|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Graphics
java.awt.Graphics2D
javax.media.jai.RenderableGraphics
An implementation of Graphics2D
with
RenderableImage
semantics. In other words, content may be
drawn into the image using the Graphics2D
interface and later
be turned into RenderedImage
s with different resolutions and
characteristics.
A RenderableGraphics
occupies a region of the plane
specified at the time of construction.
The contents of RenderableImage
s that are drawn onto a
RenderableGraphics
are accessed only at the time of rendering,
not the time of drawing.
Since the methods of this class all derive from Graphics2D
and RenderableImage
, they are not all commented individually.
Graphics2D
,
RenderableImage
Field Summary |
Fields inherited from interface java.awt.image.renderable.RenderableImage |
HINTS_OBSERVED |
Constructor Summary | |
RenderableGraphics(Rectangle2D dimensions)
Constructs a RenderableGraphics given a bounding
Rectangle2D . |
Method Summary | |
void |
addRenderingHints(Map hints)
|
void |
clearRect(int x,
int y,
int width,
int height)
|
void |
clip(Shape s)
|
void |
clipRect(int x,
int y,
int width,
int height)
|
void |
copyArea(int x,
int y,
int width,
int height,
int dx,
int dy)
|
Graphics |
create()
|
RenderedImage |
createDefaultRendering()
|
RenderedImage |
createRendering(RenderContext renderContext)
Creates a RenderedImage that represents a rendering of this image using a given RenderContext. |
RenderedImage |
createScaledRendering(int w,
int h,
RenderingHints hints)
|
void |
dispose()
|
void |
draw(Shape s)
|
void |
draw3DRect(int x,
int y,
int width,
int height,
boolean raised)
|
void |
drawArc(int x,
int y,
int width,
int height,
int startAngle,
int arcAngle)
|
void |
drawGlyphVector(GlyphVector v,
float x,
float y)
|
void |
drawImage(BufferedImage img,
BufferedImageOp op,
int x,
int y)
|
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[] xPoints,
int[] yPoints,
int nPoints)
|
void |
drawPolyline(int[] xPoints,
int[] yPoints,
int nPoints)
|
void |
drawRenderableImage(RenderableImage img,
AffineTransform xform)
|
void |
drawRenderedImage(RenderedImage img,
AffineTransform xform)
|
void |
drawRoundRect(int x,
int y,
int width,
int height,
int arcWidth,
int arcHeight)
|
void |
drawString(AttributedCharacterIterator iterator,
float x,
float y)
|
void |
drawString(AttributedCharacterIterator iterator,
int x,
int y)
|
void |
drawString(String s,
float x,
float y)
|
void |
drawString(String str,
int x,
int y)
|
void |
fill(Shape s)
|
void |
fill3DRect(int x,
int y,
int width,
int height,
boolean raised)
|
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[] xPoints,
int[] yPoints,
int nPoints)
|
void |
fillRect(int x,
int y,
int width,
int height)
|
void |
fillRoundRect(int x,
int y,
int width,
int height,
int arcWidth,
int arcHeight)
|
Color |
getBackground()
|
Shape |
getClip()
|
Rectangle |
getClipBounds()
|
Color |
getColor()
|
Composite |
getComposite()
|
GraphicsConfiguration |
getDeviceConfiguration()
|
Font |
getFont()
|
FontMetrics |
getFontMetrics(Font f)
|
FontRenderContext |
getFontRenderContext()
|
float |
getHeight()
|
float |
getMinX()
|
float |
getMinY()
|
Paint |
getPaint()
|
Object |
getProperty(String name)
|
String[] |
getPropertyNames()
|
Object |
getRenderingHint(RenderingHints.Key hintKey)
|
RenderingHints |
getRenderingHints()
|
Vector |
getSources()
|
Stroke |
getStroke()
|
AffineTransform |
getTransform()
|
float |
getWidth()
|
boolean |
hit(Rectangle rect,
Shape s,
boolean onStroke)
|
boolean |
isDynamic()
|
void |
rotate(double theta)
|
void |
rotate(double theta,
double x,
double y)
|
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 c)
|
void |
setComposite(Composite comp)
|
void |
setFont(Font font)
|
void |
setPaint(Paint paint)
|
void |
setPaintMode()
|
void |
setRenderingHint(RenderingHints.Key hintKey,
Object hintValue)
|
void |
setRenderingHints(Map hints)
|
void |
setStroke(Stroke s)
|
void |
setTransform(AffineTransform Tx)
|
void |
setXORMode(Color c1)
|
void |
shear(double shx,
double shy)
|
void |
transform(AffineTransform Tx)
|
void |
translate(double x,
double y)
|
void |
translate(int x,
int y)
|
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 |
public RenderableGraphics(Rectangle2D dimensions)
RenderableGraphics
given a bounding
Rectangle2D
.
dimensions
- The bounding Rectangle2D
.Method Detail |
public Graphics create()
public Color getColor()
public void setColor(Color c)
public void setPaintMode()
public void setXORMode(Color c1)
public Font getFont()
public void setFont(Font font)
public FontMetrics getFontMetrics(Font f)
public Rectangle getClipBounds()
public void clipRect(int x, int y, int width, int height)
public void setClip(int x, int y, int width, int height)
public Shape getClip()
public void setClip(Shape clip)
public void copyArea(int x, int y, int width, int height, int dx, int dy)
public void drawLine(int x1, int y1, int x2, int y2)
public void fillRect(int x, int y, int width, int height)
public void clearRect(int x, int y, int width, int height)
public void drawRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight)
public void fillRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight)
public void draw3DRect(int x, int y, int width, int height, boolean raised)
public void fill3DRect(int x, int y, int width, int height, boolean raised)
public void drawOval(int x, int y, int width, int height)
public void fillOval(int x, int y, int width, int height)
public void drawArc(int x, int y, int width, int height, int startAngle, int arcAngle)
public void fillArc(int x, int y, int width, int height, int startAngle, int arcAngle)
public void drawPolyline(int[] xPoints, int[] yPoints, int nPoints)
public void drawPolygon(int[] xPoints, int[] yPoints, int nPoints)
public void fillPolygon(int[] xPoints, int[] yPoints, int nPoints)
public void drawString(String str, int x, int y)
public boolean drawImage(Image img, int x, int y, ImageObserver observer)
public boolean drawImage(Image img, int x, int y, int width, int height, ImageObserver observer)
public boolean drawImage(Image img, int x, int y, Color bgcolor, ImageObserver observer)
public boolean drawImage(Image img, int x, int y, int width, int height, Color bgcolor, ImageObserver observer)
public boolean drawImage(Image img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, ImageObserver observer)
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)
public void dispose()
public void addRenderingHints(Map hints)
public void draw(Shape s)
public boolean drawImage(Image img, AffineTransform xform, ImageObserver obs)
public void drawRenderedImage(RenderedImage img, AffineTransform xform)
public void drawRenderableImage(RenderableImage img, AffineTransform xform)
public void drawImage(BufferedImage img, BufferedImageOp op, int x, int y)
public void drawString(String s, float x, float y)
public void drawString(AttributedCharacterIterator iterator, int x, int y)
public void drawString(AttributedCharacterIterator iterator, float x, float y)
public void drawGlyphVector(GlyphVector v, float x, float y)
public void fill(Shape s)
public boolean hit(Rectangle rect, Shape s, boolean onStroke)
public GraphicsConfiguration getDeviceConfiguration()
public FontRenderContext getFontRenderContext()
public void setComposite(Composite comp)
public void setPaint(Paint paint)
public void setStroke(Stroke s)
public void setRenderingHint(RenderingHints.Key hintKey, Object hintValue)
public Object getRenderingHint(RenderingHints.Key hintKey)
public void setRenderingHints(Map hints)
public RenderingHints getRenderingHints()
public void translate(int x, int y)
public void translate(double x, double y)
public void rotate(double theta)
public void rotate(double theta, double x, double y)
public void scale(double sx, double sy)
public void shear(double shx, double shy)
public void transform(AffineTransform Tx)
public void setTransform(AffineTransform Tx)
public AffineTransform getTransform()
public Paint getPaint()
public Composite getComposite()
public void setBackground(Color color)
public Color getBackground()
public Stroke getStroke()
public void clip(Shape s)
public Vector getSources()
getSources
in interface RenderableImage
public Object getProperty(String name)
getProperty
in interface RenderableImage
public String[] getPropertyNames()
getPropertyNames
in interface RenderableImage
public boolean isDynamic()
isDynamic
in interface RenderableImage
public float getWidth()
getWidth
in interface RenderableImage
public float getHeight()
getHeight
in interface RenderableImage
public float getMinX()
getMinX
in interface RenderableImage
public float getMinY()
getMinY
in interface RenderableImage
public RenderedImage createScaledRendering(int w, int h, RenderingHints hints)
createScaledRendering
in interface RenderableImage
public RenderedImage createDefaultRendering()
createDefaultRendering
in interface RenderableImage
public RenderedImage createRendering(RenderContext renderContext)
The created RenderedImage may have a property identified by the String HINTS_OBSERVED to indicate which RenderingHints (from the RenderContext) were used to create the image. In addition any RenderedImages that are obtained via the getSources() method on the created RenderedImage may have such a property.
The bounds of the RenderedImage
are determined from
the dimensions parameter passed to the RenderableGraphics
constructor. These bounds will be transformed by any
AffineTransform
from the RenderContext
.
The RenderingHints
from the RenderContext
may
be used to specify the tile width and height, SampleModel
,
and ColorModel
by supplying an ImageLayout
hint. The precedence for determining tile width and height is to use
firstly values provided explicitly via the ImageLayout
,
secondly the width and height of the SampleModel
in the
hint, and thirdly the bounds of the RenderableGraphics
object after transformation.
If either the SampleModel
or ColorModel
is null, an attempt will be made to derive a compatible value for the
null object from the non-null object. If they are both null, a 3-band
byte TiledImage
with a null ColorModel
and a
PixelInterleavedSampleModel
will be created.
createRendering
in interface RenderableImage
renderContext
- the RenderContext to use to produce the rendering.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |