org.apache.fop.area
Class RenderPagesModel
public class RenderPagesModel
This uses the AreaTreeModel to store the pages
Each page is either rendered if ready or prepared
for later rendering.
Once a page is rendered it is cleared to release the
contents but the PageViewport is retained. So even
though the pages are stored the contents are discarded.
protected List | prepared - Pages that have been prepared but not rendered yet.
|
protected Renderer | renderer - The renderer that will render the pages.
|
prepared
protected List prepared
Pages that have been prepared but not rendered yet.
renderer
protected Renderer renderer
The renderer that will render the pages.
RenderPagesModel
public RenderPagesModel(FOUserAgent userAgent,
String outputFormat,
FontInfo fontInfo,
OutputStream stream)
throws FOPException
Create a new render pages model with the given renderer.
userAgent
- FOUserAgent object for processoutputFormat
- the MIME type of the output format to use (ex. "application/pdf").fontInfo
- FontInfo objectstream
- OutputStream
FOPException
- if the renderer cannot be properly initialized
addPage
public void addPage(PageViewport page)
Add a page to the render page model.
If the page is finished it can be rendered immediately.
If the page needs resolving then if the renderer supports
out of order rendering it can prepare the page. Otherwise
the page is added to a queue.
- addPage in interface AreaTreeModel
page
- the page to add to the model
checkPreparedPages
protected boolean checkPreparedPages(PageViewport newPageViewport,
boolean renderUnresolved)
Check prepared pages
newPageViewport
- the new page being addedrenderUnresolved
- render pages with unresolved idref's
(done at end-of-document processing)
- true if the current page should be rendered
false if the renderer doesn't support out of order
rendering and there are pending pages
endDocument
public void endDocument()
throws SAXException
End the document. Render any end document OffDocumentItems
- endDocument in interface AreaTreeModel
preparePage
protected void preparePage(PageViewport page)
Prepare a page.
An unresolved page can be prepared if the renderer supports
it and the page will be rendered later.
page
- the page to prepare
startPageSequence
public void startPageSequence(LineArea title)
Start a new page sequence.
This tells the renderer that a new page sequence has
started with the given title.
- startPageSequence in interface AreaTreeModel
title
- the title of the new page sequence
Copyright 1999-2007 The Apache Software Foundation. All Rights Reserved.