Changeset 22 in josm for src/org/openstreetmap/josm/actions/mapmode/AddTrackAction.java
- Timestamp:
- 2005-10-23T22:13:33+02:00 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/org/openstreetmap/josm/actions/mapmode/AddTrackAction.java
r21 r22 6 6 import java.util.LinkedList; 7 7 8 import org.openstreetmap.josm.command.DataSet; 8 import org.openstreetmap.josm.Main; 9 import org.openstreetmap.josm.command.AddCommand; 10 import org.openstreetmap.josm.command.Command; 9 11 import org.openstreetmap.josm.data.osm.LineSegment; 10 12 import org.openstreetmap.josm.data.osm.OsmPrimitive; … … 76 78 return; // not allowed together 77 79 78 DataSet ds = mv.getActiveDataSet();79 80 80 if (!ctrl && !shift) 81 ds.clearSelection(); // new selection will replace the old. 81 Main.main.ds.clearSelection(); // new selection will replace the old. 82 82 83 83 Collection<OsmPrimitive> selectionList = selectionManager.getObjectsInRectangle(r,alt); 84 84 for (OsmPrimitive osm : selectionList) 85 osm.setSelected(!ctrl , ds);85 osm.setSelected(!ctrl); 86 86 87 87 mv.repaint(); // from now on, the map has to be repainted. … … 90 90 return; // no new track yet. 91 91 92 Collection<OsmPrimitive> selection = ds.getSelected(); 92 Collection<OsmPrimitive> selection = Main.main.ds.getSelected(); 93 93 if (selection.isEmpty()) 94 94 return; … … 104 104 Track t = new Track(); 105 105 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(); 109 111 } 110 112
Note:
See TracChangeset
for help on using the changeset viewer.
