public class DownloadOsmChangeTask extends DownloadOsmTask
Modifier and Type | Class and Description |
---|---|
protected class |
DownloadOsmChangeTask.DownloadTask
OsmChange download task.
|
private static class |
DownloadOsmChangeTask.HistoryLoaderAndListener
Loads history and updates incomplete primitives.
|
DownloadOsmTask.AbstractInternalTask
Modifier and Type | Field and Description |
---|---|
private static java.lang.String |
OSM_WEBSITE_PATTERN |
currentBounds, downloadTask, newLayerName, warnAboutEmptyArea
downloadedData, zoomAfterDownload
Constructor and Description |
---|
DownloadOsmChangeTask() |
Modifier and Type | Method and Description |
---|---|
java.util.concurrent.Future<?> |
download(DownloadParams settings,
Bounds downloadArea,
ProgressMonitor progressMonitor)
Asynchronously launches the download task for a given bounding box.
|
java.lang.String[] |
getPatterns()
Returns regular expressions that match the URLs
|
java.lang.String |
getTitle()
Returns human-readable description of the task
|
java.util.concurrent.Future<?> |
loadUrl(DownloadParams settings,
java.lang.String url,
ProgressMonitor progressMonitor)
Loads a given URL from the OSM Server
|
cancel, download, download, download, download, extractOsmFilename, getConfirmationMessage, getDownloadProjectionBounds, isSafeForRemotecontrolRequests, modifyUrlBeforeLoad
acceptsDocumentationSummary, acceptsUrl, acceptsUrl, getDownloadedData, getErrorObjects, isCanceled, isFailed, rememberDownloadedData, rememberErrorMessage, rememberException, setCanceled, setFailed, setZoomAfterDownload, toString
private static final java.lang.String OSM_WEBSITE_PATTERN
public DownloadOsmChangeTask()
public java.lang.String[] getPatterns()
DownloadTask
getPatterns
in interface DownloadTask
getPatterns
in class DownloadOsmTask
public java.lang.String getTitle()
DownloadTask
getTitle
in interface DownloadTask
getTitle
in class DownloadOsmTask
public java.util.concurrent.Future<?> download(DownloadParams settings, Bounds downloadArea, ProgressMonitor progressMonitor)
DownloadTask
progressMonitor
to null, if the task should create, open, and close a progress monitor.
Set progressMonitor to NullProgressMonitor.INSTANCE
if progress information is to
be discarded.
You can wait for the asynchronous download task to finish by synchronizing on the returned
Future
, but make sure not to freeze up JOSM. Example:
Future<?> future = task.download(...); // DON'T run this on the Swing EDT or JOSM will freeze future.get(); // waits for the dowload task to completeThe following example uses a pattern which is better suited if a task is launched from the Swing EDT:
final Future<?> future = task.download(...); Runnable runAfterTask = new Runnable() { public void run() { // this is not strictly necessary because of the type of executor service // Main.worker is initialized with, but it doesn't harm either // future.get(); // wait for the download task to complete doSomethingAfterTheTaskCompleted(); } } MainApplication.worker.submit(runAfterTask);
download
in interface DownloadTask
download
in class DownloadOsmTask
settings
- download settingsdownloadArea
- the area to downloadprogressMonitor
- the progressMonitorpublic java.util.concurrent.Future<?> loadUrl(DownloadParams settings, java.lang.String url, ProgressMonitor progressMonitor)
DownloadOsmTask
loadUrl
in interface DownloadTask
loadUrl
in class DownloadOsmTask
settings
- download settingsurl
- The URL as StringprogressMonitor
- the progressMonitorDownloadTask.download(DownloadParams, Bounds, ProgressMonitor)