location.generators
Class FakeGPSMonitor

java.lang.Object
  |
  +--location.generators.FakeGPSMonitor
All Implemented Interfaces:
LocationGenerator, java.io.Serializable

public class FakeGPSMonitor
extends java.lang.Object
implements LocationGenerator, java.io.Serializable

This class reads the data comming from a simulated GPS system.

Version:
3.0
Author:
Chien-Liang Fok
See Also:
Serialized Form

Field Summary
static long DEFAULT_INTERVAL
          The default interval between generating points is 1000ms.
static double DEFAULT_LAT_STEP_SIZE
          The default latitude step size in sexagesimal units.
static Latitude DEFAULT_LATITUDE
          The default latitude is (38 38.8935' N)
static double DEFAULT_LONG_STEP_SIZE
          The default longitude step size in sexagesimal units.
static Longitude DEFAULT_LONGITUDE
          The default longitude is (90 18.389986' W)
 
Constructor Summary
FakeGPSMonitor()
          Creates a FakeGPSMonitor with all the default settings.
FakeGPSMonitor(boolean showGUI)
          Creates a FakeGPSMonitor with all of the default settings except for the showGUI.
FakeGPSMonitor(long updatePeriod)
          Creates a FakeGPSMonitor starting at the default location with the specified update period.
FakeGPSMonitor(long updatePeriod, double latStep, double longStep)
          Creates a FakeGPSMonitor starting at a default location.
FakeGPSMonitor(long updatePeriod, Latitude defaultLat, Longitude defaultLong)
          Creates a FakeGPSMonitor with the starting location as specified by the parameter without reporting its location to a RoutSimulatorServer and default increment.
FakeGPSMonitor(long interval, Latitude defaultLat, Longitude defaultLong, double latStep, double longStep, boolean showGUI)
          Creates a FakeGPSMonitor with the starting location as specified by the parameter.
 
Method Summary
 void addGpsInfoListener(GpsInfoListener gps)
          Add a GpsInfo listener.
 void addLocationListener(LocationListener ll)
          Add a Location listener.
 LocationEvent getLocation()
          Returns the most previously current location
 void kill()
          Stops this class from generating location events.
 void removeGpsInfoListener(GpsInfoListener gps)
          Remove a GpsInfo listener.
 void removeLocationListener(LocationListener ll)
          Remove a location listener.
 void setGPSInfo(GpsInfoEvent gpsinfo)
          Sets the GpsInfoEvent to be broadcasted with the location event.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_LATITUDE

public static final Latitude DEFAULT_LATITUDE
The default latitude is (38 38.8935' N)

DEFAULT_LONGITUDE

public static final Longitude DEFAULT_LONGITUDE
The default longitude is (90 18.389986' W)

DEFAULT_LAT_STEP_SIZE

public static final double DEFAULT_LAT_STEP_SIZE
The default latitude step size in sexagesimal units. The default value is 0.43065.

DEFAULT_LONG_STEP_SIZE

public static final double DEFAULT_LONG_STEP_SIZE
The default longitude step size in sexagesimal units. The default value is 0.43065.

DEFAULT_INTERVAL

public static final long DEFAULT_INTERVAL
The default interval between generating points is 1000ms.
Constructor Detail

FakeGPSMonitor

public FakeGPSMonitor()
Creates a FakeGPSMonitor with all the default settings. Shows the GUI.

FakeGPSMonitor

public FakeGPSMonitor(boolean showGUI)
Creates a FakeGPSMonitor with all of the default settings except for the showGUI.

FakeGPSMonitor

public FakeGPSMonitor(long updatePeriod)
Creates a FakeGPSMonitor starting at the default location with the specified update period. Shows the GUI.
Parameters:
updatePeriod - the period of updating in milliseconds.

FakeGPSMonitor

public FakeGPSMonitor(long updatePeriod,
                      double latStep,
                      double longStep)
Creates a FakeGPSMonitor starting at a default location. Shows the GUI.
Parameters:
updatePeriod - the period of updating in milliseconds
latStep - the latitude step size in sexagesimal units
longStep - the longitude step size in sexagesimal units

FakeGPSMonitor

public FakeGPSMonitor(long updatePeriod,
                      Latitude defaultLat,
                      Longitude defaultLong)
Creates a FakeGPSMonitor with the starting location as specified by the parameter without reporting its location to a RoutSimulatorServer and default increment.
Parameters:
updatePeriod - the period of updating.
defaultLat - the default Latitude.
defaultLong - the default Longitude.

FakeGPSMonitor

public FakeGPSMonitor(long interval,
                      Latitude defaultLat,
                      Longitude defaultLong,
                      double latStep,
                      double longStep,
                      boolean showGUI)
Creates a FakeGPSMonitor with the starting location as specified by the parameter. Note: if this FakeGPSMonitor report to a server, then the default location will be set by the server.
Parameters:
interval - the period of updating
defaultLat - the default Latitude
defaultLong - the default Longitude
latStep - the latitude step size in sexagesimal units
longStep - the longitude step size in sexagesimal units
showGUI - determines whether the GUI that allows the user to change the data to be displayed.
Method Detail

addLocationListener

public void addLocationListener(LocationListener ll)
Add a Location listener.
Specified by:
addLocationListener in interface LocationGenerator
Parameters:
ll - the new location listener.
Returns:
true if the operation was successful.

removeLocationListener

public void removeLocationListener(LocationListener ll)
Remove a location listener.
Specified by:
removeLocationListener in interface LocationGenerator
Parameters:
ll - the location listener to remove.
Returns:
true if the operation was successful.

addGpsInfoListener

public void addGpsInfoListener(GpsInfoListener gps)
Add a GpsInfo listener.
Specified by:
addGpsInfoListener in interface LocationGenerator
Parameters:
gps - the new GpsInfo listener.
Returns:
true if the operation was successful.

removeGpsInfoListener

public void removeGpsInfoListener(GpsInfoListener gps)
Remove a GpsInfo listener.
Specified by:
removeGpsInfoListener in interface LocationGenerator
Parameters:
gps - the GpsInfo listener to remove.
Returns:
true if the operation was successful.

kill

public void kill()
Stops this class from generating location events.
Specified by:
kill in interface LocationGenerator

setGPSInfo

public void setGPSInfo(GpsInfoEvent gpsinfo)
Sets the GpsInfoEvent to be broadcasted with the location event.

getLocation

public LocationEvent getLocation()
Returns the most previously current location
Specified by:
getLocation in interface LocationGenerator