Ticket #11689: move_events_outside_monitors.patch

File move_events_outside_monitors.patch, 2.8 KB (added by wiktorn, 9 years ago)
  • src/org/openstreetmap/josm/gui/MapView.java

    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  
    416416                listenersToFire.addAll(setActiveLayer(layer, true));
    417417            }
    418418
    419             fireLayerAdded(layer);
    420419            if (isOsmDataLayer) {
    421420                ((OsmDataLayer) layer).addLayerStateChangeListener(this);
    422421            }
    423             onActiveEditLayerChanged(oldActiveLayer, oldEditLayer, listenersToFire);
     422
    424423            layer.addPropertyChangeListener(this);
    425424            Main.addProjectionChangeListener(layer);
    426425            AudioPlayer.reset();
    427426        }
     427        fireLayerAdded(layer);
     428        onActiveEditLayerChanged(oldActiveLayer, oldEditLayer, listenersToFire);
     429
    428430        if (!listenersToFire.isEmpty()) {
    429431            repaint();
    430432        }
    implements PropertyChangeListener, PreferenceChangedListener, OsmDataLayer.Layer  
    517519
    518520            layers.remove(layer);
    519521            Main.removeProjectionChangeListener(layer);
    520 
    521             onActiveEditLayerChanged(oldActiveLayer, oldEditLayer, listenersToFire);
    522             fireLayerRemoved(layer);
    523522            layer.removePropertyChangeListener(this);
    524523            layer.destroy();
    525524            AudioPlayer.reset();
    526525        }
     526        onActiveEditLayerChanged(oldActiveLayer, oldEditLayer, listenersToFire);
     527        fireLayerRemoved(layer);
     528
    527529        repaint();
    528530    }
    529531
    implements PropertyChangeListener, PreferenceChangedListener, OsmDataLayer.Layer  
    575577                layers.add(pos, layer);
    576578            }
    577579            listenersToFire = setEditLayer(layers);
    578             onActiveEditLayerChanged(oldActiveLayer, oldEditLayer, listenersToFire);
    579580            AudioPlayer.reset();
    580581        }
     582        onActiveEditLayerChanged(oldActiveLayer, oldEditLayer, listenersToFire);
     583
    581584        repaint();
    582585    }
    583586
    implements PropertyChangeListener, PreferenceChangedListener, OsmDataLayer.Layer  
    921924     */
    922925    public void setActiveLayer(Layer layer) {
    923926        EnumSet<LayerListenerType> listenersToFire;
     927        Layer oldActiveLayer;
     928        OsmDataLayer oldEditLayer;
    924929
    925930        synchronized (layers) {
    926             Layer oldActiveLayer = activeLayer;
    927             OsmDataLayer oldEditLayer = editLayer;
     931            oldActiveLayer = activeLayer;
     932            oldEditLayer = editLayer;
    928933            listenersToFire = setActiveLayer(layer, true);
    929             onActiveEditLayerChanged(oldActiveLayer, oldEditLayer, listenersToFire);
    930934        }
     935        onActiveEditLayerChanged(oldActiveLayer, oldEditLayer, listenersToFire);
     936
    931937        repaint();
    932938    }
    933939