Field Summary | |
static int |
CREATE_DEFAULT_WINDOW
Constant for creating a default drawing window |
static int |
NO_DEFAULT_WINDOW
Constant for not creating any default drawing window |
Constructor Summary | |
Turtle()
A default constructor that creates an instance of the Turtle class with a default drawing window. |
|
Turtle(int choice)
Constructs a standard turtle with or without default drawing window assigned. |
Method Summary | |
void |
backup(double length)
Moves this turtle backward for a specified length. |
void |
bodyColor(java.awt.Color color)
Changes the body color of this turtle. |
void |
bodyShape(java.awt.Point[] point)
Sets the shape of this turtle to the give shape expressed in an array of Point objects. |
void |
forward(double length)
Moves this turtle forward for a given length. |
void |
heading(double degree)
Sets this turtle's heading for a specified degree. |
void |
hide()
Hides this turtle. |
void |
init()
Initializes this turtle. |
void |
jumpTo(double x,
double y)
Jumps to the given (x, y). |
void |
move(double length)
Moves this turtle's for a specified length. |
void |
moveTo(double targetX,
double targetY)
Moves this turtle to the specified target (x, y) position. |
void |
pause()
Stops this turtle from moving. |
void |
penColor(java.awt.Color color)
Sets the color of the turtle's pen. |
void |
penDown()
Sets the pen state to down. |
void |
penSize(int penSize)
Sets the size of this turtle's pen. |
void |
penUp()
Sets the pen state to up. |
void |
redraw(java.awt.Graphics g)
Required method to implement the DrawingController interface. |
void |
run()
Required method to implement the Runnable interface. |
void |
setCanvas(DrawingCanvas canvas)
Required method to implement the DrawingController interface. |
void |
show()
Shows this turtle. |
void |
speed(int speed)
Changes the speed of this turtle |
void |
start()
Starts moving this turtle in its own thread. |
void |
turn(double degree)
|