* @return true if this panel caused the event, otherwise false
*/
public boolean checkAndDispatch(ActionEvent e) {
String cmd = e.getActionCommand();
Simulation sim = AvroraGui.instance.getSimulation();
if (STOP.equals(cmd)) {
sim.stop();
AvroraGui.instance.stopPaintThread();
return true;
} else if (RESUME.equals(cmd)) {
//If a sim is paused, resume it...if a sim is single stepped paused, go to next instruction
//otherwise, start the sim
if (sim.isPaused()) {
sim.resume();
} else if (simTimeSlider.getValue() == 5 && sim.isRunning()) {
// TODO: implement stepping of simulation
//sim.step();
} else if (!sim.isRunning()) {
//Set the correct terminal (that is, the debug terminal)
PrintStream tempstream = new PrintStream(new DebugStream(AvroraGui.instance));
Terminal.setOutput(tempstream);
// TODO: reset monitor panels
//clearMonitorPanels();
sim.start();
AvroraGui.instance.startPaintThread();
} else {
//this would most probably be run if we
//hit play and a sim is already running unpaused...in which
//case we do nothing (We DONT want to start two simulations
}
return true;
} else if (PAUSE.equals(cmd)) {
sim.pause();
return true;
} else if (REWIND.equals(cmd)) {
//move slider to the left
int slideValue = simTimeSlider.getValue();
if (slideValue <= -1) {