| java.lang.Object com.sun.perseus.j2d.RenderContext com.sun.perseus.j2d.PiscesRenderGraphics
All known Subclasses: com.sun.perseus.j2d.RenderGraphics,
PiscesRenderGraphics | abstract public class PiscesRenderGraphics extends RenderContext (Code) | | 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 Also: RenderContext See Also: java.awt.Graphics2D |
Constructor Summary | |
public | PiscesRenderGraphics(PiscesRenderer pr, int width, int height) Constructs a new PiscesRenderGraphics which will delegate painting
operations to a PiscesRenderer .
Parameters: pr - the PiscesRenderer to render to. Parameters: width - the rendering surface width. |
Method Summary | |
void | applyClip() | abstract public void | clearRect(int x, int y, int width, int height, RGB clearColor) Clears the specified rectangle. | public void | draw(Path path) | public void | drawImage(RasterImage image, float dx, float dy, float dw, float dh) | public void | drawLine(float x1, float y1, float x2, float y2) | public void | drawOval(float x, float y, float w, float h) | public void | drawRect(float x, float y, float w, float h, float aw, float ah) | public void | fill(Path path) fills the input shape with the current fill color. | void | fillOrDraw(Path path, PaintServer paint, int opOpacity, boolean isFill) Parameters: path - the Path to fill or draw. Parameters: paint - the paint to use for the operation. Parameters: opOpacity - the opacity to use for the operation. Parameters: isFill - if true, this is a fill operation. | public void | fillOval(float x, float y, float w, float h) | public void | fillRect(float x, float y, float w, float h, float aw, float ah) Fills a rectangle. | public Tile | getPrimitiveTile() the current user clip tile. | public Tile | getRenderingTile() the current rendering tile. | public void | setPaintTarget(PaintTarget paintTarget) Sets the current PaintTarget. | public void | setPaintTransform(Transform paintTransform) Sets the current paintTransform. | public void | setPrimitiveTile(Tile primitiveTile) Sets the primitive tile, which is intersected with the rendering tile. | public void | setRenderingQuality(boolean isHigh) Turns the high quality rendering on or off. | public void | setRenderingTile(Tile renderingTile) Sets the current rendering tile to the rectangle specified by the given
tile. | public void | setTransform(Transform newTransform) Setting the transform to null is equivalent to setting it
to identity.
Parameters: newTransform - the new value of the transform. | static boolean | setTransform(Transform newTransform, Transform6 transform) Transfers the transform values from the input Perseus Transform
the the input Pisces Transform6.
Parameters: newTransform - the Perseus transform to transfer. Parameters: outTransform - the Pisces transform destination. |
height | protected int height(Code) | | The rendering extent along the y axis.
|
imageTransform | protected Transform6 imageTransform(Code) | | The image transform, used in drawImage
|
needSetTransform | protected boolean needSetTransform(Code) | | Tracks whether or not the current transform needs to be set.
|
paintTarget | protected PaintTarget paintTarget(Code) | | The PaintTarget is the object defining the extent of the target rendered
area. In some situations, this may be different than the primitive being
drawn. For example, the same paint target may apply to multiple
consecutive rendering calls.
|
paintTransform | protected Transform paintTransform(Code) | | The paintTransform defines the coordinate space into which the PaintDef
should do its computation. Note that a PaintDef may add additional transform
to the paintTransform, for example to account for objectBoundingBox paints
or for paints which accept additional transforms (such as LinearGradientPaintDef
which accepts a gradientTransform).
|
primitiveTile | protected Tile primitiveTile(Code) | | The current primitive tile, i.e., the one that should encompass the
rendering of the following rendering primitive(s). This is used to
account for round-off errors in bounds computation and cut-off rendering
to the computed bouds for each primitive.
|
renderingTile | protected Tile renderingTile(Code) | | The current rendering tile.
|
width | protected int width(Code) | | The rendering extent along the x axis.
|
PiscesRenderGraphics | public PiscesRenderGraphics(PiscesRenderer pr, int width, int height)(Code) | | Constructs a new PiscesRenderGraphics which will delegate painting
operations to a PiscesRenderer .
Parameters: pr - the PiscesRenderer to render to. Parameters: width - the rendering surface width. Should be greater than zero. Parameters: height - the rendering surface height. Should be greater than zero. throws: NullPointerException - if bi is null |
applyClip | void applyClip()(Code) | | Applies the intersection of the rendering tile and the primitive tile
|
clearRect | abstract public void clearRect(int x, int y, int width, int height, RGB clearColor)(Code) | | 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.
Parameters: x - - the x coordinate of the rectangle to clear. Parameters: y - - the y coordinate of the rectangle to clear. Parameters: width - - the width of the rectangle to clear. Parameters: height - - the height of the rectangle to clear. Parameters: clearColor - - the color to use to clear the rectangle. |
draw | public void draw(Path path)(Code) | | Draws the input shape using a stroke
derived from the following properties:
- strokeWidth
- strokeDashArray
- strokeDashOffset
- strokeLineJoin
- strokeLineCap
Parameters: path - the Path to fill |
drawImage | public void drawImage(RasterImage image, float dx, float dy, float dw, float dh)(Code) | | Draws the input Image at the specified location applying the
input transform to the image before drawing it onto the
proxied Graphics2D
Parameters: image - the Image to draw Parameters: dx - the coordinate, along the x-axis, where the image should be drawn, in user space. Parameters: dy - the coordinate, along the y-axis, where the image should be drawn, in user space. Parameters: dw - the width, in the destination user space, of the image when drawn. Parameters: dh - the height, in the destination user space, of the image when drawn. |
drawLine | public void drawLine(float x1, float y1, float x2, float y2)(Code) | | Parameters: x1 - the line's x-axis starting position. Parameters: y1 - the line's y-axis starting position. Parameters: x2 - the line's x-axis end position. Parameters: y2 - the line's y-axis end position. |
drawOval | public void drawOval(float x, float y, float w, float h)(Code) | | |
drawRect | public void drawRect(float x, float y, float w, float h, float aw, float ah)(Code) | | |
fill | public void fill(Path path)(Code) | | fills the input shape with the current fill color.
Parameters: path - the Path to fill |
fillOrDraw | void fillOrDraw(Path path, PaintServer paint, int opOpacity, boolean isFill)(Code) | | Parameters: path - the Path to fill or draw. Parameters: paint - the paint to use for the operation. Parameters: opOpacity - the opacity to use for the operation. Parameters: isFill - if true, this is a fill operation. Otherwise, it is a stroke operation. |
fillOval | public void fillOval(float x, float y, float w, float h)(Code) | | |
fillRect | public void fillRect(float x, float y, float w, float h, float aw, float ah)(Code) | | Fills a rectangle.
Parameters: x - the rectangle's x-axis origin Parameters: y - the rectangle's y-axis origin Parameters: w - the rectangle's length along the x-axis Parameters: h - the rectangle's length along the y-axis Parameters: aw - the rectangle's rounded corner diameter along the x-axis Parameters: ah - the rectangle's rounded corner diameter along the y-axis. |
getPrimitiveTile | public Tile getPrimitiveTile()(Code) | | the current user clip tile. This value is _never_ null. |
getRenderingTile | public Tile getRenderingTile()(Code) | | the current rendering tile. This value is _never_ null. |
setPaintTarget | public void setPaintTarget(PaintTarget paintTarget)(Code) | | Sets the current PaintTarget.
Parameters: paintTarget - the new PaintTarget. |
setPaintTransform | public void setPaintTransform(Transform paintTransform)(Code) | | Sets the current paintTransform.
Parameters: paintTransform - the new paintTransform. |
setPrimitiveTile | public void setPrimitiveTile(Tile primitiveTile)(Code) | | Sets the primitive tile, which is intersected with the rendering tile.
Parameters: primitiveTile - if null, this sets the primitiveTile to the same valueas the renderingTile |
setRenderingQuality | public void setRenderingQuality(boolean isHigh)(Code) | | Turns the high quality rendering on or off.
Parameters: isHigh - true if the rendering quality should be high. |
setRenderingTile | public void setRenderingTile(Tile renderingTile)(Code) | | Sets the current rendering tile to the rectangle specified by the given
tile. IMPORTANT NOTE: the tile is _not_ subject to the RenderGraphics'
transform. The clip is defined in device coordinates.
Parameters: renderingTile - the Tile defining the clipping area. May be null. |
setTransform | public void setTransform(Transform newTransform)(Code) | | Setting the transform to null is equivalent to setting it
to identity.
Parameters: newTransform - the new value of the transform. This value is copied, not referenced by the context. |
setTransform | static boolean setTransform(Transform newTransform, Transform6 transform)(Code) | | Transfers the transform values from the input Perseus Transform
the the input Pisces Transform6.
Parameters: newTransform - the Perseus transform to transfer. Parameters: outTransform - the Pisces transform destination. true if the transform was indeed different. |
|
|