Save This Page
Home » openjdk-7 » java » awt » geom » [javadoc | source]
java.awt.geom
abstract public class: QuadCurve2D [javadoc | source]
java.lang.Object
   java.awt.geom.QuadCurve2D

All Implemented Interfaces:
    Shape, Cloneable

Direct Known Subclasses:
    Float, Double

The QuadCurve2D class defines a quadratic parametric curve segment in {@code (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 Class Summary:
public static class  QuadCurve2D.Float  A quadratic parametric curve segment specified with {@code float} coordinates. 
public static class  QuadCurve2D.Double  A quadratic parametric curve segment specified with {@code double} coordinates. 
Constructor:
 protected QuadCurve2D() 
Method from java.awt.geom.QuadCurve2D Summary:
clone,   contains,   contains,   contains,   contains,   getBounds,   getCtrlPt,   getCtrlX,   getCtrlY,   getFlatness,   getFlatness,   getFlatness,   getFlatnessSq,   getFlatnessSq,   getFlatnessSq,   getP1,   getP2,   getPathIterator,   getPathIterator,   getX1,   getX2,   getY1,   getY2,   intersects,   intersects,   setCurve,   setCurve,   setCurve,   setCurve,   setCurve,   solveQuadratic,   solveQuadratic,   subdivide,   subdivide,   subdivide
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from java.awt.geom.QuadCurve2D Detail:
 public Object clone() 
    Creates a new object of the same class and with the same contents as this object.
 public boolean contains(Point2D p) 
    {@inheritDoc}
 public boolean contains(Rectangle2D r) 
    {@inheritDoc}
 public boolean contains(double x,
    double y) 
    {@inheritDoc}
 public boolean contains(double x,
    double y,
    double w,
    double h) 
    {@inheritDoc}
 public Rectangle getBounds() 
    {@inheritDoc}
 abstract public Point2D getCtrlPt()
    Returns the control point.
 abstract public double getCtrlX()
    Returns the X coordinate of the control point in double precision.
 abstract public double getCtrlY()
    Returns the Y coordinate of the control point in double precision.
 public double getFlatness() 
    Returns the flatness, or maximum distance of a control point from the line connecting the end points, of this QuadCurve2D.
 public static double getFlatness(double[] coords,
    int offset) 
    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.
 public static double getFlatness(double x1,
    double y1,
    double ctrlx,
    double ctrly,
    double x2,
    double y2) 
    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.
 public 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.
 public static double getFlatnessSq(double[] coords,
    int offset) 
    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.
 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 control point from the line connecting the end points, of the quadratic curve specified by the indicated control points.
 abstract public Point2D getP1()
    Returns the start point.
 abstract public Point2D getP2()
    Returns the end point.
 public PathIterator getPathIterator(AffineTransform at) 
    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.
 public PathIterator getPathIterator(AffineTransform at,
    double flatness) 
    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.
 abstract public double getX1()
    Returns the X coordinate of the start point in double in precision.
 abstract public double getX2()
    Returns the X coordinate of the end point in double precision.
 abstract public double getY1()
    Returns the Y coordinate of the start point in double precision.
 abstract public double getY2()
    Returns the Y coordinate of the end point in double precision.
 public boolean intersects(Rectangle2D r) 
    {@inheritDoc}
 public boolean intersects(double x,
    double y,
    double w,
    double h) 
    {@inheritDoc}
 public  void setCurve(QuadCurve2D c) 
    Sets the location of the end points and control point of this QuadCurve2D to the same as those in the specified QuadCurve2D.
 public  void setCurve(double[] coords,
    int offset) 
    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.
 public  void setCurve(Point2D[] pts,
    int offset) 
    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.
 public  void setCurve(Point2D p1,
    Point2D cp,
    Point2D p2) 
    Sets the location of the end points and control point of this QuadCurve2D to the specified Point2D coordinates.
 abstract 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.
 public static int solveQuadratic(double[] eqn) 
    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 = 0
    
    A 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.
 public static int solveQuadratic(double[] eqn,
    double[] res) 
    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 = 0
    
    A 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.
 public  void subdivide(QuadCurve2D left,
    QuadCurve2D right) 
    Subdivides 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.
 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 can be the same as the src object or null.
 public static  void subdivide(double[] src,
    int srcoff,
    double[] left,
    int leftoff,
    double[] right,
    int rightoff) 
    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.