ballworld.model.paint
Class ShapePaintStrategy
java.lang.Object
ballworld.model.paint.APaintStrategy
ballworld.model.paint.ShapePaintStrategy
- All Implemented Interfaces:
- IPaintStrategy
- Direct Known Subclasses:
- EllipsePaintStrategy, Fish1PaintStrategy, Fish2PaintStrategy, RectanglePaintStrategy, UprightShapePaintStrategy
public class ShapePaintStrategy
- extends APaintStrategy
Concrete class that defines invariant painting behaviors for all
Shape subclasses.
Note: This cannot be directly instantiated by the BallWar system
because it does not have a no-parameter constructor.
Field Summary |
private java.awt.Shape |
shape
The Shape to be painted |
Constructor Summary |
ShapePaintStrategy(java.awt.geom.AffineTransform at,
java.awt.Shape shape)
Constructor that uses a supplied AffineTransform for internal use. |
ShapePaintStrategy(java.awt.Shape shape)
Constructor that allocates a new AffineTransform for internal use. |
Method Summary |
void |
paintXfrm(java.awt.Graphics g,
Ball host,
java.awt.geom.AffineTransform at)
Paints the shape on the given Graphics context using the
supplied AffineTransform. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
shape
private java.awt.Shape shape
- The Shape to be painted
ShapePaintStrategy
public ShapePaintStrategy(java.awt.Shape shape)
- Constructor that allocates a new AffineTransform for internal use.
- Parameters:
shape
- The Shape to be painted.
ShapePaintStrategy
public ShapePaintStrategy(java.awt.geom.AffineTransform at,
java.awt.Shape shape)
- Constructor that uses a supplied AffineTransform for internal use.
- Parameters:
at
- The AffineTransform to useshape
- The Shape to be painted.
paintXfrm
public void paintXfrm(java.awt.Graphics g,
Ball host,
java.awt.geom.AffineTransform at)
- Paints the shape on the 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