triptracker.client.gps.ui
Class LoginForm

java.lang.Object
  extended by triptracker.client.net.GPSSocketAdapter
      extended by triptracker.client.gps.ui.LoginForm
All Implemented Interfaces:
GPSSocketListener, SocketListener, Form

public class LoginForm
extends GPSSocketAdapter
implements Form


Field Summary
protected  JButton cancelButton
           
protected  JButton loginButton
           
protected  String name
           
protected static int nameCount
           
 
Constructor Summary
LoginForm(GPSGui view, GPSClientModel model)
          The constructor creates a JPanel for the login information, and registers as a form on the view.
LoginForm(GPSGui view, String name, GPSClientModel model)
          The constructor creates a JPanel for the login information, and registers as a form on the view.
 
Method Summary
 void addBtnListener(ActionListener listener)
          Register a listener on the login button.
 void connectionUpdate(ConnectionState state)
          Connection Update
 JComponent getFormComponent()
          Gets the formComponent
 String getHostname()
          Get the hostname value
 String getName()
          Gets the name
 String getPassword()
          Get password
 int getPort()
          Get the active port
 String getUsername()
          Get username
 void refreshView()
          Invoked by FormManager right before this form is displayed.
 void setEnableControls(boolean enable)
           
 void setStatusMsg(String msg)
          Sets status message
 void showErrorDialog(String heading, String warning)
          Shows a warning dialog
 void showMain()
          Shows the main form
 
Methods inherited from class triptracker.client.net.GPSSocketAdapter
invalidMessage, routeCreated, routeList, socketError
 
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

loginButton

protected final JButton loginButton

cancelButton

protected final JButton cancelButton
Constructor Detail

LoginForm

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

Parameters:
view - JComponent form manager
model - GPS model

LoginForm

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

Parameters:
view - parant JComponent form manager
name - unique form name
model - GPS model
Method Detail

addBtnListener

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

Parameters:
listener -

getFormComponent

public JComponent getFormComponent()
Gets the formComponent

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

getName

public String getName()
Gets the name

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

getUsername

public String getUsername()
Get username

Returns:
username

getPassword

public String getPassword()
Get password

Returns:
password

setStatusMsg

public void setStatusMsg(String msg)
Sets status message

Parameters:
msg - the message

connectionUpdate

public void connectionUpdate(ConnectionState state)
Connection Update

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

getPort

public int getPort()
Get the active port

Returns:
port the port

getHostname

public String getHostname()
Get the hostname value

Returns:
hostname

showErrorDialog

public void showErrorDialog(String heading,
                            String warning)
Shows a warning dialog

Parameters:
heading - the heading for the dialog
warning - the warning to show in the dialog

showMain

public void showMain()
Shows the main form


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

setEnableControls

public void setEnableControls(boolean enable)


Copyright © 2006 Team Trip Tracker. All Rights Reserved.