|
fop 0.95 | |||||||||
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 boolean |
isSomethingChanged
Flag to indicate if something was changed as part of the getChangeKnuthElements sequence |
protected static org.apache.commons.logging.Log |
log
logging instance |
Fields inherited from class org.apache.fop.layoutmgr.AbstractLayoutManager |
---|
childLMiter, childLMs, curChildLM, fobjIter, parentLM |
Fields inherited from class org.apache.fop.layoutmgr.AbstractBaseLayoutManager |
---|
fobj, generatesBlockArea, generatesReferenceArea |
Constructor Summary | |
---|---|
LeafNodeLayoutManager()
Create a Leaf node layout mananger. |
|
LeafNodeLayoutManager(FObj node)
Create a Leaf node layout mananger. |
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 |
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 is never called. |
protected void |
addId()
This method is called by addAreas() so IDs can be added to a page for FOs that support the 'id' property. |
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 |
InlineArea |
get(LayoutContext context)
get the inline area. |
protected MinOptMax |
getAllocationIPD(int refIPD)
Get the allocation ipd of the inline area. |
java.util.LinkedList |
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 possibile hyphenation points. |
protected InlineArea |
getEffectiveArea()
|
java.util.LinkedList |
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 is never called. |
void |
getWordChars(java.lang.StringBuffer sbChars,
Position pos)
Get the word chars corresponding to the given position |
void |
hyphenate(Position pos,
HyphContext hc)
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. |
void |
removeWordSpace(java.util.List oldList)
Remove the word space represented by the given elements |
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.AbstractLayoutManager |
---|
addChildLM, addChildLMs, addMarkersToPage, createChildLMs, createNextChildLMs, getChildLM, getChildLMs, getCurrentPage, getCurrentPV, getParent, getPSLM, hasNextChildLM, initialize, isFinished, isFirst, isLast, notifyPos, setFinished, setParent, toString, transferForeignAttributes |
Methods inherited from class org.apache.fop.layoutmgr.AbstractBaseLayoutManager |
---|
getAncestorBlockAreaBPD, getAncestorBlockAreaIPD, getBaseLength, getContentAreaBPD, getContentAreaIPD, getFObj, getGeneratesBlockArea, getGeneratesLineArea, getGeneratesReferenceArea, getParentAreaBPD, getParentAreaIPD, getReferenceAreaBPD, getReferenceAreaIPD, 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, getChildLMs, getContentAreaBPD, getContentAreaIPD, getFObj, getGeneratesBlockArea, getGeneratesLineArea, getGeneratesReferenceArea, getParent, getPSLM, initialize, isFinished, notifyPos, setFinished, setParent |
Methods inherited from interface org.apache.fop.datatypes.PercentBaseContext |
---|
getBaseLength |
Field Detail |
---|
protected static org.apache.commons.logging.Log log
protected InlineArea curArea
protected CommonBorderPaddingBackground commonBorderPaddingBackground
protected AlignmentContext alignmentContext
protected boolean isSomethingChanged
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()
protected void addId()
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.LinkedList getNextKnuthElements(LayoutContext context, int alignment)
getNextKnuthElements
in interface LayoutManager
getNextKnuthElements
in class AbstractLayoutManager
context
- the LayoutContext used to store layout informationalignment
- the desired text alignement
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 void removeWordSpace(java.util.List oldList)
removeWordSpace
in interface InlineLevelLayoutManager
oldList
- the elements representing the word spacepublic void getWordChars(java.lang.StringBuffer sbChars, Position pos)
getWordChars
in interface InlineLevelLayoutManager
sbChars
- the StringBuffer used to append word charspos
- the Position referring to the needed word charspublic void hyphenate(Position pos, HyphContext hc)
hyphenate
in interface InlineLevelLayoutManager
pos
- the Position referring to the wordhc
- 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 java.util.LinkedList 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 0.95 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |