
public String toString();
// Deprecated Public Methods
# public Rectangle getClipRect();
}
Subc lasses: Graphics2D, javax.swing .DebugGraphics
Passed To: Too many methods to list.
Retur ned By: Component.getGraphics(), Graphics.create(), Image.getGraphics(), PrintJob.getGraphics(),
java.awt.image.BufferedImage.getGraphics(), java.awt.peer.ComponentPeer.getGraphics(),
javax.swing .DebugGraphics.create(), javax.swing .JComponent.{getComponentGraphics(), getGraphics()}
Graphics2D Ja va 1.2
java.awt
This class is the Java 2D graphics context that encapsulates all drawing and filling oper-
ations. It generalizes and extends the Graphics class. A number of attributes control how
the Graphics2D object perfor ms drawing and filling operations. You can set these
attributes with the following methods:
setBackground()
Specifies the background color used by the clearRect() method of the Graphics
object. Prior to Java 2D, the background color could not be set.
setClip()
Sets the clipping region, outside of which no drawing is done. This method is
inherited from the Graphics object. Use setClip() to establish an initial clipping region
and then use clip() to narrow that region by intersecting it with other regions.
setComposite()
Specifies a Composite object (typically an instance of AlphaComposite) that should be
used to combine drawing colors with the colors that are alr eady pr esent on the
drawing surface.
setFont() ...