Package diva.util.java2d
Class Polygon2D.Float
- java.lang.Object
-
- diva.util.java2d.Polygon2D
-
- diva.util.java2d.Polygon2D.Float
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class diva.util.java2d.Polygon2D
Polygon2D.Double, Polygon2D.Float
-
-
Field Summary
-
Fields inherited from class diva.util.java2d.Polygon2D
_closed, _coordCount
-
-
Constructor Summary
Constructors Constructor 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 pointFloat(int size)
Create a new polygon with space for the given number of vertices.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.awt.geom.Rectangle2D
getBounds2D()
Get the floating-point bounds of the polygon.double
getX(int index)
Get the given X-coordinatedouble
getY(int index)
Get the given Y-coordinatevoid
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-coordinatevoid
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.-
Methods inherited from class diva.util.java2d.Polygon2D
closePath, contains, contains, contains, contains, getBounds, getPathIterator, getPathIterator, getVertexCount, intersects, intersects, reset, toString
-
-
-
-
Constructor Detail
-
Float
public Float(int size)
Create a new polygon with space for the given number of vertices.
-
Float
public Float(float[] coords)
Create a new polygon with space for the given number of vertices.
-
Float
public Float()
Create a new polygon with no vertices.
-
Float
public Float(float x, float y)
Create a new polygon with a single start point
-
-
Method Detail
-
getBounds2D
public java.awt.geom.Rectangle2D getBounds2D()
Get the floating-point bounds of the polygon.- Specified by:
getBounds2D
in interfacejava.awt.Shape
- Specified by:
getBounds2D
in classPolygon2D
-
getX
public double getX(int index)
Get the given X-coordinate
-
getY
public double getY(int index)
Get the given Y-coordinate
-
lineTo
public void lineTo(double x, double y)
Add a new vertex to the end of the line.
-
moveTo
public void moveTo(double x, double y)
Move the start point of the vertex to the given position.
-
setX
public void setX(int index, double x)
Set the given X-coordinate.
-
setY
public void setY(int index, double y)
Set the given Y-coordinate
-
transform
public void transform(java.awt.geom.AffineTransform at)
Transform the polygon with the given transform.
-
-