Changeset 2539 in josm
- Timestamp:
- 2009-11-28T22:15:54+01:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/UndoRedoHandler.java
r2512 r2539 2 2 package org.openstreetmap.josm.data; 3 3 4 import java.util.ArrayList; 5 import java.util.Collection; 4 6 import java.util.Iterator; 7 import java.util.List; 5 8 import java.util.LinkedList; 6 9 import java.util.Stack; … … 9 12 import org.openstreetmap.josm.command.Command; 10 13 import org.openstreetmap.josm.data.osm.DataSet; 14 import org.openstreetmap.josm.data.osm.OsmPrimitive; 11 15 import org.openstreetmap.josm.gui.layer.Layer; 12 16 import org.openstreetmap.josm.gui.layer.OsmDataLayer; … … 20 24 */ 21 25 public final LinkedList<Command> commands = new LinkedList<Command>(); 26 /** 27 * Selection to be restored on undo 28 */ 29 public Collection<? extends OsmPrimitive> lastSelection = new ArrayList<OsmPrimitive>(); 22 30 /** 23 31 * The stack for redoing commands … … 35 43 */ 36 44 public void addNoRedraw(final Command c) { 45 lastSelection = Main.main.getCurrentDataSet().getSelected(); 37 46 c.executeCommand(); 38 47 commands.add(c); … … 73 82 } 74 83 fireCommandsChanged(); 75 Main.main.getCurrentDataSet().setSelected(); 84 List<OsmPrimitive> all = Main.main.getCurrentDataSet().allPrimitives(); 85 for (OsmPrimitive op : lastSelection) { 86 if (all.contains(op)) { 87 Main.main.getCurrentDataSet().addSelected(op); 88 } 89 } 76 90 } 77 91
Note:
See TracChangeset
for help on using the changeset viewer.