Package org.apache.fop.area.inline
Class TextArea
- All Implemented Interfaces:
Serializable,Cloneable
- Direct Known Subclasses:
ResolvedPageNumber,UnresolvedPageNumber
A text inline area.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.fop.area.inline.AbstractTextArea
AbstractTextArea.TextAdjustingInfoNested classes/interfaces inherited from class org.apache.fop.area.inline.InlineArea
InlineArea.InlineAdjustingInfo -
Field Summary
Fields inherited from class org.apache.fop.area.inline.InlineParent
autoSize, inlines, minChildOffsetFields inherited from class org.apache.fop.area.inline.InlineArea
adjustingInfo, blockProgressionOffsetFields inherited from class org.apache.fop.area.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 org.apache.fop.area.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.intgetText()Get the whole text string.booleanReturnstrueif the last word in this area is hyphenated.voidRemove the old textvoidRecords that the last word in this text area is hyphenated.toString()voidupdateLevel(int newLevel) Methods inherited from class org.apache.fop.area.inline.AbstractTextArea
applyVariationFactor, getBaselineOffset, getTextLetterSpaceAdjust, getTextWordSpaceAdjust, setBaselineOffset, setSpaceDifference, setTextLetterSpaceAdjust, setTextWordSpaceAdjustMethods inherited from class org.apache.fop.area.inline.InlineParent
addChildArea, collectInlineRuns, getChildAreas, resetChildrenLevel, setFromFootnoteMethods inherited from class org.apache.fop.area.inline.InlineArea
getAdjustingInfo, getBlockProgressionOffset, getParentArea, handleIPDVariation, hasLineThrough, hasOverline, hasUnderline, increaseIPD, isAncestor, isAncestorOrSelf, isBlinking, notifyIPDVariation, setAdjustingInfo, setAdjustingInfo, setAdjustment, setBlockProgressionOffset, setParentAreaMethods inherited from class org.apache.fop.area.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, setWritingModeTraitsMethods inherited from class org.apache.fop.area.AreaTreeObject
addExtensionAttachment, getExtensionAttachments, getForeignAttributes, getForeignAttributeValue, hasExtensionAttachments, setExtensionAttachments, setForeignAttribute, setForeignAttributes
-
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) -
getEffectiveIPD
public int getEffectiveIPD()- Overrides:
getEffectiveIPDin classArea
-