|
fop 1.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.BlockStackingLayoutManager
public abstract class BlockStackingLayoutManager
Base LayoutManager class for all areas which stack their child areas in the block-progression direction, such as Flow, Block, ListBlock.
| Nested Class Summary | |
|---|---|
protected static class |
BlockStackingLayoutManager.MappingPosition
A mapping position. |
| Field Summary | |
|---|---|
protected int |
adjustedSpaceAfter
space-after value adjusted for block-progression-unit handling |
protected int |
adjustedSpaceBefore
space-before value adjusted for block-progression-unit handling |
protected int |
bpUnit
Value of the block-progression-unit (non-standard property) |
protected boolean |
breakBeforeServed
Indicates whether break before has been served or not |
protected int |
endIndent
the effective end-indent value |
protected boolean |
firstVisibleMarkServed
Indicates whether the first visible mark has been returned by this LM, yet |
protected MinOptMax |
foSpaceAfter
see foSpaceBefore |
protected MinOptMax |
foSpaceBefore
Holds the (one-time use) fo:block space-before and -after properties. |
protected BlockParent |
parentArea
parent area |
protected int |
referenceIPD
Reference IPD available |
protected int |
startIndent
the effective start-indent value |
protected java.util.List<KnuthElement> |
storedList
Only used to store the original list when createUnitElements is called |
| 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 | |
|---|---|
BlockStackingLayoutManager(FObj node)
|
|
| Method Summary | |
|---|---|
void |
addBlockSpacing(double adjust,
MinOptMax minoptmax)
Add a block spacer for space before and space after a block. |
void |
addChildArea(Area childArea)
Add the childArea to the current area. |
protected void |
addChildToArea(Area childArea,
BlockParent parentArea)
Add the childArea to the passed area. |
protected void |
addFirstVisibleMarks(java.util.List<ListElement> elements,
LayoutContext context,
int alignment)
Checks if this LM's first "visible marks" (= borders, padding, spaces) have already been processed, and if necessary, adds corresponding elements to the specified list, and updates the given layout context accordingly. |
protected void |
addInBetweenBreak(java.util.List<ListElement> contentList,
LayoutContext parentLC,
LayoutContext childLC)
Adds a break element to the content list between individual child elements. |
protected void |
addKnuthElementsForBorderPaddingAfter(java.util.List returnList,
boolean isLast)
Creates Knuth elements for after border padding and adds them to the return list. |
protected void |
addKnuthElementsForBorderPaddingBefore(java.util.List returnList,
boolean isFirst)
Creates Knuth elements for before border padding and adds them to the return list. |
protected boolean |
addKnuthElementsForBreakAfter(java.util.List returnList,
LayoutContext context)
Creates Knuth elements for break-after and adds them to the return list. |
protected boolean |
addKnuthElementsForBreakBefore(java.util.List returnList,
LayoutContext context)
Creates Knuth elements for break-before and adds them to the return list. |
protected void |
addKnuthElementsForSpaceAfter(java.util.List returnList,
int alignment)
Creates Knuth elements for space-after and adds them to the return list. |
protected void |
addKnuthElementsForSpaceBefore(java.util.List returnList,
int alignment)
Creates Knuth elements for space-before and adds them to the return list. |
protected void |
addLastVisibleMarks(java.util.List<ListElement> elements,
LayoutContext context,
int alignment)
Adds elements the LM's last/closing marks to the specified list, and updates the layout context accordingly. |
protected void |
addPendingMarks(LayoutContext context)
Adds the unresolved elements for border and padding to a layout context so break possibilities can be properly constructed. |
protected boolean |
breakBeforeServed(LayoutContext context,
java.util.List<ListElement> elements)
Check whether there is a break-before condition. |
void |
discardSpace(KnuthGlue spaceGlue)
Discard space. |
protected void |
flush()
Force current area to be added to parent area. |
protected Position |
getAuxiliaryPosition()
|
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. |
int |
getContentAreaBPD()
Returns the BPD of the content area |
int |
getContentAreaIPD()
Returns the IPD of the content area |
protected BlockParent |
getCurrentArea()
|
protected int |
getIPIndents()
|
Keep |
getKeepTogether()
Returns the keep-together strength for this element. |
KeepProperty |
getKeepTogetherProperty()
Returns the keep-together property specified on the FObj. |
Keep |
getKeepWithNext()
Returns the keep-with-next strength for this element. |
KeepProperty |
getKeepWithNextProperty()
Returns the keep-with-next property specified on the FObj. |
Keep |
getKeepWithPrevious()
Returns the keep-with-previous strength for this element. |
KeepProperty |
getKeepWithPreviousProperty()
Returns the keep-with-previous property specified on the FObj. |
protected java.util.List<ListElement> |
getNextChildElements(LayoutManager childLM,
LayoutContext context,
LayoutContext childLC,
int alignment,
java.util.Stack<LayoutManager> lmStack,
Position restartPosition,
LayoutManager restartAtLM)
Gets the next set of child elements for the given childLM. |
java.util.List |
getNextKnuthElements(LayoutContext context,
int alignment)
Get a sequence of KnuthElements representing the content of the node assigned to the LM. |
java.util.List |
getNextKnuthElements(LayoutContext context,
int alignment,
java.util.Stack lmStack,
Position restartPosition,
LayoutManager restartAtLM)
Returns an updated list of Knuth elements corresponding to this layout manager, after a change of IPD has been detected. |
protected Keep |
getParentKeepTogether()
Retrieves and returns the keep-together strength from the parent element. |
protected SpaceProperty |
getSpaceAfterProperty()
|
protected SpaceProperty |
getSpaceBeforeProperty()
|
boolean |
handleOverflow(int milliPoints)
Whether this LM can handle horizontal overflow error messages (only a BlockContainerLayoutManager can). |
protected LayoutContext |
makeChildLayoutContext(LayoutContext context)
Creates and initializes a LayoutContext to pass to the child LM |
boolean |
mustKeepTogether()
|
boolean |
mustKeepWithNext()
|
boolean |
mustKeepWithPrevious()
|
protected int |
neededUnits(int len)
|
int |
negotiateBPDAdjustment(int adj,
KnuthElement lastElement)
Negotiate BPD adjustment. |
void |
reset()
Re-initializes this layout manager in order to re-generate its Knuth elements according to a new IPD value. |
protected void |
setContentAreaIPD(int contentAreaIPD)
Sets the IPD of the content area |
protected void |
setCurrentArea(BlockParent parentArea)
Set the current area being filled. |
protected int |
updateContentAreaIPDwithOverconstrainedAdjust()
Determines and sets the content area IPD based on available reference area IPD, start- and end-indent properties. |
protected int |
updateContentAreaIPDwithOverconstrainedAdjust(int contentIPD)
Sets the content area IPD by directly supplying the value. |
protected void |
wrapPositionElement(ListElement el,
java.util.List targetList,
boolean force)
"wrap" the Position inside the given element and add it to the target list. |
protected void |
wrapPositionElements(java.util.List sourceList,
java.util.List targetList)
"wrap" the Position inside each element moving the elements from SourceList to targetList |
protected void |
wrapPositionElements(java.util.List sourceList,
java.util.List targetList,
boolean force)
"wrap" the Position inside each element moving the elements from SourceList to targetList |
| Methods inherited from class org.apache.fop.layoutmgr.AbstractLayoutManager |
|---|
addAreas, addChildLM, addChildLMs, addId, addMarkersToPage, checkEndOfLayout, createChildLMs, createNextChildLMs, getChildLM, getChildLMs, getCurrentPage, getCurrentPV, getParent, getParentArea, getPSLM, hasNextChildLM, initialize, isFinished, isFirst, isLast, notifyEndOfLayout, notifyPos, setCurrentChildLM, setFinished, setParent, toString, transferExtensionAttachments, transferExtensions, transferForeignAttributes |
| Methods inherited from class org.apache.fop.layoutmgr.AbstractBaseLayoutManager |
|---|
getAncestorBlockAreaBPD, getAncestorBlockAreaIPD, getBaseLength, getFObj, getGeneratesBlockArea, getGeneratesLineArea, getGeneratesReferenceArea, 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 |
|---|
addAreas, addChildLM, addChildLMs, createNextChildLMs, getChildLMs, getFObj, getGeneratesBlockArea, getGeneratesLineArea, getGeneratesReferenceArea, getParent, getParentArea, getPSLM, initialize, isFinished, isRestartable, notifyPos, setFinished, setParent |
| Methods inherited from interface org.apache.fop.datatypes.PercentBaseContext |
|---|
getBaseLength |
| Field Detail |
|---|
protected BlockParent parentArea
protected int bpUnit
protected int adjustedSpaceBefore
protected int adjustedSpaceAfter
protected java.util.List<KnuthElement> storedList
protected boolean breakBeforeServed
protected boolean firstVisibleMarkServed
protected int referenceIPD
protected int startIndent
protected int endIndent
protected MinOptMax foSpaceBefore
protected MinOptMax foSpaceAfter
| Constructor Detail |
|---|
public BlockStackingLayoutManager(FObj node)
node - the fo this LM deals with| Method Detail |
|---|
protected BlockParent getCurrentArea()
protected void setCurrentArea(BlockParent parentArea)
parentArea - the current area to be filled
public void addBlockSpacing(double adjust,
MinOptMax minoptmax)
adjust - the adjustment valueminoptmax - the min/opt/max value of the spacing
protected void addChildToArea(Area childArea,
BlockParent parentArea)
childArea - the area to add: will be some block-stacked Area.parentArea - the area in which to add the childAreapublic void addChildArea(Area childArea)
addChildArea in interface LayoutManageraddChildArea in class AbstractLayoutManagerchildArea - the area to add: will be some block-stacked Area.protected void flush()
protected Position getAuxiliaryPosition()
protected int neededUnits(int len)
len - length in millipoints to span with bp units
protected int updateContentAreaIPDwithOverconstrainedAdjust()
protected int updateContentAreaIPDwithOverconstrainedAdjust(int contentIPD)
contentIPD - the IPD of the content
public java.util.List getNextKnuthElements(LayoutContext context,
int alignment)
getNextKnuthElements in interface LayoutManagergetNextKnuthElements in class AbstractLayoutManagercontext - the LayoutContext used to store layout informationalignment - the desired text alignment
public java.util.List getNextKnuthElements(LayoutContext context,
int alignment,
java.util.Stack lmStack,
Position restartPosition,
LayoutManager restartAtLM)
getNextKnuthElements in interface LayoutManagergetNextKnuthElements in class AbstractBaseLayoutManagercontext - the layout contextalignment - the alignmentlmStack - the stack of LMs that are active at the IPD changerestartPosition - the position corresponding to the element
finishing the page before the IPD changerestartAtLM - if not null, the layout manager from which to restart.
That is, the IPD change occurs between two block elements and not inside
a paragraph
protected LayoutContext makeChildLayoutContext(LayoutContext context)
LayoutContext to pass to the child LM
context - the parent LayoutContext
protected void addFirstVisibleMarks(java.util.List<ListElement> elements,
LayoutContext context,
int alignment)
elements - the element listcontext - the layout contextalignment - the vertical alignment
protected void addLastVisibleMarks(java.util.List<ListElement> elements,
LayoutContext context,
int alignment)
elements - the element listcontext - the layout contextalignment - the vertical alignment
protected boolean breakBeforeServed(LayoutContext context,
java.util.List<ListElement> elements)
context allows it, add the necessary elements
to the given elements list.
context - the layout contextelements - the element list
false if there is a break-before condition, and it has not been served;
true otherwise
protected java.util.List<ListElement> getNextChildElements(LayoutManager childLM,
LayoutContext context,
LayoutContext childLC,
int alignment,
java.util.Stack<LayoutManager> lmStack,
Position restartPosition,
LayoutManager restartAtLM)
childLM.getNextKnuthElements(),
passing it all relevant parameters.
childLM - the current child LMcontext - the layout contextchildLC - the child layout contextalignment - the vertical alignmentlmStack - the stack of currently active LMs (if any)restartPosition - the position to restart from (if any)restartAtLM - the LM to restart from (if any)
protected void addInBetweenBreak(java.util.List<ListElement> contentList,
LayoutContext parentLC,
LayoutContext childLC)
contentList - the content listparentLC - the parent layout contextchildLC - the currently active child layout context
public int negotiateBPDAdjustment(int adj,
KnuthElement lastElement)
negotiateBPDAdjustment in interface BlockLevelLayoutManageradj - amount to adjustlastElement - the last knuth element
public void discardSpace(KnuthGlue spaceGlue)
discardSpace in interface BlockLevelLayoutManagerspaceGlue - the space
public java.util.List getChangedKnuthElements(java.util.List oldList,
int alignment)
getChangedKnuthElements in interface LayoutManagergetChangedKnuthElements in class AbstractLayoutManageroldList - the elements to replacealignment - the desired text alignment
protected Keep getParentKeepTogether()
public boolean mustKeepTogether()
mustKeepTogether in interface BlockLevelLayoutManagerpublic boolean mustKeepWithPrevious()
mustKeepWithPrevious in interface BlockLevelLayoutManagerpublic boolean mustKeepWithNext()
mustKeepWithNext in interface BlockLevelLayoutManagerpublic Keep getKeepTogether()
getKeepTogether in interface BlockLevelLayoutManagerpublic Keep getKeepWithPrevious()
getKeepWithPrevious in interface BlockLevelLayoutManagerpublic Keep getKeepWithNext()
getKeepWithNext in interface BlockLevelLayoutManagerpublic KeepProperty getKeepTogetherProperty()
IllegalStateException.
Must be implemented by the subclass, if applicable.
getKeepTogetherProperty in interface BlockLevelLayoutManagerpublic KeepProperty getKeepWithPreviousProperty()
IllegalStateException.
Must be implemented by the subclass, if applicable.
getKeepWithPreviousProperty in interface BlockLevelLayoutManagerpublic KeepProperty getKeepWithNextProperty()
IllegalStateException.
Must be implemented by the subclass, if applicable.
getKeepWithNextProperty in interface BlockLevelLayoutManagerprotected void addPendingMarks(LayoutContext context)
context - the layout contextprotected SpaceProperty getSpaceBeforeProperty()
protected SpaceProperty getSpaceAfterProperty()
protected void addKnuthElementsForBorderPaddingBefore(java.util.List returnList,
boolean isFirst)
returnList - return list to add the additional elements toisFirst - true if this is the first time a layout manager instance needs to generate
border and padding
protected void addKnuthElementsForBorderPaddingAfter(java.util.List returnList,
boolean isLast)
returnList - return list to add the additional elements toisLast - true if this is the last time a layout manager instance needs to generate
border and padding
protected boolean addKnuthElementsForBreakBefore(java.util.List returnList,
LayoutContext context)
returnList - return list to add the additional elements tocontext - the layout context
protected boolean addKnuthElementsForBreakAfter(java.util.List returnList,
LayoutContext context)
returnList - return list to add the additional elements tocontext - the layout context
protected void addKnuthElementsForSpaceBefore(java.util.List returnList,
int alignment)
returnList - return list to add the additional elements toalignment - vertical alignment
protected void addKnuthElementsForSpaceAfter(java.util.List returnList,
int alignment)
returnList - return list to add the additional elements toalignment - vertical alignment
protected void wrapPositionElements(java.util.List sourceList,
java.util.List targetList)
sourceList - source listtargetList - target list receiving the wrapped position elements
protected void wrapPositionElements(java.util.List sourceList,
java.util.List targetList,
boolean force)
sourceList - source listtargetList - target list receiving the wrapped position elementsforce - if true, every Position is wrapped regardless of its LM of origin
protected void wrapPositionElement(ListElement el,
java.util.List targetList,
boolean force)
el - the list elementtargetList - target list receiving the wrapped position elementsforce - if true, every Position is wrapped regardless of its LM of originprotected int getIPIndents()
public int getContentAreaIPD()
getContentAreaIPD in interface LayoutManagergetContentAreaIPD in class AbstractBaseLayoutManagerprotected void setContentAreaIPD(int contentAreaIPD)
contentAreaIPD - the IPD of the content areapublic int getContentAreaBPD()
getContentAreaBPD in interface LayoutManagergetContentAreaBPD in class AbstractBaseLayoutManagerpublic void reset()
reset in interface LayoutManagerreset in class AbstractLayoutManagerpublic boolean handleOverflow(int milliPoints)
milliPoints - horizontal overflow
|
fop 1.1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||