public abstract class APaintStrategy extends java.lang.Object implements IPaintStrategy
Modifier and Type | Field and Description |
---|---|
private java.awt.geom.AffineTransform |
at
The affine transform used by this paint strategy to translate, scale and rotate the image.
|
NullObject
Constructor and Description |
---|
APaintStrategy(java.awt.geom.AffineTransform at)
Constructor that initializes the strategy with an affine transform
|
Modifier and Type | Method and Description |
---|---|
protected java.awt.geom.AffineTransform |
getAT()
Protected accessor for the internal affine transform
|
void |
init(Ball context)
By default, do nothing for initialization.
|
void |
paint(java.awt.Graphics g,
Ball host)
Paints on the given graphics context using the color, scale and
direction provided by the host.
|
protected void |
paintCfg(java.awt.Graphics g,
Ball host)
Used for doing additional configurations by a subclass.
|
abstract void |
paintXfrm(java.awt.Graphics g,
Ball host,
java.awt.geom.AffineTransform at)
Paints the host onto the given Graphics context.
|
private java.awt.geom.AffineTransform at
public APaintStrategy(java.awt.geom.AffineTransform at)
at
- The AffineTransform for this paint strategy to use.protected java.awt.geom.AffineTransform getAT()
public void paint(java.awt.Graphics g, Ball host)
paint
in interface IPaintStrategy
g
- The Graphics context that will be paint onhost
- The host Ball that the required information will be pulled from.public void init(Ball context)
init
in interface IPaintStrategy
context
- The ball to initialize.protected void paintCfg(java.awt.Graphics g, Ball host)
g
- The Graphics context that will be drawn upon.host
- The Ball to be painted.public abstract void paintXfrm(java.awt.Graphics g, Ball host, java.awt.geom.AffineTransform at)
g
- The graphics context to draw upon.host
- The host ball.at
- The affine transform to use.