java.awt
public abstract class Graphics2D extends Graphics
Graphics2D
;Graphics2D
.Third party libraries provide support for output to other formats via this API, including encapsulated postscript (EPS), portable document format (PDF), and scalable vector graphics (SVG).
Constructor Summary | |
---|---|
protected | Graphics2D() |
Method Summary | |
---|---|
abstract void | addRenderingHints(Map<?,?> hints)
Adds/updates the rendering hint.
|
abstract void | clip(Shape s)
Sets the clip region to the intersection of the current clipping region
and s .
|
abstract void | draw(Shape shape)
Draws an outline around a shape using the current stroke and paint.
|
void | draw3DRect(int x, int y, int width, int height, boolean raised) |
abstract void | drawGlyphVector(GlyphVector g, float x, float y)
Draws a glyph vector at the specified location.
|
abstract boolean | drawImage(Image image, AffineTransform xform, ImageObserver obs) |
abstract void | drawImage(BufferedImage image, BufferedImageOp op, int x, int y) |
abstract void | drawRenderableImage(RenderableImage image, AffineTransform xform) |
abstract void | drawRenderedImage(RenderedImage image, AffineTransform xform) |
abstract void | drawString(String text, int x, int y)
Draws a string at the specified location, using the current font.
|
abstract void | drawString(String text, float x, float y)
Draws a string at the specified location, using the current font.
|
abstract void | drawString(AttributedCharacterIterator iterator, int x, int y)
Draws an attributed string at the specified location.
|
abstract void | drawString(AttributedCharacterIterator iterator, float x, float y)
Draws an attributed string at the specified location.
|
abstract void | fill(Shape shape)
Fills the interior of the specified shape using the current
paint.
|
void | fill3DRect(int x, int y, int width, int height, boolean raised) |
abstract Color | getBackground()
Returns the color used by the
{@link Graphics#clearRect(int, int, int, int)} method.
|
abstract Composite | getComposite()
Returns the current compositing rule.
|
abstract GraphicsConfiguration | getDeviceConfiguration() |
abstract FontRenderContext | getFontRenderContext()
Returns the font render context.
|
abstract Paint | getPaint()
Returns the current paint.
|
abstract Object | getRenderingHint(RenderingHints.Key hintKey)
Returns the current value of a rendering hint.
|
abstract RenderingHints | getRenderingHints()
Returns the current rendering hints.
|
abstract Stroke | getStroke()
Returns the current stroke.
|
abstract AffineTransform | getTransform()
Returns the current transform.
|
abstract boolean | hit(Rectangle rect, Shape text, boolean onStroke) |
abstract void | rotate(double theta) |
abstract void | rotate(double theta, double x, double y) |
abstract void | scale(double scaleX, double scaleY) |
abstract void | setBackground(Color color)
Sets the background color (used by the
{@link Graphics#clearRect(int, int, int, int)} method).
|
abstract void | setComposite(Composite comp)
Sets the current compositing rule.
|
abstract void | setPaint(Paint paint)
Sets the paint to be used for subsequent drawing operations.
|
abstract void | setRenderingHint(RenderingHints.Key hintKey, Object hintValue)
Adds or updates a hint in the current rendering hints table.
|
abstract void | setRenderingHints(Map<?,?> hints)
Replaces the current rendering hints with the supplied hints.
|
abstract void | setStroke(Stroke stroke)
Sets the stroke to be used for subsequent drawing operations.
|
abstract void | setTransform(AffineTransform transform)
Sets the current transform. |
abstract void | shear(double shearX, double shearY) |
abstract void | transform(AffineTransform transform)
Sets the current transform to a concatenation of transform
and the existing transform.
|
abstract void | translate(int x, int y) |
abstract void | translate(double tx, double ty) |
Parameters: hints the hints to add or update.
s
.
Parameters: s the shape to intersect with the current clipping region.
See Also: setClip
Parameters: shape the shape (null
not permitted).
Parameters: g the glyph vector. x the x-coordinate. y the y-coordinate.
Parameters: text the string to draw. x the x-coordinate. y the y-coordinate.
See Also: setFont
Parameters: text the string to draw. x the x-coordinate. y the y-coordinate.
See Also: setFont
Parameters: iterator the source of the attributed text. x the x-coordinate. y the y-coordinate.
Parameters: iterator the source of the attributed text. x the x-coordinate. y the y-coordinate.
shape
using the current
paint.
Parameters: shape the shape to fill (null
not permitted).
Returns: The background color.
See Also: setBackground
Returns: The current compositing rule.
See Also: setComposite
Returns: The font render context.
Returns: The current paint.
See Also: setPaint
Parameters: hintKey the key for the hint.
Returns: The value for the specified hint.
Returns: The current rendering hints.
Returns: The current stroke.
See Also: setStroke
Returns: The current transform.
See Also: setTransform
Parameters: color the color.
See Also: getBackground
Parameters: comp the composite.
See Also: getComposite
Parameters: paint the paint (null
not permitted).
See Also: getPaint
Parameters: hintKey the hint key. hintValue the hint value.
Parameters: hints the hints.
See Also: addRenderingHints
Parameters: stroke the stroke (null
not permitted).
See Also: getStroke
null
transform, this method should set the current transform to the
identity transform.
Parameters: transform the transform (null
permitted).
See Also: getTransform
transform
and the existing transform.
Parameters: transform the transform.