java.awt.geom

Class CubicCurve2D.Float

Enclosing Class:
CubicCurve2D
Implemented Interfaces:
Cloneable, Shape

public static class CubicCurve2D.Float
extends CubicCurve2D

A cubic parametric curve segment specified with float coordinates.

Nested Class Summary

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

CubicCurve2D.Double, CubicCurve2D.Float

Field Summary

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

Constructor Summary

Float()
Constructs and initializes a CubicCurve with coordinates (0, 0, 0, 0, 0, 0).
Float(float x1, float y1, float ctrlx1, float ctrly1, float ctrlx2, float ctrly2, float x2, float 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 CubicCurve2D to the specified double coordinates.
void
setCurve(float x1, float y1, float ctrlx1, float ctrly1, float ctrlx2, float ctrly2, float x2, float y2)
Sets the location of the endpoints and controlpoints of this curve to the specified float 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 float ctrlx1
The X coordinate of the first control point of the cubic curve segment.

ctrlx2

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

ctrly1

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

ctrly2

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

x1

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

x2

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

y1

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

y2

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

Constructor Details

Float

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

View More Examples of Float()
   1: 
   2:             CubicCurve2D.Float graph = new CubicCurve2D.Float();
   3:             graph.setCurve(x1, y1,
   4:                            x1 + xctrl,      y1,
   5:                            x2 + childXctrl,    y2,

View Full Code Here
   1:     private static void drawLeftCurlyBracket(Graphics2D g, double x, double y, double height) {
   2:         CubicCurve2D.Float graph = new CubicCurve2D.Float();
   3:         graph.setCurve(x+getWidth(height), y,
   4:         ...
   5:     private static void drawRightCurlyBracket(Graphics2D g, double x, double y, double height) {
   6:         CubicCurve2D.Float graph = new CubicCurve2D.Float();
   7:         graph.setCurve(x, y,
   8:         ...
   9:     public static void drawLeftStandardBracket(Graphics2D g, double x, double y, double height) {
  10:         CubicCurve2D.Float graph = new CubicCurve2D.Float();
  11:         graph.setCurve(x+getWidth(height), y,

View Full Code Here
   1:     
   2:     protected Line2D       m_line  = new Line2D.Float();
   3:         ...
   4:     protected CubicCurve2D m_cubic = new CubicCurve2D.Float();
   5: 
   6:         ...
   7:     public DefaultEdgeRenderer() {
   8:         m_tmpPoints[0]  = new Point2D.Float();
   9:         m_tmpPoints[1]  = new Point2D.Float();

View Full Code Here
   1:     
   2:     protected Line2D       m_line  = new Line2D.Float();
   3:         ...
   4:     protected CubicCurve2D m_cubic = new CubicCurve2D.Float();
   5: 
   6:         ...
   7:     public EdgeRenderer() {
   8:         m_tmpPoints[0]  = new Point2D.Float();
   9:         m_tmpPoints[1]  = new Point2D.Float();

View Full Code Here

Float

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

View More Examples of Float(float x1,float y1,float ctrlx1,float ctrly1,float ctrlx2,float ctrly2,float x2,float y2)
   1:         g.drawString("CubicCurve2D", 10, 20);
   2:         CubicCurve2D curve = new CubicCurve2D.Float(10, 55, 22.5f, 00, 38.5f, 110, 60, 55);
   3:         g.draw(curve);
   4: 
   5:         g.translate(150, -270);

View Full Code Here
   1:                          break;
   2:                 case 5 : shape = new CubicCurve2D.Float(0.0f,0.0f,w/15,h/2, w/10,h/4,w/5,0.0f);
   3:                          break;
   4:             }

View Full Code Here
   1:                     case PathIterator.SEG_QUADTO:  return new  QuadCurve2D.Float(x1,y1, buffer[0],buffer[1], buffer[2],buffer[3]);
   2:                     case PathIterator.SEG_CUBICTO: return new CubicCurve2D.Float(x1,y1, buffer[0],buffer[1], buffer[2],buffer[3], buffer[4],buffer[5]);
   3:                 }
   4:             }
   5:         }

View Full Code Here
   1:                     case PathIterator.SEG_QUADTO:  return new  QuadCurve2D.Float(x1,y1, buffer[0],buffer[1], buffer[2],buffer[3]);
   2:                     case PathIterator.SEG_CUBICTO: return new CubicCurve2D.Float(x1,y1, buffer[0],buffer[1], buffer[2],buffer[3], buffer[4],buffer[5]);
   3:                 }
   4:             }
   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 start 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 CubicCurve2D to the specified double coordinates.
Overrides:
setCurve in interface CubicCurve2D
Parameters:

setCurve

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