-
diff --git a/src/org/openstreetmap/josm/command/SelectCommand.java b/src/org/openstreetmap/josm/command/SelectCommand.java
index df372ad..d893d18 100644
|
a
|
b
|
public class SelectCommand extends Command {
|
| 37 | 37 | |
| 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 | } |
| 49 | 49 | |
-
diff --git a/src/org/openstreetmap/josm/command/conflict/ConflictAddCommand.java b/src/org/openstreetmap/josm/command/conflict/ConflictAddCommand.java
index d3da64b..8f7e927 100644
|
a
|
b
|
public class ConflictAddCommand extends Command {
|
| 61 | 61 | |
| 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(), |
| 67 | 67 | conflict.getMy().getDisplayName(DefaultNameFormatter.getInstance()) |
-
diff --git a/src/org/openstreetmap/josm/command/conflict/ConflictResolveCommand.java b/src/org/openstreetmap/josm/command/conflict/ConflictResolveCommand.java
index 98c40de..5f21a57 100644
|
a
|
b
|
public abstract class ConflictResolveCommand extends Command {
|
| 70 | 70 | super.undoCommand(); |
| 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(), |
| 76 | 76 | getLayer().toString() |
| … |
… |
public abstract class ConflictResolveCommand extends Command {
|
| 78 | 78 | return; |
| 79 | 79 | } |
| 80 | 80 | |
| 81 | | Main.map.mapView.setActiveLayer(getLayer()); |
| | 81 | Main.getLayerManager().setActiveLayer(getLayer()); |
| 82 | 82 | } |
| 83 | 83 | reconstituteConflicts(); |
| 84 | 84 | } |
-
diff --git a/src/org/openstreetmap/josm/command/conflict/RelationMemberConflictResolverCommand.java b/src/org/openstreetmap/josm/command/conflict/RelationMemberConflictResolverCommand.java
index 5905af2..820f9cf 100644
|
a
|
b
|
public class RelationMemberConflictResolverCommand extends ConflictResolveComman
|
| 74 | 74 | @Override |
| 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(), |
| 80 | 80 | layer.toString() |
| … |
… |
public class RelationMemberConflictResolverCommand extends ConflictResolveComman
|
| 82 | 82 | return; |
| 83 | 83 | } |
| 84 | 84 | |
| 85 | | Main.map.mapView.setActiveLayer(layer); |
| | 85 | Main.getLayerManager().setActiveLayer(layer); |
| 86 | 86 | OsmDataLayer editLayer = Main.main.getEditLayer(); |
| 87 | 87 | |
| 88 | 88 | // restore the former state |
-
diff --git a/src/org/openstreetmap/josm/data/AutosaveTask.java b/src/org/openstreetmap/josm/data/AutosaveTask.java
index d872628..1f84387 100644
|
a
|
b
|
public class AutosaveTask extends TimerTask implements LayerChangeListener, List
|
| 126 | 126 | timer.schedule(this, 1000L, PROP_INTERVAL.get() * 1000L); |
| 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 | } |
| 132 | 132 | } |
-
diff --git a/src/org/openstreetmap/josm/gui/ImageryMenu.java b/src/org/openstreetmap/josm/gui/ImageryMenu.java
index a6359bc..2797a60 100644
|
a
|
b
|
public class ImageryMenu extends JMenu implements LayerChangeListener {
|
| 69 | 69 | |
| 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); |
| 75 | 75 | return; |
-
diff --git a/src/org/openstreetmap/josm/gui/MapView.java b/src/org/openstreetmap/josm/gui/MapView.java
index c1abe48..5f4df08 100644
|
a
|
b
|
LayerManager.LayerChangeListener, MainLayerManager.ActiveLayerChangeListener {
|
| 416 | 416 | @Deprecated |
| 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)); |
| 422 | 422 | } else { |
-
diff --git a/src/org/openstreetmap/josm/gui/conflict/pair/ListMerger.java b/src/org/openstreetmap/josm/gui/conflict/pair/ListMerger.java
index 468b2ee..3a43f9d 100644
|
a
|
b
|
public abstract class ListMerger<T extends PrimitiveId> extends JPanel implement
|
| 890 | 890 | |
| 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) { |
| 896 | 896 | if (layer.data == primitive.getDataSet()) { |
-
diff --git a/src/org/openstreetmap/josm/gui/dialogs/layer/DuplicateAction.java b/src/org/openstreetmap/josm/gui/dialogs/layer/DuplicateAction.java
index 2d54c21..ca3c889 100644
|
a
|
b
|
public final class DuplicateAction extends AbstractAction implements IEnabledSta
|
| 56 | 56 | return; |
| 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 | } |
| 62 | 62 | if (layer instanceof OsmDataLayer) { |
-
diff --git a/src/org/openstreetmap/josm/gui/layer/GpxLayer.java b/src/org/openstreetmap/josm/gui/layer/GpxLayer.java
index 983093d..da9a97e 100644
|
a
|
b
|
public class GpxLayer extends Layer {
|
| 299 | 299 | if (!visibleSegments.isEmpty()) { |
| 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 | } |
| 305 | 305 | } |
-
diff --git a/src/org/openstreetmap/josm/gui/layer/Layer.java b/src/org/openstreetmap/josm/gui/layer/Layer.java
index 45f505c..66154ef 100644
|
a
|
b
|
public abstract class Layer extends AbstractMapViewPaintable implements Destroya
|
| 170 | 170 | // calculate total memory needed for all layers |
| 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 | } |
| 176 | 176 | if (memoryBytesRequired > Runtime.getRuntime().maxMemory()) { |
-
diff --git a/src/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImages.java b/src/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImages.java
index 8169ef0..53248ff 100644
|
a
|
b
|
public class CorrelateGpxWithImages extends AbstractAction {
|
| 180 | 180 | // Search whether an other layer has yet defined some bounding box. |
| 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(); |
| 186 | 186 | l.visitBoundingBox(bbox); |
| … |
… |
public class CorrelateGpxWithImages extends AbstractAction {
|
| 556 | 556 | @Override |
| 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) { |
| 562 | 562 | if (cur instanceof GpxLayer) { |
-
diff --git a/src/org/openstreetmap/josm/gui/layer/geoimage/GeoImageLayer.java b/src/org/openstreetmap/josm/gui/layer/geoimage/GeoImageLayer.java
index 70ab30c..10a5f49 100644
|
a
|
b
|
public class GeoImageLayer extends AbstractModifiableLayer implements PropertyCh
|
| 783 | 783 | */ |
| 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); |
| 789 | 789 | } |
-
diff --git a/src/org/openstreetmap/josm/gui/layer/gpx/DownloadWmsAlongTrackAction.java b/src/org/openstreetmap/josm/gui/layer/gpx/DownloadWmsAlongTrackAction.java
index f4c51c5..553ab70 100644
|
a
|
b
|
public class DownloadWmsAlongTrackAction extends AbstractAction {
|
| 115 | 115 | if (!Main.isDisplayingMapView()) { |
| 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()) { |
| 121 | 121 | warnNoImageryLayers(); |
-
diff --git a/src/org/openstreetmap/josm/gui/layer/markerlayer/MarkerLayer.java b/src/org/openstreetmap/josm/gui/layer/markerlayer/MarkerLayer.java
index 7f7724a..dc61ea3 100644
|
a
|
b
|
public class MarkerLayer extends Layer implements JumpToMarkerLayer {
|
| 448 | 448 | if (!Main.isDisplayingMapView()) |
| 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) { |
| 459 | 459 | break; |
-
diff --git a/src/org/openstreetmap/josm/gui/mappaint/MapPaintMenu.java b/src/org/openstreetmap/josm/gui/mappaint/MapPaintMenu.java
index 6959fe3..a02d039 100644
|
a
|
b
|
public class MapPaintMenu extends JMenu implements MapPaintSylesUpdateListener {
|
| 69 | 69 | } |
| 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; |
| 75 | 75 | } |
-
diff --git a/src/org/openstreetmap/josm/io/NoteImporter.java b/src/org/openstreetmap/josm/io/NoteImporter.java
index 8ac259e..da40198 100644
|
a
|
b
|
public class NoteImporter extends FileImporter {
|
| 37 | 37 | } |
| 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 |
| 43 | 43 | public void run() { |
| … |
… |
public class NoteImporter extends FileImporter {
|
| 68 | 68 | final List<Note> fileNotes = new NoteReader(in).parse(); |
| 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; |
| 74 | 74 | if (noteLayers != null && !noteLayers.isEmpty()) { |
-
diff --git a/src/org/openstreetmap/josm/io/OsmApi.java b/src/org/openstreetmap/josm/io/OsmApi.java
index d661461..3408a8b 100644
|
a
|
b
|
public class OsmApi extends OsmConnection {
|
| 248 | 248 | * to load the layers in the first place because they would have |
| 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())); |
| 254 | 254 | Main.main.removeLayer(l); |
-
diff --git a/src/org/openstreetmap/josm/io/remotecontrol/handler/ImageryHandler.java b/src/org/openstreetmap/josm/io/remotecontrol/handler/ImageryHandler.java
index d601f15..f85c5dc 100644
|
a
|
b
|
public class ImageryHandler extends RequestHandler.RawURLParseRequestHandler {
|
| 94 | 94 | protected void handleRequest() throws RequestHandlerErrorException { |
| 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); |
| 100 | 100 | return; |
-
diff --git a/src/org/openstreetmap/josm/io/session/MarkerSessionExporter.java b/src/org/openstreetmap/josm/io/session/MarkerSessionExporter.java
index fe34c07..838997d 100644
|
a
|
b
|
public class MarkerSessionExporter extends AbstractSessionExporter<MarkerLayer>
|
| 43 | 43 | @Override |
| 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(); |
| 49 | 49 | } |
-
diff --git a/test/unit/org/openstreetmap/josm/JOSMFixture.java b/test/unit/org/openstreetmap/josm/JOSMFixture.java
index 12872f2..9666bd4 100644
|
a
|
b
|
public class JOSMFixture {
|
| 124 | 124 | if (Main.map == null) { |
| 125 | 125 | Main.main.createMapFrame(null, null); |
| 126 | 126 | } else { |
| 127 | | for (Layer l: Main.map.mapView.getAllLayers()) { |
| | 127 | for (Layer l: Main.getLayerManager().getLayers()) { |
| 128 | 128 | Main.map.mapView.removeLayer(l); |
| 129 | 129 | } |
| 130 | 130 | } |
-
diff --git a/test/unit/org/openstreetmap/josm/actions/AddImageryLayerActionTest.java b/test/unit/org/openstreetmap/josm/actions/AddImageryLayerActionTest.java
index da3a1f8..1650c29 100644
|
a
|
b
|
public final class AddImageryLayerActionTest {
|
| 46 | 46 | */ |
| 47 | 47 | @Test |
| 48 | 48 | public void testActionPerformedEnabled() { |
| 49 | | assertTrue(Main.map.mapView.getLayersOfType(TMSLayer.class).isEmpty()); |
| | 49 | assertTrue(Main.getLayerManager().getLayersOfType(TMSLayer.class).isEmpty()); |
| 50 | 50 | new AddImageryLayerAction(new ImageryInfo("foo_tms", "http://bar", "tms", null, null)).actionPerformed(null); |
| 51 | | List<TMSLayer> tmsLayers = Main.map.mapView.getLayersOfType(TMSLayer.class); |
| | 51 | List<TMSLayer> tmsLayers = Main.getLayerManager().getLayersOfType(TMSLayer.class); |
| 52 | 52 | assertEquals(1, tmsLayers.size()); |
| 53 | 53 | |
| 54 | 54 | try { |
| 55 | 55 | new AddImageryLayerAction(new ImageryInfo("wms.openstreetmap.fr", "http://wms.openstreetmap.fr/wms?", |
| 56 | 56 | "wms_endpoint", null, null)).actionPerformed(null); |
| 57 | | List<WMSLayer> wmsLayers = Main.map.mapView.getLayersOfType(WMSLayer.class); |
| | 57 | List<WMSLayer> wmsLayers = Main.getLayerManager().getLayersOfType(WMSLayer.class); |
| 58 | 58 | assertEquals(1, wmsLayers.size()); |
| 59 | 59 | |
| 60 | 60 | Main.map.mapView.removeLayer(wmsLayers.get(0)); |
| … |
… |
public final class AddImageryLayerActionTest {
|
| 68 | 68 | */ |
| 69 | 69 | @Test |
| 70 | 70 | public void testActionPerformedDisabled() { |
| 71 | | assertTrue(Main.map.mapView.getLayersOfType(TMSLayer.class).isEmpty()); |
| | 71 | assertTrue(Main.getLayerManager().getLayersOfType(TMSLayer.class).isEmpty()); |
| 72 | 72 | new AddImageryLayerAction(new ImageryInfo()).actionPerformed(null); |
| 73 | | assertTrue(Main.map.mapView.getLayersOfType(TMSLayer.class).isEmpty()); |
| | 73 | assertTrue(Main.getLayerManager().getLayersOfType(TMSLayer.class).isEmpty()); |
| 74 | 74 | } |
| 75 | 75 | } |
-
diff --git a/test/unit/org/openstreetmap/josm/command/conflict/ConflictAddCommandTest.java b/test/unit/org/openstreetmap/josm/command/conflict/ConflictAddCommandTest.java
index 9a8d73a..f51b203 100644
|
a
|
b
|
public class ConflictAddCommandTest {
|
| 50 | 50 | */ |
| 51 | 51 | @Test |
| 52 | 52 | public void testExecuteUndoCommand() { |
| 53 | | OsmDataLayer layer = Main.map.mapView.getEditLayer(); |
| | 53 | OsmDataLayer layer = Main.getLayerManager().getEditLayer(); |
| 54 | 54 | Conflict<Node> conflict = new Conflict<>(new Node(), new Node()); |
| 55 | 55 | ConflictAddCommand cmd = new ConflictAddCommand(layer, conflict); |
| 56 | 56 | assertTrue(cmd.executeCommand()); |
| … |
… |
public class ConflictAddCommandTest {
|
| 66 | 66 | */ |
| 67 | 67 | @Test |
| 68 | 68 | public void testGetDescriptionIcon() { |
| 69 | | OsmDataLayer layer = Main.map.mapView.getEditLayer(); |
| | 69 | OsmDataLayer layer = Main.getLayerManager().getEditLayer(); |
| 70 | 70 | Conflict<Node> conflict = new Conflict<>(new Node(), new Node()); |
| 71 | 71 | assertNotNull(new ConflictAddCommand(layer, conflict).getDescriptionIcon()); |
| 72 | 72 | } |
-
diff --git a/test/unit/org/openstreetmap/josm/gui/layer/geoimage/GeoImageLayerTest.java b/test/unit/org/openstreetmap/josm/gui/layer/geoimage/GeoImageLayerTest.java
index dd20ea9..ba79468 100644
|
a
|
b
|
public class GeoImageLayerTest {
|
| 48 | 48 | Collections.singleton(new File(TestUtils.getRegressionDataFile(12255, "G0016941.JPG"))), |
| 49 | 49 | gpxLayer).run(); |
| 50 | 50 | assertEquals(2, Main.map.mapView.getNumLayers()); |
| 51 | | GeoImageLayer layer = Main.map.mapView.getLayersOfType(GeoImageLayer.class).iterator().next(); |
| | 51 | GeoImageLayer layer = Main.getLayerManager().getLayersOfType(GeoImageLayer.class).iterator().next(); |
| 52 | 52 | try { |
| 53 | 53 | assertEquals(gpxLayer, layer.getGpxLayer()); |
| 54 | 54 | List<ImageEntry> images = layer.getImages(); |
-
diff --git a/test/unit/org/openstreetmap/josm/io/NoteImporterTest.java b/test/unit/org/openstreetmap/josm/io/NoteImporterTest.java
index 012f095..ca34b92 100644
|
a
|
b
|
public class NoteImporterTest {
|
| 22 | 22 | @Test |
| 23 | 23 | public void testTicket12531() { |
| 24 | 24 | if (Main.map != null) { |
| 25 | | for (Layer l: Main.map.mapView.getAllLayers()) { |
| | 25 | for (Layer l: Main.getLayerManager().getLayers()) { |
| 26 | 26 | Main.map.mapView.removeLayer(l); |
| 27 | 27 | } |
| 28 | 28 | Main.main.setMapFrame(null); |
-
diff --git a/test/unit/org/openstreetmap/josm/io/remotecontrol/handler/ImportHandlerTest.java b/test/unit/org/openstreetmap/josm/io/remotecontrol/handler/ImportHandlerTest.java
index 0345ca0..912347f 100644
|
a
|
b
|
public class ImportHandlerTest {
|
| 94 | 94 | try { |
| 95 | 95 | newHandler("https://localhost?url=" + Utils.encodeUrl(url)).handle(); |
| 96 | 96 | } finally { |
| 97 | | for (OsmDataLayer layer : Main.map.mapView.getLayersOfType(OsmDataLayer.class)) { |
| | 97 | for (OsmDataLayer layer : Main.getLayerManager().getLayersOfType(OsmDataLayer.class)) { |
| 98 | 98 | Main.main.removeLayer(layer); |
| 99 | 99 | } |
| 100 | 100 | } |
-
diff --git a/test/unit/org/openstreetmap/josm/io/session/SessionReaderTest.java b/test/unit/org/openstreetmap/josm/io/session/SessionReaderTest.java
index ff23165..d5924eb 100644
|
a
|
b
|
public class SessionReaderTest {
|
| 138 | 138 | @Test |
| 139 | 139 | public void testReadNotes() throws IOException, IllegalDataException { |
| 140 | 140 | if (Main.isDisplayingMapView()) { |
| 141 | | for (NoteLayer nl : Main.map.mapView.getLayersOfType(NoteLayer.class)) { |
| | 141 | for (NoteLayer nl : Main.getLayerManager().getLayersOfType(NoteLayer.class)) { |
| 142 | 142 | Main.map.mapView.removeLayer(nl); |
| 143 | 143 | } |
| 144 | 144 | } |