diff --git src/org/openstreetmap/josm/gui/MapView.java src/org/openstreetmap/josm/gui/MapView.java
index bbe824a..eff7bb6 100644
|
|
implements PropertyChangeListener, PreferenceChangedListener, OsmDataLayer.Layer
|
416 | 416 | listenersToFire.addAll(setActiveLayer(layer, true)); |
417 | 417 | } |
418 | 418 | |
419 | | fireLayerAdded(layer); |
420 | 419 | if (isOsmDataLayer) { |
421 | 420 | ((OsmDataLayer) layer).addLayerStateChangeListener(this); |
422 | 421 | } |
423 | | onActiveEditLayerChanged(oldActiveLayer, oldEditLayer, listenersToFire); |
| 422 | |
424 | 423 | layer.addPropertyChangeListener(this); |
425 | 424 | Main.addProjectionChangeListener(layer); |
426 | 425 | AudioPlayer.reset(); |
427 | 426 | } |
| 427 | fireLayerAdded(layer); |
| 428 | onActiveEditLayerChanged(oldActiveLayer, oldEditLayer, listenersToFire); |
| 429 | |
428 | 430 | if (!listenersToFire.isEmpty()) { |
429 | 431 | repaint(); |
430 | 432 | } |
… |
… |
implements PropertyChangeListener, PreferenceChangedListener, OsmDataLayer.Layer
|
517 | 519 | |
518 | 520 | layers.remove(layer); |
519 | 521 | Main.removeProjectionChangeListener(layer); |
520 | | |
521 | | onActiveEditLayerChanged(oldActiveLayer, oldEditLayer, listenersToFire); |
522 | | fireLayerRemoved(layer); |
523 | 522 | layer.removePropertyChangeListener(this); |
524 | 523 | layer.destroy(); |
525 | 524 | AudioPlayer.reset(); |
526 | 525 | } |
| 526 | onActiveEditLayerChanged(oldActiveLayer, oldEditLayer, listenersToFire); |
| 527 | fireLayerRemoved(layer); |
| 528 | |
527 | 529 | repaint(); |
528 | 530 | } |
529 | 531 | |
… |
… |
implements PropertyChangeListener, PreferenceChangedListener, OsmDataLayer.Layer
|
575 | 577 | layers.add(pos, layer); |
576 | 578 | } |
577 | 579 | listenersToFire = setEditLayer(layers); |
578 | | onActiveEditLayerChanged(oldActiveLayer, oldEditLayer, listenersToFire); |
579 | 580 | AudioPlayer.reset(); |
580 | 581 | } |
| 582 | onActiveEditLayerChanged(oldActiveLayer, oldEditLayer, listenersToFire); |
| 583 | |
581 | 584 | repaint(); |
582 | 585 | } |
583 | 586 | |
… |
… |
implements PropertyChangeListener, PreferenceChangedListener, OsmDataLayer.Layer
|
921 | 924 | */ |
922 | 925 | public void setActiveLayer(Layer layer) { |
923 | 926 | EnumSet<LayerListenerType> listenersToFire; |
| 927 | Layer oldActiveLayer; |
| 928 | OsmDataLayer oldEditLayer; |
924 | 929 | |
925 | 930 | synchronized (layers) { |
926 | | Layer oldActiveLayer = activeLayer; |
927 | | OsmDataLayer oldEditLayer = editLayer; |
| 931 | oldActiveLayer = activeLayer; |
| 932 | oldEditLayer = editLayer; |
928 | 933 | listenersToFire = setActiveLayer(layer, true); |
929 | | onActiveEditLayerChanged(oldActiveLayer, oldEditLayer, listenersToFire); |
930 | 934 | } |
| 935 | onActiveEditLayerChanged(oldActiveLayer, oldEditLayer, listenersToFire); |
| 936 | |
931 | 937 | repaint(); |
932 | 938 | } |
933 | 939 | |