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
- Author:
- Teodor Danciu (teodord@users.sourceforge.net)
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
protected final JRLineBox
protected final JRParagraph
protected final boolean
protected JRLineBox
protected JRParagraph
static final String
static final String
static final String
static final String
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
ConstructorsModifierConstructorDescriptionprotected
JRFillTextElement
(JRBaseFiller filler, JRTextElement textElement, JRFillObjectFactory factory) protected
JRFillTextElement
(JRFillTextElement textElement, JRFillCloneFactory factory) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract boolean
protected void
chopTextElement
(int availableStretchHeight) protected int
protected void
protected void
evaluateStyle
(byte evaluation) float
float
Gets the text horizontal alignment.protected float
protected short[]
protected float
Returns the text markup.getMode()
Returns the element transparency mode.Gets the text own rotation.protected JRLineBox
protected JRParagraph
protected JRStyledText
protected String
Gets the text rotation.protected JRStyledText
protected Map
<AttributedCharacterIterator.Attribute, Object> protected int
protected float
protected int
protected String
float
Gets the text vertical alignment.boolean
isBold()
protected boolean
protected boolean
boolean
isItalic()
boolean
boolean
boolean
protected boolean
protected boolean
prepare
(int availableHeight, boolean isOverflow, boolean isOverflowAllowed) protected String
processMarkupText
(String text) void
reset()
protected void
void
rewind()
protected float
protected abstract boolean
protected void
setAverageCharWidth
(float averageCharWidth) void
Alternative setBold method which allows also to reset the "own" isBold property.protected void
setCutParagraph
(boolean isCutParagraph) void
setFontName
(String fontName) void
setFontSize
(Float size) void
setHeight
(int height) void
setHorizontalTextAlign
(HorizontalTextAlignEnum horizontalAlignment) Sets the text horizontal alignment.void
Alternative setItalic method which allows also to reset the "own" isItalic property.protected void
setLeadingOffset
(float leadingOffset) protected void
setLineBreakOffsets
(short[] lineBreakOffsets) protected void
setLineSpacingFactor
(float lineSpacingFactor) void
void
setPdfEmbedded
(Boolean isPdfEmbedded) Alternative setPdfEmbedded method which allows also to reset the "own" isPdfEmbedded property.void
setPdfEncoding
(String pdfEncoding) void
setPdfFontName
(String pdfFontName) protected void
setPrintText
(JRPrintText printText) protected void
setPrintText
(JRPrintText printText, String text) protected void
setRawText
(String rawText) void
setRotation
(RotationEnum rotation) Sets the text rotation.void
setStrikeThrough
(Boolean isStrikeThrough) Alternative setStrikeThrough method which allows also to reset the "own" isStrikeThrough property.protected void
setTextEnd
(int textEnd) protected void
setTextHeight
(float textHeight) protected void
setTextStart
(int textStart) protected void
setTextTruncateSuffix
(String textTruncateSuffix) protected void
setTextWidth
(float textWidth) void
setUnderline
(Boolean isUnderline) Alternative setUnderline method which allows also to reset the "own" isUnderline property.void
setVerticalTextAlign
(VerticalTextAlignEnum verticalAlignment) Gets the text vertical alignment.void
setWidth
(int width) Methods inherited from class net.sf.jasperreports.engine.fill.JRFillElement
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, getEvaluationTime, getField, getFiller, getForecolor, getGroupElements, getHeight, getInitStyle, getKey, getOwnBackcolor, getOwnForecolor, getOwnMode, getParent, getParentProperties, getPositionType, getPrepareHeight, getPrintWhenExpression, getPrintWhenGroupChanges, getPropertiesMap, getPropertyExpressions, getRelativeY, getStretchHeight, getStretchType, 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, 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, getKey, getOwnBackcolor, getOwnForecolor, getOwnMode, getWidth, setBackcolor, setForecolor, setMode
Methods inherited from interface net.sf.jasperreports.engine.JRElement
clone, collectExpressions, getElementGroup, getPositionType, getPrintWhenExpression, getPrintWhenGroupChanges, getPropertyExpressions, getStretchType, 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, getStyleName, getStyleNameReference
Methods inherited from interface net.sf.jasperreports.engine.JRVisitable
visit
-
Field Details
-
EXCEPTION_MESSAGE_KEY_INVALID_START_INDEX
- See Also:
-
PROPERTY_CONSUME_SPACE_ON_OVERFLOW
- See Also:
-
PROPERTY_SCALE_FONT_STEP_LIMIT
- See Also:
-
PROPERTY_CUT_TEXT_MAX_HEIGHT
- See Also:
-
PROPERTY_LEGACY_TEXT_MEASURING
- See Also:
-
initLineBox
-
initParagraph
-
lineBox
-
paragraph
-
keepAverageCharWidth
protected final boolean keepAverageCharWidth
-
-
Constructor Details
-
JRFillTextElement
protected JRFillTextElement(JRBaseFiller filler, JRTextElement textElement, JRFillObjectFactory factory) -
JRFillTextElement
-
-
Method Details
-
ensureTextMeasurer
protected void ensureTextMeasurer() -
evaluateStyle
- Overrides:
evaluateStyle
in classJRFillElement
- Throws:
JRException
-
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 interfaceJRCommonElement
- Overrides:
getMode
in classJRFillElement
-
getHorizontalTextAlign
Description copied from interface:JRTextAlignment
Gets the text horizontal alignment.- Specified by:
getHorizontalTextAlign
in interfaceJRTextAlignment
- Returns:
- a value representing one of the horizontal text alignment constants in
HorizontalTextAlignEnum
-
getOwnHorizontalTextAlign
- Specified by:
getOwnHorizontalTextAlign
in interfaceJRTextAlignment
-
setHorizontalTextAlign
Description copied from interface:JRTextAlignment
Sets the text horizontal alignment.- Specified by:
setHorizontalTextAlign
in interfaceJRTextAlignment
- Parameters:
horizontalAlignment
- a value representing one of the horizontal text alignment constants inHorizontalTextAlignEnum
-
getVerticalTextAlign
Description copied from interface:JRTextAlignment
Gets the text vertical alignment.- Specified by:
getVerticalTextAlign
in interfaceJRTextAlignment
- Returns:
- a value representing one of the vertical text alignment constants in
VerticalTextAlignEnum
-
getOwnVerticalTextAlign
- Specified by:
getOwnVerticalTextAlign
in interfaceJRTextAlignment
-
setVerticalTextAlign
Description copied from interface:JRTextAlignment
Gets the text vertical alignment.- Specified by:
setVerticalTextAlign
in interfaceJRTextAlignment
- Parameters:
verticalAlignment
- a value representing one of the vertical text alignment constants inVerticalTextAlignEnum
-
getRotation
Description copied from interface:JRCommonText
Gets the text rotation.- Specified by:
getRotation
in interfaceJRCommonText
- Returns:
- a value representing one of the text rotation constants in
RotationEnum
-
getOwnRotation
Description copied from interface:JRCommonText
Gets the text own rotation.- Specified by:
getOwnRotation
in interfaceJRCommonText
- Returns:
- a value representing one of the text rotation constants in
RotationEnum
-
setRotation
Description copied from interface:JRCommonText
Sets the text rotation.- Specified by:
setRotation
in interfaceJRCommonText
- Parameters:
rotation
- a value representing one of the text rotation constants inRotationEnum
-
getMarkup
Description copied from interface:JRCommonText
Returns the text markup.- Specified by:
getMarkup
in interfaceJRCommonText
-
getOwnMarkup
- Specified by:
getOwnMarkup
in interfaceJRCommonText
-
setMarkup
- Specified by:
setMarkup
in interfaceJRCommonText
-
getPrintLineBox
-
getLineBox
- Specified by:
getLineBox
in interfaceJRBoxContainer
-
getPrintParagraph
-
getParagraph
- Specified by:
getParagraph
in interfaceJRParagraphContainer
-
getStyledTextAttributes
-
getLineSpacingFactor
protected float getLineSpacingFactor() -
setLineSpacingFactor
protected void setLineSpacingFactor(float lineSpacingFactor) -
getLeadingOffset
protected float getLeadingOffset() -
setLeadingOffset
protected void setLeadingOffset(float leadingOffset) -
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
-
setRawText
-
reset
public void reset()- Overrides:
reset
in classJRFillElement
-
rewind
public void rewind()- Specified by:
rewind
in classJRFillElement
-
getStyledText
-
getProcessedStyledText
-
getTextString
-
prepare
protected boolean prepare(int availableHeight, boolean isOverflow, boolean isOverflowAllowed) throws JRException - Overrides:
prepare
in classJRFillElement
- Throws:
JRException
-
chopTextElement
protected void chopTextElement(int availableStretchHeight) -
isConsumeSpaceOnOverflow
protected boolean isConsumeSpaceOnOverflow() -
canOverflow
protected abstract boolean canOverflow() -
scaleFontToFit
protected abstract boolean scaleFontToFit() -
getFontName
- Specified by:
getFontName
in interfaceJRFont
-
getOwnFontName
- Specified by:
getOwnFontName
in interfaceJRFont
-
setFontName
- Specified by:
setFontName
in interfaceJRFont
-
isBold
public boolean isBold() -
isOwnBold
-
setBold
Alternative setBold method which allows also to reset the "own" isBold property. -
isItalic
public boolean isItalic() -
isOwnItalic
- Specified by:
isOwnItalic
in interfaceJRFont
-
setItalic
Alternative setItalic method which allows also to reset the "own" isItalic property. -
isUnderline
public boolean isUnderline()- Specified by:
isUnderline
in interfaceJRFont
-
isOwnUnderline
- Specified by:
isOwnUnderline
in interfaceJRFont
-
setUnderline
Alternative setUnderline method which allows also to reset the "own" isUnderline property.- Specified by:
setUnderline
in interfaceJRFont
-
isStrikeThrough
public boolean isStrikeThrough()- Specified by:
isStrikeThrough
in interfaceJRFont
-
isOwnStrikeThrough
- Specified by:
isOwnStrikeThrough
in interfaceJRFont
-
setStrikeThrough
Alternative setStrikeThrough method which allows also to reset the "own" isStrikeThrough property.- Specified by:
setStrikeThrough
in interfaceJRFont
-
getFontSize
public float getFontSize()- Specified by:
getFontSize
in interfaceJRCommonText
- Specified by:
getFontSize
in interfaceJRFont
-
getOwnFontSize
- Specified by:
getOwnFontSize
in interfaceJRFont
-
setFontSize
- Specified by:
setFontSize
in interfaceJRFont
-
getPdfFontName
- Specified by:
getPdfFontName
in interfaceJRFont
-
getOwnPdfFontName
- Specified by:
getOwnPdfFontName
in interfaceJRFont
-
setPdfFontName
- Specified by:
setPdfFontName
in interfaceJRFont
-
getPdfEncoding
- Specified by:
getPdfEncoding
in interfaceJRFont
-
getOwnPdfEncoding
- Specified by:
getOwnPdfEncoding
in interfaceJRFont
-
setPdfEncoding
- Specified by:
setPdfEncoding
in interfaceJRFont
-
isPdfEmbedded
public boolean isPdfEmbedded()- Specified by:
isPdfEmbedded
in interfaceJRFont
-
isOwnPdfEmbedded
- Specified by:
isOwnPdfEmbedded
in interfaceJRFont
-
setPdfEmbedded
Alternative setPdfEmbedded method which allows also to reset the "own" isPdfEmbedded property.- Specified by:
setPdfEmbedded
in interfaceJRFont
-
getDefaultLineColor
- Specified by:
getDefaultLineColor
in interfaceJRBoxContainer
-
setHeight
public void setHeight(int height) - Overrides:
setHeight
in classJRFillElement
-
setWidth
public void setWidth(int width) - Specified by:
setWidth
in interfaceJRElement
- Overrides:
setWidth
in classJRFillElement
-
processMarkupText
-
setPrintText
-
keepFullText
protected boolean keepFullText() -
scaleFontStepLimit
protected float scaleFontStepLimit() -
cutTextMaxHeight
protected int cutTextMaxHeight() -
setPrintText
-
getTextTruncateSuffix
-
setTextTruncateSuffix
-