|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectdiva.util.java2d.Polyline2D
diva.util.java2d.Polyline2D.Double
public static class Polyline2D.Double
The concrete Polyline class that stores coordinates internally as doubles.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class diva.util.java2d.Polyline2D |
|---|
Polyline2D.Double, Polyline2D.Float |
| Field Summary | |
|---|---|
(package private) double[] |
_coords
The coordinates |
| Fields inherited from class diva.util.java2d.Polyline2D |
|---|
_coordCount |
| Constructor Summary | |
|---|---|
Polyline2D.Double()
Create a new polyline with no coordinates |
|
Polyline2D.Double(double x1,
double y1,
double x2,
double y2)
Create a new polyline with two vertices. |
|
Polyline2D.Double(int initSize)
Create a new polyline with "initSize" number of vertices. |
|
Polyline2D.Double(Polyline2D in)
Copy constructor for efficient copying of Polyline2D. |
|
| Method Summary | |
|---|---|
java.awt.geom.Rectangle2D |
getBounds2D()
Get the floating-point bounds of the polyline. |
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 polyline with the given transform. |
void |
translate(double x,
double y)
Translate the polyline the given distance. |
| Methods inherited from class diva.util.java2d.Polyline2D |
|---|
contains, contains, contains, contains, getBounds, getPathIterator, getPathIterator, getVertexCount, intersects, intersects, reset, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
double[] _coords
| Constructor Detail |
|---|
public Polyline2D.Double()
public Polyline2D.Double(int initSize)
public Polyline2D.Double(double x1,
double y1,
double x2,
double y2)
public Polyline2D.Double(Polyline2D in)
| Method Detail |
|---|
public java.awt.geom.Rectangle2D getBounds2D()
getBounds2D in interface java.awt.ShapegetBounds2D in class Polyline2Dpublic double getX(int index)
getX in class Polyline2Djava.lang.IndexOutOfBoundsException - The index is out of bounds.public double getY(int index)
getY in class Polyline2Djava.lang.IndexOutOfBoundsException - The index is out of bounds.
public void lineTo(double x,
double y)
lineTo in class Polyline2D
public void moveTo(double x,
double y)
moveTo in class Polyline2Djava.lang.UnsupportedOperationException - The polyline already
has vertices
public void setX(int index,
double x)
setX in class Polyline2Djava.lang.IndexOutOfBoundsException - The index is out of bounds.
public void setY(int index,
double y)
setY in class Polyline2Djava.lang.IndexOutOfBoundsException - The index is out of bounds.public void transform(java.awt.geom.AffineTransform at)
transform in class Polyline2D
public void translate(double x,
double y)
translate in class Polyline2D
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||