Changeset 35671 in osm for applications/editors
- Timestamp:
- 2020-12-08T07:50:54+01:00 (4 years ago)
- Location:
- applications/editors/josm/plugins/utilsplugin2
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/utilsplugin2/build.xml
r35487 r35671 5 5 <property name="commit.message" value="[josm_utilsplugin2]: select boundary by double-click; multitagger table highlights"/> 6 6 <!-- enter the *lowest* JOSM version this plugin is currently compatible with --> 7 <property name="plugin.main.version" value="1 6567"/>7 <property name="plugin.main.version" value="17199"/> 8 8 9 9 <property name="plugin.author" value="Kalle Lampila, Upliner, Zverik, akks, joshdoe and others"/> -
applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/actions/PasteRelationsAction.java
r35579 r35671 16 16 17 17 import org.openstreetmap.josm.actions.JosmAction; 18 import org.openstreetmap.josm.command.ChangeCommand; 18 import org.openstreetmap.josm.command.ChangeMembersCommand; 19 19 import org.openstreetmap.josm.command.Command; 20 20 import org.openstreetmap.josm.command.SequenceCommand; … … 82 82 for (Map.Entry<Relation, String> entry : relations.entrySet()) { 83 83 Relation rel = entry.getKey(); 84 Relation r= newRelation(rel);84 List<RelationMember> members = new ArrayList<>(rel.getMembers()); 85 85 boolean changed = false; 86 86 for (OsmPrimitive p : selection) { 87 if (!r.getMemberPrimitives().contains(p) && !r.equals(p)) { 87 if (!rel.getMemberPrimitives().contains(p) && !rel.equals(p)) { 88 88 String role = entry.getValue(); 89 if ("associatedStreet" .equals(r.get("type"))) {90 if (p. get("highway")!= null) {89 if (rel.hasTag("type", "associatedStreet")) { 90 if (p.hasKey("highway")) { 91 91 role = "street"; 92 } else if (p. get("addr:housenumber")!= null) {92 } else if (p.hasKey("addr:housenumber")) { 93 93 role = "house"; 94 94 } 95 95 } 96 r.addMember(new RelationMember(role, p));96 members.add(new RelationMember(role, p)); 97 97 changed = true; 98 98 } 99 99 } 100 if (changed) 101 commands.add(new ChangeCommand(rel, r)); 100 if (changed) { 101 commands.add(new ChangeMembersCommand(rel, members)); 102 } 102 103 } 103 104 -
applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/actions/UnGlueRelationAction.java
r35580 r35671 85 85 } else { 86 86 UndoRedoHandler.getInstance().add(new SequenceCommand(tr("Unglued Relations"), cmds)); 87 //Set selection all primit eves (new and old)87 //Set selection all primitives (new and old) 88 88 newPrimitives.addAll(selection); 89 89 ds.setSelected(newPrimitives); -
applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/replacegeometry/ReplaceMembershipAction.java
r34454 r35671 16 16 17 17 import org.openstreetmap.josm.actions.JosmAction; 18 import org.openstreetmap.josm.command.ChangeCommand; 18 import org.openstreetmap.josm.command.ChangeMembersCommand; 19 19 import org.openstreetmap.josm.command.Command; 20 20 import org.openstreetmap.josm.data.UndoRedoHandler; … … 71 71 for (final Map.Entry<Relation, Set<RelationToChildReference>> i : byRelation.entrySet()) { 72 72 final Relation oldRelation = i.getKey(); 73 final Relation newRelation = new Relation(oldRelation); 73 List<RelationMember> members = new ArrayList<>(oldRelation.getMembers()); 74 boolean modified = false; 74 75 for (final RelationToChildReference reference : i.getValue()) { 75 newRelation.setMember(reference.getPosition(), new RelationMember(reference.getRole(), secondObject)); 76 members.set(reference.getPosition(), new RelationMember(reference.getRole(), secondObject)); 77 modified = true; 76 78 } 77 commands.add(new ChangeCommand(oldRelation, newRelation)); 79 if (modified) { 80 commands.add(new ChangeMembersCommand(oldRelation, members)); 81 } 78 82 } 79 83
Note:
See TracChangeset
for help on using the changeset viewer.