Class QuadCurve2D.Double
java.lang.Object
java.awt.geom.QuadCurve2D
java.awt.geom.QuadCurve2D.Double
- All Implemented Interfaces:
Shape, Serializable, Cloneable
- Enclosing class:
QuadCurve2D
public static class QuadCurve2D.Double extends QuadCurve2D implements Serializable
A quadratic parametric curve segment specified with
double coordinates.- Since:
- 1.2
- See Also:
Nested Class Summary
Nested classes/interfaces declared in class QuadCurve2D
QuadCurve2D.Double, QuadCurve2D.Float | Modifier and Type | Class | Description |
|---|---|---|
static class |
QuadCurve2D.Double |
A quadratic parametric curve segment specified with double coordinates. |
static class |
QuadCurve2D.Float |
A quadratic parametric curve segment specified with float coordinates. |
Field Summary
| Modifier and Type | Field | Description |
|---|---|---|
double |
ctrlx |
The X coordinate of the control point of the quadratic curve segment. |
double |
ctrly |
The Y coordinate of the control point of the quadratic curve segment. |
double |
x1 |
The X coordinate of the start point of the quadratic curve segment. |
double |
x2 |
The X coordinate of the end point of the quadratic curve segment. |
double |
y1 |
The Y coordinate of the start point of the quadratic curve segment. |
double |
y2 |
The Y coordinate of the end point of the quadratic curve segment. |
Constructor Summary
| Constructor | Description |
|---|---|
Double() |
Constructs and initializes a QuadCurve2D with coordinates (0, 0, 0, 0, 0, 0). |
Double |
Constructs and initializes a QuadCurve2D from the specified double coordinates. |
Method Summary
| Modifier and Type | Method | Description |
|---|---|---|
Point2D |
getCtrlPt() |
Returns the control point. |
double |
getCtrlX() |
Returns the X coordinate of the control point in double precision. |
double |
getCtrlY() |
Returns the Y coordinate of the control point in double precision. |
Point2D |
getP1() |
Returns the start point. |
Point2D |
getP2() |
Returns the end point. |
double |
getX1() |
Returns the X coordinate of the start point in double in precision. |
double |
getX2() |
Returns the X coordinate of the end point in double precision. |
double |
getY1() |
Returns the Y coordinate of the start point in double precision. |
double |
getY2() |
Returns the Y coordinate of the end point in double precision. |
void |
setCurve |
Sets the location of the end points and control point of this curve to the specified double coordinates. |
Methods declared in class QuadCurve2D
clone, contains, contains, contains, contains, getBounds, getBounds2D, getFlatness, getFlatness, getFlatness, getFlatnessSq, getFlatnessSq, getFlatnessSq, getPathIterator, getPathIterator, intersects, intersects, setCurve, setCurve, setCurve, setCurve, solveQuadratic, solveQuadratic, subdivide, subdivide, subdivide | Modifier and Type | Method | Description |
|---|---|---|
Object |
clone() |
Creates a new object of the same class and with the same contents as this object. |
boolean |
contains |
Tests if the specified coordinates are inside the boundary of the Shape, as described by the definition of insideness. |
boolean |
contains |
Tests if the interior of the Shape entirely contains the specified rectangular area. |
boolean |
contains |
Tests if a specified Point2D is inside the boundary of the Shape, as described by the definition of insideness. |
boolean |
contains |
Tests if the interior of the Shape entirely contains the specified Rectangle2D. |
Rectangle |
getBounds() |
Returns an integer Rectangle that completely encloses the Shape. |
Rectangle2D |
getBounds2D() |
Returns a high precision and more accurate bounding box of the Shape than the getBounds method. |
double |
getFlatness() |
Returns the flatness, or maximum distance of a control point from the line connecting the end points, of this QuadCurve2D. |
static double |
getFlatness |
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. |
static double |
getFlatness |
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. |
double |
getFlatnessSq() |
Returns the square of the flatness, or maximum distance of a control point from the line connecting the end points, of this QuadCurve2D. |
static double |
getFlatnessSq |
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. |
static double |
getFlatnessSq |
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. |
PathIterator |
getPathIterator |
Returns an iteration object that defines the boundary of the shape of this QuadCurve2D. |
PathIterator |
getPathIterator |
Returns an iteration object that defines the boundary of the flattened shape of this QuadCurve2D. |
boolean |
intersects |
Tests if the interior of the Shape intersects the interior of a specified rectangular area. |
boolean |
intersects |
Tests if the interior of the Shape intersects the interior of a specified Rectangle2D. |
void |
setCurve |
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. |
void |
setCurve |
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. |
void |
setCurve |
Sets the location of the end points and control point of this QuadCurve2D to the specified Point2D coordinates. |
void |
setCurve |
Sets the location of the end points and control point of this QuadCurve2D to the same as those in the specified QuadCurve2D. |
static int |
solveQuadratic |
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. |
static int |
solveQuadratic |
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. |
static void |
subdivide |
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. |
void |
subdivide |
Subdivides this QuadCurve2D and stores the resulting two subdivided curves into the left and right curve parameters. |
static void |
subdivide |
Subdivides the quadratic curve specified by the src parameter and stores the resulting two subdivided curves into the left and right curve parameters. |
Methods declared in class Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | Modifier and Type | Method | Description |
|---|---|---|
boolean |
equals |
Indicates whether some other object is "equal to" this one. |
protected void |
finalize() |
Deprecated, for removal: This API element is subject to removal in a future version. Finalization is deprecated and subject to removal in a future release. |
final Class |
getClass() |
Returns the runtime class of this Object. |
int |
hashCode() |
Returns a hash code value for this object. |
final void |
notify() |
Wakes up a single thread that is waiting on this object's monitor. |
final void |
notifyAll() |
Wakes up all threads that are waiting on this object's monitor. |
String |
toString() |
Returns a string representation of the object. |
final void |
wait() |
Causes the current thread to wait until it is awakened, typically by being notified or interrupted. |
final void |
wait |
Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed. |
final void |
wait |
Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed. |
Field Details
x1
public double x1
The X coordinate of the start point of the quadratic curve segment.
- Since:
- 1.2
y1
public double y1
The Y coordinate of the start point of the quadratic curve segment.
- Since:
- 1.2
ctrlx
public double ctrlx
The X coordinate of the control point of the quadratic curve segment.
- Since:
- 1.2
ctrly
public double ctrly
The Y coordinate of the control point of the quadratic curve segment.
- Since:
- 1.2
x2
public double x2
The X coordinate of the end point of the quadratic curve segment.
- Since:
- 1.2
y2
public double y2
The Y coordinate of the end point of the quadratic curve segment.
- Since:
- 1.2
Constructor Details
Double
public Double()
Constructs and initializes a
QuadCurve2D with coordinates (0, 0, 0, 0, 0, 0).- Since:
- 1.2
Double
public Double(double x1, double y1, double ctrlx, double ctrly, double x2, double y2)
Constructs and initializes a
QuadCurve2D from the specified double coordinates.- Parameters:
-
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 - Since:
- 1.2
Method Details
getX1
public double getX1()
Returns the X coordinate of the start point in
double in precision.- Specified by:
-
getX1in classQuadCurve2D - Returns:
- the X coordinate of the start point.
- Since:
- 1.2
getY1
public double getY1()
Returns the Y coordinate of the start point in
double precision.- Specified by:
-
getY1in classQuadCurve2D - Returns:
- the Y coordinate of the start point.
- Since:
- 1.2
getP1
public Point2D getP1()
Returns the start point.
- Specified by:
-
getP1in classQuadCurve2D - Returns:
- a
Point2Dthat is the start point of thisQuadCurve2D. - Since:
- 1.2
getCtrlX
public double getCtrlX()
Returns the X coordinate of the control point in
double precision.- Specified by:
-
getCtrlXin classQuadCurve2D - Returns:
- X coordinate the control point
- Since:
- 1.2
getCtrlY
public double getCtrlY()
Returns the Y coordinate of the control point in
double precision.- Specified by:
-
getCtrlYin classQuadCurve2D - Returns:
- the Y coordinate of the control point.
- Since:
- 1.2
getCtrlPt
public Point2D getCtrlPt()
Returns the control point.
- Specified by:
-
getCtrlPtin classQuadCurve2D - Returns:
- a
Point2Dthat is the control point of thisPoint2D. - Since:
- 1.2
getX2
public double getX2()
Returns the X coordinate of the end point in
double precision.- Specified by:
-
getX2in classQuadCurve2D - Returns:
- the x coordinate of the end point.
- Since:
- 1.2
getY2
public double getY2()
Returns the Y coordinate of the end point in
double precision.- Specified by:
-
getY2in classQuadCurve2D - Returns:
- the Y coordinate of the end point.
- Since:
- 1.2
getP2
public Point2D getP2()
Returns the end point.
- Specified by:
-
getP2in classQuadCurve2D - Returns:
- a
Pointobject that is the end point of thisPoint2D. - Since:
- 1.2
setCurve
public void setCurve(double x1, double y1, double ctrlx, double ctrly, double x2, double y2)
Sets the location of the end points and control point of this curve to the specified
double coordinates.- Specified by:
-
setCurvein classQuadCurve2D - Parameters:
-
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 - Since:
- 1.2
© 1993, 2025, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.