|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectballworld.model.paint.strategy.SquarePaintStrategy
public class SquarePaintStrategy
Paint strategy that paints a filled square with the Ball's radius. This functionality is duplicated by the RectanglePaintStrategy. The class demonstrates a direct implementation of IPaintStrategy.
Field Summary |
---|
Fields inherited from interface ballworld.model.IPaintStrategy |
---|
NullObject |
Constructor Summary | |
---|---|
SquarePaintStrategy()
No parameter constructor for the class |
Method Summary | |
---|---|
void |
init(Ball context)
By default, do nothing for initialization. |
void |
paint(java.awt.Graphics g,
Ball host)
Paints a square on the given graphics context using the color and radius provided by the host. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SquarePaintStrategy()
Method Detail |
---|
public void paint(java.awt.Graphics g, Ball host)
paint
in interface IPaintStrategy
g
- The graphics context to draw upon.host
- The host ball.public void init(Ball context)
init
in interface IPaintStrategy
context
- The ball to initialize.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |