ch.aplu.turtle
Class TurtleFactory

java.lang.Object
  |
  +--ch.aplu.turtle.TurtleFactory

public class TurtleFactory
extends java.lang.Object

This class provides functionality for generating images (java.awt.Image) of a Turtle for any angle, color (java.awt.Color) and size.
The following picture shows turtles for every 10 degrees in standard size and color:

Keep in mind that the angle for the standardTurtle methods are measured in radians and anticlockwise, where 0 means facing east, in contrast to the Playground class. The reason for this is that the Playground itself interprets the angle and position of the turtle.


Constructor Summary
TurtleFactory()
           
 
Method Summary
 java.awt.Image standardTurtle(java.awt.Color color, double angle)
          Generates the Picture of a Turtle with color, angle angle and standard size.
 java.awt.Image standardTurtle(java.awt.Color color, double angle, int size)
          Generates the Picture of a Turtle with color, angle angle and size.
 java.awt.Image standardTurtle(double angle)
          Generates the Picture of a Turtle with angle angle, standard size and standard color.
 java.awt.Image standardTurtle(double angle, int size)
          Generates the Picture of a Turtle with angle angle, size and standard Color.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TurtleFactory

public TurtleFactory()
Method Detail

standardTurtle

public java.awt.Image standardTurtle(java.awt.Color color,
                                     double angle)
Generates the Picture of a Turtle with color, angle angle and standard size.


standardTurtle

public java.awt.Image standardTurtle(java.awt.Color color,
                                     double angle,
                                     int size)
Generates the Picture of a Turtle with color, angle angle and size.


standardTurtle

public java.awt.Image standardTurtle(double angle)
Generates the Picture of a Turtle with angle angle, standard size and standard color.


standardTurtle

public java.awt.Image standardTurtle(double angle,
                                     int size)
Generates the Picture of a Turtle with angle angle, size and standard Color.