Move logoff handling into ClientController.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@418 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2001-10-09 19:23:26 +00:00
parent ce5bcd95d5
commit 8eb3dba6dc
2 changed files with 11 additions and 19 deletions
@@ -1,5 +1,5 @@
//
// $Id: ChatPanel.java,v 1.2 2001/10/09 17:47:33 mdb Exp $
// $Id: ChatPanel.java,v 1.3 2001/10/09 19:23:26 mdb Exp $
package com.threerings.micasa.client;
@@ -65,18 +65,6 @@ public class ChatPanel
epanel.add(_send, GroupLayout.FIXED);
add(epanel, GroupLayout.FIXED);
// add a logoff button
gl = new HGroupLayout(GroupLayout.NONE);
gl.setJustification(GroupLayout.RIGHT);
JPanel bpanel = new JPanel(gl);
JButton logoff = new JButton("Logoff");
logoff.addActionListener(this);
logoff.setActionCommand("logoff");
bpanel.add(logoff, GroupLayout.FIXED);
add(bpanel, GroupLayout.FIXED);
// focus the chat input field by default
_entry.requestFocus();
}
@@ -105,10 +93,6 @@ public class ChatPanel
if (cmd.equals("send")) {
sendText();
} else if (cmd.equals("logoff")) {
// request that we logoff
_ctx.getClient().logoff(true);
} else {
System.out.println("Unknown action event: " + cmd);
}
@@ -1,5 +1,5 @@
//
// $Id: ClientController.java,v 1.5 2001/10/09 18:20:08 mdb Exp $
// $Id: ClientController.java,v 1.6 2001/10/09 19:23:26 mdb Exp $
package com.threerings.micasa.client;
@@ -55,7 +55,15 @@ public class ClientController
// documentation inherited
public boolean handleAction (ActionEvent action)
{
Log.info("Got action: " + action);
String cmd = action.getActionCommand();
if (cmd.equals("logoff")) {
// request that we logoff
_ctx.getClient().logoff(true);
return true;
}
Log.info("Unhandled action: " + action);
return false;
}