public class ExtendedGeneralPath extends java.lang.Object implements ExtendedShape, java.lang.Cloneable
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
Modifier and Type | Field and Description |
---|---|
protected java.awt.geom.GeneralPath |
path
The enclosed general path.
|
Constructor and Description |
---|
ExtendedGeneralPath()
Constructs a new
ExtendedGeneralPath . |
ExtendedGeneralPath(int rule)
Constructs a new
ExtendedGeneralPath with the
specified winding rule to control operations that require the
interior of the path to be defined. |
ExtendedGeneralPath(int rule,
int initialCapacity)
Constructs a new
ExtendedGeneralPath object with
the specified winding rule and the specified initial capacity
to store path coordinates. |
ExtendedGeneralPath(java.awt.Shape s)
Constructs a new
ExtendedGeneralPath object from
an arbitrary Shape object. |
Modifier and Type | Method and Description |
---|---|
void |
append(ExtendedPathIterator epi,
boolean connect)
Delegates to the enclosed
GeneralPath . |
void |
append(java.awt.geom.PathIterator pi,
boolean connect)
Delegates to the enclosed
GeneralPath . |
void |
append(java.awt.Shape s,
boolean connect)
Delegates to the enclosed
GeneralPath . |
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.
|
protected void |
checkMoveTo()
Checks if previous command was a moveto command,
skipping a close command (if present).
|
java.lang.Object |
clone()
Delegates to the enclosed
GeneralPath . |
void |
closePath()
Delegates to the enclosed
GeneralPath . |
static java.awt.geom.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.
|
boolean |
contains(double x,
double y)
Delegates to the enclosed
GeneralPath . |
boolean |
contains(double x,
double y,
double w,
double h)
Delegates to the enclosed
GeneralPath . |
boolean |
contains(java.awt.geom.Point2D p)
Delegates to the enclosed
GeneralPath . |
boolean |
contains(java.awt.geom.Rectangle2D r)
Delegates to the enclosed
GeneralPath . |
java.awt.Shape |
createTransformedShape(java.awt.geom.AffineTransform at)
Delegates to the enclosed
GeneralPath . |
void |
curveTo(float x1,
float y1,
float x2,
float y2,
float x3,
float y3)
Delegates to the enclosed
GeneralPath . |
java.awt.Rectangle |
getBounds()
Delegates to the enclosed
GeneralPath . |
java.awt.geom.Rectangle2D |
getBounds2D()
Delegates to the enclosed
GeneralPath . |
java.awt.geom.Point2D |
getCurrentPoint()
get the current position or
null . |
ExtendedPathIterator |
getExtendedPathIterator()
Delegates to the enclosed
GeneralPath . |
java.awt.geom.PathIterator |
getPathIterator(java.awt.geom.AffineTransform at)
Delegates to the enclosed
GeneralPath . |
java.awt.geom.PathIterator |
getPathIterator(java.awt.geom.AffineTransform at,
double flatness)
Delegates to the enclosed
GeneralPath . |
int |
getWindingRule()
Delegates to the enclosed
GeneralPath . |
boolean |
intersects(double x,
double y,
double w,
double h)
Delegates to the enclosed
GeneralPath . |
boolean |
intersects(java.awt.geom.Rectangle2D r)
Delegates to the enclosed
GeneralPath . |
void |
lineTo(float x,
float y)
Delegates to the enclosed
GeneralPath . |
void |
moveTo(float x,
float y)
Delegates to the enclosed
GeneralPath . |
void |
quadTo(float x1,
float y1,
float x2,
float y2)
Delegates to the enclosed
GeneralPath . |
void |
reset()
Delegates to the enclosed
GeneralPath . |
void |
setWindingRule(int rule)
Delegates to the enclosed
GeneralPath . |
void |
transform(java.awt.geom.AffineTransform at)
Delegates to the enclosed
GeneralPath . |
public ExtendedGeneralPath()
ExtendedGeneralPath
.public ExtendedGeneralPath(int rule)
ExtendedGeneralPath
with the
specified winding rule to control operations that require the
interior of the path to be defined.public ExtendedGeneralPath(int rule, int initialCapacity)
ExtendedGeneralPath
object with
the specified winding rule and the specified initial capacity
to store path coordinates.public ExtendedGeneralPath(java.awt.Shape s)
ExtendedGeneralPath
object from
an arbitrary Shape
object.public void arcTo(float rx, float ry, float angle, boolean largeArcFlag, boolean sweepFlag, float x, float y)
rx
- the x radius of the ellipsery
- the y radius of the ellipseangle
- 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 chosensweepFlag
- the sweep flag. If true the line joining
center to arc sweeps through decreasing angles otherwise it
sweeps through increasing anglesx
- the absolute x coordinate of the final point of the arc.y
- the absolute y coordinate of the final point of the arc.public static java.awt.geom.Arc2D computeArc(double x0, double y0, double rx, double ry, double angle, boolean largeArcFlag, boolean sweepFlag, double x, double y)
public void moveTo(float x, float y)
GeneralPath
.public void lineTo(float x, float y)
GeneralPath
.public void quadTo(float x1, float y1, float x2, float y2)
GeneralPath
.public void curveTo(float x1, float y1, float x2, float y2, float x3, float y3)
GeneralPath
.public void closePath()
GeneralPath
.protected void checkMoveTo()
public void append(java.awt.Shape s, boolean connect)
GeneralPath
.public void append(java.awt.geom.PathIterator pi, boolean connect)
GeneralPath
.public void append(ExtendedPathIterator epi, boolean connect)
GeneralPath
.public int getWindingRule()
GeneralPath
.public void setWindingRule(int rule)
GeneralPath
.public java.awt.geom.Point2D getCurrentPoint()
null
.public void reset()
GeneralPath
.public void transform(java.awt.geom.AffineTransform at)
GeneralPath
.public java.awt.Shape createTransformedShape(java.awt.geom.AffineTransform at)
GeneralPath
.public java.awt.Rectangle getBounds()
GeneralPath
.getBounds
in interface java.awt.Shape
public java.awt.geom.Rectangle2D getBounds2D()
GeneralPath
.getBounds2D
in interface java.awt.Shape
public boolean contains(double x, double y)
GeneralPath
.contains
in interface java.awt.Shape
public boolean contains(java.awt.geom.Point2D p)
GeneralPath
.contains
in interface java.awt.Shape
public boolean contains(double x, double y, double w, double h)
GeneralPath
.contains
in interface java.awt.Shape
public boolean contains(java.awt.geom.Rectangle2D r)
GeneralPath
.contains
in interface java.awt.Shape
public boolean intersects(double x, double y, double w, double h)
GeneralPath
.intersects
in interface java.awt.Shape
public boolean intersects(java.awt.geom.Rectangle2D r)
GeneralPath
.intersects
in interface java.awt.Shape
public java.awt.geom.PathIterator getPathIterator(java.awt.geom.AffineTransform at)
GeneralPath
.getPathIterator
in interface java.awt.Shape
public java.awt.geom.PathIterator getPathIterator(java.awt.geom.AffineTransform at, double flatness)
GeneralPath
.getPathIterator
in interface java.awt.Shape
public ExtendedPathIterator getExtendedPathIterator()
GeneralPath
.getExtendedPathIterator
in interface ExtendedShape
public java.lang.Object clone()
GeneralPath
.clone
in class java.lang.Object
Copyright © 2022 Apache Software Foundation. All Rights Reserved.