Package | Description |
---|---|
ballworld.model | |
ballworld.model.paint | |
ballworld.model.paint.strategy |
Modifier and Type | Field and Description |
---|---|
private IPaintStrategy |
Ball._paintStrategy
The strategy used to paint the ball.
|
static IPaintStrategy |
IPaintStrategy.NullObject
The singleton null object instance for this interface, which does nothing.
|
Modifier and Type | Method and Description |
---|---|
IPaintStrategy |
Ball.getPaintStrategy()
Returns the current paint strategy of this Ball
|
IPaintStrategy |
BallModel.loadPaintStrategy(java.lang.String className)
Uses dynamic class loading to load and instantiate an IUpdateStrategy implementation,
given its class name.
|
IPaintStrategy |
IPaintStrategyFac.make()
Instantiate the specific IPaintStrategy for which this factory is
defined.
|
Modifier and Type | Method and Description |
---|---|
void |
BallModel.loadBall(IUpdateStrategy updateStrategy,
IPaintStrategy paintStrategy)
Load a ball into the system, where the ball uses the given update strategy instance.
|
void |
Ball.setPaintStrategy(IPaintStrategy pstrategy)
Sets the current strategy of this Ball to the given strategy
|
Constructor and Description |
---|
Ball(java.awt.Point p,
int r,
java.awt.Point v,
java.awt.Color c,
java.awt.Component container,
IUpdateStrategy updateStrategy,
IPaintStrategy paintStrategy)
Initializes this Ball to a given center, radius, color, containing walls,
and the NullStrategy to move in a straight line.
|
Modifier and Type | Class and Description |
---|---|
class |
ADecoratorPaintStrategy
Abstract class that provides default behavior for subclasses
that will decorate another IPaintStrategy to add functionality
to that strategy.
|
class |
AnimatePaintStrategy
Concrete paint strategy that cycles through a sequence of paint strategies,
painting one per paint update.
|
class |
APaintStrategy
The top-level affine transform-based paint strategy that provides services for its subclasses,
plus default behaviors and abstract behaviors.
|
class |
FixedColorDecoratorPaintStrategy
Decorator paint strategy that decorates another IPaintStrategy and
causes the painted color to always be a specified, fixed color.
|
class |
ImagePaintStrategy
Paint strategy that paints an image from a file, scaled to the host Ball's
radius.
|
class |
MultiPaintStrategy
A composite design pattern extension of APaintStrategy that paints a set of
paint strategies.
|
class |
ShapePaintStrategy
Concrete class that defines invariant painting behaviors to paint
Shape objects for all its subclasses.
|
class |
UprightImagePaintStrategy
An image painting strategy that adds a paintCfg override that keeps the image upright no matter which way it is going.
|
class |
UprightShapePaintStrategy
A shape painting strategy that adds a paintCfg override that keeps the shape upright no matter which direction it is going.
|
Modifier and Type | Class and Description |
---|---|
class |
BallPaintStrategy
Paint strategy that paints a filled circle with the Ball's radius.
|
class |
BirdSheepImagePaintStrategy
An example of an ImagePaintStrategy that randomly picks one
of two animated image files to display when it is instantiated.
|
class |
EllipsePaintStrategy
Paint strategy to paint an ellipse shape
|
class |
Fish1PaintStrategy
Paint strategy that paints a fish-shaped Polygon generated
by a Fish1PolyfonFactory.
|
class |
Fish2PaintStrategy
Paint strategy that paints a fish-shaped Polygon generated
by a Fish2PolyfonFactory.
|
class |
MarioSonicImagePaintStrategy
Paint strategy that uses either an animated Mario or Sonic image.
|
class |
NiceFishPaintStrategy
Subclass of MultiPaintStrategy that uses a SwimFishPaintStrategy and an
EllipsePaintStrategy to paint a swimming fish shape that
has an eye.
|
class |
PlanetImagePaintStrategy
Paint strategy that upon instantiation, randomly picks one image from an array of images to use.
|
class |
RectanglePaintStrategy
Concrete paint strategy that paints a rectangular shape
scaled to the size of the ball.
|
class |
SharkImagePaintStrategy
Paint strategy that paints a Black Tip Reef shark as its image.
|
class |
SoccerImagePaintStrategy
Paint strategy that paints a FIFA soccer ball as its image
|
class |
SquarePaintStrategy
Paint strategy that paints a filled square with the Ball's radius.
|
class |
SwimFishPaintStrategy
Subclass of AnimatePaintStrategy that alternates between
a Fish1PaintStrategy and a Fish2PaintStrategy.
|