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 TypeFieldDescriptionboolean
Methods of the classSnake2DKeeper
are allowed to modifySnake2DNode
objects only if theirfrozen
flag is set tofalse
.boolean
Methods of the classSnake2DKeeper
are allowed to interactively display (as a cross) the nodes stored inSnake2DNode
objects only if theirhidden
flag 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, setLocation
Methods inherited from class java.awt.geom.Point2D
clone, distance, distance, distance, distanceSq, distanceSq, distanceSq, equals, hashCode, setLocation
-
Field Details
-
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 tofalse
to allow methods of the classSnake2DKeeper
to modify this point. Set totrue
otherwise.hidden
- Set tofalse
to allow methods of the classSnake2DKeeper
to display this point. Set totrue
otherwise.
-
-
Method Details
-
toString
This method returns text-based information about this object.- Overrides:
toString
in classPoint2D.Double
-