public class PageBreaker extends AbstractBreaker
AbstractBreaker.BlockSequence, AbstractBreaker.FloatPosition, AbstractBreaker.PageBreakPosition
alignment, blockListIndex, blockLists, firstElementsForRestart, footnoteSeparatorLength, log, originalRestartAtLM, positionAtBreak, pslm
Constructor and Description |
---|
PageBreaker(PageSequenceLayoutManager pslm)
Construct page breaker.
|
Modifier and Type | Method and Description |
---|---|
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 void |
addAreas(PositionIterator posIter,
LayoutContext context)
Adds an area to the flow layout manager
|
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 PageBreakingAlgorithm.PageBreakingLayoutListener |
createLayoutListener()
Creates and returns a PageBreakingLayoutListener for the PageBreakingAlgorithm to
notify about layout problems.
|
protected 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 void |
finishPart(org.apache.fop.layoutmgr.PageBreakingAlgorithm alg,
AbstractBreaker.PageBreakPosition pbp)
Finish part.
|
protected FlowLayoutManager |
getCurrentChildLM() |
protected int |
getCurrentDisplayAlign() |
protected int |
getFloatHeight() |
protected int |
getFloatYOffset() |
static List<List<KnuthElement>> |
getFootnoteKnuthElements(FlowLayoutManager flowLM,
LayoutContext context,
List<FootnoteBodyLayoutManager> footnoteBodyLMs) |
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 restartLM,
List<ListElement> firstElements)
Gets the next block list (sequence) and adds it to a list of block lists
if it's not empty.
|
protected 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
|
int |
getOffsetDueToFloat() |
protected PageProvider |
getPageProvider()
Returns the PageProvider if any.
|
protected LayoutManager |
getTopLevelLM() |
protected void |
handleEmptyContent()
This method is called when no content is available for a part.
|
protected void |
handleEndOfFloat(int fHeight) |
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 void |
handleStartOfFloat(int fHeight,
int fYOffset) |
protected boolean |
handlingEndOfFloat() |
protected boolean |
handlingFloat() |
protected boolean |
handlingStartOfFloat() |
protected boolean |
hasMoreContent() |
void |
holdFootnotes(List fl,
List<Integer> ll,
int tfl,
int ifl,
boolean fp,
boolean nf,
int fnfi,
int fli,
int fei,
MinOptMax fsl,
int pfli,
int pfei) |
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) |
void |
retrieveFootones(org.apache.fop.layoutmgr.PageBreakingAlgorithm alg) |
protected boolean |
shouldRedoLayout() |
protected boolean |
shouldRedoLayout(int partCount) |
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() |
addAreas, addAreas, containsNonRestartableLM, createLayoutContext, doLayout, isEmpty, isPartOverflowRecoveryActivated, isSinglePartFavored
public PageBreaker(PageSequenceLayoutManager pslm)
pslm
- the page sequence layout managerprotected void updateLayoutContext(LayoutContext context)
updateLayoutContext
in class AbstractBreaker
context
- the LayoutContext to updateprotected LayoutManager getTopLevelLM()
getTopLevelLM
in class AbstractBreaker
protected PageProvider getPageProvider()
getPageProvider
in class AbstractBreaker
protected PageBreakingAlgorithm.PageBreakingLayoutListener createLayoutListener()
createLayoutListener
in class AbstractBreaker
protected int handleSpanChange(LayoutContext childLC, int nextSequenceStartsOn)
LayoutContext
.
Only used by the PSLM and called by getNextBlockList()
.handleSpanChange
in class AbstractBreaker
childLC
- the LayoutContextnextSequenceStartsOn
- previous value for break handlingprotected int getNextBlockList(LayoutContext childLC, int nextSequenceStartsOn)
getNextBlockList
in class AbstractBreaker
childLC
- LayoutContext to usenextSequenceStartsOn
- indicates on what page the next sequence should startprotected int getNextBlockList(LayoutContext childLC, int nextSequenceStartsOn, Position positionAtIPDChange, LayoutManager restartLM, List<ListElement> firstElements)
getNextBlockList
in class AbstractBreaker
childLC
- LayoutContext to usenextSequenceStartsOn
- indicates on what page the next sequence
should startpositionAtIPDChange
- last element on the part before an IPD changerestartLM
- the layout manager from which to restart, if IPD
change occurs between two LMsfirstElements
- elements from non-restartable LMs on the new pagepublic static List<List<KnuthElement>> getFootnoteKnuthElements(FlowLayoutManager flowLM, LayoutContext context, List<FootnoteBodyLayoutManager> footnoteBodyLMs)
protected List<ListElement> getNextKnuthElements(LayoutContext context, int alignment)
getNextKnuthElements
in class AbstractBreaker
context
- the LayoutContext used to store layout informationalignment
- the desired text alignmentprotected List<ListElement> getNextKnuthElements(LayoutContext context, int alignment, Position positionAtIPDChange, LayoutManager restartAtLM)
getNextKnuthElements
in class AbstractBreaker
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 LMsprotected int getCurrentDisplayAlign()
getCurrentDisplayAlign
in class AbstractBreaker
protected boolean hasMoreContent()
hasMoreContent
in class AbstractBreaker
protected void addAreas(PositionIterator posIter, LayoutContext context)
addAreas
in class AbstractBreaker
posIter
- the position iteratorcontext
- the layout contextprotected void doPhase3(org.apache.fop.layoutmgr.PageBreakingAlgorithm alg, int partCount, AbstractBreaker.BlockSequence originalList, AbstractBreaker.BlockSequence effectiveList)
doPhase3
in class AbstractBreaker
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 prepareToRedoLayout(org.apache.fop.layoutmgr.PageBreakingAlgorithm alg, int partCount, AbstractBreaker.BlockSequence originalList, AbstractBreaker.BlockSequence effectiveList)
prepareToRedoLayout
in class AbstractBreaker
protected void startPart(AbstractBreaker.BlockSequence list, int breakClass, boolean emptyContent)
startPart
in class AbstractBreaker
list
- a block sequencebreakClass
- a break classprotected void handleEmptyContent()
handleEmptyContent
in class AbstractBreaker
protected void finishPart(org.apache.fop.layoutmgr.PageBreakingAlgorithm alg, AbstractBreaker.PageBreakPosition pbp)
finishPart
in class AbstractBreaker
alg
- a page breaking algorithmpbp
- a page break posittionprotected FlowLayoutManager getCurrentChildLM()
getCurrentChildLM
in class AbstractBreaker
protected void observeElementList(List elementList)
observeElementList
in class AbstractBreaker
elementList
- the Knuth element listprotected boolean shouldRedoLayout()
shouldRedoLayout
in class AbstractBreaker
protected boolean shouldRedoLayout(int partCount)
protected boolean wasLayoutRedone()
wasLayoutRedone
in class AbstractBreaker
protected boolean lastPageHasIPDChange(int optimalPageCount)
lastPageHasIPDChange
in class AbstractBreaker
protected boolean handlingStartOfFloat()
protected void handleStartOfFloat(int fHeight, int fYOffset)
protected int getFloatHeight()
protected int getFloatYOffset()
protected boolean handlingEndOfFloat()
protected void handleEndOfFloat(int fHeight)
protected boolean handlingFloat()
public int getOffsetDueToFloat()
protected int handleFloatLayout(org.apache.fop.layoutmgr.PageBreakingAlgorithm alg, int optimalPageCount, AbstractBreaker.BlockSequence blockList, LayoutContext childLC)
handleFloatLayout
in class AbstractBreaker
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)
addAreasForFloats
in class AbstractBreaker
public void holdFootnotes(List fl, List<Integer> ll, int tfl, int ifl, boolean fp, boolean nf, int fnfi, int fli, int fei, MinOptMax fsl, int pfli, int pfei)
public void retrieveFootones(org.apache.fop.layoutmgr.PageBreakingAlgorithm alg)
protected void addAreas(org.apache.fop.layoutmgr.PageBreakingAlgorithm alg, int startPart, int partCount, AbstractBreaker.BlockSequence originalList, AbstractBreaker.BlockSequence effectiveList, LayoutContext childLC)
AbstractBreaker
addAreas
in class AbstractBreaker
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)Copyright © 2025 Apache Software Foundation. All rights reserved.