package widget;


/**
 * An encapsulation of a "normal" Button
 *
 * @author  Prof. David Bernstein, James Madison University
 * @version 1.0
 */
public class Button extends AbstractButton
{
    protected ButtonModel       model;
    protected ButtonView        view;


    /**
     * Default constructor
     */
    public Button()
    {
	this("DefaultButtonActionCommand", 10, 10);
    }


    /**
     * Constructor
     *
     * @param ac            The action command associated with  this button
     * @param text          The text on the Button
     * @param width         The width of the Button (in pixels)
     * @param height        The height of the Button (in pixels)
     */
    public Button(String ac, int width, int height)
    {
	super();
	setModel(new ButtonModel(this, ac));
	setView(new ButtonView(this, width, height));

	setupEventHandlers();

	buttonType = NORMAL;
    }




    /**
     * Get the model associated with this component/Widget
     *
     * @return    The model
     */
    public WidgetModel getModel()
    {
	return model;
    }




    /**
     * Get the view associated with this component/Widget
     *
     * @return    The view
     */
    public WidgetView getView()
    {
	return view;
    }




    /**
     * Set the model associated with this component/Widget
     *
     * @param model    The model
     */
    public void setModel(ButtonModel model)
    {
	super.setModel(model);

	this.model = model;
    }






    /**
     * Set the View for this component/Widget
     *
     * @param view  The view
     */
    public void setView(ButtonView view)
    {
	super.setView(view);

	this.view = view;
    }


}
