public class RectangleShape extends java.lang.Object implements Shape
Constructor and Description |
---|
RectangleShape(int w,
int h)
Constructs a rectangle shape.
|
RectangleShape(int w,
int h,
boolean border)
Constructs a rectangle shape.
|
Modifier and Type | Method and Description |
---|---|
boolean |
contains(int x,
int y)
Tests of the shape contains a specific coordinate.
|
void |
draw(java.awt.Graphics g)
Functions used to draw the shape.
|
int |
getH() |
int |
getW() |
public RectangleShape(int w, int h)
w
- Width of the rectangle.h
- Height of the rectangle.public RectangleShape(int w, int h, boolean border)
w
- Width of the rectangle.h
- Height of the rectangle.border
- Displays the border or notpublic boolean contains(int x, int y)
Shape
public void draw(java.awt.Graphics g)
Shape
public int getW()
public int getH()