Ticket #18160: 18160.2.patch
File 18160.2.patch, 5.0 KB (added by , 5 years ago) |
---|
-
src/org/openstreetmap/josm/gui/MapView.java
28 28 import java.util.LinkedHashSet; 29 29 import java.util.List; 30 30 import java.util.Set; 31 import java.util.TreeSet;32 31 import java.util.concurrent.CopyOnWriteArrayList; 33 32 import java.util.concurrent.atomic.AtomicBoolean; 33 import java.util.stream.Collectors; 34 34 35 35 import javax.swing.AbstractButton; 36 36 import javax.swing.JComponent; … … 50 50 import org.openstreetmap.josm.gui.MapViewState.MapViewRectangle; 51 51 import org.openstreetmap.josm.gui.autofilter.AutoFilterManager; 52 52 import org.openstreetmap.josm.gui.datatransfer.OsmTransferHandler; 53 import org.openstreetmap.josm.gui.layer.GpxLayer;54 import org.openstreetmap.josm.gui.layer.ImageryLayer;55 53 import org.openstreetmap.josm.gui.layer.Layer; 56 54 import org.openstreetmap.josm.gui.layer.LayerManager; 57 55 import org.openstreetmap.josm.gui.layer.LayerManager.LayerAddEvent; … … 66 64 import org.openstreetmap.josm.gui.layer.MapViewPaintable.PaintableInvalidationEvent; 67 65 import org.openstreetmap.josm.gui.layer.MapViewPaintable.PaintableInvalidationListener; 68 66 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 69 import org.openstreetmap.josm.gui.layer.geoimage.GeoImageLayer;70 67 import org.openstreetmap.josm.gui.layer.markerlayer.PlayHeadMarker; 71 68 import org.openstreetmap.josm.gui.mappaint.MapPaintStyles; 72 69 import org.openstreetmap.josm.gui.mappaint.MapPaintStyles.MapPaintSylesUpdateListener; … … 818 815 * @return A String of sources separated by ';' 819 816 */ 820 817 public String getLayerInformationForSourceTag() { 821 final Set<String> layerInfo = new TreeSet<>(); 822 if (!layerManager.getLayersOfType(GpxLayer.class).isEmpty()) { 823 // no i18n for international values 824 layerInfo.add("survey"); 825 } 826 for (final GeoImageLayer i : layerManager.getLayersOfType(GeoImageLayer.class)) { 827 if (i.isVisible()) { 828 layerInfo.add(i.getName()); 829 } 830 } 831 for (final ImageryLayer i : layerManager.getLayersOfType(ImageryLayer.class)) { 832 if (i.isVisible()) { 833 layerInfo.add(i.getInfo().getSourceName()); 834 } 835 } 818 final Set<String> layerInfo = layerManager.getLayers().stream() 819 .filter(layer -> layer.getChangesetSourceTag() != null && !layer.getChangesetSourceTag().trim().isEmpty()) 820 .map(layer -> layer.getChangesetSourceTag().trim()).distinct().collect(Collectors.toSet()); 836 821 return Utils.join("; ", layerInfo); 837 822 } 838 823 -
src/org/openstreetmap/josm/gui/layer/GpxLayer.java
473 473 public void expertChanged(boolean isExpert) { 474 474 this.isExpertMode = isExpert; 475 475 } 476 477 @Override 478 public String getChangesetSourceTag() { 479 return "survey"; 480 } 476 481 } -
src/org/openstreetmap/josm/gui/layer/ImageryLayer.java
354 354 public String toString() { 355 355 return getClass().getSimpleName() + " [info=" + info + ']'; 356 356 } 357 358 @Override 359 public String getChangesetSourceTag() { 360 if (isVisible()) 361 return getInfo().getSourceName(); 362 return null; 363 } 357 364 } -
src/org/openstreetmap/josm/gui/layer/Layer.java
674 674 return v.getBounds(); 675 675 } 676 676 677 /** 678 * Get the source for the layer 679 * @return The string for the changeset source tag or {@code null} 680 * @since xxx 681 */ 682 public String getChangesetSourceTag() { 683 return null; 684 } 685 677 686 @Override 678 687 public String toString() { 679 688 return getClass().getSimpleName() + " [name=" + name + ", associatedFile=" + associatedFile + ']'; -
src/org/openstreetmap/josm/gui/layer/geoimage/GeoImageLayer.java
1010 1010 public void imageDataUpdated(ImageData data) { 1011 1011 updateBufferAndRepaint(); 1012 1012 } 1013 1014 @Override 1015 public String getChangesetSourceTag() { 1016 if (isVisible()) 1017 return getName(); 1018 return null; 1019 } 1013 1020 }