summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mock/jrummikub/view/MockView.java6
-rw-r--r--src/jrummikub/control/ApplicationControl.java8
-rw-r--r--src/jrummikub/control/LoginControl.java5
-rw-r--r--src/jrummikub/view/IView.java2
-rw-r--r--src/jrummikub/view/impl/View.java9
-rw-r--r--test/jrummikub/control/LoginControlTest.java2
6 files changed, 22 insertions, 10 deletions
diff --git a/mock/jrummikub/view/MockView.java b/mock/jrummikub/view/MockView.java
index 3c2bee9..d444b92 100644
--- a/mock/jrummikub/view/MockView.java
+++ b/mock/jrummikub/view/MockView.java
@@ -308,4 +308,10 @@ public class MockView implements IView {
// TODO Auto-generated method stub
}
+
+ @Override
+ public void resetLoginPanel() {
+ // TODO Auto-generated method stub
+
+ }
}
diff --git a/src/jrummikub/control/ApplicationControl.java b/src/jrummikub/control/ApplicationControl.java
index 71de63e..58d1690 100644
--- a/src/jrummikub/control/ApplicationControl.java
+++ b/src/jrummikub/control/ApplicationControl.java
@@ -95,7 +95,7 @@ public class ApplicationControl {
public void handle() {
abortControls();
- createLoginControl();
+ createLoginControl(true);
}
});
@@ -121,7 +121,7 @@ public class ApplicationControl {
/**
* Create a new network login control
*/
- private void createLoginControl() {
+ private void createLoginControl(boolean reset) {
loginControl = new LoginControl(view);
loginControl.getLoginEvent().add(new IListener1<LoginData>() {
@Override
@@ -135,7 +135,7 @@ public class ApplicationControl {
startApplication();
}
});
- loginControl.startLogin();
+ loginControl.startLogin(reset);
}
/**
@@ -234,7 +234,7 @@ public class ApplicationControl {
@Override
public void handle() {
networkControl = null;
- createLoginControl();
+ createLoginControl(false);
}
});
diff --git a/src/jrummikub/control/LoginControl.java b/src/jrummikub/control/LoginControl.java
index f26b0d6..24bfcf6 100644
--- a/src/jrummikub/control/LoginControl.java
+++ b/src/jrummikub/control/LoginControl.java
@@ -53,7 +53,10 @@ public class LoginControl {
* Open Login panel
*
*/
- public void startLogin() {
+ public void startLogin(boolean reset) {
+ if (reset) {
+ view.resetLoginPanel();
+ }
view.showLoginPanel(true);
}
diff --git a/src/jrummikub/view/IView.java b/src/jrummikub/view/IView.java
index 8643781..c0dc675 100644
--- a/src/jrummikub/view/IView.java
+++ b/src/jrummikub/view/IView.java
@@ -221,6 +221,8 @@ public interface IView {
*/
public void showLoginPanel(boolean show);
+ public void resetLoginPanel();
+
/**
* Enable/disable pause mode
*
diff --git a/src/jrummikub/view/impl/View.java b/src/jrummikub/view/impl/View.java
index 9a0bf9e..0f279ab 100644
--- a/src/jrummikub/view/impl/View.java
+++ b/src/jrummikub/view/impl/View.java
@@ -497,14 +497,15 @@ public class View extends JFrame implements IView {
@Override
public void showLoginPanel(boolean show) {
- if (show) {
- loginPanel.resetLoginPanel();
- }
-
loginPanel.setVisible(show);
}
@Override
+ public void resetLoginPanel() {
+ loginPanel.resetLoginPanel();
+ }
+
+ @Override
public void showGameListPanel(boolean show) {
if (show) {
gameListPanel.reset();
diff --git a/test/jrummikub/control/LoginControlTest.java b/test/jrummikub/control/LoginControlTest.java
index 152d069..3280153 100644
--- a/test/jrummikub/control/LoginControlTest.java
+++ b/test/jrummikub/control/LoginControlTest.java
@@ -20,7 +20,7 @@ public class LoginControlTest {
public void setup() {
view = new MockView();
loginControl = new LoginControl(view);
- loginControl.startLogin();
+ loginControl.startLogin(true);
}
/** */