net.sf.jasperreports.engine.fill
Class TextMeasurer
java.lang.Object
net.sf.jasperreports.engine.fill.TextMeasurer
- All Implemented Interfaces:
- JRTextMeasurer
- Direct Known Subclasses:
- JdkGlyphFixTextMeasurer
public class TextMeasurer
- extends java.lang.Object
- implements JRTextMeasurer
Default text measurer implementation.
- Version:
- $Id: TextMeasurer.java 4595 2011-09-08 15:55:10Z teodord $
- Author:
- Teodor Danciu (teodord@users.sourceforge.net)
Method Summary |
protected void |
appendTruncateSuffix(java.text.AttributedCharacterIterator allParagraphs)
|
java.awt.font.FontRenderContext |
getFontRenderContext()
|
protected JRPropertiesHolder |
getTextPropertiesHolder()
|
protected java.lang.String |
getTruncateSuffix()
|
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(java.text.AttributedCharacterIterator allParagraphs,
java.lang.String paragraphText,
int paragraphOffset,
boolean lineTruncated)
|
protected boolean |
renderNextLine(java.awt.font.LineBreakMeasurer lineMeasurer,
java.text.AttributedCharacterIterator paragraph,
java.util.List<java.lang.Integer> tabIndexes,
int[] currentTabHolder,
TabStop[] nextTabStopHolder,
boolean[] requireNextWordHolder)
|
protected boolean |
renderParagraph(java.text.AttributedCharacterIterator allParagraphs,
int lastParagraphStart,
java.lang.String lastParagraphText)
|
protected void |
setAttributes(java.text.AttributedString string,
java.text.AttributedCharacterIterator attributes,
int stringOffset)
|
protected void |
setAttributes(java.text.AttributedString string,
java.util.Map<java.text.AttributedCharacterIterator.Attribute,java.lang.Object> attributes,
int startIndex,
int endIndex)
|
protected void |
truncateLastLineAtChar(java.text.AttributedCharacterIterator allParagraphs,
java.lang.String paragraphText,
int paragraphOffset)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TextMeasurer
public TextMeasurer(JRCommonText textElement)
initialize
protected void initialize(JRStyledText styledText,
int remainingTextStart,
int availableStretchHeight,
boolean canOverflow)
measure
public JRMeasuredText measure(JRStyledText styledText,
int remainingTextStart,
int availableStretchHeight,
boolean canOverflow)
- Description copied from interface:
JRTextMeasurer
- Fit a text chunk in a given space.
- Specified by:
measure
in interface JRTextMeasurer
- Parameters:
styledText
- the full textremainingTextStart
- the start index of the remaining textavailableStretchHeight
- the available stretch heightcanOverflow
- whether the text element is able to overflow
- Returns:
- text measuring information
renderParagraph
protected boolean renderParagraph(java.text.AttributedCharacterIterator allParagraphs,
int lastParagraphStart,
java.lang.String lastParagraphText)
processLastTruncatedRow
protected void processLastTruncatedRow(java.text.AttributedCharacterIterator allParagraphs,
java.lang.String paragraphText,
int paragraphOffset,
boolean lineTruncated)
truncateLastLineAtChar
protected void truncateLastLineAtChar(java.text.AttributedCharacterIterator allParagraphs,
java.lang.String paragraphText,
int paragraphOffset)
appendTruncateSuffix
protected void appendTruncateSuffix(java.text.AttributedCharacterIterator allParagraphs)
isToTruncateAtChar
protected boolean isToTruncateAtChar()
getTruncateSuffix
protected java.lang.String getTruncateSuffix()
renderNextLine
protected boolean renderNextLine(java.awt.font.LineBreakMeasurer lineMeasurer,
java.text.AttributedCharacterIterator paragraph,
java.util.List<java.lang.Integer> tabIndexes,
int[] currentTabHolder,
TabStop[] nextTabStopHolder,
boolean[] requireNextWordHolder)
getTextPropertiesHolder
protected JRPropertiesHolder getTextPropertiesHolder()
setAttributes
protected void setAttributes(java.text.AttributedString string,
java.text.AttributedCharacterIterator attributes,
int stringOffset)
setAttributes
protected void setAttributes(java.text.AttributedString string,
java.util.Map<java.text.AttributedCharacterIterator.Attribute,java.lang.Object> attributes,
int startIndex,
int endIndex)
getFontRenderContext
public java.awt.font.FontRenderContext getFontRenderContext()
© 2001-2010 Jaspersoft Corporation www.jaspersoft.com