public abstract class AbstractBreaker
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
class |
AbstractBreaker.BlockSequence
Helper class, extending the functionality of the
basic
BlockKnuthSequence . |
static class |
AbstractBreaker.PageBreakPosition |
Modifier and Type | Field and Description |
---|---|
protected int |
alignment |
protected MinOptMax |
footnoteSeparatorLength |
protected static org.apache.commons.logging.Log |
log
logging instance
|
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)
Phase 3 of Knuth algorithm: Adds the areas
|
protected abstract void |
addAreas(PositionIterator posIter,
LayoutContext context) |
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.
|
void |
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) |
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,
java.util.List firstElements)
Gets the next block list (sequence) and adds it to a list of block lists
if it's not empty.
|
protected abstract java.util.List |
getNextKnuthElements(LayoutContext context,
int alignment) |
protected java.util.List |
getNextKnuthElements(LayoutContext context,
int alignment,
Position positionAtIPDChange,
LayoutManager restartAtLM) |
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 |
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 void |
observeElementList(java.util.List elementList)
Used for debugging purposes.
|
protected void |
startPart(AbstractBreaker.BlockSequence list,
int breakClass) |
protected void |
updateLayoutContext(LayoutContext context)
Used to update the LayoutContext in subclasses prior to starting a new element list.
|
protected static org.apache.commons.logging.Log log
protected int alignment
protected MinOptMax footnoteSeparatorLength
protected abstract int getCurrentDisplayAlign()
protected abstract boolean hasMoreContent()
protected abstract void addAreas(PositionIterator posIter, LayoutContext context)
protected abstract LayoutManager getTopLevelLM()
protected abstract LayoutManager getCurrentChildLM()
protected boolean isPartOverflowRecoveryActivated()
protected boolean isSinglePartFavored()
protected PageProvider getPageProvider()
protected PageBreakingAlgorithm.PageBreakingLayoutListener createLayoutListener()
protected abstract java.util.List getNextKnuthElements(LayoutContext context, int alignment)
protected java.util.List getNextKnuthElements(LayoutContext context, int alignment, Position positionAtIPDChange, LayoutManager restartAtLM)
public boolean isEmpty()
protected void startPart(AbstractBreaker.BlockSequence list, int breakClass)
protected void handleEmptyContent()
protected abstract void finishPart(org.apache.fop.layoutmgr.PageBreakingAlgorithm alg, AbstractBreaker.PageBreakPosition pbp)
protected LayoutContext createLayoutContext()
protected void updateLayoutContext(LayoutContext context)
context
- the LayoutContext to updateprotected void observeElementList(java.util.List elementList)
elementList
- the Knuth element listpublic void 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 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)
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, java.util.List 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 pageCopyright 1999-2010 The Apache Software Foundation. All Rights Reserved.