|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
All classes implementing this interface are interpreting data from a GPSDevice (serial gps-receivier, file containing gps data, ...) and provide this information in a uniform way. So an NMEA-processor interprets NMEA sentences, while a Garmin-Processor understands the garmin protocol.
Other classes may register as a GPSDataListener and receive gps events. The following events are supported (if provided by the gps device):
LOCATION
: the value is a GPSPosition
objectHEADING
: the value is a FloatSPEED
: the value is a Float and is in kilometers per hourNUMBER_SATELLITES
: the value is a IntegerALTITUDE
: the value is a Float and is in metersSATELLITE_INFO
: the value is a SatelliteInfo
object.DEPTH
: the value is a Float and is in meters.
Field Summary | |
static java.lang.String |
ALTITUDE
|
static java.lang.String |
DATE
|
static java.lang.String |
DEPTH
|
static java.lang.String |
END_OF_FILE
|
static java.lang.String |
FIX_DIMENSIONS
|
static java.lang.String |
FIX_QUALITY
|
static java.lang.String |
HDOP
|
static java.lang.String |
HEADING
|
static java.lang.String |
IDS_SATELLITES
|
static float |
KM2NAUTIC
|
static java.lang.String |
LOCATION
|
static java.lang.String |
NUMBER_SATELLITES
|
static java.lang.String |
PDOP
|
static java.lang.String |
SATELLITE_INFO
|
static java.lang.String |
SPEED
|
static java.lang.String |
TIME
|
static java.lang.String |
VDOP
|
Method Summary | |
void |
addGPSDataChangeListener(java.beans.PropertyChangeListener listener)
Adds a listener for GPS data change events. |
void |
addGPSDataChangeListener(java.lang.String key,
java.beans.PropertyChangeListener listener)
Adds a listener for GPS data change events. |
void |
addGPSRawDataListener(GPSRawDataListener listener)
Adds a listener for raw GPS data (for loggin purpose or similar). |
void |
addProgressListener(ProgressListener listener)
Adds a listener for transfer progress (for transfer or route/track/waypoint data). |
void |
close()
Stopps the data processing. |
java.util.Map |
getGPSData()
Returns a map containing the last received data from the GPSDevice or null , if no data was retrieved until now. |
java.lang.Object |
getGPSData(java.lang.String key)
Returns the last received data from the GPSDevice that is named by the key or null if no data with the given
key was retrieved until now. |
GPSDevice |
getGPSDevice()
Returns the GPSDevice where the data will be retrieved from. |
java.lang.String[] |
getGPSInfo()
Returns information about the gps connected (name of device, type of connection, etc.) |
GPSPosition |
getGPSPosition()
Returns the last received position from the GPSDevice or null if no position was retrieved until now. |
float |
getHeading()
Returns the last received heading (direction) from the GPSDevice or -1.0 if no heading was retrieved until now. |
void |
open()
Starts the data processing. |
void |
removeGPSDataChangeListener(java.beans.PropertyChangeListener listener)
Removes a listener for GPS data change events. |
void |
removeGPSDataChangeListener(java.lang.String key,
java.beans.PropertyChangeListener listener)
Removes a listener for GPS data change events. |
void |
removeGPSRawDataListener(GPSRawDataListener listener)
Removes a listener for faw GPS data. |
void |
removeProgressListener(ProgressListener listener)
Removes a listener for transfer progress (for transfer or route/track/waypoint data). |
void |
setGPSDevice(GPSDevice gps_device)
Sets the GPSDevice where the data will be retrieved from. |
long |
startSendPositionPeriodically(long period)
Requests the gps device to send the current position/heading/etc. periodically. |
void |
stopSendPositionPeriodically()
Requests the gps device to stop to send the current position/heading/etc. periodically. |
Field Detail |
public static final java.lang.String LOCATION
public static final java.lang.String HEADING
public static final java.lang.String SPEED
public static final java.lang.String NUMBER_SATELLITES
public static final java.lang.String ALTITUDE
public static final java.lang.String SATELLITE_INFO
public static final java.lang.String DEPTH
public static final java.lang.String FIX_QUALITY
public static final java.lang.String IDS_SATELLITES
public static final java.lang.String FIX_DIMENSIONS
public static final java.lang.String PDOP
public static final java.lang.String HDOP
public static final java.lang.String VDOP
public static final java.lang.String TIME
public static final java.lang.String DATE
public static final java.lang.String END_OF_FILE
public static final float KM2NAUTIC
Method Detail |
public void open() throws GPSException
if
- an error occured on connecting.
GPSException
public void close() throws GPSException
if
- an error occured on disconnecting.
GPSException
public void setGPSDevice(GPSDevice gps_device)
gps_device
- the GPSDevice to retrieve data from.public GPSDevice getGPSDevice()
public java.lang.String[] getGPSInfo()
public GPSPosition getGPSPosition()
null
if no position was retrieved until now.
public float getHeading()
-1.0
if no heading was retrieved until now.
public java.lang.Object getGPSData(java.lang.String key) throws java.lang.IllegalArgumentException
key
or null
if no data with the given
key was retrieved until now. The naming scheme for the keys is
taken from the NMEA standard (e.g. GLL for location, HDG for
heading, ...)
key
- the name of the data.
java.lang.IllegalArgumentException
- if the key
is
null
.public java.util.Map getGPSData()
null
, if no data was retrieved until now. The
naming scheme for the keys is taken from the NMEA standard
(e.g. GLL for location, HDG for heading, ...)
public long startSendPositionPeriodically(long period) throws GPSException
period
- time in milliseconds between periodically sending
position/heading/etc. This value may be changed by the gps device,
so do not rely on the value given!
GPSException
- if the operation threw an exception
(e.g. communication problem).public void stopSendPositionPeriodically() throws GPSException
GPSException
- if the operation threw an exception
(e.g. communication problem).public void addGPSDataChangeListener(java.lang.String key, java.beans.PropertyChangeListener listener) throws java.lang.IllegalArgumentException
listener
- the listener to be added.key
- the key of the GPSdata to be observed.
java.lang.IllegalArgumentException
- if key
or
listener
is null
.public void addGPSDataChangeListener(java.beans.PropertyChangeListener listener) throws java.lang.IllegalArgumentException
listener
- the listener to be added.
java.lang.IllegalArgumentException
- if listener
is
null
.public void removeGPSDataChangeListener(java.lang.String key, java.beans.PropertyChangeListener listener) throws java.lang.IllegalArgumentException
listener
- the listener to be removed.key
- the key of the GPSdata to be observed.
java.lang.IllegalArgumentException
- if key or
listener
is null
.
public void addGPSRawDataListener(GPSRawDataListener listener) throws java.lang.IllegalArgumentException
listener
- the listener to be added.
java.lang.IllegalArgumentException
- if listener
is
null
.public void removeGPSRawDataListener(GPSRawDataListener listener) throws java.lang.IllegalArgumentException
listener
- the listener to be removed.
java.lang.IllegalArgumentException
- if listener
is
null
.public void removeGPSDataChangeListener(java.beans.PropertyChangeListener listener) throws java.lang.IllegalArgumentException
listener
- the listener to be removed.
java.lang.IllegalArgumentException
- if listener
is
null
.public void addProgressListener(ProgressListener listener) throws java.lang.IllegalArgumentException
listener
- the listener to be added.
java.lang.IllegalArgumentException
- if listener
is
null
.ProgressListener
public void removeProgressListener(ProgressListener listener) throws java.lang.IllegalArgumentException
listener
- the listener to be added.
java.lang.IllegalArgumentException
- if listener
is
null
.ProgressListener
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |