Changeset 10364 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2016-06-12T20:46:23+02:00 (8 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/command/SelectCommand.java
r9989 r10364 38 38 @Override 39 39 public void undoCommand() { 40 Main. map.mapView.getEditLayer().data.setSelected(oldSelection);40 Main.getLayerManager().getEditLayer().data.setSelected(oldSelection); 41 41 } 42 42 43 43 @Override 44 44 public boolean executeCommand() { 45 oldSelection = Main. map.mapView.getEditLayer().data.getSelected();46 Main. map.mapView.getEditLayer().data.setSelected(newSelection);45 oldSelection = Main.getLayerManager().getEditLayer().data.getSelected(); 46 Main.getLayerManager().getEditLayer().data.setSelected(newSelection); 47 47 return true; 48 48 } -
trunk/src/org/openstreetmap/josm/command/conflict/ConflictAddCommand.java
r9371 r10364 62 62 @Override 63 63 public void undoCommand() { 64 if (Main.isDisplayingMapView() && !Main. map.mapView.hasLayer(getLayer())) {64 if (Main.isDisplayingMapView() && !Main.getLayerManager().containsLayer(getLayer())) { 65 65 Main.warn(tr("Layer ''{0}'' does not exist any more. Cannot remove conflict for object ''{1}''.", 66 66 getLayer().getName(), -
trunk/src/org/openstreetmap/josm/command/conflict/ConflictResolveCommand.java
r9371 r10364 71 71 72 72 if (Main.isDisplayingMapView()) { 73 if (!Main. map.mapView.hasLayer(getLayer())) {73 if (!Main.getLayerManager().containsLayer(getLayer())) { 74 74 Main.warn(tr("Cannot undo command ''{0}'' because layer ''{1}'' is not present any more", 75 75 this.toString(), … … 79 79 } 80 80 81 Main. map.mapView.setActiveLayer(getLayer());81 Main.getLayerManager().setActiveLayer(getLayer()); 82 82 } 83 83 reconstituteConflicts(); -
trunk/src/org/openstreetmap/josm/command/conflict/RelationMemberConflictResolverCommand.java
r9371 r10364 75 75 public void undoCommand() { 76 76 OsmDataLayer layer = getLayer(); 77 if (!Main. map.mapView.hasLayer(layer)) {77 if (!Main.getLayerManager().containsLayer(layer)) { 78 78 Main.warn(tr("Cannot undo command ''{0}'' because layer ''{1}'' is not present any more", 79 79 this.toString(), … … 83 83 } 84 84 85 Main. map.mapView.setActiveLayer(layer);85 Main.getLayerManager().setActiveLayer(layer); 86 86 OsmDataLayer editLayer = Main.main.getEditLayer(); 87 87 -
trunk/src/org/openstreetmap/josm/data/AutosaveTask.java
r10300 r10364 127 127 MapView.addLayerChangeListener(this); 128 128 if (Main.isDisplayingMapView()) { 129 for (OsmDataLayer l: Main. map.mapView.getLayersOfType(OsmDataLayer.class)) {129 for (OsmDataLayer l: Main.getLayerManager().getLayersOfType(OsmDataLayer.class)) { 130 130 registerNewlayer(l); 131 131 } -
trunk/src/org/openstreetmap/josm/gui/ImageryMenu.java
r10345 r10364 70 70 @Override 71 71 public void actionPerformed(ActionEvent e) { 72 Collection<ImageryLayer> layers = Main. map.mapView.getLayersOfType(ImageryLayer.class);72 Collection<ImageryLayer> layers = Main.getLayerManager().getLayersOfType(ImageryLayer.class); 73 73 if (layers.isEmpty()) { 74 74 setEnabled(false); -
trunk/src/org/openstreetmap/josm/gui/MapView.java
r10340 r10364 417 417 public static void addEditLayerChangeListener(EditLayerChangeListener listener, boolean initialFire) { 418 418 if (listener != null) { 419 boolean doFire = initialFire && Main.isDisplayingMapView() && Main. map.mapView.getEditLayer() != null;419 boolean doFire = initialFire && Main.isDisplayingMapView() && Main.getLayerManager().getEditLayer() != null; 420 420 if (doFire) { 421 421 Main.getLayerManager().addAndFireActiveLayerChangeListener(new EditLayerChangeAdapter(listener)); -
trunk/src/org/openstreetmap/josm/gui/conflict/pair/ListMerger.java
r10210 r10364 891 891 protected final <P extends OsmPrimitive> OsmDataLayer findLayerFor(P primitive) { 892 892 if (primitive != null) { 893 Iterable<OsmDataLayer> layers = Main. map.mapView.getLayersOfType(OsmDataLayer.class);893 Iterable<OsmDataLayer> layers = Main.getLayerManager().getLayersOfType(OsmDataLayer.class); 894 894 // Find layer with same dataset 895 895 for (OsmDataLayer layer : layers) { -
trunk/src/org/openstreetmap/josm/gui/dialogs/layer/DuplicateAction.java
r10346 r10364 57 57 58 58 List<String> layerNames = new ArrayList<>(); 59 for (Layer l: Main. map.mapView.getAllLayers()) {59 for (Layer l: Main.getLayerManager().getLayers()) { 60 60 layerNames.add(l.getName()); 61 61 } -
trunk/src/org/openstreetmap/josm/gui/layer/GpxLayer.java
r10175 r10364 300 300 drawHelper.readPreferences(getName()); 301 301 drawHelper.drawAll(g, mv, visibleSegments); 302 if (Main. map.mapView.getActiveLayer() == this) {302 if (Main.getLayerManager().getActiveLayer() == this) { 303 303 drawHelper.drawColorBar(g, mv); 304 304 } -
trunk/src/org/openstreetmap/josm/gui/layer/Layer.java
r10181 r10364 171 171 long memoryBytesRequired = 50L * 1024L * 1024L; // assumed minimum JOSM memory footprint 172 172 if (Main.map != null && Main.map.mapView != null) { 173 for (Layer layer: Main. map.mapView.getAllLayers()) {173 for (Layer layer: Main.getLayerManager().getLayers()) { 174 174 memoryBytesRequired += layer.estimateMemoryUsage(); 175 175 } -
trunk/src/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImages.java
r10308 r10364 181 181 // If none, we'll zoom to the bounding box of the layer with the photos. 182 182 boolean boundingBoxedLayerFound = false; 183 for (Layer l: Main. map.mapView.getAllLayers()) {183 for (Layer l: Main.getLayerManager().getLayers()) { 184 184 if (l != yLayer) { 185 185 BoundingXYVisitor bbox = new BoundingXYVisitor(); … … 557 557 public void actionPerformed(ActionEvent arg0) { 558 558 // Construct the list of loaded GPX tracks 559 Collection<Layer> layerLst = Main. map.mapView.getAllLayers();559 Collection<Layer> layerLst = Main.getLayerManager().getLayers(); 560 560 GpxDataWrapper defaultItem = null; 561 561 for (Layer cur : layerLst) { -
trunk/src/org/openstreetmap/josm/gui/layer/geoimage/GeoImageLayer.java
r10173 r10364 784 784 private void clearOtherCurrentPhotos() { 785 785 for (GeoImageLayer layer: 786 Main. map.mapView.getLayersOfType(GeoImageLayer.class)) {786 Main.getLayerManager().getLayersOfType(GeoImageLayer.class)) { 787 787 if (layer != this) { 788 788 layer.clearCurrentPhoto(false); -
trunk/src/org/openstreetmap/josm/gui/layer/gpx/DownloadWmsAlongTrackAction.java
r10228 r10364 116 116 return null; 117 117 } 118 List<AbstractTileSourceLayer> targetLayers = Main. map.mapView.getLayersOfType(AbstractTileSourceLayer.class);118 List<AbstractTileSourceLayer> targetLayers = Main.getLayerManager().getLayersOfType(AbstractTileSourceLayer.class); 119 119 if (targetLayers.isEmpty()) { 120 120 if (!GraphicsEnvironment.isHeadless()) { -
trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/MarkerLayer.java
r10300 r10364 449 449 return; 450 450 Marker m = null; 451 Layer l = Main. map.mapView.getActiveLayer();451 Layer l = Main.getLayerManager().getActiveLayer(); 452 452 if (l != null) { 453 453 m = getAdjacentMarker(startMarker, next, l); 454 454 } 455 455 if (m == null) { 456 for (Layer layer : Main. map.mapView.getAllLayers()) {456 for (Layer layer : Main.getLayerManager().getLayers()) { 457 457 m = getAdjacentMarker(startMarker, next, layer); 458 458 if (m != null) { -
trunk/src/org/openstreetmap/josm/gui/mappaint/MapPaintMenu.java
r10179 r10364 70 70 71 71 private static boolean mapHasGpxorMarkerLayer() { 72 for (Layer layer : Main. map.mapView.getAllLayers()) {72 for (Layer layer : Main.getLayerManager().getLayers()) { 73 73 if (layer instanceof GpxLayer || layer instanceof MarkerLayer) { 74 74 return true; -
trunk/src/org/openstreetmap/josm/io/NoteImporter.java
r9797 r10364 38 38 try (InputStream is = Compression.getUncompressedFileInputStream(file)) { 39 39 final NoteLayer layer = loadLayer(is, file, file.getName(), progressMonitor); 40 if (Main.map == null || !Main. map.mapView.hasLayer(layer)) {40 if (Main.map == null || !Main.getLayerManager().containsLayer(layer)) { 41 41 GuiHelper.runInEDT(new Runnable() { 42 42 @Override … … 69 69 List<NoteLayer> noteLayers = null; 70 70 if (Main.map != null) { 71 noteLayers = Main. map.mapView.getLayersOfType(NoteLayer.class);71 noteLayers = Main.getLayerManager().getLayersOfType(NoteLayer.class); 72 72 } 73 73 final NoteLayer layer; -
trunk/src/org/openstreetmap/josm/io/OsmApi.java
r10212 r10364 249 249 * been disabled! */ 250 250 if (Main.isDisplayingMapView()) { 251 for (Layer l : Main. map.mapView.getLayersOfType(ImageryLayer.class)) {251 for (Layer l : Main.getLayerManager().getLayersOfType(ImageryLayer.class)) { 252 252 if (((ImageryLayer) l).getInfo().isBlacklisted()) { 253 253 Main.info(tr("Removed layer {0} because it is not allowed by the configured API.", l.getName())); -
trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/ImageryHandler.java
r10116 r10364 95 95 final ImageryInfo imgInfo = buildImageryInfo(); 96 96 if (Main.isDisplayingMapView()) { 97 for (ImageryLayer layer : Main. map.mapView.getLayersOfType(ImageryLayer.class)) {97 for (ImageryLayer layer : Main.getLayerManager().getLayersOfType(ImageryLayer.class)) { 98 98 if (layer.getInfo().equals(imgInfo)) { 99 99 Main.info("Imagery layer already exists: "+imgInfo); -
trunk/src/org/openstreetmap/josm/io/session/MarkerSessionExporter.java
r9983 r10364 44 44 public Collection<Layer> getDependencies() { 45 45 Layer gpxLayer = layer.fromLayer; 46 if (gpxLayer != null && Main. map.mapView.hasLayer(gpxLayer))46 if (gpxLayer != null && Main.getLayerManager().containsLayer(gpxLayer)) 47 47 return Collections.singleton(gpxLayer); 48 48 return Collections.emptySet();
Note:
See TracChangeset
for help on using the changeset viewer.