Ignore:
Timestamp:
2016-05-11T21:01:05+02:00 (8 years ago)
Author:
donvip
Message:

fix EDT violation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastrePlugin.java

    r32060 r32164  
    3535import org.openstreetmap.josm.gui.preferences.map.MapPreference;
    3636import org.openstreetmap.josm.gui.preferences.projection.ProjectionPreference;
     37import org.openstreetmap.josm.gui.util.GuiHelper;
    3738import org.openstreetmap.josm.plugins.Plugin;
    3839import org.openstreetmap.josm.plugins.PluginInformation;
     
    485486    }
    486487
     488    /**
     489     * Ask to change projection if current one is not suitable for French cadastre.
     490     */
    487491    public static void askToChangeProjection() {
    488         if (JOptionPane.showConfirmDialog(Main.parent,
    489                 tr("To enable the cadastre WMS plugin, change\n"
    490                         + "the current projection to one of the cadastre\n"
    491                         + "projections and retry"),
    492                         tr("Change the current projection"), JOptionPane.OK_CANCEL_OPTION)
    493             == JOptionPane.OK_OPTION) {
    494             PreferenceDialog p = new PreferenceDialog(Main.parent);
    495             p.selectPreferencesTabByClass(MapPreference.class);
    496             p.getTabbedPane().getSetting(ProjectionPreference.class).selectProjection(ProjectionPreference.lambert_cc9);
    497             p.setVisible(true);
    498         }
     492        GuiHelper.runInEDTAndWait(new Runnable() {
     493            @Override
     494            public void run() {
     495                if (JOptionPane.showConfirmDialog(Main.parent,
     496                        tr("To enable the cadastre WMS plugin, change\n"
     497                                + "the current projection to one of the cadastre\n"
     498                                + "projections and retry"),
     499                                tr("Change the current projection"), JOptionPane.OK_CANCEL_OPTION)
     500                    == JOptionPane.OK_OPTION) {
     501                    PreferenceDialog p = new PreferenceDialog(Main.parent);
     502                    p.selectPreferencesTabByClass(MapPreference.class);
     503                    p.getTabbedPane().getSetting(ProjectionPreference.class).selectProjection(ProjectionPreference.lambert_cc9);
     504                    p.setVisible(true);
     505                }
     506            }
     507        });
    499508    }
    500509}
Note: See TracChangeset for help on using the changeset viewer.