ballworld.model.paint
Class MultiPaintStrategy
java.lang.Object
ballworld.model.paint.APaintStrategy
ballworld.model.paint.MultiPaintStrategy
- All Implemented Interfaces:
- IPaintStrategy
- Direct Known Subclasses:
- NiceFishPaintStrategy
public abstract class MultiPaintStrategy
- extends APaintStrategy
A composite design pattern exension of APaintStrategy that paints a set of
paint strategies. Note: This paint strategy cannot be used directly by the
BallWar system because it lacks a no-parameter constructor.
Method Summary |
void |
init(Ball host)
Delegates to all the IPaintStrategies in the composite. |
void |
paintXfrm(java.awt.Graphics g,
Ball host,
java.awt.geom.AffineTransform at)
Delegates to all the IPaintStrategies in the composite. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
pstrats
private APaintStrategy[] pstrats
- The set of paint strategies to paint
MultiPaintStrategy
public MultiPaintStrategy(APaintStrategy... pstrats)
- Constructor that takes the paint strategies that will part of the
composite. An AffineTransform is instantiated for internal use.
- Parameters:
pstrats
- Vararg parameter that are the paint strategies that will make
up the composite.
MultiPaintStrategy
public MultiPaintStrategy(java.awt.geom.AffineTransform at,
APaintStrategy... pstrats)
- Constructor that takes the paint strategies that will part of the
composite. An external AffineTransform is supplied for internal use.
- Parameters:
at
- The AffineTransform to use.pstrats
- Vararg parameter that are the paint strategies that will make
up the composite.
paintXfrm
public void paintXfrm(java.awt.Graphics g,
Ball host,
java.awt.geom.AffineTransform at)
- Delegates to all the IPaintStrategies in the composite. Paints using
given Graphics context using the supplied AffineTransform. Called by the
inherited paint method.
- Specified by:
paintXfrm
in class APaintStrategy
- Parameters:
g
- The Graphics context to paint upon.host
- The host Ballat
- The AffineTransform to use
init
public void init(Ball host)
- Delegates to all the IPaintStrategies in the composite. Used to
initialize the paint strategies.
- Specified by:
init
in interface IPaintStrategy
- Overrides:
init
in class APaintStrategy
- Parameters:
host
- The host Ball