Changeset 12356 in josm
- Timestamp:
- 2017-06-09T11:40:32+02:00 (7 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 4 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); -
trunk/src/org/openstreetmap/josm/actions/ReverseWayAction.java
r12210 r12356 153 153 corrCmds = (new ReverseWayTagCorrector()).execute(w, wnew); 154 154 } 155 return new ReverseWayResult(wnew, corrCmds, new ChangeCommand(w , wnew));155 return new ReverseWayResult(wnew, corrCmds, new ChangeCommand(w.getDataSet(), w, wnew)); 156 156 } 157 157 -
trunk/src/org/openstreetmap/josm/command/ChangeRelationMemberRoleCommand.java
r12288 r12356 9 9 import javax.swing.Icon; 10 10 11 import org.openstreetmap.josm.data.osm.DataSet; 11 12 import org.openstreetmap.josm.data.osm.OsmPrimitive; 12 13 import org.openstreetmap.josm.data.osm.OsmPrimitiveType; … … 41 42 */ 42 43 public ChangeRelationMemberRoleCommand(Relation relation, int position, String newRole) { 44 this.relation = relation; 45 this.position = position; 46 this.newRole = newRole; 47 } 48 49 /** 50 * Constructs a new {@code ChangeRelationMemberRoleCommand}. 51 * @param dataSet The data set the role is in 52 * @param relation The relation to be changed 53 * @param position Member position 54 * @param newRole New role 55 * @since 12355 56 */ 57 public ChangeRelationMemberRoleCommand(DataSet dataSet, Relation relation, int position, String newRole) { 58 super(dataSet); 43 59 this.relation = relation; 44 60 this.position = position; -
trunk/src/org/openstreetmap/josm/corrector/TagCorrector.java
r10308 r12356 175 175 // save the clone 176 176 if (!keysChanged.isEmpty()) { 177 commands.add(new ChangeCommand(primitive , clone));177 commands.add(new ChangeCommand(primitive.getDataSet(), primitive, clone)); 178 178 } 179 179 } … … 185 185 RoleCorrection roleCorrection = roleCorrections.get(i); 186 186 if (roleTableMap.get(primitive).getCorrectionTableModel().getApply(i)) { 187 commands.add(new ChangeRelationMemberRoleCommand( 187 commands.add(new ChangeRelationMemberRoleCommand(roleCorrection.relation.getDataSet(), 188 188 roleCorrection.relation, roleCorrection.position, roleCorrection.newRole)); 189 189 }
Note:
See TracChangeset
for help on using the changeset viewer.