Changeset 13964 in josm for trunk/src/org
- Timestamp:
- 2018-06-22T17:54:19+02:00 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/mapmode/ImproveWayAccuracyAction.java
r13925 r13964 644 644 * state if a single way or node is selected. Extracts a way by a node in 645 645 * the second case. 646 *647 646 */ 648 647 private void updateStateByCurrentSelection() { 649 648 final List<Node> nodeList = new ArrayList<>(); 650 649 final List<Way> wayList = new ArrayList<>(); 651 final Collection<OsmPrimitive> sel = getLayerManager().getEditDataSet().getSelected(); 652 653 // Collecting nodes and ways from the selection 654 for (OsmPrimitive p : sel) { 655 if (p instanceof Way) { 656 wayList.add((Way) p); 657 } 658 if (p instanceof Node) { 659 nodeList.add((Node) p); 660 } 661 } 662 663 if (wayList.size() == 1) { 664 // Starting improving the single selected way 665 startImproving(wayList.get(0)); 666 return; 667 } else if (nodeList.size() == 1) { 668 // Starting improving the only way of the single selected node 669 List<OsmPrimitive> r = nodeList.get(0).getReferrers(); 670 if (r.size() == 1 && (r.get(0) instanceof Way)) { 671 startImproving((Way) r.get(0)); 650 final DataSet ds = getLayerManager().getEditDataSet(); 651 if (ds != null) { 652 final Collection<OsmPrimitive> sel = ds.getSelected(); 653 654 // Collecting nodes and ways from the selection 655 for (OsmPrimitive p : sel) { 656 if (p instanceof Way) { 657 wayList.add((Way) p); 658 } 659 if (p instanceof Node) { 660 nodeList.add((Node) p); 661 } 662 } 663 664 if (wayList.size() == 1) { 665 // Starting improving the single selected way 666 startImproving(wayList.get(0)); 672 667 return; 668 } else if (nodeList.size() == 1) { 669 // Starting improving the only way of the single selected node 670 List<OsmPrimitive> r = nodeList.get(0).getReferrers(); 671 if (r.size() == 1 && (r.get(0) instanceof Way)) { 672 startImproving((Way) r.get(0)); 673 return; 674 } 673 675 } 674 676 }
Note:
See TracChangeset
for help on using the changeset viewer.