/** ************************************************************************* * * Do the step */ private DialogAndInProcessCmd stepToProcess() { if (doAdd) { doAdd(); } else { doRemove(); } appState_.getPathControls().handlePathButtons(); return (new DialogAndInProcessCmd(DialogAndInProcessCmd.Progress.DONE, this)); }
/** ************************************************************************* * * Command */ public void doAdd() { UserTreePathStopCreationDialog scd = new UserTreePathStopCreationDialog(appState_); scd.setVisible(true); if (!scd.haveResult()) { return; } String addToPathKey = scd.getChosenPath(); String insertMode = scd.getInsertionMode(); appState_.getPathController().addAStop(addToPathKey, insertMode, dacx_); appState_.getPathControls().handlePathButtons(); return; }
/** ************************************************************************* * * Command */ public void doRemove() { if (appState_.getPathController().pathHasOnlyOneStop()) { ResourceManager rMan = appState_.getRMan(); int ok = JOptionPane.showConfirmDialog( appState_.getTopFrame(), rMan.getString("treePathDeleteStop.oneStopWarningMessage"), rMan.getString("treePathDeleteStop.oneStopWarningMessageTitle"), JOptionPane.YES_NO_OPTION); if (ok != JOptionPane.YES_OPTION) { return; } } appState_.getPathController().deleteCurrentStop(dacx_); appState_.getPathControls().handlePathButtons(); return; }