ballwar.model.paint
Class RectanglePaintStrategy

java.lang.Object
  extended by ballwar.model.paint.APaintStrategy
      extended by ballwar.model.paint.ShapePaintStrategy
          extended by ballwar.model.paint.RectanglePaintStrategy
All Implemented Interfaces:
IPaintStrategy

public class RectanglePaintStrategy
extends ShapePaintStrategy

Concrete paint strategy that paints a rectangular shape scaled to the size of the ball.


Field Summary
 
Fields inherited from class ballwar.model.paint.APaintStrategy
at
 
Fields inherited from interface ballwar.model.IPaintStrategy
NullObject
 
Constructor Summary
RectanglePaintStrategy()
          No-parameter constructor that instantiates the AffineTransform for internal use plus defines a prototype Rectangle of a width = 8/3 and height = 2/3 which is an average radius of 1.
RectanglePaintStrategy(AffineTransform at, double x, double y, double width, double height)
          Constructor that takes an external AffineTransform for internal use and a Rectangle centered at (x, y) with the given half-width and half-height (= x-radius and y-radius).
 
Method Summary
 
Methods inherited from class ballwar.model.paint.ShapePaintStrategy
paintXfrm
 
Methods inherited from class ballwar.model.paint.APaintStrategy
init, paint, paintCfg
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RectanglePaintStrategy

public RectanglePaintStrategy()
No-parameter constructor that instantiates the AffineTransform for internal use plus defines a prototype Rectangle of a width = 8/3 and height = 2/3 which is an average radius of 1.


RectanglePaintStrategy

public RectanglePaintStrategy(AffineTransform at,
                              double x,
                              double y,
                              double width,
                              double height)
Constructor that takes an external AffineTransform for internal use and a Rectangle centered at (x, y) with the given half-width and half-height (= x-radius and y-radius).

Parameters:
at - The AffineTransform to use
x - The x-coordinate of the center of the prototype rectangle
y - The y-coordinate of the center of the prototype rectangle
width - The half-width of the rectangle, i.e. the width as measured from the center.
height - The half-hieght of the rectangle, i.e. the height as measured from the center.