summaryrefslogtreecommitdiffstats
path: root/src/jrummikub/control/network/LoginControl.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/jrummikub/control/network/LoginControl.java')
-rw-r--r--src/jrummikub/control/network/LoginControl.java61
1 files changed, 0 insertions, 61 deletions
diff --git a/src/jrummikub/control/network/LoginControl.java b/src/jrummikub/control/network/LoginControl.java
deleted file mode 100644
index 07e0b71..0000000
--- a/src/jrummikub/control/network/LoginControl.java
+++ /dev/null
@@ -1,61 +0,0 @@
-package jrummikub.control.network;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import jrummikub.util.Connection;
-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 {
- private IView view;
- private Event3<String, String, String> loginEvent = new Event3<String, String, String>();
- private Event cancelEvent = new Event();
- private List<Connection> connections = new ArrayList<Connection>();
-
- public LoginControl(final IView view) {
- this.view = view;
- connections.add(view.getLoginPanel().getLoginEvent()
- .add(new IListener3<String, String, String>() {
- @Override
- public void handle(String userName, String password,
- String channelName) {
- abort();
- loginEvent.emit(userName, password, channelName);
- }
- }));
-
- connections.add(view.getLoginPanel().getCancelEvent().add(new IListener() {
- @Override
- public void handle() {
- abort();
- cancelEvent.emit();
- }
- }));
- }
-
- public void startLogin() {
- view.showLoginPanel(true);
- }
-
- public IEvent3<String, String, String> getLoginEvent() {
- return loginEvent;
- }
-
- public IEvent getCancelEvent() {
- return cancelEvent;
- }
-
- public void abort() {
- view.showLoginPanel(false);
- for (Connection c : connections) {
- c.remove();
- }
- }
-
-}