Browse Source

GUI simulator fix: new path action triggers model parse if it had not been done (e.g. due to large models not auto-parsing).

git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@10404 bbc10eb1-c90d-0410-af57-cb519fbb1720
master
Dave Parker 11 years ago
parent
commit
c2bc82b76c
  1. 29
      prism/src/userinterface/simulator/GUISimulator.java

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

@ -30,6 +30,7 @@ package userinterface.simulator;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.table.*;
import javax.swing.event.*;
@ -62,6 +63,8 @@ public class GUISimulator extends GUIPlugin implements MouseListener, ListSelect
//Current State
private boolean pathActive;
private ModulesFile parsedModel;
private boolean newPathAfterReceiveParseNotification, newPathPlotAfterReceiveParseNotification;
private boolean chooseInitialState;
private GUISimulatorPathTableModel pathTableModel;
private UpdateTableModel updateTableModel;
@ -317,6 +320,15 @@ public class GUISimulator extends GUIPlugin implements MouseListener, ListSelect
public void a_newPath(boolean chooseInitialState)
{
// Request a parse
newPathAfterReceiveParseNotification = true;
this.chooseInitialState = chooseInitialState;
notifyEventListeners(new GUIPropertiesEvent(GUIPropertiesEvent.REQUEST_MODEL_PARSE));
}
public void newPathAfterParse()
{
newPathAfterReceiveParseNotification = false;
Values initialState;
try {
// Check model is simulate-able
@ -696,6 +708,15 @@ public class GUISimulator extends GUIPlugin implements MouseListener, ListSelect
public void a_newPathPlot(boolean chooseInitialState)
{
// Request a parse
newPathPlotAfterReceiveParseNotification = true;
this.chooseInitialState = chooseInitialState;
notifyEventListeners(new GUIPropertiesEvent(GUIPropertiesEvent.REQUEST_MODEL_PARSE));
}
public void newPathPlotAfterParse()
{
newPathPlotAfterReceiveParseNotification = false;
Values initialState;
try {
// Check model is simulate-able
@ -865,7 +886,13 @@ public class GUISimulator extends GUIPlugin implements MouseListener, ListSelect
} else if (me.getID() == GUIModelEvent.MODEL_PARSED) {
a_loadModulesFile(me.getModulesFile());
doEnables();
}
if (newPathAfterReceiveParseNotification)
newPathAfterParse();
if (newPathPlotAfterReceiveParseNotification)
newPathPlotAfterParse();
} else if (me.getID() == GUIModelEvent.MODEL_PARSE_FAILED) {
newPathAfterReceiveParseNotification = false;
newPathPlotAfterReceiveParseNotification = false; }
} else if (e instanceof GUIComputationEvent) {
if (e.getID() == GUIComputationEvent.COMPUTATION_START) {

Loading…
Cancel
Save