FileDocCategorySizeDatePackage
RenderGraphics.javaAPI DocphoneME MR2 API (J2ME)3966Wed May 02 18:00:34 BST 2007com.sun.perseus.j2d

RenderGraphics

public class RenderGraphics extends PiscesRenderGraphics
All rendering in Perseus is done through the RenderGraphics class.
RenderGraphics is the combination of the traditional Graphics2D API to the rendering engine and the notion of graphical context found in SVG.

A RenderGraphics object proxies invocation to a Graphics2D instance through its draw or fill method while capturing the current rendering context state by implementing the RenderContext interface.
Note A: the Java 2D graphic context values passed by the RenderGraphics to the proxied Graphics2D correspond to the CSS 2 actual values.
Note B: the initial values for the context properties (such as color or fill) correspond to the CSS 2 initial values for these properties.
see
RenderContext
see
java.awt.Graphics2D
version
$Id: RenderGraphics.java,v 1.5 2006/04/21 06:35:43 st125089 Exp $

Fields Summary
Constructors Summary
public RenderGraphics(com.sun.pisces.PiscesRenderer pr, int width, int height)
Constructs a new RenderGraphics which will delegate painting operations to a Graphics2D built for the input BufferedImage.

param
pr the PiscesRenderer to render to.
param
width the rendering surface width. Should be greater than zero.
param
height the rendering surface height. Should be greater than zero.
throws
NullPointerException if bi is null
throws
NullPointerException if bi is null

        super(pr, width, height);
    
Methods Summary
public voidclearRect(int x, int y, int width, int height, RGB clearColor)
Clears the specified rectangle. IMPORTANT NOTE: the coordinates are in device space. This method does not account for the current transformation set on the RenderGraphics. It operates on the target pixels.

param
x - the x coordinate of the rectangle to clear.
param
y - the y coordinate of the rectangle to clear.
param
width - the width of the rectangle to clear.
param
height - the height of the rectangle to clear.
param
clearColor - the color to use to clear the rectangle.

        pr.setColor(clearColor.getRed(), 
                    clearColor.getGreen(), 
                    clearColor.getBlue(),
                    clearColor.getAlpha());
        pr.clearRect(x, y, width, height);