Changeset 15560 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2019-12-07T16:38:26+01:00 (5 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/gpx/GpxConstants.java
r15496 r15560 239 239 static Map<String, String> getExtensionAbbreviations() { 240 240 TreeMap<String, String> m = new TreeMap<>(String.CASE_INSENSITIVE_ORDER); 241 m.put("gpx:extension:gpxx:TrackExtension s:DisplayColor", "gpxx:DisplayColor");241 m.put("gpx:extension:gpxx:TrackExtension:DisplayColor", "gpxx:DisplayColor"); 242 242 m.put("gpx:extension:gpxd:color", "gpxd:color"); 243 243 return m; -
trunk/src/org/openstreetmap/josm/data/gpx/GpxExtensionCollection.java
r15497 r15560 148 148 /** 149 149 * Adds an extension from a flat chain without prefix, e.g. when converting from OSM 150 * @param chain the full key chain, e.g. ["extension", "gpxx", "TrackExtension s", "DisplayColor"]150 * @param chain the full key chain, e.g. ["extension", "gpxx", "TrackExtension", "DisplayColor"] 151 151 * @param value the value 152 152 */ -
trunk/src/org/openstreetmap/josm/data/gpx/GpxTrack.java
r15497 r15560 170 170 } 171 171 closestGarminColorCache.put(c, colorString); 172 getExtensions().addIfNotPresent("gpxx", "TrackExtension s").getExtensions().addOrUpdate("gpxx", "DisplayColor", colorString);172 getExtensions().addIfNotPresent("gpxx", "TrackExtension").getExtensions().addOrUpdate("gpxx", "DisplayColor", colorString); 173 173 } else if (cFormat == ColorFormat.GPXD) { 174 174 setColor(c); -
trunk/src/org/openstreetmap/josm/gui/io/importexport/GpxImporter.java
r15496 r15560 13 13 import org.openstreetmap.josm.data.gpx.GpxData; 14 14 import org.openstreetmap.josm.gui.MainApplication; 15 import org.openstreetmap.josm.gui.Notification; 15 16 import org.openstreetmap.josm.gui.layer.GpxLayer; 17 import org.openstreetmap.josm.gui.layer.ImageryLayer; 18 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 16 19 import org.openstreetmap.josm.gui.layer.markerlayer.MarkerLayer; 17 20 import org.openstreetmap.josm.gui.progress.ProgressMonitor; … … 154 157 } 155 158 } 159 160 final boolean isSameColor = MainApplication.getLayerManager() 161 .getLayersOfType(ImageryLayer.class) 162 .stream().noneMatch(ImageryLayer::isVisible) 163 && data.getTracks().stream().anyMatch(t -> OsmDataLayer.getBackgroundColor().equals(t.getColor())); 164 156 165 Runnable postLayerTask = () -> { 157 166 if (!parsedProperly) { … … 166 175 JOptionPane.showMessageDialog(null, msg); 167 176 } 177 if (isSameColor) { 178 new Notification(tr("The imported track \"{0}\" might not be visible because it has the same color as the background." + 179 "<br>You can change this in the context menu of the imported layer.", gpxLayerName)) 180 .setIcon(JOptionPane.WARNING_MESSAGE) 181 .setDuration(Notification.TIME_LONG) 182 .show(); 183 } 168 184 }; 169 185 return new GpxImporterData(gpxLayer, markerLayer, postLayerTask);
Note:
See TracChangeset
for help on using the changeset viewer.