Changeset 33572 in osm for applications/editors/josm/plugins
- Timestamp:
- 2017-08-27T20:56:40+02:00 (7 years ago)
- Location:
- applications/editors/josm/plugins/reverter
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/reverter/build.xml
r32680 r33572 4 4 <property name="commit.message" value="Reverter: Update MultiOsmReader to support null data after redaction"/> 5 5 <!-- enter the *lowest* JOSM version this plugin is currently compatible with --> 6 <property name="plugin.main.version" value="1 0580"/>6 <property name="plugin.main.version" value="12675"/> 7 7 8 8 <!-- Configure these properties (replace "..." accordingly). -
applications/editors/josm/plugins/reverter/src/reverter/ChangesetIdQuery.java
r32905 r33572 28 28 import org.openstreetmap.josm.data.osm.DataSet; 29 29 import org.openstreetmap.josm.gui.ExtendedDialog; 30 import org.openstreetmap.josm.gui.MainApplication; 30 31 import org.openstreetmap.josm.gui.widgets.HistoryComboBox; 31 32 import org.openstreetmap.josm.tools.GBC; … … 107 108 super.setupDialog(); 108 109 109 final DataSet ds = Main .getLayerManager().getEditDataSet();110 final DataSet ds = MainApplication.getLayerManager().getEditDataSet(); 110 111 111 112 // 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 12 12 import java.util.List; 13 13 14 import org.openstreetmap.josm.Main;15 14 import org.openstreetmap.josm.command.Command; 16 15 import org.openstreetmap.josm.command.DeleteCommand; … … 32 31 import org.openstreetmap.josm.data.osm.history.HistoryRelation; 33 32 import org.openstreetmap.josm.data.osm.history.HistoryWay; 33 import org.openstreetmap.josm.gui.MainApplication; 34 34 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 35 35 import org.openstreetmap.josm.gui.progress.ProgressMonitor; … … 38 38 import org.openstreetmap.josm.io.OsmApiException; 39 39 import org.openstreetmap.josm.io.OsmTransferException; 40 import org.openstreetmap.josm.tools.Logging; 40 41 41 42 import reverter.corehacks.ChangesetDataSet; … … 138 139 this.layer = new OsmDataLayer(this.ds, tr("Reverted changeset") + tr(" [id: {0}]", String.valueOf(changesetId)), null); 139 140 } else { 140 this.layer = Main .getLayerManager().getEditLayer();141 this.layer = MainApplication.getLayerManager().getEditLayer(); 141 142 this.ds = layer.data; 142 143 } … … 154 155 monitor.finishTask(); 155 156 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)); 162 158 } 163 159 } … … 204 200 message += ", requesting previous one"; 205 201 } 206 Main.info(message);202 Logging.info(message); 207 203 version--; 208 204 } 209 205 } 210 206 if (!readOK) { 211 Main.warn("Cannot retrieve any previous version of "+id);207 Logging.warn("Cannot retrieve any previous version of "+id); 212 208 } 213 209 } -
applications/editors/josm/plugins/reverter/src/reverter/DataSetCommandMerger.java
r32905 r33572 10 10 import java.util.List; 11 11 12 import org.openstreetmap.josm.Main;13 12 import org.openstreetmap.josm.command.ChangeCommand; 14 13 import org.openstreetmap.josm.command.Command; … … 21 20 import org.openstreetmap.josm.data.osm.RelationMember; 22 21 import org.openstreetmap.josm.data.osm.Way; 22 import org.openstreetmap.josm.tools.Logging; 23 23 24 24 /** … … 53 53 nominalRevertedPrimitives.add(target); 54 54 } 55 Main.debug("Reverting "+target+" to "+newTarget);55 Logging.debug("Reverting "+target+" to "+newTarget); 56 56 } 57 57 } … … 113 113 localConflicts.add(new Conflict<OsmPrimitive>(targetNode, sourceNode, true)); 114 114 } 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); 116 116 } 117 117 } … … 120 120 newTarget.setNodes(newNodes); 121 121 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); 123 123 } else { 124 124 for (Conflict<OsmPrimitive> c : localConflicts) { 125 Main.warn("New conflict: "+c);125 Logging.warn("New conflict: "+c); 126 126 conflicts.add(c); 127 127 Node targetNode = (Node) c.getTheir(); -
applications/editors/josm/plugins/reverter/src/reverter/RevertChangesetAction.java
r32905 r33572 8 8 import java.util.Collection; 9 9 10 import org.openstreetmap.josm.Main;11 10 import org.openstreetmap.josm.actions.JosmAction; 11 import org.openstreetmap.josm.gui.MainApplication; 12 12 import org.openstreetmap.josm.tools.Shortcut; 13 13 … … 36 36 final boolean autoConfirmDownload = newLayer || changesetIds.size() > 1; 37 37 for (Integer changesetId : changesetIds) { 38 Main .worker.submit(new RevertChangesetTask(changesetId, revertType, autoConfirmDownload, newLayer));38 MainApplication.worker.submit(new RevertChangesetTask(changesetId, revertType, autoConfirmDownload, newLayer)); 39 39 newLayer = false; // reuse layer for subsequent reverts 40 40 } -
applications/editors/josm/plugins/reverter/src/reverter/RevertChangesetHandler.java
r32905 r33572 4 4 import static org.openstreetmap.josm.tools.I18n.tr; 5 5 6 import org.openstreetmap.josm. Main;6 import org.openstreetmap.josm.gui.MainApplication; 7 7 import org.openstreetmap.josm.io.remotecontrol.PermissionPrefWithDefault; 8 8 import org.openstreetmap.josm.io.remotecontrol.handler.RequestHandler; … … 19 19 RequestHandlerBadRequestException { 20 20 try { 21 Main .worker.submit(new RevertChangesetTask(changesetId, ChangesetReverter.RevertType.FULL, true));21 MainApplication.worker.submit(new RevertChangesetTask(changesetId, ChangesetReverter.RevertType.FULL, true)); 22 22 } catch (Exception ex) { 23 23 System.out.println("RemoteControl: Error parsing revert_changeset remote control request:"); -
applications/editors/josm/plugins/reverter/src/reverter/RevertChangesetTask.java
r32905 r33572 12 12 import org.openstreetmap.josm.command.Command; 13 13 import org.openstreetmap.josm.command.conflict.ConflictAddCommand; 14 import org.openstreetmap.josm.gui.MainApplication; 14 15 import org.openstreetmap.josm.gui.Notification; 15 16 import org.openstreetmap.josm.gui.PleaseWaitRunnable; 16 import org.openstreetmap.josm.gui.progress.PleaseWaitProgressMonitor;17 17 import org.openstreetmap.josm.gui.progress.ProgressMonitor; 18 import org.openstreetmap.josm.gui.progress.swing.PleaseWaitProgressMonitor; 18 19 import org.openstreetmap.josm.gui.util.GuiHelper; 19 20 import org.openstreetmap.josm.io.OsmTransferException; … … 123 124 @Override 124 125 public void run() { 125 Main .main.undoRedo.add(cmd);126 MainApplication.undoRedo.add(cmd); 126 127 if (newConflicts > 0) { 127 Main .map.conflictDialog.warnNumNewConflicts(newConflicts);128 MainApplication.getMap().conflictDialog.warnNumNewConflicts(newConflicts); 128 129 } 129 130 } -
applications/editors/josm/plugins/reverter/src/reverter/ReverterPlugin.java
r32905 r33572 4 4 import javax.swing.JMenu; 5 5 6 import org.openstreetmap.josm.Main;7 6 import org.openstreetmap.josm.actions.UploadAction; 7 import org.openstreetmap.josm.gui.MainApplication; 8 8 import org.openstreetmap.josm.gui.MainMenu; 9 9 import org.openstreetmap.josm.io.remotecontrol.RemoteControl; … … 15 15 public ReverterPlugin(PluginInformation info) { 16 16 super(info); 17 JMenu historyMenu = Main .main.menu.dataMenu;17 JMenu historyMenu = MainApplication.getMenu().dataMenu; 18 18 //MainMenu.add(historyMenu, new ObjectsHistoryAction()); 19 19 MainMenu.add(historyMenu, new RevertChangesetAction()); -
applications/editors/josm/plugins/reverter/src/reverter/ReverterUploadHook.java
r32905 r33572 2 2 package reverter; 3 3 4 import org.openstreetmap.josm.Main;5 4 import org.openstreetmap.josm.actions.upload.UploadHook; 6 5 import org.openstreetmap.josm.command.Command; 7 6 import org.openstreetmap.josm.data.APIDataSet; 7 import org.openstreetmap.josm.gui.MainApplication; 8 8 9 9 public class ReverterUploadHook implements UploadHook { … … 17 17 if (!ReverterPlugin.reverterUsed) return true; 18 18 boolean hasRevertions = false; 19 for (Command cmd : Main .main.undoRedo.commands) {19 for (Command cmd : MainApplication.undoRedo.commands) { 20 20 if (cmd instanceof RevertChangesetCommand) { 21 21 hasRevertions = true; … … 25 25 26 26 if (hasRevertions) { 27 Main .getLayerManager().getEditDataSet().addChangeSetTag("created_by", "reverter");27 MainApplication.getLayerManager().getEditDataSet().addChangeSetTag("created_by", "reverter"); 28 28 } 29 29 return true;
Note:
See TracChangeset
for help on using the changeset viewer.