public class DefaultGeneralPathX extends GeneralPathX implements java.awt.Shape, java.lang.Cloneable, java.io.Serializable
GeneralPathX class represents a geometric path
constructed from straight lines, and quadratic and cubic
(Bézier) curves. It can contain multiple subpaths.
The winding rule specifies how the interior of a path is determined. There are two types of winding rules: EVEN_ODD and NON_ZERO.
An EVEN_ODD winding rule means that enclosed regions of the path alternate between interior and exterior areas as traversed from the outside of the path towards a point inside the region.
A NON_ZERO winding rule means that if a ray is drawn in any direction from a given point to infinity and the places where the path intersects the ray are examined, the point is inside of the path if and only if the number of times that the path crosses the ray from left to right does not equal the number of times that the path crosses the ray from right to left.
| Modifier and Type | Field and Description |
|---|---|
protected static GeometryManager |
geomManager
Deprecated.
|
INIT_SIZEcurvesize, SEG_CLOSE, SEG_CUBICTO, SEG_LINETO, SEG_MOVETO, SEG_QUADTO, WIND_EVEN_ODD, WIND_NON_ZERO| Constructor and Description |
|---|
DefaultGeneralPathX(int rule)
Deprecated.
Constructs a new
GeneralPathX object with the specified
winding rule to control operations that require the interior of the
path to be defined. |
DefaultGeneralPathX(java.awt.geom.PathIterator piter,
boolean is2Dz,
double zValue)
Deprecated.
|
DefaultGeneralPathX(java.awt.geom.PathIterator piter,
boolean is2Dz,
double zValue,
int capacity)
Deprecated.
Constructs a new
GeneralPathX object from an arbitrary
Shape object. |
| Modifier and Type | Method and Description |
|---|---|
void |
addSegment(Point[] segment)
Deprecated.
|
void |
append(GeneralPathX gp)
Deprecated.
|
void |
append(java.awt.geom.PathIterator pi,
boolean connect)
Deprecated.
Appends the geometry of the specified
PathIterator object
to the path, possibly connecting the new geometry to the existing
path segments with a line segment. |
java.lang.Object |
clone()
Deprecated.
Creates a new object of the same class as this object.
|
void |
closePath()
Deprecated.
Closes the current subpath by drawing a straight line back to
the coordinates of the last
moveTo. |
boolean |
contains(double x,
double y)
Deprecated.
Tests if the specified coordinates are inside the boundary of
this
Shape. |
boolean |
contains(double x,
double y,
double w,
double h)
Deprecated.
Tests if the specified rectangular area is inside the boundary of
this
Shape. |
boolean |
contains(java.awt.geom.Point2D p)
Deprecated.
Tests if the specified
Point2D is inside the boundary
of this Shape. |
boolean |
contains(java.awt.geom.Rectangle2D r)
Deprecated.
Tests if the specified
Rectangle2D is inside the boundary of
this Shape. |
java.awt.Shape |
createTransformedShape(java.awt.geom.AffineTransform at)
Deprecated.
Returns a new transformed
Shape. |
void |
curveTo(double x1,
double y1,
double x2,
double y2,
double x3,
double y3)
Deprecated.
use curveTo(Point, Point, Point)
|
void |
curveTo(Point point1,
Point point2,
Point point3)
Deprecated.
|
void |
ensureCapacity(int capacity)
Deprecated.
|
void |
flip()
Deprecated.
Convertimos el path a puntos y luego le damos la vuelta.
|
double[] |
get3DCoordinatesAt(int index)
Deprecated.
|
java.awt.Rectangle |
getBounds()
Deprecated.
Return the bounding box of the path.
|
java.awt.geom.Rectangle2D |
getBounds2D()
Deprecated.
Returns the bounding box of the path.
|
double[] |
getCoordinatesAt(int index)
Deprecated.
|
java.awt.geom.Point2D |
getCurrentPoint()
Deprecated.
Returns the coordinates most recently added to the end of the path
as a
Point2D object. |
int |
getNumCoords()
Deprecated.
|
int |
getNumTypes()
Deprecated.
|
java.awt.geom.PathIterator |
getPathIterator(java.awt.geom.AffineTransform at)
Deprecated.
Returns a
PathIterator object that iterates along the
boundary of this Shape and provides access to the
geometry of the outline of this Shape. |
java.awt.geom.PathIterator |
getPathIterator(java.awt.geom.AffineTransform at,
double flatness)
Deprecated.
Returns a
PathIterator object that iterates along the
boundary of the flattened Shape and provides access to the
geometry of the outline of the Shape. |
Point |
getPointAt(int index)
Deprecated.
|
double[] |
getPointCoords()
Deprecated.
use the geometry methods.
|
byte[] |
getPointTypes()
Deprecated.
use the geometry methods.
|
byte |
getTypeAt(int index)
Deprecated.
|
int |
getWindingRule()
Deprecated.
Returns the fill style winding rule.
|
boolean |
intersects(double x,
double y,
double w,
double h)
Deprecated.
Tests if the interior of this
Shape intersects the
interior of a specified set of rectangular coordinates. |
boolean |
intersects(java.awt.geom.Rectangle2D r)
Deprecated.
Tests if the interior of this
Shape intersects the
interior of a specified Rectangle2D. |
boolean |
isCCW()
Deprecated.
Check if the first part is CCW.
|
boolean |
isClosed()
Deprecated.
Check if the first part is closed.
|
boolean |
isSimple()
Deprecated.
|
void |
lineTo(double x,
double y)
Deprecated.
use lineTo(Point)
|
void |
lineTo(Point point)
Deprecated.
|
void |
moveTo(double x,
double y)
Deprecated.
use moveTo(Point)
|
void |
moveTo(Point point)
Deprecated.
|
void |
quadTo(double x1,
double y1,
double x2,
double y2)
Deprecated.
use quadTo(Point, Point)
|
void |
quadTo(Point point1,
Point point2)
Deprecated.
|
void |
reProject(ICoordTrans ct)
Deprecated.
|
void |
reset()
Deprecated.
Resets the path to empty.
|
int |
setNumCoords(int numCoords)
Deprecated.
|
void |
setNumTypes(int numTypes)
Deprecated.
|
void |
setPointCoords(double[] pointCoords)
Deprecated.
use the geometry methods.
|
void |
setPointTypes(byte[] pointTypes)
Deprecated.
use the geometry methods.
|
void |
setWindingRule(int rule)
Deprecated.
Sets the winding rule for this path to the specified value.
|
void |
transform(java.awt.geom.AffineTransform at)
Deprecated.
Transforms the geometry of this path using the specified
AffineTransform. |
protected static GeometryManager geomManager
public DefaultGeneralPathX(int rule)
GeneralPathX object with the specified
winding rule to control operations that require the interior of the
path to be defined.rule - the winding ruleIGeneralPathX.WIND_EVEN_ODD,
IGeneralPathX.WIND_NON_ZEROpublic DefaultGeneralPathX(java.awt.geom.PathIterator piter,
boolean is2Dz,
double zValue)
public DefaultGeneralPathX(java.awt.geom.PathIterator piter,
boolean is2Dz,
double zValue,
int capacity)
GeneralPathX object from an arbitrary
Shape object.
All of the initial geometry and the winding rule for this path are
taken from the specified Shape object.piter - is2Dz - zValue - capacity - public void moveTo(double x,
double y)
moveTo in interface IGeneralPathXmoveTo in class GeneralPathXx - , y the specified coordinatespublic void moveTo(Point point)
moveTo in interface IGeneralPathXmoveTo in class GeneralPathXpublic void lineTo(double x,
double y)
lineTo in interface IGeneralPathXlineTo in class GeneralPathXx - , y the specified coordinatespublic void lineTo(Point point)
lineTo in interface IGeneralPathXlineTo in class GeneralPathXpublic void addSegment(Point[] segment)
addSegment in interface IGeneralPathXaddSegment in class GeneralPathXpublic void quadTo(double x1,
double y1,
double x2,
double y2)
quadTo in interface IGeneralPathXquadTo in class GeneralPathXx1 - , y1 the coordinates of the first quadratic control
pointx2 - , y2 the coordinates of the final endpointpublic void quadTo(Point point1, Point point2)
quadTo in interface IGeneralPathXquadTo in class GeneralPathXpublic void curveTo(double x1,
double y1,
double x2,
double y2,
double x3,
double y3)
curveTo in interface IGeneralPathXcurveTo in class GeneralPathXx1 - , y1 the coordinates of the first Béezier
control pointx2 - , y2 the coordinates of the second Bézier
control pointx3 - , y3 the coordinates of the final endpointpublic void curveTo(Point point1, Point point2, Point point3)
curveTo in interface IGeneralPathXcurveTo in class GeneralPathXpublic void closePath()
moveTo. If the path is already
closed then this method has no effect.closePath in interface IGeneralPathXclosePath in class GeneralPathXpublic boolean isClosed()
isClosed in interface IGeneralPathXisClosed in class GeneralPathXpublic void append(java.awt.geom.PathIterator pi,
boolean connect)
PathIterator object
to the path, possibly connecting the new geometry to the existing
path segments with a line segment.
If the connect parameter is true and the
path is not empty then any initial moveTo in the
geometry of the appended Shape is turned into a
lineTo segment.
If the destination coordinates of such a connecting lineTo
segment match the ending coordinates of a currently open
subpath then the segment is omitted as superfluous.
The winding rule of the specified Shape is ignored
and the appended geometry is governed by the winding
rule specified for this path.append in interface IGeneralPathXappend in class GeneralPathXpi - the PathIterator whose geometry is appended to
this pathconnect - a boolean to control whether or not to turn an
initial moveTo segment into a lineTo
segment
to connect the new geometry to the existing pathpublic void append(GeneralPathX gp)
append in interface IGeneralPathXappend in class GeneralPathXpublic int getWindingRule()
getWindingRule in interface IGeneralPathXgetWindingRule in class GeneralPathXIGeneralPathX.WIND_EVEN_ODD,
IGeneralPathX.WIND_NON_ZERO,
setWindingRule(int)public void setWindingRule(int rule)
setWindingRule in interface IGeneralPathXsetWindingRule in class GeneralPathXrule - an integer representing the specified
winding ruleIllegalArgumentException - if rule is
not either WIND_EVEN_ODD or
WIND_NON_ZEROIGeneralPathX.WIND_EVEN_ODD,
IGeneralPathX.WIND_NON_ZERO,
getWindingRule()public java.awt.geom.Point2D getCurrentPoint()
Point2D object.getCurrentPoint in interface IGeneralPathXgetCurrentPoint in class GeneralPathXPoint2D object containing the ending
coordinates of the path or null if there are no
points
in the path.public void reset()
reset in interface IGeneralPathXreset in class GeneralPathXpublic void transform(java.awt.geom.AffineTransform at)
AffineTransform.
The geometry is transformed in place, which permanently changes the
boundary defined by this object.transform in interface IGeneralPathXtransform in class GeneralPathXat - the AffineTransform used to transform the areapublic void reProject(ICoordTrans ct)
reProject in interface IGeneralPathXreProject in class GeneralPathXpublic java.awt.Shape createTransformedShape(java.awt.geom.AffineTransform at)
Shape.createTransformedShape in interface IGeneralPathXcreateTransformedShape in class GeneralPathXat - the AffineTransform used to transform a
new Shape.Shape, transformed with the specified
AffineTransform.public java.awt.Rectangle getBounds()
getBounds in interface java.awt.ShapegetBounds in interface IGeneralPathXgetBounds in class GeneralPathXRectangle object that
bounds the current path.public java.awt.geom.Rectangle2D getBounds2D()
getBounds2D in interface java.awt.ShapegetBounds2D in interface IGeneralPathXgetBounds2D in class GeneralPathXRectangle2D object that
bounds the current path.public boolean contains(double x,
double y)
Shape.contains in interface java.awt.Shapecontains in interface IGeneralPathXcontains in class GeneralPathXx - , y the specified coordinatestrue if the specified coordinates are inside this
Shape; false otherwisepublic boolean contains(java.awt.geom.Point2D p)
Point2D is inside the boundary
of this Shape.contains in interface java.awt.Shapecontains in interface IGeneralPathXcontains in class GeneralPathXp - the specified Point2Dtrue if this Shape contains the
specified Point2D, false otherwise.public boolean contains(double x,
double y,
double w,
double h)
Shape.contains in interface java.awt.Shapecontains in interface IGeneralPathXcontains in class GeneralPathXx - , y the specified coordinatesw - the width of the specified rectangular areah - the height of the specified rectangular areatrue if this Shape contains
the specified rectangluar area; false otherwise.public boolean contains(java.awt.geom.Rectangle2D r)
Rectangle2D is inside the boundary of
this Shape.contains in interface java.awt.Shapecontains in interface IGeneralPathXcontains in class GeneralPathXr - a specified Rectangle2Dtrue if this Shape bounds the
specified Rectangle2D; false otherwise.public boolean intersects(double x,
double y,
double w,
double h)
Shape intersects the
interior of a specified set of rectangular coordinates.intersects in interface java.awt.Shapeintersects in interface IGeneralPathXintersects in class GeneralPathXx - , y the specified coordinatesw - the width of the specified rectangular coordinatesh - the height of the specified rectangular coordinatestrue if this Shape and the
interior of the specified set of rectangular coordinates
intersect
each other; false otherwise.public boolean intersects(java.awt.geom.Rectangle2D r)
Shape intersects the
interior of a specified Rectangle2D.intersects in interface java.awt.Shapeintersects in interface IGeneralPathXintersects in class GeneralPathXr - the specified Rectangle2Dtrue if this Shape and the interior
of the specified Rectangle2D intersect each
other; false otherwise.public java.awt.geom.PathIterator getPathIterator(java.awt.geom.AffineTransform at)
PathIterator object that iterates along the
boundary of this Shape and provides access to the
geometry of the outline of this Shape.
The iterator for this class is not multi-threaded safe,
which means that this GeneralPathX class does not
guarantee that modifications to the geometry of this
GeneralPathX object do not affect any iterations of
that geometry that are already in process.getPathIterator in interface java.awt.ShapegetPathIterator in interface IGeneralPathXgetPathIterator in class GeneralPathXat - an AffineTransformPathIterator that iterates along the
boundary of this Shape and provides access to the
geometry of this Shape's outlinepublic java.awt.geom.PathIterator getPathIterator(java.awt.geom.AffineTransform at,
double flatness)
PathIterator object that iterates along the
boundary of the flattened Shape and provides access to the
geometry of the outline of the Shape.
The iterator for this class is not multi-threaded safe,
which means that this GeneralPathX class does not
guarantee that modifications to the geometry of this
GeneralPathX object do not affect any iterations of
that geometry that are already in process.getPathIterator in interface java.awt.ShapegetPathIterator in interface IGeneralPathXgetPathIterator in class GeneralPathXat - an AffineTransformflatness - the maximum distance that the line segments used to
approximate the curved segments are allowed to deviate
from any point on the original curvePathIterator that iterates along the flattened
Shape boundary.public java.lang.Object clone()
clone in interface IGeneralPathXclone in class GeneralPathXjava.lang.OutOfMemoryError - if there is not enough memory.Cloneablepublic void setNumTypes(int numTypes)
setNumTypes in interface IGeneralPathXsetNumTypes in class GeneralPathXpublic int getNumTypes()
getNumTypes in interface IGeneralPathXgetNumTypes in class GeneralPathXpublic int setNumCoords(int numCoords)
setNumCoords in interface IGeneralPathXsetNumCoords in class GeneralPathXpublic int getNumCoords()
getNumCoords in interface IGeneralPathXgetNumCoords in class GeneralPathXpublic byte getTypeAt(int index)
getTypeAt in interface IGeneralPathXgetTypeAt in class GeneralPathXpublic void setPointTypes(byte[] pointTypes)
setPointTypes in interface IGeneralPathXsetPointTypes in class GeneralPathXpublic byte[] getPointTypes()
getPointTypes in interface IGeneralPathXgetPointTypes in class GeneralPathXpublic void setPointCoords(double[] pointCoords)
setPointCoords in interface IGeneralPathXsetPointCoords in class GeneralPathXpointCoords - public double[] getPointCoords()
getPointCoords in interface IGeneralPathXgetPointCoords in class GeneralPathXpublic Point getPointAt(int index)
getPointAt in interface IGeneralPathXgetPointAt in class GeneralPathXpublic double[] getCoordinatesAt(int index)
getCoordinatesAt in interface IGeneralPathXgetCoordinatesAt in class GeneralPathXpublic double[] get3DCoordinatesAt(int index)
get3DCoordinatesAt in interface IGeneralPathXget3DCoordinatesAt in class GeneralPathXpublic void flip()
flip in interface IGeneralPathXflip in class GeneralPathXpublic boolean isCCW()
isCCW in interface IGeneralPathXisCCW in class GeneralPathXpublic boolean isSimple()
isSimple in interface IGeneralPathXisSimple in class GeneralPathXpublic void ensureCapacity(int capacity)