|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.openstreetmap.josm.gui.PleaseWaitRunnable
org.openstreetmap.josm.gui.dialogs.changeset.ChangesetContentDownloadTask
public class ChangesetContentDownloadTask
This is an asynchronous task for downloading the changeset content of a collection of changesets.
Field Summary | |
---|---|
private boolean |
canceled
true if the task was canceled |
private java.util.Set<Changeset> |
downloadedChangesets
the set of downloaded changesets |
private java.lang.Exception |
lastException
keeps the last exception thrown in the task, if any |
private OsmServerChangesetReader |
reader
the reader object used to read changesets from the API |
private java.util.List<java.lang.Integer> |
toDownload
the list of changeset ids to download |
Fields inherited from class org.openstreetmap.josm.gui.PleaseWaitRunnable |
---|
progressMonitor |
Constructor Summary | |
---|---|
ChangesetContentDownloadTask(java.util.Collection<java.lang.Integer> changesetIds)
Creates a download task for a collection of changesets. |
|
ChangesetContentDownloadTask(java.awt.Component parent,
java.util.Collection<java.lang.Integer> changesetIds)
Creates a download task for a collection of changesets. |
|
ChangesetContentDownloadTask(java.awt.Component parent,
int changesetId)
Creates a download task for a single changeset |
|
ChangesetContentDownloadTask(int changesetId)
Creates a download task for a single changeset |
Method Summary | |
---|---|
protected void |
cancel()
User pressed cancel button. |
protected void |
downloadChangeset(int changesetId)
Downloads the changeset with id changesetId (only "header"
information, no content) |
protected void |
finish()
Finish up the data work. |
java.util.Set<Changeset> |
getDownloadedChangesets()
|
protected void |
init(java.util.Collection<java.lang.Integer> ids)
Initialize the task with a collection of changeset ids to download |
protected boolean |
isAvailableLocally(int changesetId)
Replies true if the local ChangesetCache already includes the changeset with
id changesetId . |
boolean |
isCanceled()
|
boolean |
isFailed()
|
protected void |
realRun()
Called in the worker thread to do the actual work. |
Methods inherited from class org.openstreetmap.josm.gui.PleaseWaitRunnable |
---|
afterFinish, canRunInBackground, getProgressMonitor, operationCanceled, run |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.lang.Runnable |
---|
run |
Field Detail |
---|
private final java.util.List<java.lang.Integer> toDownload
private boolean canceled
private java.lang.Exception lastException
private OsmServerChangesetReader reader
private java.util.Set<Changeset> downloadedChangesets
Constructor Detail |
---|
public ChangesetContentDownloadTask(int changesetId) throws java.lang.IllegalArgumentException
changesetId
- the changeset id. >0 required.
java.lang.IllegalArgumentException
- thrown if changesetId <= 0public ChangesetContentDownloadTask(java.util.Collection<java.lang.Integer> changesetIds)
changesetIds
- the changeset ids. Empty collection assumed, if null.public ChangesetContentDownloadTask(java.awt.Component parent, int changesetId) throws java.lang.IllegalArgumentException
parent
- the parent component for the PleaseWaitDialog
. Must not be null.changesetId
- the changeset id. >0 required.
java.lang.IllegalArgumentException
- thrown if changesetId <= 0
java.lang.IllegalArgumentException
- thrown if parent is nullpublic ChangesetContentDownloadTask(java.awt.Component parent, java.util.Collection<java.lang.Integer> changesetIds) throws java.lang.IllegalArgumentException
parent
- the parent component for the PleaseWaitDialog
. Must not be null.changesetIds
- the changeset ids. Empty collection assumed, if null.
java.lang.IllegalArgumentException
- thrown if parent is nullMethod Detail |
---|
protected void init(java.util.Collection<java.lang.Integer> ids)
ids
- the collection of ids. May be null.protected boolean isAvailableLocally(int changesetId)
ChangesetCache
already includes the changeset with
id changesetId
.
changesetId
- the changeset id
ChangesetCache
already includes the changeset with
id changesetId
protected void downloadChangeset(int changesetId) throws OsmTransferException
changesetId
(only "header"
information, no content)
changesetId
- the changeset id
OsmTransferException
- thrown if something went wrongprotected void cancel()
PleaseWaitRunnable
cancel
in class PleaseWaitRunnable
protected void finish()
PleaseWaitRunnable
finish
in class PleaseWaitRunnable
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
public java.util.Set<Changeset> getDownloadedChangesets()
getDownloadedChangesets
in interface ChangesetDownloadTask
public boolean isCanceled()
isCanceled
in interface ChangesetDownloadTask
public boolean isFailed()
isFailed
in interface ChangesetDownloadTask
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |