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 voidforgetCommands()doublegetHeading()GCompoundgetTrail()voidonPenDown()voidonPenUp()voidonStep()voidonTurn()voidpenDown()voidpenUp()voidsetDelay(int delay)voidsetHeading(double heading)voidsetLocation(double x, double y)sets the location of this GObject to (x,y)voidsetX(double x)sets the x-coordinate for this GObject to the specified x-coordinatevoidsetY(double y)sets the y-coordinate for this GObject to the specified y-coordinatevoidstep()voidturn()-
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:GObjectsets the location of this GObject to (x,y)- Overrides:
setLocationin 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:GObjectsets the x-coordinate for this GObject to the specified x-coordinate
-
setY
public void setY(double y)
Description copied from class:GObjectsets 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()
-
-