Changeset 16866 in josm


Ignore:
Timestamp:
2020-08-10T23:19:10+02:00 (2 years ago)
Author:
simon04
Message:

GpxImporter: compute markerLayerName

Location:
trunk/src/org/openstreetmap/josm
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadGpsTask.java

    r16864 r16866  
    139139            String name = getLayerName();
    140140
    141             GpxImporterData layers = GpxImporter.loadLayers(rawData, reader.isGpxParsedProperly(), name,
    142                     tr("Markers from {0}", name));
     141            GpxImporterData layers = GpxImporter.loadLayers(rawData, reader.isGpxParsedProperly(), name);
    143142
    144143            gpxLayer = layers.getGpxLayer();
  • trunk/src/org/openstreetmap/josm/gui/io/importexport/GpxImporter.java

    r16864 r16866  
    124124            boolean parsedProperly = r.parse(true);
    125125            r.getGpxData().storageFile = file;
    126             addLayers(loadLayers(r.getGpxData(), parsedProperly, fileName, tr("Markers from {0}", fileName)));
     126            addLayers(loadLayers(r.getGpxData(), parsedProperly, fileName));
    127127        } catch (SAXException e) {
    128128            Logging.error(e);
     
    157157     * @param parsedProperly True if GPX data has been properly parsed by {@link GpxReader#parse}
    158158     * @param gpxLayerName The GPX layer name
    159      * @param markerLayerName The marker layer name
    160159     * @return the new GPX and marker layers corresponding to the specified GPX data, to be used with {@link #addLayers}
    161160     * @see #addLayers
    162161     */
    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) {
    165163        MarkerLayer markerLayer = null;
    166164        GpxRouteLayer gpxRouteLayer = null;
    167165        GpxLayer gpxLayer = new GpxLayer(data, gpxLayerName, data.storageFile != null);
    168166        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);
    170168            if (markerLayer.data.isEmpty()) {
    171169                markerLayer = null;
     
    211209     * @param associatedFile GPX file
    212210     * @param gpxLayerName The GPX layer name
    213      * @param markerLayerName The marker layer name
    214211     * @param progressMonitor The progress monitor
    215212     * @return the new GPX and marker layers corresponding to the specified GPX file
     
    217214     */
    218215    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 {
    220217        try {
    221218            final GpxReader r = new GpxReader(is);
    222219            final boolean parsedProperly = r.parse(true);
    223220            r.getGpxData().storageFile = associatedFile;
    224             return loadLayers(r.getGpxData(), parsedProperly, gpxLayerName, markerLayerName);
     221            return loadLayers(r.getGpxData(), parsedProperly, gpxLayerName);
    225222        } catch (SAXException e) {
    226223            Logging.error(e);
  • trunk/src/org/openstreetmap/josm/gui/io/importexport/NMEAImporter.java

    r14153 r16866  
    9797     * @param associatedFile NMEA file
    9898     * @param gpxLayerName The GPX layer name
    99      * @param markerLayerName The marker layer name
    10099     * @return the new GPX and marker layers corresponding to the specified NMEA file
    101100     * @throws IOException if an I/O error occurs
    102101     */
    103102    public static GpxImporterData loadLayers(InputStream is, final File associatedFile,
    104             final String gpxLayerName, String markerLayerName) throws IOException {
     103                                             final String gpxLayerName) throws IOException {
    105104        final NmeaReader r = buildAndParse(is);
    106105        final boolean parsedProperly = r.getNumberOfCoordinates() > 0;
    107106        r.getGpxData().storageFile = associatedFile;
    108         return GpxImporter.loadLayers(r.getGpxData(), parsedProperly, gpxLayerName, markerLayerName);
     107        return GpxImporter.loadLayers(r.getGpxData(), parsedProperly, gpxLayerName);
    109108    }
    110109
  • trunk/src/org/openstreetmap/josm/gui/io/importexport/RtkLibImporter.java

    r15247 r16866  
    9191     * @param associatedFile RTKLib file
    9292     * @param gpxLayerName The GPX layer name
    93      * @param markerLayerName The marker layer name
    9493     * @return the new GPX and marker layers corresponding to the specified RTKLib file
    9594     * @throws IOException if an I/O error occurs
    9695     */
    9796    public static GpxImporterData loadLayers(InputStream is, final File associatedFile,
    98             final String gpxLayerName, String markerLayerName) throws IOException {
     97                                             final String gpxLayerName) throws IOException {
    9998        final RtkLibPosReader r = buildAndParse(is);
    10099        final boolean parsedProperly = r.getNumberOfCoordinates() > 0;
    101100        r.getGpxData().storageFile = associatedFile;
    102         return GpxImporter.loadLayers(r.getGpxData(), parsedProperly, gpxLayerName, markerLayerName);
     101        return GpxImporter.loadLayers(r.getGpxData(), parsedProperly, gpxLayerName);
    103102    }
    104103
  • trunk/src/org/openstreetmap/josm/io/session/GpxTracksSessionImporter.java

    r16865 r16866  
    4848
    4949                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());
    5151                } 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());
    5353                } else {
    54                     importData = GpxImporter.loadLayers(in, support.getFile(fileStr), support.getLayerName(), null, progressMonitor);
     54                    importData = GpxImporter.loadLayers(in, support.getFile(fileStr), support.getLayerName(), progressMonitor);
    5555                }
    5656
  • trunk/src/org/openstreetmap/josm/io/session/MarkerSessionImporter.java

    r12671 r16866  
    4646            try (InputStream in = support.getInputStream(fileStr)) {
    4747                GpxImporter.GpxImporterData importData = GpxImporter.loadLayers(in, support.getFile(fileStr), support.getLayerName(),
    48                         null, progressMonitor);
     48                        progressMonitor);
    4949
    5050                support.addPostLayersTask(importData.getPostLayerTask());
Note: See TracChangeset for help on using the changeset viewer.