ballworld.model.paint.strategy
Class RectanglePaintStrategy

java.lang.Object
  extended by ballworld.model.paint.APaintStrategy
      extended by ballworld.model.paint.ShapePaintStrategy
          extended by ballworld.model.paint.strategy.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 ballworld.model.paint.APaintStrategy
at
 
Fields inherited from interface ballworld.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(java.awt.geom.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 ballworld.model.paint.ShapePaintStrategy
paintXfrm
 
Methods inherited from class ballworld.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(java.awt.geom.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.