|
fop 2.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.fop.layoutmgr.AbstractBaseLayoutManager
org.apache.fop.layoutmgr.AbstractLayoutManager
org.apache.fop.layoutmgr.inline.LeafNodeLayoutManager
public abstract class LeafNodeLayoutManager
Base LayoutManager for leaf-node FObj, ie: ones which have no children. These are all inline objects. Most of them cannot be split (Text is an exception to this rule.) This class can be extended to handle the creation and adding of the inline area.
Nested Class Summary | |
---|---|
protected class |
LeafNodeLayoutManager.AreaInfo
Store information about the inline area |
Field Summary | |
---|---|
protected AlignmentContext |
alignmentContext
The alignment context applying to this area |
protected LeafNodeLayoutManager.AreaInfo |
areaInfo
Our area info for the Knuth elements |
protected CommonBorderPaddingBackground |
commonBorderPaddingBackground
Any border, padding and background properties applying to this area |
protected InlineArea |
curArea
The inline area that this leafnode will add. |
protected static org.apache.commons.logging.Log |
log
logging instance |
protected boolean |
somethingChanged
Flag to indicate if something was changed as part of the getChangeKnuthElements sequence |
Fields inherited from class org.apache.fop.layoutmgr.AbstractLayoutManager |
---|
childLMiter, childLMs, curChildLM, fobjIter, parentLayoutManager |
Fields inherited from class org.apache.fop.layoutmgr.AbstractBaseLayoutManager |
---|
fobj, generatesBlockArea, generatesReferenceArea |
Constructor Summary | |
---|---|
LeafNodeLayoutManager()
Create a Leaf node layout manager. |
|
LeafNodeLayoutManager(FObj node)
Create a Leaf node layout manager. |
Method Summary | |
---|---|
java.util.List |
addALetterSpaceTo(java.util.List oldList)
Tell the LM to modify its data, adding a letter space to the word fragment represented by the given elements, and returning the corrected elements |
java.util.List |
addALetterSpaceTo(java.util.List oldList,
int depth)
Tell the LM to modify its data, adding a letter space to the word fragment represented by the given elements, and returning the corrected elements |
void |
addAreas(PositionIterator posIter,
LayoutContext context)
Add the area for this layout manager. |
void |
addChildArea(Area childArea)
This is a leaf-node, so this method should never be called. |
protected void |
addKnuthElementsForBorderPaddingEnd(java.util.List returnList)
Creates Knuth elements for end border padding and adds them to the return list. |
protected void |
addKnuthElementsForBorderPaddingStart(java.util.List returnList)
Creates Knuth elements for start border padding and adds them to the return list. |
boolean |
applyChanges(java.util.List oldList)
Tell the LM to apply the changes due to hyphenation |
boolean |
applyChanges(java.util.List oldList,
int depth)
Tell the LM to apply the changes due to hyphenation |
InlineArea |
get(LayoutContext context)
get the inline area. |
protected MinOptMax |
getAllocationIPD(int refIPD)
Get the allocation ipd of the inline area. |
java.util.List |
getChangedKnuthElements(java.util.List oldList,
int alignment)
Get a sequence of KnuthElements representing the content of the node assigned to the LM, after changes have been applied In the context of line breaking, this method is called after hyphenation has been performed, in order to receive the sequence of elements representing the text together with all possible hyphenation points. |
java.util.List |
getChangedKnuthElements(java.util.List oldList,
int alignment,
int depth)
Get a sequence of KnuthElements representing the content of the node assigned to the LM, after changes have been applied |
protected InlineArea |
getEffectiveArea(LayoutContext layoutContext)
|
java.util.List |
getNextKnuthElements(LayoutContext context,
int alignment)
Get a sequence of KnuthElements representing the content of the node assigned to the LM. |
Area |
getParentArea(Area childArea)
This is a leaf-node, so this method should never be called. |
java.lang.String |
getWordChars(Position pos)
Get the word chars corresponding to the given position. |
void |
hyphenate(Position pos,
HyphContext hyphContext)
Tell the LM to hyphenate a word |
protected AlignmentContext |
makeAlignmentContext(LayoutContext context)
Creates a new alignment context or returns the current alignment context. |
protected void |
offsetArea(InlineArea area,
LayoutContext context)
Offset this area. |
boolean |
resolved()
Check if this inline area is resolved due to changes in page or ipd. |
protected void |
setCommonBorderPaddingBackground(CommonBorderPaddingBackground commonBorderPaddingBackground)
Set the border and padding properties of the inline area. |
void |
setCurrentArea(InlineArea ia)
Set the current inline area. |
protected void |
widthAdjustArea(InlineArea area,
LayoutContext context)
Adjust the width of the area when adding. |
Methods inherited from class org.apache.fop.layoutmgr.AbstractBaseLayoutManager |
---|
getAncestorBlockAreaBPD, getAncestorBlockAreaIPD, getBaseLength, getContentAreaBPD, getContentAreaIPD, getFObj, getGeneratesBlockArea, getGeneratesLineArea, getGeneratesReferenceArea, getNextKnuthElements, getParentAreaBPD, getParentAreaIPD, getReferenceAreaBPD, getReferenceAreaIPD, isRestartable, setGeneratesBlockArea, setGeneratesReferenceArea |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.apache.fop.layoutmgr.LayoutManager |
---|
addChildLM, addChildLMs, createNextChildLMs, getBaselineOffset, getChildLMs, getContentAreaBPD, getContentAreaIPD, getFObj, getGeneratesBlockArea, getGeneratesLineArea, getGeneratesReferenceArea, getNextKnuthElements, getParent, getPSLM, hasLineAreaDescendant, initialize, isFinished, isRestartable, notifyPos, reset, setFinished, setParent |
Methods inherited from interface org.apache.fop.datatypes.PercentBaseContext |
---|
getBaseLength |
Field Detail |
---|
protected static final org.apache.commons.logging.Log log
protected InlineArea curArea
protected CommonBorderPaddingBackground commonBorderPaddingBackground
protected AlignmentContext alignmentContext
protected boolean somethingChanged
protected LeafNodeLayoutManager.AreaInfo areaInfo
Constructor Detail |
---|
public LeafNodeLayoutManager(FObj node)
node
- the FObj to attach to this LM.public LeafNodeLayoutManager()
Method Detail |
---|
public InlineArea get(LayoutContext context)
context
- the context used to create the area
public boolean resolved()
public void setCurrentArea(InlineArea ia)
ia
- the inline area to set for this layout managerpublic void addChildArea(Area childArea)
addChildArea
in interface LayoutManager
addChildArea
in class AbstractLayoutManager
childArea
- the childArea to addpublic Area getParentArea(Area childArea)
getParentArea
in interface LayoutManager
getParentArea
in class AbstractLayoutManager
childArea
- the childArea to get the parent for
protected void setCommonBorderPaddingBackground(CommonBorderPaddingBackground commonBorderPaddingBackground)
commonBorderPaddingBackground
- the alignment adjust propertyprotected MinOptMax getAllocationIPD(int refIPD)
refIPD
- the ipd of the parent reference area
public void addAreas(PositionIterator posIter, LayoutContext context)
addAreas
in interface LayoutManager
addAreas
in class AbstractLayoutManager
posIter
- the position iteratorcontext
- the layout context for adding the areaprotected InlineArea getEffectiveArea(LayoutContext layoutContext)
protected void offsetArea(InlineArea area, LayoutContext context)
area
- the inline area to be updatedcontext
- the layout context used for adding the areaprotected AlignmentContext makeAlignmentContext(LayoutContext context)
context
- the layout context used
protected void widthAdjustArea(InlineArea area, LayoutContext context)
area
- the inline area to be updatedcontext
- the layout context for adding this areapublic java.util.List getNextKnuthElements(LayoutContext context, int alignment)
getNextKnuthElements
in interface LayoutManager
getNextKnuthElements
in class AbstractLayoutManager
context
- the LayoutContext used to store layout informationalignment
- the desired text alignment
public java.util.List addALetterSpaceTo(java.util.List oldList)
addALetterSpaceTo
in interface InlineLevelLayoutManager
oldList
- the elements which must be given one more letter space
public java.util.List addALetterSpaceTo(java.util.List oldList, int depth)
addALetterSpaceTo
in interface InlineLevelLayoutManager
oldList
- the elements which must be given one more letter spacedepth
- the depth at which the Positions for this LM in oldList are found
public java.lang.String getWordChars(Position pos)
getWordChars
in interface InlineLevelLayoutManager
pos
- the position referring to the needed word chars.
public void hyphenate(Position pos, HyphContext hyphContext)
hyphenate
in interface InlineLevelLayoutManager
pos
- the Position referring to the wordhyphContext
- the HyphContext storing hyphenation informationpublic boolean applyChanges(java.util.List oldList)
applyChanges
in interface InlineLevelLayoutManager
oldList
- the list of the old elements the changes refer to
public boolean applyChanges(java.util.List oldList, int depth)
applyChanges
in interface InlineLevelLayoutManager
oldList
- the list of the old elements the changes refer todepth
- the depth at which the Positions for this LM in oldList are found
public java.util.List getChangedKnuthElements(java.util.List oldList, int alignment, int depth)
getChangedKnuthElements
in interface InlineLevelLayoutManager
oldList
- the elements to replacealignment
- the desired text alignmentdepth
- the depth at which the Positions for this LM in oldList are found
public java.util.List getChangedKnuthElements(java.util.List oldList, int alignment)
getChangedKnuthElements
in interface LayoutManager
getChangedKnuthElements
in class AbstractLayoutManager
oldList
- the elements to replacealignment
- the desired text alignment
protected void addKnuthElementsForBorderPaddingStart(java.util.List returnList)
returnList
- return list to add the additional elements toprotected void addKnuthElementsForBorderPaddingEnd(java.util.List returnList)
returnList
- return list to add the additional elements to
|
fop 2.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |