summaryrefslogtreecommitdiffstats
path: root/src/jrummikub/view
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2011-06-15 19:02:13 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2011-06-15 19:02:13 +0200
commit1b9c7c47783a0872ca3bedfad6fb120f611d354b (patch)
treecb7568ba1c9c5822008fd2eafa93e4d98a5013b5 /src/jrummikub/view
parent3ffad8597290f91d21c2a2ba7657bbbc16ab1582 (diff)
downloadJRummikub-1b9c7c47783a0872ca3bedfad6fb120f611d354b.tar
JRummikub-1b9c7c47783a0872ca3bedfad6fb120f611d354b.zip
Start implementing color changing over network
git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@442 72836036-5685-4462-b002-a69064685172
Diffstat (limited to 'src/jrummikub/view')
-rw-r--r--src/jrummikub/view/ISettingsPanel.java2
-rw-r--r--src/jrummikub/view/impl/SettingsPanel.java17
2 files changed, 17 insertions, 2 deletions
diff --git a/src/jrummikub/view/ISettingsPanel.java b/src/jrummikub/view/ISettingsPanel.java
index 279526a..d01129e 100644
--- a/src/jrummikub/view/ISettingsPanel.java
+++ b/src/jrummikub/view/ISettingsPanel.java
@@ -237,6 +237,8 @@ public interface ISettingsPanel {
*/
public IEvent getOfferGameEvent();
+ public void setPlayerColors(Set<Color> colors);
+
/**
* Specifies the different kinds of settings errors that can be displayed
*/
diff --git a/src/jrummikub/view/impl/SettingsPanel.java b/src/jrummikub/view/impl/SettingsPanel.java
index d5599a1..b5a69c5 100644
--- a/src/jrummikub/view/impl/SettingsPanel.java
+++ b/src/jrummikub/view/impl/SettingsPanel.java
@@ -41,6 +41,7 @@ import javax.swing.JTabbedPane;
import javax.swing.JTextField;
import javax.swing.JToggleButton;
import javax.swing.SpinnerNumberModel;
+import javax.swing.UIManager;
import javax.swing.border.CompoundBorder;
import javax.swing.border.EmptyBorder;
import javax.swing.border.LineBorder;
@@ -67,6 +68,8 @@ class SettingsPanel extends JPanel implements ISettingsPanel {
private List<Boolean> removeButtonsEnabled = Collections.emptyList();
private List<Boolean> playerNamesEditable = Collections.emptyList();
+ private Set<Color> playerColors;
+
private SettingsMode settingsMode = SettingsMode.DEFAULT;
private JTabbedPane tabbedPane;
@@ -235,6 +238,11 @@ class SettingsPanel extends JPanel implements ISettingsPanel {
}
@Override
+ public void setPlayerColors(Set<Color> colors) {
+ playerColors = colors;
+ }
+
+ @Override
public void setError(SettingsError error) {
switch (error) {
case NO_ERROR:
@@ -454,7 +462,7 @@ class SettingsPanel extends JPanel implements ISettingsPanel {
jokerNumberLabel = new JLabel();
jokerNumberSpinner = createOptionSpinner(1, 999, 1, changeJokerNumberEvent);
- makeOptionLabel(row++, "Zeit für Spielzug:");
+ makeOptionLabel(row++, "Zeit f\u00fcr Spielzug:");
timeLabel = new JLabel();
timeSpinner = createOptionSpinner(1, 999, 1, changeTimeEvent);
@@ -1019,7 +1027,12 @@ class SettingsPanel extends JPanel implements ISettingsPanel {
JPopupMenu menu = new JPopupMenu();
for (Color c : PLAYER_COLORS) {
- add(new ColorButton(c, menu));
+ if (playerColors.contains(c)) {
+ add(new ColorButton(c, menu));
+ } else {
+ add(new JLabel(ImageUtil.createColorIcon(
+ UIManager.getColor("PopupMenu.background"), 16, 0)));
+ }
}
menu.setLayout(new BorderLayout());