com.levigo.jadice.document.render
Class AbstractPageRenderer

java.lang.Object
  extended by com.levigo.jadice.document.render.AbstractPageRenderer
Direct Known Subclasses:
PageImageRenderer, PageRenderer

public abstract class AbstractPageRenderer
extends Object

An abstract base class to render the contents of a page into any valid Graphics2D. This class may be used as a base class for page renderers.


Constructor Summary
AbstractPageRenderer()
           
 
Method Summary
 Page getPage()
          Returns the page to be rendered.
 RenderControls getRenderControls()
          Returns the render controls which will be applied the next time the page is rendered into a buffered image, in other words when the render(Graphics2D) method will be called.
protected abstract  void render(Graphics2D target)
          Paint a Page.
 void setPage(Page page)
          Changes the page reference, which will be rendered the next time the render(Graphics2D) method will be called.
 void setRenderControls(RenderControls renderControls)
          Changes the render controls which will be applied the next time the page is rendered, i.e.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractPageRenderer

public AbstractPageRenderer()
Method Detail

render

protected abstract void render(Graphics2D target)
                        throws JadiceException
Paint a Page. This method will paint the Page set using setPage(Page) or if the Page is null, return immediately.

Parameters:
target - the Graphics2D to paint to.
Throws:
JadiceException - will be thrown if the initialization or the rendering of the Page failed.

getPage

public Page getPage()
Returns the page to be rendered.

Returns:
Page

setPage

public void setPage(Page page)
Changes the page reference, which will be rendered the next time the render(Graphics2D) method will be called.

Parameters:
page - another page to be rendered

getRenderControls

public RenderControls getRenderControls()
Returns the render controls which will be applied the next time the page is rendered into a buffered image, in other words when the render(Graphics2D) method will be called. If the render controls are null, a default render context with zoom 100%, rotation 0 and deviceResolution 72dpi will be assumed.

Returns:
render context

setRenderControls

public void setRenderControls(RenderControls renderControls)
Changes the render controls which will be applied the next time the page is rendered, i.e. when the render(Graphics2D) method will be called. If the render context is set to null, a default render context with zoom 100%, rotation 0 and deviceResolution 72dpi will be assumed.

Parameters:
renderControls - render controls to be applied while rendering


Copyright © 1995-2020 levigo holding gmbh. All Rights Reserved.