diff options
Diffstat (limited to 'src/jrummikub/view')
-rw-r--r-- | src/jrummikub/view/ILoginPanel.java | 5 | ||||
-rw-r--r-- | src/jrummikub/view/impl/LoginPanel.java | 15 |
2 files changed, 12 insertions, 8 deletions
diff --git a/src/jrummikub/view/ILoginPanel.java b/src/jrummikub/view/ILoginPanel.java index c80c48a..f464c77 100644 --- a/src/jrummikub/view/ILoginPanel.java +++ b/src/jrummikub/view/ILoginPanel.java @@ -1,11 +1,12 @@ package jrummikub.view; import jrummikub.util.IEvent; -import jrummikub.util.IEvent3; +import jrummikub.util.IEvent1; +import jrummikub.util.LoginData; public interface ILoginPanel { - public IEvent3<String, String, String> getLoginEvent(); + public IEvent1<LoginData> getLoginEvent(); public IEvent getCancelEvent(); diff --git a/src/jrummikub/view/impl/LoginPanel.java b/src/jrummikub/view/impl/LoginPanel.java index d6260ff..450c392 100644 --- a/src/jrummikub/view/impl/LoginPanel.java +++ b/src/jrummikub/view/impl/LoginPanel.java @@ -16,16 +16,18 @@ import javax.swing.border.EmptyBorder; import javax.swing.border.LineBorder; import jrummikub.util.Event; -import jrummikub.util.Event3; +import jrummikub.util.Event1; import jrummikub.util.IEvent; -import jrummikub.util.IEvent3; +import jrummikub.util.IEvent1; +import jrummikub.util.LoginData; import jrummikub.view.ILoginPanel; @SuppressWarnings("serial") class LoginPanel extends JPanel implements ILoginPanel { - private Event3<String, String, String> loginEvent = new Event3<String, String, String>(); + private Event1<LoginData> loginEvent = new Event1<LoginData>(); private Event cancelEvent = new Event(); private JTextField userNameField; + private JTextField serverNameField; private JTextField passwordField; private JTextField channelNameField; @@ -38,6 +40,7 @@ class LoginPanel extends JPanel implements ILoginPanel { c.weighty = 1; userNameField = addInputRow("Benutzername:"); + serverNameField = addInputRow("Server:"); passwordField = addInputRow("Passwort:"); channelNameField = addInputRow("Channel:"); add(Box.createVerticalGlue(), c); @@ -48,8 +51,8 @@ class LoginPanel extends JPanel implements ILoginPanel { loginButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent arg0) { - loginEvent.emit(userNameField.getText(), passwordField.getText(), - channelNameField.getText()); + loginEvent.emit(new LoginData(userNameField.getText(), serverNameField + .getText(), passwordField.getText(), channelNameField.getText())); } }); add(loginButton, c); @@ -73,7 +76,7 @@ class LoginPanel extends JPanel implements ILoginPanel { } @Override - public IEvent3<String, String, String> getLoginEvent() { + public IEvent1<LoginData> getLoginEvent() { return loginEvent; } |