Changeset 3558 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2010-09-23T18:36:36+02:00 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPreset.java
r3533 r3558 25 25 import java.util.EnumSet; 26 26 import java.util.HashMap; 27 import java.util.HashSet; 27 28 import java.util.LinkedHashMap; 28 29 import java.util.LinkedList; … … 51 52 import org.openstreetmap.josm.data.osm.OsmUtils; 52 53 import org.openstreetmap.josm.data.osm.Relation; 54 import org.openstreetmap.josm.data.osm.RelationMember; 53 55 import org.openstreetmap.josm.data.osm.Tag; 54 56 import org.openstreetmap.josm.data.osm.Way; … … 56 58 import org.openstreetmap.josm.gui.MapView; 57 59 import org.openstreetmap.josm.gui.QuadStateCheckBox; 60 import org.openstreetmap.josm.gui.dialogs.relation.RelationEditor; 58 61 import org.openstreetmap.josm.gui.layer.Layer; 59 62 import org.openstreetmap.josm.gui.layer.OsmDataLayer; … … 947 950 List<Command> cmds = new ArrayList<Command>(2); 948 951 final Relation r = new Relation(); 949 cmds.add(new AddCommand(r)); 950 Command cmd = createCommand(Collections.<OsmPrimitive>singletonList(r), getChangedTags()); 951 if (cmd != null) { 952 cmds.add(cmd); 953 } 954 Main.main.undoRedo.add(new SequenceCommand(tr("Add relation"), cmds)); 952 final Collection<RelationMember> members = new HashSet<RelationMember>(); 953 for(Tag t : getChangedTags()) { 954 r.put(t.getKey(), t.getValue()); 955 } 956 for(OsmPrimitive osm : sel) { 957 RelationMember rm = new RelationMember("", osm); 958 r.addMember(rm); 959 members.add(rm); 960 } 955 961 SwingUtilities.invokeLater(new Runnable() { 956 962 @Override 957 963 public void run() { 958 // Relation list dialog has to be updated first for selectRelation to work 959 Main.map.relationListDialog.selectRelation(r); 964 RelationEditor.getEditor(Main.main.getEditLayer(), r, members).setVisible(true); 960 965 } 961 966 });
Note:
See TracChangeset
for help on using the changeset viewer.