Package net.sf.jasperreports.engine

Examples of net.sf.jasperreports.engine.JRPrintText


  /**
   *
   */
  public Object createObject(Attributes atts)
  {
    JRPrintText element = (JRPrintText) digester.peek();
    JRPrintXmlLoader printXmlLoader = (JRPrintXmlLoader)digester.peek(digester.getCount() - 1);
    JasperPrint jasperPrint = (JasperPrint)digester.peek(digester.getCount() - 2);

    if (atts.getValue(JRXmlConstants.ATTRIBUTE_reportFont) != null)
    {
      Map fontsMap = jasperPrint.getFontsMap();

      if ( !fontsMap.containsKey(atts.getValue(JRXmlConstants.ATTRIBUTE_reportFont)) )
      {
        printXmlLoader.addError(new JRRuntimeException("Unknown report font : " + atts.getValue(JRXmlConstants.ATTRIBUTE_reportFont)));
      }

      element.setReportFont((JRReportFont)fontsMap.get(atts.getValue(JRXmlConstants.ATTRIBUTE_reportFont)));
    }

    if (atts.getValue(JRXmlConstants.ATTRIBUTE_fontName) != null)
    {
      element.setFontName(atts.getValue(JRXmlConstants.ATTRIBUTE_fontName));
    }
    if (atts.getValue(JRXmlConstants.ATTRIBUTE_isBold) != null)
    {
      element.setBold(Boolean.valueOf(atts.getValue(JRXmlConstants.ATTRIBUTE_isBold)));
    }
    if (atts.getValue(JRXmlConstants.ATTRIBUTE_isItalic) != null)
    {
      element.setItalic(Boolean.valueOf(atts.getValue(JRXmlConstants.ATTRIBUTE_isItalic)));
    }
    if (atts.getValue(JRXmlConstants.ATTRIBUTE_isUnderline) != null)
    {
      element.setUnderline(Boolean.valueOf(atts.getValue(JRXmlConstants.ATTRIBUTE_isUnderline)));
    }
    if (atts.getValue(JRXmlConstants.ATTRIBUTE_isStrikeThrough) != null)
    {
      element.setStrikeThrough(Boolean.valueOf(atts.getValue(JRXmlConstants.ATTRIBUTE_isStrikeThrough)));
    }
    if (atts.getValue(JRXmlConstants.ATTRIBUTE_size) != null)
    {
      element.setFontSize(Integer.parseInt(atts.getValue(JRXmlConstants.ATTRIBUTE_size)));
    }
    if (atts.getValue(JRXmlConstants.ATTRIBUTE_pdfFontName) != null)
    {
      element.setPdfFontName(atts.getValue(JRXmlConstants.ATTRIBUTE_pdfFontName));
    }
    if (atts.getValue(JRXmlConstants.ATTRIBUTE_pdfEncoding) != null)
    {
      element.setPdfEncoding(atts.getValue(JRXmlConstants.ATTRIBUTE_pdfEncoding));
    }
    if (atts.getValue(JRXmlConstants.ATTRIBUTE_isPdfEmbedded) != null)
    {
      element.setPdfEmbedded(Boolean.valueOf(atts.getValue(JRXmlConstants.ATTRIBUTE_isPdfEmbedded)));
    }
    return element;
  }
View Full Code Here


    for (int i = 0; i < elements.size(); ++i)
    {
      Object element = elements.get(i);
      if (element instanceof JRPrintText)
      {
        JRPrintText textElement = (JRPrintText) element;
       
        if (textElement.getPropertiesMap().getPropertyNames().length > 0)
        {
          String currentColumnName = textElement.getPropertiesMap().getProperty(JRCsvMetadataExporterParameter.PROPERTY_COLUMN_NAME);
          String currentColumnData = textElement.getPropertiesMap().getProperty(JRCsvMetadataExporterParameter.PROPERTY_DATA);
          boolean repeatValue = JRProperties.getBooleanProperty(textElement, JRCsvMetadataExporterParameter.PROPERTY_REPEAT_VALUE, false);
         
          if (currentColumnData != null)
          {
            currentTextValue = currentColumnData;
View Full Code Here

//      borderHelper.export(((JRCommonGraphicElement)element).getLinePen());
   
    JRAlignment align = element instanceof JRAlignment ? (JRAlignment)element : null;
    if (align != null)
    {
      JRPrintText text = element instanceof JRPrintText ? (JRPrintText)element : null;
      RotationEnum ownRotation = text == null ? null : text.getOwnRotationValue();
     
      String verticalAlignment =
        getVerticalAlignment(
          align.getOwnVerticalAlignmentValue()
          );
View Full Code Here

  /**
   *
   */
  public void exportProps(JRStyle style, Locale locale)
  {
    JRPrintText text = new JRBasePrintText(null);
    text.setStyle(style);
    Map styledTextAttributes = new HashMap();
    JRFontUtil.getAttributesWithoutAwtFont(styledTextAttributes, text);
    styledTextAttributes.put(TextAttribute.FOREGROUND, text.getForecolor());
    if (style.getModeValue() == null || style.getModeValue() == ModeEnum.OPAQUE)
    {
      styledTextAttributes.put(TextAttribute.BACKGROUND, style.getBackcolor());
    }

View Full Code Here

  /**
   *
   */
  private Map getAttributes(JRStyle style)//FIXMEDOCX put this in util?
  {
    JRPrintText text = new JRBasePrintText(null);
    text.setStyle(style);
   
    Map styledTextAttributes = new HashMap();
    //JRFontUtil.getAttributes(styledTextAttributes, text, (Locale)null);//FIXMEDOCX getLocale());
    JRFontUtil.getAttributesWithoutAwtFont(styledTextAttributes, text);
    styledTextAttributes.put(TextAttribute.FOREGROUND, text.getForecolor());
    if (text.getModeValue() == ModeEnum.OPAQUE)
    {
      styledTextAttributes.put(TextAttribute.BACKGROUND, text.getBackcolor());
    }

    return styledTextAttributes;
  }
View Full Code Here

  /**
   *
   */
  public void exportProps(JRStyle style, Locale locale)
  {
    JRPrintText text = new JRBasePrintText(null);
    text.setStyle(style);
    Map styledTextAttributes = new HashMap(); //FIXMEPPTX is this map useless; check all run helpers
    JRFontUtil.getAttributesWithoutAwtFont(styledTextAttributes, text);
    styledTextAttributes.put(TextAttribute.FOREGROUND, text.getForecolor());
    if (style.getModeValue() == null || style.getModeValue() == ModeEnum.OPAQUE)
    {
      styledTextAttributes.put(TextAttribute.BACKGROUND, style.getBackcolor());
    }

View Full Code Here

  /**
   *
   */
  private Map getAttributes(JRStyle style)//FIXMEDOCX put this in util?
  {
    JRPrintText text = new JRBasePrintText(null);
    text.setStyle(style);
   
    Map styledTextAttributes = new HashMap();
    //JRFontUtil.getAttributes(styledTextAttributes, text, (Locale)null);//FIXMEDOCX getLocale());
    JRFontUtil.getAttributesWithoutAwtFont(styledTextAttributes, text);
    styledTextAttributes.put(TextAttribute.FOREGROUND, text.getForecolor());
    if (text.getModeValue() == ModeEnum.OPAQUE)
    {
      styledTextAttributes.put(TextAttribute.BACKGROUND, text.getBackcolor());
    }

    return styledTextAttributes;
  }
View Full Code Here

    JRExporterContext exporterContext,
    JRGenericPrintElement element,
    JRExporterGridCell gridCell
    )
  {
    JRPrintText text = getTextElementReplacement(exporterContext, element);

    JRExporterGridCell newGridCell =
      new ElementGridCell(
        new ElementWrapper(null, text, null),
        gridCell.getWidth(),
        gridCell.getHeight(),
        gridCell.getColSpan(),
        gridCell.getRowSpan()
        );
   
    newGridCell.setBox(text.getLineBox());
   
    return newGridCell;
  }
View Full Code Here

    JRGenericPrintElement element
    )
  {
    JRPptxExporter exporter = (JRPptxExporter)exporterContext.getExporter();
   
    JRPrintText text = getTextElementReplacement(exporterContext, element);
   
    exporter.exportText(text);
  }
View Full Code Here

    JRGenericPrintElement element
    )
  {
    JRRtfExporter exporter = (JRRtfExporter)exporterContext.getExporter();
   
    JRPrintText text = getTextElementReplacement(exporterContext, element);
   
    try
    {
      exporter.exportText(text);
    }
View Full Code Here

TOP

Related Classes of net.sf.jasperreports.engine.JRPrintText

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.