import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;

/**
 * TODO Put here a description of what this class does.
 *
 * @author LPrestonSegoIII
 * 		   Kyle Harris
 *         Created Mar 27, 2008.
 */
public class ToolsButton extends JButton implements ActionListener {
	private String name;
	private CanvasComponent canvas;
	/**
	 * CONTRUCTOR!.
	 *
	 * @param title - Title of the Button
	 * @param canvasComponent - The Canvas that we Draw On
	 */
	public ToolsButton (String title, CanvasComponent canvasComponent){
		super(title);
		this.name = title;
		this.canvas = canvasComponent;
		addActionListener(this);
	}

	public void actionPerformed(ActionEvent e) {
		//send the button ID to the Canvas
		this.canvas.chooseTool(this.name);
	}

}
