diff options
Diffstat (limited to 'src/jrummikub/view')
-rw-r--r-- | src/jrummikub/view/ISettingsPanel.java | 12 | ||||
-rw-r--r-- | src/jrummikub/view/impl/SettingsPanel.java | 25 |
2 files changed, 30 insertions, 7 deletions
diff --git a/src/jrummikub/view/ISettingsPanel.java b/src/jrummikub/view/ISettingsPanel.java index d28a9b4..8c30c78 100644 --- a/src/jrummikub/view/ISettingsPanel.java +++ b/src/jrummikub/view/ISettingsPanel.java @@ -136,9 +136,17 @@ public interface ISettingsPanel { /** Everything is ok */ NO_ERROR, /** A player name is used twice */ - DUPLICATE_PLAYER_NAME, + DUPLICATE_PLAYER_NAME_ERROR, /** A player has an empty name */ - NO_PLAYER_NAME + NO_PLAYER_NAME_ERROR, + /** More Stones than present would be dealed */ + NOT_ENOUGH_STONES_ERROR, + + // warnings + /** threshold higher 100 */ + TOO_HIGH_THRESHOLD_WARNING, + /** Only computer players added */ + COMPUTER_PLAYERS_ONLY_WARNING } /** diff --git a/src/jrummikub/view/impl/SettingsPanel.java b/src/jrummikub/view/impl/SettingsPanel.java index 02dfc10..a5792e7 100644 --- a/src/jrummikub/view/impl/SettingsPanel.java +++ b/src/jrummikub/view/impl/SettingsPanel.java @@ -112,14 +112,31 @@ class SettingsPanel extends JPanel implements ISettingsPanel { case NO_ERROR: errorMessageLabel.setText(" "); break; - case DUPLICATE_PLAYER_NAME: + case DUPLICATE_PLAYER_NAME_ERROR: errorMessageLabel .setText("Jeder Spielername darf nur einmal verwendet werden."); + errorMessageLabel.setForeground(Color.RED); break; - case NO_PLAYER_NAME: + case NO_PLAYER_NAME_ERROR: errorMessageLabel.setText("Jeder Spieler muss einen Namen haben."); + errorMessageLabel.setForeground(Color.RED); + break; + case NOT_ENOUGH_STONES_ERROR: + errorMessageLabel + .setText("Es gibt nicht genug Steine f\u00fcr die gew\u00e4hlte Spieleranzahl."); + errorMessageLabel.setForeground(Color.RED); + break; + case COMPUTER_PLAYERS_ONLY_WARNING: + errorMessageLabel.setText("Es gibt keinen menschlichen Spieler."); + errorMessageLabel.setForeground(Color.ORANGE.darker()); + break; + case TOO_HIGH_THRESHOLD_WARNING: + errorMessageLabel + .setText("Die gew\u00e4hlte Schranke ist m\u00f6glicherweise zu hoch"); + errorMessageLabel.setForeground(Color.ORANGE.darker()); break; } + } @Override @@ -284,7 +301,6 @@ class SettingsPanel extends JPanel implements ISettingsPanel { add(tabbedPane, c); errorMessageLabel = new JLabel(" "); - errorMessageLabel.setForeground(Color.RED); c.weighty = 0; add(errorMessageLabel, c); @@ -313,8 +329,7 @@ class SettingsPanel extends JPanel implements ISettingsPanel { nameField.setText(settings.getName()); } // playerType.setSelectedIndex(0); - int index = Arrays.binarySearch( - TurnControlFactory.Type.values(), + int index = Arrays.binarySearch(TurnControlFactory.Type.values(), settings.getTurnControlType()); if (index != playerType.getSelectedIndex()) { playerType.setSelectedIndex(index); |