|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Graphics
java.awt.Graphics2D
scenic.awt.AbstractGraphics2D
scenic.awt.ScenicGraphics2D
public class ScenicGraphics2D
Implementation of the Graphics2D class that uses the Scenic library for rendering. This implementation does not use direct rendering, instead it creates scene trees. After the scene tree is finished it can be rendered on the screen or to an offscreen image.
| Constructor Summary | |
|---|---|
ScenicGraphics2D(SceneContainer scene)
Constructs a new ScenicGraphics2D using the given scene as the root node. |
|
ScenicGraphics2D(ScenicGraphics2D parent)
Constructs a SceneGraphics2D that is a copy of the given SceneGraphics2D object. |
|
ScenicGraphics2D(ScenicImage image)
Constructs a new ScenicGraphics2D using the given image as the rendering target. |
|
| Method Summary | |
|---|---|
void |
clip(java.awt.Shape s)
Intersects the current Clip with the interior of the
specified Shape and sets the Clip to the
resulting intersection. |
void |
copyArea(int x,
int y,
int width,
int height,
int dx,
int dy)
|
java.awt.Graphics |
create()
|
void |
dispose()
|
void |
draw(java.awt.Shape s)
|
boolean |
drawImage(java.awt.Image img,
int x,
int y,
java.awt.image.ImageObserver observer)
|
boolean |
drawImage(java.awt.Image img,
int x,
int y,
int width,
int height,
java.awt.image.ImageObserver observer)
|
boolean |
drawImage(java.awt.Image img,
int dx1,
int dy1,
int dx2,
int dy2,
int sx1,
int sy1,
int sx2,
int sy2,
java.awt.image.ImageObserver observer)
Draws as much of the specified area of the specified image as is currently available, scaling it on the fly to fit inside the specified area of the destination drawable surface. |
void |
drawRenderableImage(java.awt.image.renderable.RenderableImage img,
java.awt.geom.AffineTransform xform)
|
void |
drawRenderedImage(java.awt.image.RenderedImage img,
java.awt.geom.AffineTransform xform)
|
void |
drawString(java.text.AttributedCharacterIterator iterator,
float x,
float y)
|
void |
drawString(java.lang.String str,
float x,
float y)
|
void |
fill(java.awt.Shape s)
|
java.awt.GraphicsConfiguration |
getDeviceConfiguration()
|
java.awt.FontMetrics |
getFontMetrics(java.awt.Font f)
|
java.awt.geom.AffineTransform |
getTransform()
|
void |
rotate(double theta)
|
void |
rotate(double theta,
double x,
double y)
|
void |
scale(double sx,
double sy)
|
void |
setClip(java.awt.Shape s)
Sets the current clipping area to an arbitrary clip shape. |
void |
setTransform(java.awt.geom.AffineTransform Tx)
|
void |
setXORMode(java.awt.Color c1)
|
void |
shear(double shx,
double shy)
|
void |
transform(java.awt.geom.AffineTransform Tx)
|
void |
translate(double tx,
double ty)
|
void |
translate(int tx,
int ty)
|
| Methods inherited from class scenic.awt.AbstractGraphics2D |
|---|
addRenderingHints, clearRect, clipRect, drawArc, drawGlyphVector, drawImage, drawImage, drawImage, drawImage, drawImage, drawLine, drawOval, drawPolygon, drawPolyline, drawRect, drawRoundRect, drawString, drawString, fillArc, fillOval, fillPolygon, fillRect, fillRoundRect, getBackground, getClip, getClipBounds, getColor, getComposite, getFont, getFontRenderContext, getGraphicContext, getPaint, getRenderingHint, getRenderingHints, getStroke, hit, setBackground, setClip, setColor, setComposite, setFont, setPaint, setPaintMode, setRenderingHint, setRenderingHints, setStroke |
| Methods inherited from class java.awt.Graphics2D |
|---|
draw3DRect, fill3DRect |
| Methods inherited from class java.awt.Graphics |
|---|
create, drawBytes, drawChars, drawPolygon, fillPolygon, finalize, getClipBounds, getClipRect, getFontMetrics, hitClip, toString |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ScenicGraphics2D(SceneContainer scene)
scene - the root nodepublic ScenicGraphics2D(ScenicImage image)
image - the render targetpublic ScenicGraphics2D(ScenicGraphics2D parent)
parent - the parent object| Method Detail |
|---|
public java.awt.geom.AffineTransform getTransform()
getTransform in class java.awt.Graphics2D
public void rotate(double theta,
double x,
double y)
rotate in class java.awt.Graphics2Dpublic void rotate(double theta)
rotate in class java.awt.Graphics2D
public void scale(double sx,
double sy)
scale in class java.awt.Graphics2Dpublic void setTransform(java.awt.geom.AffineTransform Tx)
setTransform in class java.awt.Graphics2D
public void shear(double shx,
double shy)
shear in class java.awt.Graphics2Dpublic void transform(java.awt.geom.AffineTransform Tx)
transform in class java.awt.Graphics2D
public void translate(double tx,
double ty)
translate in class java.awt.Graphics2D
public void translate(int tx,
int ty)
translate in class java.awt.Graphics2Dpublic void draw(java.awt.Shape s)
draw in class java.awt.Graphics2Dpublic void fill(java.awt.Shape s)
fill in class java.awt.Graphics2Dpublic void clip(java.awt.Shape s)
AbstractGraphics2DClip with the interior of the
specified Shape and sets the Clip to the
resulting intersection. The specified Shape is
transformed with the current Graphics2D
Transform before being intersected with the current
Clip. This method is used to make the current
Clip smaller.
To make the Clip larger, use setClip.
The user clip modified by this method is independent of the
clipping associated with device bounds and visibility. If no clip has
previously been set, or if the clip has been cleared using
setClip with a
null argument, the specified Shape becomes
the new user clip.
clip in class AbstractGraphics2Ds - the Shape to be intersected with the current
Clip. If s is null,
this method clears the current Clip.public void setClip(java.awt.Shape s)
AbstractGraphics2DShape
interface can be used to set the clip. The only
Shape objects that are guaranteed to be
supported are Shape objects that are
obtained via the getClip method and via
Rectangle objects. This method sets the
user clip, which is independent of the clipping associated
with device bounds and window visibility.
setClip in class AbstractGraphics2Ds - the Shape to use to set the clipGraphics.getClip(),
Graphics.clipRect(int, int, int, int),
Graphics.setClip(int, int, int, int)
public void drawRenderedImage(java.awt.image.RenderedImage img,
java.awt.geom.AffineTransform xform)
drawRenderedImage in class java.awt.Graphics2D
public void drawRenderableImage(java.awt.image.renderable.RenderableImage img,
java.awt.geom.AffineTransform xform)
drawRenderableImage in class java.awt.Graphics2D
public void drawString(java.lang.String str,
float x,
float y)
drawString in class java.awt.Graphics2D
public void drawString(java.text.AttributedCharacterIterator iterator,
float x,
float y)
drawString in class java.awt.Graphics2Dpublic java.awt.GraphicsConfiguration getDeviceConfiguration()
getDeviceConfiguration in class java.awt.Graphics2Dpublic java.awt.Graphics create()
create in class java.awt.Graphicspublic void setXORMode(java.awt.Color c1)
setXORMode in class java.awt.Graphicspublic java.awt.FontMetrics getFontMetrics(java.awt.Font f)
getFontMetrics in class java.awt.Graphics
public void copyArea(int x,
int y,
int width,
int height,
int dx,
int dy)
copyArea in class java.awt.Graphics
public boolean drawImage(java.awt.Image img,
int x,
int y,
java.awt.image.ImageObserver observer)
drawImage in class java.awt.Graphics
public boolean drawImage(java.awt.Image img,
int x,
int y,
int width,
int height,
java.awt.image.ImageObserver observer)
drawImage in class java.awt.Graphics
public boolean drawImage(java.awt.Image img,
int dx1,
int dy1,
int dx2,
int dy2,
int sx1,
int sy1,
int sx2,
int sy2,
java.awt.image.ImageObserver observer)
This method returns immediately in all cases, even if the
image area to be drawn has not yet been scaled, dithered, and converted
for the current output device.
If the current output representation is not yet complete then
drawImage returns false. As more of
the image becomes available, the process that draws the image notifies
the specified image observer.
This method always uses the unscaled version of the image to render the scaled rectangle and performs the required scaling on the fly. It does not use a cached, scaled version of the image for this operation. Scaling of the image from source to destination is performed such that the first coordinate of the source rectangle is mapped to the first coordinate of the destination rectangle, and the second source coordinate is mapped to the second destination coordinate. The subimage is scaled and flipped as needed to preserve those mappings.
drawImage in class java.awt.Graphicsimg - the specified image to be drawndx1 - the x coordinate of the first corner of the
destination rectangle.dy1 - the y coordinate of the first corner of the
destination rectangle.dx2 - the x coordinate of the second corner of the
destination rectangle.dy2 - the y coordinate of the second corner of the
destination rectangle.sx1 - the x coordinate of the first corner of the
source rectangle.sy1 - the y coordinate of the first corner of the
source rectangle.sx2 - the x coordinate of the second corner of the
source rectangle.sy2 - the y coordinate of the second corner of the
source rectangle.observer - object to be notified as more of the image is
scaled and converted.Image,
ImageObserver,
ImageObserver.imageUpdate(java.awt.Image, int, int, int, int, int)public void dispose()
dispose in class java.awt.Graphics
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||