Class RectangleShape
java.lang.Object
AbstractShape
RectangleShape
public class RectangleShape
- extends AbstractShape
Class Rectangle: inherits from Shape and draws a rectangle
Copyright Georgia Institute of Technology 2007
Constructor Summary |
RectangleShape()
Constructor that takes no arguments |
RectangleShape(int x1,
int y1,
int x2,
int y2)
Constructor that takes x1,y1,x2,y2 |
RectangleShape(java.awt.Point firstPoint,
java.awt.Point lastPoint)
Constructor that takes two points to define the shape |
Method Summary |
void |
draw(java.awt.Graphics g)
Draw the shape |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RectangleShape
public RectangleShape()
- Constructor that takes no arguments
RectangleShape
public RectangleShape(java.awt.Point firstPoint,
java.awt.Point lastPoint)
- Constructor that takes two points to define the shape
- Parameters:
firstPoint
- the first point used in defining the shapelastPoint
- the second point used in defining the shape
RectangleShape
public RectangleShape(int x1,
int y1,
int x2,
int y2)
- Constructor that takes x1,y1,x2,y2
- Parameters:
x1
- the x value of the first point that defines the shapey1
- the y value of the first point that defines the shapex2
- the x value of the second point that defines the shapey2
- the y value of the second point that defines the shape
draw
public void draw(java.awt.Graphics g)
- Draw the shape
- Specified by:
draw
in class AbstractShape
- Parameters:
g
- the graphics context on which to draw