com.levigo.jadice.document.render
Class BasicRenderParameters

java.lang.Object
  extended by com.levigo.jadice.document.render.BasicRenderParameters
Direct Known Subclasses:
RenderParameters

public class BasicRenderParameters
extends Object

A base class used to provide several parameters for rendering purposes.


Field Summary
protected  Graphics2D graphics
           
protected  Page page
           
protected  int pageIndex
           
protected  RenderControls renderControls
           
protected  Rectangle renderedPageBounds
           
protected  AffineTransform transform
           
 
Constructor Summary
BasicRenderParameters(Page page, int pageIndex, Rectangle bounds, Graphics2D graphics, RenderControls renderControls)
          Constructor
 
Method Summary
 Graphics2D getGraphics()
          Get the Graphics2D into which the rendering is supposed to render (if it wants to).
 Page getPage()
          The Page that is being rendered.
 int getPageIndex()
          The index of the page being rendered.
 RenderControls getRenderControls()
          The RenderControls used to render the page.
 Rectangle getRenderedPageBounds()
          Return the rendered page's bounds.
 Dimension getRenderSize()
          The size at which the page is being rendered.
 AffineTransform getTransform()
          Return the transform from document to rendered space.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

page

protected final Page page

pageIndex

protected final int pageIndex

renderedPageBounds

protected final Rectangle renderedPageBounds

renderControls

protected final RenderControls renderControls

graphics

protected final Graphics2D graphics

transform

protected AffineTransform transform
Constructor Detail

BasicRenderParameters

public BasicRenderParameters(Page page,
                             int pageIndex,
                             Rectangle bounds,
                             Graphics2D graphics,
                             RenderControls renderControls)
Constructor

Parameters:
page - the page that is being rendered
pageIndex - a zero based page index of the rendered page
bounds - the size at which the page is being rendered.
graphics - a Graphics2D object into which the rendering can be done
renderControls - rendering controls used to render the page
Method Detail

getPage

public Page getPage()
The Page that is being rendered.

Returns:
the page

getPageIndex

public int getPageIndex()
The index of the page being rendered.

Returns:
the pageIndex

getRenderSize

public Dimension getRenderSize()
The size at which the page is being rendered.

Returns:
the renderSize

getRenderedPageBounds

public Rectangle getRenderedPageBounds()
Return the rendered page's bounds. Please note that the accompanying graphics context is already translated to the bounds' origin.

Returns:
the bounds

getRenderControls

public RenderControls getRenderControls()
The RenderControls used to render the page.

Returns:
the RenderControls

getGraphics

public Graphics2D getGraphics()
Get the Graphics2D into which the rendering is supposed to render (if it wants to). The graphics context will be transformed, so that its origin rests at the upper-left corner of the page.

Returns:
the graphics

getTransform

public AffineTransform getTransform()
Return the transform from document to rendered space. This method is equivalent to renderParameters.getRenderControls() .getBaseRenderSettings().getAffineTransform( renderParameters.getPage().getSize() ) However, the transform is created only once and cached.

Returns:
the affine transform.


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