Update of /cvsroot/rails/18xx/rails/ui/swing In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv11565/rails/ui/swing Modified Files: RemainingTilesWindow.java StockChart.java ORUIManager.java StartRoundWindow.java UpgradesPanel.java GameUIManager.java Log Message: More rationalising of static method usage Index: ORUIManager.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/ORUIManager.java,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** ORUIManager.java 23 Sep 2009 21:38:57 -0000 1.29 --- ORUIManager.java 30 Oct 2009 21:53:04 -0000 1.30 *************** *** 513,517 **** GUIHex hex = map.getSelectedHex(); ! TileI tile = TileManager.get().getTile(tileId); // Check if the new tile must be connected to some other track --- 513,517 ---- GUIHex hex = map.getSelectedHex(); ! TileI tile = gameUIManager.getGameManager().getTileManager().getTile(tileId); // Check if the new tile must be connected to some other track Index: UpgradesPanel.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/UpgradesPanel.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** UpgradesPanel.java 11 Sep 2009 19:26:44 -0000 1.17 --- UpgradesPanel.java 30 Oct 2009 21:53:04 -0000 1.18 *************** *** 343,347 **** protected void setToolTip() { ! TileI currentTile = TileManager.get().getTile(internalId); StringBuffer tt = new StringBuffer("<html>"); tt.append("<b>Tile</b>: ").append(currentTile.getName()); // or --- 343,347 ---- protected void setToolTip() { ! TileI currentTile = orUIManager.getGameUIManager().getGameManager().getTileManager().getTile(internalId); StringBuffer tt = new StringBuffer("<html>"); tt.append("<b>Tile</b>: ").append(currentTile.getName()); // or Index: StockChart.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/StockChart.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** StockChart.java 3 Dec 2008 20:16:39 -0000 1.6 --- StockChart.java 30 Oct 2009 21:53:03 -0000 1.7 *************** *** 7,11 **** import javax.swing.*; ! import rails.game.*; import rails.ui.swing.elements.GUIStockSpace; --- 7,12 ---- import javax.swing.*; ! import rails.game.GameManager; ! import rails.game.StockSpaceI; import rails.ui.swing.elements.GUIStockSpace; *************** *** 22,28 **** private GridBagConstraints gc; private StockSpaceI[][] market; ! public StockChart() { super(); initialize(); --- 23,31 ---- private GridBagConstraints gc; private StockSpaceI[][] market; + private GameUIManager gameUIManager; ! public StockChart(GameUIManager gameUIManager) { super(); + this.gameUIManager = gameUIManager; initialize(); *************** *** 59,63 **** gc = new GridBagConstraints(); ! market = Game.getStockMarket().getStockChart(); gc.gridx = 0; --- 62,66 ---- gc = new GridBagConstraints(); ! market = gameUIManager.getGameManager().getStockMarket().getStockChart(); gc.gridx = 0; Index: RemainingTilesWindow.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/RemainingTilesWindow.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** RemainingTilesWindow.java 9 Oct 2009 19:03:49 -0000 1.5 --- RemainingTilesWindow.java 30 Oct 2009 21:53:03 -0000 1.6 *************** *** 58,62 **** private void init() { ! TileManager tmgr = TileManager.get(); TileI tile; Field label; --- 58,62 ---- private void init() { ! TileManager tmgr = gameUIManager.getGameManager().getTileManager(); TileI tile; Field label; Index: GameUIManager.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/GameUIManager.java,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** GameUIManager.java 25 Sep 2009 19:13:01 -0000 1.19 --- GameUIManager.java 30 Oct 2009 21:53:04 -0000 1.20 *************** *** 53,61 **** public GameUIManager() { ! } ! public void init (GameSetupWindow gameSetupWindow) { ! instance = this; this.gameSetupWindow = gameSetupWindow; --- 53,61 ---- public GameUIManager() { ! } ! public void init (GameSetupWindow gameSetupWindow) { ! instance = this; this.gameSetupWindow = gameSetupWindow; *************** *** 82,86 **** gameManager = GameManager.getInstance(); imageLoader = new ImageLoader(); ! stockChart = new StockChart(); reportWindow = new ReportWindow(gameManager); orWindow = new ORWindow(this); --- 82,86 ---- gameManager = GameManager.getInstance(); imageLoader = new ImageLoader(); ! stockChart = new StockChart(this); reportWindow = new ReportWindow(gameManager); orWindow = new ORWindow(this); *************** *** 101,105 **** } ! public void startLoadedGame() { gameUIInit(); --- 101,105 ---- } ! public void startLoadedGame() { gameUIInit(); *************** *** 113,117 **** lastAction = action; if (action != null) action.setActed(); ! log.debug("==Passing to server: " + action); --- 113,117 ---- lastAction = action; if (action != null) action.setActed(); ! log.debug("==Passing to server: " + action); *************** *** 120,127 **** action.setPlayerName(player.getName()); } ! // Process the action on the server boolean result = gameManager.process(action); ! // Follow-up the result log.debug("==Result from server: " + result); --- 120,127 ---- action.setPlayerName(player.getName()); } ! // Process the action on the server boolean result = gameManager.process(action); ! // Follow-up the result log.debug("==Result from server: " + result); *************** *** 176,183 **** * Actual round type is the class of the active Round subclass. * Visible round type is the class of one of the three 'basic' ! * round types: Start, Stock or Operating. * The latter type determines what UI windows will become visible. */ ! /* Process actual round type changes */ if (previousRound == null || !previousRound.equals(currentRound)) { --- 176,183 ---- * Actual round type is the class of the active Round subclass. * Visible round type is the class of one of the three 'basic' ! * round types: Start, Stock or Operating. * The latter type determines what UI windows will become visible. */ ! /* Process actual round type changes */ if (previousRound == null || !previousRound.equals(currentRound)) { *************** *** 297,304 **** } } ! ! /** Stub, to be overridden in subclasses for special round types */ protected void updateStatus(ActionPerformer activeWindow) { ! } --- 297,304 ---- } } ! ! /** Stub, to be overridden in subclasses for special round types */ protected void updateStatus(ActionPerformer activeWindow) { ! } *************** *** 419,423 **** } else { filename = ! saveDirectory + "/" + Game.getName() + "_" + saveDateTimeFormat.format(new Date()) + "." + saveExtension; --- 419,423 ---- } else { filename = ! saveDirectory + "/" + gameManager.getGameName() + "_" + saveDateTimeFormat.format(new Date()) + "." + saveExtension; Index: StartRoundWindow.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/StartRoundWindow.java,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** StartRoundWindow.java 9 Oct 2009 20:20:34 -0000 1.31 --- StartRoundWindow.java 30 Oct 2009 21:53:04 -0000 1.32 *************** *** 574,578 **** if (activeItem.hasSharePriceToSet()) { String compName = activeItem.getCompanyToSetPriceFor(); ! StockMarketI stockMarket = Game.getStockMarket(); // Get a sorted prices List --- 574,578 ---- if (activeItem.hasSharePriceToSet()) { String compName = activeItem.getCompanyToSetPriceFor(); ! StockMarketI stockMarket = gameUIManager.getGameManager().getStockMarket(); // Get a sorted prices List |