summaryrefslogtreecommitdiffstats
path: root/src/jrummikub/view/impl
diff options
context:
space:
mode:
Diffstat (limited to 'src/jrummikub/view/impl')
-rw-r--r--src/jrummikub/view/impl/PlayerPanel.java5
-rw-r--r--src/jrummikub/view/impl/StartTurnPanel.java18
2 files changed, 23 insertions, 0 deletions
diff --git a/src/jrummikub/view/impl/PlayerPanel.java b/src/jrummikub/view/impl/PlayerPanel.java
index 111ec1a..b7bdb32 100644
--- a/src/jrummikub/view/impl/PlayerPanel.java
+++ b/src/jrummikub/view/impl/PlayerPanel.java
@@ -50,6 +50,11 @@ class PlayerPanel extends JPanel implements IPlayerPanel {
return hand;
}
+ /**
+ * Sets the current player name
+ *
+ * @param playerName the player name
+ */
void setCurrentPlayerName(String playerName) {
currentPlayerNameLabel.setText(playerName);
}
diff --git a/src/jrummikub/view/impl/StartTurnPanel.java b/src/jrummikub/view/impl/StartTurnPanel.java
index d52ce22..ee94347 100644
--- a/src/jrummikub/view/impl/StartTurnPanel.java
+++ b/src/jrummikub/view/impl/StartTurnPanel.java
@@ -14,6 +14,9 @@ import javax.swing.border.EmptyBorder;
import jrummikub.util.Event;
import jrummikub.util.IEvent;
+/**
+ * A panel that is displayed before a player's turn
+ */
@SuppressWarnings("serial")
class StartTurnPanel extends JPanel {
private final static int PANEL_INSET = 15;
@@ -27,6 +30,9 @@ class StartTurnPanel extends JPanel {
private Event startTurnEvent = new Event();
+ /**
+ * Creates a new StartTurnPanel
+ */
StartTurnPanel() {
setLayout(null);
setBorder(new EmptyBorder(PANEL_INSET, PANEL_INSET, PANEL_INSET,
@@ -56,10 +62,22 @@ class StartTurnPanel extends JPanel {
});
}
+ /**
+ * Sets the current player name
+ *
+ * @param playerName
+ * the player name
+ */
void setCurrentPlayerName(String playerName) {
startTurnLabel.setText("'" + playerName + "' ist jetzt an der Reihe.");
}
+ /**
+ * The start turn event is emitted when the current player has clicked the
+ * start turn button
+ *
+ * @return the event
+ */
IEvent getStartTurnEvent() {
return startTurnEvent;
}