Changeset 12970 in josm
- Timestamp:
- 2017-10-09T21:57:25+02:00 (7 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/data/osm
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/DataSelectionListener.java
r12329 r12970 158 158 } 159 159 return added; 160 } 161 162 @Override 163 public String toString() { 164 return "SelectionReplaceEvent [current=" + current + ", removed=" + removed + ", added=" + added + ']'; 160 165 } 161 166 } … … 202 207 public Set<OsmPrimitive> getAdded() { 203 208 return Collections.unmodifiableSet(add); 209 } 210 211 @Override 212 public String toString() { 213 return "SelectionAddEvent [add=" + add + ", current=" + current + ']'; 204 214 } 205 215 } … … 247 257 public Set<OsmPrimitive> getAdded() { 248 258 return Collections.emptySet(); 259 } 260 261 @Override 262 public String toString() { 263 return "SelectionRemoveEvent [remove=" + remove + ", current=" + current + ']'; 249 264 } 250 265 } … … 298 313 return Collections.unmodifiableSet(add); 299 314 } 315 316 @Override 317 public String toString() { 318 return "SelectionToggleEvent [current=" + current + ", remove=" + remove + ", add=" + add + ']'; 319 } 300 320 } 301 321 } -
trunk/src/org/openstreetmap/josm/data/osm/DataSet.java
r12873 r12970 207 207 // the listener, projection change listeners are managed as WeakReferences. 208 208 Main.addProjectionChangeListener(this); 209 addSelectionListener((DataSelectionListener) e -> fireD reprecatedSelectionChange(e.getSelection()));209 addSelectionListener((DataSelectionListener) e -> fireDeprecatedSelectionChange(e.getSelection())); 210 210 } 211 211 … … 682 682 @Deprecated 683 683 public void fireSelectionChanged() { 684 fireD reprecatedSelectionChange(getAllSelected());685 } 686 687 private static void fireD reprecatedSelectionChange(Collection<? extends OsmPrimitive> currentSelection) {684 fireDeprecatedSelectionChange(getAllSelected()); 685 } 686 687 private static void fireDeprecatedSelectionChange(Collection<? extends OsmPrimitive> currentSelection) { 688 688 for (SelectionChangedListener l : selListeners) { 689 689 l.selectionChanged(currentSelection); -
trunk/src/org/openstreetmap/josm/data/osm/event/SelectionEventManager.java
r12636 r12970 178 178 // If we would not do this, e.g. the move command would have a hard time tracking which layer 179 179 // the last moved selection was in. 180 SelectionReplaceEvent event = new SelectionReplaceEvent(oldDataSet, 181 new HashSet<>(oldDataSet.getAllSelected()), Stream.empty()); 182 selectionChanged(event); 180 selectionChanged(new SelectionReplaceEvent(oldDataSet, 181 new HashSet<>(oldDataSet.getAllSelected()), Stream.empty())); 183 182 oldDataSet.removeSelectionListener(this); 184 183 } … … 187 186 newDataSet.addSelectionListener(this); 188 187 // Fake a selection add 189 SelectionReplaceEvent event = new SelectionReplaceEvent(newDataSet, 190 Collections.emptySet(), newDataSet.getAllSelected().stream()); 191 selectionChanged(event); 188 selectionChanged(new SelectionReplaceEvent(newDataSet, 189 Collections.emptySet(), newDataSet.getAllSelected().stream())); 192 190 } 193 191 }
Note:
See TracChangeset
for help on using the changeset viewer.