|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object
|
+--java.awt.Graphics
|
+--java.awt.Graphics2D
|
+--agile2d.opengl.AGLGraphics2D
AGLGraphics2D implements a partial subset of the standard Java2D Graphics2D API. It uses OpenGL as the rendering engine. This class uses the freely available GL4Java library to access native OpenGL function calls.
Note that some API functions are marked "TBD" (to be done). Calling these functions typically has no effect - most Java2D applications should run under OpenGL, although they may not appear correctly rendered.
| Constructor Summary | |
AGLGraphics2D(gl4java.drawable.GLDrawable drawable)
Constructs a AGLGraphics2D that renders to a particular GL Drawable. |
|
| Method Summary | |
void |
addRenderingHints(Map hints)
|
void |
clearRect(int x,
int y,
int width,
int height)
|
void |
clip(Shape clip)
|
void |
clipRect(int x,
int y,
int w,
int h)
|
protected Object |
clone()
|
void |
copyArea(int x,
int y,
int width,
int height,
int dx,
int dy)
|
Graphics |
create()
|
void |
dispose()
|
void |
draw(Shape shape)
|
void |
drawArc(int x,
int y,
int width,
int height,
int startAngle,
int arcAngle)
|
void |
drawGlyphVector(GlyphVector g,
float x,
float y)
|
void |
drawImage(BufferedImage img,
BufferedImageOp op,
int x,
int y)
TBD |
boolean |
drawImage(Image img,
AffineTransform xform,
ImageObserver obs)
|
boolean |
drawImage(Image img,
int x,
int y,
Color bgcolor,
ImageObserver observer)
|
boolean |
drawImage(Image img,
int x,
int y,
ImageObserver observer)
|
boolean |
drawImage(Image img,
int x,
int y,
int width,
int height,
Color bgcolor,
ImageObserver observer)
|
boolean |
drawImage(Image img,
int x,
int y,
int width,
int height,
ImageObserver observer)
|
boolean |
drawImage(Image img,
int dx1,
int dy1,
int dx2,
int dy2,
int sx1,
int sy1,
int sx2,
int sy2,
Color bgcolor,
ImageObserver observer)
|
boolean |
drawImage(Image img,
int dx1,
int dy1,
int dx2,
int dy2,
int sx1,
int sy1,
int sx2,
int sy2,
ImageObserver observer)
|
void |
drawLine(int x1,
int y1,
int x2,
int y2)
|
void |
drawOval(int x,
int y,
int width,
int height)
|
void |
drawPolygon(int[] xPts,
int[] yPts,
int nPts)
|
void |
drawPolyline(int[] xPts,
int[] yPts,
int nPts)
|
void |
drawRect(int x1,
int y1,
int width,
int height)
|
void |
drawRenderableImage(RenderableImage img,
AffineTransform xform)
TBD |
void |
drawRenderedImage(RenderedImage img,
AffineTransform xform)
TBD |
void |
drawRoundRect(int x,
int y,
int width,
int height,
int arcWidth,
int arcHeight)
|
void |
drawString(AttributedCharacterIterator iterator,
float x,
float y)
TBD |
void |
drawString(AttributedCharacterIterator iterator,
int x,
int y)
TBD |
void |
drawString(String string,
float x,
float y)
|
void |
drawString(String s,
int x,
int y)
|
void |
fill(Shape shape)
|
void |
fillArc(int x,
int y,
int width,
int height,
int startAngle,
int arcAngle)
|
void |
fillOval(int x,
int y,
int width,
int height)
|
void |
fillPolygon(int[] xPts,
int[] yPts,
int nPts)
|
void |
fillRect(int x1,
int y1,
int width,
int height)
|
void |
fillRoundRect(int x,
int y,
int width,
int height,
int arcWidth,
int arcHeight)
|
Color |
getBackground()
|
Shape |
getClip()
|
Rectangle |
getClipBounds()
|
Rectangle |
getClipBounds(Rectangle r)
|
Color |
getColor()
|
Composite |
getComposite()
|
GraphicsConfiguration |
getDeviceConfiguration()
Falls back on Java2D: Returns Java2D's current device configuration |
Font |
getFont()
|
FontMetrics |
getFontMetrics(Font f)
|
FontRenderContext |
getFontRenderContext()
Returns new FontRenderContext(null, true, true). |
Paint |
getPaint()
|
Object |
getRenderingHint(RenderingHints.Key key)
|
RenderingHints |
getRenderingHints()
|
Stroke |
getStroke()
|
AffineTransform |
getTransform()
|
boolean |
hit(Rectangle rect,
Shape s,
boolean onStroke)
Falls back on Java2D: Uses a Java2D graphics to do hit testing |
boolean |
hitClip(int x,
int y,
int width,
int height)
|
void |
resetAll()
Resets the Graphics to its default state. |
void |
rotate(double theta)
|
void |
rotate(double theta,
double x,
double y)
|
void |
runGL(gl4java.drawable.GLEventListener glevent)
Runs a GL program in the AGLGraphics2D context. |
void |
scale(double sx,
double sy)
|
void |
setBackground(Color color)
|
void |
setClip(int x,
int y,
int width,
int height)
|
void |
setClip(Shape clip)
|
void |
setColor(Color color)
|
void |
setColor(int argb)
AGLGraphics2D extension for specifing a color with an integer. |
void |
setComposite(Composite composite)
|
void |
setFont(Font font)
|
void |
setPaint(Paint paint)
|
void |
setPaintMode()
|
void |
setRenderingHint(RenderingHints.Key key,
Object value)
|
void |
setRenderingHints(Map hints)
|
void |
setStroke(Stroke stroke)
|
void |
setTransform(AffineTransform tm)
|
void |
setVertexAttributes(VertexAttributes va)
|
void |
setXORMode(Color xorColor)
|
void |
shear(double sx,
double sy)
|
void |
transform(AffineTransform transform)
|
void |
translate(double x,
double y)
|
void |
translate(int x,
int y)
|
| Methods inherited from class java.awt.Graphics2D |
draw3DRect, fill3DRect |
| Methods inherited from class java.awt.Graphics |
create, drawBytes, drawChars, drawPolygon, fillPolygon, finalize, getClipRect, getFontMetrics, toString |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public AGLGraphics2D(gl4java.drawable.GLDrawable drawable)
aglGraphics.resetAll(); // Makes the OpenGL State reflect Java2D's defaults
aglGraphics...
drawable - the underlying GLDrawable| Method Detail |
public void resetAll()
public void dispose()
dispose in class GraphicsGraphics.dispose()protected Object clone()
clone in class Objectpublic Color getBackground()
getBackground in class Graphics2DGraphics2D.getBackground()public void setBackground(Color color)
setBackground in class Graphics2DGraphics2D.setBackground(java.awt.Color)public Color getColor()
getColor in class GraphicsGraphics.getColor()public void setColor(Color color)
setColor in class GraphicsGraphics.setColor(java.awt.Color)public void setColor(int argb)
argb - color with 8 bits components for the alpha, red,
green and blue channels in that order from high bits to low bits.public Paint getPaint()
getPaint in class Graphics2DGraphics2D.getPaint()public void setPaint(Paint paint)
setPaint in class Graphics2DGraphics2D.setPaint(java.awt.Paint)public Composite getComposite()
getComposite in class Graphics2DGraphics2D.getComposite()public void setComposite(Composite composite)
setComposite in class Graphics2DGraphics2D.setComposite(java.awt.Composite)public void setFont(Font font)
setFont in class GraphicsGraphics.setFont(java.awt.Font)public Font getFont()
getFont in class GraphicsGraphics.getFont()public FontMetrics getFontMetrics(Font f)
getFontMetrics in class GraphicsGraphics.getFontMetrics(java.awt.Font)public Stroke getStroke()
getStroke in class Graphics2DGraphics2D.getStroke()public void setStroke(Stroke stroke)
setStroke in class Graphics2DGraphics2D.setStroke(java.awt.Stroke)public void setPaintMode()
setPaintMode in class GraphicsGraphics.setPaintMode()public void setXORMode(Color xorColor)
setXORMode in class GraphicsGraphics.setXORMode(java.awt.Color)public void setTransform(AffineTransform tm)
setTransform in class Graphics2DGraphics2D.setTransform(java.awt.geom.AffineTransform)public AffineTransform getTransform()
getTransform in class Graphics2DGraphics2D.getTransform()
public void scale(double sx,
double sy)
scale in class Graphics2DGraphics2D.scale(double, double)
public void shear(double sx,
double sy)
shear in class Graphics2DGraphics2D.shear(double, double)
public void rotate(double theta,
double x,
double y)
rotate in class Graphics2DGraphics2D.rotate(double, double, double)public void rotate(double theta)
rotate in class Graphics2DGraphics2D.rotate(double)
public void translate(double x,
double y)
translate in class Graphics2DGraphics2D.translate(double, double)
public void translate(int x,
int y)
translate in class Graphics2DGraphics.translate(int, int)public void transform(AffineTransform transform)
transform in class Graphics2DGraphics2D.transform(java.awt.geom.AffineTransform)public void addRenderingHints(Map hints)
addRenderingHints in class Graphics2DGraphics2D.addRenderingHints(java.util.Map)public Object getRenderingHint(RenderingHints.Key key)
getRenderingHint in class Graphics2DGraphics2D.getRenderingHint(java.awt.RenderingHints.Key)
public void setRenderingHint(RenderingHints.Key key,
Object value)
setRenderingHint in class Graphics2DGraphics2D.setRenderingHint(java.awt.RenderingHints.Key, java.lang.Object)public void setRenderingHints(Map hints)
setRenderingHints in class Graphics2DGraphics2D.setRenderingHints(java.util.Map)public RenderingHints getRenderingHints()
getRenderingHints in class Graphics2DGraphics2D.getRenderingHints()public void setClip(Shape clip)
setClip in class GraphicsGraphics.setClip(java.awt.Shape)
public void setClip(int x,
int y,
int width,
int height)
setClip in class GraphicsGraphics.setClip(int,int,int,int)public void clip(Shape clip)
clip in class Graphics2DGraphics2D.clip(java.awt.Shape)
public void clipRect(int x,
int y,
int w,
int h)
clipRect in class GraphicsGraphics.clipRect(int, int, int, int)public Shape getClip()
getClip in class GraphicsGraphics.getClip()public Rectangle getClipBounds()
getClipBounds in class GraphicsGraphics.getClipBounds()public Rectangle getClipBounds(Rectangle r)
getClipBounds in class GraphicsGraphics.getClipBounds(java.awt.Rectangle)
public boolean hitClip(int x,
int y,
int width,
int height)
hitClip in class GraphicsGraphics.hitClip(int, int, int, int)
public void drawLine(int x1,
int y1,
int x2,
int y2)
drawLine in class GraphicsGraphics.drawLine(int, int, int, int)
public void drawPolyline(int[] xPts,
int[] yPts,
int nPts)
drawPolyline in class GraphicsGraphics.drawPolygon(int[], int[], int),
Graphics.drawPolyline(int[], int[], int)
public void drawPolygon(int[] xPts,
int[] yPts,
int nPts)
drawPolygon in class GraphicsGraphics.drawPolygon(int[], int[], int)
public void drawRect(int x1,
int y1,
int width,
int height)
drawRect in class GraphicsGraphics.drawRect(int, int, int, int)
public void drawRoundRect(int x,
int y,
int width,
int height,
int arcWidth,
int arcHeight)
drawRoundRect in class GraphicsGraphics.drawRoundRect(int, int, int, int, int, int)
public void drawOval(int x,
int y,
int width,
int height)
drawOval in class GraphicsGraphics.drawOval(int, int, int, int)
public void drawArc(int x,
int y,
int width,
int height,
int startAngle,
int arcAngle)
drawArc in class GraphicsGraphics.drawArc(int, int, int, int, int, int)public void draw(Shape shape)
draw in class Graphics2DGraphics2D.draw(java.awt.Shape)
public void fillRect(int x1,
int y1,
int width,
int height)
fillRect in class GraphicsGraphics.fillRect(int, int, int, int)
public void clearRect(int x,
int y,
int width,
int height)
clearRect in class GraphicsGraphics.clearRect(int, int, int, int)
public void fillRoundRect(int x,
int y,
int width,
int height,
int arcWidth,
int arcHeight)
fillRoundRect in class GraphicsGraphics.fillRoundRect(int, int, int, int, int, int)
public void fillOval(int x,
int y,
int width,
int height)
fillOval in class GraphicsGraphics.fillOval(int, int, int, int)
public void fillArc(int x,
int y,
int width,
int height,
int startAngle,
int arcAngle)
fillArc in class GraphicsGraphics.fillArc(int, int, int, int, int, int)
public void fillPolygon(int[] xPts,
int[] yPts,
int nPts)
fillPolygon in class GraphicsGraphics.fillPolygon(int[], int[], int)public void fill(Shape shape)
fill in class Graphics2DGraphics2D.fill(java.awt.Shape)
public void drawString(String s,
int x,
int y)
drawString in class Graphics2DGraphics.drawString(java.lang.String, int, int)
public void drawString(String string,
float x,
float y)
drawString in class Graphics2DGraphics2D.drawString(java.lang.String, float, float)public Graphics create()
create in class GraphicsGraphics.create()
public void copyArea(int x,
int y,
int width,
int height,
int dx,
int dy)
copyArea in class GraphicsGraphics.copyArea(int, int, int, int, int, int)
public boolean drawImage(Image img,
int x,
int y,
ImageObserver observer)
drawImage in class GraphicsGraphics.drawImage(java.awt.Image, int, int, java.awt.image.ImageObserver)
public boolean drawImage(Image img,
int x,
int y,
int width,
int height,
ImageObserver observer)
drawImage in class GraphicsGraphics.drawImage(java.awt.Image, int, int, int, int, java.awt.image.ImageObserver)
public boolean drawImage(Image img,
int x,
int y,
Color bgcolor,
ImageObserver observer)
drawImage in class GraphicsGraphics.drawImage(java.awt.Image, int, int, java.awt.Color, java.awt.image.ImageObserver)
public boolean drawImage(Image img,
int x,
int y,
int width,
int height,
Color bgcolor,
ImageObserver observer)
drawImage in class GraphicsGraphics.drawImage(java.awt.Image, int, int, int, int, java.awt.Color, java.awt.image.ImageObserver)
public boolean drawImage(Image img,
int dx1,
int dy1,
int dx2,
int dy2,
int sx1,
int sy1,
int sx2,
int sy2,
ImageObserver observer)
drawImage in class GraphicsGraphics.drawImage(java.awt.Image, int, int, int, int, int, int, int, int, java.awt.image.ImageObserver)
public boolean drawImage(Image img,
AffineTransform xform,
ImageObserver obs)
drawImage in class Graphics2DGraphics2D.drawImage(java.awt.Image, java.awt.geom.AffineTransform, java.awt.image.ImageObserver)
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)
drawImage in class GraphicsGraphics.drawImage(java.awt.Image, int, int, int, int, int, int, int, int, java.awt.Color, java.awt.image.ImageObserver)
public void drawGlyphVector(GlyphVector g,
float x,
float y)
drawGlyphVector in class Graphics2DGraphics2D.drawGlyphVector(java.awt.font.GlyphVector, float, float)
public boolean hit(Rectangle rect,
Shape s,
boolean onStroke)
hit in class Graphics2DGraphics2D.hit(Rectangle, Shape, boolean)public GraphicsConfiguration getDeviceConfiguration()
getDeviceConfiguration in class Graphics2DGraphics2D.getDeviceConfiguration()public FontRenderContext getFontRenderContext()
getFontRenderContext in class Graphics2D
public void drawString(AttributedCharacterIterator iterator,
int x,
int y)
drawString in class Graphics2Diterator - DOCUMENT ME!x - DOCUMENT ME!y - DOCUMENT ME!
public void drawImage(BufferedImage img,
BufferedImageOp op,
int x,
int y)
drawImage in class Graphics2Dimg - DOCUMENT ME!op - DOCUMENT ME!x - DOCUMENT ME!y - DOCUMENT ME!
public void drawRenderedImage(RenderedImage img,
AffineTransform xform)
drawRenderedImage in class Graphics2Dimg - DOCUMENT ME!xform - DOCUMENT ME!
public void drawRenderableImage(RenderableImage img,
AffineTransform xform)
drawRenderableImage in class Graphics2Dimg - DOCUMENT ME!xform - DOCUMENT ME!
public void drawString(AttributedCharacterIterator iterator,
float x,
float y)
drawString in class Graphics2Diterator - DOCUMENT ME!x - DOCUMENT ME!y - DOCUMENT ME!public void setVertexAttributes(VertexAttributes va)
public void runGL(gl4java.drawable.GLEventListener glevent)
GLEventListener
it called: transform, clip, states.
All the graphic attributes are saved, but the GL state can
still be broken if the stacks are popped for example.
glevent - the GLEventListener which will be called.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||