triptracker.client.map.ui
Class LoginForm

java.lang.Object
  extended by triptracker.client.net.MapSocketAdapter
      extended by triptracker.client.map.ui.LoginForm
All Implemented Interfaces:
MapSocketListener, SocketListener, Form

public class LoginForm
extends MapSocketAdapter
implements Form


Nested Class Summary
 
Nested classes/interfaces inherited from interface triptracker.client.net.MapSocketListener
MapSocketListener.RouteState
 
Field Summary
protected  String name
           
protected static int nameCount
           
 
Constructor Summary
LoginForm(MapClientGui view, MapSocket model)
          The constructor creates a JPanel for the login information, and registers as a form on the view.
LoginForm(MapClientGui view, String name, MapSocket model)
          The constructor creates a JPanel for the login information, and registers as a form on the manager.
 
Method Summary
 void addLoginBtnListener(ActionListener listener)
          Register a listener on the login button.
 void connectionUpdate(ConnectionState state)
          Invoked when the connection state of the underlying socket has changed.
 JComponent getFormComponent()
          Returns the root JComponent object that this form operates on.
 String getName()
          Returns the name of this form.
 String getPassword()
           
 String getUsername()
           
 void refreshView()
          Invoked by FormManager right before this form is displayed.
 void setMessage(String msg)
           
 void socketError(IOException e)
          Invoked when a socket error is encountered. This generally means that the socket has been closed or at least disconnected from the server.
 
Methods inherited from class triptracker.client.net.MapSocketAdapter
coordReceived, coordsReceived, invalidMessage, routeList, routeReceived, routeUpdate, userReceived, usersReceived
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

nameCount

protected static int nameCount

name

protected final String name
Constructor Detail

LoginForm

public LoginForm(MapClientGui view,
                 MapSocket model)
The constructor creates a JPanel for the login information, and registers as a form on the view.

Parameters:
view - parent JComponent form manager
model - map model

LoginForm

public LoginForm(MapClientGui view,
                 String name,
                 MapSocket model)
The constructor creates a JPanel for the login information, and registers as a form on the manager. The form name should be unique for the given form manager.

Parameters:
view - JComponent form manager
name - unique form name
Method Detail

addLoginBtnListener

public void addLoginBtnListener(ActionListener listener)
Register a listener on the login button.

Parameters:
listener -

getFormComponent

public JComponent getFormComponent()
Description copied from interface: Form
Returns the root JComponent object that this form operates on.

Specified by:
getFormComponent in interface Form
Returns:
root JComponent object
See Also:
FormManager

getName

public String getName()
Description copied from interface: Form
Returns the name of this form. This name should be unique for each form for a given instance of FormManager.

Specified by:
getName in interface Form
Returns:
form name
See Also:
FormManager

getUsername

public String getUsername()

getPassword

public String getPassword()

setMessage

public void setMessage(String msg)

socketError

public void socketError(IOException e)
Invoked when a socket error is encountered. This generally means that the socket has been closed or at least disconnected from the server.

Specified by:
socketError in interface SocketListener
Overrides:
socketError in class MapSocketAdapter
Parameters:
e - the error that triggered the event

connectionUpdate

public void connectionUpdate(ConnectionState state)
Invoked when the connection state of the underlying socket has changed.

Specified by:
connectionUpdate in interface SocketListener
Overrides:
connectionUpdate in class MapSocketAdapter
Parameters:
state - new connection state

refreshView

public void refreshView()
Description copied from interface: Form
Invoked by FormManager right before this form is displayed.

Specified by:
refreshView in interface Form
See Also:
FormManager


Copyright © 2006 Team Trip Tracker. All Rights Reserved.