java.lang.Object
io.sf.carte.echosvg.ext.awt.geom.ExtendedGeneralPath
- All Implemented Interfaces:
- ExtendedShape,- Shape,- Cloneable
The 
ExtendedGeneralPath class represents a geometric path
 constructed from straight lines, quadratic and cubic (Bezier) curves and
 elliptical arc. This class delegates lines and curves to an enclosed
 GeneralPath. Elliptical arc is implemented using an
 Arc2D in float precision.
 Warning : An elliptical arc may be composed of several path segments. For futher details, see the SVG Appendix F.6
- 
Field SummaryFields
- 
Constructor SummaryConstructorsConstructorDescriptionConstructs a newExtendedGeneralPath.ExtendedGeneralPath(int rule) Constructs a newExtendedGeneralPathwith the specified winding rule to control operations that require the interior of the path to be defined.ExtendedGeneralPath(int rule, int initialCapacity) Constructs a newExtendedGeneralPathobject with the specified winding rule and the specified initial capacity to store path coordinates.Constructs a newExtendedGeneralPathobject from an arbitraryShapeobject.
- 
Method SummaryModifier and TypeMethodDescriptionvoidappend(ExtendedPathIterator epi, boolean connect) Delegates to the enclosedGeneralPath.voidappend(PathIterator pi, boolean connect) Delegates to the enclosedGeneralPath.voidDelegates to the enclosedGeneralPath.voidarcTo(float rx, float ry, float angle, boolean largeArcFlag, boolean sweepFlag, float x, float y) Adds an elliptical arc, defined by two radii, an angle from the x-axis, a flag to choose the large arc or not, a flag to indicate if we increase or decrease the angles and the final point of the arc.protected voidChecks if previous command was a moveto command, skipping a close command (if present).clone()Delegates to the enclosedGeneralPath.voidDelegates to the enclosedGeneralPath.static Arc2DcomputeArc(double x0, double y0, double rx, double ry, double angle, boolean largeArcFlag, boolean sweepFlag, double x, double y) This constructs an unrotated Arc2D from the SVG specification of an Elliptical arc.booleancontains(double x, double y) Delegates to the enclosedGeneralPath.booleancontains(double x, double y, double w, double h) Delegates to the enclosedGeneralPath.booleanDelegates to the enclosedGeneralPath.booleanDelegates to the enclosedGeneralPath.Delegates to the enclosedGeneralPath.voidcurveTo(float x1, float y1, float x2, float y2, float x3, float y3) Delegates to the enclosedGeneralPath.Delegates to the enclosedGeneralPath.Delegates to the enclosedGeneralPath.get the current position ornull.Delegates to the enclosedGeneralPath.Delegates to the enclosedGeneralPath.getPathIterator(AffineTransform at, double flatness) Delegates to the enclosedGeneralPath.intDelegates to the enclosedGeneralPath.booleanintersects(double x, double y, double w, double h) Delegates to the enclosedGeneralPath.booleanDelegates to the enclosedGeneralPath.voidlineTo(float x, float y) Delegates to the enclosedGeneralPath.voidmoveTo(float x, float y) Delegates to the enclosedGeneralPath.voidquadTo(float x1, float y1, float x2, float y2) Delegates to the enclosedGeneralPath.voidreset()Delegates to the enclosedGeneralPath.voidsetWindingRule(int rule) Delegates to the enclosedGeneralPath.voidDelegates to the enclosedGeneralPath.
- 
Field Details- 
pathThe enclosed general path.
 
- 
- 
Constructor Details- 
ExtendedGeneralPathpublic ExtendedGeneralPath()Constructs a newExtendedGeneralPath.
- 
ExtendedGeneralPathpublic ExtendedGeneralPath(int rule) Constructs a newExtendedGeneralPathwith the specified winding rule to control operations that require the interior of the path to be defined.
- 
ExtendedGeneralPathpublic ExtendedGeneralPath(int rule, int initialCapacity) Constructs a newExtendedGeneralPathobject with the specified winding rule and the specified initial capacity to store path coordinates.
- 
ExtendedGeneralPathConstructs a newExtendedGeneralPathobject from an arbitraryShapeobject.
 
- 
- 
Method Details- 
arcTopublic void arcTo(float rx, float ry, float angle, boolean largeArcFlag, boolean sweepFlag, float x, float y) Adds an elliptical arc, defined by two radii, an angle from the x-axis, a flag to choose the large arc or not, a flag to indicate if we increase or decrease the angles and the final point of the arc.- Parameters:
- rx- the x radius of the ellipse
- ry- the y radius of the ellipse
- angle- the angle from the x-axis of the current coordinate system to the x-axis of the ellipse in degrees.
- largeArcFlag- the large arc flag. If true the arc spanning less than or equal to 180 degrees is chosen, otherwise the arc spanning greater than 180 degrees is chosen
- sweepFlag- the sweep flag. If true the line joining center to arc sweeps through decreasing angles otherwise it sweeps through increasing angles
- x- the absolute x coordinate of the final point of the arc.
- y- the absolute y coordinate of the final point of the arc.
 
- 
computeArcpublic static Arc2D computeArc(double x0, double y0, double rx, double ry, double angle, boolean largeArcFlag, boolean sweepFlag, double x, double y) This constructs an unrotated Arc2D from the SVG specification of an Elliptical arc. To get the final arc you need to apply a rotation transform such as: AffineTransform.getRotateInstance (angle, arc.getX()+arc.getWidth()/2, arc.getY()+arc.getHeight()/2);
- 
moveTopublic void moveTo(float x, float y) Delegates to the enclosedGeneralPath.
- 
lineTopublic void lineTo(float x, float y) Delegates to the enclosedGeneralPath.
- 
quadTopublic void quadTo(float x1, float y1, float x2, float y2) Delegates to the enclosedGeneralPath.
- 
curveTopublic void curveTo(float x1, float y1, float x2, float y2, float x3, float y3) Delegates to the enclosedGeneralPath.
- 
closePathpublic void closePath()Delegates to the enclosedGeneralPath.
- 
checkMoveToprotected void checkMoveTo()Checks if previous command was a moveto command, skipping a close command (if present).
- 
appendDelegates to the enclosedGeneralPath.
- 
appendDelegates to the enclosedGeneralPath.
- 
appendDelegates to the enclosedGeneralPath.
- 
getWindingRulepublic int getWindingRule()Delegates to the enclosedGeneralPath.
- 
setWindingRulepublic void setWindingRule(int rule) Delegates to the enclosedGeneralPath.
- 
getCurrentPointget the current position ornull.
- 
resetpublic void reset()Delegates to the enclosedGeneralPath.
- 
transformDelegates to the enclosedGeneralPath.
- 
createTransformedShapeDelegates to the enclosedGeneralPath.
- 
getBoundsDelegates to the enclosedGeneralPath.
- 
getBounds2DDelegates to the enclosedGeneralPath.- Specified by:
- getBounds2Din interface- Shape
 
- 
containspublic boolean contains(double x, double y) Delegates to the enclosedGeneralPath.
- 
containsDelegates to the enclosedGeneralPath.
- 
containspublic boolean contains(double x, double y, double w, double h) Delegates to the enclosedGeneralPath.
- 
containsDelegates to the enclosedGeneralPath.
- 
intersectspublic boolean intersects(double x, double y, double w, double h) Delegates to the enclosedGeneralPath.- Specified by:
- intersectsin interface- Shape
 
- 
intersectsDelegates to the enclosedGeneralPath.- Specified by:
- intersectsin interface- Shape
 
- 
getPathIteratorDelegates to the enclosedGeneralPath.- Specified by:
- getPathIteratorin interface- Shape
 
- 
getPathIteratorDelegates to the enclosedGeneralPath.- Specified by:
- getPathIteratorin interface- Shape
 
- 
getExtendedPathIteratorDelegates to the enclosedGeneralPath.- Specified by:
- getExtendedPathIteratorin interface- ExtendedShape
 
- 
cloneDelegates to the enclosedGeneralPath.
 
-