Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
java.awt.Graphics
gnu.java.awt.peer.x.XGraphics
Method Summary | |
void |
|
void |
|
protected Object |
|
void |
|
Graphics |
|
void |
|
void |
|
boolean |
|
boolean |
|
boolean |
|
boolean |
|
boolean |
|
boolean |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
Shape |
|
Rectangle |
|
Color |
|
Font |
|
FontMetrics |
|
boolean |
|
void |
|
void | |
void | |
void | |
void |
|
void |
|
void |
|
Methods inherited from class java.awt.Graphics | |
clearRect , clipRect , copyArea , create , create , dispose , draw3DRect , drawArc , drawBytes , drawChars , drawImage , drawImage , drawImage , drawImage , drawImage , drawImage , drawLine , drawOval , drawPolygon , drawPolygon , drawPolyline , drawRect , drawRoundRect , drawString , drawString , fill3DRect , fillArc , fillOval , fillPolygon , fillPolygon , fillRect , fillRoundRect , finalize , getClip , getClipBounds , getClipBounds , getClipRect , getColor , getFont , getFontMetrics , getFontMetrics , hitClip , setClip , setClip , setColor , setFont , setPaintMode , setXORMode , toString , translate |
Methods inherited from class java.lang.Object | |
clone , equals , finalize , getClass , hashCode , notify , notifyAll , toString , wait , wait , wait |
public void clearRect(int x, int y, int width, int height)
Clears the specified rectangle.
- Parameters:
x
- The X coordinate of the upper left corner of the clear rect.y
- The Y coordinate of the upper left corner of the clear rect.width
- The width of the clear rect.height
- The height of the clear rect.
public void clipRect(int x, int y, int width, int height)
Clips the current clip with the specified clip.
public void copyArea(int x, int y, int width, int height, int dx, int dy)
Copies the specified rectangle to the specified offset location.
- Parameters:
x
- The X coordinate of the upper left corner of the copy rect.y
- The Y coordinate of the upper left corner of the copy rect.width
- The width of the copy rect.height
- The height of the copy rect.dx
- The offset from the X value to start drawing.dy
- The offset from the Y value to start drawing.
public Graphics create()
Creates an exact copy of this graphics context.
- Returns:
- an exact copy of this graphics context
public void drawArc(int x, int y, int width, int height, int arcStart, int arcAngle)
Draws an arc using the specified bounding rectangle and the specified angle parameter. The arc is centered at the center of the rectangle. The arc starts at the arcAngle position and extend for arcAngle degrees. The degree origin is at the 3 o'clock position.
- Parameters:
x
- The X coordinate of the upper left corner of the rect.y
- The Y coordinate of the upper left corner of the rect.width
- The width of the rect.height
- The height of the rect.arcStart
- The beginning angle of the arc.arcAngle
- The extent of the arc.
public boolean drawImage(Image image, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, Color bgcolor, ImageObserver observer)
FIXME: Write Javadocs for this when you understand it.
public boolean drawImage(Image image, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, ImageObserver observer)
FIXME: Write Javadocs for this when you understand it.
public boolean drawImage(Image image, int x, int y, int width, int height, Color bgcolor, ImageObserver observer)
Draws all of the image that is available and returns. The image is scaled to fit in the specified rectangle. If the image is not completely loaded,false
is returned and the specified iamge observer is notified as more data becomes available.
- Parameters:
image
- The image to draw.x
- The X coordinate of the point to draw at.y
- The Y coordinate of the point to draw at.width
- The width of the rectangle to draw in.height
- The height of the rectangle to draw in.bgcolor
- The background color to use for the image.observer
- The image observer to notify as data becomes available.
- Returns:
true
if all the image data is available,false
otherwise.
public boolean drawImage(Image image, int x, int y, int width, int height, ImageObserver observer)
Draws all of the image that is available and returns. The image is scaled to fit in the specified rectangle. If the image is not completely loaded,false
is returned and the specified iamge observer is notified as more data becomes available.
- Parameters:
image
- The image to draw.x
- The X coordinate of the point to draw at.y
- The Y coordinate of the point to draw at.width
- The width of the rectangle to draw in.height
- The height of the rectangle to draw in.observer
- The image observer to notify as data becomes available.
- Returns:
true
if all the image data is available,false
otherwise.
public boolean drawImage(Image image, int x, int y, Color bgcolor, ImageObserver observer)
Draws all of the image that is available and returns. If the image is not completely loaded,false
is returned and the specified iamge observer is notified as more data becomes available.
- Parameters:
image
- The image to draw.x
- The X coordinate of the point to draw at.y
- The Y coordinate of the point to draw at.bgcolor
- The background color to use for the image.observer
- The image observer to notify as data becomes available.
- Returns:
true
if all the image data is available,false
otherwise.
public boolean drawImage(Image image, int x, int y, ImageObserver observer)
Draws the specified image on the drawable at position (x,y).
public void drawLine(int x1, int y1, int x2, int y2)
Draws a line from point (x1, y1) to point (x2, y2).
public void drawOval(int x, int y, int width, int height)
Draws an oval that just fits within the specified rectangle.
- Parameters:
x
- The X coordinate of the upper left corner of the rect.y
- The Y coordinate of the upper left corner of the rect.width
- The width of the rect.height
- The height of the rect.
public void drawRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight)
Draws the outline of the specified rectangle with rounded cornders.
- Overrides:
- drawRoundRect in interface Graphics
- Parameters:
x
- The X coordinate of the upper left corner of the draw rect.y
- The Y coordinate of the upper left corner of the draw rect.width
- The width of the draw rect.height
- The height of the draw rect.arcWidth
- The width of the corner arcs.arcHeight
- The height of the corner arcs.
public void drawString(String string, int x, int y)
Draws the specified string at (x, y).
- Overrides:
- drawString in interface Graphics
public void drawString(AttributedCharacterIterator ci, int x, int y)
- Overrides:
- drawString in interface Graphics
public void fillArc(int x, int y, int width, int height, int arcStart, int arcAngle)
Fills the arc define by the specified bounding rectangle and the specified angle parameter. The arc is centered at the center of the rectangle. The arc starts at the arcAngle position and extend for arcAngle degrees. The degree origin is at the 3 o'clock position.
- Parameters:
x
- The X coordinate of the upper left corner of the rect.y
- The Y coordinate of the upper left corner of the rect.width
- The width of the rect.height
- The height of the rect.arcStart
- The beginning angle of the arc.arcAngle
- The extent of the arc.
public void fillOval(int x, int y, int width, int height)
Fills an oval that just fits within the specified rectangle.
- Parameters:
x
- The X coordinate of the upper left corner of the rect.y
- The Y coordinate of the upper left corner of the rect.width
- The width of the rect.height
- The height of the rect.
public void fillRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight)
Fills the specified rectangle with rounded cornders.
- Overrides:
- fillRoundRect in interface Graphics
- Parameters:
x
- The X coordinate of the upper left corner of the fill rect.y
- The Y coordinate of the upper left corner of the fill rect.width
- The width of the fill rect.height
- The height of the fill rect.arcWidth
- The width of the corner arcs.arcHeight
- The height of the corner arcs.
public Shape getClip()
Returns the current clipping region as aShape
object.
- Returns:
- The clipping region as a
Shape
.
public Rectangle getClipBounds()
Returns the bounds of the current clip.
- Overrides:
- getClipBounds in interface Graphics
- Returns:
- the bounds of the current clip
public Color getColor()
Returns the current foreground color, possiblynull
.
- Returns:
- the current foreground color, possibly
null
public Font getFont()
Returns the current font, possiblynull
.
- Returns:
- the current font, possibly
null
public FontMetrics getFontMetrics(Font font)
Returns the font metrics for the specified font.
- Overrides:
- getFontMetrics in interface Graphics
- Parameters:
font
- the font for which we want the font metrics
- Returns:
- the font metrics for the specified font
public boolean hitClip(int x, int y, int w, int h)
Returnstrue
when the specified rectangle intersects with the current clip,false
otherwise. This is overridden to avoid unnecessary creation of Rectangles via getBounds().
- Parameters:
x
- the x coordinate of the rectangley
- the y coordinate of the rectanglew
- the width of the rectangleh
- the height of the rectangle
- Returns:
true
when the specified rectangle intersects with the current clip,false
otherwise
public void setClip(int x, int y, int width, int height)
Sets the clipping region to the rectangle determined by the specified parameters.
- Parameters:
x
- The X coordinate of the upper left corner of the rect.y
- The Y coordinate of the upper left corner of the rect.width
- The width of the rect.height
- The height of the rect.
public void setColor(Color c)
Sets the current foreground color. Anull
value doesn't change the current setting.
- Parameters:
c
- the foreground color to set
public void setFont(Font f)
Sets the font on the graphics context. Anull
value doesn't change the current setting.
- Parameters:
f
- the font to set
public void setPaintMode()
Sets this context into "paint" mode, where the target pixels are completely overwritten when drawn on.
- Overrides:
- setPaintMode in interface Graphics
public void setXORMode(Color color)
Sets this context info "XOR" mode, where the targe pixles are XOR-ed when drawn on.
- Overrides:
- setXORMode in interface Graphics
- Parameters:
color
- The color to XOR against.