Changeset 6052 in josm for trunk


Ignore:
Timestamp:
2013-07-06T17:12:26+02:00 (6 years ago)
Author:
Don-vip
Message:

fix EDT violation

File:
1 edited

Legend:

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

    r6020 r6052  
    66import java.awt.AlphaComposite;
    77import java.awt.Color;
    8 
    98import java.awt.Dimension;
    109import java.awt.Graphics;
     
    5756import org.openstreetmap.josm.gui.layer.markerlayer.MarkerLayer;
    5857import org.openstreetmap.josm.gui.layer.markerlayer.PlayHeadMarker;
     58import org.openstreetmap.josm.gui.util.GuiHelper;
    5959import org.openstreetmap.josm.tools.AudioPlayer;
    6060import org.openstreetmap.josm.tools.BugReportExceptionHandler;
     
    818818         * that I switch layers and actions at the same time and it was annoying to mind the
    819819         * order. This way it works as visual clue for new users */
    820         for (AbstractButton b: Main.map.allMapModeButtons) {
     820        for (final AbstractButton b: Main.map.allMapModeButtons) {
    821821            MapMode mode = (MapMode)b.getAction();
    822822            if (mode.layerIsSupported(layer)) {
    823823                Main.registerActionShortcut(mode, mode.getShortcut()); //fix #6876
    824                 b.setEnabled(true);
     824                GuiHelper.runInEDTAndWait(new Runnable() {
     825                    @Override public void run() {
     826                        b.setEnabled(true);
     827                    }
     828                });
    825829            } else {
    826830                Main.unregisterShortcut(mode.getShortcut());
    827                 b.setEnabled(false);
     831                GuiHelper.runInEDTAndWait(new Runnable() {
     832                    @Override public void run() {
     833                        b.setEnabled(false);
     834                    }
     835                });
    828836            }
    829837        }
Note: See TracChangeset for help on using the changeset viewer.