Changeset 10436 in josm
- Timestamp:
- 2016-06-20T02:47:43+02:00 (8 years ago)
- Location:
- trunk
- Files:
-
- 56 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/DeleteLayerAction.java
r10413 r10436 37 37 return; 38 38 } 39 Main. main.removeLayer(activeLayer);39 Main.getLayerManager().removeLayer(activeLayer); 40 40 } 41 41 -
trunk/src/org/openstreetmap/josm/actions/MapRectifierWMSmenuAction.java
r10318 r10436 234 234 private static void addWMSLayer(String title, String url) { 235 235 WMSLayer layer = new WMSLayer(new ImageryInfo(title, url)); 236 Main. main.addLayer(layer);236 Main.getLayerManager().addLayer(layer); 237 237 } 238 238 -
trunk/src/org/openstreetmap/josm/actions/MergeLayerAction.java
r10413 r10436 57 57 @Override 58 58 public void run() { 59 Main. main.removeLayer(sourceLayer);59 Main.getLayerManager().removeLayer(sourceLayer); 60 60 } 61 61 }); -
trunk/src/org/openstreetmap/josm/actions/NewAction.java
r6509 r10436 30 30 @Override 31 31 public void actionPerformed(ActionEvent e) { 32 Main. main.addLayer(new OsmDataLayer(new DataSet(), OsmDataLayer.createNewName(), null));32 Main.getLayerManager().addLayer(new OsmDataLayer(new DataSet(), OsmDataLayer.createNewName(), null)); 33 33 } 34 34 } -
trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadNotesTask.java
r10318 r10436 117 117 noteLayers.get(0).getNoteData().addNotes(notesData); 118 118 } else { 119 Main. main.addLayer(new NoteLayer(notesData, tr("Notes")));119 Main.getLayerManager().addLayer(new NoteLayer(notesData, tr("Notes"))); 120 120 } 121 121 } -
trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadOsmTask.java
r10413 r10436 261 261 final OsmDataLayer layer = createNewLayer(newLayerName); 262 262 if (Main.main != null) 263 Main. main.addLayer(layer);263 Main.getLayerManager().addLayer(layer); 264 264 return layer; 265 265 } -
trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadTaskList.java
r10413 r10436 72 72 if (newLayer) { 73 73 Layer l = new OsmDataLayer(new DataSet(), OsmDataLayer.createNewName(), null); 74 Main. main.addLayer(l);74 Main.getLayerManager().addLayer(l); 75 75 Main.getLayerManager().setActiveLayer(l); 76 76 } -
trunk/src/org/openstreetmap/josm/data/validation/OsmValidator.java
r10297 r10436 222 222 if (errorLayer == null) { 223 223 errorLayer = new ValidatorLayer(); 224 Main. main.addLayer(errorLayer);224 Main.getLayerManager().addLayer(errorLayer); 225 225 } 226 226 } … … 367 367 if (e.getSource().getLayersOfType(OsmDataLayer.class).isEmpty()) { 368 368 if (errorLayer != null) { 369 Main. main.removeLayer(errorLayer);369 Main.getLayerManager().removeLayer(errorLayer); 370 370 } 371 371 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/layer/DeleteLayerAction.java
r10428 r10436 46 46 return; 47 47 for (Layer l: selectedLayers) { 48 Main. main.removeLayer(l);48 Main.getLayerManager().removeLayer(l); 49 49 } 50 50 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/layer/DuplicateAction.java
r10364 r10436 70 70 i++; 71 71 } 72 Main. main.addLayer(new OsmDataLayer(new DataSet(oldLayer.data), newName, null));72 Main.getLayerManager().addLayer(new OsmDataLayer(new DataSet(oldLayer.data), newName, null)); 73 73 } 74 74 } -
trunk/src/org/openstreetmap/josm/gui/io/DownloadPrimitivesWithReferrersTask.java
r10413 r10436 131 131 OsmDataLayer layer = Main.getLayerManager().getEditLayer(); 132 132 if (layer == null || this.newLayer) 133 Main. main.addLayer(tmpLayer);133 Main.getLayerManager().addLayer(tmpLayer); 134 134 else 135 135 layer.mergeFrom(tmpLayer); -
trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java
r10395 r10436 821 821 gpxLayer.setAssociatedFile(new File(getAssociatedFile().getParentFile(), filename)); 822 822 } 823 Main. main.addLayer(gpxLayer);823 Main.getLayerManager().addLayer(gpxLayer); 824 824 if (Main.pref.getBoolean("marker.makeautomarkers", true) && !gpxData.waypoints.isEmpty()) { 825 Main. main.addLayer(new MarkerLayer(gpxData, tr("Converted from: {0}", getName()), null, gpxLayer));826 } 827 Main. main.removeLayer(OsmDataLayer.this);825 Main.getLayerManager().addLayer(new MarkerLayer(gpxData, tr("Converted from: {0}", getName()), null, gpxLayer)); 826 } 827 Main.getLayerManager().removeLayer(OsmDataLayer.this); 828 828 } 829 829 } -
trunk/src/org/openstreetmap/josm/gui/layer/ValidatorLayer.java
r10386 r10436 164 164 public void layerRemoving(LayerRemoveEvent e) { 165 165 if (e.getRemovedLayer() instanceof OsmDataLayer && Main.isDisplayingMapView() && !Main.main.hasEditLayer()) { 166 Main. main.removeLayer(this);166 Main.getLayerManager().removeLayer(this); 167 167 } else if (e.getRemovedLayer() == this) { 168 168 Main.getLayerManager().removeLayerChangeListener(this); -
trunk/src/org/openstreetmap/josm/gui/layer/geoimage/GeoImageLayer.java
r10386 r10436 283 283 } 284 284 if (layer != null) { 285 Main. main.addLayer(layer);285 Main.getLayerManager().addLayer(layer); 286 286 287 287 if (!canceled && layer.data != null && !layer.data.isEmpty()) { -
trunk/src/org/openstreetmap/josm/gui/layer/gpx/ConvertToDataLayerAction.java
r9215 r10436 135 135 } 136 136 layer.setUploadDiscouraged(true); 137 Main. main.addLayer(layer);138 Main. main.removeLayer(this.layer);137 Main.getLayerManager().addLayer(layer); 138 Main.getLayerManager().removeLayer(this.layer); 139 139 } 140 140 } -
trunk/src/org/openstreetmap/josm/gui/layer/gpx/ImportAudioAction.java
r9243 r10436 115 115 importAudio(file, ml, firstStartTime, m); 116 116 } 117 Main. main.addLayer(ml);117 Main.getLayerManager().addLayer(ml); 118 118 Main.map.repaint(); 119 119 } -
trunk/src/org/openstreetmap/josm/gui/layer/gpx/MarkersFromNamedPointsAction.java
r8308 r10436 41 41 MarkerLayer ml = new MarkerLayer(namedTrackPoints, tr("Named Trackpoints from {0}", layer.getName()), layer.getAssociatedFile(), layer); 42 42 if (!ml.data.isEmpty()) { 43 Main. main.addLayer(ml);43 Main.getLayerManager().addLayer(ml); 44 44 } 45 45 } -
trunk/src/org/openstreetmap/josm/io/GpxImporter.java
r9477 r10436 121 121 public void run() { 122 122 if (data.markerLayer != null) { 123 Main. main.addLayer(data.markerLayer);123 Main.getLayerManager().addLayer(data.markerLayer); 124 124 } 125 125 if (data.gpxLayer != null) { 126 Main. main.addLayer(data.gpxLayer);126 Main.getLayerManager().addLayer(data.gpxLayer); 127 127 } 128 128 data.postLayerTask.run(); -
trunk/src/org/openstreetmap/josm/io/NMEAImporter.java
r10305 r10436 53 53 @Override 54 54 public void run() { 55 Main. main.addLayer(gpxLayer);55 Main.getLayerManager().addLayer(gpxLayer); 56 56 if (Main.pref.getBoolean("marker.makeautomarkers", true)) { 57 57 MarkerLayer ml = new MarkerLayer(r.data, tr("Markers from {0}", fn), fileFinal, gpxLayer); 58 58 if (!ml.data.isEmpty()) { 59 Main. main.addLayer(ml);59 Main.getLayerManager().addLayer(ml); 60 60 } 61 61 } -
trunk/src/org/openstreetmap/josm/io/OsmApi.java
r10378 r10436 256 256 if (((ImageryLayer) l).getInfo().isBlacklisted()) { 257 257 Main.info(tr("Removed layer {0} because it is not allowed by the configured API.", l.getName())); 258 Main. main.removeLayer(l);258 Main.getLayerManager().removeLayer(l); 259 259 } 260 260 } -
trunk/src/org/openstreetmap/josm/io/OsmChangeImporter.java
r10378 r10436 63 63 JOptionPane.INFORMATION_MESSAGE); 64 64 } 65 Main. main.addLayer(layer);65 Main.getLayerManager().addLayer(layer); 66 66 layer.onPostLoadFromFile(); 67 67 } -
trunk/src/org/openstreetmap/josm/io/OsmImporter.java
r10371 r10436 96 96 public void run() { 97 97 OsmDataLayer layer = data.getLayer(); 98 Main. main.addLayer(layer);98 Main.getLayerManager().addLayer(layer); 99 99 data.getPostLayerTask().run(); 100 100 data.getLayer().onPostLoadFromFile(); -
trunk/src/org/openstreetmap/josm/io/WMSLayerImporter.java
r8530 r10436 88 88 @Override 89 89 public void run() { 90 Main. main.addLayer(layer);90 Main.getLayerManager().addLayer(layer); 91 91 if (zoomTo != null) { 92 92 Main.map.mapView.zoomTo(zoomTo); -
trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/ImageryHandler.java
r10364 r10436 106 106 public void run() { 107 107 try { 108 Main. main.addLayer(ImageryLayer.create(imgInfo));108 Main.getLayerManager().addLayer(ImageryLayer.create(imgInfo)); 109 109 } catch (IllegalArgumentException e) { 110 110 Main.error(e, false); -
trunk/test/unit/org/openstreetmap/josm/actions/AlignInLineActionTest.java
r10347 r10436 59 59 60 60 try { 61 Main. main.addLayer(layer);61 Main.getLayerManager().addLayer(layer); 62 62 63 63 // Create an open way. … … 70 70 } finally { 71 71 // Ensure we clean the place before leaving, even if test fails. 72 Main. main.removeLayer(layer);72 Main.getLayerManager().removeLayer(layer); 73 73 } 74 74 … … 99 99 100 100 try { 101 Main. main.addLayer(layer);101 Main.getLayerManager().addLayer(layer); 102 102 103 103 // Create a closed way. … … 109 109 } finally { 110 110 // Ensure we clean the place before leaving, even if test fails. 111 Main. main.removeLayer(layer);111 Main.getLayerManager().removeLayer(layer); 112 112 } 113 113 … … 139 139 140 140 try { 141 Main. main.addLayer(layer);141 Main.getLayerManager().addLayer(layer); 142 142 143 143 // Create 2 ways. … … 152 152 } finally { 153 153 // Ensure we clean the place before leaving, even if test fails. 154 Main. main.removeLayer(layer);154 Main.getLayerManager().removeLayer(layer); 155 155 } 156 156 -
trunk/test/unit/org/openstreetmap/josm/actions/CreateCircleActionTest.java
r10225 r10436 94 94 action.setEnabled(true); 95 95 try { 96 Main. main.addLayer(layer);96 Main.getLayerManager().addLayer(layer); 97 97 action.actionPerformed(null); 98 98 } finally { 99 99 // Ensure we clean the place before leaving, even if test fails. 100 Main. main.removeLayer(layer);100 Main.getLayerManager().removeLayer(layer); 101 101 } 102 102 … … 170 170 action.setEnabled(true); 171 171 try { 172 Main. main.addLayer(layer);172 Main.getLayerManager().addLayer(layer); 173 173 action.actionPerformed(null); 174 174 } finally { 175 175 // Ensure we clean the place before leaving, even if test fails. 176 Main. main.removeLayer(layer);176 Main.getLayerManager().removeLayer(layer); 177 177 } 178 178 -
trunk/test/unit/org/openstreetmap/josm/actions/JoinAreasActionTest.java
r9663 r10436 42 42 DataSet ds = OsmReader.parseDataSet(is, null); 43 43 Layer layer = new OsmDataLayer(ds, null, null); 44 Main. main.addLayer(layer);44 Main.getLayerManager().addLayer(layer); 45 45 // FIXME enable this test after we fix the bug. Test disabled for now 46 46 // try { … … 48 48 // } finally { 49 49 // Ensure we clean the place before leaving, even if test fails. 50 Main. main.removeLayer(layer);50 Main.getLayerManager().removeLayer(layer); 51 51 // } 52 52 } … … 64 64 assertEquals(10, ds.getWays().size()); 65 65 Layer layer = new OsmDataLayer(ds, null, null); 66 Main. main.addLayer(layer);66 Main.getLayerManager().addLayer(layer); 67 67 try { 68 68 for (String ref : new String[]{"A", "B", "C", "D", "E"}) { … … 76 76 } finally { 77 77 // Ensure we clean the place before leaving, even if test fails. 78 Main. main.removeLayer(layer);78 Main.getLayerManager().removeLayer(layer); 79 79 } 80 80 } -
trunk/test/unit/org/openstreetmap/josm/actions/PurgeActionTest.java
r9671 r10436 44 44 DataSet ds = OsmReader.parseDataSet(is, null); 45 45 OsmDataLayer layer = new OsmDataLayer(ds, null, null); 46 Main. main.addLayer(layer);46 Main.getLayerManager().addLayer(layer); 47 47 try { 48 48 for (Way w : ds.getWays()) { … … 60 60 } finally { 61 61 // Ensure we clean the place before leaving, even if test fails. 62 Main. main.removeLayer(layer);62 Main.getLayerManager().removeLayer(layer); 63 63 } 64 64 } -
trunk/test/unit/org/openstreetmap/josm/actions/SelectByInternalPointActionTest.java
r10413 r10436 39 39 public void testNoDataSet() { 40 40 while (Main.main.hasEditLayer()) { 41 Main. main.removeLayer(Main.getLayerManager().getEditLayer());41 Main.getLayerManager().removeLayer(Main.getLayerManager().getEditLayer()); 42 42 } 43 43 assertNull(JosmAction.getCurrentDataSet()); … … 69 69 ds.addPrimitive(r); 70 70 OsmDataLayer layer = new OsmDataLayer(ds, "", null); 71 Main. main.addLayer(layer);71 Main.getLayerManager().addLayer(layer); 72 72 return layer; 73 73 } … … 86 86 } finally { 87 87 // Ensure we clean the place before leaving, even if test fails. 88 Main. main.removeLayer(layer);88 Main.getLayerManager().removeLayer(layer); 89 89 } 90 90 } … … 101 101 } finally { 102 102 // Ensure we clean the place before leaving, even if test fails. 103 Main. main.removeLayer(layer);103 Main.getLayerManager().removeLayer(layer); 104 104 } 105 105 } … … 130 130 } finally { 131 131 // Ensure we clean the place before leaving, even if test fails. 132 Main. main.removeLayer(layer);132 Main.getLayerManager().removeLayer(layer); 133 133 } 134 134 } -
trunk/test/unit/org/openstreetmap/josm/actions/SimplifyWayActionTest.java
r10263 r10436 54 54 OsmDataLayer layer = new OsmDataLayer(ds, "", null); 55 55 try { 56 Main. main.addLayer(layer);56 Main.getLayerManager().addLayer(layer); 57 57 assertTrue(ds.getSelected().isEmpty()); 58 58 action.actionPerformed(null); 59 59 } finally { 60 Main. main.removeLayer(layer);60 Main.getLayerManager().removeLayer(layer); 61 61 } 62 62 } … … 71 71 OsmDataLayer layer = new OsmDataLayer(ds, "", null); 72 72 try { 73 Main. main.addLayer(layer);73 Main.getLayerManager().addLayer(layer); 74 74 assertEquals(1, ds.getSelected().size()); 75 75 action.actionPerformed(null); 76 76 } finally { 77 Main. main.removeLayer(layer);77 Main.getLayerManager().removeLayer(layer); 78 78 } 79 79 } … … 90 90 OsmDataLayer layer = new OsmDataLayer(ds, "", null); 91 91 try { 92 Main. main.addLayer(layer);92 Main.getLayerManager().addLayer(layer); 93 93 assertEquals(11, ds.getSelected().size()); 94 94 action.actionPerformed(null); 95 95 } finally { 96 Main. main.removeLayer(layer);96 Main.getLayerManager().removeLayer(layer); 97 97 } 98 98 } -
trunk/test/unit/org/openstreetmap/josm/actions/SplitWayActionTest.java
r10256 r10436 79 79 80 80 try { 81 Main. main.addLayer(layer);81 Main.getLayerManager().addLayer(layer); 82 82 action.actionPerformed(null); 83 83 } finally { 84 84 // Ensure we clean the place before leaving, even if test fails. 85 Main. main.removeLayer(layer);85 Main.getLayerManager().removeLayer(layer); 86 86 } 87 87 -
trunk/test/unit/org/openstreetmap/josm/actions/UnGlueActionTest.java
r10256 r10436 41 41 OsmDataLayer layer = new OsmDataLayer(ds, "", null); 42 42 try { 43 Main. main.addLayer(layer);43 Main.getLayerManager().addLayer(layer); 44 44 assertTrue(ds.getSelected().isEmpty()); 45 45 assertTrue(ds.allPrimitives().isEmpty()); … … 47 47 assertTrue(ds.allPrimitives().isEmpty()); 48 48 } finally { 49 Main. main.removeLayer(layer);49 Main.getLayerManager().removeLayer(layer); 50 50 } 51 51 } … … 62 62 ds.setSelected(n); 63 63 try { 64 Main. main.addLayer(layer);64 Main.getLayerManager().addLayer(layer); 65 65 assertEquals(1, ds.getSelected().size()); 66 66 assertEquals(1, ds.allPrimitives().size()); … … 68 68 assertEquals(1, ds.allPrimitives().size()); 69 69 } finally { 70 Main. main.removeLayer(layer);70 Main.getLayerManager().removeLayer(layer); 71 71 } 72 72 } … … 89 89 ds.setSelected(n1); 90 90 try { 91 Main. main.addLayer(layer);91 Main.getLayerManager().addLayer(layer); 92 92 assertEquals(1, ds.getSelected().size()); 93 93 assertEquals(3, ds.allPrimitives().size()); … … 95 95 assertEquals(3, ds.allPrimitives().size()); 96 96 } finally { 97 Main. main.removeLayer(layer);97 Main.getLayerManager().removeLayer(layer); 98 98 } 99 99 } … … 122 122 ds.setSelected(n1); 123 123 try { 124 Main. main.addLayer(layer);124 Main.getLayerManager().addLayer(layer); 125 125 assertEquals(1, ds.getSelected().size()); 126 126 assertEquals(5, ds.allPrimitives().size()); … … 128 128 assertEquals(6, ds.allPrimitives().size()); 129 129 } finally { 130 Main. main.removeLayer(layer);130 Main.getLayerManager().removeLayer(layer); 131 131 } 132 132 } -
trunk/test/unit/org/openstreetmap/josm/actions/UnJoinNodeWayActionTest.java
r10222 r10436 74 74 action.setEnabled(true); 75 75 try { 76 Main. main.addLayer(layer);76 Main.getLayerManager().addLayer(layer); 77 77 action.actionPerformed(null); 78 78 } finally { 79 79 // Ensure we clean the place before leaving, even if test fails. 80 Main. main.removeLayer(layer);80 Main.getLayerManager().removeLayer(layer); 81 81 } 82 82 -
trunk/test/unit/org/openstreetmap/josm/actions/mapmode/AddNoteActionTest.java
r9944 r10436 36 36 OsmDataLayer layer = new OsmDataLayer(new DataSet(), "", null); 37 37 try { 38 Main. main.addLayer(layer);38 Main.getLayerManager().addLayer(layer); 39 39 AddNoteAction mapMode = new AddNoteAction(Main.map, new NoteData(Collections.<Note>emptyList())); 40 40 MapMode oldMapMode = Main.map.mapMode; … … 43 43 assertTrue(Main.map.selectMapMode(oldMapMode)); 44 44 } finally { 45 Main. main.removeLayer(layer);45 Main.getLayerManager().removeLayer(layer); 46 46 } 47 47 } -
trunk/test/unit/org/openstreetmap/josm/actions/mapmode/DeleteActionTest.java
r9944 r10436 32 32 OsmDataLayer layer = new OsmDataLayer(new DataSet(), "", null); 33 33 try { 34 Main. main.addLayer(layer);34 Main.getLayerManager().addLayer(layer); 35 35 DeleteAction mapMode = new DeleteAction(Main.map); 36 36 MapMode oldMapMode = Main.map.mapMode; … … 39 39 assertTrue(Main.map.selectMapMode(oldMapMode)); 40 40 } finally { 41 Main. main.removeLayer(layer);41 Main.getLayerManager().removeLayer(layer); 42 42 } 43 43 } -
trunk/test/unit/org/openstreetmap/josm/actions/mapmode/DrawActionTest.java
r10396 r10436 68 68 dataSet.addPrimitive(w); 69 69 70 Main. main.addLayer(layer);70 Main.getLayerManager().addLayer(layer); 71 71 try { 72 72 assertTrue(Main.map.selectDrawTool(false)); … … 99 99 } finally { 100 100 // Ensure we clean the place before leaving, even if test fails. 101 Main. main.removeLayer(layer);101 Main.getLayerManager().removeLayer(layer); 102 102 } 103 103 } -
trunk/test/unit/org/openstreetmap/josm/actions/mapmode/ExtrudeActionTest.java
r9944 r10436 32 32 OsmDataLayer layer = new OsmDataLayer(new DataSet(), "", null); 33 33 try { 34 Main. main.addLayer(layer);34 Main.getLayerManager().addLayer(layer); 35 35 ExtrudeAction mapMode = new ExtrudeAction(Main.map); 36 36 MapMode oldMapMode = Main.map.mapMode; … … 39 39 assertTrue(Main.map.selectMapMode(oldMapMode)); 40 40 } finally { 41 Main. main.removeLayer(layer);41 Main.getLayerManager().removeLayer(layer); 42 42 } 43 43 } -
trunk/test/unit/org/openstreetmap/josm/actions/mapmode/ImproveWayAccuracyActionTest.java
r9944 r10436 32 32 OsmDataLayer layer = new OsmDataLayer(new DataSet(), "", null); 33 33 try { 34 Main. main.addLayer(layer);34 Main.getLayerManager().addLayer(layer); 35 35 ImproveWayAccuracyAction mapMode = new ImproveWayAccuracyAction(Main.map); 36 36 MapMode oldMapMode = Main.map.mapMode; … … 39 39 assertTrue(Main.map.selectMapMode(oldMapMode)); 40 40 } finally { 41 Main. main.removeLayer(layer);41 Main.getLayerManager().removeLayer(layer); 42 42 } 43 43 } -
trunk/test/unit/org/openstreetmap/josm/actions/mapmode/ParallelWayActionTest.java
r9944 r10436 32 32 OsmDataLayer layer = new OsmDataLayer(new DataSet(), "", null); 33 33 try { 34 Main. main.addLayer(layer);34 Main.getLayerManager().addLayer(layer); 35 35 ParallelWayAction mapMode = new ParallelWayAction(Main.map); 36 36 MapMode oldMapMode = Main.map.mapMode; … … 39 39 assertTrue(Main.map.selectMapMode(oldMapMode)); 40 40 } finally { 41 Main. main.removeLayer(layer);41 Main.getLayerManager().removeLayer(layer); 42 42 } 43 43 } -
trunk/test/unit/org/openstreetmap/josm/actions/mapmode/PlayHeadDragModeTest.java
r9944 r10436 33 33 OsmDataLayer layer = new OsmDataLayer(new DataSet(), "", null); 34 34 try { 35 Main. main.addLayer(layer);35 Main.getLayerManager().addLayer(layer); 36 36 PlayHeadDragMode mapMode = new PlayHeadDragMode(PlayHeadMarker.create()); 37 37 MapMode oldMapMode = Main.map.mapMode; … … 40 40 assertTrue(Main.map.selectMapMode(oldMapMode)); 41 41 } finally { 42 Main. main.removeLayer(layer);42 Main.getLayerManager().removeLayer(layer); 43 43 } 44 44 } -
trunk/test/unit/org/openstreetmap/josm/actions/mapmode/SelectActionTest.java
r10396 r10436 105 105 106 106 Main.pref = new PreferencesMock(); 107 Main. main.addLayer(layer);107 Main.getLayerManager().addLayer(layer); 108 108 try { 109 109 SelectAction action = new SelectActionMock(Main.map, dataSet, layer); … … 160 160 } finally { 161 161 // Ensure we clean the place before leaving, even if test fails. 162 Main. main.removeLayer(layer);162 Main.getLayerManager().removeLayer(layer); 163 163 } 164 164 } -
trunk/test/unit/org/openstreetmap/josm/command/conflict/ConflictAddCommandTest.java
r10364 r10436 35 35 JOSMFixture.createUnitTestFixture().init(true); 36 36 layer = new OsmDataLayer(new DataSet(), null, null); 37 Main. main.addLayer(layer);37 Main.getLayerManager().addLayer(layer); 38 38 } 39 39 … … 43 43 @AfterClass 44 44 public static void tearDownAfterClass() { 45 Main. main.removeLayer(layer);45 Main.getLayerManager().removeLayer(layer); 46 46 } 47 47 -
trunk/test/unit/org/openstreetmap/josm/command/conflict/CoordinateConflictResolveCommandTest.java
r9943 r10436 37 37 JOSMFixture.createUnitTestFixture().init(true); 38 38 layer = new OsmDataLayer(new DataSet(), null, null); 39 Main. main.addLayer(layer);39 Main.getLayerManager().addLayer(layer); 40 40 } 41 41 … … 45 45 @AfterClass 46 46 public static void tearDownAfterClass() { 47 Main. main.removeLayer(layer);47 Main.getLayerManager().removeLayer(layer); 48 48 } 49 49 -
trunk/test/unit/org/openstreetmap/josm/gui/dialogs/InspectPrimitiveDialogTest.java
r10199 r10436 112 112 113 113 try { 114 Main. main.addLayer(layer);114 Main.getLayerManager().addLayer(layer); 115 115 assertEquals("", InspectPrimitiveDialog.buildMapPaintText()); 116 116 Node n = new Node(LatLon.ZERO); … … 126 126 InspectPrimitiveDialog.buildMapPaintText().replaceAll("@(\\p{XDigit})+", "")); 127 127 } finally { 128 Main. main.removeLayer(layer);128 Main.getLayerManager().removeLayer(layer); 129 129 } 130 130 } -
trunk/test/unit/org/openstreetmap/josm/gui/dialogs/relation/SelectionTableTest.java
r10089 r10436 49 49 OsmDataLayer layer = new OsmDataLayer(ds, "", null); 50 50 try { 51 Main. main.addLayer(layer);51 Main.getLayerManager().addLayer(layer); 52 52 // Constructs models and table 53 53 MemberTableModel memberTableModel = new MemberTableModel(r, layer, null); … … 84 84 } 85 85 } finally { 86 Main. main.removeLayer(layer);86 Main.getLayerManager().removeLayer(layer); 87 87 } 88 88 } -
trunk/test/unit/org/openstreetmap/josm/gui/layer/GpxLayerTest.java
r9949 r10436 196 196 GpxLayer layer = getMinimalGpxLayer(); 197 197 try { 198 Main. main.addLayer(layer);198 Main.getLayerManager().addLayer(layer); 199 199 assertTrue(layer.getMenuEntries().length > 0); 200 200 layer.paint(TestUtils.newGraphics(), Main.map.mapView, layer.data.getMetaBounds()); 201 201 } finally { 202 Main. main.removeLayer(layer);202 Main.getLayerManager().removeLayer(layer); 203 203 } 204 204 } -
trunk/test/unit/org/openstreetmap/josm/gui/layer/OsmDataLayerTest.java
r10205 r10436 44 44 OsmDataLayer layer = new OsmDataLayer(ds, "", null); 45 45 try { 46 Main. main.addLayer(layer);46 Main.getLayerManager().addLayer(layer); 47 47 int n = OsmDataLayer.PROPERTY_RECENT_RELATIONS_NUMBER.get(); 48 48 assertTrue(n > 0); … … 60 60 assertTrue(layer.getRecentRelations().isEmpty()); 61 61 } finally { 62 Main. main.removeLayer(layer);62 Main.getLayerManager().removeLayer(layer); 63 63 } 64 64 } … … 134 134 OsmDataLayer layer = new OsmDataLayer(ds, "", null); 135 135 try { 136 Main. main.addLayer(layer);136 Main.getLayerManager().addLayer(layer); 137 137 assertTrue(layer.getMenuEntries().length > 0); 138 138 layer.paint(TestUtils.newGraphics(), Main.map.mapView, new Bounds(LatLon.ZERO)); 139 139 } finally { 140 Main. main.removeLayer(layer);140 Main.getLayerManager().removeLayer(layer); 141 141 } 142 142 } -
trunk/test/unit/org/openstreetmap/josm/gui/layer/TMSLayerTest.java
r9680 r10436 50 50 private static void test(ImageryType expected, TMSLayer layer) { 51 51 try { 52 Main. main.addLayer(layer);52 Main.getLayerManager().addLayer(layer); 53 53 assertEquals(expected, layer.getInfo().getImageryType()); 54 54 } finally { 55 55 // Ensure we clean the place before leaving, even if test fails. 56 Main. main.removeLayer(layer);56 Main.getLayerManager().removeLayer(layer); 57 57 } 58 58 } -
trunk/test/unit/org/openstreetmap/josm/gui/layer/ValidatorLayerTest.java
r9881 r10436 33 33 try { 34 34 layer = new ValidatorLayer(); 35 Main. main.addLayer(layer);35 Main.getLayerManager().addLayer(layer); 36 36 assertFalse(layer.isMergable(null)); 37 37 assertNotNull(layer.getIcon()); … … 42 42 // Ensure we clean the place before leaving, even if test fails. 43 43 if (layer != null) { 44 Main. main.removeLayer(layer);44 Main.getLayerManager().removeLayer(layer); 45 45 } 46 46 } -
trunk/test/unit/org/openstreetmap/josm/gui/layer/WMSLayerTest.java
r9669 r10436 30 30 public void testWMSLayer() { 31 31 WMSLayer wms = new WMSLayer(new ImageryInfo("test wms", "http://localhost")); 32 Main. main.addLayer(wms);32 Main.getLayerManager().addLayer(wms); 33 33 try { 34 34 assertEquals(ImageryType.WMS, wms.getInfo().getImageryType()); 35 35 } finally { 36 36 // Ensure we clean the place before leaving, even if test fails. 37 Main. main.removeLayer(wms);37 Main.getLayerManager().removeLayer(wms); 38 38 } 39 39 } -
trunk/test/unit/org/openstreetmap/josm/gui/layer/geoimage/GeoImageLayerTest.java
r10396 r10436 43 43 GpxLayer gpxLayer = new GpxLayer(reader.getGpxData()); 44 44 try { 45 Main. main.addLayer(gpxLayer);45 Main.getLayerManager().addLayer(gpxLayer); 46 46 assertEquals(1, Main.getLayerManager().getLayers().size()); 47 47 new Loader( … … 62 62 } finally { 63 63 // Ensure we clean the place before leaving, even if test fails. 64 Main. main.removeLayer(gpxLayer);64 Main.getLayerManager().removeLayer(gpxLayer); 65 65 } 66 66 } -
trunk/test/unit/org/openstreetmap/josm/gui/layer/gpx/DownloadAlongTrackActionTest.java
r9817 r10436 32 32 final OsmDataLayer layer = new OsmDataLayer(new DataSet(), DownloadAlongTrackActionTest.class.getName(), null); 33 33 try { 34 Main. main.addLayer(layer);34 Main.getLayerManager().addLayer(layer); 35 35 // Perform action 36 36 final GpxData gpx = GpxReaderTest.parseGpxData(TestUtils.getTestDataRoot() + file); … … 38 38 } finally { 39 39 // Ensure we clean the place before leaving, even if test fails. 40 Main. main.removeLayer(layer);40 Main.getLayerManager().removeLayer(layer); 41 41 } 42 42 } -
trunk/test/unit/org/openstreetmap/josm/gui/layer/gpx/DownloadWmsAlongTrackActionTest.java
r10222 r10436 47 47 TMSLayer layer = new TMSLayer(new ImageryInfo("OSM TMS", "https://a.tile.openstreetmap.org/{zoom}/{x}/{y}.png", "tms", null, null)); 48 48 try { 49 Main. main.addLayer(layer);49 Main.getLayerManager().addLayer(layer); 50 50 TMSLayer.getCache().clear(); 51 51 assertTrue(TMSLayer.getCache().getMatching(".*").isEmpty()); … … 58 58 } finally { 59 59 // Ensure we clean the place before leaving, even if test fails. 60 Main. main.removeLayer(layer);60 Main.getLayerManager().removeLayer(layer); 61 61 } 62 62 } -
trunk/test/unit/org/openstreetmap/josm/io/remotecontrol/handler/AddNodeHandlerTest.java
r9732 r10436 59 59 OsmDataLayer layer = new OsmDataLayer(new DataSet(), "", null); 60 60 try { 61 Main. main.addLayer(layer);61 Main.getLayerManager().addLayer(layer); 62 62 newHandler(null).handle(); 63 63 } finally { 64 Main. main.removeLayer(layer);64 Main.getLayerManager().removeLayer(layer); 65 65 } 66 66 } … … 96 96 OsmDataLayer layer = new OsmDataLayer(new DataSet(), "", null); 97 97 try { 98 Main. main.addLayer(layer);98 Main.getLayerManager().addLayer(layer); 99 99 newHandler("https://localhost?lat=0&lon=0").handle(); 100 100 } finally { 101 Main. main.removeLayer(layer);101 Main.getLayerManager().removeLayer(layer); 102 102 } 103 103 } -
trunk/test/unit/org/openstreetmap/josm/io/remotecontrol/handler/AddWayHandlerTest.java
r10116 r10436 59 59 OsmDataLayer layer = new OsmDataLayer(new DataSet(), "", null); 60 60 try { 61 Main. main.addLayer(layer);61 Main.getLayerManager().addLayer(layer); 62 62 newHandler(null).handle(); 63 63 } finally { 64 Main. main.removeLayer(layer);64 Main.getLayerManager().removeLayer(layer); 65 65 } 66 66 } … … 96 96 OsmDataLayer layer = new OsmDataLayer(new DataSet(), "", null); 97 97 try { 98 Main. main.addLayer(layer);98 Main.getLayerManager().addLayer(layer); 99 99 newHandler("https://localhost?way=0,0;1,1").handle(); 100 100 } finally { 101 Main. main.removeLayer(layer);101 Main.getLayerManager().removeLayer(layer); 102 102 } 103 103 } -
trunk/test/unit/org/openstreetmap/josm/io/remotecontrol/handler/ImportHandlerTest.java
r10364 r10436 96 96 } finally { 97 97 for (OsmDataLayer layer : Main.getLayerManager().getLayersOfType(OsmDataLayer.class)) { 98 Main. main.removeLayer(layer);98 Main.getLayerManager().removeLayer(layer); 99 99 } 100 100 }
Note:
See TracChangeset
for help on using the changeset viewer.