Ignore:
Timestamp:
2013-03-21T14:41:44+01:00 (11 years ago)
Author:
akks
Message:

fix #8426: add_tags in remote control: better changed tags detection,
fix EDT violations and NPE when layer is closed while adding tags
added GuiHelper.executeByMainWorkerInEDT to execute GUI-related tasks sequentially from non-EDT threads

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/LoadAndZoomHandler.java

    r5707 r5790  
    2727import org.openstreetmap.josm.data.osm.Way;
    2828import org.openstreetmap.josm.data.osm.visitor.BoundingXYVisitor;
     29import org.openstreetmap.josm.gui.util.GuiHelper;
    2930import org.openstreetmap.josm.io.remotecontrol.AddTagsDialog;
    3031import org.openstreetmap.josm.io.remotecontrol.PermissionPrefWithDefault;
     
    132133         */
    133134        if (args.containsKey("addtags")) {
    134             Main.worker.execute(new Runnable() {
     135            GuiHelper.executeByMainWorkerInEDT(new Runnable() {
    135136                public void run() {
    136137                    DataSet ds = Main.main.getCurrentDataSet();
     
    145146        if (args.containsKey("select") && PermissionPrefWithDefault.CHANGE_SELECTION.isAllowed()) {
    146147            // select objects after downloading, zoom to selection.
    147             Main.worker.execute(new Runnable() {
     148            GuiHelper.executeByMainWorkerInEDT(new Runnable() {
    148149                public void run() {
    149150                    HashSet<OsmPrimitive> newSel = new HashSet<OsmPrimitive>();
     
    199200    static void addTags(final Map<String, String> args) {
    200201        if (args.containsKey("addtags")) {
    201             Main.worker.execute(new Runnable() {
     202            GuiHelper.executeByMainWorkerInEDT(new Runnable() {
    202203
    203204                public void run() {
     
    235236        // make sure this isn't called unless there *is* a MapView
    236237        if (Main.isDisplayingMapView()) {
    237             Main.worker.execute(new Runnable() {
     238            GuiHelper.executeByMainWorkerInEDT(new Runnable() {
    238239                public void run() {
    239240                    BoundingXYVisitor bbox = new BoundingXYVisitor();
Note: See TracChangeset for help on using the changeset viewer.