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

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.CurveToQuadraticSmooth

public class CurveToQuadraticSmooth
extends EndPointCommand

A PathCommand that represents a shorthand quadratic Bézier segment. The control point is assumed to be the reflection of the control point on the previous command relative to the current point.


Constructor Summary
CurveToQuadraticSmooth()
          Creates a shorthand quadratic curve PathCommand with the given points.
CurveToQuadraticSmooth(CurveToQuadraticSmooth smoothQuadratic)
          Creates a copy of the given shorthand quadratic curve PathCommand with the given points.
CurveToQuadraticSmooth(double x, double y)
          Creates a shorthand quadratic curve PathCommand with the given points.
CurveToQuadraticSmooth(double x, double y, boolean relative)
          Creates a shorthand quadratic curve PathCommand with the given points.
 
Method Summary
 CurveToQuadraticSmooth copy()
          Returns a copy of the path command.
 boolean nearEqual(PathCommand command)
          Determines equality of two commands using rounded values.
 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, toAbsolute
 
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

CurveToQuadraticSmooth

public CurveToQuadraticSmooth()
Creates a shorthand quadratic curve PathCommand with the given points. Defaults to absolute.


CurveToQuadraticSmooth

public CurveToQuadraticSmooth(CurveToQuadraticSmooth smoothQuadratic)
Creates a copy of the given shorthand quadratic curve PathCommand with the given points.

Parameters:
smoothQuadratic - the shorthand quadratic curve to copy

CurveToQuadraticSmooth

public CurveToQuadraticSmooth(double x,
                              double y)
Creates a shorthand quadratic curve PathCommand with the given points. Defaults to absolute.

Parameters:
x - the x-coordinate of the end of the segment
y - the y-coordinate of the end of the segment

CurveToQuadraticSmooth

public CurveToQuadraticSmooth(double x,
                              double y,
                              boolean relative)
Creates a shorthand quadratic curve PathCommand with the given points.

Parameters:
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 CurveToQuadraticSmooth 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

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

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.