org.openstreetmap.josm.io
Class GpxImporter

java.lang.Object
  extended by org.openstreetmap.josm.io.FileImporter
      extended by org.openstreetmap.josm.io.GpxImporter
All Implemented Interfaces:
java.lang.Comparable<FileImporter>, MapView.LayerChangeListener

public class GpxImporter
extends FileImporter

File importer allowing to import GPX files (*.gpx/gpx.gz files).


Nested Class Summary
static class GpxImporter.GpxImporterData
          Utility class containing imported GPX and marker layers, and a task to run after they are added to MapView.
 
Field Summary
static ExtensionFileFilter FILE_FILTER
          The GPX file filter (*.gpx and *.gpx.gz files).
 
Fields inherited from class org.openstreetmap.josm.io.FileImporter
filter
 
Constructor Summary
GpxImporter()
          Constructs a new GpxImporter.
 
Method Summary
static void addLayers(GpxImporter.GpxImporterData data)
          Adds the specified GPX and marker layers to Map.main
 void importData(java.io.File file, ProgressMonitor progressMonitor)
          Needs to be implemented if isBatchImporter() returns false.
static GpxImporter.GpxImporterData loadLayers(GpxData data, boolean parsedProperly, java.lang.String gpxLayerName, java.lang.String markerLayerName)
          Replies the new GPX and marker layers corresponding to the specified GPX data.
static GpxImporter.GpxImporterData loadLayers(java.io.InputStream is, java.io.File associatedFile, java.lang.String gpxLayerName, java.lang.String markerLayerName, ProgressMonitor progressMonitor)
           
 
Methods inherited from class org.openstreetmap.josm.io.FileImporter
acceptFile, activeLayerChange, compareTo, getBZip2InputStream, getGZipInputStream, getPriority, importData, importDataHandleExceptions, importDataHandleExceptions, isBatchImporter, isEnabled, layerAdded, layerRemoved, setEnabled
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FILE_FILTER

public static final ExtensionFileFilter FILE_FILTER
The GPX file filter (*.gpx and *.gpx.gz files).

Constructor Detail

GpxImporter

public GpxImporter()
Constructs a new GpxImporter.

Method Detail

importData

public void importData(java.io.File file,
                       ProgressMonitor progressMonitor)
                throws java.io.IOException
Description copied from class: FileImporter
Needs to be implemented if isBatchImporter() returns false.

Overrides:
importData in class FileImporter
Throws:
java.io.IOException

addLayers

public static void addLayers(GpxImporter.GpxImporterData data)
Adds the specified GPX and marker layers to Map.main

Parameters:
data - The layers to add
See Also:
loadLayers(org.openstreetmap.josm.data.gpx.GpxData, boolean, java.lang.String, java.lang.String)

loadLayers

public static GpxImporter.GpxImporterData loadLayers(GpxData data,
                                                     boolean parsedProperly,
                                                     java.lang.String gpxLayerName,
                                                     java.lang.String markerLayerName)
Replies the new GPX and marker layers corresponding to the specified GPX data.

Parameters:
data - The GPX data
parsedProperly - True if GPX data has been properly parsed by GpxReader.parse(boolean)
gpxLayerName - The GPX layer name
markerLayerName - The marker layer name
Returns:
the new GPX and marker layers corresponding to the specified GPX data, to be used with addLayers(org.openstreetmap.josm.io.GpxImporter.GpxImporterData)
See Also:
addLayers(org.openstreetmap.josm.io.GpxImporter.GpxImporterData)

loadLayers

public static GpxImporter.GpxImporterData loadLayers(java.io.InputStream is,
                                                     java.io.File associatedFile,
                                                     java.lang.String gpxLayerName,
                                                     java.lang.String markerLayerName,
                                                     ProgressMonitor progressMonitor)
                                              throws java.io.IOException
Throws:
java.io.IOException


JOSM