java.lang.Object | |
↳ | java.awt.geom.QuadCurve2D |
Known Direct Subclasses |
The QuadCurve2D
class defines a quadratic parametric curve
segment in (x,y)
coordinate space.
This class is only the abstract superclass for all objects that store a 2D quadratic curve segment. The actual storage representation of the coordinates is left to the subclass.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
QuadCurve2D.Double | A quadratic parametric curve segment specified with
double coordinates. |
||||||||||
QuadCurve2D.Float | A quadratic parametric curve segment specified with
float coordinates. |
Protected Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
This is an abstract class that cannot be instantiated directly.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Creates a new object of the same class and with the same contents
as this object.
| |||||||||||
Tests if the interior of the
Shape entirely contains
the specified rectangular area. | |||||||||||
Tests if a specified
Point2D is inside the boundary
of the Shape . | |||||||||||
Tests if the specified coordinates are inside the boundary of the
Shape . | |||||||||||
Tests if the interior of the
Shape entirely contains the
specified Rectangle2D . | |||||||||||
Returns an integer
Rectangle that completely encloses the
Shape . | |||||||||||
Returns the control point.
| |||||||||||
Returns the X coordinate of the control point in
double precision. | |||||||||||
Returns the Y coordinate of the control point in
double precision. | |||||||||||
Returns the flatness, or maximum distance of a
control point from the line connecting the end points, of the
quadratic curve specified by the indicated control points.
| |||||||||||
Returns the flatness, or maximum distance of a
control point from the line connecting the end points, of this
QuadCurve2D . | |||||||||||
Returns the flatness, or maximum distance of a
control point from the line connecting the end points, of the
quadratic curve specified by the control points stored in the
indicated array at the indicated index.
| |||||||||||
Returns the square of the flatness, or maximum distance of a
control point from the line connecting the end points, of this
QuadCurve2D . | |||||||||||
Returns the square of the flatness, or maximum distance of a
control point from the line connecting the end points, of the
quadratic curve specified by the control points stored in the
indicated array at the indicated index.
| |||||||||||
Returns the square of the flatness, or maximum distance of a
control point from the line connecting the end points, of the
quadratic curve specified by the indicated control points.
| |||||||||||
Returns the start point.
| |||||||||||
Returns the end point.
| |||||||||||
Returns an iteration object that defines the boundary of the
shape of this
QuadCurve2D . | |||||||||||
Returns an iteration object that defines the boundary of the
flattened shape of this
QuadCurve2D . | |||||||||||
Returns the X coordinate of the start point in
double in precision. | |||||||||||
Returns the X coordinate of the end point in
double precision. | |||||||||||
Returns the Y coordinate of the start point in
double precision. | |||||||||||
Returns the Y coordinate of the end point in
double precision. | |||||||||||
Tests if the interior of the
Shape intersects the
interior of a specified rectangular area. | |||||||||||
Tests if the interior of the
Shape intersects the
interior of a specified Rectangle2D . | |||||||||||
Sets the location of the end points and control point of this curve
to the specified
double coordinates. | |||||||||||
Sets the location of the end points and control point of this
QuadCurve2D to the specified Point2D
coordinates. | |||||||||||
Sets the location of the end points and control point of this
QuadCurve2D to the same as those in the specified
QuadCurve2D . | |||||||||||
Sets the location of the end points and control points of this
QuadCurve2D to the coordinates of the
Point2D objects at the specified offset in
the specified array. | |||||||||||
Sets the location of the end points and control points of this
QuadCurve2D to the double coordinates at
the specified offset in the specified array. | |||||||||||
Solves the quadratic whose coefficients are in the
eqn
array and places the non-complex roots into the res
array, returning the number of roots. | |||||||||||
Solves the quadratic whose coefficients are in the
eqn
array and places the non-complex roots back into the same array,
returning the number of roots. | |||||||||||
Subdivides this
QuadCurve2D and stores the resulting
two subdivided curves into the left and
right curve parameters. | |||||||||||
Subdivides the quadratic curve specified by the coordinates
stored in the
src array at indices
srcoff through srcoff + 5
and stores the resulting two subdivided curves into the two
result arrays at the corresponding indices. | |||||||||||
Subdivides the quadratic curve specified by the
src
parameter and stores the resulting two subdivided curves into the
left and right curve parameters. |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
java.awt.Shape
|
This is an abstract class that cannot be instantiated directly. Type-specific implementation subclasses are available for instantiation and provide a number of formats for storing the information necessary to satisfy the various accessor methods below.
Creates a new object of the same class and with the same contents as this object.
OutOfMemoryError | if there is not enough memory. |
---|
Tests if the interior of the Shape
entirely contains
the specified rectangular area. All coordinates that lie inside
the rectangular area must lie within the Shape
for the
entire rectanglar area to be considered contained within the
Shape
.
The Shape.contains()
method allows a Shape
implementation to conservatively return false
when:
intersect
method returns true
and
Shape
entirely contains the rectangular area are
prohibitively expensive.
Shapes
this method might
return false
even though the Shape
contains
the rectangular area.
The Area
class performs
more accurate geometric computations than most
Shape
objects and therefore can be used if a more precise
answer is required.x | the X coordinate of the upper-left corner of the specified rectangular area |
---|---|
y | the Y coordinate of the upper-left corner of the specified rectangular area |
w | the width of the specified rectangular area |
h | the height of the specified rectangular area |
true
if the interior of the Shape
entirely contains the specified rectangular area;
false
otherwise or, if the Shape
contains the rectangular area and the
intersects
method returns true
and the containment calculations would be too expensive to
perform.Tests if a specified Point2D
is inside the boundary
of the Shape
.
p | the specified Point2D to be tested |
---|
true
if the specified Point2D
is
inside the boundary of the Shape
;
false
otherwise.Tests if the specified coordinates are inside the boundary of the
Shape
.
x | the specified X coordinate to be tested |
---|---|
y | the specified Y coordinate to be tested |
true
if the specified coordinates are inside
the Shape
boundary; false
otherwise.Tests if the interior of the Shape
entirely contains the
specified Rectangle2D
.
The Shape.contains()
method allows a Shape
implementation to conservatively return false
when:
intersect
method returns true
and
Shape
entirely contains the Rectangle2D
are prohibitively expensive.
Shapes
this method might
return false
even though the Shape
contains
the Rectangle2D
.
The Area
class performs
more accurate geometric computations than most
Shape
objects and therefore can be used if a more precise
answer is required.r | The specified Rectangle2D |
---|
true
if the interior of the Shape
entirely contains the Rectangle2D
;
false
otherwise or, if the Shape
contains the Rectangle2D
and the
intersects
method returns true
and the containment calculations would be too expensive to
perform.Returns an integer Rectangle
that completely encloses the
Shape
. Note that there is no guarantee that the
returned Rectangle
is the smallest bounding box that
encloses the Shape
, only that the Shape
lies entirely within the indicated Rectangle
. The
returned Rectangle
might also fail to completely
enclose the Shape
if the Shape
overflows
the limited range of the integer data type. The
getBounds2D
method generally returns a
tighter bounding box due to its greater flexibility in
representation.
Rectangle
that completely encloses
the Shape
.Returns the control point.
Point2D
that is the control point of this
Point2D
.Returns the X coordinate of the control point in
double
precision.
Returns the Y coordinate of the control point in
double
precision.
Returns the flatness, or maximum distance of a control point from the line connecting the end points, of the quadratic curve specified by the indicated control points.
x1 | the X coordinate of the start point |
---|---|
y1 | the Y coordinate of the start point |
ctrlx | the X coordinate of the control point |
ctrly | the Y coordinate of the control point |
x2 | the X coordinate of the end point |
y2 | the Y coordinate of the end point |
Returns the flatness, or maximum distance of a
control point from the line connecting the end points, of this
QuadCurve2D
.
QuadCurve2D
.Returns the flatness, or maximum distance of a control point from the line connecting the end points, of the quadratic curve specified by the control points stored in the indicated array at the indicated index.
coords | an array containing coordinate values |
---|---|
offset | the index into coords from which to
start getting the coordinate values |
Returns the square of the flatness, or maximum distance of a
control point from the line connecting the end points, of this
QuadCurve2D
.
QuadCurve2D
.Returns the square of the flatness, or maximum distance of a control point from the line connecting the end points, of the quadratic curve specified by the control points stored in the indicated array at the indicated index.
coords | an array containing coordinate values |
---|---|
offset | the index into coords from which to
to start getting the values from the array |
Returns the square of the flatness, or maximum distance of a control point from the line connecting the end points, of the quadratic curve specified by the indicated control points.
x1 | the X coordinate of the start point |
---|---|
y1 | the Y coordinate of the start point |
ctrlx | the X coordinate of the control point |
ctrly | the Y coordinate of the control point |
x2 | the X coordinate of the end point |
y2 | the Y coordinate of the end point |
Returns the start point.
Point2D
that is the start point of this
QuadCurve2D
.Returns the end point.
Point
object that is the end point
of this Point2D
.Returns an iteration object that defines the boundary of the
shape of this QuadCurve2D
.
The iterator for this class is not multi-threaded safe,
which means that this QuadCurve2D
class does not
guarantee that modifications to the geometry of this
QuadCurve2D
object do not affect any iterations of
that geometry that are already in process.
at | an optional AffineTransform to apply to the
shape boundary |
---|
PathIterator
object that defines the boundary
of the shape.Returns an iteration object that defines the boundary of the
flattened shape of this QuadCurve2D
.
The iterator for this class is not multi-threaded safe,
which means that this QuadCurve2D
class does not
guarantee that modifications to the geometry of this
QuadCurve2D
object do not affect any iterations of
that geometry that are already in process.
at | an optional AffineTransform to apply
to the boundary of the shape |
---|---|
flatness | the maximum distance that the control points for a subdivided curve can be with respect to a line connecting the end points of this curve before this curve is replaced by a straight line connecting the end points. |
PathIterator
object that defines the
flattened boundary of the shape.Returns the X coordinate of the start point in
double
in precision.
Returns the X coordinate of the end point in
double
precision.
Returns the Y coordinate of the start point in
double
precision.
Returns the Y coordinate of the end point in
double
precision.
Tests if the interior of the Shape
intersects the
interior of a specified rectangular area.
The rectangular area is considered to intersect the Shape
if any point is contained in both the interior of the
Shape
and the specified rectangular area.
The Shape.intersects()
method allows a Shape
implementation to conservatively return true
when:
Shape
intersect, but
Shapes
this method might
return true
even though the rectangular area does not
intersect the Shape
.
The Area
class performs
more accurate computations of geometric intersection than most
Shape
objects and therefore can be used if a more precise
answer is required.x | the X coordinate of the upper-left corner of the specified rectangular area |
---|---|
y | the Y coordinate of the upper-left corner of the specified rectangular area |
w | the width of the specified rectangular area |
h | the height of the specified rectangular area |
true
if the interior of the Shape
and
the interior of the rectangular area intersect, or are
both highly likely to intersect and intersection calculations
would be too expensive to perform; false
otherwise.Tests if the interior of the Shape
intersects the
interior of a specified Rectangle2D
.
The Shape.intersects()
method allows a Shape
implementation to conservatively return true
when:
Rectangle2D
and the
Shape
intersect, but
Shapes
this method might
return true
even though the Rectangle2D
does not
intersect the Shape
.
The Area
class performs
more accurate computations of geometric intersection than most
Shape
objects and therefore can be used if a more precise
answer is required.r | the specified Rectangle2D |
---|
true
if the interior of the Shape
and
the interior of the specified Rectangle2D
intersect, or are both highly likely to intersect and intersection
calculations would be too expensive to perform; false
otherwise.Sets the location of the end points and control point of this curve
to the specified double
coordinates.
x1 | the X coordinate of the start point |
---|---|
y1 | the Y coordinate of the start point |
ctrlx | the X coordinate of the control point |
ctrly | the Y coordinate of the control point |
x2 | the X coordinate of the end point |
y2 | the Y coordinate of the end point |
Sets the location of the end points and control point of this
QuadCurve2D
to the specified Point2D
coordinates.
p1 | the start point |
---|---|
cp | the control point |
p2 | the end point |
Sets the location of the end points and control point of this
QuadCurve2D
to the same as those in the specified
QuadCurve2D
.
c | the specified QuadCurve2D |
---|
Sets the location of the end points and control points of this
QuadCurve2D
to the coordinates of the
Point2D
objects at the specified offset in
the specified array.
pts | an array containing Point2D that define
coordinate values |
---|---|
offset | the index into pts from which to start
getting the coordinate values and assigning them to this
QuadCurve2D |
Sets the location of the end points and control points of this
QuadCurve2D
to the double
coordinates at
the specified offset in the specified array.
coords | the array containing coordinate values |
---|---|
offset | the index into the array from which to start
getting the coordinate values and assigning them to this
QuadCurve2D |
Solves the quadratic whose coefficients are in the eqn
array and places the non-complex roots into the res
array, returning the number of roots.
The quadratic solved is represented by the equation:
eqn = {C, B, A}; ax^2 + bx + c = 0A return value of
-1
is used to distinguish a constant
equation, which might be always 0 or never 0, from an equation that
has no zeroes.eqn | the specified array of coefficients to use to solve the quadratic equation |
---|---|
res | the array that contains the non-complex roots resulting from the solution of the quadratic equation |
-1
if the equation is
a constant.Solves the quadratic whose coefficients are in the eqn
array and places the non-complex roots back into the same array,
returning the number of roots. The quadratic solved is represented
by the equation:
eqn = {C, B, A}; ax^2 + bx + c = 0A return value of
-1
is used to distinguish a constant
equation, which might be always 0 or never 0, from an equation that
has no zeroes.eqn | the array that contains the quadratic coefficients |
---|
-1
if the equation is
a constantSubdivides this QuadCurve2D
and stores the resulting
two subdivided curves into the left
and
right
curve parameters.
Either or both of the left
and right
objects can be the same as this QuadCurve2D
or
null
.
left | the QuadCurve2D object for storing the
left or first half of the subdivided curve |
---|---|
right | the QuadCurve2D object for storing the
right or second half of the subdivided curve |
Subdivides the quadratic curve specified by the coordinates
stored in the src
array at indices
srcoff
through srcoff
+ 5
and stores the resulting two subdivided curves into the two
result arrays at the corresponding indices.
Either or both of the left
and right
arrays can be null
or a reference to the same array
and offset as the src
array.
Note that the last point in the first subdivided curve is the
same as the first point in the second subdivided curve. Thus,
it is possible to pass the same array for left
and
right
and to use offsets such that
rightoff
equals leftoff
+ 4 in order
to avoid allocating extra storage for this common point.
src | the array holding the coordinates for the source curve |
---|---|
srcoff | the offset into the array of the beginning of the the 6 source coordinates |
left | the array for storing the coordinates for the first half of the subdivided curve |
leftoff | the offset into the array of the beginning of the the 6 left coordinates |
right | the array for storing the coordinates for the second half of the subdivided curve |
rightoff | the offset into the array of the beginning of the the 6 right coordinates |
Subdivides the quadratic curve specified by the src
parameter and stores the resulting two subdivided curves into the
left
and right
curve parameters.
Either or both of the left
and right
objects can be the same as the src
object or
null
.
src | the quadratic curve to be subdivided |
---|---|
left | the QuadCurve2D object for storing the
left or first half of the subdivided curve |
right | the QuadCurve2D object for storing the
right or second half of the subdivided curve |