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


Constructor Index

 o Rect(int, int, int, int)
Constructs a rectangle with black as the default color
 o Rect(int, int, int, int, Color)
Constructs a rectangle with the passed color

Method Index

 o draw(Graphics)
 o toString()

Constructors

 o 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
 o 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

Methods

 o draw
 public void draw(Graphics g)
Overrides:
draw in class GraphicsObject
 o toString
 public String toString()
Overrides:
toString in class GraphicsObject

All Packages  Class Hierarchy  This Package  Previous  Next  Index