Polygon2D.Double, Polygon2D.Float
Modifier and Type | Field and Description |
---|---|
(package private) double[] |
_coords
The coordinates
|
_closed, _coordCount
Constructor and Description |
---|
Double()
Create a new polygon with no coordinates
|
Double(double[] coords)
Create a new polygon with the
given vertices, in the format
[x0, y0, x1, y1, ... ].
|
Double(double x,
double y)
Create a new polygon with a single start point
|
Double(int size)
Create a new polygon with space for the
given number of vertices.
|
Modifier and Type | Method and Description |
---|---|
java.awt.geom.Rectangle2D |
getBounds2D()
Get the floating-point bounds of the polygon.
|
int |
getVertexCount()
Get the number of vertices
|
double |
getX(int index)
Get the given X-coordinate
|
double |
getY(int index)
Get the given Y-coordinate
|
void |
lineTo(double x,
double y)
Add a new vertex to the end of the line.
|
void |
moveTo(double x,
double y)
Move the start point of the vertex to the given position.
|
void |
setX(int index,
double x)
Set the given X-coordinate.
|
void |
setY(int index,
double y)
Set the given Y-coordinate
|
void |
transform(java.awt.geom.AffineTransform at)
Transform the polygon with the given transform.
|
void |
translate(double x,
double y)
Translate the polygon the given distance.
|
closePath, contains, contains, contains, contains, getBounds, getPathIterator, getPathIterator, intersects, intersects, reset, toString
public Double(int size)
public Double(double[] coords)
public Double()
public Double(double x, double y)
public java.awt.geom.Rectangle2D getBounds2D()
getBounds2D
in interface java.awt.Shape
getBounds2D
in class Polygon2D
public int getVertexCount()
getVertexCount
in class Polygon2D
public double getX(int index)
public double getY(int index)
public void lineTo(double x, double y)
public void moveTo(double x, double y)
public void setX(int index, double x)
public void setY(int index, double y)
public void transform(java.awt.geom.AffineTransform at)