|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Object | +--nl.skybound.awt.DoublePolygon
Similar to but not a descendent of java.awt.Polygon that uses double values instead of int values.
Polygon, Serialized Form| Field Summary | |
int |
npoints
The total number of points. |
double[] |
xpoints
The array of x coordinates. |
double[] |
ypoints
The array of y coordinates. |
| Constructor Summary | |
DoublePolygon()
Creates an empty polygon. |
|
DoublePolygon(double[] xpoints,
double[] ypoints,
int npoints)
Constructs and initializes a DoublePolygon from the specified
parameters. |
|
| Method Summary | |
void |
addPoint(double x,
double y)
Appends the specified coordinates to this DoublePolygon. |
boolean |
contains(double x,
double y)
Determines whether the specified coordinates are inside this Polygon. |
double |
getMaxX()
Returns the maximum x coordinate. |
double |
getMaxY()
Returns the maximum y coordinate. |
double |
getMinX()
Returns the minimum x coordinate. |
double |
getMinY()
Returns the minimum y coordinate. |
void |
translate(double deltaX,
double deltaY)
Translates the vertices of the DoublePolygon by
deltaX along the x axis and by
deltaY along the y axis. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public int npoints
addPoint(double, double)public double[] xpoints
addPoint(double, double)public double[] ypoints
addPoint(double, double)| Constructor Detail |
public DoublePolygon()
public DoublePolygon(double[] xpoints,
double[] ypoints,
int npoints)
DoublePolygon from the specified
parameters.xpoints - an array of x coordinatesypoints - an array of y coordinatesnpoints - the total number of points in the
PolygonNegativeArraySizeException - if the value of
npoints is negative.IndexOutOfBoundsException - if npoints is
greater than the length of xpoints
or the length of ypoints.NullPointerException - if xpoints or
ypoints is null.| Method Detail |
public void translate(double deltaX,
double deltaY)
DoublePolygon by
deltaX along the x axis and by
deltaY along the y axis.deltaX - the amount to translate along the x axisdeltaY - the amount to translate along the y axis
public void addPoint(double x,
double y)
DoublePolygon.
x, y - the specified coordinatescontains(double, double)
public boolean contains(double x,
double y)
Polygon. For the definition of
insideness, see the class comments of Shape.x, y - the specified coordinatestrue if this Polygon contains the
specified coordinates; false otherwise.public double getMinX()
public double getMinY()
public double getMaxX()
public double getMaxY()
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||