Package breadboards
Class GTurtle
- java.lang.Object
-
- breadboards.GObject
-
- breadboards.GCompound
-
- breadboards.GTurtle
-
- All Implemented Interfaces:
Drawable
,GObjectParent
public class GTurtle extends GCompound
-
-
Constructor Summary
Constructors Constructor Description GTurtle(double x, double y, double stepSize, double turnSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
forgetCommands()
double
getHeading()
GCompound
getTrail()
void
onPenDown()
void
onPenUp()
void
onStep()
void
onTurn()
void
penDown()
void
penUp()
void
setDelay(int delay)
void
setHeading(double heading)
void
setLocation(double x, double y)
sets the location of this GObject to (x,y)void
setX(double x)
sets the x-coordinate for this GObject to the specified x-coordinatevoid
setY(double y)
sets the y-coordinate for this GObject to the specified y-coordinatevoid
step()
void
turn()
-
Methods inherited from class breadboards.GCompound
add, add, add, contains, draw, getBounds, getCanvasPoint, getElement, getElementAt, getElementAt, getElementCount, getHeight, getLocalPoint, getWidth, remove, removeAll, sendBackward, sendForward, sendToBack, sendToFront, updateDisplay
-
Methods inherited from class breadboards.GObject
addMouseListener, addMouseMotionListener, getBreadboard, getLocation, getMouseListeners, getMouseMotionListeners, getParent, getX, getY, isVisible, move, movePolar, removeMouseListener, removeMouseMotionListener, sendBackward, sendForward, sendToBack, sendToFront, setParent, setVisible, updateBreadboard
-
-
-
-
Method Detail
-
forgetCommands
public void forgetCommands()
-
setLocation
public void setLocation(double x, double y)
Description copied from class:GObject
sets the location of this GObject to (x,y)- Overrides:
setLocation
in classGObject
- Parameters:
x
- the new x-coordinate for this GObjecty
- the new y-coordinate for this GObject
-
setX
public void setX(double x)
Description copied from class:GObject
sets the x-coordinate for this GObject to the specified x-coordinate
-
setY
public void setY(double y)
Description copied from class:GObject
sets the y-coordinate for this GObject to the specified y-coordinate
-
getHeading
public double getHeading()
-
setDelay
public void setDelay(int delay)
-
setHeading
public void setHeading(double heading)
-
penUp
public void penUp()
-
penDown
public void penDown()
-
onPenDown
public void onPenDown()
-
onPenUp
public void onPenUp()
-
getTrail
public GCompound getTrail()
-
turn
public void turn()
-
onTurn
public void onTurn()
-
step
public void step()
-
onStep
public void onStep()
-
-