From 297d5de03ef6e9f0c55d461021699dd2d34051f7 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sat, 18 Jun 2011 17:36:09 +0200 Subject: Move some code to AbstractSettingsControl for consistency git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@466 72836036-5685-4462-b002-a69064685172 --- .../control/network/NetworkSettingsControl.java | 32 ++++++++++------------ 1 file changed, 14 insertions(+), 18 deletions(-) (limited to 'src/jrummikub/control/network') diff --git a/src/jrummikub/control/network/NetworkSettingsControl.java b/src/jrummikub/control/network/NetworkSettingsControl.java index 41cf5f8..1f6cc3d 100644 --- a/src/jrummikub/control/network/NetworkSettingsControl.java +++ b/src/jrummikub/control/network/NetworkSettingsControl.java @@ -28,11 +28,11 @@ public class NetworkSettingsControl extends AbstractSettingsControl { * Creates a new network settings control * * @param nickname - * to be set as player name + * to be set as player name * @param view - * for events and handlers + * for events and handlers * @param settings - * for playerNumber, color... + * for playerNumber, color... */ public NetworkSettingsControl(String nickname, IView view, GameSettings settings) { @@ -40,8 +40,6 @@ public class NetworkSettingsControl extends AbstractSettingsControl { this.nickname = nickname; view.getSettingsPanel().setSettingsMode(SettingsMode.NETWORK_SETUP); - view.getSettingsPanel().setPlayerNamesEditable( - Collections. emptyList()); addFirstPlayer(); addPlayer(); @@ -56,19 +54,18 @@ public class NetworkSettingsControl extends AbstractSettingsControl { } })); - connections.add(view.getSettingsPanel().getBackEvent() - .add(new IListener() { - @Override - public void handle() { - abort(); - backEvent.emit(); - } - })); + connections.add(view.getSettingsPanel().getBackEvent().add(new IListener() { + @Override + public void handle() { + abort(); + backEvent.emit(); + } + })); } /** - * The game offer event is emitted when a player wants to offer a new - * network game + * The game offer event is emitted when a player wants to offer a new network + * game * * @return the event */ @@ -96,9 +93,8 @@ public class NetworkSettingsControl extends AbstractSettingsControl { @Override protected void update() { - view.getSettingsPanel() - .enableAddPlayerButton( - settings.getPlayerList().size() < ISettingsPanel.PLAYER_COLORS.length); + view.getSettingsPanel().enableAddPlayerButton( + settings.getPlayerList().size() < ISettingsPanel.PLAYER_COLORS.length); checkSettings(); -- cgit v1.2.3