diff options
Diffstat (limited to 'src/jrummikub/view')
-rw-r--r-- | src/jrummikub/view/ISettingsPanel.java | 2 | ||||
-rw-r--r-- | src/jrummikub/view/impl/SettingsPanel.java | 17 |
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()); |