fop 0.95

org.apache.fop.layoutmgr
Class PageBreaker

java.lang.Object
  extended by org.apache.fop.layoutmgr.AbstractBreaker
      extended by org.apache.fop.layoutmgr.PageBreaker

public class PageBreaker
extends AbstractBreaker

Handles the breaking of pages in an fo:flow


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.fop.layoutmgr.AbstractBreaker
AbstractBreaker.BlockSequence, AbstractBreaker.PageBreakPosition
 
Field Summary
 
Fields inherited from class org.apache.fop.layoutmgr.AbstractBreaker
alignment, footnoteSeparatorLength, log
 
Constructor Summary
PageBreaker(PageSequenceLayoutManager pslm)
           
 
Method Summary
protected  void addAreas(PositionIterator posIter, LayoutContext context)
          Adds an area to the flow layout manager
protected  void doPhase3(org.apache.fop.layoutmgr.PageBreakingAlgorithm alg, int partCount, AbstractBreaker.BlockSequence originalList, AbstractBreaker.BlockSequence effectiveList)
          Performs phase 3 operation
protected  void finishPart(org.apache.fop.layoutmgr.PageBreakingAlgorithm alg, AbstractBreaker.PageBreakPosition pbp)
           
protected  LayoutManager getCurrentChildLM()
           
protected  int getCurrentDisplayAlign()
           
protected  PageBreakingAlgorithm.PageBreakingLayoutListener getLayoutListener()
          Returns a PageBreakingLayoutListener for the PageBreakingAlgorithm to notify about layout problems.
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  java.util.LinkedList getNextKnuthElements(LayoutContext context, int alignment)
          
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  int handleSpanChange(LayoutContext childLC, int nextSequenceStartsOn)
          Handles span changes reported through the LayoutContext.
protected  boolean hasMoreContent()
           
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.
 
Methods inherited from class org.apache.fop.layoutmgr.AbstractBreaker
addAreas, addAreas, createLayoutContext, doLayout, doLayout, isEmpty, isPartOverflowRecoveryActivated, isSinglePartFavored
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PageBreaker

public PageBreaker(PageSequenceLayoutManager pslm)
Method Detail

updateLayoutContext

protected void updateLayoutContext(LayoutContext context)
Used to update the LayoutContext in subclasses prior to starting a new element list.

Overrides:
updateLayoutContext in class AbstractBreaker
Parameters:
context - the LayoutContext to update

getTopLevelLM

protected LayoutManager getTopLevelLM()

Specified by:
getTopLevelLM in class AbstractBreaker

getPageProvider

protected PageProvider getPageProvider()
Returns the PageProvider if any. PageBreaker overrides this method because each page may have a different available BPD which needs to be accessible to the breaking algorithm.

Overrides:
getPageProvider in class AbstractBreaker
Returns:
the applicable PageProvider, or null if not applicable

getLayoutListener

protected PageBreakingAlgorithm.PageBreakingLayoutListener getLayoutListener()
Returns a PageBreakingLayoutListener for the PageBreakingAlgorithm to notify about layout problems.

Overrides:
getLayoutListener in class AbstractBreaker
Returns:
the listener instance or null if no notifications are needed

handleSpanChange

protected int handleSpanChange(LayoutContext childLC,
                               int nextSequenceStartsOn)
Handles span changes reported through the LayoutContext. Only used by the PSLM and called by getNextBlockList().

Overrides:
handleSpanChange in class AbstractBreaker
Parameters:
childLC - the LayoutContext
nextSequenceStartsOn - previous value for break handling
Returns:
effective value for break handling

getNextBlockList

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.

Overrides:
getNextBlockList in class AbstractBreaker
Parameters:
childLC - LayoutContext to use
nextSequenceStartsOn - indicates on what page the next sequence should start
Returns:
the page on which the next content should appear after a hard break

getNextKnuthElements

protected java.util.LinkedList getNextKnuthElements(LayoutContext context,
                                                    int alignment)

Specified by:
getNextKnuthElements in class AbstractBreaker

getCurrentDisplayAlign

protected int getCurrentDisplayAlign()
Specified by:
getCurrentDisplayAlign in class AbstractBreaker
Returns:
current display alignment

hasMoreContent

protected boolean hasMoreContent()
Specified by:
hasMoreContent in class AbstractBreaker
Returns:
whether or not this flow has more page break opportunities

addAreas

protected void addAreas(PositionIterator posIter,
                        LayoutContext context)
Adds an area to the flow layout manager

Specified by:
addAreas in class AbstractBreaker
Parameters:
posIter - the position iterator
context - the layout context

doPhase3

protected void doPhase3(org.apache.fop.layoutmgr.PageBreakingAlgorithm alg,
                        int partCount,
                        AbstractBreaker.BlockSequence originalList,
                        AbstractBreaker.BlockSequence effectiveList)
Performs phase 3 operation

Specified by:
doPhase3 in class AbstractBreaker
Parameters:
alg - page breaking algorithm
partCount - part count
originalList - the block sequence original list
effectiveList - the block sequence effective list

startPart

protected void startPart(AbstractBreaker.BlockSequence list,
                         int breakClass)
Overrides:
startPart in class AbstractBreaker

handleEmptyContent

protected void handleEmptyContent()
This method is called when no content is available for a part. Used to force empty pages.

Overrides:
handleEmptyContent in class AbstractBreaker

finishPart

protected void finishPart(org.apache.fop.layoutmgr.PageBreakingAlgorithm alg,
                          AbstractBreaker.PageBreakPosition pbp)
Specified by:
finishPart in class AbstractBreaker

getCurrentChildLM

protected LayoutManager getCurrentChildLM()
Specified by:
getCurrentChildLM in class AbstractBreaker
Returns:
the current child flow layout manager

observeElementList

protected void observeElementList(java.util.List elementList)
Used for debugging purposes. Notifies all registered observers about the element list. Override to set different parameters.

Overrides:
observeElementList in class AbstractBreaker
Parameters:
elementList - the Knuth element list

fop 0.95

Copyright 1999-2008 The Apache Software Foundation. All Rights Reserved.