Class ArrowTurtle
java.lang.Object
SpritePixels
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.
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 |
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
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.
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