|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.ObjectTurtleGraphics.AbstractPen
TurtleGraphics.StandardPen
TurtleGraphics.RainbowPen
public class RainbowPen
Copyright 2006 by Ken Lambert and Martin Osborne.
Provides behavior and state for a pen with randomly generated colors. A new random color is chosen for the pen each time it is moved or draws a string.
| Field Summary |
|---|
| Fields inherited from class TurtleGraphics.AbstractPen |
|---|
color, direction, isDown, pad, width, xPos, yPos |
| Constructor Summary | |
|---|---|
RainbowPen()
|
|
RainbowPen(SketchPad pad)
|
|
RainbowPen(SketchPadWindow w)
|
|
| Method Summary | |
|---|---|
void |
drawString(java.lang.String str)
Action: Draws the string at the pen's position. |
void |
move(double distance)
Action: The pen moves the specified distance in the current direction. |
void |
move(double x,
double y)
Action: Moves the pen to the position (x, y). |
| Methods inherited from class TurtleGraphics.StandardPen |
|---|
drawLine |
| Methods inherited from class TurtleGraphics.AbstractPen |
|---|
down, home, isDown, setColor, setDirection, setWidth, toString, turn, turn, up |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public RainbowPen()
public RainbowPen(SketchPad pad)
public RainbowPen(SketchPadWindow w)
| Method Detail |
|---|
public void drawString(java.lang.String str)
Pen
drawString in interface PendrawString in class StandardPenpublic void move(double distance)
Pen
move in interface Penmove in class AbstractPen
public void move(double x,
double y)
Pen
move in interface Penmove in class AbstractPen
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||