ballworld.model.paint
Class UprightImagePaintStrategy

java.lang.Object
  extended by ballworld.model.paint.APaintStrategy
      extended by ballworld.model.paint.ImagePaintStrategy
          extended by ballworld.model.paint.UprightImagePaintStrategy
All Implemented Interfaces:
IPaintStrategy
Direct Known Subclasses:
BirdSheepImagePaintStrategy, MarioSonicImagePaintStrategy, SharkImagePaintStrategy

public class UprightImagePaintStrategy
extends ImagePaintStrategy

An image painting strategy that adds behavior to the paintCfg process that keeps the image upright no matter which way it is going.

Author:
swong

Field Summary
 
Fields inherited from class ballworld.model.paint.ImagePaintStrategy
localAT
 
Fields inherited from class ballworld.model.paint.APaintStrategy
at
 
Fields inherited from interface ballworld.model.IPaintStrategy
NullObject
 
Constructor Summary
UprightImagePaintStrategy(java.lang.String filename, double fillFactor)
          Constructor for an image painting strategy
 
Method Summary
protected  void paintCfg(java.awt.Graphics g, Ball host)
          Augments the inherited paint method to add flipping of the image to keep it upright whenever the ball is going towards the left.
 
Methods inherited from class ballworld.model.paint.ImagePaintStrategy
init, paintXfrm
 
Methods inherited from class ballworld.model.paint.APaintStrategy
paint
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UprightImagePaintStrategy

public UprightImagePaintStrategy(java.lang.String filename,
                                 double fillFactor)
Constructor for an image painting strategy

Parameters:
filename - Fully qualified filename of the image file RELATIVE TO THIS PACKAGE, using a forward slash as a directory divider.
fillFactor - The ratio of the effective diameter (hit circle) of the image to the average of its width and height.
Method Detail

paintCfg

protected void paintCfg(java.awt.Graphics g,
                        Ball host)
Augments the inherited paint method to add flipping of the image to keep it upright whenever the ball is going towards the left.

Overrides:
paintCfg in class APaintStrategy
Parameters:
g - The Graphics context that will be drawn upon.
host - The Ball to be painted.