|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object triptracker.client.net.GPSSocketAdapter triptracker.client.gps.ui.MainForm
public class MainForm
Field Summary | |
---|---|
protected JButton |
gpsButton
|
protected JSpinner |
intervalSpinner
|
protected String |
name
|
protected static int |
nameCount
|
protected JButton |
serverButton
|
Constructor Summary | |
---|---|
MainForm(GPSGui view,
GPSClientModel model)
|
|
MainForm(GPSGui view,
GPSClientModel model,
String name)
|
Method Summary | |
---|---|
void |
addGPSBtnListener(ActionListener listener)
Register a listener on the GPS button. |
void |
addServerBtnListener(ActionListener listener)
Register a listener on the Server button. |
void |
addSpinnerListener(ChangeListener listener)
Adds an changelistener for the intervalspinner. |
void |
addTimerListener(ActionListener listener)
Adds an actionlistener for the timer. |
void |
bufferToFile()
Changes the text and icon on the server button to buffer mode, also changes the status msg. |
void |
connected(boolean connected)
Invoked when a GPS unit is connected or disconnected. |
void |
connectionUpdate(ConnectionState state)
Invoked when the connection state of the underlying socket has changed. |
void |
coordReceived(Coordinate coord)
Invoked when a new coordinate is received from the GPS unit. |
void |
createTimer(ActionListener listener)
Creates a new timer |
JComponent |
getFormComponent()
Gets the form's component |
int |
getInterval()
Gets the interval to get data from the GPS-unit |
String |
getName()
Gets the form name |
Timer |
getTimer()
Get the current timer |
void |
increaseRecievedField()
Increases the number of recieved coordinates |
void |
pauseFromGPS()
Changes the text and icon on the GPS button to pause mode, also changes the status msg. |
void |
readExcepion(IOException e)
Handles an read exception when trying to read data from the GPS-unit |
void |
recieveFromGPS()
Changes the text and icon on the GPS button to recieve mode, also changes the status msg. |
void |
refreshView()
Refreshes the form |
void |
setActiveRoute(String route)
Sets the activeroute label |
void |
setDistField(double dist)
Sets the distance field. |
void |
setGPSBtnTxt(String text)
Changes the text on the gpsButton. |
void |
setLastUpdateField(String update)
Sets the last updated field |
void |
setLatLonFields(String lat,
String lon)
Sets the latitude / logitude fields |
void |
setServerBtnTxt(String text)
Changes the text on the serverButton. |
void |
setStatusMsg(String status)
Set the status message on the status bar. |
void |
showErrorDialog(String heading,
String error)
Shows an error dialog. |
void |
showLogin()
Shows the loginform. |
void |
showMain()
Show main form. |
void |
showRoutes()
Show route form |
void |
startTimer()
Starts the timer. |
void |
statusUpdate(GPSStatusState state)
Invoked when the state for the connected GPS unit changes. |
void |
stopTimer()
Stops the timer. |
boolean |
timerIsRunning()
Checks wether the timer is running or not |
boolean |
transferBufferedDialog()
Creates a dialog for transfer buffered coordinates or not |
void |
transferToServer()
Transferring to server, changes status message, text on server button and the server button icon to transfer mode. |
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 |
---|
protected final String name
protected static int nameCount
protected final JButton gpsButton
protected final JButton serverButton
protected JSpinner intervalSpinner
Constructor Detail |
---|
public MainForm(GPSGui view, GPSClientModel model)
public MainForm(GPSGui view, GPSClientModel model, String name)
Method Detail |
---|
public void addGPSBtnListener(ActionListener listener)
listener
- public void addSpinnerListener(ChangeListener listener)
listener
- public void addTimerListener(ActionListener listener)
listener
- public void addServerBtnListener(ActionListener listener)
listener
- public JComponent getFormComponent()
getFormComponent
in interface Form
FormManager
public String getName()
getName
in interface Form
FormManager
public void coordReceived(Coordinate coord)
GPSListener
coordReceived
in interface GPSListener
coord
- the new coordinatepublic void refreshView()
refreshView
in interface Form
FormManager
public int getInterval()
public void setStatusMsg(String status)
status
- status messagepublic void increaseRecievedField()
public void setLatLonFields(String lat, String lon)
lat
- the coordinate's latitudelon
- the coordinate's logitudepublic void setLastUpdateField(String update)
update
- last updatedpublic void statusUpdate(GPSStatusState state)
GPSListener
statusUpdate
in interface GPSListener
state
- new statepublic void connected(boolean connected)
GPSListener
connected
in interface GPSListener
connected
- true if connected, false if disconnectedpublic void createTimer(ActionListener listener)
listener
- the listenerpublic void setServerBtnTxt(String text)
text
- the new text on the buttonpublic void setGPSBtnTxt(String text)
text
- the new text on the buttonpublic void showMain()
public void showErrorDialog(String heading, String error)
heading
- heading of the error dialogerror
- the error itselfpublic Timer getTimer()
public void showLogin()
public void stopTimer()
public void startTimer()
public boolean timerIsRunning()
public void showRoutes()
public boolean transferBufferedDialog()
public void setActiveRoute(String route)
route
- the active routepublic void connectionUpdate(ConnectionState state)
GPSSocketAdapter
connectionUpdate
in interface SocketListener
connectionUpdate
in class GPSSocketAdapter
state
- new connection statepublic void transferToServer()
public void recieveFromGPS()
public void pauseFromGPS()
public void bufferToFile()
public void readExcepion(IOException e)
readExcepion
in interface GPSListener
e
- the exceptionpublic void setDistField(double dist)
dist
- traveled distance
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |