Ignore:
Timestamp:
2006-04-21T14:31:51+02:00 (18 years ago)
Author:
imi
Message:
  • added conflicts and resolve conflict dialog

This is one of those "changed everything" checkpoint.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/org/openstreetmap/josm/command/DeleteCommand.java

    r40 r86  
    44import java.util.HashSet;
    55
    6 import org.openstreetmap.josm.data.osm.DataSet;
     6import org.openstreetmap.josm.Main;
    77import org.openstreetmap.josm.data.osm.OsmPrimitive;
    88import org.openstreetmap.josm.data.osm.visitor.CollectBackReferencesVisitor;
     
    1212 * @author imi
    1313 */
    14 public class DeleteCommand implements Command {
     14public class DeleteCommand extends Command {
    1515
    16         /**
    17          * The dataset this command operates on.
    18          */
    19         final DataSet ds;
    2016        /**
    2117         * The primitive that get deleted.
     
    2319        final Collection<OsmPrimitive> data = new HashSet<OsmPrimitive>();
    2420
    25         public DeleteCommand(DataSet ds, OsmPrimitive osm) {
    26                 this.ds = ds;
    27                 CollectBackReferencesVisitor v = new CollectBackReferencesVisitor(ds);
     21        public DeleteCommand(OsmPrimitive osm) {
     22                CollectBackReferencesVisitor v = new CollectBackReferencesVisitor(Main.ds);
    2823                osm.visit(v);
    2924                data.addAll(v.data);
     
    3126        }
    3227       
    33         public void executeCommand() {
     28        @Override public void executeCommand() {
     29                super.executeCommand();
    3430                for (OsmPrimitive osm : data)
    35                         osm.setDeleted(true);
     31                        osm.delete(true);
    3632        }
    3733
    38         public void undoCommand() {
    39                 for (OsmPrimitive osm : data)
    40                         osm.setDeleted(false);
    41         }
    42 
    43         public void fillModifiedData(Collection<OsmPrimitive> modified, Collection<OsmPrimitive> deleted, Collection<OsmPrimitive> added) {
     34        @Override public void fillModifiedData(Collection<OsmPrimitive> modified, Collection<OsmPrimitive> deleted, Collection<OsmPrimitive> added) {
    4435                deleted.addAll(data);
    4536        }
Note: See TracChangeset for help on using the changeset viewer.