Search in sources :

Example 1 with ScalingFileChooser

use of de.hpi.bpt.scylla.GUI.ScalingFileChooser in project scylla by bptlab.

the class SimulationConfigurationPane method be_openGC.

private void be_openGC() {
    // Choose file to be opened
    ScalingFileChooser chooser = new ScalingFileChooser(ScyllaGUI.DEFAULTFILEPATH);
    chooser.setDialogTitle("Open Global Configuration File");
    int c = chooser.showDialog(SimulationConfigurationPane.this, "Open");
    // if the process is canceled, nothing happens
    if (c == ScalingFileChooser.APPROVE_OPTION) {
        if (chooser.getSelectedFile() != null) {
            try {
                globalPath = chooser.getSelectedFile().getPath();
                gcc = GlobalConfigurationCreator.createFromFile(globalPath);
                if (creator != null)
                    updateGCC();
                labelRefGCshow.setText(globalPath);
            } catch (JDOMException | IOException e1) {
                e1.printStackTrace();
            }
            ScyllaGUI.DEFAULTFILEPATH = chooser.getSelectedFile().getPath();
        } else {
            System.err.println("Could not open file");
        }
    }
}
Also used : ScalingFileChooser(de.hpi.bpt.scylla.GUI.ScalingFileChooser) IOException(java.io.IOException) JDOMException(org.jdom2.JDOMException)

Example 2 with ScalingFileChooser

use of de.hpi.bpt.scylla.GUI.ScalingFileChooser in project scylla by bptlab.

the class SimulationConfigurationPane method be_openPM.

private void be_openPM() {
    // Choose file to be opened
    ScalingFileChooser chooser = new ScalingFileChooser(ScyllaGUI.DEFAULTFILEPATH);
    chooser.setDialogTitle("Open Process Model File");
    int c = chooser.showDialog(SimulationConfigurationPane.this, "Open");
    // if the process is canceled, nothing happens
    if (c == ScalingFileChooser.APPROVE_OPTION) {
        if (chooser.getSelectedFile() != null) {
            try {
                boolean success = true;
                bpmnPath = chooser.getSelectedFile().getPath();
                if (creator != null)
                    success = updateModel();
                if (!success) {
                    clearBpmnPath();
                } else {
                    labelRefPMshow.setText(bpmnPath);
                }
            } catch (JDOMException | IOException e1) {
                e1.printStackTrace();
            }
            ScyllaGUI.DEFAULTFILEPATH = chooser.getSelectedFile().getPath();
        } else {
            System.err.println("Could not open file");
        }
    }
}
Also used : ScalingFileChooser(de.hpi.bpt.scylla.GUI.ScalingFileChooser) IOException(java.io.IOException) JDOMException(org.jdom2.JDOMException)

Aggregations

ScalingFileChooser (de.hpi.bpt.scylla.GUI.ScalingFileChooser)2 IOException (java.io.IOException)2 JDOMException (org.jdom2.JDOMException)2