Changeset 12099 in josm for trunk/src/org


Ignore:
Timestamp:
2017-05-10T23:01:59+02:00 (8 years ago)
Author:
michael2402
Message:

Use selection event manager to trigger repaints on selection changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/MapView.java

    r12030 r12099  
    4141import org.openstreetmap.josm.data.Preferences.PreferenceChangedListener;
    4242import org.openstreetmap.josm.data.ProjectionBounds;
    43 import org.openstreetmap.josm.data.SelectionChangedListener;
    4443import org.openstreetmap.josm.data.ViewportData;
    4544import org.openstreetmap.josm.data.coor.EastNorth;
    4645import org.openstreetmap.josm.data.imagery.ImageryInfo;
     46import org.openstreetmap.josm.data.osm.DataSelectionListener;
    4747import org.openstreetmap.josm.data.osm.DataSet;
     48import org.openstreetmap.josm.data.osm.event.SelectionEventManager;
    4849import org.openstreetmap.josm.data.osm.visitor.paint.PaintColors;
    4950import org.openstreetmap.josm.data.osm.visitor.paint.Rendering;
     
    269270
    270271        // listens to selection changes to redraw the map
    271         DataSet.addSelectionListener(repaintSelectionChangedListener);
     272        SelectionEventManager.getInstance().addSelectionListenerForEdt(repaintSelectionChangedListener);
    272273
    273274        //store the last mouse action
     
    742743    }
    743744
    744     private final transient SelectionChangedListener repaintSelectionChangedListener = newSelection -> repaint();
     745    private final transient DataSelectionListener repaintSelectionChangedListener = event -> repaint();
    745746
    746747    /**
     
    751752        layerManager.removeActiveLayerChangeListener(this);
    752753        Main.pref.removePreferenceChangeListener(this);
    753         DataSet.removeSelectionListener(repaintSelectionChangedListener);
     754        SelectionEventManager.getInstance().removeSelectionListener(repaintSelectionChangedListener);
    754755        MultipolygonCache.getInstance().clear();
    755756        if (mapMover != null) {
Note: See TracChangeset for help on using the changeset viewer.