|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object sysModel.env.ASquareEnv.Direction
public class ASquareEnv.Direction
Concrete direction class.
Field Summary | |
---|---|
private double |
_dx
Direction delta x. |
private double |
_dy
Direction delta y. |
private double |
EPSILON
|
Constructor Summary | |
---|---|
ASquareEnv.Direction()
Creates a new direction facing north. |
|
ASquareEnv.Direction(ASquareEnv.Direction other)
Constructor. |
|
ASquareEnv.Direction(double dx,
double dy)
Constructor. |
Method Summary | |
---|---|
ASquareEnv.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. |
ASquareEnv.Direction |
parse(Lexer l)
Parses a direction. |
void |
reverseDirection()
Reverse this direction. |
void |
rotateGraphics(java.awt.Graphics2D g)
Rotate the graphics object by the angle between (0,-1) and this direction. |
boolean |
same(ASquareEnv.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 final double EPSILON
private double _dx
private double _dy
Constructor Detail |
---|
public ASquareEnv.Direction(ASquareEnv.Direction other)
other
- other directionpublic ASquareEnv.Direction(double dx, double dy)
dx
- delta xdy
- delta ypublic ASquareEnv.Direction()
Method Detail |
---|
public double getDeltaX()
public double getDeltaY()
public ASquareEnv.Direction duplicate()
public void reverseDirection()
public boolean same(ASquareEnv.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.Object
public ASquareEnv.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 |