Changeset 13200 in josm


Ignore:
Timestamp:
2017-12-12T19:48:44+01:00 (4 months ago)
Author:
Don-vip
Message:

fix #15668 - make sure zoom change events are always fired in EDT

File:
1 edited

Legend:

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

    r13181 r13200  
    6161import org.openstreetmap.josm.gui.mappaint.mapcss.MapCSSStyleSource;
    6262import org.openstreetmap.josm.gui.util.CursorManager;
     63import org.openstreetmap.josm.gui.util.GuiHelper;
    6364import org.openstreetmap.josm.spi.preferences.Config;
    6465import org.openstreetmap.josm.tools.Logging;
     
    122123     * @param listener the listener. Ignored if null or already absent
    123124     */
    124     public static void removeZoomChangeListener(NavigatableComponent.ZoomChangeListener listener) {
     125    public static void removeZoomChangeListener(ZoomChangeListener listener) {
    125126        zoomChangeListeners.remove(listener);
    126127    }
     
    131132     * @param listener the listener. Ignored if null or already registered.
    132133     */
    133     public static void addZoomChangeListener(NavigatableComponent.ZoomChangeListener listener) {
     134    public static void addZoomChangeListener(ZoomChangeListener listener) {
    134135        if (listener != null) {
    135136            zoomChangeListeners.addIfAbsent(listener);
     
    138139
    139140    protected static void fireZoomChanged() {
    140         for (ZoomChangeListener l : zoomChangeListeners) {
    141             l.zoomChanged();
    142         }
     141        GuiHelper.runInEDTAndWait(() -> {
     142            for (ZoomChangeListener l : zoomChangeListeners) {
     143                l.zoomChanged();
     144            }
     145        });
    143146    }
    144147
Note: See TracChangeset for help on using the changeset viewer.