use of de.hpi.bpt.scylla.creation.SimulationConfiguration.SimulationConfigurationCreator.NotAValidFileException in project scylla by bptlab.
the class SimulationConfigurationPane method open.
@Override
protected void open() throws JDOMException, IOException {
buttonClosefile.setEnabled(true);
try {
creator = SimulationConfigurationCreator.createFromFile(getFile().getPath());
} catch (NotAValidFileException e1) {
setFile(null);
e1.printStackTrace();
return;
}
if (gcc != null)
creator.setGCC(gcc);
Element modelRoot = null;
if (bpmnPath != null && !bpmnPath.isEmpty())
try {
Document doc;
SAXBuilder builder = new SAXBuilder();
doc = builder.build(bpmnPath);
modelRoot = doc.getRootElement();
creator.setModel(modelRoot, false);
} catch (JDOMException | IOException e) {
e.printStackTrace();
} catch (NoProcessSpecifiedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (NotAuthorizedToOverrideException e) {
int override = showModelOverrideConfirmationDialog(e);
if (override == 0)
try {
creator.setModel(modelRoot, true);
} catch (NoProcessSpecifiedException | NotAuthorizedToOverrideException e1) {
e1.printStackTrace();
}
else
clearBpmnPath();
e.printStackTrace();
}
setChangeFlag(true);
textfieldId.loadSavedValue();
if (creator.getRandomSeed() != null) {
textfieldSeed.setValue(creator.getRandomSeed());
}
if (creator.getProcessInstances() != null)
spinnerNOI.setValue(Integer.parseInt(creator.getProcessInstances()));
String startDt = creator.getStartDateTime();
if (startDt != null) {
startDateTime = ZonedDateTime.parse(startDt);
textfieldStartTime.setValue(startDateTime.toLocalTime());
textfieldStartDate.setValue(startDateTime.toLocalDate());
}
String endDt = creator.getEndDateTime();
if (endDt != null) {
checkboxUnlimited.setSelected(false);
endDateTime = ZonedDateTime.parse(endDt);
textfieldEndTime.setValue(endDateTime.toLocalTime());
textfieldEndDate.setValue(endDateTime.toLocalDate());
} else {
checkboxUnlimited.setSelected(true);
textfieldEndDate.getComponent().setEnabled(false);
textfieldEndTime.getComponent().setEnabled(false);
}
importCreatorElements();
setChangeFlag(false);
setEnabled(true);
}
Aggregations