package jsetool.gui; import java.awt.event.MouseEvent; import java.io.Serializable; /** * * @author Mike Lawson * * @since Nov 12, 2004 * * The FSMDrawingState class is the base class for all * states that the FSMDrawingPane may take. * * */ abstract class FSMDrawingState implements Serializable { /** * Constructs a new state for the given pane. * @param p * */ public FSMDrawingState(FSMDrawingPane p) { pane = p; } /** * Returns the associated drawing pane for the state. * @return FSMDrawingPane */ public FSMDrawingPane getPane() { return pane; } /** * Called when the state is entered. */ public abstract void enter(); /** * Called when the user clicks the mouse on the display. * * @param e * The mouse event associated with the click. * @throws Exception */ public abstract void mouseClicked(MouseEvent e) throws Exception; /** * Called when the user presses the mouse on the display. * @param e * @throws Exception * */ public abstract void mousePressed(MouseEvent e) throws Exception; /** * Called when the user drags the mosue on the display. * @param e * @throws Exception * */ public abstract void mouseDragged(MouseEvent e) throws Exception; /** * Called when the user releases the mouse after a drag. * @param e * @throws Exception */ public abstract void mouseReleased(MouseEvent e) throws Exception; protected FSMDrawingPane pane; }