Class JRFillTextElement

java.lang.Object
net.sf.jasperreports.engine.fill.JRFillElement
net.sf.jasperreports.engine.fill.JRFillTextElement
All Implemented Interfaces:
Cloneable, DynamicPropertiesHolder, JRFillCloneable, JRBoxContainer, JRChild, JRCloneable, JRCommonElement, JRCommonText, JRElement, JRFont, JRIdentifiable, JRParagraphContainer, JRPropertiesHolder, JRStyleContainer, JRStyleSetter, JRTextAlignment, JRTextElement, JRVisitable
Direct Known Subclasses:
JRFillStaticText, JRFillTextField

public abstract class JRFillTextElement extends JRFillElement implements JRTextElement
Author:
Teodor Danciu (teodord@users.sourceforge.net)
  • Field Details

    • EXCEPTION_MESSAGE_KEY_INVALID_START_INDEX

      public static final String EXCEPTION_MESSAGE_KEY_INVALID_START_INDEX
      See Also:
    • PROPERTY_CONSUME_SPACE_ON_OVERFLOW

      public static final String PROPERTY_CONSUME_SPACE_ON_OVERFLOW
      See Also:
    • PROPERTY_SCALE_FONT_STEP_LIMIT

      public static final String PROPERTY_SCALE_FONT_STEP_LIMIT
      See Also:
    • PROPERTY_CUT_TEXT_MAX_HEIGHT

      public static final String PROPERTY_CUT_TEXT_MAX_HEIGHT
      See Also:
    • PROPERTY_LEGACY_TEXT_MEASURING

      public static final String PROPERTY_LEGACY_TEXT_MEASURING
      See Also:
    • initLineBox

      protected final JRLineBox initLineBox
    • initParagraph

      protected final JRParagraph initParagraph
    • lineBox

      protected JRLineBox lineBox
    • paragraph

      protected JRParagraph paragraph
    • keepAverageCharWidth

      protected final boolean keepAverageCharWidth
  • Constructor Details

  • Method Details

    • ensureTextMeasurer

      protected void ensureTextMeasurer()
    • evaluateStyle

      protected void evaluateStyle(byte evaluation) throws JRException
      Overrides:
      evaluateStyle in class JRFillElement
      Throws:
      JRException
    • getMode

      public ModeEnum getMode()
      Description copied from interface: JRCommonElement
      Returns the element transparency mode. The default value depends on the type of the report element. Graphic elements like rectangles and lines are opaque by default, but the images are transparent. Both static texts and text fields are transparent by default, and so are the subreport elements.
      Specified by:
      getMode in interface JRCommonElement
      Overrides:
      getMode in class JRFillElement
    • getHorizontalTextAlign

      public HorizontalTextAlignEnum getHorizontalTextAlign()
      Description copied from interface: JRTextAlignment
      Gets the text horizontal alignment.
      Specified by:
      getHorizontalTextAlign in interface JRTextAlignment
      Returns:
      a value representing one of the horizontal text alignment constants in HorizontalTextAlignEnum
    • getOwnHorizontalTextAlign

      public HorizontalTextAlignEnum getOwnHorizontalTextAlign()
      Specified by:
      getOwnHorizontalTextAlign in interface JRTextAlignment
    • setHorizontalTextAlign

      public void setHorizontalTextAlign(HorizontalTextAlignEnum horizontalAlignment)
      Description copied from interface: JRTextAlignment
      Sets the text horizontal alignment.
      Specified by:
      setHorizontalTextAlign in interface JRTextAlignment
      Parameters:
      horizontalAlignment - a value representing one of the horizontal text alignment constants in HorizontalTextAlignEnum
    • getVerticalTextAlign

      public VerticalTextAlignEnum getVerticalTextAlign()
      Description copied from interface: JRTextAlignment
      Gets the text vertical alignment.
      Specified by:
      getVerticalTextAlign in interface JRTextAlignment
      Returns:
      a value representing one of the vertical text alignment constants in VerticalTextAlignEnum
    • getOwnVerticalTextAlign

      public VerticalTextAlignEnum getOwnVerticalTextAlign()
      Specified by:
      getOwnVerticalTextAlign in interface JRTextAlignment
    • setVerticalTextAlign

      public void setVerticalTextAlign(VerticalTextAlignEnum verticalAlignment)
      Description copied from interface: JRTextAlignment
      Gets the text vertical alignment.
      Specified by:
      setVerticalTextAlign in interface JRTextAlignment
      Parameters:
      verticalAlignment - a value representing one of the vertical text alignment constants in VerticalTextAlignEnum
    • getRotation

      public RotationEnum getRotation()
      Description copied from interface: JRCommonText
      Gets the text rotation.
      Specified by:
      getRotation in interface JRCommonText
      Returns:
      a value representing one of the text rotation constants in RotationEnum
    • getOwnRotation

      public RotationEnum getOwnRotation()
      Description copied from interface: JRCommonText
      Gets the text own rotation.
      Specified by:
      getOwnRotation in interface JRCommonText
      Returns:
      a value representing one of the text rotation constants in RotationEnum
    • setRotation

      public void setRotation(RotationEnum rotation)
      Description copied from interface: JRCommonText
      Sets the text rotation.
      Specified by:
      setRotation in interface JRCommonText
      Parameters:
      rotation - a value representing one of the text rotation constants in RotationEnum
    • getMarkup

      public String getMarkup()
      Description copied from interface: JRCommonText
      Returns the text markup.
      Specified by:
      getMarkup in interface JRCommonText
    • getOwnMarkup

      public String getOwnMarkup()
      Specified by:
      getOwnMarkup in interface JRCommonText
    • setMarkup

      public void setMarkup(String markup)
      Specified by:
      setMarkup in interface JRCommonText
    • getPrintLineBox

      protected JRLineBox getPrintLineBox()
    • getLineBox

      public JRLineBox getLineBox()
      Specified by:
      getLineBox in interface JRBoxContainer
    • getPrintParagraph

      protected JRParagraph getPrintParagraph()
    • getParagraph

      public JRParagraph getParagraph()
      Specified by:
      getParagraph in interface JRParagraphContainer
    • getStyledTextAttributes

      protected Map<AttributedCharacterIterator.Attribute,Object> getStyledTextAttributes()
    • getLineSpacingFactor

      protected float getLineSpacingFactor()
    • setLineSpacingFactor

      protected void setLineSpacingFactor(float lineSpacingFactor)
    • getLeadingOffset

      protected float getLeadingOffset()
    • setLeadingOffset

      protected void setLeadingOffset(float leadingOffset)
    • getRunDirection

      public RunDirectionEnum getRunDirection()
    • getTextWidth

      public float getTextWidth()
    • setTextWidth

      protected void setTextWidth(float textWidth)
    • getAverageCharWidth

      public float getAverageCharWidth()
    • setAverageCharWidth

      protected void setAverageCharWidth(float averageCharWidth)
    • getTextHeight

      protected float getTextHeight()
    • setTextHeight

      protected void setTextHeight(float textHeight)
    • getTextStart

      protected int getTextStart()
    • setTextStart

      protected void setTextStart(int textStart)
    • getTextEnd

      protected int getTextEnd()
    • setTextEnd

      protected void setTextEnd(int textEnd)
    • isCutParagraph

      protected boolean isCutParagraph()
    • setCutParagraph

      protected void setCutParagraph(boolean isCutParagraph)
    • getLineBreakOffsets

      protected short[] getLineBreakOffsets()
    • setLineBreakOffsets

      protected void setLineBreakOffsets(short[] lineBreakOffsets)
    • resetTextChunk

      protected void resetTextChunk()
    • getRawText

      protected String getRawText()
    • setRawText

      protected void setRawText(String rawText)
    • reset

      public void reset()
      Overrides:
      reset in class JRFillElement
    • rewind

      public void rewind()
      Specified by:
      rewind in class JRFillElement
    • getStyledText

      protected JRStyledText getStyledText()
    • getProcessedStyledText

      protected JRStyledText getProcessedStyledText()
    • getTextString

      public String getTextString()
    • prepare

      protected boolean prepare(int availableHeight, boolean isOverflow, boolean isOverflowAllowed) throws JRException
      Overrides:
      prepare in class JRFillElement
      Throws:
      JRException
    • chopTextElement

      protected void chopTextElement(int availableStretchHeight)
    • isConsumeSpaceOnOverflow

      protected boolean isConsumeSpaceOnOverflow()
    • canOverflow

      protected abstract boolean canOverflow()
    • scaleFontToFit

      protected abstract boolean scaleFontToFit()
    • getFontName

      public String getFontName()
      Specified by:
      getFontName in interface JRFont
    • getOwnFontName

      public String getOwnFontName()
      Specified by:
      getOwnFontName in interface JRFont
    • setFontName

      public void setFontName(String fontName)
      Specified by:
      setFontName in interface JRFont
    • isBold

      public boolean isBold()
      Specified by:
      isBold in interface JRFont
    • isOwnBold

      public Boolean isOwnBold()
      Specified by:
      isOwnBold in interface JRFont
    • setBold

      public void setBold(Boolean isBold)
      Alternative setBold method which allows also to reset the "own" isBold property.
      Specified by:
      setBold in interface JRFont
    • isItalic

      public boolean isItalic()
      Specified by:
      isItalic in interface JRFont
    • isOwnItalic

      public Boolean isOwnItalic()
      Specified by:
      isOwnItalic in interface JRFont
    • setItalic

      public void setItalic(Boolean isItalic)
      Alternative setItalic method which allows also to reset the "own" isItalic property.
      Specified by:
      setItalic in interface JRFont
    • isUnderline

      public boolean isUnderline()
      Specified by:
      isUnderline in interface JRFont
    • isOwnUnderline

      public Boolean isOwnUnderline()
      Specified by:
      isOwnUnderline in interface JRFont
    • setUnderline

      public void setUnderline(Boolean isUnderline)
      Alternative setUnderline method which allows also to reset the "own" isUnderline property.
      Specified by:
      setUnderline in interface JRFont
    • isStrikeThrough

      public boolean isStrikeThrough()
      Specified by:
      isStrikeThrough in interface JRFont
    • isOwnStrikeThrough

      public Boolean isOwnStrikeThrough()
      Specified by:
      isOwnStrikeThrough in interface JRFont
    • setStrikeThrough

      public void setStrikeThrough(Boolean isStrikeThrough)
      Alternative setStrikeThrough method which allows also to reset the "own" isStrikeThrough property.
      Specified by:
      setStrikeThrough in interface JRFont
    • getFontSize

      public float getFontSize()
      Specified by:
      getFontSize in interface JRCommonText
      Specified by:
      getFontSize in interface JRFont
    • getOwnFontSize

      public Float getOwnFontSize()
      Specified by:
      getOwnFontSize in interface JRFont
    • setFontSize

      public void setFontSize(Float size)
      Specified by:
      setFontSize in interface JRFont
    • getPdfFontName

      public String getPdfFontName()
      Specified by:
      getPdfFontName in interface JRFont
    • getOwnPdfFontName

      public String getOwnPdfFontName()
      Specified by:
      getOwnPdfFontName in interface JRFont
    • setPdfFontName

      public void setPdfFontName(String pdfFontName)
      Specified by:
      setPdfFontName in interface JRFont
    • getPdfEncoding

      public String getPdfEncoding()
      Specified by:
      getPdfEncoding in interface JRFont
    • getOwnPdfEncoding

      public String getOwnPdfEncoding()
      Specified by:
      getOwnPdfEncoding in interface JRFont
    • setPdfEncoding

      public void setPdfEncoding(String pdfEncoding)
      Specified by:
      setPdfEncoding in interface JRFont
    • isPdfEmbedded

      public boolean isPdfEmbedded()
      Specified by:
      isPdfEmbedded in interface JRFont
    • isOwnPdfEmbedded

      public Boolean isOwnPdfEmbedded()
      Specified by:
      isOwnPdfEmbedded in interface JRFont
    • setPdfEmbedded

      public void setPdfEmbedded(Boolean isPdfEmbedded)
      Alternative setPdfEmbedded method which allows also to reset the "own" isPdfEmbedded property.
      Specified by:
      setPdfEmbedded in interface JRFont
    • getDefaultLineColor

      public Color getDefaultLineColor()
      Specified by:
      getDefaultLineColor in interface JRBoxContainer
    • setHeight

      public void setHeight(int height)
      Overrides:
      setHeight in class JRFillElement
    • setWidth

      public void setWidth(int width)
      Specified by:
      setWidth in interface JRElement
      Overrides:
      setWidth in class JRFillElement
    • processMarkupText

      protected String processMarkupText(String text)
    • setPrintText

      protected void setPrintText(JRPrintText printText)
    • keepFullText

      protected boolean keepFullText()
    • scaleFontStepLimit

      protected float scaleFontStepLimit()
    • cutTextMaxHeight

      protected int cutTextMaxHeight()
    • setPrintText

      protected void setPrintText(JRPrintText printText, String text)
    • getTextTruncateSuffix

      protected String getTextTruncateSuffix()
    • setTextTruncateSuffix

      protected void setTextTruncateSuffix(String textTruncateSuffix)