org.jscience.architecture.traffic.util
Class TurnCurve

java.lang.Object
  extended by java.awt.geom.QuadCurve2D
      extended by java.awt.geom.QuadCurve2D.Double
          extended by org.jscience.architecture.traffic.util.TurnCurve
All Implemented Interfaces:
java.awt.Shape, java.io.Serializable, java.lang.Cloneable

public class TurnCurve
extends java.awt.geom.QuadCurve2D.Double

DOCUMENT ME!

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.awt.geom.QuadCurve2D
java.awt.geom.QuadCurve2D.Double, java.awt.geom.QuadCurve2D.Float
 
Field Summary
protected  java.awt.Point control
          The control point of this TurnCurve
protected  java.awt.Point end
          The end point of this TurnCurve
protected  java.awt.geom.PathIterator iterator
          The PathIterator for this TurnCurve
protected  java.awt.Point start
          The start point of this TurnCurve
protected  boolean straight
          A flag indicating whether this TurnCurve is actually a straight line
 
Fields inherited from class java.awt.geom.QuadCurve2D.Double
ctrlx, ctrly, x1, x2, y1, y2
 
Constructor Summary
TurnCurve(java.awt.Point p1, java.awt.Point p2)
          Create a new straight TurnCurve with specified end points
TurnCurve(java.awt.Point p1, java.awt.Point cp, java.awt.Point p2)
          Create a new TurnCurve with specified end and control points
 
Method Summary
 java.awt.Point getControl()
          Return the control point of this TurnCurve
 java.awt.Point getFirst()
          Return the first point on this TurnCurve
 java.awt.Point getLast()
          Return the last point on this TurnCurve
 boolean isStraight()
          Returns true if this TurnCurve is actually a straight line, false otherwise
 java.awt.Point next()
          Let the PathIterator do a step and if successfull return the coordinates of it's current position
 java.awt.Point pointAt(int index)
          Return the coordinates of the point with a given index on this TurnCurve
 void rewind()
          Set the PathIterator to the first position on this TurnCurve
 
Methods inherited from class java.awt.geom.QuadCurve2D.Double
getBounds2D, getCtrlPt, getCtrlX, getCtrlY, getP1, getP2, getX1, getX2, getY1, getY2, setCurve
 
Methods inherited from class java.awt.geom.QuadCurve2D
clone, contains, contains, contains, contains, getBounds, getFlatness, getFlatness, getFlatness, getFlatnessSq, getFlatnessSq, getFlatnessSq, getPathIterator, getPathIterator, intersects, intersects, setCurve, setCurve, setCurve, setCurve, solveQuadratic, solveQuadratic, subdivide, subdivide, subdivide
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

iterator

protected java.awt.geom.PathIterator iterator
The PathIterator for this TurnCurve


start

protected java.awt.Point start
The start point of this TurnCurve


control

protected java.awt.Point control
The control point of this TurnCurve


end

protected java.awt.Point end
The end point of this TurnCurve


straight

protected boolean straight
A flag indicating whether this TurnCurve is actually a straight line

Constructor Detail

TurnCurve

public TurnCurve(java.awt.Point p1,
                 java.awt.Point cp,
                 java.awt.Point p2)
Create a new TurnCurve with specified end and control points

Parameters:
p1 - The start point
cp - The control point
p2 - The end point

TurnCurve

public TurnCurve(java.awt.Point p1,
                 java.awt.Point p2)
Create a new straight TurnCurve with specified end points

Parameters:
p1 - The start point
p2 - The end point
Method Detail

getFirst

public java.awt.Point getFirst()
Return the first point on this TurnCurve

Returns:
DOCUMENT ME!

getControl

public java.awt.Point getControl()
Return the control point of this TurnCurve

Returns:
DOCUMENT ME!

getLast

public java.awt.Point getLast()
Return the last point on this TurnCurve

Returns:
DOCUMENT ME!

isStraight

public boolean isStraight()
Returns true if this TurnCurve is actually a straight line, false otherwise

Returns:
DOCUMENT ME!

rewind

public void rewind()
Set the PathIterator to the first position on this TurnCurve


next

public java.awt.Point next()
Let the PathIterator do a step and if successfull return the coordinates of it's current position

Returns:
The coordinats of the PathIterator's position, or null if no step was possible

pointAt

public java.awt.Point pointAt(int index)
Return the coordinates of the point with a given index on this TurnCurve

Parameters:
index - DOCUMENT ME!
Returns:
DOCUMENT ME!