- Timestamp:
- 2010-08-05T07:58:54+02:00 (14 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/JosmAction.java
r3385 r3416 96 96 } 97 97 MapView.removeLayerChangeListener(layerChangeAdapter); 98 DataSet. selListeners.remove(selectionChangeAdapter);98 DataSet.removeSelectionListener(selectionChangeAdapter); 99 99 } 100 100 … … 131 131 selectionChangeAdapter = new SelectionChangeAdapter(); 132 132 MapView.addLayerChangeListener(layerChangeAdapter); 133 DataSet. selListeners.add(selectionChangeAdapter);133 DataSet.addSelectionListener(selectionChangeAdapter); 134 134 initEnabledState(); 135 135 } -
trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java
r3327 r3416 218 218 Main.map.mapView.addMouseMotionListener(this); 219 219 Main.map.mapView.addTemporaryLayer(this); 220 DataSet. selListeners.add(this);220 DataSet.addSelectionListener(this); 221 221 222 222 try { … … 233 233 Main.map.mapView.removeMouseMotionListener(this); 234 234 Main.map.mapView.removeTemporaryLayer(this); 235 DataSet. selListeners.remove(this);235 DataSet.removeSelectionListener(this); 236 236 removeHighlighting(); 237 237 try { -
trunk/src/org/openstreetmap/josm/data/osm/DataSet.java
r3414 r3416 322 322 * themselves for any dataset selection changes that occur, regardless of the current active 323 323 * dataset. (However, the selection does only change in the active layer) 324 */ 325 public static final Collection<SelectionChangedListener> selListeners = 326 Collections.synchronizedList(new LinkedList<SelectionChangedListener>()); 324 * @deprecated Use addSelectionListener/removeSelectionListener instead 325 */ 326 @Deprecated 327 public static final Collection<SelectionChangedListener> selListeners = new CopyOnWriteArrayList<SelectionChangedListener>(); 328 329 public static void addSelectionListener(SelectionChangedListener listener) { 330 ((CopyOnWriteArrayList<SelectionChangedListener>)selListeners).addIfAbsent(listener); 331 } 332 333 public static void removeSelectionListener(SelectionChangedListener listener) { 334 selListeners.remove(listener); 335 } 327 336 328 337 /** -
trunk/src/org/openstreetmap/josm/data/osm/DatasetCollection.java
r3207 r3416 50 50 private final Collection<? extends OsmPrimitive> primitives; 51 51 private final Predicate<OsmPrimitive> predicate; 52 int size = -1; 52 53 53 54 public DatasetCollection(Collection<? extends OsmPrimitive> primitives, Predicate<OsmPrimitive> predicate) { … … 63 64 @Override 64 65 public int size() { 65 int size = 0; 66 Iterator<T> it = iterator(); 67 while (it.hasNext()) { 68 size++; 69 it.next(); 66 if (size == -1) { 67 size = 0; 68 Iterator<T> it = iterator(); 69 while (it.hasNext()) { 70 size++; 71 it.next(); 72 } 70 73 } 71 74 return size; -
trunk/src/org/openstreetmap/josm/data/osm/event/SelectionEventManager.java
r3083 r3416 49 49 50 50 public SelectionEventManager() { 51 DataSet. selListeners.add(this);51 DataSet.addSelectionListener(this); 52 52 } 53 53 -
trunk/src/org/openstreetmap/josm/gui/MapView.java
r3327 r3416 222 222 223 223 // listend to selection changes to redraw the map 224 DataSet. selListeners.add(new SelectionChangedListener(){224 DataSet.addSelectionListener(new SelectionChangedListener(){ 225 225 public void selectionChanged(Collection<? extends OsmPrimitive> newSelection) { 226 226 repaint(); -
trunk/src/org/openstreetmap/josm/gui/dialogs/ChangesetDialog.java
r3206 r3416 115 115 ChangesetCache.getInstance().addChangesetCacheListener(inSelectionModel); 116 116 MapView.addEditLayerChangeListener(inSelectionModel); 117 DataSet. selListeners.add(inSelectionModel);117 DataSet.addSelectionListener(inSelectionModel); 118 118 119 119 // let the model for changesets in the current layer listen to various … … 141 141 // 142 142 MapView.removeEditLayerChangeListener(inSelectionModel); 143 DataSet. selListeners.remove(inSelectionModel);143 DataSet.removeSelectionListener(inSelectionModel); 144 144 } 145 145 -
trunk/src/org/openstreetmap/josm/gui/dialogs/ConflictDialog.java
r3078 r3416 121 121 @Override 122 122 public void showNotify() { 123 DataSet. selListeners.add(this);123 DataSet.addSelectionListener(this); 124 124 MapView.addEditLayerChangeListener(this, true); 125 125 refreshView(); … … 129 129 public void hideNotify() { 130 130 MapView.removeEditLayerChangeListener(this); 131 DataSet. selListeners.remove(this);131 DataSet.removeSelectionListener(this); 132 132 } 133 133 -
trunk/src/org/openstreetmap/josm/gui/dialogs/HistoryDialog.java
r2961 r3416 71 71 Shortcut.GROUP_LAYER, Shortcut.SHIFT_DEFAULT), 150); 72 72 build(); 73 DataSet. selListeners.add(model);73 DataSet.addSelectionListener(model); 74 74 75 75 HelpUtil.setHelpContext(this, HelpUtil.ht("/Dialog/HistoryDialog")); -
trunk/src/org/openstreetmap/josm/gui/dialogs/UserListDialog.java
r3071 r3416 71 71 @Override 72 72 public void showNotify() { 73 DataSet. selListeners.add(this);73 DataSet.addSelectionListener(this); 74 74 MapView.addLayerChangeListener(this); 75 75 } … … 78 78 public void hideNotify() { 79 79 MapView.removeLayerChangeListener(this); 80 DataSet. selListeners.remove(this);80 DataSet.removeSelectionListener(this); 81 81 } 82 82 -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/MemberTableModel.java
r3095 r3416 73 73 74 74 public void register() { 75 DataSet. selListeners.add(this);75 DataSet.addSelectionListener(this); 76 76 getLayer().data.addDataSetListener(this); 77 77 } 78 78 79 79 public void unregister() { 80 DataSet. selListeners.remove(this);80 DataSet.removeSelectionListener(this); 81 81 getLayer().data.removeDataSetListener(this); 82 82 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/SelectionTableModel.java
r3095 r3416 36 36 37 37 public void register() { 38 DataSet. selListeners.add(this);38 DataSet.addSelectionListener(this); 39 39 MapView.addLayerChangeListener(this); 40 40 } 41 41 42 42 public void unregister() { 43 DataSet. selListeners.remove(this);43 DataSet.removeSelectionListener(this); 44 44 MapView.removeLayerChangeListener(this); 45 45 } -
trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java
r3408 r3416 202 202 conflicts = new ConflictCollection(); 203 203 data.addDataSetListener(new DataSetListenerAdapter(this)); 204 DataSet. selListeners.add(this);204 DataSet.addSelectionListener(this); 205 205 } 206 206 … … 653 653 @Override 654 654 public void destroy() { 655 DataSet. selListeners.remove(this);655 DataSet.removeSelectionListener(this); 656 656 } 657 657
Note:
See TracChangeset
for help on using the changeset viewer.