|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--org.writersforge.catalan.renderers.Renderer
Abstract base class for rendering Page objects into a final output format. The Renderer will always work on a Book object. The Book should be processed with a RenderTemplate beforehand, and typically a LayoutEngine too. The type of output will depend on the subclass of Renderer.
Derived Renderers can override rendering at the Book level, at the Page level, and at the LayoutArea level. The default implementation of Book and Page rendering should be sufficient for most purposes. The renderArea() method is the most important in this class, and is the one that does all the real Renderer-specific work.
The startPage() and endPage() methods should be overridden if any resources need to be allocated for each Page. Likewise, global resources should be managed in startBook() and endBook().
| Constructor Summary | |
Renderer()
|
|
| Method Summary | |
protected void |
endBook(Book book)
Performs any cleanup that the Renderer must do at the end of the rendering process. |
protected void |
endPage(Page page)
Performs any cleanup that the Renderer must do after every Page. |
void |
render(Book book)
Renders an entire Book, pulling all data from the Book's Page array. |
protected void |
renderArea(LayoutArea area)
Renders a single LayoutArea object within the current Page. |
protected void |
renderPage(Book book,
int pageNumber)
Renders a single page of a book. |
protected abstract void |
renderShapeArea(LayoutShape shapeArea)
Renders a single LayoutShape area within the current Page. |
protected abstract void |
renderTextArea(LayoutText textArea)
Renders a single LayoutText area within the current Page. |
protected void |
startBook(Book book)
Performs any special initialization that the Renderer must do at the very beginning of the rendering process. |
protected void |
startPage(Page page)
Performs any special initialization that the Renderer must do before every Page. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public Renderer()
| Method Detail |
protected void renderArea(LayoutArea area)
This base class implementation delegates rendering to
renderTextArea() for all LayoutText objects, and
renderShapeArea() for all LayoutShape objects. If a
renderer needs to support other area types, it can override this
method; however, for most cases this implementation should work fine.
area - the LayoutArea object to renderprotected abstract void renderTextArea(LayoutText textArea)
textArea - the LayoutText object to renderprotected abstract void renderShapeArea(LayoutShape shapeArea)
shapeArea - the LayoutArea object to renderprotected void startBook(Book book)
book - the Book object to initialize withprotected void endBook(Book book)
book - the Book object to clean upprotected void startPage(Page page)
page - the Page object to initialize withprotected void endPage(Page page)
page - the Page object to clean up
protected void renderPage(Book book,
int pageNumber)
book - the Book to renderpageNumber - the page index number to renderpublic void render(Book book)
book - the Book to render
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||