java.awt.geom

Class QuadCurve2D.Double

Enclosing Class:
QuadCurve2D
Implemented Interfaces:
Cloneable, Shape

public static class QuadCurve2D.Double
extends QuadCurve2D

A quadratic parametric curve segment specified with double coordinates.

Nested Class Summary

Nested classes/interfaces inherited from class java.awt.geom.QuadCurve2D

QuadCurve2D.Double, QuadCurve2D.Float

Field Summary

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 x 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

Double()
Constructs and initializes a QuadCurve2D with coordinates (0, 0, 0, 0, 0, 0).
Double(double x1, double y1, double ctrlx, double ctrly, double x2, double y2)
Constructs and initializes a QuadCurve2D from the specified coordinates.

Method Summary

Rectangle2D
getBounds2D()
Returns the bounding box of this QuadCurve2D.
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 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(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.

Methods inherited from class java.awt.geom.QuadCurve2D

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 inherited from class java.lang.Object

clone, equals, extends Object> getClass, finalize, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Details

ctrlx

public double ctrlx
The x coordinate of the control point of the quadratic curve segment.

ctrly

public double ctrly
The y coordinate of the control point of the quadratic curve segment.

x1

public double x1
The x coordinate of the start point of the quadratic curve segment.

x2

public double x2
The x coordinate of the end point of the quadratic curve segment.

y1

public double y1
The x coordinate of the start point of the quadratic curve segment.

y2

public double y2
The y coordinate of the end point of the quadratic curve segment.

Constructor Details

Double

public Double()
Constructs and initializes a QuadCurve2D with coordinates (0, 0, 0, 0, 0, 0).
Usages and Demos :

View More Examples of Double()
   1:         if (quadCurve == null) {
   2:             quadCurve = new QuadCurve2D.Double();
   3:         }
   4:         return quadCurve;
   5:     }

View Full Code Here
   1:     Rectangle area, startpt, endpt, ctrl, rect;    
   2:     QuadCurve2D.Double quad = new QuadCurve2D.Double();
   3:     Point2D.Double start, end, control, point;
   4:         ...
   5: 
   6:         start = new Point2D.Double();
   7:         ...
   8:         control = new Point2D.Double();
   9:         end = new Point2D.Double();

View Full Code Here
   1:     
   2:     private final Point2D.Double localhost = new Point2D.Double();
   3:     
   4:         ...
   5:     private final Ellipse2D.Double ellipse = new Ellipse2D.Double();
   6:     
   7:         ...
   8:     private final Ellipse2D.Double dot = new Ellipse2D.Double();
   9:     

View Full Code Here
   1: 
   2:     QuadCurve2D left = new QuadCurve2D.Double();
   3:         ...
   4:     QuadCurve2D right = new QuadCurve2D.Double();
   5:     QuadCurve2D orig = new QuadCurve2D.Double(x0, y0, x1, y1, x2, y2);
   6:     orig.subdivide(left, right);

View Full Code Here
   1: 
   2:   private QuadCurve2D spline_ = new QuadCurve2D.Double();
   3: 
   4:   private Map<String,Object> pdest_=null;

View Full Code Here

Double

public Double(double x1,
              double y1,
              double ctrlx,
              double ctrly,
              double x2,
              double y2)
Constructs and initializes a QuadCurve2D from the specified coordinates.
Parameters:
Usages and Demos :

View More Examples of Double(double x1,double y1,double ctrlx,double ctrly,double x2,double y2)
   1:     QuadCurve2D right = new QuadCurve2D.Double();
   2:     QuadCurve2D orig = new QuadCurve2D.Double(x0, y0, x1, y1, x2, y2);
   3:     orig.subdivide(left, right);
   4: 
   5:     QuadSegment s1 = offsetSubdivided(left, true);

View Full Code Here
   1:             QuadCurve2D.Double curve = (QuadCurve2D.Double) shape;
   2:             curve = new QuadCurve2D.Double(curve.x1 + translate, curve.y1, curve.ctrlx + translate, curve.ctrly, curve.x2 + translate, curve.y2);
   3:             graphics.draw(curve);
   4:         ...
   5: 
   6:         QuadCurve2D.Double curve = new QuadCurve2D.Double(x, y, controlx, controly, xx, yy);
   7:         shapes.add(curve);
   8:     }

View Full Code Here
   1: 
   2:         QuadCurve2D curve = new QuadCurve2D.Double(x1, y1, xc, yc, x2, y2);
   3:         g.draw(curve);
   4:       }
   5:     long endTime = System.currentTimeMillis();

View Full Code Here

Method Details

getBounds2D

public Rectangle2D getBounds2D()
Returns the bounding box of this QuadCurve2D.
Specified by:
getBounds2D in interface Shape
Returns:
a Rectangle2D that is the bounding box of the shape of this QuadCurve2D.

getCtrlPt

public Point2D getCtrlPt()
Returns the control point.
Overrides:
getCtrlPt in interface QuadCurve2D
Returns:
a Point2D object that is the control point of this QuadCurve2D.

getCtrlX

public double getCtrlX()
Returns the x coordinate of the control point in double precision.
Overrides:
getCtrlX in interface QuadCurve2D
Returns:
the x coordinate of the control point.

getCtrlY

public double getCtrlY()
Returns the y coordinate of the control point in double precision.
Overrides:
getCtrlY in interface QuadCurve2D
Returns:
the y coordiante of the control point.

getP1

public Point2D getP1()
Returns the start point.
Overrides:
getP1 in interface QuadCurve2D
Returns:
a Point2D that is the starting point of this QuadCurve2D.

getP2

public Point2D getP2()
Returns the end point.
Overrides:
getP2 in interface QuadCurve2D
Returns:
a Point2D that is the end point of this QuadCurve2D.

getX1

public double getX1()
Returns the x coordinate of the start point in double precision.
Overrides:
getX1 in interface QuadCurve2D
Returns:
the x coordinate of the starting point.

getX2

public double getX2()
Returns the x coordinate of the end point in double precision.
Overrides:
getX2 in interface QuadCurve2D
Returns:
the x coordiante of the end point.

getY1

public double getY1()
Returns the y coordinate of the start point in double precision.
Overrides:
getY1 in interface QuadCurve2D
Returns:
the y coordiante of the starting point.

getY2

public double getY2()
Returns the y coordinate of the end point in double precision.
Overrides:
getY2 in interface QuadCurve2D
Returns:
the y coordiante of the end point.

setCurve

public 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.
Overrides:
setCurve in interface QuadCurve2D
Parameters: