Polygon2D.Double, Polygon2D.Float_closed, _coordCount| Constructor and Description |
|---|
Float()
Create a new polygon with no vertices.
|
Float(float[] coords)
Create a new polygon with space for the
given number of vertices.
|
Float(float x,
float y)
Create a new polygon with a single start point
|
Float(int size)
Create a new polygon with space for the
given number of vertices.
|
| Modifier and Type | Method and Description |
|---|---|
Rectangle2D |
getBounds2D()
Get the floating-point bounds of the polygon.
|
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(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, getVertexCount, intersects, intersects, reset, toStringpublic Float(int size)
public Float(float[] coords)
public Float()
public Float(float x,
float y)
public Rectangle2D getBounds2D()
getBounds2D in interface ShapegetBounds2D in class Polygon2Dpublic double getX(int index)
getX in class Polygon2DIndexOutOfBoundsException - The index is out of bounds.public double getY(int index)
getY in class Polygon2DIndexOutOfBoundsException - The index is out of bounds.public void lineTo(double x,
double y)
public void moveTo(double x,
double y)
moveTo in class Polygon2DUnsupportedOperationException - The polygon already
has verticespublic void setX(int index,
double x)
setX in class Polygon2DIndexOutOfBoundsException - The index is out of bounds.public void setY(int index,
double y)
setY in class Polygon2DIndexOutOfBoundsException - The index is out of bounds.public void transform(AffineTransform at)
Copyright © 2025 Central Laboratory of the Research Councils. All Rights Reserved.