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

GpxImporter: compute markerLayerName

Location:
trunk/src/org/openstreetmap/josm/gui/io/importexport
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • 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
Note: See TracChangeset for help on using the changeset viewer.