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

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

public class LineToHorizontal
extends PathCommand

A PathCommand that represents a horizontal line.


Constructor Summary
LineToHorizontal()
          Creates a horizontal line PathCommand.
LineToHorizontal(double x)
          Creates a horizontal line PathCommand using the given coordinates.
LineToHorizontal(double x, boolean relative)
          Creates a horizontal line PathCommand using the given coordinates.
LineToHorizontal(LineToHorizontal horizontal)
          Creates a copy of the given horizontal line PathCommand.
 
Method Summary
 LineToHorizontal copy()
          Returns a copy of the path command.
 double getX()
          Returns the x-coordinate of the end point of the command.
 boolean nearEqual(PathCommand command)
          Determines equality of two commands using rounded values.
 void setX(double x)
          Sets the x-coordinate of the end point of the command.
 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.PathCommand
isRelative, setRelative
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LineToHorizontal

public LineToHorizontal()
Creates a horizontal line PathCommand. Defaults to absolute.


LineToHorizontal

public LineToHorizontal(double x)
Creates a horizontal line PathCommand using the given coordinates. Defaults to absolute.

Parameters:
x - the x-coordinate of the end point of the line

LineToHorizontal

public LineToHorizontal(double x,
                        boolean relative)
Creates a horizontal line PathCommand using the given coordinates.

Parameters:
x - the x-coordinate of the end point of the line
relative - true if the command is relative

LineToHorizontal

public LineToHorizontal(LineToHorizontal horizontal)
Creates a copy of the given horizontal line PathCommand.

Parameters:
horizontal - the command to be copied
Method Detail

copy

public LineToHorizontal 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

getX

public double getX()
Returns the x-coordinate of the end point of the command.

Returns:
the x-coordinate of the end point of the 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

setX

public void setX(double x)
Sets the x-coordinate of the end point of the command.

Parameters:
x - the x-coordinate of the end point of the command

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