Java Doc for CubicCurve2D.java in  » 6.0-JDK-Core » AWT » java » awt » geom » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Home
Java Source Code / Java Documentation
1.6.0 JDK Core
2.6.0 JDK Modules
3.6.0 JDK Modules com.sun
4.6.0 JDK Modules com.sun.java
5.6.0 JDK Modules sun
6.6.0 JDK Platform
7.Ajax
8.Apache Harmony Java SE
9.Aspect oriented
10.Authentication Authorization
11.Blogger System
12.Build
13.Byte Code
14.Cache
15.Chart
16.Chat
17.Code Analyzer
18.Collaboration
19.Content Management System
20.Database Client
21.Database DBMS
22.Database JDBC Connection Pool
23.Database ORM
24.Development
25.EJB Server
26.ERP CRM Financial
27.ESB
28.Forum
29.Game
30.GIS
31.Graphic 3D
32.Graphic Library
33.Groupware
34.HTML Parser
35.IDE
36.IDE Eclipse
37.IDE Netbeans
38.Installer
39.Internationalization Localization
40.Inversion of Control
41.Issue Tracking
42.J2EE
43.J2ME
44.JBoss
45.JMS
46.JMX
47.Library
48.Mail Clients
49.Music
50.Net
51.Parser
52.PDF
53.Portal
54.Profiler
55.Project Management
56.Report
57.RSS RDF
58.Rule Engine
59.Science
60.Scripting
61.Search Engine
62.Security
63.Sevlet Container
64.Source Control
65.Swing Library
66.Template Engine
67.Test Coverage
68.Testing
69.UML
70.Web Crawler
71.Web Framework
72.Web Mail
73.Web Server
74.Web Services
75.Web Services apache cxf 2.2.6
76.Web Services AXIS2
77.Wiki Engine
78.Workflow Engines
79.XML
80.XML UI
Java Source Code / Java Documentation » 6.0 JDK Core » AWT » java.awt.geom 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   java.awt.geom.CubicCurve2D

CubicCurve2D
abstract public class CubicCurve2D implements Shape,Cloneable(Code)
The CubicCurve2D class defines a cubic parametric curve segment in (x,y) coordinate space.

This class is only the abstract superclass for all objects which store a 2D cubic curve segment. The actual storage representation of the coordinates is left to the subclass.
version:
   1.42, 05/05/07
author:
   Jim Graham
since:
   1.2


Inner Class :public static class Float extends CubicCurve2D implements Serializable
Inner Class :public static class Double extends CubicCurve2D implements Serializable


Constructor Summary
protected  CubicCurve2D()
     This is an abstract class that cannot be instantiated directly.

Method Summary
public  Objectclone()
     Creates a new object of the same class as this object.
public  booleancontains(double x, double y)
    
public  booleancontains(Point2D p)
    
public  booleancontains(double x, double y, double w, double h)
    
public  booleancontains(Rectangle2D r)
    
public  RectanglegetBounds()
    
abstract public  Point2DgetCtrlP1()
     Returns the first control point.
abstract public  Point2DgetCtrlP2()
     Returns the second control point.
abstract public  doublegetCtrlX1()
     Returns the X coordinate of the first control point in double precision.
abstract public  doublegetCtrlX2()
     Returns the X coordinate of the second control point in double precision.
abstract public  doublegetCtrlY1()
     Returns the Y coordinate of the first control point in double precision.
abstract public  doublegetCtrlY2()
     Returns the Y coordinate of the second control point in double precision.
public static  doublegetFlatness(double x1, double y1, double ctrlx1, double ctrly1, double ctrlx2, double ctrly2, double x2, double y2)
     Returns the flatness of the cubic curve specified by the indicated control points.
public static  doublegetFlatness(double coords, int offset)
     Returns the flatness of the cubic curve specified by the control points stored in the indicated array at the indicated index.
public  doublegetFlatness()
     Returns the flatness of this curve.
public static  doublegetFlatnessSq(double x1, double y1, double ctrlx1, double ctrly1, double ctrlx2, double ctrly2, double x2, double y2)
     Returns the square of the flatness of the cubic curve specified by the indicated control points.
public static  doublegetFlatnessSq(double coords, int offset)
     Returns the square of the flatness of the cubic curve specified by the control points stored in the indicated array at the indicated index.
public  doublegetFlatnessSq()
     Returns the square of the flatness of this curve.
abstract public  Point2DgetP1()
     Returns the start point.
abstract public  Point2DgetP2()
     Returns the end point.
public  PathIteratorgetPathIterator(AffineTransform at)
     Returns an iteration object that defines the boundary of the shape.
public  PathIteratorgetPathIterator(AffineTransform at, double flatness)
     Return an iteration object that defines the boundary of the flattened shape.
abstract public  doublegetX1()
     Returns the X coordinate of the start point in double precision.
abstract public  doublegetX2()
     Returns the X coordinate of the end point in double precision.
abstract public  doublegetY1()
     Returns the Y coordinate of the start point in double precision.
abstract public  doublegetY2()
     Returns the Y coordinate of the end point in double precision.
public  booleanintersects(double x, double y, double w, double h)
    
public  booleanintersects(Rectangle2D r)
    
abstract public  voidsetCurve(double x1, double y1, double ctrlx1, double ctrly1, double ctrlx2, double ctrly2, double x2, double y2)
     Sets the location of the end points and control points of this curve to the specified double coordinates.
public  voidsetCurve(double[] coords, int offset)
     Sets the location of the end points and control points of this curve to the double coordinates at the specified offset in the specified array.
public  voidsetCurve(Point2D p1, Point2D cp1, Point2D cp2, Point2D p2)
     Sets the location of the end points and control points of this curve to the specified Point2D coordinates.
public  voidsetCurve(Point2D[] pts, int offset)
     Sets the location of the end points and control points of this curve to the coordinates of the Point2D objects at the specified offset in the specified array.
public  voidsetCurve(CubicCurve2D c)
     Sets the location of the end points and control points of this curve to the same as those in the specified CubicCurve2D.
public static  intsolveCubic(double eqn)
     Solves the cubic whose coefficients are in the eqn array and places the non-complex roots back into the same array, returning the number of roots.
public static  intsolveCubic(double eqn, double res)
     Solve the cubic whose coefficients are in the eqn array and place the non-complex roots into the res array, returning the number of roots.
public  voidsubdivide(CubicCurve2D left, CubicCurve2D right)
     Subdivides this cubic curve and stores the resulting two subdivided curves into the left and right curve parameters.
public static  voidsubdivide(CubicCurve2D src, CubicCurve2D left, CubicCurve2D right)
     Subdivides the cubic curve specified by the src parameter and stores the resulting two subdivided curves into the left and right curve parameters.
public static  voidsubdivide(double src, int srcoff, double left, int leftoff, double right, int rightoff)
     Subdivides the cubic curve specified by the coordinates stored in the src array at indices srcoff through (srcoff + 7) 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 may be null or a reference to the same array 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.


Constructor Detail
CubicCurve2D
protected CubicCurve2D()(Code)
This is an abstract class that cannot be instantiated directly. Type-specific implementation subclasses are available for instantiation and provide a number of formats for storing the information necessary to satisfy the various accessor methods below.
See Also:   java.awt.geom.CubicCurve2D.Float
See Also:   java.awt.geom.CubicCurve2D.Double
since:
   1.2




Method Detail
clone
public Object clone()(Code)
Creates a new object of the same class as this object. a clone of this instance.
exception:
  OutOfMemoryError - if there is not enough memory.
See Also:   java.lang.Cloneable
since:
   1.2



contains
public boolean contains(double x, double y)(Code)

since:
   1.2



contains
public boolean contains(Point2D p)(Code)

since:
   1.2



contains
public boolean contains(double x, double y, double w, double h)(Code)

since:
   1.2



contains
public boolean contains(Rectangle2D r)(Code)

since:
   1.2



getBounds
public Rectangle getBounds()(Code)

since:
   1.2



getCtrlP1
abstract public Point2D getCtrlP1()(Code)
Returns the first control point. a Point2D that is the first control point of the CubicCurve2D .
since:
   1.2



getCtrlP2
abstract public Point2D getCtrlP2()(Code)
Returns the second control point. a Point2D that is the second control point of the CubicCurve2D .
since:
   1.2



getCtrlX1
abstract public double getCtrlX1()(Code)
Returns the X coordinate of the first control point in double precision. the X coordinate of the first control point of the CubicCurve2D .
since:
   1.2



getCtrlX2
abstract public double getCtrlX2()(Code)
Returns the X coordinate of the second control point in double precision. the X coordinate of the second control point of the CubicCurve2D .
since:
   1.2



getCtrlY1
abstract public double getCtrlY1()(Code)
Returns the Y coordinate of the first control point in double precision. the Y coordinate of the first control point of the CubicCurve2D .
since:
   1.2



getCtrlY2
abstract public double getCtrlY2()(Code)
Returns the Y coordinate of the second control point in double precision. the Y coordinate of the second control point of the CubicCurve2D .
since:
   1.2



getFlatness
public static double getFlatness(double x1, double y1, double ctrlx1, double ctrly1, double ctrlx2, double ctrly2, double x2, double y2)(Code)
Returns the flatness of the cubic curve specified by the indicated control points. The flatness is the maximum distance of a control point from the line connecting the end points.
Parameters:
  x1 - the X coordinate that specifies the start pointof a CubicCurve2D
Parameters:
  y1 - the Y coordinate that specifies the start pointof a CubicCurve2D
Parameters:
  ctrlx1 - the X coordinate that specifies the first control pointof a CubicCurve2D
Parameters:
  ctrly1 - the Y coordinate that specifies the first control pointof a CubicCurve2D
Parameters:
  ctrlx2 - the X coordinate that specifies the second control pointof a CubicCurve2D
Parameters:
  ctrly2 - the Y coordinate that specifies the second control pointof a CubicCurve2D
Parameters:
  x2 - the X coordinate that specifies the end pointof a CubicCurve2D
Parameters:
  y2 - the Y coordinate that specifies the end pointof a CubicCurve2D the flatness of the CubicCurve2D represented by the specified coordinates.
since:
   1.2



getFlatness
public static double getFlatness(double coords, int offset)(Code)
Returns the flatness of the cubic curve specified by the control points stored in the indicated array at the indicated index. The flatness is the maximum distance of a control point from the line connecting the end points.
Parameters:
  coords - an array containing coordinates
Parameters:
  offset - the index of coords from which to begin getting the end points and control points of the curve the flatness of the CubicCurve2Dspecified by the coordinates in coords atthe specified offset.
since:
   1.2



getFlatness
public double getFlatness()(Code)
Returns the flatness of this curve. The flatness is the maximum distance of a control point from the line connecting the end points. the flatness of this curve.
since:
   1.2



getFlatnessSq
public static double getFlatnessSq(double x1, double y1, double ctrlx1, double ctrly1, double ctrlx2, double ctrly2, double x2, double y2)(Code)
Returns the square of the flatness of the cubic curve specified by the indicated control points. The flatness is the maximum distance of a control point from the line connecting the end points.
Parameters:
  x1 - the X coordinate that specifies the start pointof a CubicCurve2D
Parameters:
  y1 - the Y coordinate that specifies the start pointof a CubicCurve2D
Parameters:
  ctrlx1 - the X coordinate that specifies the first control pointof a CubicCurve2D
Parameters:
  ctrly1 - the Y coordinate that specifies the first control pointof a CubicCurve2D
Parameters:
  ctrlx2 - the X coordinate that specifies the second control pointof a CubicCurve2D
Parameters:
  ctrly2 - the Y coordinate that specifies the second control pointof a CubicCurve2D
Parameters:
  x2 - the X coordinate that specifies the end pointof a CubicCurve2D
Parameters:
  y2 - the Y coordinate that specifies the end pointof a CubicCurve2D the square of the flatness of the CubicCurve2D represented by the specified coordinates.
since:
   1.2



getFlatnessSq
public static double getFlatnessSq(double coords, int offset)(Code)
Returns the square of the flatness of the cubic curve specified by the control points stored in the indicated array at the indicated index. The flatness is the maximum distance of a control point from the line connecting the end points.
Parameters:
  coords - an array containing coordinates
Parameters:
  offset - the index of coords from which to begin getting the end points and control points of the curve the square of the flatness of the CubicCurve2Dspecified by the coordinates in coords atthe specified offset.
since:
   1.2



getFlatnessSq
public double getFlatnessSq()(Code)
Returns the square of the flatness of this curve. The flatness is the maximum distance of a control point from the line connecting the end points. the square of the flatness of this curve.
since:
   1.2



getP1
abstract public Point2D getP1()(Code)
Returns the start point. a Point2D that is the start point of the CubicCurve2D .
since:
   1.2



getP2
abstract public Point2D getP2()(Code)
Returns the end point. a Point2D that is the end point of the CubicCurve2D .
since:
   1.2



getPathIterator
public PathIterator getPathIterator(AffineTransform at)(Code)
Returns an iteration object that defines the boundary of the shape. The iterator for this class is not multi-threaded safe, which means that this CubicCurve2D class does not guarantee that modifications to the geometry of this CubicCurve2D object do not affect any iterations of that geometry that are already in process.
Parameters:
  at - an optional AffineTransform to be applied to thecoordinates as they are returned in the iteration, or nullif untransformed coordinates are desired the PathIterator object that returns thegeometry of the outline of this CubicCurve2D, onesegment at a time.
since:
   1.2



getPathIterator
public PathIterator getPathIterator(AffineTransform at, double flatness)(Code)
Return an iteration object that defines the boundary of the flattened shape. The iterator for this class is not multi-threaded safe, which means that this CubicCurve2D class does not guarantee that modifications to the geometry of this CubicCurve2D object do not affect any iterations of that geometry that are already in process.
Parameters:
  at - an optional AffineTransform to be applied to thecoordinates as they are returned in the iteration, or nullif untransformed coordinates are desired
Parameters:
  flatness - the maximum amount that the control pointsfor a given curve can vary from colinear before a subdividedcurve is replaced by a straight line connecting the end points the PathIterator object that returns thegeometry of the outline of this CubicCurve2D,one segment at a time.
since:
   1.2



getX1
abstract public double getX1()(Code)
Returns the X coordinate of the start point in double precision. the X coordinate of the start point of the CubicCurve2D .
since:
   1.2



getX2
abstract public double getX2()(Code)
Returns the X coordinate of the end point in double precision. the X coordinate of the end point of the CubicCurve2D .
since:
   1.2



getY1
abstract public double getY1()(Code)
Returns the Y coordinate of the start point in double precision. the Y coordinate of the start point of the CubicCurve2D .
since:
   1.2



getY2
abstract public double getY2()(Code)
Returns the Y coordinate of the end point in double precision. the Y coordinate of the end point of the CubicCurve2D .
since:
   1.2



intersects
public boolean intersects(double x, double y, double w, double h)(Code)

since:
   1.2



intersects
public boolean intersects(Rectangle2D r)(Code)

since:
   1.2



setCurve
abstract public void setCurve(double x1, double y1, double ctrlx1, double ctrly1, double ctrlx2, double ctrly2, double x2, double y2)(Code)
Sets the location of the end points and control points of this curve to the specified double coordinates.
Parameters:
  x1 - the X coordinate used to set the start pointof this CubicCurve2D
Parameters:
  y1 - the Y coordinate used to set the start pointof this CubicCurve2D
Parameters:
  ctrlx1 - the X coordinate used to set the first control pointof this CubicCurve2D
Parameters:
  ctrly1 - the Y coordinate used to set the first control pointof this CubicCurve2D
Parameters:
  ctrlx2 - the X coordinate used to set the second control pointof this CubicCurve2D
Parameters:
  ctrly2 - the Y coordinate used to set the second control pointof this CubicCurve2D
Parameters:
  x2 - the X coordinate used to set the end pointof this CubicCurve2D
Parameters:
  y2 - the Y coordinate used to set the end pointof this CubicCurve2D
since:
   1.2



setCurve
public void setCurve(double[] coords, int offset)(Code)
Sets the location of the end points and control points of this curve to the double coordinates at the specified offset in the specified array.
Parameters:
  coords - a double array containing coordinates
Parameters:
  offset - the index of coords from which to begin setting the end points and control points of this curveto the coordinates contained in coords
since:
   1.2



setCurve
public void setCurve(Point2D p1, Point2D cp1, Point2D cp2, Point2D p2)(Code)
Sets the location of the end points and control points of this curve to the specified Point2D coordinates.
Parameters:
  p1 - the first specified Point2D used to set thestart point of this curve
Parameters:
  cp1 - the second specified Point2D used to set thefirst control point of this curve
Parameters:
  cp2 - the third specified Point2D used to set thesecond control point of this curve
Parameters:
  p2 - the fourth specified Point2D used to set theend point of this curve
since:
   1.2



setCurve
public void setCurve(Point2D[] pts, int offset)(Code)
Sets the location of the end points and control points of this curve to the coordinates of the Point2D objects at the specified offset in the specified array.
Parameters:
  pts - an array of Point2D objects
Parameters:
  offset - the index of pts from which to begin settingthe end points and control points of this curve to the points contained in pts
since:
   1.2



setCurve
public void setCurve(CubicCurve2D c)(Code)
Sets the location of the end points and control points of this curve to the same as those in the specified CubicCurve2D.
Parameters:
  c - the specified CubicCurve2D
since:
   1.2



solveCubic
public static int solveCubic(double eqn)(Code)
Solves the cubic whose coefficients are in the eqn array and places the non-complex roots back into the same array, returning the number of roots. The solved cubic is represented by the equation:
 eqn = {c, b, a, d}
 dx^3 + ax^2 + bx + c = 0
 
A return value of -1 is used to distinguish a constant equation that might be always 0 or never 0 from an equation that has no zeroes.
Parameters:
  eqn - an array containing coefficients for a cubic the number of roots, or -1 if the equation is a constant.
since:
   1.2



solveCubic
public static int solveCubic(double eqn, double res)(Code)
Solve the cubic whose coefficients are in the eqn array and place the non-complex roots into the res array, returning the number of roots. The cubic solved is represented by the equation: eqn = {c, b, a, d} dx^3 + ax^2 + bx + c = 0 A return value of -1 is used to distinguish a constant equation, which may be always 0 or never 0, from an equation which has no zeroes.
Parameters:
  eqn - the specified array of coefficients to use to solvethe cubic equation
Parameters:
  res - the array that contains the non-complex roots resulting from the solution of the cubic equation the number of roots, or -1 if the equation is a constant
since:
   1.3



subdivide
public void subdivide(CubicCurve2D left, CubicCurve2D right)(Code)
Subdivides this cubic curve and stores the resulting two subdivided curves into the left and right curve parameters. Either or both of the left and right objects may be the same as this object or null.
Parameters:
  left - the cubic curve object for storing for the left orfirst half of the subdivided curve
Parameters:
  right - the cubic curve object for storing for the right orsecond half of the subdivided curve
since:
   1.2



subdivide
public static void subdivide(CubicCurve2D src, CubicCurve2D left, CubicCurve2D right)(Code)
Subdivides the cubic 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 may be the same as the src object or null.
Parameters:
  src - the cubic curve to be subdivided
Parameters:
  left - the cubic curve object for storing the left orfirst half of the subdivided curve
Parameters:
  right - the cubic curve object for storing the right orsecond half of the subdivided curve
since:
   1.2



subdivide
public static void subdivide(double src, int srcoff, double left, int leftoff, double right, int rightoff)(Code)
Subdivides the cubic curve specified by the coordinates stored in the src array at indices srcoff through (srcoff + 7) 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 may be null or a reference to the same array 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 as rightoff equals (leftoff + 6), in order to avoid allocating extra storage for this common point.
Parameters:
  src - the array holding the coordinates for the source curve
Parameters:
  srcoff - the offset into the array of the beginning of thethe 6 source coordinates
Parameters:
  left - the array for storing the coordinates for the firsthalf of the subdivided curve
Parameters:
  leftoff - the offset into the array of the beginning of thethe 6 left coordinates
Parameters:
  right - the array for storing the coordinates for the secondhalf of the subdivided curve
Parameters:
  rightoff - the offset into the array of the beginning of thethe 6 right coordinates
since:
   1.2



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.