|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.foray.common.AbstractOrderedTreeNode
org.foray.area.AreaNode
org.foray.area.Area
org.foray.area.AreaFlexible
org.foray.area.AbstractInlineArea
org.foray.area.TextArea
public final class TextArea
TextArea is a convenience class whose members represent contiguous glyph-areas that have identical text-related traits. With regard to the XSL-FO AreaTree, it is not a real area: essentially each character in the TextArea represents an XSL-FO glyph-area.
TextArea does not contain a copy of the text, but only keeps pointers to the text that is in the FOTree. Its generated-by is always an FObjMixed FO, and it is "backed" by exactly one of the nodes immediately under that FObjMixed item, usually an FOText node. TextArea stores a pointer to that node, as well a record of how much of that node's text actually belongs in this area. Please note that a given FOText node may have more than one TextArea that springs from it (they would have to be in different LineAreas or use different Fonts due to overriding). However , a TextSegment always springs from exactly one FOText node.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.foray.common.AbstractOrderedTreeNode |
|---|
AbstractOrderedTreeNode.PostOrderDescendantIterator |
| Method Summary | |
|---|---|
int |
countLetterSpacingChars()
Counts the number of characters in this text that will have letter-spacing applied to them. |
int |
countSpaces()
Counts the number of space-like characters in this text that should be rendered as spaces in the output. |
boolean |
endsWithLinefeed()
Indicates whether this text-area ends with a linefeed. |
org.axsl.font.FontOptions |
fontOptions()
|
String |
getAreaName()
|
List<AreaNode> |
getChildren()
Return the List of this node's children. |
FOLinkage |
getLinkage()
Returns the raw "generated by" instance. |
Area |
getParent()
|
org.axsl.font.FontUse |
getPrimaryFont()
|
CharSequence |
getRawText()
Returns the raw text for this area. |
int |
getResolvedLetterSpacing()
Returns the resolved letter-spacing, in millipoints. |
org.axsl.font.FontUse |
getSecondaryFont(int codePoint)
|
CharSequence |
getText()
|
static int |
ignoreAtEnd(CharSequence chars,
int start,
int size,
boolean lastItemOnLine,
org.axsl.common.value.WhiteSpaceTreatment whiteSpaceTreatment)
Computes the number of characters that should be ignored at the end of this text-area. |
static int |
ignoreAtStart(CharSequence chars,
int start,
int size,
boolean firstItemOnLine,
org.axsl.common.value.WhiteSpaceTreatment whiteSpaceTreatment)
Computes the number of characters that should be ignored at the start of this text-area. |
int |
letterSpacing()
|
int |
letterSpacingUsed()
Computes the amount of space, in millipoints, that this area has already absorbed by adjusting word spacing. |
int |
maxLetterSpacingCapacity()
Computes the total amount of space (including that already used), in millipoints, that the area can absorb by expanding each space to the maximum word space specified. |
int |
maxWordSpacingCapacity()
Computes the amount of space, in millipoints, that the area can absorb by expanding each space to the maximum word space specified. |
int |
minLetterSpacingCapacity()
Computes the amount of space, in millipoints, that the area can absorb by contracting each space to the minimum word space specified. |
int |
minWordSpacingCapacity()
Computes the amount of space, in millipoints, that the area can absorb by contracting each space to the minimum word space specified. |
protected boolean |
optimize()
This method should be run after layout is complete, allowing cleanup and adjustments that do not affect the placement of the areas to be computed before the page is rendered. |
org.axsl.common.i18n.Orthography |
orthography()
|
void |
render(org.axsl.galley.RenderVisitor visitor)
|
void |
setParent(AreaNode node)
Sets the parent node. |
void |
setResolvedLetterSpacing(int resolvedLetterSpacing)
Sets the resolved letter-spacing. |
void |
setResolvedWordSpacing(int resolvedWordSpacing)
Sets the resolved word-spacing. |
int |
traitBorderAfterWidth()
Returns the border-after-width trait for this area. |
int |
traitBorderBeforeWidth()
Returns the border-before-width trait for this area. |
int |
traitBorderEndWidth()
Returns the border-end-width trait for this area. |
int |
traitBorderStartWidth()
Returns the border-start-width trait for this area. |
Color |
traitColor()
|
int |
traitFontSize()
Overrides the Area method because it needs to handle faux-small-caps. |
org.axsl.fo.fo.CharacterSequence |
traitGeneratedBy()
|
int |
traitHyphenationCharacter()
Returns the hyphenation-character trait for this area. |
int |
traitIPDimensionOpt()
Return the optimum IP dimension for this area. |
int |
traitLetterSpacingMax()
Returns the letter-spacing maximum trait. |
int |
traitLetterSpacingMin()
Returns the letter-spacing minimum trait. |
int |
traitLetterSpacingOpt()
Returns the letter-spacing optimum trait. |
boolean |
traitOverlineScore()
|
Color |
traitOverlineScoreColor()
|
int |
traitPaddingAfter()
Returns the padding-after trait for this area. |
int |
traitPaddingBefore()
Returns the padding-before trait for this area. |
int |
traitPaddingEnd()
Returns the padding-end trait for this area. |
int |
traitPaddingStart()
Returns the padding-start trait for this area. |
int |
traitSpaceEndOptimum()
Returns the space-end optimum trait for this area. |
int |
traitSpaceStartOptimum()
Returns the space-start optimum trait for this area. |
boolean |
traitThroughScore()
|
Color |
traitThroughScoreColor()
|
boolean |
traitUnderlineScore()
|
Color |
traitUnderlineScoreColor()
|
int |
traitWordSpacingMax()
Returns the word-spacing maximum trait. |
int |
traitWordSpacingMin()
Returns the word-spacing minimum trait. |
int |
traitWordSpacingOpt()
Returns the word-spacing optimum trait. |
int |
wordSpacing()
|
int |
wordSpacingUsed()
Computes the amount of space, in millipoints, that this area has already absorbed by adjusting word spacing. |
| Methods inherited from class org.foray.common.AbstractOrderedTreeNode |
|---|
children, getChildCount, getFirstLeaf, getIndex, getLastLeaf, getLevel, getNextLeaf, getNextSibling, getPreviousLeaf, getPreviousSibling, getSharedAncestor, hasChildren, isLeaf, isNodeAncestor, isNodeDescendant, nextPostOrderNode, nextPreOrderNode, postOrderDescendantIterator, siblingIndex |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.axsl.galley.GeneralInlineArea |
|---|
baselineX, baselineY, getLineArea |
| Methods inherited from interface org.axsl.galley.Area |
|---|
brBpd, brIpd, brOriginX, brOriginY, crBpd, crIpd, crOriginX, crOriginY, destinationName, generatedByExists, generatedByName, isLinkRoot, linkDestination, linkType, traitId |
| Methods inherited from interface org.axsl.galley.AreaNode |
|---|
getChildAt, getGalley |
| Methods inherited from interface javax.swing.tree.TreeNode |
|---|
children, getAllowsChildren, getChildCount, getIndex, isLeaf |
| Methods inherited from interface java.lang.Iterable |
|---|
iterator |
| Methods inherited from interface org.axsl.area.Area |
|---|
crBpd, crIpd, pdAvailable |
| Methods inherited from interface org.axsl.area.AreaNode |
|---|
ancestorArea, ancestorBlockContentFactory, ancestorNormalBlockArea, ancestorTableArea, getAreaTree, getPage, isFirstChildOfGeneratedBy, nearestArea, nearestGeneratedByBlockLevelFo, removeChild, siblingIndex |
| Methods inherited from interface org.axsl.fo.FoContext |
|---|
bpdAncestorBlockOrRa, getGraftingPoint, heightContainingBlock, ipdAncestorBlockArea, ipdAncestorBlockOrRa, ipdContainingRefArea, ipdParentArea, isFirst, isLast, tableWidth, widthContainingBlock |
| Method Detail |
|---|
public CharSequence getText()
Computes and returns the text that should actually be used in the output document. Note that it may be different from the char array that backs this TextSegment for the following reasons:
Note that the following text changes occur elsewhere:
getText in interface org.axsl.galley.TextAreapublic CharSequence getRawText()
public int traitBorderBeforeWidth()
traitBorderBeforeWidth in class Areapublic int traitBorderAfterWidth()
traitBorderAfterWidth in class Areapublic int traitBorderStartWidth()
traitBorderStartWidth in class Areapublic int traitBorderEndWidth()
traitBorderEndWidth in class Areapublic int traitPaddingBefore()
traitPaddingBefore in class Areapublic int traitPaddingAfter()
traitPaddingAfter in class Areapublic int traitPaddingStart()
traitPaddingStart in class Areapublic int traitPaddingEnd()
traitPaddingEnd in class Area
public static int ignoreAtStart(CharSequence chars,
int start,
int size,
boolean firstItemOnLine,
org.axsl.common.value.WhiteSpaceTreatment whiteSpaceTreatment)
chars - The char array containing the text.start - The first char that is part of the text.size - The size of the the chars that are part of the text.firstItemOnLine - Indicates whether this content will be the first
item on the line.whiteSpaceTreatment - The white-space treatment value.
public static int ignoreAtEnd(CharSequence chars,
int start,
int size,
boolean lastItemOnLine,
org.axsl.common.value.WhiteSpaceTreatment whiteSpaceTreatment)
chars - The char array containing the text.start - The first char that is part of the text.size - The size of the the chars that are part of the text.lastItemOnLine - Indicates whether this content will be the last
item on the line.whiteSpaceTreatment - The white-space treatment value.
public int wordSpacingUsed()
public int maxWordSpacingCapacity()
public int minWordSpacingCapacity()
public int letterSpacingUsed()
public int maxLetterSpacingCapacity()
public int minLetterSpacingCapacity()
public int countSpaces()
public int countLetterSpacingChars()
public boolean endsWithLinefeed()
public int getResolvedLetterSpacing()
public int letterSpacing()
letterSpacing in interface org.axsl.galley.TextAreapublic void setResolvedLetterSpacing(int resolvedLetterSpacing)
resolvedLetterSpacing - The resolvedLetterSpacing to set.public int wordSpacing()
wordSpacing in interface org.axsl.galley.TextAreapublic void setResolvedWordSpacing(int resolvedWordSpacing)
resolvedWordSpacing - The resolvedWordSpacing to set.public int traitFontSize()
traitFontSize in interface org.axsl.galley.TextAreapublic String getAreaName()
getAreaName in interface org.axsl.area.AreaNodepublic org.axsl.fo.fo.CharacterSequence traitGeneratedBy()
traitGeneratedBy in interface org.axsl.area.AreaNodetraitGeneratedBy in class AreaNode
public void render(org.axsl.galley.RenderVisitor visitor)
throws org.axsl.galley.GalleyVisitorException
org.axsl.galley.GalleyVisitorExceptionpublic List<AreaNode> getChildren()
AbstractOrderedTreeNode
getChildren in class AreaNodeprotected boolean optimize()
AreaNodePageRA.layoutComplete().
optimize in class AreaNodepublic FOLinkage getLinkage()
AreaNode
getLinkage in class AreaNodepublic org.axsl.font.FontOptions fontOptions()
fontOptions in interface org.axsl.galley.TextAreapublic org.axsl.common.i18n.Orthography orthography()
orthography in interface org.axsl.galley.TextAreapublic Area getParent()
getParent in interface TreeNodegetParent in class AreaNode
public void setParent(AreaNode node)
throws org.axsl.area.AreaTreeException
AreaNode
setParent in class AreaNodenode - The new parent node.
org.axsl.area.AreaTreeException - If the parent node is not compatible with
the implementations specification for a parent node.public org.axsl.font.FontUse getPrimaryFont()
getPrimaryFont in interface org.axsl.galley.TextAreapublic org.axsl.font.FontUse getSecondaryFont(int codePoint)
getSecondaryFont in interface org.axsl.galley.TextAreapublic int traitHyphenationCharacter()
public int traitSpaceStartOptimum()
Area
traitSpaceStartOptimum in class Areapublic int traitSpaceEndOptimum()
Area
traitSpaceEndOptimum in class Areapublic int traitWordSpacingOpt()
public int traitWordSpacingMax()
public int traitWordSpacingMin()
public int traitLetterSpacingOpt()
public int traitLetterSpacingMax()
public int traitLetterSpacingMin()
public boolean traitUnderlineScore()
traitUnderlineScore in interface org.axsl.galley.GeneralInlineAreapublic boolean traitOverlineScore()
traitOverlineScore in interface org.axsl.galley.GeneralInlineAreapublic boolean traitThroughScore()
traitThroughScore in interface org.axsl.galley.GeneralInlineAreapublic Color traitUnderlineScoreColor()
traitUnderlineScoreColor in interface org.axsl.galley.GeneralInlineAreapublic Color traitOverlineScoreColor()
traitOverlineScoreColor in interface org.axsl.galley.GeneralInlineAreapublic Color traitThroughScoreColor()
traitThroughScoreColor in interface org.axsl.galley.GeneralInlineAreapublic int traitIPDimensionOpt()
AreaFlexible
traitIPDimensionOpt in class AreaFlexiblepublic Color traitColor()
traitColor in interface org.axsl.galley.GeneralInlineArea
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||