| Constructor and Description |
|---|
Polygon(int[] points) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(int px,
int py)
Returns true if the specified point is located within this shape.
|
boolean |
contains(Point2D p)
Returns true if the specified point
p is located within this shape. |
boolean |
contains(Shape s)
Returns true if the shape
s is entirely located within this shape. |
boolean |
equals(java.lang.Object o) |
int |
getNumPoints() |
int[] |
getPoints() |
int |
getPointX(int n) |
int |
getPointY(int n) |
int |
hashCode() |
boolean |
intersects(Shape s)
Returns true if the shape
s is entirely or partially located within
this shape. |
void |
move(int dx,
int dy) |
void |
rotateDegrees(int degrees,
int ox,
int oy) |
void |
rotateRadians(double radians,
int ox,
int oy) |
void |
setPoints(int[] points) |
Polygon |
toPolygon() |
java.lang.String |
toString() |
public void setPoints(int[] points)
public int[] getPoints()
public int getNumPoints()
public int getPointX(int n)
public int getPointY(int n)
public void move(int dx,
int dy)
public void rotateDegrees(int degrees,
int ox,
int oy)
public void rotateRadians(double radians,
int ox,
int oy)
public boolean contains(Point2D p)
Shapep is located within this shape.
This includes cases where the point is located on one of the edges.public boolean contains(int px,
int py)
Shapepublic boolean contains(Shape s)
Shapes is entirely located within this shape.
This includes cases where the shape is located on this shape's edges.public boolean intersects(Shape s)
Shapes is entirely or partially located within
this shape.intersects in interface Shapepublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object