|
fop 1.0 | |||||||||
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
|
protected static class |
BlockStackingLayoutManager.StackingIter
|
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
|
protected int |
referenceIPD
Reference IPD available |
protected int |
startIndent
the effective start-indent value |
protected java.util.List |
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 |
addInBetweenBreak(java.util.List 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 |
addPendingMarks(LayoutContext context)
Adds the unresolved elements for border and padding to a layout context so break possibilities can be properly constructed. |
protected java.util.List |
createUnitElements(java.util.List oldList)
|
void |
discardSpace(KnuthGlue spaceGlue)
|
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. |
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. |
boolean |
mustKeepTogether()
|
boolean |
mustKeepWithNext()
|
boolean |
mustKeepWithPrevious()
|
protected int |
neededUnits(int len)
|
int |
negotiateBPDAdjustment(int adj,
KnuthElement lastElement)
|
protected void |
notifyEndOfLayout()
Notifies the PageSequenceLayoutManager that layout
for this LM has ended. |
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, 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 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 withMethod Detail |
---|
protected BlockParent getCurrentArea()
protected void setCurrentArea(BlockParent parentArea)
parentArea
- the current area to be filledpublic void addBlockSpacing(double adjust, MinOptMax minoptmax)
adjust
- the adjustment valueminoptmax
- the min/opt/max value of the spacingprotected 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 LayoutManager
addChildArea
in class AbstractLayoutManager
childArea
- the area to add: will be some block-stacked Area.protected void notifyEndOfLayout()
PageSequenceLayoutManager
that layout
for this LM has ended.
notifyEndOfLayout
in class AbstractLayoutManager
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 LayoutManager
getNextKnuthElements
in class AbstractLayoutManager
context
- 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 LayoutManager
getNextKnuthElements
in class AbstractBaseLayoutManager
context
- 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 void addInBetweenBreak(java.util.List contentList, LayoutContext parentLC, LayoutContext childLC)
contentList
- parentLC
- childLC
- the currently active child layout contextpublic int negotiateBPDAdjustment(int adj, KnuthElement lastElement)
negotiateBPDAdjustment
in interface BlockLevelLayoutManager
public void discardSpace(KnuthGlue spaceGlue)
discardSpace
in interface BlockLevelLayoutManager
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 Keep getParentKeepTogether()
public boolean mustKeepTogether()
mustKeepTogether
in interface BlockLevelLayoutManager
public boolean mustKeepWithPrevious()
mustKeepWithPrevious
in interface BlockLevelLayoutManager
public boolean mustKeepWithNext()
mustKeepWithNext
in interface BlockLevelLayoutManager
public Keep getKeepTogether()
getKeepTogether
in interface BlockLevelLayoutManager
public Keep getKeepWithPrevious()
getKeepWithPrevious
in interface BlockLevelLayoutManager
public Keep getKeepWithNext()
getKeepWithNext
in interface BlockLevelLayoutManager
public KeepProperty getKeepTogetherProperty()
IllegalStateException
.
Must be implemented by the subclass, if applicable.
getKeepTogetherProperty
in interface BlockLevelLayoutManager
public KeepProperty getKeepWithPreviousProperty()
IllegalStateException
.
Must be implemented by the subclass, if applicable.
getKeepWithPreviousProperty
in interface BlockLevelLayoutManager
public KeepProperty getKeepWithNextProperty()
IllegalStateException
.
Must be implemented by the subclass, if applicable.
getKeepWithNextProperty
in interface BlockLevelLayoutManager
protected void addPendingMarks(LayoutContext context)
context
- the layout contextprotected 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 paddingprotected 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 paddingprotected 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 alignmentprotected void addKnuthElementsForSpaceAfter(java.util.List returnList, int alignment)
returnList
- return list to add the additional elements toalignment
- vertical alignmentprotected java.util.List createUnitElements(java.util.List oldList)
protected void wrapPositionElements(java.util.List sourceList, java.util.List targetList)
sourceList
- source listtargetList
- target list receiving the wrapped position elementsprotected 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 originprotected 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 LayoutManager
getContentAreaIPD
in class AbstractBaseLayoutManager
protected void setContentAreaIPD(int contentAreaIPD)
contentAreaIPD
- the IPD of the content areapublic int getContentAreaBPD()
getContentAreaBPD
in interface LayoutManager
getContentAreaBPD
in class AbstractBaseLayoutManager
public void reset()
reset
in interface LayoutManager
reset
in class AbstractLayoutManager
|
fop 1.0 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |