diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2011-04-30 22:12:00 +0200 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2011-04-30 22:12:00 +0200 |
commit | dd46130c8c8718fd108362d8133b6ca9e8c78325 (patch) | |
tree | a0752f2c9a875aef13bceaf90db2c044f438251b /src/jrummikub/JRummikub.java | |
parent | 9ea9b1150121738a5d5260d380aab654ef218079 (diff) | |
download | JRummikub-dd46130c8c8718fd108362d8133b6ca9e8c78325.tar JRummikub-dd46130c8c8718fd108362d8133b6ca9e8c78325.zip |
Add highlighting to board and table
git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@37 72836036-5685-4462-b002-a69064685172
Diffstat (limited to 'src/jrummikub/JRummikub.java')
-rw-r--r-- | src/jrummikub/JRummikub.java | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/jrummikub/JRummikub.java b/src/jrummikub/JRummikub.java index 93cef06..da2a0e9 100644 --- a/src/jrummikub/JRummikub.java +++ b/src/jrummikub/JRummikub.java @@ -1,6 +1,7 @@ package jrummikub; import java.util.ArrayList; +import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -59,10 +60,13 @@ public class JRummikub { stones.put(new Stone(9, StoneColor.RED, false), new Position(0.5f, 1)); stones.put(new Stone(7, StoneColor.BLACK, false), new Position(1.75f, 1)); - stones.put(new Stone(0, StoneColor.RED, true), new Position(2.5f, 0)); + Stone stoneJoker = new Stone(0, StoneColor.RED, true); + stones.put(stoneJoker, new Position(2.5f, 0)); stones.put(new Stone(0, StoneColor.BLACK, true), new Position(3.5f, 0)); - + view.getPlayerPanel().getBoard().setStones(stones); + view.getPlayerPanel().getBoard().setHighlightedStones(Collections.singleton(stoneJoker)); + view.getPlayerPanel().getBoard().getClickEvent().add(new IListener1<Position>(){ @Override @@ -87,13 +91,15 @@ public class JRummikub { List<Stone> stoneList = new ArrayList<Stone>(); stoneList.add(new Stone(7, StoneColor.BLACK, false)); - stoneList.add(new Stone(8, StoneColor.BLACK, false)); + Stone stone8 = new Stone(8, StoneColor.BLACK, false); + stoneList.add(stone8); stoneList.add(new Stone(9, StoneColor.BLACK, false)); stoneList.add(new Stone(10, StoneColor.BLACK, false)); stoneSets.put(new StoneSet(stoneList), new Position(3.5f, 4)); view.getTable().setStoneSets(stoneSets); + view.getTable().setHighlightedStones(Collections.singleton(stone8)); } |