Changeset 35668 in osm for applications
- Timestamp:
- 2020-12-07T18:17:10+01:00 (4 years ago)
- Location:
- applications/editors/josm/plugins/buildings_tools
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/buildings_tools/build.xml
r35171 r35668 4 4 <property name="commit.message" value="buildings_tools: add option to disable click+drag"/> 5 5 <!-- enter the *lowest* JOSM version this plugin is currently compatible with --> 6 <property name="plugin.main.version" value="1 4960"/>6 <property name="plugin.main.version" value="17329"/> 7 7 8 8 <!-- Configure these properties (replace "..." accordingly). -
applications/editors/josm/plugins/buildings_tools/src/org/openstreetmap/josm/plugins/buildings_tools/Building.java
r35574 r35668 22 22 import org.openstreetmap.josm.actions.CreateCircleAction; 23 23 import org.openstreetmap.josm.command.AddCommand; 24 import org.openstreetmap.josm.command.Change Command;24 import org.openstreetmap.josm.command.ChangeMembersCommand; 25 25 import org.openstreetmap.josm.command.ChangeNodesCommand; 26 26 import org.openstreetmap.josm.command.Command; … … 472 472 for (OsmPrimitive p : addrNode.getReferrers()) { 473 473 Relation r = (Relation) p; 474 Relation rnew = new Relation(r);475 for (int i = 0; i < r.getMembersCount(); i++) {476 RelationMember member = r.getMember(i);474 List<RelationMember> members = new ArrayList<>(r.getMembers()); 475 for (int i = 0; i < members.size(); i++) { 476 RelationMember member = members.get(i); 477 477 if (addrNode.equals(member.getMember())) { 478 rnew.removeMember(i); 479 rnew.addMember(i, new RelationMember(member.getRole(), w)); 478 members.set(i, new RelationMember(member.getRole(), w)); 480 479 } 481 480 } 482 addressCmds.add(new Change Command(r, rnew));481 addressCmds.add(new ChangeMembersCommand(r, members)); 483 482 } 484 483 addressCmds.add(new DeleteCommand(addrNode)); -
applications/editors/josm/plugins/buildings_tools/src/org/openstreetmap/josm/plugins/buildings_tools/MergeAddrPointsAction.java
r35579 r35668 16 16 import java.util.Map; 17 17 import java.util.Map.Entry; 18 import java.util.Set; 18 19 import java.util.stream.Collectors; 19 import java.util.Set;20 20 21 21 import javax.swing.JOptionPane; 22 22 23 23 import org.openstreetmap.josm.actions.JosmAction; 24 import org.openstreetmap.josm.command.Change Command;24 import org.openstreetmap.josm.command.ChangeMembersCommand; 25 25 import org.openstreetmap.josm.command.ChangePropertyCommand; 26 26 import org.openstreetmap.josm.command.Command; … … 158 158 159 159 for (Relation r : modifiedRelations) { 160 Relation rnew = new Relation(r);160 List<RelationMember> members = new ArrayList<>(r.getMembers()); 161 161 boolean modified = false; 162 162 for (Pair<Node, Way> repl : replaced) { 163 for (int i = 0; i < rnew.getMembersCount(); i++) {164 RelationMember member = rnew.getMember(i);163 for (int i = 0; i < members.size(); i++) { 164 RelationMember member = members.get(i); 165 165 if (repl.a.equals(member.getMember())) { 166 rnew.removeMember(i); 167 rnew.addMember(i, new RelationMember(member.getRole(), repl.b)); 166 members.set(i, new RelationMember(member.getRole(), repl.b)); 168 167 modified = true; 169 168 } … … 171 170 } 172 171 if (modified) { 173 cmds.add(new Change Command(r, rnew));172 cmds.add(new ChangeMembersCommand(r, members)); 174 173 } 175 174 }
Note:
See TracChangeset
for help on using the changeset viewer.