Changeset 32452 in osm for applications/editors/josm/plugins/waydownloader/src
- Timestamp:
- 2016-06-29T23:57:30+02:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/waydownloader/src/org/openstreetmap/josm/plugins/waydownloader/WayDownloaderPlugin.java
r30737 r32452 67 67 public void actionPerformed(ActionEvent e) { 68 68 selectedNode = null; 69 Collection<Node> selection = Main.main.getCurrentDataSet().getSelectedNodes(); 69 DataSet ds = Main.getLayerManager().getEditDataSet(); 70 Collection<Node> selection = ds.getSelectedNodes(); 70 71 if (selection.isEmpty()) { 71 Collection<Way> selWays = Main.main.getCurrentDataSet().getSelectedWays();72 Collection<Way> selWays = ds.getSelectedWays(); 72 73 if (!workFromWaySelection(selWays)) { 73 74 showWarningMessage(tr("<html>Neither a node nor a way with an endpoint outside of the<br>current download areas is selected.<br>Select a node on the start or end of a way or an entire way first.</html>")); 74 75 return; 75 76 } 76 selection = Main.main.getCurrentDataSet().getSelectedNodes();77 selection = ds.getSelectedNodes(); 77 78 } 78 79 … … 176 177 return; 177 178 Command cmd = MergeNodesAction.mergeNodes( 178 Main. main.getEditLayer(),179 Main.getLayerManager().getEditLayer(), 179 180 Collections.singletonList(dupeNode), 180 181 selectedNode … … 182 183 if (cmd != null) { 183 184 Main.main.undoRedo.add(cmd); 184 Main. main.getEditLayer().data.setSelected(selectedNode);185 Main.getLayerManager().getEditLayer().data.setSelected(selectedNode); 185 186 } 186 187 connectedWays = findConnectedWays(selectedNode); … … 213 214 214 215 //Select the next node 215 Main. main.getCurrentDataSet().setSelected(nextNode);216 Main.getLayerManager().getEditDataSet().setSelected(nextNode); 216 217 Main.map.mapView.zoomTo(nextNode.getEastNorth()); 217 218 } … … 220 221 @Override 221 222 protected void updateEnabledState() { 222 setEnabled(get EditLayer() != null);223 setEnabled(getLayerManager().getEditLayer() != null); 223 224 } 224 225 … … 236 237 */ 237 238 private Node findDuplicateNode(Node referenceNode) { 238 DataSet ds = Main. main.getCurrentDataSet();239 DataSet ds = Main.getLayerManager().getEditDataSet(); 239 240 List<Node> candidates = ds.searchNodes(new Bounds(referenceNode.getCoor(), 0.0003, 0.0005).toBBox()); 240 241 for (Node candidate: candidates) { … … 289 290 if (isDownloaded(selectedNode)) return false; 290 291 } 291 Main. main.getCurrentDataSet().setSelected(selectedNode);292 Main.getLayerManager().getEditDataSet().setSelected(selectedNode); 292 293 return true; 293 294 } 294 295 295 296 private boolean isDownloaded(Node node) { 296 for (DataSource datasource :Main.main.getCurrentDataSet().dataSources) {297 for (DataSource datasource : Main.getLayerManager().getEditDataSet().dataSources) { 297 298 Bounds bounds = datasource.bounds; 298 299 if (bounds != null && bounds.contains(node.getCoor())) return true;
Note:
See TracChangeset
for help on using the changeset viewer.