summaryrefslogtreecommitdiffstats
path: root/src/jrummikub/control/network
diff options
context:
space:
mode:
authorIda Massow <massow@informatik.uni-luebeck.de>2011-06-10 17:05:50 +0200
committerIda Massow <massow@informatik.uni-luebeck.de>2011-06-10 17:05:50 +0200
commitec53437da1d1ddd56fc4a4ba5429d1f3e9c5c558 (patch)
treee6ecf9b420928240b5ae8cae440d2b7c0a01359c /src/jrummikub/control/network
parent8e24819d8638110a4112f6898bd8d2e527a68db2 (diff)
downloadJRummikub-ec53437da1d1ddd56fc4a4ba5429d1f3e9c5c558.tar
JRummikub-ec53437da1d1ddd56fc4a4ba5429d1f3e9c5c558.zip
LoginControl ist fertig und getestet
git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@398 72836036-5685-4462-b002-a69064685172
Diffstat (limited to 'src/jrummikub/control/network')
-rw-r--r--src/jrummikub/control/network/LoginControl.java26
1 files changed, 25 insertions, 1 deletions
diff --git a/src/jrummikub/control/network/LoginControl.java b/src/jrummikub/control/network/LoginControl.java
index a9dd5e8..e03625d 100644
--- a/src/jrummikub/control/network/LoginControl.java
+++ b/src/jrummikub/control/network/LoginControl.java
@@ -4,6 +4,8 @@ import jrummikub.util.Event;
import jrummikub.util.Event3;
import jrummikub.util.IEvent;
import jrummikub.util.IEvent3;
+import jrummikub.util.IListener;
+import jrummikub.util.IListener3;
import jrummikub.view.IView;
public class LoginControl {
@@ -11,8 +13,30 @@ public class LoginControl {
private Event3<String, String, String> loginEvent = new Event3<String, String, String>();
private Event cancelEvent = new Event();
- public LoginControl(IView view) {
+ public LoginControl(final IView view) {
this.view = view;
+ view.getLoginPanel().getLoginEvent()
+ .add(new IListener3<String, String, String>() {
+ @Override
+ public void handle(String userName, String password,
+ String channelName) {
+ view.showLoginPanel(false);
+ loginEvent.emit(userName, password, channelName);
+ }
+ });
+
+ view.getLoginPanel().getCancelEvent().add(new IListener() {
+ @Override
+ public void handle() {
+ view.showLoginPanel(false);
+ cancelEvent.emit();
+ }
+ });
+ }
+
+ public void startLogin() {
+ view.clearView();
+ view.showLoginPanel(true);
}
public IEvent3<String, String, String> getLoginEvent() {