summaryrefslogtreecommitdiffstats
path: root/mock/jrummikub/view
diff options
context:
space:
mode:
authorIda Massow <massow@informatik.uni-luebeck.de>2011-05-27 15:00:28 +0200
committerIda Massow <massow@informatik.uni-luebeck.de>2011-05-27 15:00:28 +0200
commit531fe57b17394c931ee968a66104429e69cf60c6 (patch)
tree30976cf9a7909df97bd49740c74a835edf9f47c3 /mock/jrummikub/view
parentdf79c78dec6d9db0c60709fcb6728b5fab170379 (diff)
downloadJRummikub-531fe57b17394c931ee968a66104429e69cf60c6.tar
JRummikub-531fe57b17394c931ee968a66104429e69cf60c6.zip
Test für SettingsControl, 3 neue Klassen, Mocks für SettingPanel, lauter fixes
git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@285 72836036-5685-4462-b002-a69064685172
Diffstat (limited to 'mock/jrummikub/view')
-rw-r--r--mock/jrummikub/view/MockSettingsPanel.java87
-rw-r--r--mock/jrummikub/view/MockView.java5
2 files changed, 90 insertions, 2 deletions
diff --git a/mock/jrummikub/view/MockSettingsPanel.java b/mock/jrummikub/view/MockSettingsPanel.java
new file mode 100644
index 0000000..55090b5
--- /dev/null
+++ b/mock/jrummikub/view/MockSettingsPanel.java
@@ -0,0 +1,87 @@
+package jrummikub.view;
+
+import java.awt.Color;
+
+import jrummikub.model.GameSettings;
+import jrummikub.util.IEvent;
+import jrummikub.util.IEvent1;
+import jrummikub.util.IEvent2;
+import jrummikub.util.MockEvent;
+import jrummikub.util.MockEvent1;
+import jrummikub.util.MockEvent2;
+
+public class MockSettingsPanel implements ISettingsPanel {
+
+ public MockEvent addPlayerEvent = new MockEvent();
+ public MockEvent1<Integer> removePlayerEvent = new MockEvent1<Integer>();
+ public MockEvent2<Integer, Color> changePlayerColorEvent = new MockEvent2<Integer, Color>();
+ public MockEvent2<Integer, String> changePlayerNameEvent = new MockEvent2<Integer, String>();
+ public MockEvent1<Integer> changeInitialMeldThresholdEvent = new MockEvent1<Integer>();
+ public MockEvent startGameEvent = new MockEvent();
+ public SettingsError error = SettingsError.NO_ERROR;
+ public boolean startButtonEnabled = true;
+ public boolean addPlayerButtonEnabled = true;
+ public boolean removePlayerButtonsEnabled = false;
+ public GameSettings gameSettings = new GameSettings();
+
+ @Override
+ public IEvent getAddPlayerEvent() {
+ return addPlayerEvent;
+ }
+
+ @Override
+ public IEvent1<Integer> getRemovePlayerEvent() {
+ return removePlayerEvent;
+ }
+
+ @Override
+ public IEvent2<Integer, Color> getChangePlayerColorEvent() {
+ return changePlayerColorEvent;
+ }
+
+ @Override
+ public IEvent2<Integer, String> getChangePlayerNameEvent() {
+ return changePlayerNameEvent;
+ }
+
+ @Override
+ public IEvent1<Integer> getChangeInitialMeldThresholdEvent() {
+ return changeInitialMeldThresholdEvent;
+ }
+
+ @Override
+ public IEvent getStartGameEvent() {
+ return startGameEvent;
+ }
+
+ @Override
+ public void setError(SettingsError error) {
+ this.error = error;
+
+ }
+
+ @Override
+ public void enableStartGameButton(boolean enable) {
+ startButtonEnabled = enable;
+
+ }
+
+ @Override
+ public void enableAddPlayerButton(boolean enable) {
+ addPlayerButtonEnabled = enable;
+
+ }
+
+ @Override
+ public void enableRemovePlayerButtons(boolean enable) {
+ removePlayerButtonsEnabled = enable;
+
+ }
+
+ @Override
+ public void setGameSettings(GameSettings gameSettings) {
+ this.gameSettings = gameSettings;
+
+ }
+
+}
diff --git a/mock/jrummikub/view/MockView.java b/mock/jrummikub/view/MockView.java
index 5e145da..431641a 100644
--- a/mock/jrummikub/view/MockView.java
+++ b/mock/jrummikub/view/MockView.java
@@ -11,6 +11,8 @@ import jrummikub.util.MockEvent;
*/
public class MockView implements IView {
/** */
+ public MockSettingsPanel settingsPanel = new MockSettingsPanel();
+
public MockPlayerPanel playerPanel = new MockPlayerPanel();
/** */
public MockTablePanel tablePanel = new MockTablePanel();
@@ -86,8 +88,7 @@ public class MockView implements IView {
@Override
public ISettingsPanel getSettingsPanel() {
- // TODO Auto-generated method stub
- return null;
+ return settingsPanel;
}
@Override