use of org.vcell.model.rbm.gui.ValidateConstraintsPanel in project vcell by virtualcell.
the class ReturnBNGOutput method validateConstraints.
private void validateConstraints(BNGOutputSpec outputSpec) {
ValidateConstraintsPanel panel = new ValidateConstraintsPanel(owner);
ChildWindowManager childWindowManager = ChildWindowManager.findChildWindowManager(owner);
ChildWindow childWindow = childWindowManager.addChildWindow(panel, panel, "Apply the new constraints?");
// 320, 160 without the warning line
Dimension dim = new Dimension(376, 163);
childWindow.pack();
panel.setChildWindow(childWindow);
childWindow.setPreferredSize(dim);
childWindow.showModal();
if (panel.getButtonPushed() == ValidateConstraintsPanel.ActionButtons.Apply) {
System.out.println("pressed APPLY from task");
TaskCallbackMessage tcm = new TaskCallbackMessage(TaskCallbackStatus.TaskEndAdjustSimulationContextFlagsOnly, "");
owner.setNewCallbackMessage(tcm);
String string = "Updating the network constraints with the test values.";
System.out.println(string);
owner.updateOutputSpecToSimulationContext(outputSpec);
sc.getNetworkConstraints().updateConstraintsFromTest();
tcm = new TaskCallbackMessage(TaskCallbackStatus.Notification, string);
sc.firePropertyChange("appendToConsole", "", tcm);
return;
} else {
System.out.println("pressed CANCEL from task");
owner.updateOutputSpecToSimulationContext(null);
TaskCallbackMessage tcm = new TaskCallbackMessage(TaskCallbackStatus.Clean, "");
sc.appendToConsole(tcm);
String string = "The Network constraints were not updated with the test values.";
tcm = new TaskCallbackMessage(TaskCallbackStatus.Notification, string);
sc.firePropertyChange("appendToConsole", "", tcm);
// owner.refreshInterface();
return;
}
}
Aggregations