Class ArrowTurtle

java.lang.Object
  extended by SpritePixels
      extended by ArrowTurtle

public class ArrowTurtle
extends SpritePixels

This class provides the turtle's appearance, the array of pixels that make up its image. In this case, the image is an arrow.


Field Summary
static int DEFAULT_ARROW_HEIGHT
           
static int DEFAULT_ARROW_WIDTH
           
static int MINIMUM_ARROW_HEIGHT
           
static int MINIMUM_ARROW_WIDTH
           
 
Fields inherited from class SpritePixels
CLASS_NAME, MAX_SPRITE_HEIGHT, MAX_SPRITE_WIDTH, MIN_SPRITE_HEIGHT, MIN_SPRITE_WIDTH, ROTATE_LEFT_RIGHT, ROTATE_OFF, ROTATE_ON, ROTATE_RIGHT_LEFT
 
Constructor Summary
ArrowTurtle(java.awt.Color color, double heading)
          Constructor for an arrow Sprite image of the default height.
ArrowTurtle(int width, int height, java.awt.Color color, double heading)
          Constructor for an arrow Sprite image of a given height and width.
 
Method Summary
protected  void initSpritePixels(int turtleSideSize)
          Initialize the turtle's pixels, an arrow.
 
Methods inherited from class SpritePixels
getHeight, getMinimumHeight, getMinimumWidth, getPixels, getSideSize, getWidth, setCirclePixels, setLinePixels, setPixel, setSpriteColor, setSpriteHeading
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_ARROW_HEIGHT

public static final int DEFAULT_ARROW_HEIGHT
See Also:
Constant Field Values

DEFAULT_ARROW_WIDTH

public static final int DEFAULT_ARROW_WIDTH
See Also:
Constant Field Values

MINIMUM_ARROW_HEIGHT

public static final int MINIMUM_ARROW_HEIGHT
See Also:
Constant Field Values

MINIMUM_ARROW_WIDTH

public static final int MINIMUM_ARROW_WIDTH
See Also:
Constant Field Values
Constructor Detail

ArrowTurtle

public ArrowTurtle(java.awt.Color color,
                   double heading)
Constructor for an arrow Sprite image of the default height.


ArrowTurtle

public ArrowTurtle(int width,
                   int height,
                   java.awt.Color color,
                   double heading)
Constructor for an arrow Sprite image of a given height and width.

Method Detail

initSpritePixels

protected void initSpritePixels(int turtleSideSize)
Initialize the turtle's pixels, an arrow. The arrow's geometry has a shaft either half the spriteHeight (for arrows with widths equal-to or greater than their height) or two-thirds the spriteHeight (for arrows whose heights are greater than their widths). The arrowhead is one-third the spriteHeight tall. The shaft's width is one-third of spriteWidth.

Overrides:
initSpritePixels in class SpritePixels