Class QuadCurve2D.Float

java.lang.Object
java.awt.geom.QuadCurve2D
java.awt.geom.QuadCurve2D.Float
All Implemented Interfaces:
Shape, Serializable, Cloneable
Enclosing class:
QuadCurve2D

public static class QuadCurve2D.Float extends QuadCurve2D implements Serializable
A quadratic parametric curve segment specified with float 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 
    A quadratic parametric curve segment specified with double coordinates.
    static class 
    A quadratic parametric curve segment specified with float coordinates.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    float
    The X coordinate of the control point of the quadratic curve segment.
    float
    The Y coordinate of the control point of the quadratic curve segment.
    float
    The X coordinate of the start point of the quadratic curve segment.
    float
    The X coordinate of the end point of the quadratic curve segment.
    float
    The Y coordinate of the start point of the quadratic curve segment.
    float
    The Y coordinate of the end point of the quadratic curve segment.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructs and initializes a QuadCurve2D with coordinates (0, 0, 0, 0, 0, 0).
    Float(float x1, float y1, float ctrlx, float ctrly, float x2, float y2)
    Constructs and initializes a QuadCurve2D from the specified float coordinates.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the control point.
    double
    Returns the X coordinate of the control point in double precision.
    double
    Returns the Y coordinate of the control point in double precision.
    Returns the start point.
    Returns the end point.
    double
    Returns the X coordinate of the start point in double in precision.
    double
    Returns the X coordinate of the end point in double precision.
    double
    Returns the Y coordinate of the start point in double precision.
    double
    Returns the Y coordinate of the end point in double precision.
    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.
    void
    setCurve(float x1, float y1, float ctrlx, float ctrly, float x2, float y2)
    Sets the location of the end points and control point of this curve to the specified float 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
    Creates a new object of the same class and with the same contents as this object.
    boolean
    contains(double x, double y)
    Tests if the specified coordinates are inside the boundary of the Shape, as described by the definition of insideness.
    boolean
    contains(double x, double y, double w, double h)
    Tests if the interior of the Shape entirely contains the specified rectangular area.
    boolean
    Tests if a specified Point2D is inside the boundary of the Shape, as described by the definition of insideness.
    boolean
    Tests if the interior of the Shape entirely contains the specified Rectangle2D.
    Returns an integer Rectangle that completely encloses the Shape.
    Returns a high precision and more accurate bounding box of the Shape than the getBounds method.
    double
    Returns the flatness, or maximum distance of a control point from the line connecting the end points, of this QuadCurve2D.
    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.
    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.
    double
    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(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.
    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.
    Returns an iteration object that defines the boundary of the shape of this QuadCurve2D.
    getPathIterator(AffineTransform at, double flatness)
    Returns an iteration object that defines the boundary of the flattened shape of this QuadCurve2D.
    boolean
    intersects(double x, double y, double w, double h)
    Tests if the interior of the Shape intersects the interior of a specified rectangular area.
    boolean
    Tests if the interior of the Shape intersects the interior of a specified Rectangle2D.
    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.
    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.
    void
    Sets the location of the end points and control point of this QuadCurve2D to the specified Point2D coordinates.
    void
    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(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.
    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.
    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.
    void
    Subdivides this QuadCurve2D and stores the resulting two subdivided curves into the left and right curve parameters.
    static void
    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
    Indicates whether some other object is "equal to" this one.
    protected void
    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<?>
    Returns the runtime class of this Object.
    int
    Returns a hash code value for this object.
    final void
    Wakes up a single thread that is waiting on this object's monitor.
    final void
    Wakes up all threads that are waiting on this object's monitor.
    Returns a string representation of the object.
    final void
    Causes the current thread to wait until it is awakened, typically by being notified or interrupted.
    final void
    wait(long timeoutMillis)
    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(long timeoutMillis, int nanos)
    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 float x1
      The X coordinate of the start point of the quadratic curve segment.
      Since:
      1.2
    • y1

      public float y1
      The Y coordinate of the start point of the quadratic curve segment.
      Since:
      1.2
    • ctrlx

      public float ctrlx
      The X coordinate of the control point of the quadratic curve segment.
      Since:
      1.2
    • ctrly

      public float ctrly
      The Y coordinate of the control point of the quadratic curve segment.
      Since:
      1.2
    • x2

      public float x2
      The X coordinate of the end point of the quadratic curve segment.
      Since:
      1.2
    • y2

      public float y2
      The Y coordinate of the end point of the quadratic curve segment.
      Since:
      1.2
  • Constructor Details

    • Float

      public Float()
      Constructs and initializes a QuadCurve2D with coordinates (0, 0, 0, 0, 0, 0).
      Since:
      1.2
    • Float

      public Float(float x1, float y1, float ctrlx, float ctrly, float x2, float y2)
      Constructs and initializes a QuadCurve2D from the specified float 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:
      getX1 in class QuadCurve2D
      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:
      getY1 in class QuadCurve2D
      Returns:
      the Y coordinate of the start point.
      Since:
      1.2
    • getP1

      public Point2D getP1()
      Returns the start point.
      Specified by:
      getP1 in class QuadCurve2D
      Returns:
      a Point2D that is the start point of this QuadCurve2D.
      Since:
      1.2
    • getCtrlX

      public double getCtrlX()
      Returns the X coordinate of the control point in double precision.
      Specified by:
      getCtrlX in class QuadCurve2D
      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:
      getCtrlY in class QuadCurve2D
      Returns:
      the Y coordinate of the control point.
      Since:
      1.2
    • getCtrlPt

      public Point2D getCtrlPt()
      Returns the control point.
      Specified by:
      getCtrlPt in class QuadCurve2D
      Returns:
      a Point2D that is the control point of this Point2D.
      Since:
      1.2
    • getX2

      public double getX2()
      Returns the X coordinate of the end point in double precision.
      Specified by:
      getX2 in class QuadCurve2D
      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:
      getY2 in class QuadCurve2D
      Returns:
      the Y coordinate of the end point.
      Since:
      1.2
    • getP2

      public Point2D getP2()
      Returns the end point.
      Specified by:
      getP2 in class QuadCurve2D
      Returns:
      a Point object that is the end point of this Point2D.
      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:
      setCurve in class QuadCurve2D
      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
    • setCurve

      public void setCurve(float x1, float y1, float ctrlx, float ctrly, float x2, float y2)
      Sets the location of the end points and control point of this curve to the specified float 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