|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Graphics | +--java.awt.Graphics2D | +--javax.media.j3d.J3DGraphics2D
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:
Canvas3D.swap
method calls
flush(true)
flush(true)
prior to
swapping the buffer for a double buffered on-screen Canvas3Dflush(true)
prior to
copying into the off-screen buffer of an off-screen Canvas3Dflush(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.
Canvas3D.getGraphics2D()
Method Summary | |
void |
clearRect(int x,
int y,
int width,
int height)
This method is not supported. |
java.awt.Graphics |
create()
This method is not supported. |
java.awt.Graphics |
create(int x,
int y,
int width,
int height)
This method is not supported. |
abstract void |
flush(boolean wait)
Flushes all previously executed rendering operations to the drawing buffer for this 2D graphics object. |
java.awt.Color |
getBackground()
This method is not supported. |
void |
setBackground(java.awt.Color color)
This method is not supported. |
Methods inherited from class java.awt.Graphics2D |
addRenderingHints,
clip,
draw,
draw3DRect,
drawGlyphVector,
drawImage,
drawImage,
drawRenderableImage,
drawRenderedImage,
drawString,
drawString,
drawString,
drawString,
fill,
fill3DRect,
getComposite,
getDeviceConfiguration,
getFontRenderContext,
getPaint,
getRenderingHint,
getRenderingHints,
getStroke,
getTransform,
hit,
rotate,
rotate,
scale,
setComposite,
setPaint,
setRenderingHint,
setRenderingHints,
setStroke,
setTransform,
shear,
transform,
translate,
translate |
Methods inherited from class java.awt.Graphics |
clipRect,
copyArea,
dispose,
drawArc,
drawBytes,
drawChars,
drawImage,
drawImage,
drawImage,
drawImage,
drawImage,
drawImage,
drawLine,
drawOval,
drawPolygon,
drawPolygon,
drawPolyline,
drawRect,
drawRoundRect,
fillArc,
fillOval,
fillPolygon,
fillPolygon,
fillRect,
fillRoundRect,
finalize,
getClip,
getClipBounds,
getClipBounds,
getClipRect,
getColor,
getFont,
getFontMetrics,
getFontMetrics,
hitClip,
setClip,
setClip,
setColor,
setFont,
setPaintMode,
setXORMode,
toString |
Methods inherited from class java.lang.Object |
clone,
equals,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Method Detail |
public final java.awt.Graphics create()
Canvas3D.getGraphics2D()
public final java.awt.Graphics create(int x, int y, int width, int height)
Canvas3D.getGraphics2D()
public final void setBackground(java.awt.Color color)
Background
,
GraphicsContext3D.setBackground(javax.media.j3d.Background)
,
GraphicsContext3D.clear()
public final java.awt.Color getBackground()
Background
,
GraphicsContext3D.getBackground()
,
GraphicsContext3D.clear()
public final void clearRect(int x, int y, int width, int height)
Background
,
GraphicsContext3D.setBackground(javax.media.j3d.Background)
,
GraphicsContext3D.clear()
public abstract void flush(boolean wait)
wait
- flag indicating whether or not to wait for the
rendering to be complete before returning from this call.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |