public class HistoryLoadTask extends PleaseWaitRunnable
HistoryLoadTask task = new HistoryLoadTask() .add(1, OsmPrimitiveType.NODE) .add(1233, OsmPrimitiveType.WAY) .add(37234, OsmPrimitveType.RELATION) .add(aHistoryItem); Main.worker.execute(task);
Modifier and Type | Field and Description |
---|---|
private boolean |
canceled |
private Exception |
lastException |
private HistoryDataSet |
loadedData |
private OsmServerHistoryReader |
reader |
private Set<PrimitiveId> |
toLoad |
progressMonitor
Constructor and Description |
---|
HistoryLoadTask() |
HistoryLoadTask(Component parent)
Creates a new task
|
Modifier and Type | Method and Description |
---|---|
HistoryLoadTask |
add(Collection<? extends OsmPrimitive> primitives)
Adds a collection of objects to loaded, specified by a collection of OSM primitives.
|
HistoryLoadTask |
add(History history)
Adds an object to be loaded, the object is specified by an already loaded object history.
|
HistoryLoadTask |
add(HistoryOsmPrimitive primitive)
Adds an object to be loaded, the object is specified by a history item.
|
HistoryLoadTask |
add(long id,
OsmPrimitiveType type)
Adds an object whose history is to be loaded.
|
HistoryLoadTask |
add(OsmPrimitive primitive)
Adds an object to be loaded, the object is specified by an OSM primitive.
|
HistoryLoadTask |
add(PrimitiveId pid)
Adds an object whose history is to be loaded.
|
protected void |
cancel()
User pressed cancel button.
|
protected void |
finish()
Finish up the data work.
|
Exception |
getLastException() |
boolean |
isCanceled() |
protected void |
realRun()
Called in the worker thread to do the actual work.
|
afterFinish, canRunInBackground, getProgressMonitor, operationCanceled, run
private boolean canceled
private Exception lastException
private Set<PrimitiveId> toLoad
private HistoryDataSet loadedData
private OsmServerHistoryReader reader
public HistoryLoadTask()
public HistoryLoadTask(Component parent)
parent
- the component to be used as reference to find the
parent for PleaseWaitDialog
.
Must not be null
.IllegalArgumentException
- thrown if parent is null
public HistoryLoadTask add(long id, OsmPrimitiveType type) throws IllegalArgumentException
id
- the object idtype
- the object typeIllegalArgumentException
public HistoryLoadTask add(PrimitiveId pid)
pid
- the primitive id. Must not be null. Id > 0 required.public HistoryLoadTask add(HistoryOsmPrimitive primitive)
primitive
- the history itemIllegalArgumentException
- thrown if primitive is nullpublic HistoryLoadTask add(History history)
history
- the history. Must not be null.IllegalArgumentException
- thrown if history is nullpublic HistoryLoadTask add(OsmPrimitive primitive)
primitive
- the OSM primitive. Must not be null. primitive.getId() > 0 required.IllegalArgumentException
- thrown if the primitive is nullIllegalArgumentException
- thrown if primitive.getId() <= 0public HistoryLoadTask add(Collection<? extends OsmPrimitive> primitives)
primitives
- the OSM primitives. Must not be null
.
primitive.getId() > 0
required.IllegalArgumentException
- thrown if primitives is null
IllegalArgumentException
- thrown if one of the ids in the collection <= 0protected void cancel()
PleaseWaitRunnable
cancel
in class PleaseWaitRunnable
protected void finish()
PleaseWaitRunnable
finish
in class PleaseWaitRunnable
protected void realRun() throws SAXException, IOException, OsmTransferException
PleaseWaitRunnable
realRun
in class PleaseWaitRunnable
SAXException
IOException
OsmTransferException
public boolean isCanceled()
public Exception getLastException()