public class TextMeasurer extends Object implements JRTextMeasurer
| Modifier and Type | Class and Description |
|---|---|
protected static class |
TextMeasurer.TextMeasuredState |
| Modifier and Type | Field and Description |
|---|---|
protected JasperReportsContext |
jasperReportsContext |
protected int |
leftPadding |
protected int |
maxHeight |
protected TextMeasurer.TextMeasuredState |
measuredState |
protected TextMeasurer.TextMeasuredState |
prevMeasuredState |
static String |
PROPERTY_MEASURE_SIMPLE_TEXTS |
protected int |
rightPadding |
protected JRCommonText |
textElement |
protected int |
width |
| Constructor and Description |
|---|
TextMeasurer(JasperReportsContext jasperReportsContext,
JRCommonText textElement) |
TextMeasurer(JRCommonText textElement)
Deprecated.
Replaced by
TextMeasurer(JasperReportsContext, JRCommonText). |
| Modifier and Type | Method and Description |
|---|---|
protected void |
appendTruncateSuffix(TextLineWrapper lineWrapper) |
FontRenderContext |
getFontRenderContext() |
protected JRPropertiesHolder |
getTextPropertiesHolder() |
protected String |
getTruncateSuffix() |
protected boolean |
hasParagraphIndents() |
protected void |
initialize(JRStyledText styledText,
int remainingTextStart,
int availableStretchHeight,
boolean canOverflow) |
protected boolean |
isToTruncateAtChar() |
JRMeasuredText |
measure(JRStyledText styledText,
int remainingTextStart,
int availableStretchHeight,
boolean canOverflow)
Fit a text chunk in a given space.
|
protected void |
processLastTruncatedRow(TextLineWrapper lineWrapper,
String paragraphText,
int paragraphOffset,
boolean lineTruncated) |
protected boolean |
renderNextLine(TextLineWrapper lineWrapper,
List<Integer> tabIndexes,
int[] currentTabHolder,
TabStop[] nextTabStopHolder,
boolean[] requireNextWordHolder) |
protected boolean |
renderParagraph(TextLineWrapper lineWrapper,
int lastParagraphStart,
String lastParagraphText) |
protected void |
truncateLastLineAtChar(TextLineWrapper lineWrapper,
String paragraphText,
int paragraphOffset) |
public static final String PROPERTY_MEASURE_SIMPLE_TEXTS
protected JasperReportsContext jasperReportsContext
protected JRCommonText textElement
protected int width
protected int leftPadding
protected int rightPadding
protected int maxHeight
protected TextMeasurer.TextMeasuredState measuredState
protected TextMeasurer.TextMeasuredState prevMeasuredState
public TextMeasurer(JasperReportsContext jasperReportsContext, JRCommonText textElement)
public TextMeasurer(JRCommonText textElement)
TextMeasurer(JasperReportsContext, JRCommonText).protected void initialize(JRStyledText styledText, int remainingTextStart, int availableStretchHeight, boolean canOverflow)
public JRMeasuredText measure(JRStyledText styledText, int remainingTextStart, int availableStretchHeight, boolean canOverflow)
JRTextMeasurermeasure in interface JRTextMeasurerstyledText - the full textremainingTextStart - the start index of the remaining textavailableStretchHeight - the available stretch heightcanOverflow - whether the text element is able to overflowprotected boolean hasParagraphIndents()
protected boolean renderParagraph(TextLineWrapper lineWrapper, int lastParagraphStart, String lastParagraphText)
protected void processLastTruncatedRow(TextLineWrapper lineWrapper, String paragraphText, int paragraphOffset, boolean lineTruncated)
protected void truncateLastLineAtChar(TextLineWrapper lineWrapper, String paragraphText, int paragraphOffset)
protected void appendTruncateSuffix(TextLineWrapper lineWrapper)
protected boolean isToTruncateAtChar()
protected String getTruncateSuffix()
protected boolean renderNextLine(TextLineWrapper lineWrapper, List<Integer> tabIndexes, int[] currentTabHolder, TabStop[] nextTabStopHolder, boolean[] requireNextWordHolder)
protected JRPropertiesHolder getTextPropertiesHolder()
public FontRenderContext getFontRenderContext()
Copyright © 2014. All rights reserved.