public class DownloadPrimitivesWithReferrersTask extends PleaseWaitRunnable
Modifier and Type | Field and Description |
---|---|
private boolean |
canceled
Flag indicated that user ask for cancel this task
|
private PleaseWaitRunnable |
currentTask
Reference to the task currently running
|
private boolean |
downloadReferrers
If true, download also referrers
|
private boolean |
full
If true, download members for relation
|
private java.util.List<PrimitiveId> |
ids
List of primitives id to download
|
private DownloadPrimitivesTask |
mainTask
Reference to the task that download requested primitives
|
private boolean |
newLayer
If true download into a new layer
|
private OsmDataLayer |
tmpLayer
Temporary layer where downloaded primitives are put
|
progressMonitor
Constructor and Description |
---|
DownloadPrimitivesWithReferrersTask(boolean newLayer,
java.util.List<PrimitiveId> ids,
boolean downloadReferrers,
boolean full,
ProgressMonitor monitor)
Constructor
|
Modifier and Type | Method and Description |
---|---|
protected void |
cancel()
Cancel recursively the task.
|
protected void |
finish()
Finish up the data work.
|
java.util.List<PrimitiveId> |
getDownloadedId()
Return id of really downloaded primitives.
|
protected void |
realRun()
Called in the worker thread to do the actual work.
|
private static ExtendedDialog |
reportProblemDialog(java.util.Set<PrimitiveId> errs,
java.lang.String title,
java.lang.String text,
java.lang.String listLabel,
int msgType)
Dialog for report a problem during download.
|
afterFinish, canRunInBackground, getProgressMonitor, operationCanceled, run
private final boolean newLayer
private final java.util.List<PrimitiveId> ids
private final boolean full
private final boolean downloadReferrers
private OsmDataLayer tmpLayer
private DownloadPrimitivesTask mainTask
private boolean canceled
private PleaseWaitRunnable currentTask
public DownloadPrimitivesWithReferrersTask(boolean newLayer, java.util.List<PrimitiveId> ids, boolean downloadReferrers, boolean full, ProgressMonitor monitor)
newLayer
- if the data should be downloaded into a new layerids
- List of primitive id to downloaddownloadReferrers
- if the referrers of the object should be downloaded as well,
i.e., parent relations, and for nodes, additionally, parent waysfull
- if the members of a relation should be downloaded as wellmonitor
- ProgressMonitor to use, or null to create a new oneprotected void cancel()
cancel
in class PleaseWaitRunnable
PleaseWaitRunnable.operationCanceled()
protected void realRun() throws org.xml.sax.SAXException, java.io.IOException, OsmTransferException
PleaseWaitRunnable
realRun
in class PleaseWaitRunnable
org.xml.sax.SAXException
java.io.IOException
OsmTransferException
protected void finish()
PleaseWaitRunnable
finish
in class PleaseWaitRunnable
public java.util.List<PrimitiveId> getDownloadedId()
private static ExtendedDialog reportProblemDialog(java.util.Set<PrimitiveId> errs, java.lang.String title, java.lang.String text, java.lang.String listLabel, int msgType)
errs
- Primitives involvedtitle
- Title of dialogtext
- Detail messagelistLabel
- List of primitives descriptionmsgType
- Type of message, see JOptionPane