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:
java.lang.Runnable
,ProgressMonitor.CancelListener
- Enclosing class:
- DownloadOsmChangeTask
protected class DownloadOsmChangeTask.DownloadTask extends DownloadOsmTask.DownloadTask
OsmChange download task.
-
-
Field Summary
-
Fields inherited from class org.openstreetmap.josm.actions.downloadtasks.DownloadOsmTask.DownloadTask
compression, reader
-
Fields inherited from class org.openstreetmap.josm.actions.downloadtasks.DownloadOsmTask.AbstractInternalTask
dataSet, settings, zoomAfterDownload
-
Fields inherited from class org.openstreetmap.josm.gui.PleaseWaitRunnable
progressMonitor
-
-
Constructor Summary
Constructors Constructor Description DownloadTask(DownloadParams settings, OsmServerReader reader, ProgressMonitor progressMonitor, boolean zoomAfterDownload, Compression compression)
Constructs a newDownloadTask
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
finish()
Finish up the data work.private void
loadLastVersions(java.util.Map<OsmPrimitive,java.time.Instant> toLoad, java.util.Map<OsmPrimitive,java.time.Instant> toLoadNext)
This gets the last versions of references primitives.protected DataSet
parseDataSet()
void
realRun()
Called in the worker thread to do the actual work.-
Methods inherited from class org.openstreetmap.josm.actions.downloadtasks.DownloadOsmTask.DownloadTask
cancel
-
Methods inherited from class org.openstreetmap.josm.actions.downloadtasks.DownloadOsmTask.AbstractInternalTask
addNewLayerIfRequired, computeBbox, createNewLayer, createNewLayer, generateLayerName, getEditLayer, getFirstModifiableDataLayer, getNumModifiableDataLayers, loadData, searchPrimitivesToUpdate
-
Methods inherited from class org.openstreetmap.josm.gui.PleaseWaitRunnable
afterFinish, canRunInBackground, getProgressMonitor, operationCanceled, run
-
-
-
-
Constructor Detail
-
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 Detail
-
parseDataSet
protected DataSet parseDataSet() throws OsmTransferException
- Overrides:
parseDataSet
in classDownloadOsmTask.DownloadTask
- Throws:
OsmTransferException
-
realRun
public void realRun() throws java.io.IOException, org.xml.sax.SAXException, OsmTransferException
Description copied from class:PleaseWaitRunnable
Called 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:
realRun
in classDownloadOsmTask.DownloadTask
- Throws:
java.io.IOException
- if an I/O error occursorg.xml.sax.SAXException
- if a SAX error occursOsmTransferException
- if a communication error with the OSM server occurs
-
loadLastVersions
private void loadLastVersions(java.util.Map<OsmPrimitive,java.time.Instant> toLoad, java.util.Map<OsmPrimitive,java.time.Instant> toLoadNext) throws OsmTransferException
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
protected void finish()
Description copied from class:PleaseWaitRunnable
Finish 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:
finish
in classDownloadOsmTask.DownloadTask
-
-