public class GRect extends GObject implements GFillable, GResizable, GScalable
GRect class is a graphical object whose appearance consists
of a rectangular box.| Constructor and Description |
|---|
GRect()
Constructs a new 0x0 rectangle, positioned at the origin.
|
GRect(float width,
float height)
Constructs a new rectangle with the specified width and height,
positioned at the origin.
|
GRect(float x,
float y,
float width,
float height)
Constructs a new rectangle with the specified bounds.
|
GRect(GCanvas canvas)
Constructs a new 0x0 rectangle, positioned at the origin.
|
GRect(GCanvas canvas,
float width,
float height)
Constructs a new rectangle with the specified width and height,
positioned at the origin.
|
GRect(GCanvas canvas,
float x,
float y,
float width,
float height)
Constructs a new rectangle with the specified bounds.
|
| Modifier and Type | Method and Description |
|---|---|
void |
paint(Canvas canvas)
Implements the
paint operation for this graphical object. |
addTo, addTo, addTo, contains, contains, getBottomY, getBounds, getCenterX, getCenterY, getColor, getFillColor, getGCanvas, getHeight, getLeftX, getLocation, getPaint, getRightX, getSize, getTopY, getWidth, getX, getY, intersects, isFilled, isVisible, moveBy, moveByPolar, moveTo, moveTo, moveTo, moveToPolar, remove, repaint, scale, scale, sendBackward, sendForward, sendToBack, sendToFront, setBottomY, setBounds, setBounds, setBounds, setCanvas, setColor, setFillColor, setFilled, setGCanvas, setLocation, setLocation, setLocation, setPaint, setRightX, setSize, setSize, setVisible, setX, setY, toString, translateclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetFillColor, isFilled, setFillColor, setFilledsetBounds, setBounds, setSize, setSizepublic GRect()
public GRect(float width,
float height)
width - The width of the rectangle in pixelsheight - The height of the rectangle in pixelspublic GRect(float x,
float y,
float width,
float height)
x - The x-coordinate of the upper left cornery - The y-coordinate of the upper left cornerwidth - The width of the rectangle in pixelsheight - The height of the rectangle in pixelspublic GRect(GCanvas canvas)
public GRect(GCanvas canvas, float width, float height)
width - The width of the rectangle in pixelsheight - The height of the rectangle in pixelspublic GRect(GCanvas canvas, float x, float y, float width, float height)
x - The x-coordinate of the upper left cornery - The y-coordinate of the upper left cornerwidth - The width of the rectangle in pixelsheight - The height of the rectangle in pixels