Ignore:
Timestamp:
2017-11-17T21:34:13+01:00 (7 years ago)
Author:
donvip
Message:

update to JOSM 12840

Location:
applications/editors/josm/plugins/undelete
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/undelete/build.xml

    r32680 r33835  
    44    <property name="commit.message" value="adapt to core changes (backwards compatible)"/>
    55    <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
    6     <property name="plugin.main.version" value="10580"/>
     6    <property name="plugin.main.version" value="12840"/>
    77
    88    <property name="plugin.author" value="Nakor"/>
  • applications/editors/josm/plugins/undelete/src/org/openstreetmap/josm/plugins/undelete/Undelete.java

    r32552 r33835  
    22package org.openstreetmap.josm.plugins.undelete;
    33
    4 import org.openstreetmap.josm.Main;
     4import org.openstreetmap.josm.gui.MainApplication;
    55import org.openstreetmap.josm.gui.MainMenu;
    66import org.openstreetmap.josm.plugins.Plugin;
     
    1111    public Undelete(PluginInformation info) {
    1212        super(info);
    13         MainMenu.addAfter(Main.main.menu.fileMenu, new UndeleteAction(), false, Main.main.menu.updateModified);
     13        MainMenu.addAfter(MainApplication.getMenu().fileMenu, new UndeleteAction(), false, MainApplication.getMenu().updateModified);
    1414    }
    1515}
  • applications/editors/josm/plugins/undelete/src/org/openstreetmap/josm/plugins/undelete/UndeleteAction.java

    r33480 r33835  
    3131import org.openstreetmap.josm.data.osm.history.HistoryRelation;
    3232import org.openstreetmap.josm.data.osm.history.HistoryWay;
     33import org.openstreetmap.josm.gui.MainApplication;
    3334import org.openstreetmap.josm.gui.Notification;
    3435import org.openstreetmap.josm.gui.history.HistoryLoadTask;
     
    3637import org.openstreetmap.josm.gui.layer.OsmDataLayer;
    3738import org.openstreetmap.josm.gui.util.GuiHelper;
     39import org.openstreetmap.josm.tools.Logging;
    3840import org.openstreetmap.josm.tools.Shortcut;
    3941
     
    6668
    6769                        if (h == null) {
    68                             Main.warn("Cannot find history for " + type + " " + id);
     70                            Logging.warn("Cannot find history for " + type + " " + id);
    6971                            return;
    7072                        }
     
    171173                                  : null;
    172174                                GuiHelper.runInEDT(() -> new Notification(msg).setIcon(JOptionPane.WARNING_MESSAGE).show());
    173                                 Main.warn(msg);
     175                                Logging.warn(msg);
    174176                            }
    175177                        }
    176178                    } catch (Exception t) {
    177                         Main.error(t);
     179                        Logging.error(t);
    178180                    }
    179181                }
     
    184186            if (parent instanceof Way && !nodes.isEmpty()) {
    185187                ((Way) parent).setNodes(nodes);
    186                 Main.map.repaint();
     188                MainApplication.getMap().repaint();
    187189            }
    188190            GuiHelper.runInEDT(() -> AutoScaleAction.zoomTo(layer.data.allNonDeletedPrimitives()));
     
    200202        if (dialog.showDialog().getValue() != 1)
    201203            return;
    202         Main.pref.put("undelete.newlayer", dialog.isNewLayerSelected());
     204        Main.pref.putBoolean("undelete.newlayer", dialog.isNewLayerSelected());
    203205        Main.pref.put("undelete.osmid", dialog.getOsmIdsString());
    204206        undelete(dialog.isNewLayerSelected(), dialog.getOsmIds(), null);
     
    210212    public void undelete(boolean newLayer, final List<PrimitiveId> ids, final OsmPrimitive parent) {
    211213
    212         Main.info("Undeleting "+ids+(parent == null ? "" : " with parent "+parent));
    213 
    214         OsmDataLayer tmpLayer = Main.getLayerManager().getEditLayer();
     214        Logging.info("Undeleting "+ids+(parent == null ? "" : " with parent "+parent));
     215
     216        OsmDataLayer tmpLayer = MainApplication.getLayerManager().getEditLayer();
    215217        if ((tmpLayer == null) || newLayer) {
    216218            tmpLayer = new OsmDataLayer(new DataSet(), OsmDataLayer.createNewName(), null);
    217             Main.getLayerManager().addLayer(tmpLayer);
     219            MainApplication.getLayerManager().addLayer(tmpLayer);
    218220        }
    219221
     
    225227        }
    226228
    227         Main.worker.execute(task);
    228         Main.worker.submit(new Worker(parent, layer, ids));
     229        MainApplication.worker.execute(task);
     230        MainApplication.worker.submit(new Worker(parent, layer, ids));
    229231    }
    230232}
Note: See TracChangeset for help on using the changeset viewer.