com.sencha.gxt.chart.client.draw.path
Class CurveTo

java.lang.Object
  extended by com.sencha.gxt.chart.client.draw.path.PathCommand
      extended by com.sencha.gxt.chart.client.draw.path.EndPointCommand
          extended by com.sencha.gxt.chart.client.draw.path.CurveTo

public class CurveTo
extends EndPointCommand

A PathCommand that represents a cubic Bézier segment.


Constructor Summary
CurveTo()
          Creates a curve PathCommand.
CurveTo(CurveTo curveto)
          Creates a copy of the given curve PathCommand.
CurveTo(double x1, double y1, double x2, double y2, double x, double y)
          Creates a curve PathCommand with the given points.
CurveTo(double x1, double y1, double x2, double y2, double x, double y, boolean relative)
          Creates a curve PathCommand with the given points.
 
Method Summary
 CurveTo copy()
          Returns a copy of the path command.
 double getX1()
          Returns the x-coordinate of the beginning control point of the curve.
 double getX2()
          Returns the x-coordinate of the ending control point of the curve
 double getY1()
          Returns the y-coordinate of the beginning control point of the curve.
 double getY2()
          Returns the y-coordinate of the ending control point of the curve
 boolean nearEqual(PathCommand command)
          Determines equality of two commands using rounded values.
 void setX1(double x1)
          Sets the x-coordinate of the beginning control point of the curve.
 void setX2(double x2)
          Sets the x-coordinate of the ending control point of the curve.
 void setY1(double y1)
          Sets the y-coordinate of the beginning control point of the curve.
 void setY2(double y2)
          Sets the y-coordinate of the ending control point of the curve.
 void toAbsolute(PrecisePoint currentPoint, PrecisePoint movePoint)
          Converts the path commands to absolute coordinates using the given frame of reference and the last move.
 CurveTo toCurve(PrecisePoint currentPoint, PrecisePoint movePoint, PrecisePoint curvePoint, PrecisePoint quadraticPoint)
          Converts the PathCommand to a CurveTo command.
 String toString()
           
 
Methods inherited from class com.sencha.gxt.chart.client.draw.path.EndPointCommand
getX, getY, setX, setY
 
Methods inherited from class com.sencha.gxt.chart.client.draw.path.PathCommand
isRelative, setRelative
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CurveTo

public CurveTo()
Creates a curve PathCommand. Defaults to absolute.


CurveTo

public CurveTo(CurveTo curveto)
Creates a copy of the given curve PathCommand.

Parameters:
curveto - the curve to copy

CurveTo

public CurveTo(double x1,
               double y1,
               double x2,
               double y2,
               double x,
               double y)
Creates a curve PathCommand with the given points. Defaults to absolute.

Parameters:
x1 - the x-coordinate of the beginning control point of the curve
y1 - the y-coordinate of the beginning control point of the curve
x2 - the x-coordinate of the ending control point of the curve
y2 - the y-coordinate of the ending control point of the curve
x - the x-coordinate of the end of the segment
y - the y-coordinate of the end of the segment

CurveTo

public CurveTo(double x1,
               double y1,
               double x2,
               double y2,
               double x,
               double y,
               boolean relative)
Creates a curve PathCommand with the given points.

Parameters:
x1 - the x-coordinate of the beginning control point of the curve
y1 - the y-coordinate of the beginning control point of the curve
x2 - the x-coordinate of the ending control point of the curve
y2 - the y-coordinate of the ending control point of the curve
x - the x-coordinate of the end of the segment
y - the y-coordinate of the end of the segment
relative - true if the command is relative
Method Detail

copy

public CurveTo copy()
Description copied from class: PathCommand
Returns a copy of the path command.

Specified by:
copy in class PathCommand
Returns:
a copy of the path command

getX1

public double getX1()
Returns the x-coordinate of the beginning control point of the curve.

Returns:
the x-coordinate of the beginning control point of the curve

getX2

public double getX2()
Returns the x-coordinate of the ending control point of the curve

Returns:
the x-coordinate of the ending control point of the curve

getY1

public double getY1()
Returns the y-coordinate of the beginning control point of the curve.

Returns:
the y-coordinate of the beginning control point of the curve

getY2

public double getY2()
Returns the y-coordinate of the ending control point of the curve

Returns:
the y-coordinate of the ending control point of the curve

nearEqual

public boolean nearEqual(PathCommand command)
Description copied from class: PathCommand
Determines equality of two commands using rounded values.

Specified by:
nearEqual in class PathCommand
Parameters:
command - the command to compare
Returns:
true if equal and false otherwise

setX1

public void setX1(double x1)
Sets the x-coordinate of the beginning control point of the curve.

Parameters:
x1 - the x-coordinate of the beginning control point of the curve

setX2

public void setX2(double x2)
Sets the x-coordinate of the ending control point of the curve.

Parameters:
x2 - the x-coordinate of the ending control point of the curve

setY1

public void setY1(double y1)
Sets the y-coordinate of the beginning control point of the curve.

Parameters:
y1 - the y-coordinate of the beginning control point of the curve

setY2

public void setY2(double y2)
Sets the y-coordinate of the ending control point of the curve.

Parameters:
y2 - the y-coordinate of the ending control point of the curve

toAbsolute

public void toAbsolute(PrecisePoint currentPoint,
                       PrecisePoint movePoint)
Description copied from class: PathCommand
Converts the path commands to absolute coordinates using the given frame of reference and the last move.

Overrides:
toAbsolute in class EndPointCommand
Parameters:
currentPoint - frame of reference
movePoint - last move point

toCurve

public CurveTo toCurve(PrecisePoint currentPoint,
                       PrecisePoint movePoint,
                       PrecisePoint curvePoint,
                       PrecisePoint quadraticPoint)
Description copied from class: PathCommand
Converts the PathCommand to a CurveTo command. If a MoveTo no conversion takes place, but the current move point is updated.

Specified by:
toCurve in class PathCommand
Parameters:
currentPoint - the current point of the path
movePoint - the frame of reference for the path
curvePoint - the frame of reference for the Bézier
quadraticPoint - the beginning of the last quadratic curve
Returns:
the converted command

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2011. All Rights Reserved.