Changeset 12356 in josm for trunk/src/org/openstreetmap/josm/actions/CombineWayAction.java
- Timestamp:
- 2017-06-09T11:40:32+02:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/CombineWayAction.java
r12314 r12356 20 20 import java.util.Set; 21 21 import java.util.Stack; 22 import java.util.stream.Collectors; 22 23 23 24 import javax.swing.JOptionPane; … … 112 113 ways = new LinkedHashSet<>(ways); 113 114 115 List<DataSet> dataSets = ways.stream().map(Way::getDataSet).distinct().collect(Collectors.toList()); 116 if (dataSets.size() != 1) { 117 throw new IllegalArgumentException("Cannot combine ways of multiple data sets."); 118 } 119 114 120 // try to build a new way which includes all the combined ways 115 //116 121 NodeGraph graph = NodeGraph.createNearlyUndirectedGraphFromNodeWays(ways); 117 122 List<Node> path = graph.buildSpanningPath(); … … 194 199 deletedWays.remove(targetWay); 195 200 196 cmds.add(new ChangeCommand( targetWay, modifiedTargetWay));201 cmds.add(new ChangeCommand(dataSets.get(0), targetWay, modifiedTargetWay)); 197 202 cmds.addAll(reverseWayTagCommands); 198 203 cmds.addAll(resolution); 199 cmds.add(new DeleteCommand(d eletedWays));204 cmds.add(new DeleteCommand(dataSets.get(0), deletedWays)); 200 205 final Command sequenceCommand = new SequenceCommand(/* for correct i18n of plural forms - see #9110 */ 201 206 trn("Combine {0} way", "Combine {0} ways", ways.size(), ways.size()), cmds);
Note:
See TracChangeset
for help on using the changeset viewer.