Changeset 12069 in josm for trunk/src/org
- Timestamp:
- 2017-05-06T14:10:40+02:00 (8 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/data/osm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/DataSelectionListener.java
r12058 r12069 4 4 import java.util.Collections; 5 5 import java.util.HashSet; 6 import java.util.LinkedHashSet; 6 7 import java.util.Set; 7 8 import java.util.stream.Collectors; … … 39 40 40 41 /** 41 * Gets the new selection 42 * Gets the new selection. New elements are added to the end of the collection. 42 43 * <p> 43 44 * This collection cannot be modified and will not change. … … 175 176 this.current = this.getOldSelection(); 176 177 } else { 177 this.current = new HashSet<>(old);178 this.current = new LinkedHashSet<>(old); 178 179 this.current.addAll(add); 179 180 } … … 217 218 this.current = this.getOldSelection(); 218 219 } else { 219 HashSet<OsmPrimitive> currentSet = new HashSet<>(old);220 HashSet<OsmPrimitive> currentSet = new LinkedHashSet<>(old); 220 221 currentSet.removeAll(remove); 221 222 current = Collections.unmodifiableSet(currentSet); … … 257 258 public SelectionToggleEvent(DataSet source, Set<OsmPrimitive> old, Stream<OsmPrimitive> toToggle) { 258 259 super(source, old); 259 HashSet<OsmPrimitive> currentSet = new HashSet<>(old);260 HashSet<OsmPrimitive> removeSet = new HashSet<>();261 HashSet<OsmPrimitive> addSet = new HashSet<>();260 HashSet<OsmPrimitive> currentSet = new LinkedHashSet<>(old); 261 HashSet<OsmPrimitive> removeSet = new LinkedHashSet<>(); 262 HashSet<OsmPrimitive> addSet = new LinkedHashSet<>(); 262 263 toToggle.forEach(p -> { 263 264 if (currentSet.remove(p)) { -
trunk/src/org/openstreetmap/josm/data/osm/DataSet.java
r12065 r12069 177 177 /** 178 178 * The current selected primitives. This is always a unmodifiable set. 179 * 180 * The set should be ordered in the order in which the primitives have been added to the selection. 179 181 */ 180 182 private Set<OsmPrimitive> currentSelectedPrimitives = Collections.emptySet(); … … 705 707 * in this dataset, except deleted ones. May be empty, but not null. 706 708 * 709 * When iterating through the set it is ordered by the order in which the primitives were added to the selection. 710 * 707 711 * @return unmodifiable collection of primitives 708 712 */ … … 714 718 * Replies an unmodifiable collection of primitives currently selected 715 719 * in this dataset, including deleted ones. May be empty, but not null. 720 * 721 * When iterating through the set it is ordered by the order in which the primitives were added to the selection. 716 722 * 717 723 * @return unmodifiable collection of primitives
Note:
See TracChangeset
for help on using the changeset viewer.