Changeset 4064 in josm
- Timestamp:
- 2011-04-25T20:32:26+02:00 (13 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/PurgeAction.java
r3823 r4064 208 208 if (cbClearUndoRedo.isSelected()) { 209 209 Main.main.undoRedo.clean(); 210 Main.map.selectionListDialog.clearSelectionHistory();210 getCurrentDataSet().clearSelectionHistory(); 211 211 } 212 212 } -
trunk/src/org/openstreetmap/josm/data/osm/DataSet.java
r3801 r4064 134 134 135 135 /** 136 * History of selections - shared by plugins and SelectionListDialog 137 */ 138 private final LinkedList<Collection<? extends OsmPrimitive>> selectionHistory = new LinkedList<Collection<? extends OsmPrimitive>>(); 139 140 /** 141 * Replies the history of JOSM selections 142 * 143 * @return 144 */ 145 public LinkedList<Collection<? extends OsmPrimitive>> getSelectionHistory() { 146 return selectionHistory; 147 } 148 149 /** 150 * Clears selection history list 151 */ 152 public void clearSelectionHistory() { 153 selectionHistory.clear(); 154 } 155 156 /** 136 157 * Maintain a list of used tags for autocompletion 137 158 */ -
trunk/src/org/openstreetmap/josm/gui/dialogs/SelectionListDialog.java
r3654 r4064 200 200 DatasetEventManager.getInstance().addDatasetListener(model, FireMode.IN_EDT); 201 201 MapView.addEditLayerChangeListener(actSearch); 202 // editLayerChanged also gets the selection history of the level 203 model.editLayerChanged(null, Main.map.mapView.getEditLayer()); 202 204 if (Main.map.mapView.getEditLayer() != null) { 203 205 model.setJOSMSelection(Main.map.mapView.getEditLayer().data.getSelected()); … … 222 224 } 223 225 224 public void clearSelectionHistory() {225 model.clearSelectionHistory();226 }227 226 228 227 /** … … 482 481 private static final int SELECTION_HISTORY_SIZE = 10; 483 482 484 private final LinkedList<Collection<? extends OsmPrimitive>> history = new LinkedList<Collection<? extends OsmPrimitive>>(); 483 // Variable to store history from currentDataSet() 484 private LinkedList<Collection<? extends OsmPrimitive>> history; 485 485 private final List<OsmPrimitive> selection = new ArrayList<OsmPrimitive>(); 486 486 private DefaultListSelectionModel selectionModel; … … 522 522 if (selection == null)return; 523 523 if (selection.isEmpty())return; 524 if (history == null) return; 524 525 if (history.isEmpty()) { 525 526 history.add(selection); … … 547 548 public List<Collection<? extends OsmPrimitive>> getSelectionHistory() { 548 549 return history; 549 }550 551 public void clearSelectionHistory() {552 history.clear();553 550 } 554 551 … … 690 687 if (newLayer == null) { 691 688 setJOSMSelection(null); 689 history = null; 692 690 } else { 691 history = newLayer.data.getSelectionHistory(); 693 692 setJOSMSelection(newLayer.data.getSelected()); 694 693 }
Note:
See TracChangeset
for help on using the changeset viewer.