Package org.openstreetmap.josm.gui.io
Class AbstractPrimitiveTask
java.lang.Object
org.openstreetmap.josm.gui.PleaseWaitRunnable
org.openstreetmap.josm.gui.io.AbstractPrimitiveTask
- All Implemented Interfaces:
Runnable,ProgressMonitor.CancelListener
- Direct Known Subclasses:
DownloadPrimitivesTask,UpdatePrimitivesTask
Abstract superclass of download/update primitives tasks.
- Since:
- 10129
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected final DataSetprotected booleanprotected Exceptionprotected final OsmDataLayerprivate Set<PrimitiveId>protected MultiFetchServerObjectReaderprotected OsmServerObjectReaderprivate booleanFields inherited from class org.openstreetmap.josm.gui.PleaseWaitRunnable
progressMonitor -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractPrimitiveTask(String title, OsmDataLayer layer) protectedAbstractPrimitiveTask(String title, ProgressMonitor progressMonitor, OsmDataLayer layer) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcancel()User pressed cancel button.protected voidfinish()Finish up the data work.Replies the set of ids of all primitives for which a fetch request to the server was submitted but which are not available from the server (the server replied a return code of 404)protected abstract voidprotected voidprotected voidrealRun()Called in the worker thread to do the actual work.final AbstractPrimitiveTasksetDownloadRelations(boolean fullRelation) Sets whether all members of the relation should be downloaded completely.final AbstractPrimitiveTasksetZoom(boolean zoom) Sets whether the map view should zoom to impacted primitives at the end.Methods inherited from class org.openstreetmap.josm.gui.PleaseWaitRunnable
afterFinish, canRunInBackground, getProgressMonitor, operationCanceled, run
-
Field Details
-
ds
-
canceled
-
lastException
-
missingPrimitives
-
layer
-
multiObjectReader
-
objectReader
-
zoom
-
fullRelation
-
-
Constructor Details
-
AbstractPrimitiveTask
-
AbstractPrimitiveTask
-
-
Method Details
-
initMultiFetchReader
-
setZoom
Sets whether the map view should zoom to impacted primitives at the end.- Parameters:
zoom-trueif the map view should zoom to impacted primitives at the end- Returns:
this
-
setDownloadRelations
Sets whether all members of the relation should be downloaded completely.- Parameters:
fullRelation-trueif a full download is required, i.e., a download including the immediate children of a relation.- Returns:
thissince 15811 (changed parameter list)
-
getMissingPrimitives
Replies the set of ids of all primitives for which a fetch request to the server was submitted but which are not available from the server (the server replied a return code of 404)- Returns:
- the set of ids of missing primitives
-
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:
SAXException- if a SAX error occursIOException- if an I/O error occursOsmTransferException- if a communication error with the OSM server occurs
-
loadIncompleteNodes
- Throws:
OsmTransferException
-
cancel
Description copied from class:PleaseWaitRunnableUser pressed cancel button.- Specified by:
cancelin classPleaseWaitRunnable
-
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
-