diff options
Diffstat (limited to 'src/jrummikub/control/network/NetworkControl.java')
-rw-r--r-- | src/jrummikub/control/network/NetworkControl.java | 38 |
1 files changed, 20 insertions, 18 deletions
diff --git a/src/jrummikub/control/network/NetworkControl.java b/src/jrummikub/control/network/NetworkControl.java index 0a7ea8d..95f48a4 100644 --- a/src/jrummikub/control/network/NetworkControl.java +++ b/src/jrummikub/control/network/NetworkControl.java @@ -13,7 +13,6 @@ import jrummikub.util.GameData; import jrummikub.util.IEvent; import jrummikub.util.IListener; import jrummikub.util.IListener1; -import jrummikub.util.IListener2; import jrummikub.util.LoginData; import jrummikub.view.IView; @@ -21,7 +20,7 @@ import jrummikub.view.IView; * Class dealing with network connection, offering and choice of network games */ public class NetworkControl { - private ConnectionControl connectionControl; + private IConnectionControl connectionControl; private IView view; private List<Connection> connections = new ArrayList<Connection>(); private Event stopNetworkEvent = new Event(); @@ -37,9 +36,9 @@ public class NetworkControl { * Creates a new network control * * @param loginData - * user's login data + * user's login data * @param view - * for events and handlers + * for events and handlers */ public NetworkControl(final LoginData loginData, final IView view) { this.view = view; @@ -82,19 +81,21 @@ public class NetworkControl { * Adds the listeners for connection control events * * @param loginData - * player's login data + * player's login data * @param view - * view for events + * view for events */ public void addConnectionControlListeners(final LoginData loginData, final IView view) { - connections.add(connectionControl.getConnectedEvent().add(new IListener() { - @Override - public void handle() { - view.getGameListPanel().setChannelName(loginData.getChannelName()); - view.showGameListPanel(true); - } - })); + connections.add(connectionControl.getConnectedEvent().add( + new IListener() { + @Override + public void handle() { + view.getGameListPanel().setChannelName( + loginData.getChannelName()); + view.showGameListPanel(true); + } + })); connections.add(connectionControl.getConnectionFailedEvent().add( new IListener() { @@ -165,10 +166,10 @@ public class NetworkControl { GameData gameData = connectionControl.getCurrentGame(); gameJoinControl = new GameJoinControl(connectionControl, gameData, view); - gameJoinControl.getBackEvent().add(new IListener() { + gameJoinControl.getBackEvent().add(new IListener() { @Override public void handle() { - gameJoinControl=null; + gameJoinControl = null; view.showGameListPanel(true); } }); @@ -242,11 +243,12 @@ public class NetworkControl { if (gameOfferControl != null) { return; } - gameOfferControl = new GameOfferControl(connectionControl, settings, view); - gameOfferControl.getBackEvent().add(new IListener() { + gameOfferControl = new GameOfferControl(connectionControl, settings, + view); + gameOfferControl.getBackEvent().add(new IListener() { @Override public void handle() { - gameOfferControl=null; + gameOfferControl = null; view.showGameListPanel(true); } }); |