From: Erik V. <ev...@us...> - 2010-01-11 23:06:49
|
Update of /cvsroot/rails/18xx/rails/ui/swing/gamespecific/_1856 In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv20271/rails/ui/swing/gamespecific/_1856 Modified Files: StatusWindow_1856.java Log Message: More dialogs made modal Index: StatusWindow_1856.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/gamespecific/_1856/StatusWindow_1856.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** StatusWindow_1856.java 8 Jan 2010 21:27:46 -0000 1.4 --- StatusWindow_1856.java 11 Jan 2010 23:06:05 -0000 1.5 *************** *** 1,11 **** package rails.ui.swing.gamespecific._1856; - import javax.swing.JDialog; - import rails.game.*; import rails.game.action.*; import rails.game.specific._1856.CGRFormationRound; import rails.ui.swing.StatusWindow; ! import rails.ui.swing.elements.RadioButtonDialog2; import rails.util.LocalText; import rails.util.Util; --- 1,9 ---- package rails.ui.swing.gamespecific._1856; import rails.game.*; import rails.game.action.*; import rails.game.specific._1856.CGRFormationRound; import rails.ui.swing.StatusWindow; ! import rails.ui.swing.elements.RadioButtonDialog; import rails.util.LocalText; import rails.util.Util; *************** *** 95,140 **** } ! /* ! Object choice = JOptionPane.showInputDialog(this, ! message, ! LocalText.getText("Select"), ! JOptionPane.QUESTION_MESSAGE, ! null, ! options.toArray(), ! options.get(0)); ! ! numberRepaid = minNumber + options.indexOf(choice); ! ! action.setNumberTaken(numberRepaid); ! process (action); ! */ ! RadioButtonDialog2 currentDialog = new RadioButtonDialog2 (this, LocalText.getText("Select"), message, options, 0); ! setCurrentDialog (currentDialog, action); ! } ! ! @Override ! public void dialogActionPerformed () { ! ! JDialog currentDialog = getCurrentDialog(); ! PossibleAction currentDialogAction = getCurrentDialogAction(); ! ! if (currentDialog instanceof RadioButtonDialog2 ! && currentDialogAction instanceof RepayLoans) { ! ! RadioButtonDialog2 dialog = (RadioButtonDialog2) currentDialog; ! RepayLoans action = (RepayLoans) currentDialogAction; ! int selected = dialog.getSelectedOption(); ! action.setNumberTaken(selected); ! } else { ! return; ! } ! ! gameUIManager.processOnServer(currentDialogAction); } - } --- 93,103 ---- } ! RadioButtonDialog currentDialog = new RadioButtonDialog (gameUIManager, LocalText.getText("Select"), message, options, 0); ! gameUIManager.setCurrentDialog (currentDialog, action); } } |