| Modifier and Type | Field and Description |
|---|---|
| private Graphics | g
The Graphics instance that performs the drawing for this Graphics. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | clearRect(int
the x coordinate of the rectangle to clear. x, int the y coordinate of the rectangle to clear. y, int the width of the rectangle to clear. width, int the height of the rectangle to clear. height)Implements abstract java. Clears the specified rectangle by filling it with the background color of the current drawing surface. |
| public void | clipRect(int
the x coordinate of the rectangle to intersect the clip with x, int the y coordinate of the rectangle to intersect the clip with y, int the width of the rectangle to intersect the clip with width, int the height of the rectangle to intersect the clip with height)Implements abstract java. Intersects the current clip with the specified rectangle. |
| public void | copyArea(int
the x coordinate of the source rectangle. x, int the y coordinate of the source rectangle. y, int the width of the source rectangle. width, int the height of the source rectangle. height, int the horizontal distance to copy the pixels. dx, int the vertical distance to copy the pixels. dy)Implements abstract java. Copies an area of the component by a distance specified by
|
| public Graphics | Returns: a new graphics context that is a copy of this graphics context.Implements abstract java. Creates a new |
| public Graphics | Returns: a new graphics context.the x coordinate. x, int the y coordinate. y, int the width of the clipping rectangle. width, int the height of the clipping rectangle. height)Overrides java. Creates a new |
| public void | dispose()
Implements abstract java. Disposes of this graphics context and releases any system resources that it is using. |
| public void | draw3DRect(int
the x coordinate of the rectangle to be drawn. x, int the y coordinate of the rectangle to be drawn. y, int the width of the rectangle to be drawn. width, int the height of the rectangle to be drawn. height, boolean a boolean that determines whether the rectangle
appears to be raised above the surface
or sunk into the surface. raised)Overrides java. Draws a 3-D highlighted outline of the specified rectangle. |
| public void | drawArc(int
the x coordinate of the
upper-left corner of the arc to be drawn. x, int the y coordinate of the
upper-left corner of the arc to be drawn. y, int the width of the arc to be drawn. width, int the height of the arc to be drawn. height, int the beginning angle. startAngle, int the angular extent of the arc,
relative to the start angle. arcAngle)Implements abstract java. Draws the outline of a circular or elliptical arc covering the specified rectangle. |
| public void | drawBytes(byte[]
the data to be drawn data, int the start offset in the data offset, int the number of bytes that are drawn length, int the x coordinate of the baseline of the text x, int the y coordinate of the baseline of the text y)Overrides java. Draws the text given by the specified byte array, using this graphics context's current font and color. |
| public void | drawChars(char[]
the array of characters to be drawn data, int the start offset in the data offset, int the number of characters to be drawn length, int the x coordinate of the baseline of the text x, int the y coordinate of the baseline of the text y)Overrides java. Draws the text given by the specified character array, using this graphics context's current font and color. |
| public boolean | drawImage(Image
the specified image to be drawn. img, int the x coordinate. x, int the y coordinate. y, ImageObserver object to be notified as more of
the image is converted. observer)Implements abstract java. Draws as much of the specified image as is currently available. |
| public boolean | drawImage(Image
the specified image to be drawn. img, int the x coordinate. x, int the y coordinate. y, int the width of the rectangle. width, int the height of the rectangle. height, ImageObserver object to be notified as more of
the image is converted. observer)Implements abstract java. Draws as much of the specified image as has already been scaled to fit inside the specified rectangle. |
| public boolean | drawImage(Image
the specified image to be drawn. img, int the x coordinate. x, int the y coordinate. y, Color the background color to paint under the
non-opaque portions of the image. bgcolor, ImageObserver object to be notified as more of
the image is converted. observer)Implements abstract java. Draws as much of the specified image as is currently available. |
| public boolean | drawImage(Image
the specified image to be drawn. img, int the x coordinate. x, int the y coordinate. y, int the width of the rectangle. width, int the height of the rectangle. height, Color the background color to paint under the
non-opaque portions of the image. bgcolor, ImageObserver object to be notified as more of
the image is converted. observer)Implements abstract java. Draws as much of the specified image as has already been scaled to fit inside the specified rectangle. |
| public boolean | drawImage(Image
the specified image to be drawn img, int the x coordinate of the first corner of the
destination rectangle. dx1, int the y coordinate of the first corner of the
destination rectangle. dy1, int the x coordinate of the second corner of the
destination rectangle. dx2, int the y coordinate of the second corner of the
destination rectangle. dy2, int the x coordinate of the first corner of the
source rectangle. sx1, int the y coordinate of the first corner of the
source rectangle. sy1, int the x coordinate of the second corner of the
source rectangle. sx2, int the y coordinate of the second corner of the
source rectangle. sy2, ImageObserver object to be notified as more of the image is
scaled and converted. observer)Implements abstract java. Draws as much of the specified area of the specified image as is currently available, scaling it on the fly to fit inside the specified area of the destination drawable surface. |
| public boolean | drawImage(Image
the specified image to be drawn img, int the x coordinate of the first corner of the
destination rectangle. dx1, int the y coordinate of the first corner of the
destination rectangle. dy1, int the x coordinate of the second corner of the
destination rectangle. dx2, int the y coordinate of the second corner of the
destination rectangle. dy2, int the x coordinate of the first corner of the
source rectangle. sx1, int the y coordinate of the first corner of the
source rectangle. sy1, int the x coordinate of the second corner of the
source rectangle. sx2, int the y coordinate of the second corner of the
source rectangle. sy2, Color the background color to paint under the
non-opaque portions of the image. bgcolor, ImageObserver object to be notified as more of the image is
scaled and converted. observer)Implements abstract java. Draws as much of the specified area of the specified image as is currently available, scaling it on the fly to fit inside the specified area of the destination drawable surface. |
| public void | drawLine(int
the first point's x coordinate. x1, int the first point's y coordinate. y1, int the second point's x coordinate. x2, int the second point's y coordinate. y2)Implements abstract java. Draws a line, using the current color, between the points
|
| public void | drawOval(int
the x coordinate of the upper left
corner of the oval to be drawn. x, int the y coordinate of the upper left
corner of the oval to be drawn. y, int the width of the oval to be drawn. width, int the height of the oval to be drawn. height)Implements abstract java. Draws the outline of an oval. |
| public void | drawPolygon(int[]
an array of xPoints, int[] x coordinates.an array of yPoints, int y coordinates.the total number of points. nPoints)Implements abstract java. Draws a closed polygon defined by arrays of x and y coordinates. |
| public void | drawPolygon(Polygon
the polygon to draw. p)Overrides java. Draws the outline of a polygon defined by the specified
|
| public void | drawPolyline(int[]
an array of x points xPoints, int[] an array of y points yPoints, int the total number of points nPoints)Implements abstract java. Draws a sequence of connected lines defined by arrays of x and y coordinates. |
| public void | drawRect(int
the x coordinate
of the rectangle to be drawn. x, int the y coordinate
of the rectangle to be drawn. y, int the width of the rectangle to be drawn. width, int the height of the rectangle to be drawn. height)Overrides java. Draws the outline of the specified rectangle. |
| public void | drawRoundRect(int
the x coordinate of the rectangle to be drawn. x, int the y coordinate of the rectangle to be drawn. y, int the width of the rectangle to be drawn. width, int the height of the rectangle to be drawn. height, int the horizontal diameter of the arc
at the four corners. arcWidth, int the vertical diameter of the arc
at the four corners. arcHeight)Implements abstract java. Draws an outlined round-cornered rectangle using this graphics context's current color. |
| public void | drawString(String
the string to be drawn. str, int the x coordinate. x, int the y coordinate. y)Implements abstract java. Draws the text given by the specified string, using this graphics context's current font and color. |
| public void | drawString(AttributedCharacterIterator
the iterator whose text is to be drawn iterator, int the x coordinate. x, int the y coordinate. y)Implements abstract java. Draws the text given by the specified iterator, using this graphics context's current color. |
| public void | fill3DRect(int
the x coordinate of the rectangle to be filled. x, int the y coordinate of the rectangle to be filled. y, int the width of the rectangle to be filled. width, int the height of the rectangle to be filled. height, boolean a boolean value that determines whether the
rectangle appears to be raised above the surface
or etched into the surface. raised)Overrides java. Paints a 3-D highlighted rectangle filled with the current color. |
| public void | fillArc(int
the x coordinate of the
upper-left corner of the arc to be filled. x, int the y coordinate of the
upper-left corner of the arc to be filled. y, int the width of the arc to be filled. width, int the height of the arc to be filled. height, int the beginning angle. startAngle, int the angular extent of the arc,
relative to the start angle. arcAngle)Implements abstract java. Fills a circular or elliptical arc covering the specified rectangle. |
| public void | fillOval(int
the x coordinate of the upper left corner
of the oval to be filled. x, int the y coordinate of the upper left corner
of the oval to be filled. y, int the width of the oval to be filled. width, int the height of the oval to be filled. height)Implements abstract java. Fills an oval bounded by the specified rectangle with the current color. |
| public void | fillPolygon(int[]
an array of xPoints, int[] x coordinates.an array of yPoints, int y coordinates.the total number of points. nPoints)Implements abstract java. Fills a closed polygon defined by arrays of x and y coordinates. |
| public void | fillPolygon(Polygon
the polygon to fill. p)Overrides java. Fills the polygon defined by the specified Polygon object with the graphics context's current color. |
| public void | fillRect(int
the x coordinate
of the rectangle to be filled. x, int the y coordinate
of the rectangle to be filled. y, int the width of the rectangle to be filled. width, int the height of the rectangle to be filled. height)Implements abstract java. Fills the specified rectangle. |
| public void | fillRoundRect(int
the x coordinate of the rectangle to be filled. x, int the y coordinate of the rectangle to be filled. y, int the width of the rectangle to be filled. width, int the height of the rectangle to be filled. height, int the horizontal diameter
of the arc at the four corners. arcWidth, int the vertical diameter
of the arc at the four corners. arcHeight)Implements abstract java. Fills the specified rounded corner rectangle with the current color. |
| public void | |
| public Shape | Returns: aShape object representing the
current clipping area, or null if
no clip is set.Implements abstract java. Gets the current clipping area. |
| public Rectangle | Returns: the bounding rectangle of the current clipping area, ornull if no clip is set.Implements abstract java. Returns the bounding rectangle of the current clipping area. |
| public Rectangle | Returns: the bounding rectangle of the current clipping area.the rectangle where the current clipping area is
copied to. Any current values in this rectangle are
overwritten. r)Overrides java. Returns the bounding rectangle of the current clipping area. |
| public Rectangle | getClipRect()
Overrides java.
Deprecated
As of JDK version 1.1,
replaced by
getClipBounds().
Returns the bounding rectangle of the current clipping area. |
| public Color | Returns: this graphics context's current color.Implements abstract java. Gets this graphics context's current color. |
| public Font | Returns: this graphics context's current font.Implements abstract java. Gets the current font. |
| public FontMetrics | Returns: the font metrics of this graphics context's current font.Overrides java. Gets the font metrics of the current font. |
| public FontMetrics | Returns: the font metrics for the specified font.the specified font f)Implements abstract java. Gets the font metrics for the specified font. |
| pack-priv Graphics | |
| public boolean | hitClip(int
the x coordinate of the rectangle to test against the clip x, int the y coordinate of the rectangle to test against the clip y, int the width of the rectangle to test against the clip width, int the height of the rectangle to test against the clip height)Overrides java. Returns true if the specified rectangular area intersects the bounding rectangle of the current clipping area. |
| public void | setClip(int
the x coordinate of the new clip rectangle. x, int the y coordinate of the new clip rectangle. y, int the width of the new clip rectangle. width, int the height of the new clip rectangle. height)Implements abstract java. Sets the current clip to the rectangle specified by the given coordinates. |
| public void | setClip(Shape
the clip)Shape to use to set the clipImplements abstract java. Sets the current clipping area to an arbitrary clip shape. |
| public void | setColor(Color
the new rendering color. c)Implements abstract java. Sets this graphics context's current color to the specified color. |
| public void | setFont(Font
the font. font)Implements abstract java. Sets this graphics context's font to the specified font. |
| public void | setPaintMode()
Implements abstract java. Sets the paint mode of this graphics context to overwrite the destination with this graphics context's current color. |
| public void | setXORMode(Color
the XOR alternation color c1)Implements abstract java. Sets the paint mode of this graphics context to alternate between this graphics context's current color and the new specified color. |
| public String | Returns: a string representation of this graphics context.Overrides java. Returns a |
| public void | translate(int
the x coordinate. x, int the y coordinate. y)Implements abstract java. Translates the origin of the graphics context to the point (x, y) in the current coordinate system. |