All Packages  Class Hierarchy  This Package  Previous  Next  Index  

Class java.awt.geom.QuadCurve2D

java.lang.Object
    |
    +----java.awt.geom.QuadCurve2D

public abstract class QuadCurve2D
extends Object
implements Shape
A quadratic parametric curve segment in (x, y) coordinate space.

This class is only the abstract superclass for all objects which store a 2D quadratic curve segment. The actual storage representation of the coordinates is left to the subclass.


Class Index

 o QuadCurve2D.Float
A quadratic parametric curve segment specified with float coordinates.

Constructor Index

 o QuadCurve2D()

Method Index

 o contains(double, double)
Test if a given coordinate is inside the boundary of the shape.
 o contains(double, double, double, double)
Test if the interior of the Shape entirely contains the given set of rectangular coordinates.
 o contains(Point2D)
Test if a given Point is inside the boundary of the shape.
 o contains(Rectangle2D)
Test if the interior of the Shape entirely contains the given Rectangle.
 o getBounds()
Return the bounding box of the shape.
 o getCtrlX()
Returns the X coordinate of the control point in double precision.
 o getCtrlY()
Returns the Y coordinate of the control point in double precision.
 o getFlatness()
Returns the flatness, or maximum distance of a controlpoint from the line connecting the endpoints, of this curve.
 o getFlatness(double, double, double, double, double, double)
Returns the flatness, or maximum distance of a controlpoint from the line connecting the endpoints, of the quadratic curve specified by the indicated controlpoints.
 o getFlatness(double[], int)
Returns the flatness, or maximum distance of a controlpoint from the line connecting the endpoints, of the quadratic curve specified by the controlpoints stored in the indicated array at the indicated index.
 o getFlatnessSq()
Returns the square of the flatness, or maximum distance of a controlpoint from the line connecting the endpoints, of this curve.
 o getFlatnessSq(double, double, double, double, double, double)
Returns the square of the flatness, or maximum distance of a controlpoint from the line connecting the endpoints, of the quadratic curve specified by the indicated controlpoints.
 o getFlatnessSq(double[], int)
Returns the square of the flatness, or maximum distance of a controlpoint from the line connecting the endpoints, of the quadratic curve specified by the controlpoints stored in the indicated array at the indicated index.
 o getPathIterator(AffineTransform)
Return an iteration object that defines the boundary of the shape.
 o getPathIterator(AffineTransform, double)
Return an iteration object that defines the boundary of the flattened shape.
 o getX1()
Returns the X coordinate of the start point in double precision.
 o getX2()
Returns the X coordinate of the end point in double precision.
 o getY1()
Returns the Y coordinate of the start point in double precision.
 o getY2()
Returns the Y coordinate of the end point in double precision.
 o intersects(double, double, double, double)
Test if the Shape intersects the interior of a given set of rectangular coordinates.
 o intersects(Rectangle2D)
Test if the Shape intersects the interior of a given Rectangle.
 o setCurve(double, double, double, double, double, double)
Sets the location of the endpoints and controlpoint of this curve to the specified double coordinates.
 o setCurve(double[], int)
Sets the location of the endpoints and controlpoints of this curve to the double coordinates at the specified offset in the specified array.
 o setCurve(Point2D, Point2D, Point2D)
Sets the location of the endpoints and controlpoint of this curve to the specified Point coordinates.
 o setCurve(Point2D[], int)
Sets the location of the endpoints and controlpoints of this curve to the coordinates of the Point objects at the specified offset in the specified array.
 o setCurve(QuadCurve2D)
Sets the location of the endpoints and controlpoint of this curve to the same as those in the specified QuadCurve.
 o solveQuadratic(double[])
Solve the quadratic whose coefficients are in the eqn array and place the non-complex roots back into the array, returning the number of roots.
 o subdivide(double[], int, double[], int, double[], int)
Subdivides the quadratic curve specified by the 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.
 o subdivide(QuadCurve2D, QuadCurve2D)
Subdivides this quadratic curve and stores the resulting two subdivided curves into the left and right curve parameters.
 o subdivide(QuadCurve2D, QuadCurve2D, QuadCurve2D)
Subdivides the quadratic curve specified by the src parameter and stores the resulting two subdivided curves into the left and right curve parameters.

Constructors

 o QuadCurve2D
protected QuadCurve2D()

Methods

 o getX1
public abstract double getX1()
Returns the X coordinate of the start point in double precision.

 o getY1
public abstract double getY1()
Returns the Y coordinate of the start point in double precision.

 o getCtrlX
public abstract double getCtrlX()
Returns the X coordinate of the control point in double precision.

 o getCtrlY
public abstract double getCtrlY()
Returns the Y coordinate of the control point in double precision.

 o getX2
public abstract double getX2()
Returns the X coordinate of the end point in double precision.

 o getY2
public abstract double getY2()
Returns the Y coordinate of the end point in double precision.

 o setCurve
public abstract void setCurve(double x1,
                              double y1,
                              double ctrlx,
                              double ctrly,
                              double x2,
                              double y2)
Sets the location of the endpoints and controlpoint of this curve to the specified double coordinates.

 o setCurve
public void setCurve(double[] coords,
                     int offset)
Sets the location of the endpoints and controlpoints of this curve to the double coordinates at the specified offset in the specified array.

 o setCurve
public void setCurve(Point2D p1,
                     Point2D cp,
                     Point2D p2)
Sets the location of the endpoints and controlpoint of this curve to the specified Point coordinates.

 o setCurve
public void setCurve(Point2D[] pts,
                     int offset)
Sets the location of the endpoints and controlpoints of this curve to the coordinates of the Point objects at the specified offset in the specified array.

 o setCurve
public void setCurve(QuadCurve2D c)
Sets the location of the endpoints and controlpoint of this curve to the same as those in the specified QuadCurve.

 o getFlatnessSq
public static double getFlatnessSq(double x1,
                                   double y1,
                                   double ctrlx,
                                   double ctrly,
                                   double x2,
                                   double y2)
Returns the square of the flatness, or maximum distance of a controlpoint from the line connecting the endpoints, of the quadratic curve specified by the indicated controlpoints.

 o getFlatness
public static double getFlatness(double x1,
                                 double y1,
                                 double ctrlx,
                                 double ctrly,
                                 double x2,
                                 double y2)
Returns the flatness, or maximum distance of a controlpoint from the line connecting the endpoints, of the quadratic curve specified by the indicated controlpoints.

 o getFlatnessSq
public static double getFlatnessSq(double[] coords,
                                   int offset)
Returns the square of the flatness, or maximum distance of a controlpoint from the line connecting the endpoints, of the quadratic curve specified by the controlpoints stored in the indicated array at the indicated index.

 o getFlatness
public static double getFlatness(double[] coords,
                                 int offset)
Returns the flatness, or maximum distance of a controlpoint from the line connecting the endpoints, of the quadratic curve specified by the controlpoints stored in the indicated array at the indicated index.

 o getFlatnessSq
public double getFlatnessSq()
Returns the square of the flatness, or maximum distance of a controlpoint from the line connecting the endpoints, of this curve.

 o getFlatness
public double getFlatness()
Returns the flatness, or maximum distance of a controlpoint from the line connecting the endpoints, of this curve.

 o subdivide
public void subdivide(QuadCurve2D left,
                      QuadCurve2D right)
Subdivides this quadratic curve and stores the resulting two subdivided curves into the left and right curve parameters. Either or both of the left and right objects may be the same as this object or null.

Parameters:
left - the quadratic curve object for storing for the left or first half of the subdivided curve
right - the quadratic curve object for storing for the right or second half of the subdivided curve
 o subdivide
public static void subdivide(QuadCurve2D src,
                             QuadCurve2D left,
                             QuadCurve2D right)
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 may be the same as the src object or null.

Parameters:
src - the quadratic curve to be subdivided
left - the quadratic curve object for storing for the left or first half of the subdivided curve
right - the quadratic curve object for storing for the right or second half of the subdivided curve
 o subdivide
public static void subdivide(double[] src,
                             int srcoff,
                             double[] left,
                             int leftoff,
                             double[] right,
                             int rightoff)
Subdivides the quadratic curve specified by the 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 may 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 and 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.

Parameters:
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
 o solveQuadratic
public static int solveQuadratic(double[] eqn)
Solve the quadratic whose coefficients are in the eqn array and place the non-complex roots back into the array, returning the number of roots. The quadratic solved is represented by the equation: eqn = {C, B, A}; ax^2 + bx + c = 0 A return value of -1 is used to distinguish a constant equation, which may be always 0 or never 0, from an equation which has no zeroes.

Returns:
the number of roots, or -1 if the equation is a constant
 o contains
public boolean contains(double x,
                        double y)
Test if a given coordinate is inside the boundary of the shape.

 o contains
public boolean contains(Point2D p)
Test if a given Point is inside the boundary of the shape.

 o intersects
public boolean intersects(double x,
                          double y,
                          double w,
                          double h)
Test if the Shape intersects the interior of a given set of rectangular coordinates.

 o intersects
public boolean intersects(Rectangle2D r)
Test if the Shape intersects the interior of a given Rectangle.

 o contains
public boolean contains(double x,
                        double y,
                        double w,
                        double h)
Test if the interior of the Shape entirely contains the given set of rectangular coordinates.

 o contains
public boolean contains(Rectangle2D r)
Test if the interior of the Shape entirely contains the given Rectangle.

 o getBounds
public Rectangle getBounds()
Return the bounding box of the shape.

 o getPathIterator
public PathIterator getPathIterator(AffineTransform at)
Return an iteration object that defines the boundary of the shape.

 o getPathIterator
public PathIterator getPathIterator(AffineTransform at,
                                    double flatness)
Return an iteration object that defines the boundary of the flattened shape.


All Packages  Class Hierarchy  This Package  Previous  Next  Index  

Submit a bug or feature