TurtleGraphics
Class StandardPen
java.lang.Object
TurtleGraphics.AbstractPen
TurtleGraphics.StandardPen
- All Implemented Interfaces:
- Pen
- Direct Known Subclasses:
- RainbowPen, WigglePen
public class StandardPen
- extends AbstractPen
Copyright 2006 by Ken Lambert and Martin Osborne.
Provides default behavior and state for a pen. The pen's initial color is blue and its width is 2 pixels. It is situated at the origin of a sketchpad, facing north (90 degrees). It is placed down on the sketchpad, ready to draw.
Constructor Summary |
StandardPen()
Action: Pops up an application window containing a sketchpad
and an associated standard pen. |
StandardPen(SketchPad p)
Action: Associates a standard pen with a client-supplied sketchpad. |
StandardPen(SketchPadWindow w)
Action: Pops up the client's application window containing a sketchpad
and an associated standard pen. |
Method Summary |
protected void |
drawLine(double x,
double y)
|
void |
drawString(java.lang.String text)
Action: Draws the string at the pen's position. |
Methods inherited from class TurtleGraphics.AbstractPen |
down, home, isDown, move, move, setColor, setDirection, setWidth, toString, turn, turn, up |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
StandardPen
public StandardPen()
- Action: Pops up an application window containing a sketchpad
and an associated standard pen.
StandardPen
public StandardPen(SketchPad p)
- Action: Associates a standard pen with a client-supplied sketchpad.
StandardPen
public StandardPen(SketchPadWindow w)
- Action: Pops up the client's application window containing a sketchpad
and an associated standard pen.
drawString
public void drawString(java.lang.String text)
- Description copied from interface:
Pen
- Action: Draws the string at the pen's position.
- Specified by:
drawString
in interface Pen
- Specified by:
drawString
in class AbstractPen
drawLine
protected void drawLine(double x,
double y)
- Specified by:
drawLine
in class AbstractPen