Пример #1
0
  public boolean openPathway(final File f) {
    final ProgressKeeper pk = new ProgressKeeper();
    final ProgressDialog d =
        new ProgressDialog(
            JOptionPane.getFrameForComponent(getApplicationPanel()), "", pk, false, true);

    engine.setWrapper(createWrapper());
    SwingWorker<Boolean, Boolean> sw =
        new SwingWorker<Boolean, Boolean>() {
          protected Boolean doInBackground() {
            pk.setTaskName("Opening pathway");
            try {
              engine.openPathway(f);
              return true;
            } catch (ConverterException e) {
              handleConverterException(e.getMessage(), null, e);
              return false;
            } finally {
              pk.finished();
            }
          }
        };

    return processTask(pk, d, sw);
  }
Пример #2
0
 public void newPathway() {
   engine.setWrapper(createWrapper());
   engine.newPathway();
 }