|
||||||||||
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.history.HistoryLoadTask
public class HistoryLoadTask
Loads the object history of an collection of objects from the server. It provides a fluent API for configuration. Sample usage:
HistoryLoadTask task = new HistoryLoadTask() .add(1, OsmPrimitiveType.NODE) .add(1233, OsmPrimitiveType.WAY) .add(37234, OsmPrimitveType.RELATION) .add(aHistoryItem); Main.worker.execute(task);
Field Summary | |
---|---|
private boolean |
canceled
|
private java.lang.Exception |
lastException
|
private HistoryDataSet |
loadedData
|
private java.util.HashSet<PrimitiveId> |
toLoad
|
Fields inherited from class org.openstreetmap.josm.gui.PleaseWaitRunnable |
---|
progressMonitor |
Constructor Summary | |
---|---|
HistoryLoadTask()
|
|
HistoryLoadTask(java.awt.Component parent)
Creates a new task |
Method Summary | |
---|---|
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. |
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 |
Field Detail |
---|
private boolean canceled
private java.lang.Exception lastException
private java.util.HashSet<PrimitiveId> toLoad
private HistoryDataSet loadedData
Constructor Detail |
---|
public HistoryLoadTask()
public HistoryLoadTask(java.awt.Component parent)
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 nullMethod Detail |
---|
public HistoryLoadTask add(long id, OsmPrimitiveType type) throws java.lang.IllegalArgumentException
id
- the object idtype
- the object type
java.lang.IllegalArgumentException
public HistoryLoadTask add(PrimitiveId pid)
pid
- the primitive id. Must not be null. Id > 0 required.
public HistoryLoadTask add(HistoryOsmPrimitive primitive)
primitive
- the history item
java.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 null
java.lang.IllegalArgumentException
- thrown if primitive.getId() <= 0public HistoryLoadTask add(java.util.Collection<? extends OsmPrimitive> primitives)
primitive
- the OSM primitive. Must not be null. primitive.getId() > 0 required.
java.lang.IllegalArgumentException
- thrown if primitives is null
java.lang.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 org.xml.sax.SAXException, java.io.IOException, OsmTransferException
PleaseWaitRunnable
realRun
in class PleaseWaitRunnable
org.xml.sax.SAXException
java.io.IOException
OsmTransferException
public boolean isCanceled()
public java.lang.Exception getLastException()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |