triptracker.client.gps.ui
Class RoutesForm

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

public class RoutesForm
extends GPSSocketAdapter
implements Form


Field Summary
protected  JButton cancelButton
           
protected  String name
           
protected static int nameCount
           
protected  JButton newButton
           
protected  JButton trackButton
           
 
Constructor Summary
RoutesForm(GPSGui view, GPSClientModel model, Form mainForm)
          The constructor creates a JPanel for the login information, and registers as a form on the view.
RoutesForm(GPSGui view, String name, GPSClientModel model, Form mainForm)
          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.
 JComponent getFormComponent()
          Returns the root JComponent object that this form operates on.
 String getName()
          Returns the name of this form.
 Route getNewRoute()
          Gets the new route
 String getNewRouteDesc()
          Gets the description of the new route created
 Route getRoute()
          Returns selected element in routeBox
 void refreshView()
          Invoked by FormManager right before this form is displayed.
 void routeCreated(int rId)
          Invoked when a route creation confirmation is received.
 void routeList(List<Route> routes)
          Invoked when a list of routes is received.
 void setRouteBox(List<Route> routes)
          Adds route elements to routeBox
 void setStatusMsg(String msg)
          Sets the status msg
 void showInfoDialog(String head, String info)
          Creates an info dialog with the give heading and info
 void showMain()
           
 boolean transferBufferedDialog()
          Dialog created to ask if transfer buffered coordinates
 
Methods inherited from class triptracker.client.net.GPSSocketAdapter
connectionUpdate, invalidMessage, 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

trackButton

protected final JButton trackButton

cancelButton

protected final JButton cancelButton

newButton

protected final JButton newButton
Constructor Detail

RoutesForm

public RoutesForm(GPSGui view,
                  GPSClientModel model,
                  Form mainForm)
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

RoutesForm

public RoutesForm(GPSGui view,
                  String name,
                  GPSClientModel model,
                  Form mainForm)
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 - parent 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()
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

showMain

public void showMain()

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

routeList

public void routeList(List<Route> routes)
Description copied from class: GPSSocketAdapter
Invoked when a list of routes is received.

Specified by:
routeList in interface GPSSocketListener
Overrides:
routeList in class GPSSocketAdapter
Parameters:
routes - list of routes

routeCreated

public void routeCreated(int rId)
Description copied from class: GPSSocketAdapter
Invoked when a route creation confirmation is received.

Specified by:
routeCreated in interface GPSSocketListener
Overrides:
routeCreated in class GPSSocketAdapter
Parameters:
rId - ID of new route

setRouteBox

public void setRouteBox(List<Route> routes)
Adds route elements to routeBox


getRoute

public Route getRoute()
Returns selected element in routeBox


setStatusMsg

public void setStatusMsg(String msg)
Sets the status msg

Parameters:
msg - msg in the statusbar

transferBufferedDialog

public boolean transferBufferedDialog()
Dialog created to ask if transfer buffered coordinates

Returns:
true if transfer

showInfoDialog

public void showInfoDialog(String head,
                           String info)
Creates an info dialog with the give heading and info

Parameters:
head - the header of the dialog
info - the info message to give

getNewRouteDesc

public String getNewRouteDesc()
Gets the description of the new route created

Returns:
the description of the new route

getNewRoute

public Route getNewRoute()
Gets the new route

Returns:
the new route


Copyright © 2006 Team Trip Tracker. All Rights Reserved.