public class HistoryLoadTask extends PleaseWaitRunnable
HistoryLoadTask task = new HistoryLoadTask()
.add(node)
.add(way)
.add(relation)
.add(aHistoryItem);
MainApplication.worker.execute(task);
| Modifier and Type | Field and Description |
|---|---|
private boolean |
canceled |
private boolean |
getChangesetData |
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(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()
Returns the last exception that occurred during loading, if any.
|
protected static java.lang.String |
getLoadingMessage(PrimitiveId pid) |
boolean |
isCanceled()
Determines if this task has ben canceled.
|
protected static HistoryDataSet |
loadHistory(OsmServerHistoryReader reader,
ProgressMonitor progressMonitor) |
private void |
loadHistory(PrimitiveId pid) |
protected void |
realRun()
Called in the worker thread to do the actual work.
|
void |
setChangesetDataNeeded(boolean b)
Determine if changeset information is needed.
|
afterFinish, canRunInBackground, getProgressMonitor, operationCanceled, runprivate boolean canceled
private java.lang.Exception lastException
private final java.util.Set<PrimitiveId> toLoad
private HistoryDataSet loadedData
private OsmServerHistoryReader reader
private boolean getChangesetData
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 - if parent is nullpublic 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 - if primitive is nullpublic HistoryLoadTask add(History history)
history - the history. Must not be null.java.lang.IllegalArgumentException - if history is nullpublic HistoryLoadTask add(OsmPrimitive primitive)
primitive - the OSM primitive. Must not be null. primitive.getOsmId() > 0 required.java.lang.IllegalArgumentException - if the primitive is nulljava.lang.IllegalArgumentException - if primitive.getOsmId() <= 0public HistoryLoadTask add(java.util.Collection<? extends OsmPrimitive> primitives)
primitives - the OSM primitives. Must not be null.
primitive.getId() > 0 required.java.lang.IllegalArgumentException - if primitives is nulljava.lang.IllegalArgumentException - 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.SAXException - if a SAX error occursjava.io.IOException - if an I/O error occursOsmTransferException - if a communication error with the OSM server occursprivate void loadHistory(PrimitiveId pid) throws OsmTransferException
OsmTransferExceptionprotected static HistoryDataSet loadHistory(OsmServerHistoryReader reader, ProgressMonitor progressMonitor) throws OsmTransferException
OsmTransferExceptionprotected static java.lang.String getLoadingMessage(PrimitiveId pid)
public boolean isCanceled()
true if this task has ben canceledpublic java.lang.Exception getLastException()
nullpublic void setChangesetDataNeeded(boolean b)
b - false means don't retrieve changeset data.