org.apache.batik.gvt.renderer
Class MacRenderer
public
class
MacRenderer
extends Object
implements ImageRenderer
Simple implementation of the Renderer that supports dynamic updates.
Method Summary |
void | clearOffScreen()
Sets up and clears the current offscreen buffer.
|
void | dispose() |
void | flush() |
void | flush(Rectangle r) |
void | flush(Collection areas)
Flush a list of rectangles of cached image data. |
BufferedImage | getOffScreen()
Returns the current offscreen image.
|
RenderingHints | getRenderingHints() |
AffineTransform | getTransform()
Returns the transform from the current user space (as defined
by the top node of the GVT tree) to the device space. |
GraphicsNode | getTree()
Returns the GVT tree associated with this renderer |
boolean | isDoubleBuffered()
Returns true if the Renderer is currently doubleBuffering is
rendering requests. |
void | repaint(Shape area) |
void | repaint(RectListManager devRLM)
Repaints the associated GVT tree under the list of areas.
|
void | setDoubleBuffered(boolean isDoubleBuffered)
Turns on/off double buffering in renderer. |
void | setRenderingHints(RenderingHints rh) |
void | setTransform(AffineTransform usr2dev)
Sets the transform from the current user space (as defined by
the top node of the GVT tree, to the associated device space. |
void | setTree(GraphicsNode treeRoot)
This associates the given GVT Tree with this renderer.
|
void | updateOffScreen(int width, int height)
Update the size of the image to be returned by getOffScreen.
|
protected void | updateWorkingBuffers() |
protected BufferedImage currImg
protected static RenderingHints defaultRenderingHints
protected boolean isDoubleBuffered
public static int IMAGE_TYPE
protected int offScreenHeight
protected int offScreenWidth
protected RenderingHints renderingHints
public static Color TRANSPARENT_WHITE
protected AffineTransform usr2dev
protected BufferedImage workImg
public MacRenderer()
Constructs a new dynamic renderer with the specified buffer image.
public MacRenderer(RenderingHints rh, AffineTransform at)
public void clearOffScreen()
Sets up and clears the current offscreen buffer.
When not double buffering one should call this method before
calling getOffscreen to get the offscreen being drawn into.
This ensures the buffer is up to date and doesn't contain junk.
When double buffering this call can effectively be skipped,
since getOffscreen will only refect the new rendering after
repaint completes.
public void dispose()
public void flush()
public void flush(Rectangle r)
public void flush(Collection areas)
Flush a list of rectangles of cached image data.
public BufferedImage getOffScreen()
Returns the current offscreen image.
The exact symantics of this vary base on the value of
isDoubleBuffered. If isDoubleBuffered is false this will
return the image currently being worked on as soon as it is
available.
if isDoubleBuffered is false this will return the most recently
completed result of repaint.
public RenderingHints getRenderingHints()
Returns: the RenderingHints which the Renderer is using for its
rendering
public AffineTransform getTransform()
Returns the transform from the current user space (as defined
by the top node of the GVT tree) to the device space.
Returns the GVT tree associated with this renderer
public boolean isDoubleBuffered()
Returns true if the Renderer is currently doubleBuffering is
rendering requests. If it is then getOffscreen will only
return completed renderings (or null if nothing is available).
public void repaint(Shape area)
Repaints the associated GVT tree under the list of
areas.
If double buffered is true and this method completes cleanly it
will set the result of the repaint as the image returned by
getOffscreen otherwise the old image will still be returned.
If double buffered is false it is possible some effects of
the failed rendering will be visible in the image returned
by getOffscreen.
Parameters: devRLM regions to be repainted, in the current
user space coordinate system.
public void setDoubleBuffered(boolean isDoubleBuffered)
Turns on/off double buffering in renderer. Turning off
double buffering makes it possible to see the ongoing results
of a render operation.
Parameters: isDoubleBuffered the new value for double buffering
public void setRenderingHints(RenderingHints rh)
Parameters: rh Set of rendering hints to use for future renderings
public void setTransform(AffineTransform usr2dev)
Sets the transform from the current user space (as defined by
the top node of the GVT tree, to the associated device space.
This associates the given GVT Tree with this renderer.
Any previous tree association is forgotten.
Not certain if this should be just GraphicsNode, or CanvasGraphicsNode.
public void updateOffScreen(int width, int height)
Update the size of the image to be returned by getOffScreen.
Note that this change will not be reflected by calls to
getOffscreen until either clearOffScreen has completed (when
isDoubleBuffered is false) or reapint has completed (when
isDoubleBuffered is true).
protected void updateWorkingBuffers()
Copyright B) 2007 Apache Software Foundation. All Rights Reserved.