public class ChangesetHeaderDownloadTask extends PleaseWaitRunnable implements ChangesetDownloadTask
ChangesetCache.| Modifier and Type | Field and Description |
|---|---|
private boolean |
canceled |
private Set<Changeset> |
downloadedChangesets |
private Set<Integer> |
idsToDownload |
private boolean |
includeDiscussion |
private Exception |
lastException |
private OsmServerChangesetReader |
reader |
progressMonitor| Constructor and Description |
|---|
ChangesetHeaderDownloadTask(Collection<Integer> ids)
Creates the download task for a collection of changeset ids.
|
ChangesetHeaderDownloadTask(Component dialogParent,
Collection<Integer> ids)
Creates the download task for a collection of changeset ids.
|
ChangesetHeaderDownloadTask(Component dialogParent,
Collection<Integer> ids,
boolean includeDiscussion)
Creates the download task for a collection of changeset ids, with possibility to download changeset discussion.
|
| Modifier and Type | Method and Description |
|---|---|
static ChangesetHeaderDownloadTask |
buildTaskForChangesets(Collection<Changeset> changesets)
Builds a download task from for a collection of changesets.
|
static ChangesetHeaderDownloadTask |
buildTaskForChangesets(Component parent,
Collection<Changeset> changesets)
Builds a download task from for a collection of changesets.
|
protected void |
cancel()
User pressed cancel button.
|
protected void |
finish()
Finish up the data work.
|
Set<Changeset> |
getDownloadedChangesets() |
protected void |
init(Collection<Integer> ids) |
boolean |
isCanceled() |
boolean |
isFailed() |
protected void |
realRun()
Called in the worker thread to do the actual work.
|
afterFinish, canRunInBackground, getProgressMonitor, operationCanceled, runprivate Set<Integer> idsToDownload
private OsmServerChangesetReader reader
private boolean canceled
private Exception lastException
private Set<Changeset> downloadedChangesets
private final boolean includeDiscussion
public ChangesetHeaderDownloadTask(Collection<Integer> ids)
PleaseWaitDialog
whose parent is Main.parent.
Null ids or or ids <= 0 in the id collection are ignored.ids - the collection of ids. Empty collection assumed if null.public ChangesetHeaderDownloadTask(Component dialogParent, Collection<Integer> ids)
PleaseWaitDialog
whose parent is the parent window of dialogParent.
Null ids or or ids <= 0 in the id collection are ignored.dialogParent - the parent reference component for the PleaseWaitDialog. Must not be null.ids - the collection of ids. Empty collection assumed if null.IllegalArgumentException - if dialogParent is nullpublic ChangesetHeaderDownloadTask(Component dialogParent, Collection<Integer> ids, boolean includeDiscussion)
PleaseWaitDialog whose parent is the parent window of dialogParent.
Null ids or or ids <= 0 in the id collection are ignored.dialogParent - the parent reference component for the PleaseWaitDialog. Must not be null.ids - the collection of ids. Empty collection assumed if null.includeDiscussion - determines if discussion comments must be downloaded or notIllegalArgumentException - if dialogParent is nullpublic static ChangesetHeaderDownloadTask buildTaskForChangesets(Collection<Changeset> changesets)
Changeset.isNew() == true.changesets - the collection of changesets. Assumes an empty collection if null.public static ChangesetHeaderDownloadTask buildTaskForChangesets(Component parent, Collection<Changeset> changesets)
Changeset.isNew() == true.parent - the parent component relative to which the PleaseWaitDialog is displayed.
Must not be null.changesets - the collection of changesets. Assumes an empty collection if null.IllegalArgumentException - if parent is nullprotected void init(Collection<Integer> ids)
protected void cancel()
PleaseWaitRunnablecancel in class PleaseWaitRunnableprotected void finish()
PleaseWaitRunnablefinish in class PleaseWaitRunnableprotected void realRun() throws SAXException, IOException, OsmTransferException
PleaseWaitRunnablerealRun in class PleaseWaitRunnableSAXException - if a SAX error occursIOException - if an I/O error occursOsmTransferException - if a communication error with the OSM server occurspublic Set<Changeset> getDownloadedChangesets()
getDownloadedChangesets in interface ChangesetDownloadTaskpublic boolean isCanceled()
isCanceled in interface ChangesetDownloadTaskpublic boolean isFailed()
isFailed in interface ChangesetDownloadTask