public class SimpleTextLineWrapper extends Object implements TextLineWrapper
| Modifier and Type | Class and Description |
|---|---|
protected static class |
SimpleTextLineWrapper.ElementFontInfo |
protected static class |
SimpleTextLineWrapper.FontInfo |
protected static class |
SimpleTextLineWrapper.FontKey |
protected static class |
SimpleTextLineWrapper.FontStatistics |
| Modifier and Type | Field and Description |
|---|---|
protected static int |
COMPEX_LAYOUT_END_CHAR |
protected static int |
COMPEX_LAYOUT_START_CHAR |
protected static String |
FILL_CACHE_KEY_ELEMENT_FONT_INFOS |
protected static String |
FILL_CACHE_KEY_GENERAL_FONT_INFOS |
protected static int |
FONT_MIN_COUNT |
protected static double |
FONT_SIZE_MIN_FACTOR |
protected static double |
FONT_WIDTH_CHECK_FACTOR |
static String |
MEASURE_EXACT_ALWAYS |
static String |
MEASURE_EXACT_MULTILINE |
protected static int |
NEXT_BREAK_INDEX_THRESHOLD |
static String |
PROPERTY_ELEMENT_CACHE_SIZE |
static String |
PROPERTY_MEASURE_EXACT |
protected static Set<Character.UnicodeBlock> |
simpleLayoutBlocks |
| Constructor and Description |
|---|
SimpleTextLineWrapper() |
SimpleTextLineWrapper(SimpleTextLineWrapper parent) |
| Modifier and Type | Method and Description |
|---|---|
TextLine |
baseTextLine(int index) |
char |
charAt(int index) |
protected HashMap<Pair<UUID,SimpleTextLineWrapper.FontKey>,SimpleTextLineWrapper.ElementFontInfo> |
createElementFontInfosFillCache() |
protected void |
createFontInfo(Map<AttributedCharacterIterator.Attribute,Object> textAttributes) |
protected boolean |
determineComplexLayout(Font font) |
protected float |
determineLeading(Font font) |
protected int |
estimateBreakIndex(float width,
int endLimit) |
protected SimpleTextLineWrapper.FontInfo |
getGeneralFontInfo(Map<AttributedCharacterIterator.Attribute,Object> textAttributes) |
String |
getLineText(int start,
int end) |
protected boolean |
hasComplexLayout(char[] chars) |
void |
init(TextMeasureContext context) |
protected boolean |
isLeftToRight(char[] chars) |
protected boolean |
isParagraphMeasureExact(char[] chars) |
TextLineWrapper |
lastLineWrapper(String lineText,
int start,
int textLength,
boolean truncateAtChar) |
protected Font |
loadFont(Map<AttributedCharacterIterator.Attribute,Object> textAttributes) |
float |
maxFontsize(int start,
int end) |
int |
maxFontSize(int start,
int end)
Deprecated.
Replaced by
maxFontsize(int, int). |
protected TextLine |
measureExactLine(float width,
int endLimit,
boolean requireWord) |
protected int |
measureExactLineBreakIndex(float width,
int endLimit,
boolean requireWord) |
protected TextLine |
measureLine(float width,
boolean requireWord,
int endLimit) |
protected Rectangle2D |
measureParagraphFragment(int measureIndex) |
TextLine |
nextLine(float width,
int endLimit,
boolean requireWord) |
int |
paragraphEnd() |
int |
paragraphPosition() |
boolean |
start(JRStyledText styledText) |
void |
startEmptyParagraph(int paragraphStart) |
void |
startParagraph(int paragraphStart,
int paragraphEnd,
boolean truncateAtChar) |
protected void |
startParagraph(String text,
int start,
boolean truncateAtChar) |
protected TextLine |
toTextLine(int measureIndex,
Rectangle2D measuredBounds) |
protected boolean |
useExactLineMeasurement() |
public static final String PROPERTY_MEASURE_EXACT
public static final String PROPERTY_ELEMENT_CACHE_SIZE
public static final String MEASURE_EXACT_ALWAYS
public static final String MEASURE_EXACT_MULTILINE
protected static final int FONT_MIN_COUNT
protected static final double FONT_SIZE_MIN_FACTOR
protected static final double FONT_WIDTH_CHECK_FACTOR
protected static final int NEXT_BREAK_INDEX_THRESHOLD
protected static final int COMPEX_LAYOUT_START_CHAR
protected static final int COMPEX_LAYOUT_END_CHAR
protected static final String FILL_CACHE_KEY_ELEMENT_FONT_INFOS
protected static final String FILL_CACHE_KEY_GENERAL_FONT_INFOS
protected static final Set<Character.UnicodeBlock> simpleLayoutBlocks
public SimpleTextLineWrapper()
public SimpleTextLineWrapper(SimpleTextLineWrapper parent)
public void init(TextMeasureContext context)
init in interface TextLineWrapperpublic boolean start(JRStyledText styledText)
start in interface TextLineWrapperprotected void createFontInfo(Map<AttributedCharacterIterator.Attribute,Object> textAttributes)
protected HashMap<Pair<UUID,SimpleTextLineWrapper.FontKey>,SimpleTextLineWrapper.ElementFontInfo> createElementFontInfosFillCache()
protected SimpleTextLineWrapper.FontInfo getGeneralFontInfo(Map<AttributedCharacterIterator.Attribute,Object> textAttributes)
protected Font loadFont(Map<AttributedCharacterIterator.Attribute,Object> textAttributes)
protected boolean determineComplexLayout(Font font)
protected float determineLeading(Font font)
public void startParagraph(int paragraphStart,
int paragraphEnd,
boolean truncateAtChar)
startParagraph in interface TextLineWrapperpublic void startEmptyParagraph(int paragraphStart)
startEmptyParagraph in interface TextLineWrapperprotected void startParagraph(String text, int start, boolean truncateAtChar)
protected boolean isLeftToRight(char[] chars)
protected boolean isParagraphMeasureExact(char[] chars)
protected boolean hasComplexLayout(char[] chars)
public int paragraphPosition()
paragraphPosition in interface TextLineWrapperpublic int paragraphEnd()
paragraphEnd in interface TextLineWrapperpublic TextLine nextLine(float width, int endLimit, boolean requireWord)
nextLine in interface TextLineWrapperprotected boolean useExactLineMeasurement()
protected TextLine measureExactLine(float width, int endLimit, boolean requireWord)
protected int measureExactLineBreakIndex(float width,
int endLimit,
boolean requireWord)
protected TextLine measureLine(float width, boolean requireWord, int endLimit)
protected int estimateBreakIndex(float width,
int endLimit)
protected Rectangle2D measureParagraphFragment(int measureIndex)
protected TextLine toTextLine(int measureIndex, Rectangle2D measuredBounds)
public TextLine baseTextLine(int index)
baseTextLine in interface TextLineWrapperpublic float maxFontsize(int start,
int end)
maxFontsize in interface TextLineWrapperpublic int maxFontSize(int start,
int end)
maxFontsize(int, int).maxFontSize in interface TextLineWrapperpublic String getLineText(int start, int end)
getLineText in interface TextLineWrapperpublic char charAt(int index)
charAt in interface TextLineWrapperpublic TextLineWrapper lastLineWrapper(String lineText, int start, int textLength, boolean truncateAtChar)
lastLineWrapper in interface TextLineWrapperCopyright © 2017. All rights reserved.