public class RectangleShape extends AbstractShape
Constructor | Description |
---|---|
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
|
Modifier and Type | Method | Description |
---|---|---|
void |
draw(java.awt.Graphics g) |
Draw the shape
|
getHeight, getMinX, getMinY, getWidth, setPoint1Values, setPoint2Values
public RectangleShape()
public RectangleShape(java.awt.Point firstPoint, java.awt.Point lastPoint)
firstPoint
- the first point used in defining the shapelastPoint
- the second point used in defining the shapepublic RectangleShape(int x1, int y1, int x2, int y2)
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 shapepublic void draw(java.awt.Graphics g)
draw
in class AbstractShape
g
- the graphics context on which to draw