java.lang.Object
java.awt.Graphics
java.awt.Graphics2D
org.jfree.fx.FXGraphics2D
public class FXGraphics2D extends Graphics2D
A
Graphics2D implementation that writes to a JavaFX Canvas.
This is intended for general purpose usage, but has been created for use in
Orson Charts (http://www.object-refinery.com/orsoncharts/) and
JFreeChart (http://www.jfree.org/jfreechart/).-
Constructor Summary
Constructors Constructor Description FXGraphics2D(javafx.scene.canvas.GraphicsContext gc)Creates a new instance that will render to the specified JavaFXGraphicsContext. -
Method Summary
Modifier and Type Method Description voidaddRenderingHints(Map<?,?> hints)Adds all the supplied rendering hints.voidclearRect(int x, int y, int width, int height)Clears the specified rectangle by filling it with the current background color.voidclip(Shape s)Clips to the intersection of the current clipping region and the specified shape.voidclipRect(int x, int y, int width, int height)Clips to the intersection of the current clipping region and the specified rectangle.voidcopyArea(int x, int y, int width, int height, int dx, int dy)Not yet implemented.Graphicscreate()Creates a new graphics object that is a copy of this graphics object.GeneralPathcreatePolygon(int[] xPoints, int[] yPoints, int nPoints, boolean close)Creates a polygon from the specifiedxandycoordinate arrays.voiddispose()This method does nothing.voiddraw(Shape s)Draws the specified shape with the currentpaintandstroke.voiddrawArc(int x, int y, int width, int height, int startAngle, int arcAngle)Draws an arc contained within the rectangle(x, y, width, height), starting atstartAngleand continuing througharcAngledegrees using the currentpaintandstroke.voiddrawGlyphVector(GlyphVector g, float x, float y)Draws the specified glyph vector at the location(x, y).voiddrawImage(BufferedImage img, BufferedImageOp op, int x, int y)Draws the image resulting from applying theBufferedImageOpto the specified image at the location(x, y).booleandrawImage(Image img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, Color bgcolor, ImageObserver observer)Draws part of an image (defined by the source rectangle(sx1, sy1, sx2, sy2)) into the destination rectangle(dx1, dy1, dx2, dy2).booleandrawImage(Image img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, ImageObserver observer)Draws part of an image (defined by the source rectangle(sx1, sy1, sx2, sy2)) into the destination rectangle(dx1, dy1, dx2, dy2).booleandrawImage(Image img, int x, int y, int w, int h, Color bgcolor, ImageObserver observer)Draws an image to the rectangle(x, y, w, h)(scaling it if required), first filling the background with the specified color.booleandrawImage(Image img, int x, int y, int w, int h, ImageObserver observer)Draws the image into the rectangle defined by(x, y, w, h).booleandrawImage(Image img, int x, int y, Color bgcolor, ImageObserver observer)Draws an image at the location(x, y).booleandrawImage(Image img, int x, int y, ImageObserver observer)Draws an image at the location(x, y).booleandrawImage(Image img, AffineTransform xform, ImageObserver obs)Draws an image with the specified transform.voiddrawLine(int x1, int y1, int x2, int y2)Draws a line from(x1, y1)to(x2, y2)using the currentpaintandstroke.voiddrawOval(int x, int y, int width, int height)Draws an oval framed by the rectangle(x, y, width, height)using the currentpaintandstroke.voiddrawPolygon(int[] xPoints, int[] yPoints, int nPoints)Draws the specified polygon using the currentpaintandstroke.voiddrawPolyline(int[] xPoints, int[] yPoints, int nPoints)Draws the specified multi-segment line using the currentpaintandstroke.voiddrawRenderableImage(RenderableImage img, AffineTransform xform)Draws the renderable image.voiddrawRenderedImage(RenderedImage img, AffineTransform xform)Draws a rendered image.voiddrawRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight)Draws a rectangle with rounded corners using the currentpaintandstroke.voiddrawString(String str, float x, float y)Draws a string at(x, y).voiddrawString(String str, int x, int y)Draws a string at(x, y).voiddrawString(AttributedCharacterIterator iterator, float x, float y)Draws a string of attributed characters at(x, y).voiddrawString(AttributedCharacterIterator iterator, int x, int y)Draws a string of attributed characters at(x, y).voidfill(Shape s)Fills the specified shape with the currentpaint.voidfillArc(int x, int y, int width, int height, int startAngle, int arcAngle)Fills an arc contained within the rectangle(x, y, width, height), starting atstartAngleand continuing througharcAngledegrees, using the currentpaint.voidfillOval(int x, int y, int width, int height)Fills an oval framed by the rectangle(x, y, width, height).voidfillPolygon(int[] xPoints, int[] yPoints, int nPoints)Fills the specified polygon using the currentpaint.voidfillRect(int x, int y, int width, int height)Fills the specified rectangle with the currentpaint.voidfillRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight)Fills a rectangle with rounded corners using the currentpaint.ColorgetBackground()Returns the background color (the default value isColor.BLACK).ShapegetClip()Returns the user clipping region.RectanglegetClipBounds()Returns the bounds of the user clipping region.ColorgetColor()Returns the foreground color.CompositegetComposite()Returns the current composite.GraphicsConfigurationgetDeviceConfiguration()Returns the device configuration associated with thisGraphics2D.FontgetFont()Returns the current font used for drawing text.FontMetricsgetFontMetrics(Font f)Returns the font metrics for the specified font.FontRenderContextgetFontRenderContext()Returns the font render context.PaintgetPaint()Returns the paint used to draw or fill shapes (or text).ObjectgetRenderingHint(RenderingHints.Key hintKey)Returns the current value for the specified hint.RenderingHintsgetRenderingHints()Returns a copy of the rendering hints.StrokegetStroke()Returns the current stroke (this attribute is used when drawing shapes).AffineTransformgetTransform()Returns a copy of the current transform.doublegetZeroStrokeWidth()Returns the width to use for the stroke when the AWT stroke specified has a zero width (the default value is0.5).booleanhit(Rectangle rect, Shape s, boolean onStroke)Returnstrueif the rectangle (in device space) intersects with the shape (the interior, ifonStrokeisfalse, otherwise the stroked outline of the shape).voidrotate(double theta)Applies a rotation (anti-clockwise) about(0, 0).voidrotate(double theta, double x, double y)Applies a rotation (anti-clockwise) about(x, y).voidscale(double sx, double sy)Applies a scale transformation.voidsetBackground(Color color)Sets the background color.voidsetClip(int x, int y, int width, int height)Sets the user clipping region to the specified rectangle.voidsetClip(Shape shape)Sets the user clipping region.voidsetColor(Color c)Sets the foreground color.voidsetComposite(Composite comp)Sets the composite.voidsetFont(Font font)Sets the font to be used for drawing text.voidsetPaint(Paint paint)Sets the paint used to draw or fill shapes (or text).voidsetPaintMode()Not implemented - the method does nothing.voidsetRenderingHint(RenderingHints.Key hintKey, Object hintValue)Sets the value for a hint.voidsetRenderingHints(Map<?,?> hints)Sets the rendering hints to the specified collection.voidsetStroke(Stroke s)Sets the stroke that will be used to draw shapes.voidsetTransform(AffineTransform t)Sets the transform.voidsetXORMode(Color c1)Not implemented - the method does nothing.voidsetZeroStrokeWidth(double width)Sets the width to use for the stroke when setting a new AWT stroke that has a width of0.0.voidshear(double shx, double shy)Applies a shear transformation.voidtransform(AffineTransform t)Applies this transform to the existing transform by concatenating it.voidtranslate(double tx, double ty)Applies the translation(tx, ty).voidtranslate(int tx, int ty)Applies the translation(tx, ty).Methods inherited from class java.awt.Graphics
create, drawBytes, drawChars, drawPolygon, drawRect, fillPolygon, finalize, getClipBounds, getClipRect, getFontMetrics, hitClip, toString
-
Constructor Details
-
FXGraphics2D
Creates a new instance that will render to the specified JavaFXGraphicsContext.- Parameters:
gc- the graphics context (nullnot permitted).
-
-
Method Details
-
getZeroStrokeWidth
Returns the width to use for the stroke when the AWT stroke specified has a zero width (the default value is0.5).In the Java specification for
BasicStrokeit states "If width is set to 0.0f, the stroke is rendered as the thinnest possible line for the target device and the antialias hint setting." We don't have a means to implement that accurately since we must specify a fixed width to the JavaFX canvas - this attribute is the width that is used.- Returns:
- The width.
-
setZeroStrokeWidth
Sets the width to use for the stroke when setting a new AWT stroke that has a width of0.0.- Parameters:
width- the new width (must be 0.0 or greater).
-
getDeviceConfiguration
Returns the device configuration associated with thisGraphics2D.- Specified by:
getDeviceConfigurationin classGraphics2D- Returns:
- The device configuration (never
null).
-
create
Creates a new graphics object that is a copy of this graphics object. -
getPaint
Returns the paint used to draw or fill shapes (or text). The default value isColor.BLACK. This attribute is updated by both thesetPaint(java.awt.Paint)andsetColor(java.awt.Color)methods.- Specified by:
getPaintin classGraphics2D- Returns:
- The paint (never
null). - See Also:
setPaint(java.awt.Paint)
-
setPaint
Sets the paint used to draw or fill shapes (or text). Ifpaintis an instance ofColor, this method will also update the current color attribute (seegetColor()). If you passnullto this method, it does nothing (in accordance with the JDK specification).
Note that this implementation will mapColor,GradientPaint,LinearGradientPaintandRadialGradientPaintto JavaFX equivalents, other paint implementations are not handled.- Specified by:
setPaintin classGraphics2D- Parameters:
paint- the paint (nullis permitted but ignored).- See Also:
getPaint()
-
getColor
Returns the foreground color. This method exists for backwards compatibility in AWT, you should use thegetPaint()method. This attribute is updated by thesetColor(java.awt.Color)method, and also by thesetPaint(java.awt.Paint)method if aColorinstance is passed to the method.- Specified by:
getColorin classGraphics- Returns:
- The foreground color (never
null). - See Also:
getPaint()
-
setColor
Sets the foreground color. This method exists for backwards compatibility in AWT, you should use thesetPaint(java.awt.Paint)method.- Specified by:
setColorin classGraphics- Parameters:
c- the color (nullpermitted but ignored).- See Also:
setPaint(java.awt.Paint)
-
getBackground
Returns the background color (the default value isColor.BLACK). This attribute is used by theclearRect(int, int, int, int)method.- Specified by:
getBackgroundin classGraphics2D- Returns:
- The background color (possibly
null). - See Also:
setBackground(java.awt.Color)
-
setBackground
Sets the background color. This attribute is used by theclearRect(int, int, int, int)method. The reference implementation allowsnullfor the background color so we allow that too (but for that case, theclearRect(int, int, int, int)method will do nothing).- Specified by:
setBackgroundin classGraphics2D- Parameters:
color- the color (nullpermitted).- See Also:
getBackground()
-
getComposite
Returns the current composite.- Specified by:
getCompositein classGraphics2D- Returns:
- The current composite (never
null). - See Also:
setComposite(java.awt.Composite)
-
setComposite
Sets the composite. There is limited handling forAlphaComposite, other composites will have no effect on the output.- Specified by:
setCompositein classGraphics2D- Parameters:
comp- the composite (nullnot permitted).- See Also:
getComposite()
-
getStroke
Returns the current stroke (this attribute is used when drawing shapes).- Specified by:
getStrokein classGraphics2D- Returns:
- The current stroke (never
null). - See Also:
setStroke(java.awt.Stroke)
-
setStroke
Sets the stroke that will be used to draw shapes.- Specified by:
setStrokein classGraphics2D- Parameters:
s- the stroke (nullnot permitted).- See Also:
getStroke()
-
getRenderingHint
Returns the current value for the specified hint.- Specified by:
getRenderingHintin classGraphics2D- Parameters:
hintKey- the hint key (nullpermitted, but the result will benullalso in that case).- Returns:
- The current value for the specified hint
(possibly
null). - See Also:
setRenderingHint(java.awt.RenderingHints.Key, java.lang.Object)
-
setRenderingHint
Sets the value for a hint. See theFXHintsclass for information about the hints that can be used with this implementation.- Specified by:
setRenderingHintin classGraphics2D- Parameters:
hintKey- the hint key (nullnot permitted).hintValue- the hint value.- See Also:
getRenderingHint(java.awt.RenderingHints.Key)
-
getRenderingHints
Returns a copy of the rendering hints. Modifying the returned copy will have no impact on the state of thisGraphics2Dinstance.- Specified by:
getRenderingHintsin classGraphics2D- Returns:
- The rendering hints (never
null). - See Also:
setRenderingHints(java.util.Map)
-
setRenderingHints
Sets the rendering hints to the specified collection.- Specified by:
setRenderingHintsin classGraphics2D- Parameters:
hints- the new set of hints (nullnot permitted).- See Also:
getRenderingHints()
-
addRenderingHints
Adds all the supplied rendering hints.- Specified by:
addRenderingHintsin classGraphics2D- Parameters:
hints- the hints (nullnot permitted).
-
draw
Draws the specified shape with the currentpaintandstroke. There is direct handling forLine2D,Rectangle2D,Ellipse2D,Arc2DandPath2D. All other shapes are mapped to a path outline and then drawn.- Specified by:
drawin classGraphics2D- Parameters:
s- the shape (nullnot permitted).- See Also:
fill(java.awt.Shape)
-
fill
Fills the specified shape with the currentpaint. There is direct handling forRoundRectangle2D,Rectangle2D,Ellipse2DandArc2D. All other shapes are mapped to a path outline and then filled.- Specified by:
fillin classGraphics2D- Parameters:
s- the shape (nullnot permitted).- See Also:
draw(java.awt.Shape)
-
getFont
Returns the current font used for drawing text.- Specified by:
getFontin classGraphics- Returns:
- The current font (never
null). - See Also:
setFont(java.awt.Font)
-
setFont
Sets the font to be used for drawing text. -
getFontMetrics
Returns the font metrics for the specified font. The font metrics returned are from Java2D (via an internalBufferedImage) which does not always match exactly the font metrics used by JavaFX.- Specified by:
getFontMetricsin classGraphics- Parameters:
f- the font.- Returns:
- The font metrics.
-
getFontRenderContext
Returns the font render context. The implementation here returns theFontRenderContextfor an image that is maintained internally (as forgetFontMetrics(java.awt.Font)).- Specified by:
getFontRenderContextin classGraphics2D- Returns:
- The font render context.
-
drawString
Draws a string at(x, y). The start of the text at the baseline level will be aligned with the(x, y)point.- Specified by:
drawStringin classGraphics2D- Parameters:
str- the string (nullnot permitted).x- the x-coordinate.y- the y-coordinate.- See Also:
drawString(java.lang.String, float, float)
-
drawString
Draws a string at(x, y). The start of the text at the baseline level will be aligned with the(x, y)point.- Specified by:
drawStringin classGraphics2D- Parameters:
str- the string (nullnot permitted).x- the x-coordinate.y- the y-coordinate.
-
drawString
Draws a string of attributed characters at(x, y). The call is delegated todrawString(AttributedCharacterIterator, float, float).- Specified by:
drawStringin classGraphics2D- Parameters:
iterator- an iterator for the characters.x- the x-coordinate.y- the x-coordinate.
-
drawString
Draws a string of attributed characters at(x, y).- Specified by:
drawStringin classGraphics2D- Parameters:
iterator- an iterator over the characters (nullnot permitted).x- the x-coordinate.y- the y-coordinate.
-
drawGlyphVector
Draws the specified glyph vector at the location(x, y).- Specified by:
drawGlyphVectorin classGraphics2D- Parameters:
g- the glyph vector (nullnot permitted).x- the x-coordinate.y- the y-coordinate.
-
translate
Applies the translation(tx, ty). This call is delegated totranslate(double, double).- Specified by:
translatein classGraphics2D- Parameters:
tx- the x-translation.ty- the y-translation.- See Also:
translate(double, double)
-
translate
Applies the translation(tx, ty).- Specified by:
translatein classGraphics2D- Parameters:
tx- the x-translation.ty- the y-translation.
-
rotate
Applies a rotation (anti-clockwise) about(0, 0).- Specified by:
rotatein classGraphics2D- Parameters:
theta- the rotation angle (in radians).
-
rotate
Applies a rotation (anti-clockwise) about(x, y).- Specified by:
rotatein classGraphics2D- Parameters:
theta- the rotation angle (in radians).x- the x-coordinate.y- the y-coordinate.
-
scale
Applies a scale transformation.- Specified by:
scalein classGraphics2D- Parameters:
sx- the x-scaling factor.sy- the y-scaling factor.
-
shear
Applies a shear transformation. This is equivalent to the following call to thetransformmethod:
-
transform(AffineTransform.getShearInstance(shx, shy));
- Specified by:
shearin classGraphics2D- Parameters:
shx- the x-shear factor.shy- the y-shear factor.
-
-
transform
Applies this transform to the existing transform by concatenating it.- Specified by:
transformin classGraphics2D- Parameters:
t- the transform (nullnot permitted).
-
getTransform
Returns a copy of the current transform.- Specified by:
getTransformin classGraphics2D- Returns:
- A copy of the current transform (never
null). - See Also:
setTransform(java.awt.geom.AffineTransform)
-
setTransform
Sets the transform.- Specified by:
setTransformin classGraphics2D- Parameters:
t- the new transform (nullpermitted, resets to the identity transform).- See Also:
getTransform()
-
hit
Returnstrueif the rectangle (in device space) intersects with the shape (the interior, ifonStrokeisfalse, otherwise the stroked outline of the shape).- Specified by:
hitin classGraphics2D- Parameters:
rect- a rectangle (in device space).s- the shape.onStroke- test the stroked outline only?- Returns:
- A boolean.
-
setPaintMode
Not implemented - the method does nothing.- Specified by:
setPaintModein classGraphics
-
setXORMode
Not implemented - the method does nothing.- Specified by:
setXORModein classGraphics
-
getClipBounds
Returns the bounds of the user clipping region.- Specified by:
getClipBoundsin classGraphics- Returns:
- The clip bounds (possibly
null). - See Also:
getClip()
-
getClip
Returns the user clipping region. The initial default value isnull.- Specified by:
getClipin classGraphics- Returns:
- The user clipping region (possibly
null). - See Also:
setClip(java.awt.Shape)
-
setClip
Sets the user clipping region. -
clip
Clips to the intersection of the current clipping region and the specified shape. According to the Oracle API specification, this method will accept anullargument, but there is an open bug report (since 2004) that suggests this is wrong:http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6206189 In this implementation, a
nullargument is not permitted.- Specified by:
clipin classGraphics2D- Parameters:
s- the clip shape (nullnot permitted).
-
clipRect
Clips to the intersection of the current clipping region and the specified rectangle. -
setClip
Sets the user clipping region to the specified rectangle. -
drawLine
Draws a line from(x1, y1)to(x2, y2)using the currentpaintandstroke. -
fillRect
Fills the specified rectangle with the currentpaint. -
clearRect
Clears the specified rectangle by filling it with the current background color. If the background color isnull, this method will do nothing.- Specified by:
clearRectin classGraphics- Parameters:
x- the x-coordinate.y- the y-coordinate.width- the width.height- the height.- See Also:
getBackground()
-
drawRoundRect
Draws a rectangle with rounded corners using the currentpaintandstroke.- Specified by:
drawRoundRectin classGraphics- Parameters:
x- the x-coordinate.y- the y-coordinate.width- the width.height- the height.arcWidth- the arc-width.arcHeight- the arc-height.- See Also:
fillRoundRect(int, int, int, int, int, int)
-
fillRoundRect
Fills a rectangle with rounded corners using the currentpaint.- Specified by:
fillRoundRectin classGraphics- Parameters:
x- the x-coordinate.y- the y-coordinate.width- the width.height- the height.arcWidth- the arc-width.arcHeight- the arc-height.- See Also:
drawRoundRect(int, int, int, int, int, int)
-
drawOval
Draws an oval framed by the rectangle(x, y, width, height)using the currentpaintandstroke.- Specified by:
drawOvalin classGraphics- Parameters:
x- the x-coordinate.y- the y-coordinate.width- the width.height- the height.- See Also:
fillOval(int, int, int, int)
-
fillOval
Fills an oval framed by the rectangle(x, y, width, height).- Specified by:
fillOvalin classGraphics- Parameters:
x- the x-coordinate.y- the y-coordinate.width- the width.height- the height.- See Also:
drawOval(int, int, int, int)
-
drawArc
Draws an arc contained within the rectangle(x, y, width, height), starting atstartAngleand continuing througharcAngledegrees using the currentpaintandstroke.- Specified by:
drawArcin classGraphics- Parameters:
x- the x-coordinate.y- the y-coordinate.width- the width.height- the height.startAngle- the start angle in degrees, 0 = 3 o'clock.arcAngle- the angle (anticlockwise) in degrees.- See Also:
fillArc(int, int, int, int, int, int)
-
fillArc
Fills an arc contained within the rectangle(x, y, width, height), starting atstartAngleand continuing througharcAngledegrees, using the currentpaint.- Specified by:
fillArcin classGraphics- Parameters:
x- the x-coordinate.y- the y-coordinate.width- the width.height- the height.startAngle- the start angle in degrees, 0 = 3 o'clock.arcAngle- the angle (anticlockwise) in degrees.- See Also:
drawArc(int, int, int, int, int, int)
-
drawPolyline
Draws the specified multi-segment line using the currentpaintandstroke.- Specified by:
drawPolylinein classGraphics- Parameters:
xPoints- the x-points.yPoints- the y-points.nPoints- the number of points to use for the polyline.
-
drawPolygon
Draws the specified polygon using the currentpaintandstroke.- Specified by:
drawPolygonin classGraphics- Parameters:
xPoints- the x-points.yPoints- the y-points.nPoints- the number of points to use for the polygon.- See Also:
fillPolygon(int[], int[], int)
-
fillPolygon
Fills the specified polygon using the currentpaint.- Specified by:
fillPolygonin classGraphics- Parameters:
xPoints- the x-points.yPoints- the y-points.nPoints- the number of points to use for the polygon.- See Also:
drawPolygon(int[], int[], int)
-
createPolygon
Creates a polygon from the specifiedxandycoordinate arrays.- Parameters:
xPoints- the x-points.yPoints- the y-points.nPoints- the number of points to use for the polyline.close- closed?- Returns:
- A polygon.
-
drawImage
Draws an image at the location(x, y). Note that theobserveris ignored. -
drawImage
Draws the image into the rectangle defined by(x, y, w, h). Note that theobserveris ignored (it is not useful in this context). -
drawImage
Draws an image at the location(x, y). Note that theobserveris ignored. -
drawImage
public boolean drawImage(Image img, int x, int y, int w, int h, Color bgcolor, ImageObserver observer)Draws an image to the rectangle(x, y, w, h)(scaling it if required), first filling the background with the specified color. Note that theobserveris ignored. -
drawImage
public boolean drawImage(Image img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, ImageObserver observer)Draws part of an image (defined by the source rectangle(sx1, sy1, sx2, sy2)) into the destination rectangle(dx1, dy1, dx2, dy2). Note that theobserveris ignored in this implementation.- Specified by:
drawImagein classGraphics- Parameters:
img- the image.dx1- the x-coordinate for the top left of the destination.dy1- the y-coordinate for the top left of the destination.dx2- the x-coordinate for the bottom right of the destination.dy2- the y-coordinate for the bottom right of the destination.sx1- the x-coordinate for the top left of the source.sy1- the y-coordinate for the top left of the source.sx2- the x-coordinate for the bottom right of the source.sy2- the y-coordinate for the bottom right of the source.- Returns:
trueif the image is drawn.
-
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)Draws part of an image (defined by the source rectangle(sx1, sy1, sx2, sy2)) into the destination rectangle(dx1, dy1, dx2, dy2). The destination rectangle is first cleared by filling it with the specifiedbgcolor. Note that theobserveris ignored.- Specified by:
drawImagein classGraphics- Parameters:
img- the image.dx1- the x-coordinate for the top left of the destination.dy1- the y-coordinate for the top left of the destination.dx2- the x-coordinate for the bottom right of the destination.dy2- the y-coordinate for the bottom right of the destination.sx1- the x-coordinate for the top left of the source.sy1- the y-coordinate for the top left of the source.sx2- the x-coordinate for the bottom right of the source.sy2- the y-coordinate for the bottom right of the source.bgcolor- the background color (nullpermitted).observer- ignored.- Returns:
trueif the image is drawn.
-
drawRenderedImage
Draws a rendered image.- Specified by:
drawRenderedImagein classGraphics2D- Parameters:
img- the rendered image.xform- the transform.
-
drawRenderableImage
Draws the renderable image.- Specified by:
drawRenderableImagein classGraphics2D- Parameters:
img- the renderable image.xform- the transform.
-
drawImage
Draws an image with the specified transform. Note that theobserveris ignored in this implementation.- Specified by:
drawImagein classGraphics2D- Parameters:
img- the image.xform- the transform (nullpermitted).obs- the image observer (ignored).- Returns:
trueif the image is drawn.
-
drawImage
Draws the image resulting from applying theBufferedImageOpto the specified image at the location(x, y).- Specified by:
drawImagein classGraphics2D- Parameters:
img- the image.op- the operation.x- the x-coordinate.y- the y-coordinate.
-
copyArea
Not yet implemented. -
dispose
This method does nothing.
-