Examples of JRStyledText


Examples of net.sf.jasperreports.engine.util.JRStyledText

   
    if (text == null)
    {
      text = "";
    }
    JRStyledText styledText =
      JRStyledTextParser.getInstance().getStyledText(
        JRStyledTextAttributeSelector.NO_BACKCOLOR.getStyledTextAttributes(printText),
        text,
        JRCommonText.MARKUP_STYLED_TEXT.equals(printText.getMarkup()),//FIXMEMARKUP only static styled text appears on preview. no other markup
        JRStyledTextAttributeSelector.getTextLocale(printText)
View Full Code Here

Examples of net.sf.jasperreports.engine.util.JRStyledText

  {
    PdfTextRenderer textRenderer = new PdfTextRenderer(false);//FIXMETAB optimize this
   
    textRenderer.initialize(this, pdfContentByte, text, getOffsetX(), getOffsetY());
   
    JRStyledText styledText = textRenderer.getStyledText();

    if (styledText == null)
    {
      return;
    }

    int xFillCorrection = 0;
    int yFillCorrection = 0;
    double angle = 0;

    switch (text.getRotationValue())
    {
      case LEFT :
      {
        xFillCorrection = 1;
        angle = Math.PI / 2;
        break;
      }
      case RIGHT :
      {
        yFillCorrection = -1;
        angle = - Math.PI / 2;
        break;
      }
      case UPSIDE_DOWN :
      {
        angle = Math.PI;
        break;
      }
      case NONE :
      default :
      {
      }
    }

    AffineTransform atrans = new AffineTransform();
    atrans.rotate(angle, textRenderer.getX(), jasperPrint.getPageHeight() - textRenderer.getY());
    pdfContentByte.transform(atrans);

    if (text.getModeValue() == ModeEnum.OPAQUE)
    {
      Color backcolor = text.getBackcolor();
      pdfContentByte.setRGBColorFill(
        backcolor.getRed(),
        backcolor.getGreen(),
        backcolor.getBlue()
        );
      pdfContentByte.rectangle(
        textRenderer.getX() + xFillCorrection,
        jasperPrint.getPageHeight() - textRenderer.getY() + yFillCorrection,
        textRenderer.getWidth(),
        - textRenderer.getHeight()
        );
      pdfContentByte.fill();
    }

    if (styledText.length() > 0)
    {
      tagHelper.startText();
     
      /*   */
      textRenderer.render();
 
View Full Code Here

Examples of net.sf.jasperreports.engine.util.JRStyledText

  /**
   *
   */
  public String getText()
  {
    JRStyledText tmpStyledText = getStyledText();

    if (tmpStyledText == null)
    {
      return null;
    }

    return tmpStyledText.getText();
  }
View Full Code Here

Examples of net.sf.jasperreports.engine.util.JRStyledText

    int availableStretchHeight
    )
  {
    ensureTextMeasurer();
   
    JRStyledText tmpStyledText = getStyledText();

    if (tmpStyledText == null)
    {
      return;
    }

    if (getTextEnd() == tmpStyledText.getText().length())
    {
      return;
    }

    /*   */
 
View Full Code Here

Examples of net.sf.jasperreports.engine.util.JRStyledText

  protected void setPrintText(JRPrintText printText)
  {
    int startIndex = getTextStart();
    int endIndex = getTextEnd();
    JRStyledText fullStyledText = getStyledText();
    String fullText = fullStyledText.getText();
   
    boolean keepAllText = !canOverflow()
        && JRProperties.getBooleanProperty(this, JRTextElement.PROPERTY_PRINT_KEEP_FULL_TEXT, false);
    if (keepAllText)
    {
View Full Code Here

Examples of net.sf.jasperreports.engine.util.JRStyledText

      //if the text exceeds the page width, truncate the column count
      colSpan = pageWidthInChars - col;
    }

    String allText;
    JRStyledText styledText = getStyledText(element);
    if (styledText == null)
    {
      allText = "";
    }
    else
    {
      allText = styledText.getText();
    }

    // if the space is too small, the element will not be rendered
    if (rowSpan <= 0 || colSpan <= 0)
    {
View Full Code Here

Examples of net.sf.jasperreports.engine.util.JRStyledText

          {
            element = grid[y][x].getWrapper().getElement();
 
            if (element instanceof JRPrintText)
            {
              JRStyledText styledText = getStyledText((JRPrintText)element);
              if (styledText == null)
              {
                text = "";
              }
              else
              {
                text = styledText.getText();
              }
             
              if (!isFirstColumn)
              {
                rowbuffer.append(delimiter);
View Full Code Here

Examples of net.sf.jasperreports.engine.util.JRStyledText

  /**
   *
   */
  protected void exportText(JRPrintText text) throws IOException
  {
    JRStyledText styledText = getStyledText(text);

    int textLength = 0;

    if (styledText != null)
    {
      textLength = styledText.length();
    }

    if (text.getAnchorName() != null)
    {
      writer.write("<a name=\"");
View Full Code Here

Examples of net.sf.jasperreports.engine.util.JRStyledText


  protected JRStyledText getStyledText(JRPrintText textElement,
      boolean setBackcolor)
  {
    JRStyledText styledText = super.getStyledText(textElement, setBackcolor);
   
    if (styledText != null)
    {
      short[] lineBreakOffsets = textElement.getLineBreakOffsets();
      if (lineBreakOffsets != null && lineBreakOffsets.length > 0)
      {
        //insert new lines at the line break positions saved at fill time
        //cloning the text first
        styledText = styledText.cloneText();
        styledText.insert("\n", lineBreakOffsets);
      }
    }
   
    return styledText;
  }
View Full Code Here

Examples of net.sf.jasperreports.engine.util.JRStyledText

          {
            currentTextValue = currentColumnData;
           
          } else
          {
            JRStyledText styledText = getStyledText((JRPrintText)element);
           
            if (styledText != null)
            {
              currentTextValue = styledText.getText();
            } else
            {
              currentTextValue = "";
            }
          }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.