Package net.sf.jasperreports.engine.fill
Class TextMeasurer.TextMeasuredState
- java.lang.Object
-
- net.sf.jasperreports.engine.fill.TextMeasurer.TextMeasuredState
-
- All Implemented Interfaces:
Cloneable
,JRMeasuredText
- Enclosing class:
- TextMeasurer
protected static class TextMeasurer.TextMeasuredState extends Object implements JRMeasuredText, Cloneable
-
-
Field Summary
Fields Modifier and Type Field Description protected float
averageCharWidth
protected float
firstLineLeading
protected float
firstLineMaxFontSize
protected float
fontSizeSum
protected boolean
isLeftToRight
protected boolean
isMeasured
protected boolean
isParagraphCut
protected int
lastOffset
protected ArrayList<Integer>
lineBreakOffsets
protected int
lines
protected int
spacingBefore
protected float
textHeight
protected int
textOffset
protected String
textSuffix
protected float
textWidth
-
Constructor Summary
Constructors Constructor Description TextMeasuredState(boolean saveLineBreakOffsets)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addLineBreak()
TextMeasurer.TextMeasuredState
cloneState()
float
getAverageCharWidth()
Returns the text's average character width.float
getLeadingOffset()
Returns the text leading offset.short[]
getLineBreakOffsets()
Returns the line break offsets as required forJRPrintText.getLineBreakOffsets()
.float
getLineSpacingFactor()
Return the line spacing factor for the text.float
getTextHeight()
Returns the text's measure height.int
getTextOffset()
Returns the offset up to which text fitted.String
getTextSuffix()
Returns the suffix that was appended to the text (afterJRMeasuredText.getTextOffset()
).float
getTextWidth()
Returns the text's measure width.boolean
isLeftToRight()
Returns whether the text was determined to be left to right or not.boolean
isParagraphCut()
Returns whether the text was cut during a paragraph or the last paragraph was complete.
-
-
-
Field Detail
-
textOffset
protected int textOffset
-
lines
protected int lines
-
fontSizeSum
protected float fontSizeSum
-
firstLineMaxFontSize
protected float firstLineMaxFontSize
-
spacingBefore
protected int spacingBefore
-
textWidth
protected float textWidth
-
textHeight
protected float textHeight
-
averageCharWidth
protected float averageCharWidth
-
firstLineLeading
protected float firstLineLeading
-
isLeftToRight
protected boolean isLeftToRight
-
isParagraphCut
protected boolean isParagraphCut
-
textSuffix
protected String textSuffix
-
isMeasured
protected boolean isMeasured
-
lastOffset
protected int lastOffset
-
-
Method Detail
-
isLeftToRight
public boolean isLeftToRight()
Description copied from interface:JRMeasuredText
Returns whether the text was determined to be left to right or not.- Specified by:
isLeftToRight
in interfaceJRMeasuredText
- Returns:
- whether the text was determined to be left to right
-
getTextOffset
public int getTextOffset()
Description copied from interface:JRMeasuredText
Returns the offset up to which text fitted.- Specified by:
getTextOffset
in interfaceJRMeasuredText
- Returns:
- the offset up to which text fitted
-
getTextWidth
public float getTextWidth()
Description copied from interface:JRMeasuredText
Returns the text's measure width.- Specified by:
getTextWidth
in interfaceJRMeasuredText
- Returns:
- the text's measure width
-
getAverageCharWidth
public float getAverageCharWidth()
Description copied from interface:JRMeasuredText
Returns the text's average character width.- Specified by:
getAverageCharWidth
in interfaceJRMeasuredText
- Returns:
- the text's average character width
-
getTextHeight
public float getTextHeight()
Description copied from interface:JRMeasuredText
Returns the text's measure height.- Specified by:
getTextHeight
in interfaceJRMeasuredText
- Returns:
- the text's measure height
-
getLineSpacingFactor
public float getLineSpacingFactor()
Description copied from interface:JRMeasuredText
Return the line spacing factor for the text.- Specified by:
getLineSpacingFactor
in interfaceJRMeasuredText
- Returns:
- the line spacing factor
-
getLeadingOffset
public float getLeadingOffset()
Description copied from interface:JRMeasuredText
Returns the text leading offset.- Specified by:
getLeadingOffset
in interfaceJRMeasuredText
- Returns:
- the text leading offset
-
isParagraphCut
public boolean isParagraphCut()
Description copied from interface:JRMeasuredText
Returns whether the text was cut during a paragraph or the last paragraph was complete.- Specified by:
isParagraphCut
in interfaceJRMeasuredText
- Returns:
- whether the last paragraph was cut
-
getTextSuffix
public String getTextSuffix()
Description copied from interface:JRMeasuredText
Returns the suffix that was appended to the text (afterJRMeasuredText.getTextOffset()
).- Specified by:
getTextSuffix
in interfaceJRMeasuredText
- Returns:
- the suffix that was appended to the text
-
cloneState
public TextMeasurer.TextMeasuredState cloneState()
-
addLineBreak
protected void addLineBreak()
-
getLineBreakOffsets
public short[] getLineBreakOffsets()
Description copied from interface:JRMeasuredText
Returns the line break offsets as required forJRPrintText.getLineBreakOffsets()
.- Specified by:
getLineBreakOffsets
in interfaceJRMeasuredText
- Returns:
- the line break offsets for the measured text
-
-