From: Stefan F. <ste...@us...> - 2010-03-08 20:34:06
|
Update of /cvsroot/rails/18xx/rails/ui/swing In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv2993/rails/ui/swing Modified Files: GameStatus.java StatusWindow.java GameUIManager.java Log Message: Improved GUI support for cash corrections and some refactoring of the corrections package. Index: StatusWindow.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/StatusWindow.java,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** StatusWindow.java 3 Mar 2010 00:44:38 -0000 1.38 --- StatusWindow.java 8 Mar 2010 20:33:27 -0000 1.39 *************** *** 344,348 **** } ! public void setupFor(RoundI round) { currentRound = round; --- 344,348 ---- } ! public boolean setupFor(RoundI round) { currentRound = round; *************** *** 358,370 **** disableCheckBoxMenuItem(MARKET_CMD); } - } - public void updateStatus() { - // correction actions always possible ! gameStatus.initCashCorrectionActions(); ! if (!(currentRound instanceof StockRound)) { ! return; } --- 358,370 ---- disableCheckBoxMenuItem(MARKET_CMD); } // correction actions always possible ! return gameStatus.initCashCorrectionActions(); ! } ! ! public void updateStatus() { ! ! if (!(currentRound instanceof StockRound)) { return; } Index: GameStatus.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/GameStatus.java,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** GameStatus.java 5 Mar 2010 20:50:35 -0000 1.42 --- GameStatus.java 8 Mar 2010 20:33:21 -0000 1.43 *************** *** 826,830 **** * Initializes the CashCorrectionActions */ ! public void initCashCorrectionActions() { // Clear all buttons --- 826,830 ---- * Initializes the CashCorrectionActions */ ! public boolean initCashCorrectionActions() { // Clear all buttons *************** *** 855,858 **** --- 855,860 ---- } + return (actions != null && !actions.isEmpty()); + } Index: GameUIManager.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/GameUIManager.java,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** GameUIManager.java 3 Mar 2010 00:44:50 -0000 1.41 --- GameUIManager.java 8 Mar 2010 20:33:27 -0000 1.42 *************** *** 333,336 **** --- 333,342 ---- } + boolean correctionOverride = statusWindow.setupFor(currentRound); + + if (correctionOverride) { + log.debug("Correction overrides active window: status window active"); + } + // Active window settings are handled last. // Side effects: the active window is made visible and put on top. *************** *** 341,345 **** startRoundWindow.toFront(); ! } else if (uiHints.getActivePanel() == GuiDef.Panel.STATUS) { log.debug("Entering Stock Round UI type"); --- 347,351 ---- startRoundWindow.toFront(); ! } else if (uiHints.getActivePanel() == GuiDef.Panel.STATUS || correctionOverride) { log.debug("Entering Stock Round UI type"); *************** *** 349,353 **** statusWindow.toFront(); ! } else if (uiHints.getActivePanel() == GuiDef.Panel.MAP) { log.debug("Entering Operating Round UI type "); --- 355,359 ---- statusWindow.toFront(); ! } else if (uiHints.getActivePanel() == GuiDef.Panel.MAP && !correctionOverride) { log.debug("Entering Operating Round UI type "); *************** *** 356,364 **** orWindow.toFront(); } ! ! ! ! statusWindow.setupFor(currentRound); ! // Update the currently visible round window // "Switchable" rounds will be handled from subclasses of this class. --- 362,367 ---- orWindow.toFront(); } ! ! // Update the currently visible round window // "Switchable" rounds will be handled from subclasses of this class. *************** *** 370,373 **** --- 373,377 ---- } else if (StatusWindow.class.isAssignableFrom(activeWindow.getClass())) { + // } else { log.debug("Updating Stock (status) round window"); |