summaryrefslogtreecommitdiffstats
path: root/src/jrummikub/control
diff options
context:
space:
mode:
authorIda Massow <massow@informatik.uni-luebeck.de>2011-06-19 00:28:23 +0200
committerIda Massow <massow@informatik.uni-luebeck.de>2011-06-19 00:28:23 +0200
commitd47e291d19dfc2c3a351c0ba94469e3d50637411 (patch)
treeb54027e861277fdc8205a6b7dc4c44f63dfb3242 /src/jrummikub/control
parent80f0c0d43faab53ec30333529d748bdd725a72df (diff)
downloadJRummikub-d47e291d19dfc2c3a351c0ba94469e3d50637411.tar
JRummikub-d47e291d19dfc2c3a351c0ba94469e3d50637411.zip
Tests für NetworkControl
git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@473 72836036-5685-4462-b002-a69064685172
Diffstat (limited to 'src/jrummikub/control')
-rw-r--r--src/jrummikub/control/ApplicationControl.java6
-rw-r--r--src/jrummikub/control/network/ConnectionControl.java4
-rw-r--r--src/jrummikub/control/network/NetworkControl.java12
3 files changed, 11 insertions, 11 deletions
diff --git a/src/jrummikub/control/ApplicationControl.java b/src/jrummikub/control/ApplicationControl.java
index 3e429d2..bcf497f 100644
--- a/src/jrummikub/control/ApplicationControl.java
+++ b/src/jrummikub/control/ApplicationControl.java
@@ -1,5 +1,6 @@
package jrummikub.control;
+import jrummikub.control.network.ConnectionControl;
import jrummikub.control.network.NetworkControl;
import jrummikub.model.GameSettings;
import jrummikub.model.GameState;
@@ -71,7 +72,7 @@ public class ApplicationControl {
@Override
public void handle() {
abortControls();
-
+
loginControl = new LoginControl(view);
loginControl.getLoginEvent().add(new IListener1<LoginData>() {
@Override
@@ -149,7 +150,8 @@ public class ApplicationControl {
}
private void createNetworkControl(LoginData loginData) {
- networkControl = new NetworkControl(loginData, view);
+ ConnectionControl connectionControl = new ConnectionControl(loginData);
+ networkControl = new NetworkControl(loginData, connectionControl, view);
networkControl.getStopNetworkEvent().add(new IListener() {
@Override
diff --git a/src/jrummikub/control/network/ConnectionControl.java b/src/jrummikub/control/network/ConnectionControl.java
index e435309..81f6095 100644
--- a/src/jrummikub/control/network/ConnectionControl.java
+++ b/src/jrummikub/control/network/ConnectionControl.java
@@ -32,7 +32,7 @@ import org.jivesoftware.smack.util.Base64;
import org.jivesoftware.smackx.muc.DiscussionHistory;
import org.jivesoftware.smackx.muc.MultiUserChat;
-class ConnectionControl implements IConnectionControl {
+public class ConnectionControl implements IConnectionControl {
private final static String ELEMENT_NAME = "rummikub";
private final static String NAMESPACE = "http://home.universe-factory.net/rummikub/";
@@ -57,7 +57,7 @@ class ConnectionControl implements IConnectionControl {
private volatile GameData offeredGame;
- ConnectionControl(LoginData loginData) {
+ public ConnectionControl(LoginData loginData) {
this.loginData = loginData;
}
diff --git a/src/jrummikub/control/network/NetworkControl.java b/src/jrummikub/control/network/NetworkControl.java
index a8faac5..cfb3c14 100644
--- a/src/jrummikub/control/network/NetworkControl.java
+++ b/src/jrummikub/control/network/NetworkControl.java
@@ -40,12 +40,13 @@ public class NetworkControl {
* @param view
* for events and handlers
*/
- public NetworkControl(final LoginData loginData, final IView view) {
+ public NetworkControl(final LoginData loginData,
+ IConnectionControl connectionControl, final IView view) {
this.view = view;
- connectionControl = new ConnectionControl(loginData);
+ this.connectionControl = connectionControl;
addConnectionSetupListeners(loginData, view);
- addConnectionControlListeners(loginData, view);
+ addConnectionControlListeners(view);
connections.add(view.getGameListPanel().getJoinEvent().add(
new IListener1<GameData>() {
@@ -81,13 +82,10 @@ public class NetworkControl {
/**
* Adds the listeners for connection control events
*
- * @param loginData
- * player's login data
* @param view
* view for events
*/
- public void addConnectionControlListeners(final LoginData loginData,
- final IView view) {
+ public void addConnectionControlListeners(final IView view) {
connections.add(connectionControl.getGameOfferEvent().add(
new IListener1<GameData>() {
@Override