|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--location.LocationServer
LocationServer is the singleton that applications implementing the LocationListener interface register on to receive location information. The LocationServer obtains location information from a LocationGenerator. The LocationGenerator used can be specified by the user using the setLocationGenerator(...) method prior to booting the LocationServer. Once the LocationServer has been booted, the LocationGenerator it is using cannot be changed.
Two LocationGenerators are provided within a subpackage called location.generators. They are: FakeGPSMonitor and RealGPSMonitor. The FakeGPSMonitor provides a graphical user interface that allows the user to "move" around. The RealGPSMonitor reads data from a real GPS unit connected to the serial port.
Additional LocationGenerators may be defined by third parties by implementing the LocationGenerator interface.
The LocationServer supports two types of listeners: LocationListener
and GpsInfoListener
. A LocationListener
is informed
of location information, while a GpsInfoListener
is informed of
GPS status such as the number of satellites.
GpsInfoEvent
,
LocationEvent
,
LocationListener
,
GpsInfoListener
, Serialized FormMethod Summary | |
void |
addGpsInfoListener(GpsInfoListener gpsinfo)
Adds a GpsInfoListener to this server. |
void |
addLocationListener(LocationListener ll)
Adds a LocationListener to this server. |
void |
boot()
Boots the Location Server. |
static LocationServer |
getServer()
Returns the LocationServer singleton. |
boolean |
isBooted()
Returns true if the location server is booted. |
void |
locationChanged(LocationEvent le)
This implements the locationlistener interface. |
void |
newGpsInfo(GpsInfoEvent gpsinfo)
This implements the GpsInfolistener interface. |
void |
removeGpsInfoListener(GpsInfoListener gpsinfo)
Removes a GpsInfoListener from this server. |
void |
removeLocationListener(LocationListener ll)
Removes a LocationListener from this server. |
void |
setLocationGenerator(LocationGenerator lg)
Sets the location generated used by this LocationServer. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public void setLocationGenerator(LocationGenerator lg)
public void locationChanged(LocationEvent le)
locationChanged
in interface LocationListener
location.LocationListener
le
- the new location event.public void newGpsInfo(GpsInfoEvent gpsinfo)
newGpsInfo
in interface GpsInfoListener
location.GpsInfoListener
gpsinfo
- The new gpsinfoevent.public boolean isBooted()
public void boot()
public void addLocationListener(LocationListener ll)
ll
- the LocationListener.public void removeLocationListener(LocationListener ll)
ll
- the LocationListener to be removed.public void addGpsInfoListener(GpsInfoListener gpsinfo)
gpsinfo
- the GpsInfoListener.public void removeGpsInfoListener(GpsInfoListener gpsinfo)
gpsinfo
- the GpsInfoListener to be removed.public static LocationServer getServer()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |