summaryrefslogtreecommitdiffstats
path: root/src/jrummikub/view/impl
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 /src/jrummikub/view/impl
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 'src/jrummikub/view/impl')
-rw-r--r--src/jrummikub/view/impl/SettingsPanel.java98
1 files changed, 83 insertions, 15 deletions
diff --git a/src/jrummikub/view/impl/SettingsPanel.java b/src/jrummikub/view/impl/SettingsPanel.java
index 7a9347c..03cfd4c 100644
--- a/src/jrummikub/view/impl/SettingsPanel.java
+++ b/src/jrummikub/view/impl/SettingsPanel.java
@@ -32,7 +32,9 @@ import javax.swing.event.DocumentListener;
import jrummikub.model.GameSettings;
import jrummikub.model.PlayerSettings;
import jrummikub.util.Event1;
+import jrummikub.util.IEvent;
import jrummikub.util.IEvent1;
+import jrummikub.util.IEvent2;
import jrummikub.view.ISettingsPanel;
@SuppressWarnings("serial")
@@ -66,15 +68,13 @@ class SettingsPanel extends JPanel implements ISettingsPanel {
private Event1<GameSettings> settingsChangeEvent = new Event1<GameSettings>();
private Event1<GameSettings> startGameEvent = new Event1<GameSettings>();
- @Override
- public IEvent1<GameSettings> getSettingsChangeEvent() {
- return settingsChangeEvent;
- }
-
- @Override
- public IEvent1<GameSettings> getStartGameEvent() {
- return startGameEvent;
- }
+ /*
+ * @Override public IEvent1<GameSettings> getSettingsChangeEvent() { return
+ * settingsChangeEvent; }
+ *
+ * @Override public IEvent1<GameSettings> getStartGameEvent() { return
+ * startGameEvent; }
+ */
private void addPlayerSettings() {
// Find unused player name
@@ -104,7 +104,8 @@ class SettingsPanel extends JPanel implements ISettingsPanel {
break;
}
- PlayerSettingsPanel panel = new PlayerSettingsPanel("Spieler " + num, color);
+ PlayerSettingsPanel panel = new PlayerSettingsPanel("Spieler " + num,
+ color);
playerSettingsPanels.add(panel);
playerSettingsViewport.add(panel,
playerSettingsViewport.getComponentCount() - 1);
@@ -130,7 +131,8 @@ class SettingsPanel extends JPanel implements ISettingsPanel {
playerSettingsViewport.add(addPlayerPanel);
JButton addPlayerButton = new JButton("+");
- addPlayerButton.setFont(addPlayerButton.getFont().deriveFont(Font.BOLD));
+ addPlayerButton
+ .setFont(addPlayerButton.getFont().deriveFont(Font.BOLD));
addPlayerButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
@@ -180,8 +182,8 @@ class SettingsPanel extends JPanel implements ISettingsPanel {
});
add(startButton, c);
- setBorder(new CompoundBorder(new LineBorder(Color.BLACK), new EmptyBorder(
- 10, 10, 10, 10)));
+ setBorder(new CompoundBorder(new LineBorder(Color.BLACK),
+ new EmptyBorder(10, 10, 10, 10)));
}
private class PlayerSettingsPanel extends JPanel {
@@ -200,8 +202,8 @@ class SettingsPanel extends JPanel implements ISettingsPanel {
}
private void updateColor() {
- colorButton
- .setIcon(ImageUtil.createColorIcon(settings.getColor(), 16, 2));
+ colorButton.setIcon(ImageUtil.createColorIcon(settings.getColor(),
+ 16, 2));
}
private void setName() {
@@ -333,4 +335,70 @@ class SettingsPanel extends JPanel implements ISettingsPanel {
}
}
}
+
+ @Override
+ public IEvent getAddPlayerEvent() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public IEvent1<Integer> getRemovePlayerEvent() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public IEvent2<Integer, Color> getChangePlayerColorEvent() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public IEvent2<Integer, String> getChangePlayerNameEvent() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public IEvent1<Integer> getChangeInitialMeldThresholdEvent() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public void setError(SettingsError error) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void enableStartGameButton(boolean enable) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void enableAddPlayerButton(boolean enable) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void enableRemovePlayerButtons(boolean enable) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public IEvent getStartGameEvent() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public void setGameSettings(GameSettings gameSettings) {
+ // TODO Auto-generated method stub
+
+ }
}