scenic.path
Class LineSegment

java.lang.Object
  extended by scenic.path.LineSegment
All Implemented Interfaces:
Segment

public class LineSegment
extends java.lang.Object
implements Segment

This class defines a straight line segment. This class does not define the start point of the line. The start point is the end point of the previous segment.


Constructor Summary
LineSegment(double x, double y)
          Creates a straight line segment with the given parameters.
 
Method Summary
 void getBounds(java.awt.geom.AffineTransform transform, java.awt.Rectangle r, java.awt.geom.Point2D.Double position)
          Gets the bounds of this segment using the given transform.
 double getX()
          Gets the x coordinate of the end point.
 double getY()
          Gets the y coordinate of the end point.
 void walk(PathWalker walker, java.awt.geom.Point2D.Double position, java.awt.geom.AffineTransform error)
          Walks the given walker through this segment.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LineSegment

public LineSegment(double x,
                   double y)
Creates a straight line segment with the given parameters.

Parameters:
x - the x coordinate of the end point.
y - the y coordinate of the end point.
Method Detail

getX

public double getX()
Gets the x coordinate of the end point.


getY

public double getY()
Gets the y coordinate of the end point.


walk

public void walk(PathWalker walker,
                 java.awt.geom.Point2D.Double position,
                 java.awt.geom.AffineTransform error)
Description copied from interface: Segment
Walks the given walker through this segment.

Specified by:
walk in interface Segment
Parameters:
walker - the walker.
position - the start position.
error - the error matrix.

getBounds

public void getBounds(java.awt.geom.AffineTransform transform,
                      java.awt.Rectangle r,
                      java.awt.geom.Point2D.Double position)
Description copied from interface: Segment
Gets the bounds of this segment using the given transform.

Specified by:
getBounds in interface Segment
Parameters:
transform - the transform
r - the bounds.
position - the start position.