Changeset 10601 in josm for trunk/src/org/openstreetmap/josm/actions/downloadtasks
- Timestamp:
- 2016-07-23T04:10:39+02:00 (8 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/actions/downloadtasks
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/downloadtasks/AbstractChangesetDownloadTask.java
r10250 r10601 61 61 // Run on the EDT because UI updates are triggered. 62 62 // 63 Runnable r = new Runnable() { 64 @Override public void run() { 65 ChangesetCache.getInstance().update(downloadedChangesets); 66 } 67 }; 63 Runnable r = () -> ChangesetCache.getInstance().update(downloadedChangesets); 68 64 if (SwingUtilities.isEventDispatchThread()) { 69 65 r.run(); -
trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadReferrersTask.java
r10467 r10601 117 117 DataSetMerger visitor = new DataSetMerger(targetLayer.data, parents); 118 118 visitor.merge(); 119 SwingUtilities.invokeLater( 120 new Runnable() { 121 @Override 122 public void run() { 123 targetLayer.onPostDownloadFromServer(); 124 } 125 } 126 ); 119 SwingUtilities.invokeLater(targetLayer::onPostDownloadFromServer); 127 120 if (visitor.getConflicts().isEmpty()) 128 121 return; … … 131 124 Main.parent, 132 125 trn("There was {0} conflict during import.", 133 134 135 126 "There were {0} conflicts during import.", 127 visitor.getConflicts().size(), 128 visitor.getConflicts().size() 136 129 ), 137 130 trn("Conflict during download", "Conflicts during download", visitor.getConflicts().size()), -
trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadTaskList.java
r10436 r10601 33 33 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 34 34 import org.openstreetmap.josm.gui.progress.ProgressMonitor; 35 import org.openstreetmap.josm.gui.progress.ProgressMonitor.CancelListener;36 35 import org.openstreetmap.josm.gui.util.GuiHelper; 37 36 import org.openstreetmap.josm.tools.ExceptionUtil; … … 88 87 } 89 88 } 90 progressMonitor.addCancelListener(new CancelListener() { 91 @Override 92 public void operationCanceled() { 93 for (DownloadTask dt : tasks) { 94 dt.cancel(); 95 } 89 progressMonitor.addCancelListener(() -> { 90 for (DownloadTask dt : tasks) { 91 dt.cancel(); 96 92 } 97 93 }); … … 151 147 } 152 148 } 153 EventQueue.invokeLater(new Runnable() { 154 @Override public void run() { 155 UpdateSelectionAction.updatePrimitives(toSelect); 156 } 157 }); 149 EventQueue.invokeLater(() -> UpdateSelectionAction.updatePrimitives(toSelect)); 158 150 } 159 151 … … 270 262 } 271 263 272 GuiHelper.runInEDT(new Runnable() { 273 @Override 274 public void run() { 275 if (items.size() == 1 && tr("No data found in this area.").equals(items.iterator().next())) { 276 new Notification(items.iterator().next()).setIcon(JOptionPane.WARNING_MESSAGE).show(); 277 } else { 278 JOptionPane.showMessageDialog(Main.parent, "<html>" 279 + tr("The following errors occurred during mass download: {0}", 280 Utils.joinAsHtmlUnorderedList(items)) + "</html>", 281 tr("Errors during download"), JOptionPane.ERROR_MESSAGE); 282 } 264 GuiHelper.runInEDT(() -> { 265 if (items.size() == 1 && tr("No data found in this area.").equals(items.iterator().next())) { 266 new Notification(items.iterator().next()).setIcon(JOptionPane.WARNING_MESSAGE).show(); 267 } else { 268 JOptionPane.showMessageDialog(Main.parent, "<html>" 269 + tr("The following errors occurred during mass download: {0}", 270 Utils.joinAsHtmlUnorderedList(items)) + "</html>", 271 tr("Errors during download"), JOptionPane.ERROR_MESSAGE); 283 272 } 284 273 }); … … 312 301 } 313 302 if (!myPrimitives.isEmpty()) { 314 GuiHelper.runInEDT(new Runnable() { 315 @Override public void run() { 316 handlePotentiallyDeletedPrimitives(myPrimitives); 317 } 318 }); 303 GuiHelper.runInEDT(() -> handlePotentiallyDeletedPrimitives(myPrimitives)); 319 304 } 320 305 } -
trunk/src/org/openstreetmap/josm/actions/downloadtasks/PostDownloadHandler.java
r10212 r10601 58 58 final Object error = errors.iterator().next(); 59 59 if (!GraphicsEnvironment.isHeadless()) { 60 SwingUtilities.invokeLater(new Runnable() { 61 @Override 62 public void run() { 63 if (error instanceof Exception) { 64 ExceptionDialogUtil.explainException((Exception) error); 65 } else if (tr("No data found in this area.").equals(error)) { 66 new Notification(error.toString()).setIcon(JOptionPane.WARNING_MESSAGE).show(); 67 } else { 68 JOptionPane.showMessageDialog( 69 Main.parent, 70 error.toString(), 71 tr("Error during download"), 72 JOptionPane.ERROR_MESSAGE); 73 } 60 SwingUtilities.invokeLater(() -> { 61 if (error instanceof Exception) { 62 ExceptionDialogUtil.explainException((Exception) error); 63 } else if (tr("No data found in this area.").equals(error)) { 64 new Notification(error.toString()).setIcon(JOptionPane.WARNING_MESSAGE).show(); 65 } else { 66 JOptionPane.showMessageDialog( 67 Main.parent, 68 error.toString(), 69 tr("Error during download"), 70 JOptionPane.ERROR_MESSAGE); 74 71 } 75 72 }); … … 91 88 92 89 if (!GraphicsEnvironment.isHeadless()) { 93 SwingUtilities.invokeLater(new Runnable() { 94 @Override 95 public void run() { 96 JOptionPane.showMessageDialog( 97 Main.parent, 98 "<html>"+Utils.joinAsHtmlUnorderedList(items)+"</html>", 99 tr("Errors during download"), 100 JOptionPane.ERROR_MESSAGE); 101 } 102 }); 90 SwingUtilities.invokeLater(() -> JOptionPane.showMessageDialog( 91 Main.parent, 92 "<html>"+Utils.joinAsHtmlUnorderedList(items)+"</html>", 93 tr("Errors during download"), 94 JOptionPane.ERROR_MESSAGE)); 103 95 } 104 96 return;
Note:
See TracChangeset
for help on using the changeset viewer.