package model.shapes; import javax.swing.*; /** * Factory to create IShapes. Extends a JPanel for graphical display. * * @author Mathias Ricken */ public abstract class AShapeFactory extends JPanel { /** * Name of the class to create. */ private String _className; /** * Constructor to initialize class name. * @param className name of the class to create */ public AShapeFactory(String className) { _className = className; } /** * Create the IShape that matches the current parameters. * @return IShape */ public abstract IShape makeShape(); /** * Return string representation of this factory. * @return string representation */ public String toString() { return _className; } }