|
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
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. For example, if the text "representation" originates a single box element when getNextKnuthElements() is called, it will be now split in syllables (rep-re-sen-ta-tion) each one originating a box and divided by additional elements allowing a line break. In the context of page breaking, this method is called only if the pages need to be "vertically justified" modifying (also) the quantity of lines created by the paragraphs, and after a first page breaking has been performed. According to the result of the first page breaking, each paragraph now knows how many lines it must create (among the existing layout possibilities) and has to create a sequence of elements representing this layout; in particular, each box, representing a line, will contain a LineBreakPositions that will be used in the addAreas() phase. LMs having children look at the old list of elements in order to know which ones they must get the new elements from, as break conditions of preserved linefeeds can divide children into smaller groups (page sequences or paragraphs). LMs having no children can simply return the old elements if they have nothing to change. Inline LMs need to know the text alignment because it affects the elements representing feasible breaks between syllables. |
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. Default implementation throws a IllegalStateException. |
Keep |
getKeepWithNext()
Returns the keep-with-next strength for this element. |
KeepProperty |
getKeepWithNextProperty()
Returns the keep-with-next property specified on the FObj. Default implementation throws a IllegalStateException. |
Keep |
getKeepWithPrevious()
Returns the keep-with-previous strength for this element. |
KeepProperty |
getKeepWithPreviousProperty()
Returns the keep-with-previous property specified on the FObj. Default implementation throws a IllegalStateException. |
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 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 notifyEndOfLayout()
PageSequenceLayoutManager that layout
for this LM has ended.
notifyEndOfLayout in class AbstractLayoutManagerprotected 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 AbstractLayoutManager
public java.util.List getNextKnuthElements(LayoutContext context,
int alignment,
java.util.Stack lmStack,
Position restartPosition,
LayoutManager restartAtLM)
getNextKnuthElements in interface LayoutManagergetNextKnuthElements in class AbstractBaseLayoutManager
protected void addInBetweenBreak(java.util.List contentList,
LayoutContext parentLC,
LayoutContext childLC)
contentList - parentLC - childLC - the currently active child layout context
public int negotiateBPDAdjustment(int adj,
KnuthElement lastElement)
negotiateBPDAdjustment in interface BlockLevelLayoutManagerpublic void discardSpace(KnuthGlue spaceGlue)
discardSpace in interface BlockLevelLayoutManager
public java.util.List getChangedKnuthElements(java.util.List oldList,
int alignment)
getChangedKnuthElements in interface LayoutManagergetChangedKnuthElements in class AbstractLayoutManagerprotected 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 context
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 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 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 AbstractLayoutManager
|
fop 1.0 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||