Ejemplo n.º 1
0
  protected void executeSelectedAlgorithm() {

    try {
      if (m_Alg != null) {
        final GeoAlgorithm alg = m_Alg.getNewInstance();
        final int iRet =
            SextanteGUI.getGUIFactory().showAlgorithmDialog(alg, m_ParentDialog.getDialog(), null);
        if (iRet == IGUIFactory.OK) {
          final String[] cmd = alg.getAlgorithmAsCommandLineSentences();
          if (cmd != null) {
            History.addToHistory(cmd);
          }
          GeoAlgorithmExecutors.execute(alg, m_ParentDialog.getDialog());
          updateListOfMostRecentAlgorithms();
        }
      } else if (m_Action != null) {
        m_Action.execute();
      }
    } catch (final Exception e) {
      Sextante.addErrorToLog(e);
    }
  }