Changeset 16866 in josm for trunk/src/org
- Timestamp:
- 2020-08-10T23:19:10+02:00 (4 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadGpsTask.java
r16864 r16866 139 139 String name = getLayerName(); 140 140 141 GpxImporterData layers = GpxImporter.loadLayers(rawData, reader.isGpxParsedProperly(), name, 142 tr("Markers from {0}", name)); 141 GpxImporterData layers = GpxImporter.loadLayers(rawData, reader.isGpxParsedProperly(), name); 143 142 144 143 gpxLayer = layers.getGpxLayer(); -
trunk/src/org/openstreetmap/josm/gui/io/importexport/GpxImporter.java
r16864 r16866 124 124 boolean parsedProperly = r.parse(true); 125 125 r.getGpxData().storageFile = file; 126 addLayers(loadLayers(r.getGpxData(), parsedProperly, fileName , tr("Markers from {0}", fileName)));126 addLayers(loadLayers(r.getGpxData(), parsedProperly, fileName)); 127 127 } catch (SAXException e) { 128 128 Logging.error(e); … … 157 157 * @param parsedProperly True if GPX data has been properly parsed by {@link GpxReader#parse} 158 158 * @param gpxLayerName The GPX layer name 159 * @param markerLayerName The marker layer name160 159 * @return the new GPX and marker layers corresponding to the specified GPX data, to be used with {@link #addLayers} 161 160 * @see #addLayers 162 161 */ 163 public static GpxImporterData loadLayers(final GpxData data, final boolean parsedProperly, 164 final String gpxLayerName, String markerLayerName) { 162 public static GpxImporterData loadLayers(final GpxData data, final boolean parsedProperly, final String gpxLayerName) { 165 163 MarkerLayer markerLayer = null; 166 164 GpxRouteLayer gpxRouteLayer = null; 167 165 GpxLayer gpxLayer = new GpxLayer(data, gpxLayerName, data.storageFile != null); 168 166 if (Config.getPref().getBoolean("marker.makeautomarkers", true) && !data.waypoints.isEmpty()) { 169 markerLayer = new MarkerLayer(data, markerLayerName, data.storageFile, gpxLayer);167 markerLayer = new MarkerLayer(data, tr("Markers from {0}", gpxLayerName), data.storageFile, gpxLayer); 170 168 if (markerLayer.data.isEmpty()) { 171 169 markerLayer = null; … … 211 209 * @param associatedFile GPX file 212 210 * @param gpxLayerName The GPX layer name 213 * @param markerLayerName The marker layer name214 211 * @param progressMonitor The progress monitor 215 212 * @return the new GPX and marker layers corresponding to the specified GPX file … … 217 214 */ 218 215 public static GpxImporterData loadLayers(InputStream is, final File associatedFile, 219 final String gpxLayerName, String markerLayerName, ProgressMonitor progressMonitor) throws IOException {216 final String gpxLayerName, ProgressMonitor progressMonitor) throws IOException { 220 217 try { 221 218 final GpxReader r = new GpxReader(is); 222 219 final boolean parsedProperly = r.parse(true); 223 220 r.getGpxData().storageFile = associatedFile; 224 return loadLayers(r.getGpxData(), parsedProperly, gpxLayerName , markerLayerName);221 return loadLayers(r.getGpxData(), parsedProperly, gpxLayerName); 225 222 } catch (SAXException e) { 226 223 Logging.error(e); -
trunk/src/org/openstreetmap/josm/gui/io/importexport/NMEAImporter.java
r14153 r16866 97 97 * @param associatedFile NMEA file 98 98 * @param gpxLayerName The GPX layer name 99 * @param markerLayerName The marker layer name100 99 * @return the new GPX and marker layers corresponding to the specified NMEA file 101 100 * @throws IOException if an I/O error occurs 102 101 */ 103 102 public static GpxImporterData loadLayers(InputStream is, final File associatedFile, 104 final String gpxLayerName, String markerLayerName) throws IOException {103 final String gpxLayerName) throws IOException { 105 104 final NmeaReader r = buildAndParse(is); 106 105 final boolean parsedProperly = r.getNumberOfCoordinates() > 0; 107 106 r.getGpxData().storageFile = associatedFile; 108 return GpxImporter.loadLayers(r.getGpxData(), parsedProperly, gpxLayerName , markerLayerName);107 return GpxImporter.loadLayers(r.getGpxData(), parsedProperly, gpxLayerName); 109 108 } 110 109 -
trunk/src/org/openstreetmap/josm/gui/io/importexport/RtkLibImporter.java
r15247 r16866 91 91 * @param associatedFile RTKLib file 92 92 * @param gpxLayerName The GPX layer name 93 * @param markerLayerName The marker layer name94 93 * @return the new GPX and marker layers corresponding to the specified RTKLib file 95 94 * @throws IOException if an I/O error occurs 96 95 */ 97 96 public static GpxImporterData loadLayers(InputStream is, final File associatedFile, 98 final String gpxLayerName, String markerLayerName) throws IOException {97 final String gpxLayerName) throws IOException { 99 98 final RtkLibPosReader r = buildAndParse(is); 100 99 final boolean parsedProperly = r.getNumberOfCoordinates() > 0; 101 100 r.getGpxData().storageFile = associatedFile; 102 return GpxImporter.loadLayers(r.getGpxData(), parsedProperly, gpxLayerName , markerLayerName);101 return GpxImporter.loadLayers(r.getGpxData(), parsedProperly, gpxLayerName); 103 102 } 104 103 -
trunk/src/org/openstreetmap/josm/io/session/GpxTracksSessionImporter.java
r16865 r16866 48 48 49 49 if (NMEAImporter.FILE_FILTER.acceptName(fileStr)) { 50 importData = NMEAImporter.loadLayers(in, support.getFile(fileStr), support.getLayerName() , null);50 importData = NMEAImporter.loadLayers(in, support.getFile(fileStr), support.getLayerName()); 51 51 } else if (RtkLibImporter.FILE_FILTER.acceptName(fileStr)) { 52 importData = RtkLibImporter.loadLayers(in, support.getFile(fileStr), support.getLayerName() , null);52 importData = RtkLibImporter.loadLayers(in, support.getFile(fileStr), support.getLayerName()); 53 53 } else { 54 importData = GpxImporter.loadLayers(in, support.getFile(fileStr), support.getLayerName(), null,progressMonitor);54 importData = GpxImporter.loadLayers(in, support.getFile(fileStr), support.getLayerName(), progressMonitor); 55 55 } 56 56 -
trunk/src/org/openstreetmap/josm/io/session/MarkerSessionImporter.java
r12671 r16866 46 46 try (InputStream in = support.getInputStream(fileStr)) { 47 47 GpxImporter.GpxImporterData importData = GpxImporter.loadLayers(in, support.getFile(fileStr), support.getLayerName(), 48 null,progressMonitor);48 progressMonitor); 49 49 50 50 support.addPostLayersTask(importData.getPostLayerTask());
Note:
See TracChangeset
for help on using the changeset viewer.