From: Erik V. <ev...@us...> - 2009-12-13 16:39:56
|
Update of /cvsroot/rails/18xx/rails/ui/swing/hexmap In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv28822/rails/ui/swing/hexmap Modified Files: GUIHex.java Log Message: Implemented request to show low-price colours in SR and OR panels. Added a generic Model-to-View update mechanism (used by above) All configurable colours can now be specified as RGB decimally or hexadecimally. Index: GUIHex.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/hexmap/GUIHex.java,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** GUIHex.java 7 Nov 2009 12:09:55 -0000 1.25 --- GUIHex.java 13 Dec 2009 16:39:48 -0000 1.26 *************** *** 11,15 **** import rails.game.*; import rails.game.model.ModelObject; ! import rails.ui.swing.*; import rails.ui.swing.elements.ViewObject; import rails.util.Util; --- 11,16 ---- import rails.game.*; import rails.game.model.ModelObject; ! import rails.ui.swing.GUIToken; ! import rails.ui.swing.GameUIManager; import rails.ui.swing.elements.ViewObject; import rails.util.Util; *************** *** 163,169 **** setToolTip(); ! if (StatusWindow.useObserver) { ! model.addObserver(this); ! } } --- 164,168 ---- setToolTip(); ! model.addObserver(this); } *************** *** 679,683 **** /** Needed to satisfy the ViewObject interface. Currently not used. */ public void deRegister() { ! if (model != null && StatusWindow.useObserver) model.deleteObserver(this); } --- 678,682 ---- /** Needed to satisfy the ViewObject interface. Currently not used. */ public void deRegister() { ! if (model != null) model.deleteObserver(this); } *************** *** 707,711 **** log.debug("GUIHex " + model.getName() + " updated: new tile " + currentTileId + "/" + currentTileOrientation); ! GameUIManager.instance.orWindow.updateStatus(); } else { hexMap.repaint(getBounds()); --- 706,713 ---- log.debug("GUIHex " + model.getName() + " updated: new tile " + currentTileId + "/" + currentTileOrientation); ! ! if (GameUIManager.instance != null && GameUIManager.instance.orWindow != null) { ! GameUIManager.instance.orWindow.updateStatus(); ! } } else { hexMap.repaint(getBounds()); |