net.sf.jasperreports.engine.fill
Class TextMeasurer

java.lang.Object
  extended by 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 3202 2009-11-19 13:08:37Z teodord $
Author:
Teodor Danciu (teodord@users.sourceforge.net)

Nested Class Summary
protected static class TextMeasurer.TextMeasuredState
           
 
Constructor Summary
TextMeasurer(JRCommonText textElement)
           
 
Method Summary
protected  void appendTruncateSuffix(java.text.AttributedCharacterIterator allParagraphs)
           
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)
           
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 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
 

Constructor Detail

TextMeasurer

public TextMeasurer(JRCommonText textElement)
Method Detail

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 text
remainingTextStart - the start index of the remaining text
availableStretchHeight - the available stretch height
canOverflow - 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)

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 attributes,
                             int startIndex,
                             int endIndex)


© 2001-2009 Jaspersoft Corporation www.jaspersoft.com