| 
 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.ObjectsysModel.env.NoGridEnv.Direction
public static class NoGridEnv.Direction
Concrete direction class.
| Field Summary | |
|---|---|
| private  double | _dxDirection delta x. | 
| private  double | _dyDirection delta y. | 
| private static double | EPSILON | 
| Constructor Summary | |
|---|---|
| NoGridEnv.Direction()Creates a new direction facing north. | |
| NoGridEnv.Direction(double dx,
                                       double dy)Constructor. | |
| NoGridEnv.Direction(NoGridEnv.Direction other)Copy constructor. | |
| Method Summary | |
|---|---|
|  NoGridEnv.Direction | duplicate()Return a new object which has the same direction. | 
|  double | getAngle()Return the angle between (0,-1) and this direction. | 
|  double | getDeltaX()Return the direction delta x. | 
|  double | getDeltaY()Return the direction delta y. | 
| static NoGridEnv.Direction | parse(Lexer l)Parses a direction. | 
|  void | reverseDirection()Reverse this direction. | 
|  void | rotateGraphics(java.awt.Graphics2D g)Rotate the supplied Graphics2D object to match this direction. | 
|  boolean | same(NoGridEnv.Direction other)Return true of this direction is the same as the other. | 
|  java.lang.String | toString()Overridden toString method. | 
|  void | turnLeft()Turn this direction PI/2 radians to the left. | 
|  void | turnLeft(double radians)Turn this direction to the left. | 
|  void | turnRight()Turn this direction PI/2 radians to the right. | 
|  void | turnRight(double radians)Turn this direction to the right. | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait | 
| Field Detail | 
|---|
private static double EPSILON
private double _dx
private double _dy
| Constructor Detail | 
|---|
public NoGridEnv.Direction(double dx,
                           double dy)
dx - delta xdy - delta ypublic NoGridEnv.Direction(NoGridEnv.Direction other)
other - other directionpublic NoGridEnv.Direction()
| Method Detail | 
|---|
public double getDeltaX()
public double getDeltaY()
public NoGridEnv.Direction duplicate()
public void reverseDirection()
public boolean same(NoGridEnv.Direction other)
other - other direction
public void turnLeft(double radians)
radians - radians to turnpublic void turnLeft()
public void turnRight(double radians)
radians - radians to turnpublic void turnRight()
public java.lang.String toString()
toString in class java.lang.Objectpublic static NoGridEnv.Direction parse(Lexer l)
l - parser to read from
public void rotateGraphics(java.awt.Graphics2D g)
g - graphics object to rotatepublic double getAngle()
| 
 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||