public abstract class Polyline2D
extends java.lang.Object
implements java.awt.Shape
Modifier and Type | Class and Description |
---|---|
static class |
Polyline2D.Double
The concrete Polyline class that stores coordinates internally
as doubles.
|
static class |
Polyline2D.Float
The concrete Polyline class that stores coordinates internally
as floats.
|
Modifier and Type | Field and Description |
---|---|
protected int |
_coordCount
The current number of coordinates
|
Constructor and Description |
---|
Polyline2D() |
Modifier and Type | Method and Description |
---|---|
boolean |
contains(double x,
double y)
Return false.
|
boolean |
contains(double x,
double y,
double w,
double h)
Return false.
|
boolean |
contains(java.awt.geom.Point2D p)
Return false.
|
boolean |
contains(java.awt.geom.Rectangle2D r)
Return false.
|
java.awt.Rectangle |
getBounds()
Get the integer bounds of the polyline.
|
abstract java.awt.geom.Rectangle2D |
getBounds2D()
Get the floating-point bounds of the polyline.
|
java.awt.geom.PathIterator |
getPathIterator(java.awt.geom.AffineTransform at)
Get a path iterator over the object.
|
java.awt.geom.PathIterator |
getPathIterator(java.awt.geom.AffineTransform at,
double flatness)
Get a path iterator over the object.
|
int |
getVertexCount()
Get the number of vertices
|
abstract double |
getX(int index)
Get the given X-coordinate
|
abstract double |
getY(int index)
Get the given Y-coordinate
|
boolean |
intersects(double x,
double y,
double w,
double h)
Test if the polyline is intersected by the given
rectangle.
|
boolean |
intersects(java.awt.geom.Rectangle2D r)
Test if the polyline is intersected by the given
rectangle.
|
abstract void |
lineTo(double x,
double y)
Add a new vertex to the end of the line.
|
abstract void |
moveTo(double x,
double y)
Move the start point of the vertex to the given position.
|
void |
reset()
Reset the polyline back to empty.
|
abstract void |
setX(int index,
double x)
Set the given X-coordinate.
|
abstract void |
setY(int index,
double y)
Set the given Y-coordinate
|
java.lang.String |
toString()
Return a string representing this object
|
abstract void |
transform(java.awt.geom.AffineTransform at)
Transform the polyline with the given transform.
|
abstract void |
translate(double x,
double y)
Translate the polyline the given distance.
|
public boolean contains(double x, double y)
contains
in interface java.awt.Shape
public boolean contains(java.awt.geom.Point2D p)
contains
in interface java.awt.Shape
public boolean contains(java.awt.geom.Rectangle2D r)
contains
in interface java.awt.Shape
public boolean contains(double x, double y, double w, double h)
contains
in interface java.awt.Shape
public java.awt.Rectangle getBounds()
getBounds
in interface java.awt.Shape
public abstract java.awt.geom.Rectangle2D getBounds2D()
getBounds2D
in interface java.awt.Shape
public java.awt.geom.PathIterator getPathIterator(java.awt.geom.AffineTransform at, double flatness)
getPathIterator
in interface java.awt.Shape
public java.awt.geom.PathIterator getPathIterator(java.awt.geom.AffineTransform at)
getPathIterator
in interface java.awt.Shape
public int getVertexCount()
public abstract double getX(int index)
java.lang.IndexOutOfBoundsException
- The index is out of bounds.public abstract double getY(int index)
java.lang.IndexOutOfBoundsException
- The index is out of bounds.public boolean intersects(java.awt.geom.Rectangle2D r)
intersects
in interface java.awt.Shape
public boolean intersects(double x, double y, double w, double h)
intersects
in interface java.awt.Shape
public abstract void lineTo(double x, double y)
public abstract void moveTo(double x, double y)
public void reset()
public abstract void setX(int index, double x)
java.lang.IndexOutOfBoundsException
- The index is out of bounds.public abstract void setY(int index, double y)
java.lang.IndexOutOfBoundsException
- The index is out of bounds.public java.lang.String toString()
toString
in class java.lang.Object
public abstract void transform(java.awt.geom.AffineTransform at)
public abstract void translate(double x, double y)