public class ShapeMultiPath extends MultiPath implements java.awt.Shape
ControlPath cp = new ControlPath();
cp.addPoint(...); // add points
Curve c = new BezierCurve(cp, new GroupIterator("0:n-1"));
ShapeMultiPath smp = new ShapeMultiPath();
c.appendTo(smp);
Graphics2D g = ...;
g.draw(smp);
| Modifier and Type | Field and Description |
|---|---|
private int |
ai0 |
private int |
ai1 |
private int |
windingRule |
| Constructor and Description |
|---|
ShapeMultiPath()
Constructs a new ShapeMultiPath with a dimension of 2.
|
ShapeMultiPath(int dimension)
Constructs a new ShapeMultiPath with the specified dimension requirement.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(double x,
double y)
Returns true if the point is contained inside the shape.
|
boolean |
contains(double x1,
double y1,
double w,
double h)
Returns true only if the shape contains all points of the rectangle.
|
boolean |
contains(java.awt.geom.Point2D p)
See the contains(x, y) method.
|
boolean |
contains(java.awt.geom.Rectangle2D r)
See the contains(x, y, w, h) method.
|
int[] |
getBasisVectors()
Returns a new integer array with the basis vectors.
|
java.awt.Rectangle |
getBounds()
See the getBounds2D() method.
|
java.awt.geom.Rectangle2D |
getBounds2D()
Computes the bounding box of the points.
|
double |
getDistSq(double x,
double y)
Returns the minimum distance^2 from the specified point to the line segments of this multi-path.
|
java.awt.geom.PathIterator |
getPathIterator(java.awt.geom.AffineTransform at)
Returns a new PathIterator object.
|
java.awt.geom.PathIterator |
getPathIterator(java.awt.geom.AffineTransform at,
double flatness)
Returns a new PathIterator object.
|
int |
getWindingRule()
Returns the value of the winding rule.
|
boolean |
intersects(double x1,
double y1,
double w,
double h)
This method returns true if any line segment in this multi-path intersects any of the
4 line segments formed by the rectangle or any corner of the rectangle is inside the
shape or any point of the shape is inside the rectangle.
|
boolean |
intersects(java.awt.geom.Rectangle2D r)
See the intersects(x, y, w, h) method.
|
void |
setBasisVectors(int[] b)
The basis vectors specify which index corresponds to the x-axis and which index
corresponds to the y-axis.
|
void |
setWindingRule(int rule)
Sets the winding rule.
|
ensureCapacity, get, getCapacity, getDimension, getDistSq, getFlatness, getNumPoints, getType, lineTo, moveTo, set, setFlatness, setNumPoints, setType, trimArraypublic ShapeMultiPath()
public ShapeMultiPath(int dimension)
java.lang.IllegalArgumentException - If the specified dimension is less than 2.public void setBasisVectors(int[] b)
java.lang.IllegalArgumentException - If the axis values are less than 0 or greater than or
equal to the dimension.getBasisVectors()public int[] getBasisVectors()
setBasisVectors(int[])public double getDistSq(double x,
double y)
public int getWindingRule()
setWindingRule(int)public void setWindingRule(int rule)
public java.awt.geom.PathIterator getPathIterator(java.awt.geom.AffineTransform at)
getPathIterator in interface java.awt.Shapepublic java.awt.geom.PathIterator getPathIterator(java.awt.geom.AffineTransform at,
double flatness)
getPathIterator in interface java.awt.Shapepublic java.awt.Rectangle getBounds()
getBounds in interface java.awt.ShapegetBounds2D()public java.awt.geom.Rectangle2D getBounds2D()
getBounds2D in interface java.awt.Shapepublic boolean contains(double x,
double y)
contains in interface java.awt.Shapepublic boolean contains(java.awt.geom.Point2D p)
contains in interface java.awt.Shapecontains(double,double)public boolean contains(double x1,
double y1,
double w,
double h)
contains in interface java.awt.Shapepublic boolean contains(java.awt.geom.Rectangle2D r)
contains in interface java.awt.Shapecontains(double,double,double,double)public boolean intersects(double x1,
double y1,
double w,
double h)
intersects in interface java.awt.Shapepublic boolean intersects(java.awt.geom.Rectangle2D r)
intersects in interface java.awt.Shapeintersects(double,double,double,double)