fop 0.91beta

org.apache.fop.layoutmgr
Class PageSequenceLayoutManager.PageViewportProvider

java.lang.Object
  |
  +--org.apache.fop.layoutmgr.PageSequenceLayoutManager.PageViewportProvider
Enclosing class:
PageSequenceLayoutManager

public class PageSequenceLayoutManager.PageViewportProvider
extends java.lang.Object

This class delivers PageViewport instances. It also caches them as necessary.

Additional functionality makes sure that surplus instances that are requested by the page breaker are properly discarded, especially in situations where hard breaks cause blank pages. The reason for that: The page breaker sometimes needs to preallocate additional pages since it doesn't know exactly until the end how many pages it really needs.


Field Summary
static int RELTO_CURRENT_ELEMENT_LIST
          Indices are evaluated relative to the first page in the current element list.
static int RELTO_PAGE_SEQUENCE
          Indices are evaluated relative to the first page in the page-sequence.
 
Constructor Summary
PageSequenceLayoutManager.PageViewportProvider(PageSequence ps)
          Main constructor.
 
Method Summary
 int getAvailableBPD(int index)
          Returns the available BPD for the part/page indicated by the index parameter.
 PageViewport getPageViewport(boolean bIsBlank, int index, int relativeTo)
          Returns a PageViewport.
 int getStartingPartIndexForLastPage(int partCount)
          Returns the part index (0
 void setStartOfNextElementList(int startPage, int startColumn)
          The page breaker notifies the provider about the page number an element list starts on so it can later retrieve PageViewports relative to this first page.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RELTO_PAGE_SEQUENCE

public static final int RELTO_PAGE_SEQUENCE
Indices are evaluated relative to the first page in the page-sequence.

RELTO_CURRENT_ELEMENT_LIST

public static final int RELTO_CURRENT_ELEMENT_LIST
Indices are evaluated relative to the first page in the current element list.
Constructor Detail

PageSequenceLayoutManager.PageViewportProvider

public PageSequenceLayoutManager.PageViewportProvider(PageSequence ps)
Main constructor.
Parameters:
ps - The page-sequence the provider operates on
Method Detail

setStartOfNextElementList

public void setStartOfNextElementList(int startPage,
                                      int startColumn)
The page breaker notifies the provider about the page number an element list starts on so it can later retrieve PageViewports relative to this first page.
Parameters:
startPage - the number of the first page for the element list.
startColumn - the starting column number for the element list.

getAvailableBPD

public int getAvailableBPD(int index)
Returns the available BPD for the part/page indicated by the index parameter. The index is the part/page relative to the start of the current element list. This method takes multiple columns into account.
Parameters:
index - zero-based index of the requested part/page
Returns:
the available BPD

getStartingPartIndexForLastPage

public int getStartingPartIndexForLastPage(int partCount)
Returns the part index (0
Parameters:
partCount - Number of parts determined by the breaking algorithm
Returns:
the requested part index

getPageViewport

public PageViewport getPageViewport(boolean bIsBlank,
                                    int index,
                                    int relativeTo)
Returns a PageViewport.
Parameters:
bIsBlank - true if this page is supposed to be blank.
index - Index of the page (see relativeTo)
relativeTo - Defines which value the index parameter should be evaluated relative to. (One of PageViewportProvider.RELTO_*)
Returns:
the requested PageViewport

fop 0.91beta

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