ballwar.model.paint
Class BirdSheepImagePaintStrategy

java.lang.Object
  extended by ballwar.model.paint.APaintStrategy
      extended by ballwar.model.paint.ImagePaintStrategy
          extended by ballwar.model.paint.BirdSheepImagePaintStrategy
All Implemented Interfaces:
IPaintStrategy

public class BirdSheepImagePaintStrategy
extends ImagePaintStrategy

An example of an ImagePaintStrategy that randomly picks one of two animated image files to display when it is instantiated.


Field Summary
 
Fields inherited from class ballwar.model.paint.APaintStrategy
at
 
Fields inherited from interface ballwar.model.IPaintStrategy
NullObject
 
Constructor Summary
BirdSheepImagePaintStrategy()
          No-parameter constructor that instantiates the AffineTransform used internally and randomly loads one of two files: ballwar\model\paint\images\humbird4.gif or ballwar\model\paint\images\img104c.gif with a fill factor of 0.5.
 
Method Summary
protected  void paintCfg(Graphics g, Ball host)
          Augments the inhereited paint method to add flipping of the image to keep it upright.
 
Methods inherited from class ballwar.model.paint.ImagePaintStrategy
init, paintXfrm
 
Methods inherited from class ballwar.model.paint.APaintStrategy
paint
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BirdSheepImagePaintStrategy

public BirdSheepImagePaintStrategy()
No-parameter constructor that instantiates the AffineTransform used internally and randomly loads one of two files: ballwar\model\paint\images\humbird4.gif or ballwar\model\paint\images\img104c.gif with a fill factor of 0.5.

Method Detail

paintCfg

protected void paintCfg(Graphics g,
                        Ball host)
Augments the inhereited paint method to add flipping of the image to keep it upright.

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