summaryrefslogtreecommitdiffstats
path: root/src/jrummikub
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2011-06-18 18:07:48 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2011-06-18 18:07:48 +0200
commit1bddf11ce0d69e789bbb0fca421e00520dcd8559 (patch)
treede82701f2eec314681ce117b1a77e2adf5b4ec44 /src/jrummikub
parent6ffc2c38a2bf5b3a3e52eabb99977dfeabadbd81 (diff)
downloadJRummikub-1bddf11ce0d69e789bbb0fca421e00520dcd8559.tar
JRummikub-1bddf11ce0d69e789bbb0fca421e00520dcd8559.zip
Fix NullPointerException on pause mode
git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@468 72836036-5685-4462-b002-a69064685172
Diffstat (limited to 'src/jrummikub')
-rw-r--r--src/jrummikub/view/impl/StartTurnPanel.java36
1 files changed, 21 insertions, 15 deletions
diff --git a/src/jrummikub/view/impl/StartTurnPanel.java b/src/jrummikub/view/impl/StartTurnPanel.java
index 9418a3b..ccbaf91 100644
--- a/src/jrummikub/view/impl/StartTurnPanel.java
+++ b/src/jrummikub/view/impl/StartTurnPanel.java
@@ -31,7 +31,7 @@ class StartTurnPanel extends JPanel {
private Event startTurnEvent = new Event();
private Event acknowledgeInvalidEvent = new Event();
-
+
private Event buttonEvent = startTurnEvent;
/**
@@ -70,11 +70,12 @@ class StartTurnPanel extends JPanel {
void setCurrentPlayerName(String playerName) {
startTurnLabel.setText(playerName + " ist jetzt an der Reihe.");
}
-
+
void setInitialMeldError(int points) {
- startTurnLabel.setText("Es wurden weniger als " + points + " Punkte ausgelegt.");
+ startTurnLabel.setText("Es wurden weniger als " + points
+ + " Punkte ausgelegt.");
}
-
+
void setInitialMeldFirstError() {
startTurnLabel.setText("Vor dem Rauskommen darf nicht angelegt werden.");
}
@@ -82,7 +83,7 @@ class StartTurnPanel extends JPanel {
IEvent getStartTurnEvent() {
return startTurnEvent;
}
-
+
IEvent getAcknowledgeInvalidEvent() {
return acknowledgeInvalidEvent;
}
@@ -111,17 +112,22 @@ class StartTurnPanel extends JPanel {
}
public void setType(BottomPanelType type) {
+ if (type == null) {
+ return;
+ }
+
switch (type) {
- case START_TURN_PANEL:
- startTurnButton.setText("Zug beginnen");
- buttonEvent = startTurnEvent;
- break;
- case INVALID_TURN_PANEL:
- startTurnLabel.setText("Es liegen ung\u00FCltige Serien auf dem Tisch.");
- startTurnButton.setText("N\u00E4chster Spieler");
- buttonEvent = acknowledgeInvalidEvent;
- break;
+ case START_TURN_PANEL:
+ startTurnButton.setText("Zug beginnen");
+ buttonEvent = startTurnEvent;
+ break;
+ case INVALID_TURN_PANEL:
+ startTurnLabel
+ .setText("Es liegen ung\u00FCltige Serien auf dem Tisch.");
+ startTurnButton.setText("N\u00E4chster Spieler");
+ buttonEvent = acknowledgeInvalidEvent;
+ break;
}
-
+
}
}