java.awt.geom

Class CubicCurve2D.Double

Enclosing Class:
CubicCurve2D
Implemented Interfaces:
Cloneable, Shape

public static class CubicCurve2D.Double
extends CubicCurve2D

A cubic parametric curve segment specified with double coordinates.

Nested Class Summary

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

CubicCurve2D.Double, CubicCurve2D.Float

Field Summary

double
ctrlx1
The X coordinate of the first control point of the cubic curve segment.
double
ctrlx2
The X coordinate of the second control point of the cubic curve segment.
double
ctrly1
The Y coordinate of the first control point of the cubic curve segment.
double
ctrly2
The Y coordinate of the second control point of the cubic curve segment.
double
x1
The X coordinate of the start point of the cubic curve segment.
double
x2
The X coordinate of the end point of the cubic curve segment.
double
y1
The Y coordinate of the start point of the cubic curve segment.
double
y2
The Y coordinate of the end point of the cubic curve segment.

Constructor Summary

Double()
Constructs and initializes a CubicCurve with coordinates (0, 0, 0, 0, 0, 0).
Double(double x1, double y1, double ctrlx1, double ctrly1, double ctrlx2, double ctrly2, double x2, double y2)
Constructs and initializes a CubicCurve2D from the specified coordinates.

Method Summary

Rectangle2D
getBounds2D()
Returns the bounding box of the shape.
Point2D
getCtrlP1()
Returns the first control point.
Point2D
getCtrlP2()
Returns the second control point.
double
getCtrlX1()
Returns the X coordinate of the first control point in double precision.
double
getCtrlX2()
Returns the X coordinate of the second control point in double precision.
double
getCtrlY1()
Returns the Y coordinate of the first control point in double precision.
double
getCtrlY2()
Returns the Y coordinate of the second 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 ctrlx1, double ctrly1, double ctrlx2, double ctrly2, double x2, double y2)
Sets the location of the endpoints and controlpoints of this curve to the specified double coordinates.

Methods inherited from class java.awt.geom.CubicCurve2D

clone, contains, contains, contains, contains, getBounds, getCtrlP1, getCtrlP2, getCtrlX1, getCtrlX2, getCtrlY1, getCtrlY2, getFlatness, getFlatness, getFlatness, getFlatnessSq, getFlatnessSq, getFlatnessSq, getP1, getP2, getPathIterator, getPathIterator, getX1, getX2, getY1, getY2, intersects, intersects, setCurve, setCurve, setCurve, setCurve, setCurve, solveCubic, solveCubic, 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

ctrlx1

public double ctrlx1
The X coordinate of the first control point of the cubic curve segment.

ctrlx2

public double ctrlx2
The X coordinate of the second control point of the cubic curve segment.

ctrly1

public double ctrly1
The Y coordinate of the first control point of the cubic curve segment.

ctrly2

public double ctrly2
The Y coordinate of the second control point of the cubic curve segment.

x1

public double x1
The X coordinate of the start point of the cubic curve segment.

x2

public double x2
The X coordinate of the end point of the cubic curve segment.

y1

public double y1
The Y coordinate of the start point of the cubic curve segment.

y2

public double y2
The Y coordinate of the end point of the cubic curve segment.

Constructor Details

Double

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

View More Examples of Double()
   1:           {
   2:             CubicCurve2D left = new CubicCurve2D.Double();
   3:         ...
   4:             CubicCurve2D right = new CubicCurve2D.Double();
   5:             curves[numCurves - 1].subdivide(left, right);
   6:             curves[numCurves - 1] = right;
   7:             curves[numCurves] = left;

View Full Code Here
   1:         if (cubicCurve == null) {
   2:             cubicCurve = new CubicCurve2D.Double();
   3:         }
   4:         return cubicCurve;
   5:     }

View Full Code Here
   1:     Rectangle area, startpt, endpt, ctrl1, ctrl2, rect;    
   2:     CubicCurve2D.Double cubic = new CubicCurve2D.Double();
   3:     Point2D.Double start, end, one, two, point;
   4:         ...
   5: 
   6:         start = new Point2D.Double();
   7:         ...
   8:         one = new Point2D.Double();
   9:         two = new Point2D.Double();

View Full Code Here
   1:                     case 0 : obj = new GeneralPath(); break;
   2:                     case 1 : obj = new Rectangle2D.Double(); break;
   3:         ...
   4:                     case 2 : obj = new Ellipse2D.Double(); break;
   5:         ...
   6:                     case 3 : obj = new Arc2D.Double(); break;
   7:                     case 4 : obj = new RoundRectangle2D.Double(); break;

View Full Code Here
   1:                     case 0 : obj = new GeneralPath(); break;
   2:                     case 1 : obj = new Rectangle2D.Double(); break;
   3:         ...
   4:                     case 2 : obj = new Ellipse2D.Double(); break;
   5:         ...
   6:                     case 3 : obj = new Arc2D.Double(); break;
   7:                     case 4 : obj = new RoundRectangle2D.Double(); break;

View Full Code Here

Double

public Double(double x1,
              double y1,
              double ctrlx1,
              double ctrly1,
              double ctrlx2,
              double ctrly2,
              double x2,
              double y2)
Constructs and initializes a CubicCurve2D from the specified coordinates.
Parameters:
Usages and Demos :

View More Examples of Double(double x1,double y1,double ctrlx1,double ctrly1,double ctrlx2,double ctrly2,double x2,double y2)
   1:         g2D.setStroke(curveStroke);
   2:         g2D.draw(new CubicCurve2D.Double(startX,startY,firstX,firstY,secondX,secondY,lineEndX,lineEndY));
   3:             clicks = 1;
   4:     public void setClicks(int i){
   5:         clicks = i;

View Full Code Here
   1:         g2D.setStroke(curveStroke);
   2:         g2D.draw(new CubicCurve2D.Double(startX,startY,firstX,firstY,secondX,secondY,lineEndX,lineEndY));
   3:             clicks = 1;
   4:     public void setClicks(int i){
   5:         clicks = i;

View Full Code Here
   1:       return;
   2:     g_.draw(new CubicCurve2D.Double(x1, y1, x1 + vx1, y1 + vy1, x2 + vx2, y2 + vy2, x2, y2));
   3:     g_.setColor(oldColor);
   4:     g_.setStroke(oldStroke);
   5:   }

View Full Code Here

Method Details

getBounds2D

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

getCtrlP1

public Point2D getCtrlP1()
Returns the first control point.
Overrides:
getCtrlP1 in interface CubicCurve2D
Returns:
a Point2D that is the first control point of the CubicCurve2D.

getCtrlP2

public Point2D getCtrlP2()
Returns the second control point.
Overrides:
getCtrlP2 in interface CubicCurve2D
Returns:
a Point2D that is the second control point of the CubicCurve2D.

getCtrlX1

public double getCtrlX1()
Returns the X coordinate of the first control point in double precision.
Overrides:
getCtrlX1 in interface CubicCurve2D
Returns:
the X coordinate of the first control point of the CubicCurve2D.

getCtrlX2

public double getCtrlX2()
Returns the X coordinate of the second control point in double precision.
Overrides:
getCtrlX2 in interface CubicCurve2D
Returns:
the X coordinate of the second control point of the CubicCurve2D.

getCtrlY1

public double getCtrlY1()
Returns the Y coordinate of the first control point in double precision.
Overrides:
getCtrlY1 in interface CubicCurve2D
Returns:
the Y coordinate of the first control point of the CubicCurve2D.

getCtrlY2

public double getCtrlY2()
Returns the Y coordinate of the second control point in double precision.
Overrides:
getCtrlY2 in interface CubicCurve2D
Returns:
the Y coordinate of the second control point of the CubicCurve2D.

getP1

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

getP2

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

getX1

public double getX1()
Returns the X coordinate of the start point in double precision.
Overrides:
getX1 in interface CubicCurve2D
Returns:
the X coordinate of the first control point of the CubicCurve2D.

getX2

public double getX2()
Returns the X coordinate of the end point in double precision.
Overrides:
getX2 in interface CubicCurve2D
Returns:
the X coordinate of the end point of the CubicCurve2D.

getY1

public double getY1()
Returns the Y coordinate of the start point in double precision.
Overrides:
getY1 in interface CubicCurve2D
Returns:
the Y coordinate of the start point of the CubicCurve2D.

getY2

public double getY2()
Returns the Y coordinate of the end point in double precision.
Overrides:
getY2 in interface CubicCurve2D
Returns:
the Y coordinate of the end point of the CubicCurve2D.

setCurve

public void setCurve(double x1,
                     double y1,
                     double ctrlx1,
                     double ctrly1,
                     double ctrlx2,
                     double ctrly2,
                     double x2,
                     double y2)
Sets the location of the endpoints and controlpoints of this curve to the specified double coordinates.
Overrides:
setCurve in interface CubicCurve2D
Parameters: