Class TextArea
- All Implemented Interfaces:
Serializable, Cloneable
- Direct Known Subclasses:
ResolvedPageNumber, UnresolvedPageNumber
-
Nested Class Summary
Nested classes/interfaces inherited from class AbstractTextArea
AbstractTextArea.TextAdjustingInfoNested classes/interfaces inherited from class InlineArea
InlineArea.InlineAdjustingInfo -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanprivate static final longFields inherited from class InlineParent
autoSize, inlines, minChildOffsetFields inherited from class InlineArea
adjustingInfo, blockProgressionOffsetFields inherited from class Area
bidiLevel, bpd, CLASS_ABSOLUTE, CLASS_BEFORE_FLOAT, CLASS_FIXED, CLASS_FOOTNOTE, CLASS_MAX, CLASS_NORMAL, CLASS_SIDE_FLOAT, effectiveIPD, ipd, log, ORIENT_0, ORIENT_180, ORIENT_270, ORIENT_90, traitsFields inherited from class AreaTreeObject
extensionAttachments, foreignAttributes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddSpace(char space, int ipd, boolean adjustable, int blockProgressionOffset, int level) Create and add a SpaceArea child to this TextAreavoidCreate and add a WordArea child to this TextArea.voidCreate and add a WordArea child to this TextArea.voidaddWord(String word, int ipd, int[] letterAdjust, int[] levels, int[][] gposAdjustments, int blockProgressionOffset) voidaddWord(String word, int ipd, int[] letterAdjust, int[] levels, int[][] gposAdjustments, int blockProgressionOffset, boolean nextIsSpace) Create and add a WordArea child to this TextArea.private static intfindMinLevel(int[] levels, int defaultLevel) intgetText()Get the whole text string.booleanReturnstrueif the last word in this area is hyphenated.private int[]makeLevels(int level, int count) voidRemove the old textvoidRecords that the last word in this text area is hyphenated.toString()voidupdateLevel(int newLevel) Methods inherited from class AbstractTextArea
applyVariationFactor, getBaselineOffset, getTextLetterSpaceAdjust, getTextWordSpaceAdjust, getVirtualBPD, getVirtualOffset, setBaselineOffset, setSpaceDifference, setTextLetterSpaceAdjust, setTextWordSpaceAdjustMethods inherited from class InlineParent
addChildArea, collectInlineRuns, getChildAreas, resetChildrenLevel, setFromFootnoteMethods inherited from class InlineArea
getAdjustingInfo, getBlockProgressionOffset, getParentArea, handleIPDVariation, hasLineThrough, hasOverline, hasUnderline, increaseIPD, isAncestor, isAncestorOrSelf, isBlinking, notifyIPDVariation, setAdjustingInfo, setAdjustingInfo, setAdjustment, setBlockProgressionOffset, setParentAreaMethods inherited from class Area
activateEffectiveIPD, addTrait, clone, getAllocBPD, getAllocIPD, getAreaClass, getBidiLevel, getBorderAndPaddingWidthAfter, getBorderAndPaddingWidthBefore, getBorderAndPaddingWidthEnd, getBorderAndPaddingWidthStart, getBPD, getChangeBarList, getEffectiveAllocIPD, getIPD, getSpaceAfter, getSpaceBefore, getSpaceEnd, getSpaceStart, getTrait, getTraitAsBoolean, getTraitAsInteger, getTraits, hasTrait, hasTraits, isFromFootnote, resetBidiLevel, setAreaClass, setBidiLevel, setBPD, setChangeBarList, setIPD, setTraits, setWritingModeTraits
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
isHyphenated
private boolean isHyphenated
-
-
Constructor Details
-
TextArea
public TextArea()Create a text inline area -
TextArea
public TextArea(int stretch, int shrink, int adj) Constructor with extra parameters: create a TextAdjustingInfo object- Parameters:
stretch- the available stretch of the textshrink- the available shrink of the textadj- the current total adjustment
-
-
Method Details
-
removeText
public void removeText()Remove the old text -
addWord
Create and add a WordArea child to this TextArea.- Parameters:
word- the word stringoffset- the offset for the next area
-
addWord
Create and add a WordArea child to this TextArea.- Parameters:
word- the word stringoffset- the offset for the next arealevel- bidirectional level that applies to entire word
-
addWord
public void addWord(String word, int ipd, int[] letterAdjust, int[] levels, int[][] gposAdjustments, int blockProgressionOffset, boolean nextIsSpace) Create and add a WordArea child to this TextArea.- Parameters:
word- the word stringipd- the word's ipdletterAdjust- the letter adjustment array (may be null)levels- array of resolved bidirectional levels of word characters, or null if default levelgposAdjustments- array of general position adjustments or null if none applyblockProgressionOffset- the offset for the next area
-
addWord
public void addWord(String word, int ipd, int[] letterAdjust, int[] levels, int[][] gposAdjustments, int blockProgressionOffset) -
addSpace
public void addSpace(char space, int ipd, boolean adjustable, int blockProgressionOffset, int level) Create and add a SpaceArea child to this TextArea- Parameters:
space- the space characteripd- the space's ipdadjustable- is this space adjustable?blockProgressionOffset- the offset for the next arealevel- resolved bidirection level of space character
-
setHyphenated
public void setHyphenated()Records that the last word in this text area is hyphenated. -
isHyphenated
public boolean isHyphenated()Returnstrueif the last word in this area is hyphenated. -
getText
Get the whole text string. Renderers whose space adjustment handling is not affected by multi-byte characters can use this method to render the whole TextArea at once; the other renderers (for example PDFRenderer) have to implement renderWord(WordArea) and renderSpace(SpaceArea) in order to correctly place each text fragment.- Returns:
- the text string
-
toString
-
updateLevel
public void updateLevel(int newLevel) -
findMinLevel
private static int findMinLevel(int[] levels, int defaultLevel) -
makeLevels
private int[] makeLevels(int level, int count) -
getEffectiveIPD
public int getEffectiveIPD()- Overrides:
getEffectiveIPDin classArea
-