public final class EqualPolygon extends Polygon
Constructor and Description |
---|
EqualPolygon()
Creates a new instance of EqualGeneralPath
|
EqualPolygon(int[] x,
int[] y)
Non copy constructor based on fixed arrays.
|
EqualPolygon(int[] x,
int[] y,
int n)
Copy constructor will copy the xpoints/ypoints arrays so the caller can
later modify them without changing the polygon constructor here.
|
EqualPolygon(Polygon p)
Copy constructor - takes either another EqualPolygon or a Polygon.
|
EqualPolygon(Rectangle r)
Convenience constructor which takes a Rectangle
|
Modifier and Type | Method and Description |
---|---|
Object |
clone()
Creates a new EqualPolygon using the copy constructor - the resulting
polygon may be modified without affecting the original.
|
boolean |
equals(Object o)
Returns true if the argument is a Polygon (does not need to be
EqualPolygon) and its point arrays and number of points matches.
|
int |
hashCode()
Computes a hashCode based on the points arrays.
|
void |
lineTo(int x,
int y)
Delegates to
Polygon.addPoint() . |
void |
moveTo(int x,
int y)
Delegates to
Polygon.addPoint() . |
String |
toString()
Overridden to produce a meaningful result.
|
addPoint, contains, contains, contains, contains, contains, contains, getBoundingBox, getBounds, getBounds2D, getPathIterator, getPathIterator, inside, intersects, intersects, invalidate, reset, translate
public EqualPolygon()
public EqualPolygon(int[] x, int[] y, int n)
public EqualPolygon(Polygon p)
p
- public EqualPolygon(Rectangle r)
public EqualPolygon(int[] x, int[] y)
x.length
.public void moveTo(int x, int y)
Polygon.addPoint()
.x
- x coordinatey
- y coordinatepublic void lineTo(int x, int y)
Polygon.addPoint()
.x
- x coordinatey
- y coordinatepublic Object clone()
public String toString()
public int hashCode()