From 531fe57b17394c931ee968a66104429e69cf60c6 Mon Sep 17 00:00:00 2001 From: Ida Massow Date: Fri, 27 May 2011 15:00:28 +0200 Subject: =?UTF-8?q?Test=20f=C3=BCr=20SettingsControl,=203=20neue=20Klassen?= =?UTF-8?q?,=20Mocks=20f=C3=BCr=20SettingPanel,=20lauter=20fixes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@285 72836036-5685-4462-b002-a69064685172 --- mock/jrummikub/view/MockSettingsPanel.java | 87 ++++++++++++++++++++++++++++++ mock/jrummikub/view/MockView.java | 5 +- 2 files changed, 90 insertions(+), 2 deletions(-) create mode 100644 mock/jrummikub/view/MockSettingsPanel.java (limited to 'mock') 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 removePlayerEvent = new MockEvent1(); + public MockEvent2 changePlayerColorEvent = new MockEvent2(); + public MockEvent2 changePlayerNameEvent = new MockEvent2(); + public MockEvent1 changeInitialMeldThresholdEvent = new MockEvent1(); + 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 getRemovePlayerEvent() { + return removePlayerEvent; + } + + @Override + public IEvent2 getChangePlayerColorEvent() { + return changePlayerColorEvent; + } + + @Override + public IEvent2 getChangePlayerNameEvent() { + return changePlayerNameEvent; + } + + @Override + public IEvent1 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 -- cgit v1.2.3