Browse Source

Tidying/commenting in GUI simulator.

git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@10915 bbc10eb1-c90d-0410-af57-cb519fbb1720
master
Dave Parker 10 years ago
parent
commit
15cbc73554
  1. 44
      prism/src/userinterface/simulator/GUISimulator.java

44
prism/src/userinterface/simulator/GUISimulator.java

@ -85,6 +85,7 @@ import userinterface.properties.GUIPropertiesList;
import userinterface.properties.GUIProperty; import userinterface.properties.GUIProperty;
import userinterface.simulator.networking.GUINetworkEditor; import userinterface.simulator.networking.GUINetworkEditor;
import userinterface.util.GUIComputationEvent; import userinterface.util.GUIComputationEvent;
import userinterface.util.GUIEvent;
import userinterface.util.GUIExitEvent; import userinterface.util.GUIExitEvent;
@SuppressWarnings("serial") @SuppressWarnings("serial")
@ -92,13 +93,23 @@ public class GUISimulator extends GUIPlugin implements MouseListener, ListSelect
{ {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
//ATTRIBUTES
private GUIMultiProperties guiProp; //reference to the properties information
private GUIMultiModel guiMultiModel; //reference to the model plugin
// Links to other parts of the GUI
private GUIMultiProperties guiProp;
private GUIMultiModel guiMultiModel;
/** Underlying simulator */
private SimulatorEngine engine; private SimulatorEngine engine;
private FileFilter textFilter;
// GUI components
private UpdateTableModel updateTableModel;
private GUISimulatorPathTableModel pathTableModel;
// Menus/actions/etc.
private JMenu simulatorMenu; private JMenu simulatorMenu;
private JPopupMenu pathPopupMenu; private JPopupMenu pathPopupMenu;
private FileFilter textFilter;
private Action randomExploration, backtrack, backtrackToHere, removeToHere, newPath, newPathFromState, newPathPlot, newPathPlotFromState, resetPath,
exportPath, plotPath, configureView;
//Current State //Current State
private boolean pathActive; private boolean pathActive;
@ -106,21 +117,17 @@ public class GUISimulator extends GUIPlugin implements MouseListener, ListSelect
private boolean newPathAfterReceiveParseNotification, newPathPlotAfterReceiveParseNotification; private boolean newPathAfterReceiveParseNotification, newPathPlotAfterReceiveParseNotification;
private boolean chooseInitialState; private boolean chooseInitialState;
private GUISimulatorPathTableModel pathTableModel;
private UpdateTableModel updateTableModel;
private Values lastConstants, lastPropertyConstants, lastInitialState; private Values lastConstants, lastPropertyConstants, lastInitialState;
private boolean computing; private boolean computing;
// Config/options
private boolean displayStyleFast; private boolean displayStyleFast;
private boolean displayPathLoops; private boolean displayPathLoops;
private SimulationView view; private SimulationView view;
//Actions
private Action randomExploration, backtrack, backtrackToHere, removeToHere, newPath, newPathFromState, newPathPlot, newPathPlotFromState, resetPath,
exportPath, plotPath, configureView;
/** Creates a new instance of GUISimulator */
/**
* Creates a new instance of GUISimulator
*/
public GUISimulator(GUIPrism gui) public GUISimulator(GUIPrism gui)
{ {
super(gui, true); super(gui, true);
@ -294,6 +301,9 @@ public class GUISimulator extends GUIPlugin implements MouseListener, ListSelect
pathFormulaeList.repaint(); pathFormulaeList.repaint();
} }
/**
* React to a new model being loaded into the GUI.
*/
public void a_clearModel() public void a_clearModel()
{ {
// Blank out path table // Blank out path table
@ -912,15 +922,13 @@ public class GUISimulator extends GUIPlugin implements MouseListener, ListSelect
{ {
} }
public boolean processGUIEvent(userinterface.util.GUIEvent e)
@Override
public boolean processGUIEvent(GUIEvent e)
{ {
if (e instanceof GUIModelEvent) { if (e instanceof GUIModelEvent) {
GUIModelEvent me = (GUIModelEvent) e; GUIModelEvent me = (GUIModelEvent) e;
if (me.getID() == me.NEW_MODEL) {
//New Model
if (me.getID() == GUIModelEvent.NEW_MODEL) {
a_clearModel(); a_clearModel();
doEnables();
//newList();
} else if (me.getID() == GUIModelEvent.MODEL_PARSED) { } else if (me.getID() == GUIModelEvent.MODEL_PARSED) {
a_loadModulesFile(me.getModulesFile()); a_loadModulesFile(me.getModulesFile());
doEnables(); doEnables();

Loading…
Cancel
Save