- Timestamp:
- 2015-02-09T22:04:50+01:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/MapView.java
r7817 r8029 142 142 143 143 /** 144 * Adds a layer change listener 145 * 146 * @param listener the listener. Ignored if null or already registered. 147 * @param initialFire fire an active-layer-changed-event right after adding 148 * the listener in case there is a layer present (should be) 149 */ 150 public static void addLayerChangeListener(LayerChangeListener listener, boolean initialFire) { 151 addLayerChangeListener(listener); 152 if (initialFire && Main.isDisplayingMapView()) { 153 listener.activeLayerChange(null, Main.map.mapView.getActiveLayer()); 154 } 155 } 156 157 /** 144 158 * Adds an edit layer change listener 145 159 * 146 160 * @param listener the listener. Ignored if null or already registered. 147 * @param initialFire Fire an edit-layer-changed-event right after adding161 * @param initialFire fire an edit-layer-changed-event right after adding 148 162 * the listener in case there is an edit layer present 149 163 */ … … 151 165 addEditLayerChangeListener(listener); 152 166 if (initialFire && Main.isDisplayingMapView() && Main.map.mapView.getEditLayer() != null) { 153 fireEditLayerChanged(null, Main.map.mapView.getEditLayer());167 listener.editLayerChanged(null, Main.map.mapView.getEditLayer()); 154 168 } 155 169 }
Note:
See TracChangeset
for help on using the changeset viewer.