Ignore:
Timestamp:
2005-10-23T22:13:33+02:00 (20 years ago)
Author:
imi
Message:

starting restructure of dataset. Checkpoint is broken!

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/org/openstreetmap/josm/actions/mapmode/AddTrackAction.java

    r21 r22  
    66import java.util.LinkedList;
    77
    8 import org.openstreetmap.josm.command.DataSet;
     8import org.openstreetmap.josm.Main;
     9import org.openstreetmap.josm.command.AddCommand;
     10import org.openstreetmap.josm.command.Command;
    911import org.openstreetmap.josm.data.osm.LineSegment;
    1012import org.openstreetmap.josm.data.osm.OsmPrimitive;
     
    7678                        return; // not allowed together
    7779
    78                 DataSet ds = mv.getActiveDataSet();
    79                
    8080                if (!ctrl && !shift)
    81                         ds.clearSelection(); // new selection will replace the old.
     81                        Main.main.ds.clearSelection(); // new selection will replace the old.
    8282
    8383                Collection<OsmPrimitive> selectionList = selectionManager.getObjectsInRectangle(r,alt);
    8484                for (OsmPrimitive osm : selectionList)
    85                         osm.setSelected(!ctrl, ds);
     85                        osm.setSelected(!ctrl);
    8686
    8787                mv.repaint(); // from now on, the map has to be repainted.
     
    9090                        return; // no new track yet.
    9191               
    92                 Collection<OsmPrimitive> selection = ds.getSelected();
     92                Collection<OsmPrimitive> selection = Main.main.ds.getSelected();
    9393                if (selection.isEmpty())
    9494                        return;
     
    104104                Track t = new Track();
    105105                for (LineSegment ls : lineSegments)
    106                         ds.assignPendingLineSegment(ls, t, true);
    107                 ds.addTrack(t);
    108                 ds.clearSelection();
     106                        t.add(ls);
     107                Command c = new AddCommand(t);
     108                c.executeCommand();
     109                Main.main.commands.add(c);
     110                Main.main.ds.clearSelection();
    109111        }
    110112
Note: See TracChangeset for help on using the changeset viewer.