import java.awt.event.*;
import javax.swing.*;

public class ControllerAdapter extends MazeController implements ActionListener {

	public ControllerAdapter(Maze m) {
		super(m);
	}
	@Override
	public void actionPerformed(ActionEvent e) {
		String command = e.getActionCommand();
		try {
			execute(command);
		} catch(Exception x) {
			JOptionPane.showMessageDialog(null, x.getMessage(), "Oops!", JOptionPane.ERROR_MESSAGE);
		}
	}

}
