Java 类net.sf.jasperreports.engine.fill.JRTemplateGenericPrintElement 实例源码

项目:dynamicreports-jasper    文件:GeoMapFillComponent.java   
@Override
public JRPrintElement fill() {
    JRComponentElement element = fillContext.getComponentElement();
    JRTemplateGenericElement template = new JRTemplateGenericElement(fillContext.getElementOrigin(),
            fillContext.getDefaultStyleProvider(), GeoMapPrintElement.GEOMAP_ELEMENT_TYPE);

    JRTemplateGenericPrintElement printElement = new JRTemplateGenericPrintElement(template, printElementOriginator);
    printElement.setX(element.getX());
    printElement.setY(fillContext.getElementPrintY());
    printElement.setWidth(element.getWidth());
    printElement.setHeight(element.getHeight());

    if (isEvaluateNow()) {
        copy(printElement);
    } else {
        fillContext.registerDelayedEvaluation(printElement, geoMapComponent.getEvaluationTime(), geoMapComponent.getEvaluationGroup());
    }

    return printElement;
}
项目:jasperreports-wms-component    文件:WmsMapFillComponent.java   
@Override
public JRPrintElement fill() {
  JRComponentElement element = fillContext.getComponentElement();
  JRTemplateGenericElement template = new JRTemplateGenericElement(
      fillContext.getElementOrigin(),
      fillContext.getDefaultStyleProvider(),
      WmsMapPrintElement.WMS_MAP_ELEMENT_TYPE);
  template = deduplicate(template);

  JRTemplateGenericPrintElement printElement = new JRTemplateGenericPrintElement(
      template, elementId);
  printElement.setUUID(element.getUUID());
  printElement.setX(element.getX());
  printElement.setY(fillContext.getElementPrintY());
  printElement.setWidth(element.getWidth());
  printElement.setHeight(element.getHeight());

  if (isEvaluateNow()) {
    copy(printElement);
  } else {
    fillContext.registerDelayedEvaluation(printElement,
        mapComponent.getEvaluationTime(), mapComponent.getEvaluationGroup());
  }

  return printElement;
}
项目:jasperreports    文件:FillPieChart.java   
public JRPrintElement fill()
{
    JRComponentElement element = fillContext.getComponentElement();
    JRTemplateGenericElement template = new JRTemplateGenericElement(
            fillContext.getElementOrigin(), 
            fillContext.getDefaultStyleProvider(),
            CHART_PRINT_TYPE);

    JRTemplateGenericPrintElement printElement = new JRTemplateGenericPrintElement(
            template, printElementOriginator);
    printElement.setX(element.getX());
    printElement.setY(fillContext.getElementPrintY());
    printElement.setWidth(element.getWidth());
    printElement.setHeight(element.getHeight());

    if (isEvaluateNow())
    {
        copy(printElement);
    }
    else
    {
        fillContext.registerDelayedEvaluation(printElement, 
                chart.getEvaluationTime(), chart.getEvaluationGroup());
    }

    return printElement;
}
项目:jasperreports    文件:FillBarChart.java   
public JRPrintElement fill()
{
    JRComponentElement element = fillContext.getComponentElement();
    JRTemplateGenericElement template = new JRTemplateGenericElement(
            fillContext.getElementOrigin(), 
            fillContext.getDefaultStyleProvider(),
            CHART_PRINT_TYPE);

    JRTemplateGenericPrintElement printElement = new JRTemplateGenericPrintElement(
            template, printElementOriginator);
    printElement.setX(element.getX());
    printElement.setY(fillContext.getElementPrintY());
    printElement.setWidth(element.getWidth());
    printElement.setHeight(element.getHeight());

    if (isEvaluateNow())
    {
        copy(printElement);
    }
    else
    {
        fillContext.registerDelayedEvaluation(printElement, 
                chart.getEvaluationTime(), chart.getEvaluationGroup());
    }

    return printElement;
}
项目:jasperreports    文件:HtmlComponentFill.java   
private Dimension computeSizeOfPrintElement(JRTemplateGenericPrintElement printElement) {
    HtmlPrintElement htmlPrintElement = null; 
    try{
        htmlPrintElement = HtmlPrintElementUtils.getHtmlPrintElement();
    } catch (JRException e) {
        throw new JRRuntimeException(e);
    }
    return htmlPrintElement.getComputedSize(printElement);
}
项目:jasperreports    文件:MapFillComponent.java   
@Override
public JRPrintElement fill()
{
    JRComponentElement element = fillContext.getComponentElement();
    JRTemplateGenericElement template = new JRTemplateGenericElement(
            fillContext.getElementOrigin(), 
            fillContext.getDefaultStyleProvider(),
            MapComponent.MAP_ELEMENT_TYPE);
    template = deduplicate(template);
    JRTemplateGenericPrintElement printElement = new JRTemplateGenericPrintElement(template, printElementOriginator);
    printElement.setUUID(element.getUUID());
    printElement.setX(element.getX());
    printElement.setY(fillContext.getElementPrintY());
    printElement.setWidth(element.getWidth());
    printElement.setHeight(element.getHeight());

    if (isEvaluateNow())
    {
        copy(printElement);
    }
    else
    {
        fillContext.registerDelayedEvaluation(printElement, 
                mapComponent.getEvaluationTime(), mapComponent.getEvaluationGroup());
    }

    return printElement;
}
项目:jasperreports    文件:GenericElementTest.java   
protected JRTemplateGenericPrintElement genericElement()
{
    JRTemplateGenericElement template = genericTemplate();
    JRTemplateGenericPrintElement element = new JRTemplateGenericPrintElement(template, new DefaultPrintElementOriginator(12));
    setElement(element);
    return element;
}
项目:jasperreports    文件:GenericElementTest.java   
protected void setElement(JRTemplateGenericPrintElement element)
{
    element.setUUID(UUID.randomUUID());
    element.setX(10);
    element.setY(20);
    element.setWidth(50);
    element.setHeight(30);

    element.setParameterValue("a", 13);
    element.setParameterValue("b", "y");
}
项目:dynamicreports-jasper    文件:MapTest.java   
@Override
public void test() {
    super.test();

    numberOfPagesTest(1);

    JRTemplateGenericPrintElement map = (JRTemplateGenericPrintElement) getJasperPrint().getPages().get(0).getElements().get(0);
    Assert.assertEquals("latitude", map.getParameterValue("latitude"), 40.7f);
    Assert.assertEquals("longitude", map.getParameterValue("longitude"), -74f);
    Assert.assertEquals("zoom", map.getParameterValue("zoom"), 12);
}
项目:jasperreports    文件:DefaultSerializerRegistry.java   
public DefaultSerializerRegistry()
{
    classSerializers = new HashMap<Class<?>, ObjectSerializer<?>>();
    typeSerializers = new HashMap<Integer, ObjectSerializer<?>>();

    addSerializer(String.class, new StringSerializer());
    addSerializer(UUID.class, new UUIDSerializer());
    addSerializer(Byte.class, new ByteSerializer());
    addSerializer(Short.class, new ShortSerializer());
    addSerializer(Integer.class, new IntegerSerializer());
    addSerializer(Long.class, new LongSerializer());
    addSerializer(Boolean.class, new BooleanSerializer());
    addSerializer(Float.class, new FloatSerializer());
    addSerializer(Double.class, new DoubleSerializer());
    addSerializer(BigInteger.class, new BigIntegerSerializer());
    addSerializer(BigDecimal.class, new BigDecimalSerializer(new BigIntegerSerializer()));
    addSerializer(Date.class, new DateSerializer());
    addSerializer(java.sql.Date.class, new SqlDateSerializer());
    addSerializer(Time.class, new TimeSerializer());
    addSerializer(Timestamp.class, new TimestampSerializer());

    addSerializableType(VirtualElementsData.class, SerializationConstants.OBJECT_TYPE_ELEMENTS_DATA);
    addSerializableType(JRTemplatePrintElement.class, SerializationConstants.OBJECT_TYPE_TEMPLATE_ELEMENT);
    addSerializableType(JRTemplatePrintFrame.class, SerializationConstants.OBJECT_TYPE_TEMPLATE_FRAME);
    addSerializableType(JRTemplatePrintText.class, SerializationConstants.OBJECT_TYPE_TEMPLATE_TEXT);
    addSerializableType(JRRecordedValuesPrintText.class, SerializationConstants.OBJECT_TYPE_TEMPLATE_TEXT_RECORDED_VALUES);
    addSerializableType(JRTemplatePrintGraphicElement.class, SerializationConstants.OBJECT_TYPE_TEMPLATE_GRAPHIC);
    addSerializableType(JRTemplatePrintImage.class, SerializationConstants.OBJECT_TYPE_TEMPLATE_IMAGE);
    addSerializableType(JRRecordedValuesPrintImage.class, SerializationConstants.OBJECT_TYPE_TEMPLATE_IMAGE_RECORDED_VALUES);
    addSerializableType(JRTemplatePrintLine.class, SerializationConstants.OBJECT_TYPE_TEMPLATE_LINE);
    addSerializableType(JRTemplatePrintRectangle.class, SerializationConstants.OBJECT_TYPE_TEMPLATE_RECTANGLE);
    addSerializableType(JRTemplatePrintEllipse.class, SerializationConstants.OBJECT_TYPE_TEMPLATE_ELLIPSE);
    addSerializableType(JRTemplateGenericPrintElement.class, SerializationConstants.OBJECT_TYPE_TEMPLATE_GENERIC);
    addSerializableType(JRRecordedValuesGenericPrintElement.class, SerializationConstants.OBJECT_TYPE_TEMPLATE_GENERIC_RECORDED_VALUES);

    addSerializableType(JRPrintHyperlinkParameters.class, SerializationConstants.OBJECT_TYPE_HYPERLINK_PARAMETERS);
    addSerializableType(JRPrintHyperlinkParameter.class, SerializationConstants.OBJECT_TYPE_HYPERLINK_PARAMETER);

    addSerializer(JREvaluationTime.class, new EvaluationTimeSerializer());
    addSerializer(JRRecordedValues.class, new RecordedValuesSerializer());
}
项目:jasperreports    文件:GenericElementTest.java   
@Test
public void basicElement()
{
    JRTemplateGenericPrintElement element = genericElement();
    compareSerialized(element);
}