|
|||||||||
| Home >> All >> org >> dinopolis >> [ gpstool overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
org.dinopolis.gpstool
Class TrackManagerImpl

java.lang.Objectorg.dinopolis.gpstool.TrackManagerImpl
- All Implemented Interfaces:
- GPSMapKeyConstants, TrackManager
- public class TrackManagerImpl
- extends java.lang.Object
- implements TrackManager, GPSMapKeyConstants
- extends java.lang.Object
Manages tracks and provides these to all modules. Internally, all org.dinopolis.gpstool.gpsinput.GPSTrack objects that are added or downloaded are converted to org.dinopolis.gpstool.track.Track objects, so they may be projected and printed.
- Version:
- $Revision: 1.8 $
| Field Summary | |
(package private) java.lang.String |
active_track_identifier_
|
(package private) org.dinopolis.gpstool.gpsinput.GPSDataProcessor |
gps_data_processor_
|
(package private) org.dinopolis.util.Resources |
resources_
|
(package private) java.util.Vector |
track_listeners_
|
(package private) java.util.Map |
track_map_
|
| Constructor Summary | |
TrackManagerImpl()
Empty constructor |
|
| Method Summary | |
void |
addToActiveTrack(org.dinopolis.gpstool.gpsinput.GPSTrackpoint trackpoint)
Adds the given trackpoint to the active track. |
void |
addToTrack(java.lang.String identifier,
org.dinopolis.gpstool.gpsinput.GPSTrackpoint trackpoint)
Adds the given trackpoint to the track with the given identifier. |
void |
addTrack(org.dinopolis.gpstool.gpsinput.GPSTrack track)
Add a track. |
void |
addTrackListener(org.dinopolis.gpstool.event.TrackChangedListener listener)
Adds a track listener. |
void |
addTracksFromGPSDevice()
Download all tracks from the connected gps device and adds them to the list of tracks. |
protected void |
fireTrackChangedEvent(org.dinopolis.gpstool.event.TrackChangedEvent event)
Inform all registered listeners about track changes. |
java.lang.String |
getActiveTrackIdentifier()
Returns the name of the active track (the track used by the addToActiveTrack(GPSTrackpoint) 55 method). |
org.dinopolis.gpstool.track.Track |
getProjectedTrack(java.lang.String identifier,
Projection projection)
Returns a projected track (holding the screen coordinates as well as the geographic coordinates). |
org.dinopolis.gpstool.track.Track |
getTrack(java.lang.String identifier)
Returns the track with the given identifier or null if
no track was found with the given identifier. |
java.lang.String[] |
getTrackIdentifiers()
Returns the track identifiers. |
java.util.List |
getTracks()
Returns a copy of the list of tracks (org.dinopolis.gpstool.track.Track objects). |
java.util.List |
getVisibleProjectedTracks(Projection projection)
Returns all visible projected tracks (holding the screen coordinates as well as the geographic coordinates) in a List. |
void |
initialize(org.dinopolis.gpstool.plugin.PluginSupport support)
Initialize with all the track manager needs (resources and gps data processor). |
static boolean |
isTrackVisible(org.dinopolis.gpstool.gpsinput.GPSTrack track,
org.dinopolis.gpstool.util.GeoExtent visible_area)
Returns true if the given track is starts in, ends in or crosses the given area, false otherwise. |
void |
removeTrack(java.lang.String identifier)
Removes the track with the given identifier. |
void |
removeTrackListener(org.dinopolis.gpstool.event.TrackChangedListener listener)
Removes a track listener. |
void |
setActiveTrackIdentifier(java.lang.String identifier)
Defines the track with the given identifier as the active track (the track used by the addToActiveTrack(GPSTrackpoint) 55 method). |
void |
setTracks(java.util.List tracks)
Set the tracks. |
void |
uploadTracksToGPSDevice()
Uploads all available tracks to the gps device. |
void |
uploadTracksToGPSDevice(java.lang.String[] identifiers)
Uploads the tracks with the given identifiers to the gps device. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
track_map_
java.util.Map track_map_
gps_data_processor_
org.dinopolis.gpstool.gpsinput.GPSDataProcessor gps_data_processor_
track_listeners_
java.util.Vector track_listeners_
active_track_identifier_
java.lang.String active_track_identifier_
resources_
org.dinopolis.util.Resources resources_
| Constructor Detail |
TrackManagerImpl
public TrackManagerImpl()
- Empty constructor
| Method Detail |
initialize
public void initialize(org.dinopolis.gpstool.plugin.PluginSupport support)
- Initialize with all the track manager needs (resources and gps data
processor).
getTracks
public java.util.List getTracks()
- Returns a copy of the list of tracks (org.dinopolis.gpstool.track.Track objects).
- Specified by:
getTracksin interfaceTrackManager
setTracks
public void setTracks(java.util.List tracks)
- Set the tracks. All previously stored tracks are removed.
- Specified by:
setTracksin interfaceTrackManager
addTrack
public void addTrack(org.dinopolis.gpstool.gpsinput.GPSTrack track)
- Add a track. If a track with the same identifier already exists,
the old track is overwritten.
- Specified by:
addTrackin interfaceTrackManager
getTrackIdentifiers
public java.lang.String[] getTrackIdentifiers()
- Returns the track identifiers.
- Specified by:
getTrackIdentifiersin interfaceTrackManager
getTrack
public org.dinopolis.gpstool.track.Track getTrack(java.lang.String identifier)
- Returns the track with the given identifier or
nullif no track was found with the given identifier.- Specified by:
getTrackin interfaceTrackManager
removeTrack
public void removeTrack(java.lang.String identifier)
- Removes the track with the given identifier.
- Specified by:
removeTrackin interfaceTrackManager
setActiveTrackIdentifier
public void setActiveTrackIdentifier(java.lang.String identifier) throws java.lang.IllegalArgumentException
- Defines the track with the given identifier as the active track
(the track used by the
addToActiveTrack(GPSTrackpoint)55 method).- Specified by:
setActiveTrackIdentifierin interfaceTrackManager
getActiveTrackIdentifier
public java.lang.String getActiveTrackIdentifier()
- Returns the name of the active track
(the track used by the
addToActiveTrack(GPSTrackpoint)55 method).- Specified by:
getActiveTrackIdentifierin interfaceTrackManager
addToTrack
public void addToTrack(java.lang.String identifier, org.dinopolis.gpstool.gpsinput.GPSTrackpoint trackpoint) throws java.lang.IllegalArgumentException
- Adds the given trackpoint to the track with the given identifier.
- Specified by:
addToTrackin interfaceTrackManager
addToActiveTrack
public void addToActiveTrack(org.dinopolis.gpstool.gpsinput.GPSTrackpoint trackpoint) throws java.lang.IllegalArgumentException
- Adds the given trackpoint to the active track.
- Specified by:
addToActiveTrackin interfaceTrackManager
addTracksFromGPSDevice
public void addTracksFromGPSDevice()
throws java.lang.UnsupportedOperationException,
org.dinopolis.gpstool.gpsinput.GPSException
- Download all tracks from the connected gps device and adds them to
the list of tracks.
- Specified by:
addTracksFromGPSDevicein interfaceTrackManager
uploadTracksToGPSDevice
public void uploadTracksToGPSDevice()
throws java.lang.UnsupportedOperationException,
org.dinopolis.gpstool.gpsinput.GPSException
- Uploads all available tracks to the gps device.
- Specified by:
uploadTracksToGPSDevicein interfaceTrackManager
uploadTracksToGPSDevice
public void uploadTracksToGPSDevice(java.lang.String[] identifiers) throws java.lang.UnsupportedOperationException, org.dinopolis.gpstool.gpsinput.GPSException
- Uploads the tracks with the given identifiers to the gps device.
- Specified by:
uploadTracksToGPSDevicein interfaceTrackManager
addTrackListener
public void addTrackListener(org.dinopolis.gpstool.event.TrackChangedListener listener)
- Adds a track listener.
- Specified by:
addTrackListenerin interfaceTrackManager
removeTrackListener
public void removeTrackListener(org.dinopolis.gpstool.event.TrackChangedListener listener)
- Removes a track listener.
- Specified by:
removeTrackListenerin interfaceTrackManager
getVisibleProjectedTracks
public java.util.List getVisibleProjectedTracks(Projection projection) throws java.lang.InterruptedException
- Returns all visible projected tracks (holding the screen
coordinates as well as the geographic coordinates) in a List. If no
tracks are found (or visible), an empty list is returned. Visiblity
is determined for the given projection. The tracks returned are
deep cloned, so any changes in these tracks do not influence the
tracks stored in the track manager (and vice versa).
- Specified by:
getVisibleProjectedTracksin interfaceTrackManager
getProjectedTrack
public org.dinopolis.gpstool.track.Track getProjectedTrack(java.lang.String identifier, Projection projection)
- Returns a projected track (holding the screen coordinates as well
as the geographic coordinates). At the moment, no caching is done,
so the calculation is always executed when this method is called.
If no track was found with the given identifier,
nullis returned. The track returned is deep cloned, so any changes in this tracks does not influence the tracks stored in the track manager (and vice versa). TODO: cache calls with same projection- Specified by:
getProjectedTrackin interfaceTrackManager
isTrackVisible
public static boolean isTrackVisible(org.dinopolis.gpstool.gpsinput.GPSTrack track, org.dinopolis.gpstool.util.GeoExtent visible_area)
- Returns true if the given track is starts in, ends in or crosses
the given area, false otherwise.
fireTrackChangedEvent
protected void fireTrackChangedEvent(org.dinopolis.gpstool.event.TrackChangedEvent event)
- Inform all registered listeners about track changes.
|
|||||||||
| Home >> All >> org >> dinopolis >> [ gpstool overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC
org.dinopolis.gpstool.TrackManagerImpl