ballwar.model.paint
Class BirdSheepImagePaintStrategy
java.lang.Object
ballwar.model.paint.APaintStrategy
ballwar.model.paint.ImagePaintStrategy
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.
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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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.
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.