Update of /cvsroot/rails/18xx/rails/ui/swing/hexmap
In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv9545/rails/ui/swing/hexmap
Modified Files:
GUIHex.java
Log Message:
Added Tile and Token location hints
Some minor fixes
Index: GUIHex.java
===================================================================
RCS file: /cvsroot/rails/18xx/rails/ui/swing/hexmap/GUIHex.java,v
retrieving revision 1.39
retrieving revision 1.40
diff -C2 -d -r1.39 -r1.40
*** GUIHex.java 28 Mar 2010 17:05:55 -0000 1.39
--- GUIHex.java 9 Apr 2010 07:20:27 -0000 1.40
***************
*** 40,43 ****
--- 40,44 ----
protected GeneralPath innerHexagon;
protected static final Color highlightColor = Color.red;
+ protected static final Color upgradableColor = Color.magenta;
protected Point center;
/** x and y coordinates on the map */
***************
*** 89,92 ****
--- 90,94 ----
// Selection is in-between GUI and rails.game state.
private boolean selected;
+ private boolean selectable;
protected static Logger log =
***************
*** 224,228 ****
if (selected) {
currentGUITile.setScale(SELECTED_SCALE);
! } else {
currentGUITile.setScale(NORMAL_SCALE);
provisionalGUITile = null;
--- 226,230 ----
if (selected) {
currentGUITile.setScale(SELECTED_SCALE);
! } else if (!isSelectable()) {
currentGUITile.setScale(NORMAL_SCALE);
provisionalGUITile = null;
***************
*** 234,237 ****
--- 236,253 ----
}
+ public void setSelectable(boolean selectable) {
+ this.selectable = selectable;
+ if (selectable) {
+ currentGUITile.setScale(SELECTED_SCALE);
+ } else {
+ currentGUITile.setScale(NORMAL_SCALE);
+ provisionalGUITile = null;
+ }
+ }
+
+ public boolean isSelectable() {
+ return selectable;
+ }
+
static boolean getAntialias() {
return antialias;
***************
*** 296,301 ****
Color terrainColor = Color.WHITE;
! if (isSelected()) {
! g2.setColor(highlightColor);
g2.fill(hexagon);
--- 312,320 ----
Color terrainColor = Color.WHITE;
! if (isSelected() || isSelectable()) {
! if (isSelected())
! g2.setColor(highlightColor);
! else
! g2.setColor(upgradableColor);
g2.fill(hexagon);
|