Class AbstractTextRenderer

java.lang.Object
net.sf.jasperreports.engine.export.AbstractTextRenderer
Direct Known Subclasses:
AbstractPdfTextRenderer, AwtTextRenderer

public abstract class AbstractTextRenderer extends Object
Author:
Teodor Danciu (teodord@users.sourceforge.net)
  • Field Details

    • LINE_BREAK_FONT_RENDER_CONTEXT

      public static final FontRenderContext LINE_BREAK_FONT_RENDER_CONTEXT
    • jasperReportsContext

      protected final JasperReportsContext jasperReportsContext
    • propUtil

      protected final JRPropertiesUtil propUtil
    • fontUtil

      protected final FontUtil fontUtil
    • text

      protected JRPrintText text
    • styledText

      protected JRStyledText styledText
    • allText

      protected String allText
    • x

      protected int x
    • y

      protected int y
    • width

      protected int width
    • height

      protected int height
    • topPadding

      protected int topPadding
    • leftPadding

      protected int leftPadding
    • bottomPadding

      protected int bottomPadding
    • rightPadding

      protected int rightPadding
    • verticalAlignOffset

      protected float verticalAlignOffset
    • drawPosY

      protected float drawPosY
    • drawPosX

      protected float drawPosX
    • lineHeight

      protected float lineHeight
    • isMaxHeightReached

      protected boolean isMaxHeightReached
    • isFirstParagraph

      protected boolean isFirstParagraph
    • isLastParagraph

      protected boolean isLastParagraph
    • segments

    • segmentIndex

      protected int segmentIndex
    • indentFirstLine

      protected boolean indentFirstLine
    • justifyLastLine

      protected boolean justifyLastLine
    • htmlListIndent

      protected int htmlListIndent
    • bulletText

      protected String bulletText
    • bulletChunk

      protected AttributedString bulletChunk
    • ignoreMissingFont

      protected final boolean ignoreMissingFont
  • Constructor Details

    • AbstractTextRenderer

      public AbstractTextRenderer(JasperReportsContext jasperReportsContext, boolean isMinimizePrinterJobSize, boolean ignoreMissingFont, boolean defaultIndentFirstLine, boolean defaultJustifyLastLine)
  • Method Details

    • getX

      public int getX()
    • getY

      public int getY()
    • getWidth

      public int getWidth()
    • getHeight

      public int getHeight()
    • getTopPadding

      public int getTopPadding()
    • getLeftPadding

      public int getLeftPadding()
    • getBottomPadding

      public int getBottomPadding()
    • getRightPadding

      public int getRightPadding()
    • getStyledText

      public JRStyledText getStyledText()
    • getPlainText

      public String getPlainText()
    • initialize

      public void initialize(JRPrintText text, JRStyledText styledText, int offsetX, int offsetY)
    • render

      public void render()
    • getListWriter

      protected StyledTextListWriter getListWriter()
    • renderParagraph

      protected void renderParagraph(AttributedCharacterIterator allParagraphs, int paragraphStart, String paragraphText)
    • getAttributedString

      protected AttributedString getAttributedString()
    • draw

      public abstract void draw()
    • getLineHeight

      public static float getLineHeight(boolean isFirstLine, JRParagraph paragraph, float maxLeading, float maxAscent)
    • getFontRenderContext

      public FontRenderContext getFontRenderContext()
      public static float getLineHeight(JRParagraph paragraph, float lineSpacingFactor, int maxFontSize) { float lineHeight = 0; switch(paragraph.getLineSpacing()) { case SINGLE: case ONE_AND_HALF: case DOUBLE: case PROPORTIONAL: { lineHeight = lineSpacingFactor * maxFontSize; break; } case AT_LEAST: { lineHeight = Math.max(lineSpacingFactor * maxFontSize, paragraph.getLineSpacingSize()); break; } case FIXED: { lineHeight = paragraph.getLineSpacingSize(); break; } default : { throw new JRRuntimeException("Invalid line space type: " + paragraph.getLineSpacing()); } } return lineHeight; } /**