Method Summary |
void |
erasePath()
Erases the entire path drawn by the turtle but does not change its position. |
void |
forward()
Moves the turtle forward by its own size. |
void |
forward(double distance)
Moves the turtle forward in its current direction by the specified distance. |
GRectangle |
getBounds()
Returns the bounding box for the entire figure traced by the turtle. |
double |
getDirection()
Returns the direction specified by setDirection . |
double |
getSpeed()
Returns the current speed of the turtle. |
int |
getTurtleSize()
Returns the size of the turtle. |
void |
hideTurtle()
Hides the turtle. |
boolean |
isPenDown()
Returns whether the pen is down, as described in
setPenDown . |
boolean |
isTurtleVisible()
Returns whether the turtle is visible. |
void |
left(double angle)
Changes the direction of the turtle so that it moves the specified number
of degrees to the left. |
void |
main(String[] args)
Makes it possible for a GTurtle to be run under the control
of a GraphicsProgram object. |
void |
penDown()
Lowers the pen. |
void |
penUp()
Raises the pen. |
void |
right(double angle)
Changes the direction of the turtle so that it moves the specified number
of degrees to the right. |
void |
setColor(Color color)
Sets the color of the turtle's pen. |
void |
setDirection(double dir)
Sets the direction in which the turtle is moving. |
void |
setLocation(double x,
double y)
Moves the turtle to the point (x , y ) without drawing a line. |
void |
setSize(int size)
Sets the size of the turtle. |
void |
setSpeed(double speed)
Sets the speed of the turtle, which must be a number between 0 (slowest)
and 1 (fastest). |
void |
showTurtle()
Makes the turtle visible. |
Inherited Method Summary |
Color | getColor()
Returns the color used to display this object.
|
GPoint | getLocation()
Returns the location of this object as a GPoint .
|
GDimension | getSize()
Returns the size of the bounding box for this object.
|
double | getX()
Returns the x-coordinate of the object.
|
double | getX()
Returns the x-coordinate of the object.
|
double | getY()
Returns the y-coordinate of the object.
|
double | getY()
Returns the y-coordinate of the object.
|
boolean | isVisible()
Checks to see whether the trace of the turtle is visible.
|
void | sendBackward()
Moves this object one step toward the back in the z dimension.
|
void | sendForward()
Moves this object one step toward the front in the z dimension.
|
void | sendToBack()
Moves this object to the back of the display in the z dimension.
|
void | sendToFront()
Moves this object to the front of the display in the z dimension.
|
void | setVisible(boolean visible)
Sets whether the trace of the turtle is visible.
|