ballworld.model.paint
Class UprightShapePaintStrategy
java.lang.Object
ballworld.model.paint.APaintStrategy
ballworld.model.paint.ShapePaintStrategy
ballworld.model.paint.UprightShapePaintStrategy
- All Implemented Interfaces:
- IPaintStrategy
public class UprightShapePaintStrategy
- extends ShapePaintStrategy
Class that adds a paintCfg override that keeps the shape upright no matter which direction it is going.
- Author:
- swong
Constructor Summary |
UprightShapePaintStrategy(java.awt.geom.AffineTransform at,
java.awt.Shape shape)
Constructor that takes both a Shape and an affine transform |
UprightShapePaintStrategy(java.awt.Shape shape)
Constructor that takes a Shape, generates its own affine transform. |
Method Summary |
protected void |
paintCfg(java.awt.Graphics g,
Ball host)
Override paintCfg to add the transform needed to
keep the shape upright at all times. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
UprightShapePaintStrategy
public UprightShapePaintStrategy(java.awt.Shape shape)
- Constructor that takes a Shape, generates its own affine transform.
- Parameters:
shape
- The prototype shape to be painted.
UprightShapePaintStrategy
public UprightShapePaintStrategy(java.awt.geom.AffineTransform at,
java.awt.Shape shape)
- Constructor that takes both a Shape and an affine transform
- Parameters:
at
- The affine transform object to useshape
- The prototype shape to use.
paintCfg
protected void paintCfg(java.awt.Graphics g,
Ball host)
- Override paintCfg to add the transform needed to
keep the shape upright at all times.
- Overrides:
paintCfg
in class APaintStrategy
- Parameters:
g
- The Graphics context that will be drawn upon.host
- The Ball to be painted.