|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjwo.landserf.process.gps.GPS
public abstract class GPS
Abstract base class that represents the functionality of a generic GPS unit.
| Field Summary | |
|---|---|
protected Vector |
gpsListeners
List of objects registered as listeners to this GPS. |
protected Vector |
routeListeners
List of objects registered as listeners for route data from the GPS. |
static int |
SERIAL
Indicates that the GPS uses a SERIAL connection. |
protected Vector |
trackListeners
List of objects registered as listeners for track data from the GPS. |
protected Vector |
transferListeners
List of objects registered as listeners for data transfers from the GPS. |
static int |
USB
Indicates that the GPS uses a USB packet. |
protected Vector |
waypointListeners
List of objects registered as listeners for waypoint data from the GPS. |
| Constructor Summary | |
|---|---|
protected |
GPS()
Initialises the generic GPS object. |
| Method Summary | |
|---|---|
void |
addGPSlistener(GPSListener gpsListener)
Adds the specified GPSListener to those that will receive data from the GPS. |
void |
addRouteListener(GPSRouteListener routeListener)
Adds the specified RouteListener to those that will receive data from the GPS. |
void |
addTrackListener(GPSTrackListener trackListener)
Adds the specified TrackListener to those that will receive data from the GPS. |
void |
addWaypointListener(GPSWaypointListener waypointListener)
Adds the specified WaypointListener to those that will receive data from the GPS. |
protected void |
fireDateData(GPSDate date)
Notifies listeners of a new GPS date. |
protected void |
firePositionData(Position position)
Notifies listeners of a new GPS position. |
void |
fireRouteData(GPSRoute route)
Notifies listeners of the given route. |
protected void |
fireTimeData(GPSTime time)
Notifies listeners of a new GPS time. |
void |
fireTrackData(GPSTrack track)
Notifies listeners of the given track. |
void |
fireTransferComplete(int commandID)
Notifies listeners of the end of a stream of data. |
void |
fireTransferStart(int numItems)
Notifies listeners of the beginning of a stream of data. |
void |
fireWaypointData(GPSWaypoint waypoint)
Notifies listeners of the given waypoint. |
abstract int |
getConnectionType()
Should report the type of connection used by the GPS. |
abstract String |
getDescription()
Should ask for a descriptive string from the GPS. |
abstract String |
getShortDescription()
Should ask for a short descriptive string from the GPS. |
void |
removeGPSListener(GPSListener gpsListener)
Removes the given GPS listener from the list of GPS listeners. |
void |
removeRouteListener(GPSRouteListener routeListener)
Removes the given route listener from the list of route listeners. |
void |
removeTrackListener(GPSTrackListener trackListener)
Removes the given track listener from the list of track listeners. |
protected void |
removeTransferListener(GPSTransferListener transferListener)
Removes the given transfer listener from the list of transfer listeners. |
void |
removeWaypointListener(GPSWaypointListener waypointListener)
Removes the given waypoint listener from the list of waypoint listeners. |
abstract void |
requestDate()
Should ask for the date from the GPS. |
abstract void |
requestPosition()
Should ask for the current position from the GPS. |
abstract void |
requestRoutes()
Should ask the GPS to transmit all the routes in its memory. |
abstract void |
requestTime()
Should ask for the time from the GPS. |
abstract void |
requestTracks()
Should ask the GPS to transmit all the tracks in its memory. |
abstract void |
requestWaypoints()
Should ask the GPS to transmit all the waypoints in its memory. |
abstract void |
sendWaypoints(Vector gpsWaypoints)
Should send the given collection of GPSWaypoints to the GPS. |
abstract void |
setAutoTransmit(boolean transmit)
Should ask the GPS to either start or stop transmitting data periodically. |
abstract void |
shutdown(boolean turnOff)
Should stop communication with GPS. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Vector gpsListeners
protected Vector waypointListeners
protected Vector trackListeners
protected Vector routeListeners
protected Vector transferListeners
public static final int SERIAL
public static final int USB
| Constructor Detail |
|---|
protected GPS()
| Method Detail |
|---|
public void addGPSlistener(GPSListener gpsListener)
gpsListener - Object receiving GPS information.public void addWaypointListener(GPSWaypointListener waypointListener)
waypointListener - Object receiving GPS waypoint information.public void addTrackListener(GPSTrackListener trackListener)
trackListener - Object receiving GPS track information.public void addRouteListener(GPSRouteListener routeListener)
routeListener - Object receiving GPS route information.public void removeWaypointListener(GPSWaypointListener waypointListener)
waypointListener - Listener to remove.public void removeTrackListener(GPSTrackListener trackListener)
trackListener - Listener to remove.public void removeRouteListener(GPSRouteListener routeListener)
routeListener - Listener to remove.public void removeGPSListener(GPSListener gpsListener)
gpsListener - Listener to remove.protected void removeTransferListener(GPSTransferListener transferListener)
transferListener - Listener to remove.public void fireTransferStart(int numItems)
numItems - Number of data units in the transfer.public void fireWaypointData(GPSWaypoint waypoint)
waypoint - Waypoint passed to listenerspublic void fireTrackData(GPSTrack track)
track - Track passed to listenerspublic void fireRouteData(GPSRoute route)
route - Route passed to listenerspublic void fireTransferComplete(int commandID)
commandID - ID of command that has been completed.protected void firePositionData(Position position)
position - Point location passed to listenersprotected void fireDateData(GPSDate date)
date - GPS date passed to listenersprotected void fireTimeData(GPSTime time)
time - GPS time passed to listenerspublic abstract int getConnectionType()
USB or SERIAL.
public abstract void requestPosition()
public abstract void requestTime()
public abstract void requestDate()
public abstract String getDescription()
public abstract String getShortDescription()
public abstract void requestWaypoints()
FeatureNotSupportedException - if it isn't possible to do this on the GPS.public abstract void requestTracks()
FeatureNotSupportedException - if it isn't possible to do this on the GPS.public abstract void requestRoutes()
public abstract void sendWaypoints(Vector gpsWaypoints)
gpsWaypoints - Collection of waypoints. Each item in the collection should
be a GPSWaypoint object.public abstract void setAutoTransmit(boolean transmit)
transmit - Start transmitting if true, otherwise stop transmitting.
FeatureNotSupportedException - if it isn't possible to do this on the GPS.public abstract void shutdown(boolean turnOff)
turnOff - Turn of GPS unit if true, otherwise just stop listening.
FeatureNotSupportedException - if turnOff is true, but the GPS unit doesn't
support remote shutdown.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||