Ignore:
Timestamp:
2017-08-27T20:56:40+02:00 (7 years ago)
Author:
donvip
Message:

update to JOSM 12675

Location:
applications/editors/josm/plugins/reverter
Files:
9 edited

Legend:

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

    r32680 r33572  
    44    <property name="commit.message" value="Reverter: Update MultiOsmReader to support null data after redaction"/>
    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="12675"/>
    77
    88    <!-- Configure these properties (replace "..." accordingly).
  • applications/editors/josm/plugins/reverter/src/reverter/ChangesetIdQuery.java

    r32905 r33572  
    2828import org.openstreetmap.josm.data.osm.DataSet;
    2929import org.openstreetmap.josm.gui.ExtendedDialog;
     30import org.openstreetmap.josm.gui.MainApplication;
    3031import org.openstreetmap.josm.gui.widgets.HistoryComboBox;
    3132import org.openstreetmap.josm.tools.GBC;
     
    107108        super.setupDialog();
    108109
    109         final DataSet ds = Main.getLayerManager().getEditDataSet();
     110        final DataSet ds = MainApplication.getLayerManager().getEditDataSet();
    110111
    111112        // Disables "Download in new layer" choice if there is no current data set (i.e no data layer)
  • applications/editors/josm/plugins/reverter/src/reverter/ChangesetReverter.java

    r32905 r33572  
    1212import java.util.List;
    1313
    14 import org.openstreetmap.josm.Main;
    1514import org.openstreetmap.josm.command.Command;
    1615import org.openstreetmap.josm.command.DeleteCommand;
     
    3231import org.openstreetmap.josm.data.osm.history.HistoryRelation;
    3332import org.openstreetmap.josm.data.osm.history.HistoryWay;
     33import org.openstreetmap.josm.gui.MainApplication;
    3434import org.openstreetmap.josm.gui.layer.OsmDataLayer;
    3535import org.openstreetmap.josm.gui.progress.ProgressMonitor;
     
    3838import org.openstreetmap.josm.io.OsmApiException;
    3939import org.openstreetmap.josm.io.OsmTransferException;
     40import org.openstreetmap.josm.tools.Logging;
    4041
    4142import reverter.corehacks.ChangesetDataSet;
     
    138139            this.layer = new OsmDataLayer(this.ds, tr("Reverted changeset") + tr(" [id: {0}]", String.valueOf(changesetId)), null);
    139140        } else {
    140             this.layer = Main.getLayerManager().getEditLayer();
     141            this.layer = MainApplication.getLayerManager().getEditLayer();
    141142            this.ds = layer.data;
    142143        }
     
    154155            monitor.finishTask();
    155156            if (newLayer) {
    156                 GuiHelper.runInEDT(new Runnable() {
    157                     @Override
    158                     public void run() {
    159                         Main.getLayerManager().addLayer(layer);
    160                     }
    161                 });
     157                GuiHelper.runInEDT(() -> MainApplication.getLayerManager().addLayer(layer));
    162158            }
    163159        }
     
    204200                    message += ", requesting previous one";
    205201                }
    206                 Main.info(message);
     202                Logging.info(message);
    207203                version--;
    208204            }
    209205        }
    210206        if (!readOK) {
    211             Main.warn("Cannot retrieve any previous version of "+id);
     207            Logging.warn("Cannot retrieve any previous version of "+id);
    212208        }
    213209    }
  • applications/editors/josm/plugins/reverter/src/reverter/DataSetCommandMerger.java

    r32905 r33572  
    1010import java.util.List;
    1111
    12 import org.openstreetmap.josm.Main;
    1312import org.openstreetmap.josm.command.ChangeCommand;
    1413import org.openstreetmap.josm.command.Command;
     
    2120import org.openstreetmap.josm.data.osm.RelationMember;
    2221import org.openstreetmap.josm.data.osm.Way;
     22import org.openstreetmap.josm.tools.Logging;
    2323
    2424/**
     
    5353                nominalRevertedPrimitives.add(target);
    5454            }
    55             Main.debug("Reverting "+target+" to "+newTarget);
     55            Logging.debug("Reverting "+target+" to "+newTarget);
    5656        }
    5757    }
     
    113113                localConflicts.add(new Conflict<OsmPrimitive>(targetNode, sourceNode, true));
    114114            } else {
    115                 Main.info("Skipping target node "+targetNode+" for source node "+sourceNode+" while reverting way "+source);
     115               Logging.info("Skipping target node "+targetNode+" for source node "+sourceNode+" while reverting way "+source);
    116116            }
    117117        }
     
    120120        newTarget.setNodes(newNodes);
    121121        if (newNodes.isEmpty()) {
    122             Main.error("Unable to revert "+source+" as it produces 0 nodes way "+newTarget);
     122            Logging.error("Unable to revert "+source+" as it produces 0 nodes way "+newTarget);
    123123        } else {
    124124            for (Conflict<OsmPrimitive> c : localConflicts) {
    125                 Main.warn("New conflict: "+c);
     125                Logging.warn("New conflict: "+c);
    126126                conflicts.add(c);
    127127                Node targetNode = (Node) c.getTheir();
  • applications/editors/josm/plugins/reverter/src/reverter/RevertChangesetAction.java

    r32905 r33572  
    88import java.util.Collection;
    99
    10 import org.openstreetmap.josm.Main;
    1110import org.openstreetmap.josm.actions.JosmAction;
     11import org.openstreetmap.josm.gui.MainApplication;
    1212import org.openstreetmap.josm.tools.Shortcut;
    1313
     
    3636        final boolean autoConfirmDownload = newLayer || changesetIds.size() > 1;
    3737        for (Integer changesetId : changesetIds) {
    38             Main.worker.submit(new RevertChangesetTask(changesetId, revertType, autoConfirmDownload, newLayer));
     38            MainApplication.worker.submit(new RevertChangesetTask(changesetId, revertType, autoConfirmDownload, newLayer));
    3939            newLayer = false; // reuse layer for subsequent reverts
    4040        }
  • applications/editors/josm/plugins/reverter/src/reverter/RevertChangesetHandler.java

    r32905 r33572  
    44import static org.openstreetmap.josm.tools.I18n.tr;
    55
    6 import org.openstreetmap.josm.Main;
     6import org.openstreetmap.josm.gui.MainApplication;
    77import org.openstreetmap.josm.io.remotecontrol.PermissionPrefWithDefault;
    88import org.openstreetmap.josm.io.remotecontrol.handler.RequestHandler;
     
    1919            RequestHandlerBadRequestException {
    2020        try {
    21             Main.worker.submit(new RevertChangesetTask(changesetId, ChangesetReverter.RevertType.FULL, true));
     21            MainApplication.worker.submit(new RevertChangesetTask(changesetId, ChangesetReverter.RevertType.FULL, true));
    2222        } catch (Exception ex) {
    2323            System.out.println("RemoteControl: Error parsing revert_changeset remote control request:");
  • applications/editors/josm/plugins/reverter/src/reverter/RevertChangesetTask.java

    r32905 r33572  
    1212import org.openstreetmap.josm.command.Command;
    1313import org.openstreetmap.josm.command.conflict.ConflictAddCommand;
     14import org.openstreetmap.josm.gui.MainApplication;
    1415import org.openstreetmap.josm.gui.Notification;
    1516import org.openstreetmap.josm.gui.PleaseWaitRunnable;
    16 import org.openstreetmap.josm.gui.progress.PleaseWaitProgressMonitor;
    1717import org.openstreetmap.josm.gui.progress.ProgressMonitor;
     18import org.openstreetmap.josm.gui.progress.swing.PleaseWaitProgressMonitor;
    1819import org.openstreetmap.josm.gui.util.GuiHelper;
    1920import org.openstreetmap.josm.io.OsmTransferException;
     
    123124            @Override
    124125            public void run() {
    125                 Main.main.undoRedo.add(cmd);
     126                MainApplication.undoRedo.add(cmd);
    126127                if (newConflicts > 0) {
    127                     Main.map.conflictDialog.warnNumNewConflicts(newConflicts);
     128                    MainApplication.getMap().conflictDialog.warnNumNewConflicts(newConflicts);
    128129                }
    129130            }
  • applications/editors/josm/plugins/reverter/src/reverter/ReverterPlugin.java

    r32905 r33572  
    44import javax.swing.JMenu;
    55
    6 import org.openstreetmap.josm.Main;
    76import org.openstreetmap.josm.actions.UploadAction;
     7import org.openstreetmap.josm.gui.MainApplication;
    88import org.openstreetmap.josm.gui.MainMenu;
    99import org.openstreetmap.josm.io.remotecontrol.RemoteControl;
     
    1515    public ReverterPlugin(PluginInformation info) {
    1616        super(info);
    17         JMenu historyMenu = Main.main.menu.dataMenu;
     17        JMenu historyMenu = MainApplication.getMenu().dataMenu;
    1818        //MainMenu.add(historyMenu, new ObjectsHistoryAction());
    1919        MainMenu.add(historyMenu, new RevertChangesetAction());
  • applications/editors/josm/plugins/reverter/src/reverter/ReverterUploadHook.java

    r32905 r33572  
    22package reverter;
    33
    4 import org.openstreetmap.josm.Main;
    54import org.openstreetmap.josm.actions.upload.UploadHook;
    65import org.openstreetmap.josm.command.Command;
    76import org.openstreetmap.josm.data.APIDataSet;
     7import org.openstreetmap.josm.gui.MainApplication;
    88
    99public class ReverterUploadHook implements UploadHook {
     
    1717        if (!ReverterPlugin.reverterUsed) return true;
    1818        boolean hasRevertions = false;
    19         for (Command cmd : Main.main.undoRedo.commands) {
     19        for (Command cmd : MainApplication.undoRedo.commands) {
    2020            if (cmd instanceof RevertChangesetCommand) {
    2121                hasRevertions = true;
     
    2525
    2626        if (hasRevertions) {
    27             Main.getLayerManager().getEditDataSet().addChangeSetTag("created_by", "reverter");
     27            MainApplication.getLayerManager().getEditDataSet().addChangeSetTag("created_by", "reverter");
    2828        }
    2929        return true;
Note: See TracChangeset for help on using the changeset viewer.