Changeset 32473 in osm
- Timestamp:
- 2016-06-30T23:43:58+02:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/MapdustPlugin.java
r32329 r32473 29 29 30 30 import static org.openstreetmap.josm.tools.I18n.tr; 31 31 32 import java.awt.Point; 32 33 import java.awt.event.KeyEvent; … … 35 36 import java.util.ArrayList; 36 37 import java.util.List; 38 37 39 import javax.swing.JOptionPane; 38 40 import javax.swing.SwingUtilities; 41 39 42 import org.openstreetmap.josm.Main; 40 43 import org.openstreetmap.josm.data.Bounds; … … 44 47 import org.openstreetmap.josm.gui.MapFrame; 45 48 import org.openstreetmap.josm.gui.MapView; 46 import org.openstreetmap.josm.gui.MapView.LayerChangeListener;47 49 import org.openstreetmap.josm.gui.NavigatableComponent; 48 50 import org.openstreetmap.josm.gui.NavigatableComponent.ZoomChangeListener; 49 import org.openstreetmap.josm.gui.layer.Layer; 51 import org.openstreetmap.josm.gui.layer.LayerManager.LayerAddEvent; 52 import org.openstreetmap.josm.gui.layer.LayerManager.LayerChangeListener; 53 import org.openstreetmap.josm.gui.layer.LayerManager.LayerOrderChangeEvent; 54 import org.openstreetmap.josm.gui.layer.LayerManager.LayerRemoveEvent; 50 55 import org.openstreetmap.josm.plugins.Plugin; 51 56 import org.openstreetmap.josm.plugins.PluginInformation; … … 152 157 /* add Listeners */ 153 158 NavigatableComponent.addZoomChangeListener(this); 154 Ma pView.addLayerChangeListener(this);159 Main.getLayerManager().addLayerChangeListener(this); 155 160 newMapFrame.mapView.addMouseListener(this); 156 161 /* put username to preferences */ … … 159 164 /* if new MapFrame is null, remove listener */ 160 165 oldMapFrame.mapView.removeMouseListener(this); 161 Ma pView.removeLayerChangeListener(this);166 Main.getLayerManager().removeLayerChangeListener(this); 162 167 NavigatableComponent.removeZoomChangeListener(this); 163 168 mapdustGUI.removeObserver(this); … … 421 426 } 422 427 423 /** 424 * No need to implement this. 425 */ 426 @Override 427 public void activeLayerChange(Layer arg0, Layer arg1) {} 428 @Override 429 public void layerOrderChanged(LayerOrderChangeEvent e) { 430 } 428 431 429 432 /** … … 432 435 * MapDust Service and updates the editor with this new data. 433 436 * 434 * @param layer The <code>Layer</code> which will be added to the JOSM 435 * editor 436 */ 437 @Override 438 public void layerAdded(Layer layer) {} 437 * @param e The new added layer event 438 */ 439 @Override 440 public void layerAdded(LayerAddEvent e) {} 439 441 440 442 /** … … 442 444 * the MapDust plug-in window. 443 445 * 444 * @param layer The <code>Layer</code> which will be removed from the JOSM 445 * editor 446 */ 447 @Override 448 public void layerRemoved(Layer layer) { 449 if (layer instanceof MapdustLayer) { 446 * @param e The new added layer event 447 */ 448 @Override 449 public void layerRemoving(LayerRemoveEvent e) { 450 if (e.getRemovedLayer() instanceof MapdustLayer) { 450 451 /* remove the layer */ 451 452 Main.pref.put("mapdust.pluginState", 452 453 MapdustPluginState.ONLINE.getValue()); 453 454 NavigatableComponent.removeZoomChangeListener(this); 454 Main.main.removeLayer(layer);455 455 if (mapdustGUI != null) { 456 456 Main.map.remove(mapdustGUI); … … 588 588 mapdustLayer = new MapdustLayer("MapDust", mapdustGUI, 589 589 mapdustBugList); 590 Main. main.addLayer(this.mapdustLayer);590 Main.getLayerManager().addLayer(this.mapdustLayer); 591 591 Main.map.mapView.moveLayer(this.mapdustLayer, 0); 592 592 Main.map.mapView.addMouseListener(this);
Note:
See TracChangeset
for help on using the changeset viewer.