Package snake2D
Class Snake2DNode
java.lang.Object
java.awt.geom.Point2D
java.awt.geom.Point2D.Double
snake2D.Snake2DNode
- All Implemented Interfaces:
Serializable,Cloneable
This class is used to store the snake-defining parameters. It extends
the capabilities of the class
Point2D.Double by
additional state variables.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.awt.geom.Point2D
Point2D.Double, Point2D.Float -
Field Summary
FieldsModifier and TypeFieldDescriptionbooleanMethods of the classSnake2DKeeperare allowed to modifySnake2DNodeobjects only if theirfrozenflag is set tofalse.booleanMethods of the classSnake2DKeeperare allowed to interactively display (as a cross) the nodes stored inSnake2DNodeobjects only if theirhiddenflag is set tofalse.Fields inherited from class java.awt.geom.Point2D.Double
x, y -
Constructor Summary
ConstructorsConstructorDescriptionSnake2DNode(double x, double y) This constructor builds a point that is initially neither frozen nor hidden.Snake2DNode(double x, double y, boolean frozen, boolean hidden) This constructor builds a point with the given initial values. -
Method Summary
Methods inherited from class java.awt.geom.Point2D.Double
getX, getY, setLocationMethods inherited from class java.awt.geom.Point2D
clone, distance, distance, distance, distanceSq, distanceSq, distanceSq, equals, hashCode, setLocation
-
Field Details
-
frozen
public boolean frozenMethods of the classSnake2DKeeperare allowed to modifySnake2DNodeobjects only if theirfrozenflag is set tofalse.
-
-
Constructor Details
-
Snake2DNode
public Snake2DNode(double x, double y) This constructor builds a point that is initially neither frozen nor hidden.- Parameters:
x- The horizontal coordinate.y- The vertical coordinate.
-
Snake2DNode
public Snake2DNode(double x, double y, boolean frozen, boolean hidden) This constructor builds a point with the given initial values.- Parameters:
x- The horizontal coordinate.y- The vertical coordinate.frozen- Set tofalseto allow methods of the classSnake2DKeeperto modify this point. Set totrueotherwise.hidden- Set tofalseto allow methods of the classSnake2DKeeperto display this point. Set totrueotherwise.
-
-
Method Details
-
toString
This method returns text-based information about this object.- Overrides:
toStringin classPoint2D.Double
-