Changeset 2517 in josm
- Timestamp:
- 2009-11-26T20:43:56+01:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/DataSet.java
r2515 r2517 248 248 * dataset. (However, the selection does only change in the active layer) 249 249 */ 250 public static Collection<SelectionChangedListener> selListeners = 250 public static Collection<SelectionChangedListener> selListeners = 251 251 Collections.synchronizedList(new LinkedList<SelectionChangedListener>()); 252 253 /**254 * notifies all registered selection change listeners about the current selection of255 * primitives256 *257 * @param sel the current selection258 */259 private static void notifySelectionChangeListeners(Collection<? extends OsmPrimitive> sel) {260 synchronized (selListeners) {261 for (SelectionChangedListener l : selListeners) {262 l.selectionChanged(sel);263 }264 }265 }266 252 267 253 /** … … 271 257 */ 272 258 public void fireSelectionChanged(){ 273 notifySelectionChangeListeners(selectedPrimitives); 259 synchronized (selListeners) { 260 List<? extends OsmPrimitive> currentSelection = Collections.unmodifiableList(new ArrayList<OsmPrimitive>(selectedPrimitives)); 261 for (SelectionChangedListener l : selListeners) { 262 l.selectionChanged(currentSelection); 263 } 264 } 274 265 } 275 266
Note:
See TracChangeset
for help on using the changeset viewer.