Changeset 343 in josm for trunk/src/org/openstreetmap/josm/command
- Timestamp:
- 2007-10-07T13:20:27+02:00 (17 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/command
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/command/AddCommand.java
r304 r343 12 12 import org.openstreetmap.josm.Main; 13 13 import org.openstreetmap.josm.data.osm.DataSet; 14 import org.openstreetmap.josm.data.osm.Relation; 14 15 import org.openstreetmap.josm.data.osm.OsmPrimitive; 15 16 import org.openstreetmap.josm.data.osm.visitor.AddVisitor; … … 22 23 * A command that adds an osm primitive to a dataset. Keys cannot be added this 23 24 * way. Use ChangeKeyValueCommand instead. 25 * 26 * See ChangeCommand for comments on relation back references. 24 27 * 25 28 * @author imi -
trunk/src/org/openstreetmap/josm/command/ChangeCommand.java
r298 r343 13 13 import org.openstreetmap.josm.data.osm.visitor.NameVisitor; 14 14 15 /** 16 * Command that basically replaces one OSM primitive by another of the 17 * same type. 18 * 19 * @author Imi 20 */ 15 21 public class ChangeCommand extends Command { 16 22 -
trunk/src/org/openstreetmap/josm/command/Command.java
r304 r343 10 10 import javax.swing.tree.MutableTreeNode; 11 11 12 import org.openstreetmap.josm.data.osm.Relation; 12 13 import org.openstreetmap.josm.data.osm.Node; 13 14 import org.openstreetmap.josm.data.osm.OsmPrimitive; 14 import org.openstreetmap.josm.data.osm.Segment;15 15 import org.openstreetmap.josm.data.osm.Way; 16 16 import org.openstreetmap.josm.data.osm.visitor.Visitor; … … 37 37 orig.put(n, new Node(n)); 38 38 } 39 public void visit(Segment s) {40 orig.put(s, new Segment(s));41 }42 39 public void visit(Way w) { 43 40 orig.put(w, new Way(w)); 41 } 42 public void visit(Relation e) { 43 orig.put(e, new Relation(e)); 44 44 } 45 45 } -
trunk/src/org/openstreetmap/josm/command/DeleteCommand.java
r298 r343 11 11 import javax.swing.tree.MutableTreeNode; 12 12 13 import org.openstreetmap.josm.data.osm.Relation; 13 14 import org.openstreetmap.josm.data.osm.OsmPrimitive; 14 15 import org.openstreetmap.josm.data.osm.visitor.NameVisitor; … … 32 33 @Override public void executeCommand() { 33 34 super.executeCommand(); 34 for (OsmPrimitive osm : data) 35 for (OsmPrimitive osm : data) { 35 36 osm.delete(true); 37 } 36 38 } 37 39 38 40 @Override public void fillModifiedData(Collection<OsmPrimitive> modified, Collection<OsmPrimitive> deleted, Collection<OsmPrimitive> added) { 39 41 deleted.addAll(data);
Note:
See TracChangeset
for help on using the changeset viewer.