Class DownloadOsmChangeTask.DownloadTask
java.lang.Object
org.openstreetmap.josm.gui.PleaseWaitRunnable
org.openstreetmap.josm.actions.downloadtasks.DownloadOsmTask.AbstractInternalTask
org.openstreetmap.josm.actions.downloadtasks.DownloadOsmTask.DownloadTask
org.openstreetmap.josm.actions.downloadtasks.DownloadOsmChangeTask.DownloadTask
- All Implemented Interfaces:
Runnable,ProgressMonitor.CancelListener
- Enclosing class:
- DownloadOsmChangeTask
OsmChange download task.
-
Field Summary
Fields inherited from class org.openstreetmap.josm.actions.downloadtasks.DownloadOsmTask.DownloadTask
compression, readerFields inherited from class org.openstreetmap.josm.actions.downloadtasks.DownloadOsmTask.AbstractInternalTask
dataSet, settings, zoomAfterDownloadFields inherited from class org.openstreetmap.josm.gui.PleaseWaitRunnable
progressMonitor -
Constructor Summary
ConstructorsConstructorDescriptionDownloadTask(DownloadParams settings, OsmServerReader reader, ProgressMonitor progressMonitor, boolean zoomAfterDownload, Compression compression) Constructs a newDownloadTask. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidfinish()Finish up the data work.private voidloadLastVersions(Map<OsmPrimitive, Instant> toLoad, Map<OsmPrimitive, Instant> toLoadNext) This gets the last versions of references primitives.protected DataSetvoidrealRun()Called in the worker thread to do the actual work.Methods inherited from class org.openstreetmap.josm.actions.downloadtasks.DownloadOsmTask.DownloadTask
cancelMethods inherited from class org.openstreetmap.josm.actions.downloadtasks.DownloadOsmTask.AbstractInternalTask
addNewLayerIfRequired, computeBbox, createNewLayer, createNewLayer, generateLayerName, getEditLayer, getFirstModifiableDataLayer, getNumModifiableDataLayers, loadData, searchPrimitivesToUpdateMethods inherited from class org.openstreetmap.josm.gui.PleaseWaitRunnable
afterFinish, canRunInBackground, getProgressMonitor, operationCanceled, run
-
Constructor Details
-
DownloadTask
public DownloadTask(DownloadParams settings, OsmServerReader reader, ProgressMonitor progressMonitor, boolean zoomAfterDownload, Compression compression) Constructs a newDownloadTask.- Parameters:
settings- download settingsreader- OSM data readerprogressMonitor- progress monitorzoomAfterDownload- If true, the map view will zoom to download area after downloadcompression- compression to use
-
-
Method Details
-
parseDataSet
- Overrides:
parseDataSetin classDownloadOsmTask.DownloadTask- Throws:
OsmTransferException
-
realRun
Description copied from class:PleaseWaitRunnableCalled in the worker thread to do the actual work. When any of the exception is thrown, a message box will be displayed and closeDialog is called. finish() is called in any case.- Overrides:
realRunin classDownloadOsmTask.DownloadTask- Throws:
IOException- if an I/O error occursSAXException- if a SAX error occursOsmTransferException- if a communication error with the OSM server occurs
-
loadLastVersions
private void loadLastVersions(Map<OsmPrimitive, Instant> toLoad, Map<OsmPrimitive, throws OsmTransferExceptionInstant> toLoadNext) This gets the last versions of references primitives. This may enough for many of the primitives.- Parameters:
toLoad- The primitives to loadtoLoadNext- The primitives to load next (filled by this method)- Throws:
OsmTransferException
-
finish
Description copied from class:PleaseWaitRunnableFinish up the data work. Is guaranteed to be called if realRun is called. Finish is called in the gui thread just after the dialog disappeared.- Overrides:
finishin classDownloadOsmTask.DownloadTask
-