ballwar.model.paint.shape
Class RectangleShapeFactory
java.lang.Object
   ballwar.model.paint.shape.RectangleShapeFactory
ballwar.model.paint.shape.RectangleShapeFactory
- All Implemented Interfaces: 
- IShapeFactory
- public class RectangleShapeFactory 
- extends Object- implements IShapeFactory
Concrete IShapeFactory that instantiates Rectangle2d.Double shapes.
 
 
| Method Summary | 
|  Shape | makeShape(double x,
          double y,
          double xScale,
          double yScale)Instantiates a Rectangle2D.Double object at the specified orign and size.
 | 
 
| Methods inherited from class java.lang.Object | 
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
 
Singleton
public static final RectangleShapeFactory Singleton
- Singleton pattern
 
 
RectangleShapeFactory
private RectangleShapeFactory()
makeShape
public Shape makeShape(double x,
                       double y,
                       double xScale,
                       double yScale)
- Instantiates a Rectangle2D.Double object at the specified orign and size.
 
- 
- Specified by:
- makeShapein interface- IShapeFactory
 
- 
- Parameters:
- x- The x-coordinate of the center of the prototype rectangle
- y- The y-coordinate of the center of the prototype rectangle
- xScale- The half-width of the rectangle, i.e. the width as measured from the center.
- yScale- The half-hieght of the rectangle, i.e. the height as measured from the center.
- Returns:
- A Rectangle2D.Double instance