public abstract class AbstractBreaker extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
AbstractBreaker.BlockSequence
Helper class, extending the functionality of the
basic
BlockKnuthSequence. |
static class |
AbstractBreaker.FloatPosition |
static class |
AbstractBreaker.PageBreakPosition
A page break position.
|
| Modifier and Type | Field and Description |
|---|---|
protected int |
alignment
desired text alignment
|
protected int |
blockListIndex
blockListIndex of the current BlockSequence in blockLists
|
protected List<AbstractBreaker.BlockSequence> |
blockLists |
protected List<ListElement> |
firstElementsForRestart |
protected MinOptMax |
footnoteSeparatorLength
footnote separator length
|
protected static org.apache.commons.logging.Log |
log
logging instance
|
protected LayoutManager |
originalRestartAtLM |
protected Position |
positionAtBreak |
protected PageSequenceLayoutManager |
pslm |
| Constructor and Description |
|---|
AbstractBreaker() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addAreas(org.apache.fop.layoutmgr.PageBreakingAlgorithm alg,
int partCount,
AbstractBreaker.BlockSequence originalList,
AbstractBreaker.BlockSequence effectiveList)
Phase 3 of Knuth algorithm: Adds the areas
|
protected void |
addAreas(org.apache.fop.layoutmgr.PageBreakingAlgorithm alg,
int startPart,
int partCount,
AbstractBreaker.BlockSequence originalList,
AbstractBreaker.BlockSequence effectiveList) |
protected void |
addAreas(org.apache.fop.layoutmgr.PageBreakingAlgorithm alg,
int startPart,
int partCount,
AbstractBreaker.BlockSequence originalList,
AbstractBreaker.BlockSequence effectiveList,
LayoutContext childLC)
Phase 3 of Knuth algorithm: Adds the areas
|
protected abstract void |
addAreas(PositionIterator posIter,
LayoutContext context)
Tell the layout manager to add all the child areas implied
by Position objects which will be returned by the
Iterator.
|
protected void |
addAreasForFloats(org.apache.fop.layoutmgr.PageBreakingAlgorithm alg,
int startPart,
int partCount,
AbstractBreaker.BlockSequence originalList,
AbstractBreaker.BlockSequence effectiveList,
LayoutContext childLC,
int lastBreak,
int startElementIndex,
int endElementIndex) |
protected boolean |
containsNonRestartableLM(Position position)
Returns
true if the given position or one of its descendants
corresponds to a non-restartable LM. |
protected LayoutContext |
createLayoutContext()
Creates the top-level LayoutContext for the breaker operation.
|
protected PageBreakingAlgorithm.PageBreakingLayoutListener |
createLayoutListener()
Creates and returns a PageBreakingLayoutListener for the PageBreakingAlgorithm to
notify about layout problems.
|
boolean |
doLayout(int flowBPD,
boolean autoHeight)
Starts the page breaking process.
|
protected abstract void |
doPhase3(org.apache.fop.layoutmgr.PageBreakingAlgorithm alg,
int partCount,
AbstractBreaker.BlockSequence originalList,
AbstractBreaker.BlockSequence effectiveList)
Phase 3 of Knuth algorithm: Adds the areas
|
protected abstract void |
finishPart(org.apache.fop.layoutmgr.PageBreakingAlgorithm alg,
AbstractBreaker.PageBreakPosition pbp)
Finish part.
|
protected abstract LayoutManager |
getCurrentChildLM() |
protected abstract int |
getCurrentDisplayAlign() |
protected int |
getNextBlockList(LayoutContext childLC,
int nextSequenceStartsOn)
Gets the next block list (sequence) and adds it to a list of block lists if it's not empty.
|
protected int |
getNextBlockList(LayoutContext childLC,
int nextSequenceStartsOn,
Position positionAtIPDChange,
LayoutManager restartAtLM,
List<ListElement> firstElements)
Gets the next block list (sequence) and adds it to a list of block lists
if it's not empty.
|
protected abstract List<ListElement> |
getNextKnuthElements(LayoutContext context,
int alignment)
Get a sequence of KnuthElements representing the content
of the node assigned to the LM
|
protected List<ListElement> |
getNextKnuthElements(LayoutContext context,
int alignment,
Position positionAtIPDChange,
LayoutManager restartAtLM)
Get a sequence of KnuthElements representing the content
of the node assigned to the LM
|
protected PageProvider |
getPageProvider()
Returns the PageProvider if any.
|
protected abstract LayoutManager |
getTopLevelLM() |
protected void |
handleEmptyContent()
This method is called when no content is available for a part.
|
protected int |
handleFloatLayout(org.apache.fop.layoutmgr.PageBreakingAlgorithm alg,
int optimalPageCount,
AbstractBreaker.BlockSequence blockList,
LayoutContext childLC) |
protected int |
handleSpanChange(LayoutContext childLC,
int nextSequenceStartsOn)
Handles span changes reported through the
LayoutContext. |
protected abstract boolean |
hasMoreContent() |
boolean |
isEmpty() |
protected boolean |
isPartOverflowRecoveryActivated()
Controls the behaviour of the algorithm in cases where the first element of a part
overflows a line/page.
|
protected boolean |
isSinglePartFavored() |
protected boolean |
lastPageHasIPDChange(int optimalPageCount) |
protected void |
observeElementList(List elementList)
Used for debugging purposes.
|
protected void |
prepareToRedoLayout(org.apache.fop.layoutmgr.PageBreakingAlgorithm alg,
int partCount,
AbstractBreaker.BlockSequence originalList,
AbstractBreaker.BlockSequence effectiveList) |
protected boolean |
shouldRedoLayout() |
protected void |
startPart(AbstractBreaker.BlockSequence list,
int breakClass,
boolean emptyContent)
Start part.
|
protected void |
updateLayoutContext(LayoutContext context)
Used to update the LayoutContext in subclasses prior to starting a new element list.
|
protected boolean |
wasLayoutRedone() |
protected static final org.apache.commons.logging.Log log
protected LayoutManager originalRestartAtLM
protected Position positionAtBreak
protected List<ListElement> firstElementsForRestart
protected PageSequenceLayoutManager pslm
protected List<AbstractBreaker.BlockSequence> blockLists
protected int blockListIndex
protected int alignment
protected MinOptMax footnoteSeparatorLength
protected abstract int getCurrentDisplayAlign()
protected abstract boolean hasMoreContent()
protected abstract void addAreas(PositionIterator posIter, LayoutContext context)
posIter - the position iteratorcontext - the contextprotected abstract LayoutManager getTopLevelLM()
protected abstract LayoutManager getCurrentChildLM()
protected boolean isPartOverflowRecoveryActivated()
protected boolean isSinglePartFavored()
protected PageProvider getPageProvider()
protected PageBreakingAlgorithm.PageBreakingLayoutListener createLayoutListener()
protected abstract List<ListElement> getNextKnuthElements(LayoutContext context, int alignment)
context - the LayoutContext used to store layout informationalignment - the desired text alignmentprotected List<ListElement> getNextKnuthElements(LayoutContext context, int alignment, Position positionAtIPDChange, LayoutManager restartAtLM)
context - the LayoutContext used to store layout informationalignment - the desired text alignmentpositionAtIPDChange - last element on the part before an IPD changerestartAtLM - the layout manager from which to restart, if IPD
change occurs between two LMspublic boolean isEmpty()
protected void startPart(AbstractBreaker.BlockSequence list, int breakClass, boolean emptyContent)
list - a block sequencebreakClass - a break classprotected void handleEmptyContent()
protected abstract void finishPart(org.apache.fop.layoutmgr.PageBreakingAlgorithm alg,
AbstractBreaker.PageBreakPosition pbp)
alg - a page breaking algorithmpbp - a page break posittionprotected LayoutContext createLayoutContext()
protected void updateLayoutContext(LayoutContext context)
context - the LayoutContext to updateprotected void observeElementList(List elementList)
elementList - the Knuth element listpublic boolean doLayout(int flowBPD,
boolean autoHeight)
flowBPD - the constant available block-progression-dimension (used for every part)autoHeight - true if warnings about overflows should be disabled because the
the BPD is really undefined (for footnote-separators, for example)protected boolean containsNonRestartableLM(Position position)
true if the given position or one of its descendants
corresponds to a non-restartable LM.position - a positiontrue if there is a non-restartable LM in the hierarchyprotected abstract void doPhase3(org.apache.fop.layoutmgr.PageBreakingAlgorithm alg,
int partCount,
AbstractBreaker.BlockSequence originalList,
AbstractBreaker.BlockSequence effectiveList)
alg - PageBreakingAlgorithm instance which determined the breakspartCount - number of parts (pages) to be renderedoriginalList - original Knuth element listeffectiveList - effective Knuth element list (after adjustments)protected void addAreas(org.apache.fop.layoutmgr.PageBreakingAlgorithm alg,
int partCount,
AbstractBreaker.BlockSequence originalList,
AbstractBreaker.BlockSequence effectiveList)
alg - PageBreakingAlgorithm instance which determined the breakspartCount - number of parts (pages) to be renderedoriginalList - original Knuth element listeffectiveList - effective Knuth element list (after adjustments)protected void addAreas(org.apache.fop.layoutmgr.PageBreakingAlgorithm alg,
int startPart,
int partCount,
AbstractBreaker.BlockSequence originalList,
AbstractBreaker.BlockSequence effectiveList)
protected void addAreas(org.apache.fop.layoutmgr.PageBreakingAlgorithm alg,
int startPart,
int partCount,
AbstractBreaker.BlockSequence originalList,
AbstractBreaker.BlockSequence effectiveList,
LayoutContext childLC)
alg - PageBreakingAlgorithm instance which determined the breaksstartPart - index of the first part (page) to be renderedpartCount - number of parts (pages) to be renderedoriginalList - original Knuth element listeffectiveList - effective Knuth element list (after adjustments)protected int handleSpanChange(LayoutContext childLC, int nextSequenceStartsOn)
LayoutContext.
Only used by the PSLM and called by getNextBlockList().childLC - the LayoutContextnextSequenceStartsOn - previous value for break handlingprotected int getNextBlockList(LayoutContext childLC, int nextSequenceStartsOn)
childLC - LayoutContext to usenextSequenceStartsOn - indicates on what page the next sequence should startprotected int getNextBlockList(LayoutContext childLC, int nextSequenceStartsOn, Position positionAtIPDChange, LayoutManager restartAtLM, List<ListElement> firstElements)
childLC - LayoutContext to usenextSequenceStartsOn - indicates on what page the next sequence
should startpositionAtIPDChange - last element on the part before an IPD changerestartAtLM - the layout manager from which to restart, if IPD
change occurs between two LMsfirstElements - elements from non-restartable LMs on the new pageprotected boolean shouldRedoLayout()
protected void prepareToRedoLayout(org.apache.fop.layoutmgr.PageBreakingAlgorithm alg,
int partCount,
AbstractBreaker.BlockSequence originalList,
AbstractBreaker.BlockSequence effectiveList)
protected boolean wasLayoutRedone()
protected boolean lastPageHasIPDChange(int optimalPageCount)
protected int handleFloatLayout(org.apache.fop.layoutmgr.PageBreakingAlgorithm alg,
int optimalPageCount,
AbstractBreaker.BlockSequence blockList,
LayoutContext childLC)
protected void addAreasForFloats(org.apache.fop.layoutmgr.PageBreakingAlgorithm alg,
int startPart,
int partCount,
AbstractBreaker.BlockSequence originalList,
AbstractBreaker.BlockSequence effectiveList,
LayoutContext childLC,
int lastBreak,
int startElementIndex,
int endElementIndex)
Copyright © 2025 Apache Software Foundation. All rights reserved.