javax.media.jai
Class GraphicsJAI

java.lang.Object
  |
  +--java.awt.Graphics
        |
        +--java.awt.Graphics2D
              |
              +--javax.media.jai.GraphicsJAI

public class GraphicsJAI
extends Graphics2D

A JAI wrapper for a Graphics2D object derived from a Component. When drawing JAI images to a Component such as a Canvas, a new GraphicsJAI may be constructed to wrap the Graphics2D object provided by that Component. This GraphicsJAI object may provide acceleration for calls to drawRenderedImage(), drawRenderableImage(), and possibly other methods.

If it is possible to use a CanvasJAI object instead of a generic Canvas, or other Canvas subclass, then the Graphics objects obtained from getGraphics() or received as an argument in paint() will automatically be instances of GraphicsJAI.

The portion of the GraphicsJAI interface that deals with adding and retrieving new hardware-specific implementations has not been finalized and does not appear in the current API.

See Also:
CanvasJAI

Constructor Summary
protected GraphicsJAI(Graphics2D g, Component component)
          Constructs a new instance of GraphicsJAI that wraps a given instance of Graphics2D for drawing to a given Component.
 
Method Summary
 void addRenderingHints(Map hints)
          See comments in java.awt.Graphics2D.
 void clearRect(int x, int y, int width, int height)
          See comments in java.awt.Graphics.
 void clip(Shape s)
          See comments in java.awt.Graphics2D.
 void clipRect(int x, int y, int width, int height)
          See comments in java.awt.Graphics.
 void copyArea(int x, int y, int width, int height, int dx, int dy)
          See comments in java.awt.Graphics.
 Graphics create()
          Creates a new GraphicsJAI object that is a copy of this GraphicsJAI object.
static GraphicsJAI createGraphicsJAI(Graphics2D g, Component component)
          Returns an instance of GraphicsJAI suitable for rendering to the given Component via the given Graphics2D instance.
 void dispose()
          See comments in java.awt.Graphics.
 void draw(Shape s)
          See comments in java.awt.Graphics2D.
 void drawArc(int x, int y, int width, int height, int startAngle, int arcAngle)
          See comments in java.awt.Graphics.
 void drawGlyphVector(GlyphVector g, float x, float y)
          See comments in java.awt.Graphics2D.
 void drawImage(BufferedImage img, BufferedImageOp op, int x, int y)
          See comments in java.awt.Graphics2D.
 boolean drawImage(Image img, AffineTransform xform, ImageObserver obs)
          See comments in java.awt.Graphics2D.
 boolean drawImage(Image img, int x, int y, Color bgcolor, ImageObserver observer)
          See comments in java.awt.Graphics.
 boolean drawImage(Image img, int x, int y, ImageObserver observer)
          See comments in java.awt.Graphics.
 boolean drawImage(Image img, int x, int y, int width, int height, Color bgcolor, ImageObserver observer)
          See comments in java.awt.Graphics.
 boolean drawImage(Image img, int x, int y, int width, int height, ImageObserver observer)
          See comments in java.awt.Graphics.
 boolean drawImage(Image img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, Color bgcolor, ImageObserver observer)
          See comments in java.awt.Graphics.
 boolean drawImage(Image img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, ImageObserver observer)
          See comments in java.awt.Graphics.
 void drawLine(int x1, int y1, int x2, int y2)
          See comments in java.awt.Graphics.
 void drawOval(int x, int y, int width, int height)
          See comments in java.awt.Graphics.
 void drawPolygon(int[] xPoints, int[] yPoints, int nPoints)
          See comments in java.awt.Graphics.
 void drawPolyline(int[] xPoints, int[] yPoints, int nPoints)
          See comments in java.awt.Graphics.
 void drawRenderableImage(RenderableImage img, AffineTransform xform)
          See comments in java.awt.Graphics2D.
 void drawRenderedImage(RenderedImage img, AffineTransform xform)
          See comments in java.awt.Graphics2D.
 void drawRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight)
          See comments in java.awt.Graphics.
 void drawString(AttributedCharacterIterator iterator, float x, float y)
          See comments in java.awt.Graphics2D.
 void drawString(AttributedCharacterIterator iterator, int x, int y)
          See comments in java.awt.Graphics2D.
 void drawString(String s, float x, float y)
          See comments in java.awt.Graphics2D.
 void drawString(String str, int x, int y)
          See comments in java.awt.Graphics2D.
 void fill(Shape s)
          See comments in java.awt.Graphics2D.
 void fillArc(int x, int y, int width, int height, int startAngle, int arcAngle)
          See comments in java.awt.Graphics.
 void fillOval(int x, int y, int width, int height)
          See comments in java.awt.Graphics.
 void fillPolygon(int[] xPoints, int[] yPoints, int nPoints)
          See comments in java.awt.Graphics.
 void fillRect(int x, int y, int width, int height)
          See comments in java.awt.Graphics.
 void fillRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight)
          See comments in java.awt.Graphics.
 Color getBackground()
          See comments in java.awt.Graphics2D.
 Shape getClip()
          See comments in java.awt.Graphics.
 Rectangle getClipBounds()
          See comments in java.awt.Graphics.
 Color getColor()
          See comments in java.awt.Graphics.
 Composite getComposite()
          See comments in java.awt.Graphics2D.
 GraphicsConfiguration getDeviceConfiguration()
          See comments in java.awt.Graphics2D.
 Font getFont()
          See comments in java.awt.Graphics.
 FontMetrics getFontMetrics(Font f)
          See comments in java.awt.Graphics.
 FontRenderContext getFontRenderContext()
          See comments in java.awt.Graphics2D.
 Paint getPaint()
          See comments in java.awt.Graphics2D.
 Object getRenderingHint(RenderingHints.Key hintKey)
          See comments in java.awt.Graphics2D.
 RenderingHints getRenderingHints()
          See comments in java.awt.Graphics2D.
 Stroke getStroke()
          See comments in java.awt.Graphics2D.
 AffineTransform getTransform()
          See comments in java.awt.Graphics2D.
 boolean hit(Rectangle rect, Shape s, boolean onStroke)
          See comments in java.awt.Graphics2D.
 void rotate(double theta)
          See comments in java.awt.Graphics2D.
 void rotate(double theta, double x, double y)
          See comments in java.awt.Graphics2D.
 void scale(double sx, double sy)
          See comments in java.awt.Graphics2D.
 void setBackground(Color color)
          See comments in java.awt.Graphics2D.
 void setClip(int x, int y, int width, int height)
          See comments in java.awt.Graphics.
 void setClip(Shape clip)
          See comments in java.awt.Graphics.
 void setColor(Color c)
          See comments in java.awt.Graphics.
 void setComposite(Composite comp)
          See comments in java.awt.Graphics2D.
 void setFont(Font font)
          See comments in java.awt.Graphics.
 void setPaint(Paint paint)
          See comments in java.awt.Graphics2D.
 void setPaintMode()
          See comments in java.awt.Graphics.
 void setRenderingHint(RenderingHints.Key hintKey, Object hintValue)
          See comments in java.awt.Graphics2D.
 void setRenderingHints(Map hints)
          See comments in java.awt.Graphics2D.
 void setStroke(Stroke s)
          See comments in java.awt.Graphics2D.
 void setTransform(AffineTransform Tx)
          See comments in java.awt.Graphics2D.
 void setXORMode(Color c1)
          See comments in java.awt.Graphics.
 void shear(double shx, double shy)
          See comments in java.awt.Graphics2D.
 void transform(AffineTransform Tx)
          See comments in java.awt.Graphics2D.
 void translate(double tx, double ty)
          See comments in java.awt.Graphics2D.
 void translate(int x, int y)
          See comments in java.awt.Graphics2D.
 
Methods inherited from class java.awt.Graphics2D
draw3DRect, fill3DRect
 
Methods inherited from class java.awt.Graphics
create, drawBytes, drawChars, drawPolygon, drawRect, fillPolygon, finalize, getClipBounds, getClipRect, getFontMetrics, hitClip, toString
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GraphicsJAI

protected GraphicsJAI(Graphics2D g,
                      Component component)
Constructs a new instance of GraphicsJAI that wraps a given instance of Graphics2D for drawing to a given Component.
Method Detail

createGraphicsJAI

public static GraphicsJAI createGraphicsJAI(Graphics2D g,
                                            Component component)
Returns an instance of GraphicsJAI suitable for rendering to the given Component via the given Graphics2D instance.

If one is available, his method will select a hardware-specific implementation, that is specialized for the display device containing the component.


create

public Graphics create()
Creates a new GraphicsJAI object that is a copy of this GraphicsJAI object.
Overrides:
create in class Graphics
See Also:
Graphics.create()

getColor

public Color getColor()
See comments in java.awt.Graphics.
Overrides:
getColor in class Graphics
See Also:
Graphics.getColor()

setColor

public void setColor(Color c)
See comments in java.awt.Graphics.
Overrides:
setColor in class Graphics
See Also:
Graphics.setColor(Color)

setPaintMode

public void setPaintMode()
See comments in java.awt.Graphics.
Overrides:
setPaintMode in class Graphics
See Also:
Graphics.setPaintMode()

setXORMode

public void setXORMode(Color c1)
See comments in java.awt.Graphics.
Overrides:
setXORMode in class Graphics
See Also:
Graphics.setXORMode(Color)

getFont

public Font getFont()
See comments in java.awt.Graphics.
Overrides:
getFont in class Graphics
See Also:
Graphics.getFont()

setFont

public void setFont(Font font)
See comments in java.awt.Graphics.
Overrides:
setFont in class Graphics
See Also:
Graphics.setFont(Font)

getFontMetrics

public FontMetrics getFontMetrics(Font f)
See comments in java.awt.Graphics.
Overrides:
getFontMetrics in class Graphics
See Also:
Graphics.getFontMetrics(Font)

getClipBounds

public Rectangle getClipBounds()
See comments in java.awt.Graphics.
Overrides:
getClipBounds in class Graphics
See Also:
Graphics.getClipBounds()

clipRect

public void clipRect(int x,
                     int y,
                     int width,
                     int height)
See comments in java.awt.Graphics.
Overrides:
clipRect in class Graphics
See Also:
Graphics.clipRect(int, int, int, int)

setClip

public void setClip(int x,
                    int y,
                    int width,
                    int height)
See comments in java.awt.Graphics.
Overrides:
setClip in class Graphics
See Also:
Graphics.setClip(int, int, int, int)

getClip

public Shape getClip()
See comments in java.awt.Graphics.
Overrides:
getClip in class Graphics
See Also:
Graphics.getClip()

setClip

public void setClip(Shape clip)
See comments in java.awt.Graphics.
Overrides:
setClip in class Graphics
See Also:
Graphics.setClip(Shape)

copyArea

public void copyArea(int x,
                     int y,
                     int width,
                     int height,
                     int dx,
                     int dy)
See comments in java.awt.Graphics.
Overrides:
copyArea in class Graphics
See Also:
Graphics.copyArea(int, int, int, int, int, int)

drawLine

public void drawLine(int x1,
                     int y1,
                     int x2,
                     int y2)
See comments in java.awt.Graphics.
Overrides:
drawLine in class Graphics
See Also:
Graphics.drawLine(int, int, int, int)

fillRect

public void fillRect(int x,
                     int y,
                     int width,
                     int height)
See comments in java.awt.Graphics.
Overrides:
fillRect in class Graphics
See Also:
Graphics.fillRect(int, int, int, int)

clearRect

public void clearRect(int x,
                      int y,
                      int width,
                      int height)
See comments in java.awt.Graphics.
Overrides:
clearRect in class Graphics
See Also:
Graphics.clearRect(int, int, int, int)

drawRoundRect

public void drawRoundRect(int x,
                          int y,
                          int width,
                          int height,
                          int arcWidth,
                          int arcHeight)
See comments in java.awt.Graphics.
Overrides:
drawRoundRect in class Graphics
See Also:
Graphics.drawRoundRect(int, int, int, int, int, int)

fillRoundRect

public void fillRoundRect(int x,
                          int y,
                          int width,
                          int height,
                          int arcWidth,
                          int arcHeight)
See comments in java.awt.Graphics.
Overrides:
fillRoundRect in class Graphics
See Also:
Graphics.fillRoundRect(int, int, int, int, int, int)

drawOval

public void drawOval(int x,
                     int y,
                     int width,
                     int height)
See comments in java.awt.Graphics.
Overrides:
drawOval in class Graphics
See Also:
Graphics.drawOval(int, int, int, int)

fillOval

public void fillOval(int x,
                     int y,
                     int width,
                     int height)
See comments in java.awt.Graphics.
Overrides:
fillOval in class Graphics
See Also:
Graphics.fillOval(int, int, int, int)

drawArc

public void drawArc(int x,
                    int y,
                    int width,
                    int height,
                    int startAngle,
                    int arcAngle)
See comments in java.awt.Graphics.
Overrides:
drawArc in class Graphics
See Also:
Graphics.drawArc(int, int, int, int, int, int)

fillArc

public void fillArc(int x,
                    int y,
                    int width,
                    int height,
                    int startAngle,
                    int arcAngle)
See comments in java.awt.Graphics.
Overrides:
fillArc in class Graphics
See Also:
Graphics.fillArc(int, int, int, int, int, int)

drawPolyline

public void drawPolyline(int[] xPoints,
                         int[] yPoints,
                         int nPoints)
See comments in java.awt.Graphics.
Overrides:
drawPolyline in class Graphics
See Also:
Graphics.drawPolyline(int[], int[], int)

drawPolygon

public void drawPolygon(int[] xPoints,
                        int[] yPoints,
                        int nPoints)
See comments in java.awt.Graphics.
Overrides:
drawPolygon in class Graphics
See Also:
Graphics.drawPolygon(int[], int[], int)

fillPolygon

public void fillPolygon(int[] xPoints,
                        int[] yPoints,
                        int nPoints)
See comments in java.awt.Graphics.
Overrides:
fillPolygon in class Graphics
See Also:
Graphics.fillPolygon(int[], int[], int)

drawImage

public boolean drawImage(Image img,
                         int x,
                         int y,
                         ImageObserver observer)
See comments in java.awt.Graphics.
Overrides:
drawImage in class Graphics
See Also:
Graphics.drawImage(Image, int, int, ImageObserver)

drawImage

public boolean drawImage(Image img,
                         int x,
                         int y,
                         int width,
                         int height,
                         ImageObserver observer)
See comments in java.awt.Graphics.
Overrides:
drawImage in class Graphics
See Also:
Graphics.drawImage(Image, int, int, int, int, ImageObserver)

drawImage

public boolean drawImage(Image img,
                         int x,
                         int y,
                         Color bgcolor,
                         ImageObserver observer)
See comments in java.awt.Graphics.
Overrides:
drawImage in class Graphics
See Also:
Graphics.drawImage(Image, int, int, Color, ImageObserver)

drawImage

public boolean drawImage(Image img,
                         int x,
                         int y,
                         int width,
                         int height,
                         Color bgcolor,
                         ImageObserver observer)
See comments in java.awt.Graphics.
Overrides:
drawImage in class Graphics
See Also:
Graphics.drawImage(Image, int, int, int, int, Color, ImageObserver)

drawImage

public boolean drawImage(Image img,
                         int dx1,
                         int dy1,
                         int dx2,
                         int dy2,
                         int sx1,
                         int sy1,
                         int sx2,
                         int sy2,
                         ImageObserver observer)
See comments in java.awt.Graphics.
Overrides:
drawImage in class Graphics
See Also:
Graphics.drawImage(Image, int, int, int, int, int, int, int, int, ImageObserver)

drawImage

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)
See comments in java.awt.Graphics.
Overrides:
drawImage in class Graphics
See Also:
Graphics.drawImage(Image, int, int, int, int, int, int, int, int, Color, ImageObserver)

dispose

public void dispose()
See comments in java.awt.Graphics.
Overrides:
dispose in class Graphics
See Also:
Graphics.dispose()

draw

public void draw(Shape s)
See comments in java.awt.Graphics2D.
Overrides:
draw in class Graphics2D
See Also:
Graphics2D.draw(Shape)

drawImage

public boolean drawImage(Image img,
                         AffineTransform xform,
                         ImageObserver obs)
See comments in java.awt.Graphics2D.
Overrides:
drawImage in class Graphics2D
See Also:
Graphics2D.drawImage(Image, AffineTransform, ImageObserver)

drawImage

public void drawImage(BufferedImage img,
                      BufferedImageOp op,
                      int x,
                      int y)
See comments in java.awt.Graphics2D.
Overrides:
drawImage in class Graphics2D
See Also:
Graphics2D.drawImage(BufferedImage, BufferedImageOp, int, int)

drawRenderedImage

public void drawRenderedImage(RenderedImage img,
                              AffineTransform xform)
See comments in java.awt.Graphics2D.
Overrides:
drawRenderedImage in class Graphics2D
See Also:
Graphics2D.drawRenderedImage(RenderedImage, AffineTransform)

drawRenderableImage

public void drawRenderableImage(RenderableImage img,
                                AffineTransform xform)
See comments in java.awt.Graphics2D.
Overrides:
drawRenderableImage in class Graphics2D
See Also:
Graphics2D.drawRenderableImage(RenderableImage, AffineTransform)

drawString

public void drawString(String str,
                       int x,
                       int y)
See comments in java.awt.Graphics2D.
Overrides:
drawString in class Graphics2D
See Also:
Graphics2D.drawString(String, int, int)

drawString

public void drawString(String s,
                       float x,
                       float y)
See comments in java.awt.Graphics2D.
Overrides:
drawString in class Graphics2D
See Also:
Graphics2D.drawString(String, float, float)

drawString

public void drawString(AttributedCharacterIterator iterator,
                       int x,
                       int y)
See comments in java.awt.Graphics2D.
Overrides:
drawString in class Graphics2D
See Also:
Graphics2D.drawString(AttributedCharacterIterator, int, int)

drawString

public void drawString(AttributedCharacterIterator iterator,
                       float x,
                       float y)
See comments in java.awt.Graphics2D.
Overrides:
drawString in class Graphics2D
See Also:
Graphics2D.drawString(AttributedCharacterIterator, float, float)

drawGlyphVector

public void drawGlyphVector(GlyphVector g,
                            float x,
                            float y)
See comments in java.awt.Graphics2D.
Overrides:
drawGlyphVector in class Graphics2D
See Also:
Graphics2D.drawGlyphVector(GlyphVector, float, float)

fill

public void fill(Shape s)
See comments in java.awt.Graphics2D.
Overrides:
fill in class Graphics2D
See Also:
Graphics2D.fill(Shape)

hit

public boolean hit(Rectangle rect,
                   Shape s,
                   boolean onStroke)
See comments in java.awt.Graphics2D.
Overrides:
hit in class Graphics2D
See Also:
Graphics2D.hit(Rectangle, Shape, boolean)

getDeviceConfiguration

public GraphicsConfiguration getDeviceConfiguration()
See comments in java.awt.Graphics2D.
Overrides:
getDeviceConfiguration in class Graphics2D
See Also:
Graphics2D.getDeviceConfiguration()

setComposite

public void setComposite(Composite comp)
See comments in java.awt.Graphics2D.
Overrides:
setComposite in class Graphics2D
See Also:
Graphics2D.setComposite(Composite)

setPaint

public void setPaint(Paint paint)
See comments in java.awt.Graphics2D.
Overrides:
setPaint in class Graphics2D
See Also:
Graphics2D.setPaint(Paint)

setStroke

public void setStroke(Stroke s)
See comments in java.awt.Graphics2D.
Overrides:
setStroke in class Graphics2D
See Also:
Graphics2D.setStroke(Stroke)

setRenderingHint

public void setRenderingHint(RenderingHints.Key hintKey,
                             Object hintValue)
See comments in java.awt.Graphics2D.
Overrides:
setRenderingHint in class Graphics2D
See Also:
Graphics2D.setRenderingHint(RenderingHints.Key, Object)

getRenderingHint

public Object getRenderingHint(RenderingHints.Key hintKey)
See comments in java.awt.Graphics2D.
Overrides:
getRenderingHint in class Graphics2D
See Also:
Graphics2D.getRenderingHint(RenderingHints.Key)

setRenderingHints

public void setRenderingHints(Map hints)
See comments in java.awt.Graphics2D.
Overrides:
setRenderingHints in class Graphics2D
See Also:
Graphics2D.setRenderingHints(Map)

addRenderingHints

public void addRenderingHints(Map hints)
See comments in java.awt.Graphics2D.
Overrides:
addRenderingHints in class Graphics2D
See Also:
Graphics2D.addRenderingHints(Map)

getRenderingHints

public RenderingHints getRenderingHints()
See comments in java.awt.Graphics2D.
Overrides:
getRenderingHints in class Graphics2D
See Also:
Graphics2D.getRenderingHints()

translate

public void translate(int x,
                      int y)
See comments in java.awt.Graphics2D.
Overrides:
translate in class Graphics2D
See Also:
Graphics2D.translate(int, int)

translate

public void translate(double tx,
                      double ty)
See comments in java.awt.Graphics2D.
Overrides:
translate in class Graphics2D
See Also:
Graphics2D.translate(double, double)

rotate

public void rotate(double theta)
See comments in java.awt.Graphics2D.
Overrides:
rotate in class Graphics2D
See Also:
Graphics2D.rotate(double)

rotate

public void rotate(double theta,
                   double x,
                   double y)
See comments in java.awt.Graphics2D.
Overrides:
rotate in class Graphics2D
See Also:
Graphics2D.rotate(double, double, double)

scale

public void scale(double sx,
                  double sy)
See comments in java.awt.Graphics2D.
Overrides:
scale in class Graphics2D
See Also:
Graphics2D.scale(double, double)

shear

public void shear(double shx,
                  double shy)
See comments in java.awt.Graphics2D.
Overrides:
shear in class Graphics2D
See Also:
Graphics2D.shear(double, double)

transform

public void transform(AffineTransform Tx)
See comments in java.awt.Graphics2D.
Overrides:
transform in class Graphics2D
See Also:
Graphics2D.transform(AffineTransform)

setTransform

public void setTransform(AffineTransform Tx)
See comments in java.awt.Graphics2D.
Overrides:
setTransform in class Graphics2D
See Also:
Graphics2D.setTransform(AffineTransform)

getTransform

public AffineTransform getTransform()
See comments in java.awt.Graphics2D.
Overrides:
getTransform in class Graphics2D
See Also:
Graphics2D.getTransform()

getPaint

public Paint getPaint()
See comments in java.awt.Graphics2D.
Overrides:
getPaint in class Graphics2D
See Also:
Graphics2D.getPaint()

getComposite

public Composite getComposite()
See comments in java.awt.Graphics2D.
Overrides:
getComposite in class Graphics2D
See Also:
Graphics2D.getComposite()

setBackground

public void setBackground(Color color)
See comments in java.awt.Graphics2D.
Overrides:
setBackground in class Graphics2D
See Also:
Graphics2D.setBackground(Color)

getBackground

public Color getBackground()
See comments in java.awt.Graphics2D.
Overrides:
getBackground in class Graphics2D
See Also:
Graphics2D.getBackground()

getStroke

public Stroke getStroke()
See comments in java.awt.Graphics2D.
Overrides:
getStroke in class Graphics2D
See Also:
Graphics2D.getStroke()

clip

public void clip(Shape s)
See comments in java.awt.Graphics2D.
Overrides:
clip in class Graphics2D
See Also:
Graphics2D.clip(Shape)

getFontRenderContext

public FontRenderContext getFontRenderContext()
See comments in java.awt.Graphics2D.
Overrides:
getFontRenderContext in class Graphics2D
See Also:
Graphics2D.getFontRenderContext()