Package net.sf.jasperreports.engine.fill
Class SimpleTextLineWrapper
- java.lang.Object
-
- net.sf.jasperreports.engine.fill.SimpleTextLineWrapper
-
- All Implemented Interfaces:
TextLineWrapper
public class SimpleTextLineWrapper extends Object implements TextLineWrapper
- Author:
- Lucian Chirita (lucianc@users.sourceforge.net)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classSimpleTextLineWrapper.ElementFontInfoprotected static classSimpleTextLineWrapper.FontInfoprotected static classSimpleTextLineWrapper.FontKeyprotected static classSimpleTextLineWrapper.FontStatistics
-
Field Summary
Fields Modifier and Type Field Description protected static StringFILL_CACHE_KEY_ELEMENT_FONT_INFOSprotected static StringFILL_CACHE_KEY_GENERAL_FONT_INFOSprotected static intFONT_MIN_COUNTprotected static doubleFONT_SIZE_MIN_FACTORprotected static doubleFONT_WIDTH_CHECK_FACTORstatic StringMEASURE_EXACT_ALWAYSstatic StringMEASURE_EXACT_MULTILINEprotected static intNEXT_BREAK_INDEX_THRESHOLDstatic StringPROPERTY_ELEMENT_CACHE_SIZEstatic StringPROPERTY_MEASURE_EXACT
-
Constructor Summary
Constructors Constructor Description SimpleTextLineWrapper()SimpleTextLineWrapper(SimpleTextLineWrapper parent)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TextLinebaseTextLine(int index)charcharAt(int index)protected HashMap<Pair<UUID,SimpleTextLineWrapper.FontKey>,SimpleTextLineWrapper.ElementFontInfo>createElementFontInfosFillCache()protected voidcreateFontInfo(Map<AttributedCharacterIterator.Attribute,Object> textAttributes)protected booleandetermineComplexLayout(Font font)protected floatdetermineLeading(Font font)protected intestimateBreakIndex(float width, int endLimit)protected SimpleTextLineWrapper.FontInfogetGeneralFontInfo(Map<AttributedCharacterIterator.Attribute,Object> textAttributes)StringgetLineText(int start, int end)protected booleanhasComplexLayout(char[] chars)voidinit(TextMeasureContext context)protected booleanisLeftToRight(char[] chars)protected booleanisParagraphMeasureExact(char[] chars)TextLineWrapperlastLineWrapper(String lineText, int start, int textLength, boolean truncateAtChar)protected FontloadFont(Map<AttributedCharacterIterator.Attribute,Object> textAttributes)floatmaxFontsize(int start, int end)protected TextLinemeasureExactLine(float width, int endLimit, boolean requireWord)protected intmeasureExactLineBreakIndex(float width, int endLimit, boolean requireWord)protected TextLinemeasureLine(float width, boolean requireWord, int endLimit)protected Rectangle2DmeasureParagraphFragment(int measureIndex)TextLinenextLine(float width, int endLimit, boolean requireWord)intparagraphEnd()intparagraphPosition()booleanstart(JRStyledText styledText)voidstartEmptyParagraph(int paragraphStart)voidstartParagraph(int paragraphStart, int paragraphEnd, boolean truncateAtChar)protected voidstartParagraph(String text, int start, boolean truncateAtChar)protected TextLinetoTextLine(int measureIndex, Rectangle2D measuredBounds)protected booleanuseExactLineMeasurement()
-
-
-
Field Detail
-
PROPERTY_MEASURE_EXACT
public static final String PROPERTY_MEASURE_EXACT
- See Also:
- Constant Field Values
-
PROPERTY_ELEMENT_CACHE_SIZE
public static final String PROPERTY_ELEMENT_CACHE_SIZE
- See Also:
- Constant Field Values
-
MEASURE_EXACT_ALWAYS
public static final String MEASURE_EXACT_ALWAYS
- See Also:
- Constant Field Values
-
MEASURE_EXACT_MULTILINE
public static final String MEASURE_EXACT_MULTILINE
- See Also:
- Constant Field Values
-
FONT_MIN_COUNT
protected static final int FONT_MIN_COUNT
- See Also:
- Constant Field Values
-
FONT_SIZE_MIN_FACTOR
protected static final double FONT_SIZE_MIN_FACTOR
- See Also:
- Constant Field Values
-
FONT_WIDTH_CHECK_FACTOR
protected static final double FONT_WIDTH_CHECK_FACTOR
- See Also:
- Constant Field Values
-
NEXT_BREAK_INDEX_THRESHOLD
protected static final int NEXT_BREAK_INDEX_THRESHOLD
- See Also:
- Constant Field Values
-
FILL_CACHE_KEY_ELEMENT_FONT_INFOS
protected static final String FILL_CACHE_KEY_ELEMENT_FONT_INFOS
-
FILL_CACHE_KEY_GENERAL_FONT_INFOS
protected static final String FILL_CACHE_KEY_GENERAL_FONT_INFOS
-
-
Constructor Detail
-
SimpleTextLineWrapper
public SimpleTextLineWrapper()
-
SimpleTextLineWrapper
public SimpleTextLineWrapper(SimpleTextLineWrapper parent)
-
-
Method Detail
-
init
public void init(TextMeasureContext context)
- Specified by:
initin interfaceTextLineWrapper
-
start
public boolean start(JRStyledText styledText)
- Specified by:
startin interfaceTextLineWrapper
-
createFontInfo
protected void createFontInfo(Map<AttributedCharacterIterator.Attribute,Object> textAttributes)
-
createElementFontInfosFillCache
protected HashMap<Pair<UUID,SimpleTextLineWrapper.FontKey>,SimpleTextLineWrapper.ElementFontInfo> createElementFontInfosFillCache()
-
getGeneralFontInfo
protected SimpleTextLineWrapper.FontInfo getGeneralFontInfo(Map<AttributedCharacterIterator.Attribute,Object> textAttributes)
-
loadFont
protected Font loadFont(Map<AttributedCharacterIterator.Attribute,Object> textAttributes)
-
determineComplexLayout
protected boolean determineComplexLayout(Font font)
-
determineLeading
protected float determineLeading(Font font)
-
startParagraph
public void startParagraph(int paragraphStart, int paragraphEnd, boolean truncateAtChar)- Specified by:
startParagraphin interfaceTextLineWrapper
-
startEmptyParagraph
public void startEmptyParagraph(int paragraphStart)
- Specified by:
startEmptyParagraphin interfaceTextLineWrapper
-
startParagraph
protected void startParagraph(String text, int start, boolean truncateAtChar)
-
isLeftToRight
protected boolean isLeftToRight(char[] chars)
-
isParagraphMeasureExact
protected boolean isParagraphMeasureExact(char[] chars)
-
hasComplexLayout
protected boolean hasComplexLayout(char[] chars)
-
paragraphPosition
public int paragraphPosition()
- Specified by:
paragraphPositionin interfaceTextLineWrapper
-
paragraphEnd
public int paragraphEnd()
- Specified by:
paragraphEndin interfaceTextLineWrapper
-
nextLine
public TextLine nextLine(float width, int endLimit, boolean requireWord)
- Specified by:
nextLinein interfaceTextLineWrapper
-
useExactLineMeasurement
protected boolean useExactLineMeasurement()
-
measureExactLine
protected TextLine measureExactLine(float width, int endLimit, boolean requireWord)
-
measureExactLineBreakIndex
protected int measureExactLineBreakIndex(float width, int endLimit, boolean requireWord)
-
measureLine
protected TextLine measureLine(float width, boolean requireWord, int endLimit)
-
estimateBreakIndex
protected int estimateBreakIndex(float width, int endLimit)
-
measureParagraphFragment
protected Rectangle2D measureParagraphFragment(int measureIndex)
-
toTextLine
protected TextLine toTextLine(int measureIndex, Rectangle2D measuredBounds)
-
baseTextLine
public TextLine baseTextLine(int index)
- Specified by:
baseTextLinein interfaceTextLineWrapper
-
maxFontsize
public float maxFontsize(int start, int end)- Specified by:
maxFontsizein interfaceTextLineWrapper
-
getLineText
public String getLineText(int start, int end)
- Specified by:
getLineTextin interfaceTextLineWrapper
-
charAt
public char charAt(int index)
- Specified by:
charAtin interfaceTextLineWrapper
-
lastLineWrapper
public TextLineWrapper lastLineWrapper(String lineText, int start, int textLength, boolean truncateAtChar)
- Specified by:
lastLineWrapperin interfaceTextLineWrapper
-
-