ballworld.model.paint.shape
Class RectangleShapeFactory
java.lang.Object
ballworld.model.paint.shape.RectangleShapeFactory
- All Implemented Interfaces:
- IShapeFactory
public class RectangleShapeFactory
- extends java.lang.Object
- implements IShapeFactory
Concrete IShapeFactory that instantiates Rectangle2d.Double shapes.
Method Summary |
java.awt.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 java.awt.Shape makeShape(double x,
double y,
double xScale,
double yScale)
- Instantiates a Rectangle2D.Double object at the specified orign and size.
- Specified by:
makeShape
in interface IShapeFactory
- Parameters:
x
- The x-coordinate of the center of the prototype rectangley
- The y-coordinate of the center of the prototype rectanglexScale
- 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