Package net.sf.jasperreports.engine.fill
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 Summary
Fields Modifier and Type Field Description static StringEXCEPTION_MESSAGE_KEY_INVALID_START_INDEXprotected JRLineBoxinitLineBoxprotected JRParagraphinitParagraphprotected JRLineBoxlineBoxprotected JRParagraphparagraphstatic StringPROPERTY_CONSUME_SPACE_ON_OVERFLOWstatic StringPROPERTY_CUT_TEXT_MAX_HEIGHTstatic StringPROPERTY_LEGACY_TEXT_MEASURINGstatic StringPROPERTY_SCALE_FONT_STEP_LIMIT-
Fields inherited from class net.sf.jasperreports.engine.fill.JRFillElement
band, conditionalStylesContainer, currentEvaluation, currentStyle, defaultPopulateTemplateStyle, defaultStyleProvider, delayedEvaluationsMap, dynamicProperties, dynamicTransferProperties, elementGroup, EXCEPTION_MESSAGE_KEY_INVALID_BOOKMARK_LEVEL, expressionEvaluator, exprStyle, fillContainerContext, filler, hasDynamicPopulateTemplateStyle, initStyle, mergedProperties, originProvider, parent, printElementOriginator, printWhenGroupChanges, propertyExpressions, providerStyle, staticProperties, staticTransferProperties, styleProviders, templates
-
Fields inherited from interface net.sf.jasperreports.engine.JRCommonText
MARKUP_HTML, MARKUP_NONE, MARKUP_RTF, MARKUP_STYLED_TEXT
-
Fields inherited from interface net.sf.jasperreports.engine.JRElement
PROPERTY_ELEMENT_TEMPLATE_POPULATE_STYLE
-
Fields inherited from interface net.sf.jasperreports.engine.JRFont
DEFAULT_FONT_NAME, DEFAULT_FONT_SIZE, DEFAULT_PDF_EMBEDDED, DEFAULT_PDF_ENCODING, DEFAULT_PDF_FONT_NAME
-
Fields inherited from interface net.sf.jasperreports.engine.JRTextElement
PROPERTY_PRINT_KEEP_FULL_TEXT, PROPERTY_SAVE_LINE_BREAKS, PROPERTY_TRUNCATE_AT_CHAR, PROPERTY_TRUNCATE_SUFFIX
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedJRFillTextElement(JRBaseFiller filler, JRTextElement textElement, JRFillObjectFactory factory)protectedJRFillTextElement(JRFillTextElement textElement, JRFillCloneFactory factory)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract booleancanOverflow()protected voidchopTextElement(int availableStretchHeight)protected intcutTextMaxHeight()protected voidensureTextMeasurer()protected voidevaluateStyle(byte evaluation)ColorgetDefaultLineColor()StringgetFontName()floatgetFontsize()HorizontalTextAlignEnumgetHorizontalTextAlign()Gets the text horizontal alignment.protected floatgetLeadingOffset()JRLineBoxgetLineBox()protected short[]getLineBreakOffsets()protected floatgetLineSpacingFactor()StringgetMarkup()Returns the text markup.ModeEnumgetModeValue()Returns the element transparency mode.StringgetOwnFontName()FloatgetOwnFontsize()HorizontalTextAlignEnumgetOwnHorizontalTextAlign()StringgetOwnMarkup()StringgetOwnPdfEncoding()StringgetOwnPdfFontName()RotationEnumgetOwnRotationValue()Gets the text own rotation.VerticalTextAlignEnumgetOwnVerticalTextAlign()JRParagraphgetParagraph()StringgetPdfEncoding()StringgetPdfFontName()protected JRLineBoxgetPrintLineBox()protected JRParagraphgetPrintParagraph()protected JRStyledTextgetProcessedStyledText()protected StringgetRawText()RotationEnumgetRotationValue()Gets the text rotation.RunDirectionEnumgetRunDirectionValue()protected JRStyledTextgetStyledText()protected Map<AttributedCharacterIterator.Attribute,Object>getStyledTextAttributes()protected intgetTextEnd()protected floatgetTextHeight()protected intgetTextStart()StringgetTextString()protected StringgetTextTruncateSuffix()floatgetTextWidth()VerticalTextAlignEnumgetVerticalTextAlign()Gets the text vertical alignment.booleanisBold()protected booleanisConsumeSpaceOnOverflow()protected booleanisCutParagraph()booleanisItalic()BooleanisOwnBold()BooleanisOwnItalic()BooleanisOwnPdfEmbedded()BooleanisOwnStrikeThrough()BooleanisOwnUnderline()booleanisPdfEmbedded()booleanisStrikeThrough()booleanisUnderline()protected booleankeepFullText()protected booleanprepare(int availableHeight, boolean isOverflow)protected StringprocessMarkupText(String text)voidreset()protected voidresetTextChunk()voidrewind()protected floatscaleFontStepLimit()protected abstract booleanscaleFontToFit()voidsetBold(Boolean isBold)Alternative setBold method which allows also to reset the "own" isBold property.protected voidsetCutParagraph(boolean isCutParagraph)voidsetFontName(String fontName)voidsetFontSize(Float size)voidsetHeight(int height)voidsetHorizontalTextAlign(HorizontalTextAlignEnum horizontalAlignment)Sets the text horizontal alignment.voidsetItalic(Boolean isItalic)Alternative setItalic method which allows also to reset the "own" isItalic property.protected voidsetLeadingOffset(float leadingOffset)protected voidsetLineBreakOffsets(short[] lineBreakOffsets)protected voidsetLineSpacingFactor(float lineSpacingFactor)voidsetMarkup(String markup)voidsetPdfEmbedded(Boolean isPdfEmbedded)Alternative setPdfEmbedded method which allows also to reset the "own" isPdfEmbedded property.voidsetPdfEncoding(String pdfEncoding)voidsetPdfFontName(String pdfFontName)protected voidsetPrintText(JRPrintText printText)protected voidsetPrintText(JRPrintText printText, String text)protected voidsetRawText(String rawText)voidsetRotation(RotationEnum rotation)Sets the text rotation.voidsetStrikeThrough(Boolean isStrikeThrough)Alternative setStrikeThrough method which allows also to reset the "own" isStrikeThrough property.protected voidsetTextEnd(int textEnd)protected voidsetTextHeight(float textHeight)protected voidsetTextStart(int textStart)protected voidsetTextTruncateSuffix(String textTruncateSuffix)protected voidsetTextWidth(float textWidth)voidsetUnderline(Boolean isUnderline)Alternative setUnderline method which allows also to reset the "own" isUnderline property.voidsetVerticalTextAlign(VerticalTextAlignEnum verticalAlignment)Gets the text vertical alignment.voidsetWidth(int width)-
Methods inherited from class net.sf.jasperreports.engine.fill.JRFillElement
_moveDependantElements, _stretchElement, _stretchElementToHeight, addDependantElement, addDynamicProperty, clone, clone, clone, collectDelayedEvaluations, collectDelayedEvaluations, collectDelayedEvaluations, collectStyleDelayedEvaluations, collectStyleProviderDelayedEvaluations, createElementTemplate, delayedEvaluate, delayedEvaluationUpdatesTemplate, evaluate, evaluateExpression, evaluatePrintWhenExpression, evaluateProperties, fill, getBackcolor, getBand, getBookmarkLevel, getCollapsedHeightAbove, getCollapsedHeightBelow, getConditionalStylesContainer, getDefaultStyleProvider, getDependantElements, getDynamicProperties, getElementGroup, getElementOrigin, getElementTemplate, getEvaluatedProperties, getEvaluationTimeValue, getField, getFiller, getForecolor, getGroupElements, getHeight, getInitStyle, getKey, getOwnBackcolor, getOwnForecolor, getOwnModeValue, getParent, getParentProperties, getPositionTypeValue, getPrepareHeight, getPrintWhenExpression, getPrintWhenGroupChanges, getPropertiesMap, getPropertyExpressions, getRelativeY, getStretchHeight, getStretchTypeValue, getStyle, getStyleExpression, getStyleNameReference, getStyleResolver, getTemplate, getTimeZone, getUUID, getVariable, getWidth, getX, getY, hasDynamicProperties, hasDynamicProperty, hasProperties, initDelayedEvaluationPrint, initDelayedEvaluations, initStyleProviders, isAlreadyPrinted, isAutoEvaluateNow, isDelayedStyleEvaluation, isEvaluateAuto, isEvaluateNow, isPrintInFirstWholeBand, isPrintRepeatedValues, isPrintWhenDetailOverflows, isPrintWhenExpressionNull, isPrintWhenTrue, isRemoveLineWhenBlank, isReprinted, isToPrint, isValueRepeating, moveDependantElements, performDelayedEvaluation, registerTemplate, resolveElement, resolveElement, setAlreadyPrinted, setBackcolor, setBand, setCollapsedHeightAbove, setCollapsedHeightBelow, setConditionalStylesContainer, setCurrentEvaluation, setExpressionEvaluator, setForecolor, setMode, setOriginProvider, setPositionType, setPrepareHeight, setPrintInFirstWholeBand, setPrintRepeatedValues, setPrintWhenDetailOverflows, setPrintWhenExpressionNull, setPrintWhenTrue, setRelativeY, setRemoveLineWhenBlank, setReprinted, setShrinkable, setStretchHeight, setStretchType, setStyle, setStyleNameReference, setToPrint, setValueRepeating, setX, setY, stretchElement, stretchElementToContainer, stretchElementToElementGroup, stretchElementToHeight, stretchHeightFinal, toPopulateTemplateStyle, transferProperties, transferProperties
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.sf.jasperreports.engine.JRCloneable
clone
-
Methods inherited from interface net.sf.jasperreports.engine.JRCommonElement
getBackcolor, getForecolor, getHeight, getOwnBackcolor, getOwnForecolor, getOwnModeValue, getWidth, setBackcolor, setForecolor, setMode
-
Methods inherited from interface net.sf.jasperreports.engine.JRElement
clone, collectExpressions, getElementGroup, getKey, getPositionTypeValue, getPrintWhenExpression, getPrintWhenGroupChanges, getPropertyExpressions, getStretchTypeValue, getStyleExpression, getX, getY, isPrintInFirstWholeBand, isPrintRepeatedValues, isPrintWhenDetailOverflows, isRemoveLineWhenBlank, setPositionType, setPrintInFirstWholeBand, setPrintRepeatedValues, setPrintWhenDetailOverflows, setRemoveLineWhenBlank, setStretchType, setX
-
Methods inherited from interface net.sf.jasperreports.engine.fill.JRFillCloneable
createClone
-
Methods inherited from interface net.sf.jasperreports.engine.JRIdentifiable
getUUID
-
Methods inherited from interface net.sf.jasperreports.engine.JRPropertiesHolder
getParentProperties, getPropertiesMap, hasProperties
-
Methods inherited from interface net.sf.jasperreports.engine.JRStyleContainer
getDefaultStyleProvider, getStyle, getStyleNameReference
-
Methods inherited from interface net.sf.jasperreports.engine.JRVisitable
visit
-
-
-
-
Field Detail
-
EXCEPTION_MESSAGE_KEY_INVALID_START_INDEX
public static final String EXCEPTION_MESSAGE_KEY_INVALID_START_INDEX
- See Also:
- Constant Field Values
-
PROPERTY_CONSUME_SPACE_ON_OVERFLOW
public static final String PROPERTY_CONSUME_SPACE_ON_OVERFLOW
- See Also:
- Constant Field Values
-
PROPERTY_SCALE_FONT_STEP_LIMIT
public static final String PROPERTY_SCALE_FONT_STEP_LIMIT
- See Also:
- Constant Field Values
-
PROPERTY_CUT_TEXT_MAX_HEIGHT
public static final String PROPERTY_CUT_TEXT_MAX_HEIGHT
- See Also:
- Constant Field Values
-
PROPERTY_LEGACY_TEXT_MEASURING
public static final String PROPERTY_LEGACY_TEXT_MEASURING
- See Also:
- Constant Field Values
-
initLineBox
protected final JRLineBox initLineBox
-
initParagraph
protected final JRParagraph initParagraph
-
lineBox
protected JRLineBox lineBox
-
paragraph
protected JRParagraph paragraph
-
-
Constructor Detail
-
JRFillTextElement
protected JRFillTextElement(JRBaseFiller filler, JRTextElement textElement, JRFillObjectFactory factory)
-
JRFillTextElement
protected JRFillTextElement(JRFillTextElement textElement, JRFillCloneFactory factory)
-
-
Method Detail
-
ensureTextMeasurer
protected void ensureTextMeasurer()
-
evaluateStyle
protected void evaluateStyle(byte evaluation) throws JRException- Overrides:
evaluateStylein classJRFillElement- Throws:
JRException
-
getModeValue
public ModeEnum getModeValue()
Description copied from interface:JRCommonElementReturns 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:
getModeValuein interfaceJRCommonElement- Overrides:
getModeValuein classJRFillElement
-
getHorizontalTextAlign
public HorizontalTextAlignEnum getHorizontalTextAlign()
Description copied from interface:JRTextAlignmentGets the text horizontal alignment.- Specified by:
getHorizontalTextAlignin interfaceJRTextAlignment- Returns:
- a value representing one of the horizontal text alignment constants in
HorizontalTextAlignEnum
-
getOwnHorizontalTextAlign
public HorizontalTextAlignEnum getOwnHorizontalTextAlign()
- Specified by:
getOwnHorizontalTextAlignin interfaceJRTextAlignment
-
setHorizontalTextAlign
public void setHorizontalTextAlign(HorizontalTextAlignEnum horizontalAlignment)
Description copied from interface:JRTextAlignmentSets the text horizontal alignment.- Specified by:
setHorizontalTextAlignin interfaceJRTextAlignment- Parameters:
horizontalAlignment- a value representing one of the horizontal text alignment constants inHorizontalTextAlignEnum
-
getVerticalTextAlign
public VerticalTextAlignEnum getVerticalTextAlign()
Description copied from interface:JRTextAlignmentGets the text vertical alignment.- Specified by:
getVerticalTextAlignin interfaceJRTextAlignment- Returns:
- a value representing one of the vertical text alignment constants in
VerticalTextAlignEnum
-
getOwnVerticalTextAlign
public VerticalTextAlignEnum getOwnVerticalTextAlign()
- Specified by:
getOwnVerticalTextAlignin interfaceJRTextAlignment
-
setVerticalTextAlign
public void setVerticalTextAlign(VerticalTextAlignEnum verticalAlignment)
Description copied from interface:JRTextAlignmentGets the text vertical alignment.- Specified by:
setVerticalTextAlignin interfaceJRTextAlignment- Parameters:
verticalAlignment- a value representing one of the vertical text alignment constants inVerticalTextAlignEnum
-
getRotationValue
public RotationEnum getRotationValue()
Description copied from interface:JRCommonTextGets the text rotation.- Specified by:
getRotationValuein interfaceJRCommonText- Returns:
- a value representing one of the text rotation constants in
RotationEnum
-
getOwnRotationValue
public RotationEnum getOwnRotationValue()
Description copied from interface:JRCommonTextGets the text own rotation.- Specified by:
getOwnRotationValuein interfaceJRCommonText- Returns:
- a value representing one of the text rotation constants in
RotationEnum
-
setRotation
public void setRotation(RotationEnum rotation)
Description copied from interface:JRCommonTextSets the text rotation.- Specified by:
setRotationin interfaceJRCommonText- Parameters:
rotation- a value representing one of the text rotation constants inRotationEnum
-
getMarkup
public String getMarkup()
Description copied from interface:JRCommonTextReturns the text markup.- Specified by:
getMarkupin interfaceJRCommonText
-
getOwnMarkup
public String getOwnMarkup()
- Specified by:
getOwnMarkupin interfaceJRCommonText
-
setMarkup
public void setMarkup(String markup)
- Specified by:
setMarkupin interfaceJRCommonText
-
getPrintLineBox
protected JRLineBox getPrintLineBox()
-
getLineBox
public JRLineBox getLineBox()
- Specified by:
getLineBoxin interfaceJRBoxContainer
-
getPrintParagraph
protected JRParagraph getPrintParagraph()
-
getParagraph
public JRParagraph getParagraph()
- Specified by:
getParagraphin interfaceJRParagraphContainer
-
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)
-
getRunDirectionValue
public RunDirectionEnum getRunDirectionValue()
-
getTextWidth
public float getTextWidth()
-
setTextWidth
protected void setTextWidth(float textWidth)
-
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:
resetin classJRFillElement
-
rewind
public void rewind()
- Specified by:
rewindin classJRFillElement
-
getStyledText
protected JRStyledText getStyledText()
-
getProcessedStyledText
protected JRStyledText getProcessedStyledText()
-
getTextString
public String getTextString()
-
prepare
protected boolean prepare(int availableHeight, boolean isOverflow) throws JRException- Overrides:
preparein classJRFillElement- 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:
getFontNamein interfaceJRFont
-
getOwnFontName
public String getOwnFontName()
- Specified by:
getOwnFontNamein interfaceJRFont
-
setFontName
public void setFontName(String fontName)
- Specified by:
setFontNamein interfaceJRFont
-
setBold
public void setBold(Boolean isBold)
Alternative setBold method which allows also to reset the "own" isBold property.
-
isOwnItalic
public Boolean isOwnItalic()
- Specified by:
isOwnItalicin interfaceJRFont
-
setItalic
public void setItalic(Boolean isItalic)
Alternative setItalic method which allows also to reset the "own" isItalic property.
-
isUnderline
public boolean isUnderline()
- Specified by:
isUnderlinein interfaceJRFont
-
isOwnUnderline
public Boolean isOwnUnderline()
- Specified by:
isOwnUnderlinein interfaceJRFont
-
setUnderline
public void setUnderline(Boolean isUnderline)
Alternative setUnderline method which allows also to reset the "own" isUnderline property.- Specified by:
setUnderlinein interfaceJRFont
-
isStrikeThrough
public boolean isStrikeThrough()
- Specified by:
isStrikeThroughin interfaceJRFont
-
isOwnStrikeThrough
public Boolean isOwnStrikeThrough()
- Specified by:
isOwnStrikeThroughin interfaceJRFont
-
setStrikeThrough
public void setStrikeThrough(Boolean isStrikeThrough)
Alternative setStrikeThrough method which allows also to reset the "own" isStrikeThrough property.- Specified by:
setStrikeThroughin interfaceJRFont
-
getFontsize
public float getFontsize()
- Specified by:
getFontsizein interfaceJRCommonText- Specified by:
getFontsizein interfaceJRFont
-
getOwnFontsize
public Float getOwnFontsize()
- Specified by:
getOwnFontsizein interfaceJRFont
-
setFontSize
public void setFontSize(Float size)
- Specified by:
setFontSizein interfaceJRFont
-
getPdfFontName
public String getPdfFontName()
- Specified by:
getPdfFontNamein interfaceJRFont
-
getOwnPdfFontName
public String getOwnPdfFontName()
- Specified by:
getOwnPdfFontNamein interfaceJRFont
-
setPdfFontName
public void setPdfFontName(String pdfFontName)
- Specified by:
setPdfFontNamein interfaceJRFont
-
getPdfEncoding
public String getPdfEncoding()
- Specified by:
getPdfEncodingin interfaceJRFont
-
getOwnPdfEncoding
public String getOwnPdfEncoding()
- Specified by:
getOwnPdfEncodingin interfaceJRFont
-
setPdfEncoding
public void setPdfEncoding(String pdfEncoding)
- Specified by:
setPdfEncodingin interfaceJRFont
-
isPdfEmbedded
public boolean isPdfEmbedded()
- Specified by:
isPdfEmbeddedin interfaceJRFont
-
isOwnPdfEmbedded
public Boolean isOwnPdfEmbedded()
- Specified by:
isOwnPdfEmbeddedin interfaceJRFont
-
setPdfEmbedded
public void setPdfEmbedded(Boolean isPdfEmbedded)
Alternative setPdfEmbedded method which allows also to reset the "own" isPdfEmbedded property.- Specified by:
setPdfEmbeddedin interfaceJRFont
-
getDefaultLineColor
public Color getDefaultLineColor()
- Specified by:
getDefaultLineColorin interfaceJRBoxContainer
-
setHeight
public void setHeight(int height)
- Overrides:
setHeightin classJRFillElement
-
setWidth
public void setWidth(int width)
- Specified by:
setWidthin interfaceJRElement- Overrides:
setWidthin classJRFillElement
-
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)
-
-