Changeset 10129 in josm for trunk/src/org/openstreetmap/josm/actions/downloadtasks/AbstractChangesetDownloadTask.java
- Timestamp:
- 2016-04-09T23:24:01+02:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/downloadtasks/AbstractChangesetDownloadTask.java
r10124 r10129 3 3 4 4 import java.awt.Component; 5 import java.lang.reflect.InvocationTargetException; 5 6 import java.net.URL; 6 7 import java.util.HashSet; … … 8 9 import java.util.concurrent.Future; 9 10 11 import javax.swing.SwingUtilities; 12 10 13 import org.openstreetmap.josm.Main; 11 14 import org.openstreetmap.josm.data.Bounds; 12 15 import org.openstreetmap.josm.data.osm.Changeset; 16 import org.openstreetmap.josm.data.osm.ChangesetCache; 13 17 import org.openstreetmap.josm.gui.PleaseWaitRunnable; 14 18 import org.openstreetmap.josm.gui.progress.ProgressMonitor; 15 19 import org.openstreetmap.josm.io.OsmServerChangesetReader; 20 import org.openstreetmap.josm.tools.ExceptionUtil; 21 import org.openstreetmap.josm.tools.bugreport.BugReportExceptionHandler; 16 22 17 23 /** … … 46 52 lastException = e; 47 53 setFailed(true); 54 } 55 56 protected final void updateChangesets() { 57 // update the global changeset cache with the downloaded changesets. 58 // this will trigger change events which views are listening to. They 59 // will update their views accordingly. 60 // 61 // Run on the EDT because UI updates are triggered. 62 // 63 Runnable r = new Runnable() { 64 @Override public void run() { 65 ChangesetCache.getInstance().update(downloadedChangesets); 66 } 67 }; 68 if (SwingUtilities.isEventDispatchThread()) { 69 r.run(); 70 } else { 71 try { 72 SwingUtilities.invokeAndWait(r); 73 } catch (InterruptedException e) { 74 Main.warn("InterruptedException in "+getClass().getSimpleName()+" while updating changeset cache"); 75 } catch (InvocationTargetException e) { 76 Throwable t = e.getTargetException(); 77 if (t instanceof RuntimeException) { 78 BugReportExceptionHandler.handleException(t); 79 } else if (t instanceof Exception) { 80 ExceptionUtil.explainException(e); 81 } else { 82 BugReportExceptionHandler.handleException(t); 83 } 84 } 85 } 48 86 } 49 87 }
Note:
See TracChangeset
for help on using the changeset viewer.
