All Packages Class Hierarchy This Package Previous Next Index
Class cs101.canvas.Rect
java.lang.Object
|
+----cs101.canvas.GraphicsObject
|
+----cs101.canvas.ResizableObject
|
+----cs101.canvas.FilledObject
|
+----cs101.canvas.Rect
- public class Rect
- extends FilledObject
A GraphicsObject that represents a geometric rectangle
-
Rect(int, int, int, int)
- Constructs a rectangle with black as the default color
-
Rect(int, int, int, int, Color)
- Constructs a rectangle with the passed color
-
draw(Graphics)
-
-
toString()
-
Rect
public Rect(int x,
int y,
int width,
int height)
- Constructs a rectangle with black as the default color
- Parameters:
- x - x coordinate of the left side
- y - y coordinate of the top side
- width - width of the rectangle
- height - height of the rectangle
- Returns:
- none
Rect
public Rect(int x,
int y,
int width,
int height,
Color graphicsColor)
- Constructs a rectangle with the passed color
- Parameters:
- x - x coordinate of the left side
- y - y coordinate of the top side
- width - width of the rectangle
- height - height of the rectangle
- graphicsColor - color of the rectangle
- Returns:
- none
draw
public void draw(Graphics g)
- Overrides:
- draw in class GraphicsObject
toString
public String toString()
- Overrides:
- toString in class GraphicsObject
All Packages Class Hierarchy This Package Previous Next Index