Class DownloadGpsTask.DownloadTask
java.lang.Object
org.openstreetmap.josm.gui.PleaseWaitRunnable
org.openstreetmap.josm.actions.downloadtasks.DownloadGpsTask.DownloadTask
- All Implemented Interfaces:
Runnable,ProgressMonitor.CancelListener
- Enclosing class:
- DownloadGpsTask
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final booleanprivate GpxDataprivate final OsmServerReaderFields inherited from class org.openstreetmap.josm.gui.PleaseWaitRunnable
progressMonitor -
Constructor Summary
ConstructorsConstructorDescriptionDownloadTask(DownloadParams settings, OsmServerReader reader, ProgressMonitor progressMonitor) -
Method Summary
Modifier and TypeMethodDescriptionprivate <L extends Layer>
LaddOrMergeLayer(L layer, L mergeLayer) protected voidcancel()User pressed cancel button.Task can run in background if returned value != null.private GpxLayerprivate GpxRouteLayerfindGpxRouteMergeLayer(GpxLayer fromLayer) private MarkerLayerfindMarkerMergeLayer(GpxLayer fromLayer) protected voidfinish()Finish up the data work.private StringvoidrealRun()Called in the worker thread to do the actual work.Methods inherited from class org.openstreetmap.josm.gui.PleaseWaitRunnable
afterFinish, getProgressMonitor, operationCanceled, run
-
Field Details
-
reader
-
rawData
-
newLayer
-
-
Constructor Details
-
DownloadTask
DownloadTask(DownloadParams settings, OsmServerReader reader, ProgressMonitor progressMonitor)
-
-
Method Details
-
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.- Specified by:
realRunin classPleaseWaitRunnable- Throws:
IOException- if an I/O error occursSAXException- if a SAX error occursOsmTransferException- if a communication error with the OSM server occurs
-
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.- Specified by:
finishin classPleaseWaitRunnable
-
getLayerName
-
addOrMergeLayer
-
findGpxMergeLayer
-
findMarkerMergeLayer
-
findGpxRouteMergeLayer
-
cancel
Description copied from class:PleaseWaitRunnableUser pressed cancel button.- Specified by:
cancelin classPleaseWaitRunnable
-
canRunInBackground
Description copied from class:PleaseWaitRunnableTask can run in background if returned value != null. Note that it's tasks responsibility to ensure proper synchronization, PleaseWaitRunnable doesn't with it.- Overrides:
canRunInBackgroundin classPleaseWaitRunnable- Returns:
- If returned value is != null then task can run in background. TaskId could be used in future for "Always run in background" checkbox
-