scenic
Class ImageRenderer

java.lang.Object
  extended by scenic.ImageRenderer

public class ImageRenderer
extends java.lang.Object

This class is used to render a scene graph to an image. The rendering does not take place automatically, instead, the render() method must be called to do the rendering.


Constructor Summary
ImageRenderer(ScenicImage image, SceneNode scene)
          Creates a new ImageRenderer object.
 
Method Summary
 void childChanged(java.awt.Rectangle area)
          Automatically called when the image changes.
 ScenicColor getBgColor()
          Gets the current background color.
 SceneNode getScene()
          Gets the scene that is used for rendering.
 void render()
          Renders the scene to the image.
 void setBgColor(ScenicColor color)
          Sets the background color for the image.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImageRenderer

public ImageRenderer(ScenicImage image,
                     SceneNode scene)
Creates a new ImageRenderer object. Note that the scene is not rendered automatically. Use the render() method to do the rendering.

Parameters:
image - the image that is used as the rendering target
scene - the scene that is rendered to the image.
Method Detail

setBgColor

public void setBgColor(ScenicColor color)
Sets the background color for the image. The background color is used to clear the image before it is rendered. Settings the background color to null will disable clearing of the image. This is useful if you want to do incremental drawing. The default background color is black.

Parameters:
color - the background color

getBgColor

public ScenicColor getBgColor()
Gets the current background color.

Returns:
the background color

getScene

public SceneNode getScene()
Gets the scene that is used for rendering.

Returns:
the scene

render

public void render()
Renders the scene to the image.


childChanged

public void childChanged(java.awt.Rectangle area)
Automatically called when the image changes. Do not call this method yourself.