| java.lang.Object java.awt.Graphics java.awt.Graphics2D javax.media.j3d.J3DGraphics2D
All known Subclasses: javax.media.j3d.J3DGraphics2DImpl,
J3DGraphics2D | abstract public class J3DGraphics2D extends Graphics2D (Code) | | The J3DGraphics2D class extends Graphics2D to provide 2D rendering
into a Canvas3D. It is an abstract base class that is further
extended by a non-public Java 3D implementation class. This class
allows Java 2D rendering to be mixed with Java 3D rendering in the
same Canvas3D, subject to the same restrictions as imposed for 3D
immediate-mode rendering: In mixed-mode rendering, all Java 2D
requests must be done from one of the Canvas3D callback methods; in
pure-immediate mode, the Java 3D renderer must be stopped for the
Canvas3D being rendered into.
An application obtains a J3D 2D graphics context object from the
Canvas3D object that the application wishes to render into by using
the getGraphics2D method. A new J3DGraphics2D object is created if
one does not already exist.
Note that the drawing methods in this class, including those
inherited from Graphics2D, are not necessarily executed
immediately. They may be buffered up for future execution.
Applications must call the flush(boolean) method to ensure
that the rendering actually happens. The flush method is implicitly
called in the following cases:
- The
Canvas3D.swap method calls
flush(true)
- The Java 3D renderer calls
flush(true) prior to
swapping the buffer for a double buffered on-screen Canvas3D
- The Java 3D renderer calls
flush(true) prior to
copying into the off-screen buffer of an off-screen Canvas3D
- The Java 3D renderer calls
flush(false) after
calling the preRender, renderField, postRender, and postSwap
Canvas3D callback methods.
A single-buffered, pure-immediate mode application must explicitly
call flush to ensure that the graphics will be rendered to the
Canvas3D.
See Also: Canvas3D.getGraphics2D since: Java 3D 1.2 |
Method Summary | |
final public void | clearRect(int x, int y, int width, int height) This method is not supported. | final public Graphics | create() This method is not supported. | final public Graphics | create(int x, int y, int width, int height) This method is not supported. | abstract public void | drawAndFlushImage(BufferedImage img, int x, int y, ImageObserver observer) Draws the specified image and flushes the buffer. | abstract public void | flush(boolean wait) Flushes all previously executed rendering operations to the
drawing buffer for this 2D graphics object. | final public Color | getBackground() This method is not supported. | final public void | setBackground(Color color) This method is not supported. |
J3DGraphics2D | J3DGraphics2D()(Code) | | |
drawAndFlushImage | abstract public void drawAndFlushImage(BufferedImage img, int x, int y, ImageObserver observer)(Code) | | Draws the specified image and flushes the buffer. This is
functionally equivalent to calling drawImage(...)
followed by flush(false) , but can avoid the cost
of making an extra copy of the image in some cases. Anything
previously drawn to this J3DGraphics2D will be flushed before
the image is drawn.
Parameters: img - The image to draw Parameters: x - The x location to draw at Parameters: y - The y location to draw at Parameters: observer - The ImageObserver since: Java 3D 1.3 |
flush | abstract public void flush(boolean wait)(Code) | | Flushes all previously executed rendering operations to the
drawing buffer for this 2D graphics object.
Parameters: wait - flag indicating whether or not to wait for therendering to be complete before returning from this call. |
Methods inherited from java.awt.Graphics2D | abstract public void addRenderingHints(Map, ?> hints)(Code)(Java Doc) abstract public void clip(Shape s)(Code)(Java Doc) abstract public void draw(Shape s)(Code)(Java Doc) public void draw3DRect(int x, int y, int width, int height, boolean raised)(Code)(Java Doc) abstract public void drawGlyphVector(GlyphVector g, float x, float y)(Code)(Java Doc) abstract public boolean drawImage(Image img, AffineTransform xform, ImageObserver obs)(Code)(Java Doc) abstract public void drawImage(BufferedImage img, BufferedImageOp op, int x, int y)(Code)(Java Doc) abstract public void drawRenderableImage(RenderableImage img, AffineTransform xform)(Code)(Java Doc) abstract public void drawRenderedImage(RenderedImage img, AffineTransform xform)(Code)(Java Doc) abstract public void drawString(String str, int x, int y)(Code)(Java Doc) abstract public void drawString(String str, float x, float y)(Code)(Java Doc) abstract public void drawString(AttributedCharacterIterator iterator, int x, int y)(Code)(Java Doc) abstract public void drawString(AttributedCharacterIterator iterator, float x, float y)(Code)(Java Doc) abstract public void fill(Shape s)(Code)(Java Doc) public void fill3DRect(int x, int y, int width, int height, boolean raised)(Code)(Java Doc) abstract public Color getBackground()(Code)(Java Doc) abstract public Composite getComposite()(Code)(Java Doc) abstract public GraphicsConfiguration getDeviceConfiguration()(Code)(Java Doc) abstract public FontRenderContext getFontRenderContext()(Code)(Java Doc) abstract public Paint getPaint()(Code)(Java Doc) abstract public Object getRenderingHint(Key hintKey)(Code)(Java Doc) abstract public RenderingHints getRenderingHints()(Code)(Java Doc) abstract public Stroke getStroke()(Code)(Java Doc) abstract public AffineTransform getTransform()(Code)(Java Doc) abstract public boolean hit(Rectangle rect, Shape s, boolean onStroke)(Code)(Java Doc) abstract public void rotate(double theta)(Code)(Java Doc) abstract public void rotate(double theta, double x, double y)(Code)(Java Doc) abstract public void scale(double sx, double sy)(Code)(Java Doc) abstract public void setBackground(Color color)(Code)(Java Doc) abstract public void setComposite(Composite comp)(Code)(Java Doc) abstract public void setPaint(Paint paint)(Code)(Java Doc) abstract public void setRenderingHint(Key hintKey, Object hintValue)(Code)(Java Doc) abstract public void setRenderingHints(Map, ?> hints)(Code)(Java Doc) abstract public void setStroke(Stroke s)(Code)(Java Doc) abstract public void setTransform(AffineTransform Tx)(Code)(Java Doc) abstract public void shear(double shx, double shy)(Code)(Java Doc) abstract public void transform(AffineTransform Tx)(Code)(Java Doc) abstract public void translate(int x, int y)(Code)(Java Doc) abstract public void translate(double tx, double ty)(Code)(Java Doc)
|
Methods inherited from java.awt.Graphics | abstract public void clearRect(int x, int y, int width, int height)(Code)(Java Doc) abstract public void clipRect(int x, int y, int width, int height)(Code)(Java Doc) abstract public void copyArea(int x, int y, int width, int height, int dx, int dy)(Code)(Java Doc) abstract public Graphics create()(Code)(Java Doc) public Graphics create(int x, int y, int width, int height)(Code)(Java Doc) abstract public void dispose()(Code)(Java Doc) public void draw3DRect(int x, int y, int width, int height, boolean raised)(Code)(Java Doc) abstract public void drawArc(int x, int y, int width, int height, int startAngle, int arcAngle)(Code)(Java Doc) public void drawBytes(byte data, int offset, int length, int x, int y)(Code)(Java Doc) public void drawChars(char data, int offset, int length, int x, int y)(Code)(Java Doc) abstract public boolean drawImage(Image img, int x, int y, ImageObserver observer)(Code)(Java Doc) abstract public boolean drawImage(Image img, int x, int y, int width, int height, ImageObserver observer)(Code)(Java Doc) abstract public boolean drawImage(Image img, int x, int y, Color bgcolor, ImageObserver observer)(Code)(Java Doc) abstract public boolean drawImage(Image img, int x, int y, int width, int height, Color bgcolor, ImageObserver observer)(Code)(Java Doc) abstract public boolean drawImage(Image img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, ImageObserver observer)(Code)(Java Doc) abstract public boolean drawImage(Image img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, Color bgcolor, ImageObserver observer)(Code)(Java Doc) abstract public void drawLine(int x1, int y1, int x2, int y2)(Code)(Java Doc) abstract public void drawOval(int x, int y, int width, int height)(Code)(Java Doc) abstract public void drawPolygon(int xPoints, int yPoints, int nPoints)(Code)(Java Doc) public void drawPolygon(Polygon p)(Code)(Java Doc) abstract public void drawPolyline(int xPoints, int yPoints, int nPoints)(Code)(Java Doc) public void drawRect(int x, int y, int width, int height)(Code)(Java Doc) abstract public void drawRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight)(Code)(Java Doc) abstract public void drawString(String str, int x, int y)(Code)(Java Doc) abstract public void drawString(AttributedCharacterIterator iterator, int x, int y)(Code)(Java Doc) public void fill3DRect(int x, int y, int width, int height, boolean raised)(Code)(Java Doc) abstract public void fillArc(int x, int y, int width, int height, int startAngle, int arcAngle)(Code)(Java Doc) abstract public void fillOval(int x, int y, int width, int height)(Code)(Java Doc) abstract public void fillPolygon(int xPoints, int yPoints, int nPoints)(Code)(Java Doc) public void fillPolygon(Polygon p)(Code)(Java Doc) abstract public void fillRect(int x, int y, int width, int height)(Code)(Java Doc) abstract public void fillRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight)(Code)(Java Doc) public void finalize()(Code)(Java Doc) abstract public Shape getClip()(Code)(Java Doc) abstract public Rectangle getClipBounds()(Code)(Java Doc) public Rectangle getClipBounds(Rectangle r)(Code)(Java Doc) public Rectangle getClipRect()(Code)(Java Doc) abstract public Color getColor()(Code)(Java Doc) abstract public Font getFont()(Code)(Java Doc) public FontMetrics getFontMetrics()(Code)(Java Doc) abstract public FontMetrics getFontMetrics(Font f)(Code)(Java Doc) public boolean hitClip(int x, int y, int width, int height)(Code)(Java Doc) abstract public void setClip(int x, int y, int width, int height)(Code)(Java Doc) abstract public void setClip(Shape clip)(Code)(Java Doc) abstract public void setColor(Color c)(Code)(Java Doc) abstract public void setFont(Font font)(Code)(Java Doc) abstract public void setPaintMode()(Code)(Java Doc) abstract public void setXORMode(Color c1)(Code)(Java Doc) public String toString()(Code)(Java Doc) abstract public void translate(int x, int y)(Code)(Java Doc)
|
|
|