es.uv.robotica.gvsig.mobile.gps.tracklog
Class WaypointManager

java.lang.Object
  extended byes.uv.robotica.gvsig.mobile.gps.tracklog.WaypointManager

public class WaypointManager
extends java.lang.Object

A static class which manages the access to a tracklog for storing waypoints

Author:
juangui
See Also:
Tracklogger

Field Summary
static int WAYPOINT_TYPE_CSV
          Identifies a CSV waypoint type
static int WAYPOINT_TYPE_GPX
          Identifies a GPX waypoint type
 
Constructor Summary
WaypointManager()
           
 
Method Summary
static void clearWaypoints()
          Clears waypoints file
static void closeWaypoints()
          Closes the waypoints file, which includes flushing the buffer and giving format to the waypoints file before closing.
static java.lang.String getFileName()
          Gets the name of the file where the waypoints are stored
static java.lang.String getFolderName()
          Gets the name of the folder where the waypoints are stored
static int getType()
          Gets the waypoints file type
static void openWaypoints()
          Opens the waypoints file
static void setFileName(java.lang.String _fileName)
          Sets the name of the file where the waypoints are stored
static void setFolderName(java.lang.String _folderName)
          Sets the name of the folder where the waypoints are stored
static void setType(int _type)
          Sets the waypoints file type.
static void setTypeAndOpen(int _type)
          Sets the waypoints type, closing the old waypoints file No need to open a new one, it will do it acutomatically when storing the next waypoint
static void storeWaypoint(Waypoint _wpt)
          Stores a waypoint in the tracklog
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WAYPOINT_TYPE_GPX

public static final int WAYPOINT_TYPE_GPX
Identifies a GPX waypoint type

See Also:
Constant Field Values

WAYPOINT_TYPE_CSV

public static final int WAYPOINT_TYPE_CSV
Identifies a CSV waypoint type

See Also:
Constant Field Values
Constructor Detail

WaypointManager

public WaypointManager()
Method Detail

setFileName

public static void setFileName(java.lang.String _fileName)
Sets the name of the file where the waypoints are stored


getFileName

public static java.lang.String getFileName()
Gets the name of the file where the waypoints are stored

Returns:
a String with the file name

setFolderName

public static void setFolderName(java.lang.String _folderName)
Sets the name of the folder where the waypoints are stored

Parameters:
_folderName -

getFolderName

public static java.lang.String getFolderName()
Gets the name of the folder where the waypoints are stored

Returns:
a String with the folder name

setTypeAndOpen

public static void setTypeAndOpen(int _type)
Sets the waypoints type, closing the old waypoints file No need to open a new one, it will do it acutomatically when storing the next waypoint

Parameters:
_type - one of the following values: - WaypointManager.WAYPOINT_TYPE_GPX for a waypoints file in GPX format - WaypointManager.WAYPOINT_TYPE_GPX for a waypoints file in CSV format

setType

public static void setType(int _type)
Sets the waypoints file type. Should not be used before closing the waypoints file

Parameters:
_type - one of the following values: - WaypointManager.WAYPOINT_TYPE_GPX for a waypoints file in GPX format - WaypointManager.WAYPOINT_TYPE_GPX for a waypoints file in CSV format
See Also:
WaypointManager.setTypeAndOpen(int _type)

getType

public static int getType()
Gets the waypoints file type

Returns:
one of the following values: - WaypointManager.WAYPOINT_TYPE_GPX for a waypoints file in GPX format - WaypointManager.WAYPOINT_TYPE_GPX for a waypoints file in CSV format

openWaypoints

public static void openWaypoints()
Opens the waypoints file


closeWaypoints

public static void closeWaypoints()
Closes the waypoints file, which includes flushing the buffer and giving format to the waypoints file before closing. Call this member function before closing the application


clearWaypoints

public static void clearWaypoints()
Clears waypoints file


storeWaypoint

public static void storeWaypoint(Waypoint _wpt)
Stores a waypoint in the tracklog

Parameters:
_wpt - the waypoint to be stored