diff options
Diffstat (limited to 'src/jrummikub/view/impl/PlayerPanel.java')
-rw-r--r-- | src/jrummikub/view/impl/PlayerPanel.java | 32 |
1 files changed, 21 insertions, 11 deletions
diff --git a/src/jrummikub/view/impl/PlayerPanel.java b/src/jrummikub/view/impl/PlayerPanel.java index a16b32f..dcd22ed 100644 --- a/src/jrummikub/view/impl/PlayerPanel.java +++ b/src/jrummikub/view/impl/PlayerPanel.java @@ -17,6 +17,7 @@ import javax.swing.JProgressBar; import javax.swing.UIManager; import javax.swing.border.EmptyBorder; +import jrummikub.control.turn.TurnMode; import jrummikub.model.Position; import jrummikub.model.Stone; import jrummikub.util.Event; @@ -268,8 +269,6 @@ class PlayerPanel extends JPanel implements IPlayerPanel { addComponentListener(rescaleListener); hand.addComponentListener(rescaleListener); - - setEndTurnMode(true, true); } private class LeftPanelResizeListener extends ComponentAdapter { @@ -363,16 +362,27 @@ class PlayerPanel extends JPanel implements IPlayerPanel { } @Override - public void setEndTurnMode(boolean inspectOnly, boolean mayRedeal) { - if (!inspectOnly) { - endTurnButton.setText("Zug beenden"); - } else if (!mayRedeal) { + public void setEndTurnMode(TurnMode turnMode) { + + switch (turnMode) { + case MAY_REDEAL: + endTurnButton.setVisible(false); + keepStonesButton.setVisible(true); + redealButton.setVisible(true); + break; + case INSPECT_ONLY: endTurnButton.setText("N\u00e4chster Spieler"); + endTurnButton.setVisible(true); + keepStonesButton.setVisible(false); + redealButton.setVisible(false); + break; + case NORMAL_TURN: + endTurnButton.setText("Zug beenden"); + endTurnButton.setVisible(true); + keepStonesButton.setVisible(false); + redealButton.setVisible(false); + break; } - boolean smallButtons = mayRedeal && inspectOnly; - endTurnButton.setVisible(!smallButtons); - keepStonesButton.setVisible(smallButtons); - redealButton.setVisible(smallButtons); } void showButtons(boolean show) { @@ -397,7 +407,7 @@ class PlayerPanel extends JPanel implements IPlayerPanel { sortByGroupsButton.setEnabled(enable); sortByRunsButton.setEnabled(enable); if (!enable) { - setEndTurnMode(false, false); + setEndTurnMode(TurnMode.NORMAL_TURN); endTurnButton.setText("<html><center>Computer denkt nach"); hand.setStones(Collections.<Pair<Stone, Position>> emptyList()); handRowDownButton.setForeground(Color.GRAY); |