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 java.lang.Exception |
lastException |
private HistoryDataSet |
loadedData |
private OsmServerHistoryReader |
reader |
private java.util.Set<PrimitiveId> |
toLoad |
progressMonitor| Constructor and Description |
|---|
HistoryLoadTask()
Constructs a new
HistoryLoadTask. |
HistoryLoadTask(java.awt.Component parent)
Constructs a new
HistoryLoadTask. |
| Modifier and Type | Method and Description |
|---|---|
HistoryLoadTask |
add(java.util.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.
|
java.lang.Exception |
getLastException() |
boolean |
isCanceled() |
protected void |
realRun()
Called in the worker thread to do the actual work.
|
afterFinish, canRunInBackground, getProgressMonitor, operationCanceled, runprivate boolean canceled
private java.lang.Exception lastException
private java.util.Set<PrimitiveId> toLoad
private HistoryDataSet loadedData
private OsmServerHistoryReader reader
public HistoryLoadTask()
HistoryLoadTask.public HistoryLoadTask(java.awt.Component parent)
HistoryLoadTask.parent - the component to be used as reference to find the
parent for PleaseWaitDialog.
Must not be null.java.lang.IllegalArgumentException - thrown if parent is nullpublic HistoryLoadTask add(long id, OsmPrimitiveType type) throws java.lang.IllegalArgumentException
id - the object idtype - the object typejava.lang.IllegalArgumentExceptionpublic HistoryLoadTask add(PrimitiveId pid)
pid - the primitive id. Must not be null. Id > 0 required.public HistoryLoadTask add(HistoryOsmPrimitive primitive)
primitive - the history itemjava.lang.IllegalArgumentException - thrown if primitive is nullpublic HistoryLoadTask add(History history)
history - the history. Must not be null.java.lang.IllegalArgumentException - thrown if history is nullpublic HistoryLoadTask add(OsmPrimitive primitive)
primitive - the OSM primitive. Must not be null. primitive.getId() > 0 required.java.lang.IllegalArgumentException - thrown if the primitive is nulljava.lang.IllegalArgumentException - thrown if primitive.getId() <= 0public HistoryLoadTask add(java.util.Collection<? extends OsmPrimitive> primitives)
primitives - the OSM primitives. Must not be null.
primitive.getId() > 0 required.java.lang.IllegalArgumentException - thrown if primitives is nulljava.lang.IllegalArgumentException - thrown if one of the ids in the collection <= 0protected void cancel()
PleaseWaitRunnablecancel in class PleaseWaitRunnableprotected void finish()
PleaseWaitRunnablefinish in class PleaseWaitRunnableprotected void realRun() throws org.xml.sax.SAXException, java.io.IOException, OsmTransferException
PleaseWaitRunnablerealRun in class PleaseWaitRunnableorg.xml.sax.SAXExceptionjava.io.IOExceptionOsmTransferExceptionpublic boolean isCanceled()
public java.lang.Exception getLastException()