|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectballwar.model.paint.ADecoratorPaintStrategy
public abstract class ADecoratorPaintStrategy
Abstract class that provides default behavior for subclasses that will decorate another IPaintStrategy to add functionality to that strategy. All this class's methods do is to simply delegate to the decoree. A subclass should override one or more methods, adding additional processing either before or after delegating to the decoree. Note that this class cannot be used by the BallWar system directly as it lacks a no-parameter constructor.
Field Summary | |
---|---|
private IPaintStrategy |
decoree
The "decoree" paint strategy whose methods are being augmented by this decorator paint strategy. |
Fields inherited from interface ballwar.model.IPaintStrategy |
---|
NullObject |
Constructor Summary | |
---|---|
ADecoratorPaintStrategy(IPaintStrategy decoree)
Constructor that takes the decoree paint strategy |
Method Summary | |
---|---|
void |
init(Ball host)
Default behavior is to simply delegate to the decoree's init method |
void |
paint(Graphics g,
Ball host)
Default behavior is to simply delegate to the decoree's paint method |
void |
paintXfrm(Graphics g,
Ball host,
AffineTransform at)
Default behavior is to simply delegate to the decoree's paintXfrm method |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private IPaintStrategy decoree
Constructor Detail |
---|
public ADecoratorPaintStrategy(IPaintStrategy decoree)
decoree
- The paint strategy that is to be decoratedMethod Detail |
---|
public void paint(Graphics g, Ball host)
paint
in interface IPaintStrategy
g
- The graphics context which is passed to the decoreehost
- The host Ball which is passed to the decoreepublic void paintXfrm(Graphics g, Ball host, AffineTransform at)
paintXfrm
in interface IPaintStrategy
g
- The graphics context which is passed to the decoreehost
- The host Ball which is passed to the decoree.at
- The affine transform which is passed to the decoree.public void init(Ball host)
init
in interface IPaintStrategy
host
- The host Ball which is passed to the decoree.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |