Index: /trunk/src/org/openstreetmap/josm/actions/DownloadAction.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/DownloadAction.java	(revision 2329)
+++ /trunk/src/org/openstreetmap/josm/actions/DownloadAction.java	(revision 2330)
@@ -10,4 +10,5 @@
 import java.awt.event.KeyEvent;
 import java.util.concurrent.Future;
+import java.util.logging.Logger;
 
 import javax.swing.JOptionPane;
@@ -18,4 +19,5 @@
 import org.openstreetmap.josm.actions.downloadtasks.DownloadOsmTask;
 import org.openstreetmap.josm.actions.downloadtasks.PostDownloadHandler;
+import org.openstreetmap.josm.data.Bounds;
 import org.openstreetmap.josm.gui.ExtendedDialog;
 import org.openstreetmap.josm.gui.download.DownloadDialog;
@@ -32,6 +34,6 @@
  */
 public class DownloadAction extends JosmAction {
+    private static final Logger logger = Logger.getLogger(DownloadAction.class.getName());
     
-
     private DownloadDialog dialog;
     private ExtendedDialog downloadDialog;
@@ -45,12 +47,11 @@
     /**
      * Creates the download dialog
+     * 
      * @return the downlaod dialog
      */
-    protected ExtendedDialog createUploadDialog() {
-        if (dialog == null)
+    protected ExtendedDialog createDownloadDialog() {
+        if (dialog == null) 
             dialog = new DownloadDialog();
         dialog.restoreSettings();
-        JPanel downPanel = new JPanel(new BorderLayout());
-        downPanel.add(dialog, BorderLayout.CENTER);
 
         final String prefName = dialog.getClass().getName()+ ".geometry";
@@ -59,4 +60,6 @@
 
         if (downloadDialog == null) {
+            JPanel downPanel = new JPanel(new BorderLayout());
+            downPanel.add(dialog, BorderLayout.CENTER);
             downloadDialog= new ExtendedDialog(Main.parent,
                 tr("Download"),
@@ -70,5 +73,5 @@
 
     public void actionPerformed(ActionEvent e) {
-        ExtendedDialog dlg = createUploadDialog();
+        ExtendedDialog dlg = createDownloadDialog();
         boolean finish = false;
         while (!finish) {            
@@ -76,7 +79,8 @@
             if (dlg.getValue() == 1 /* OK */) {
                 dialog.rememberSettings();
+                Bounds area = dialog.getSelectedDownloadArea();                
                 if (dialog.isDownloadOsmData()) {
                     DownloadOsmTask task = new DownloadOsmTask();
-                    Future<?> future = task.download(dialog.isNewLayerRequired(), dialog.getSelectedDownloadArea(), null);
+                    Future<?> future = task.download(dialog.isNewLayerRequired(), area, null);
                     Main.worker.submit(new PostDownloadHandler(task, future));
                     finish = true;
@@ -84,5 +88,5 @@
                 if (dialog.isDownloadGpxData()) {
                     DownloadGpsTask task = new DownloadGpsTask();
-                    Future<?> future = task.download(dialog.isNewLayerRequired(),dialog.getSelectedDownloadArea(), null);
+                    Future<?> future = task.download(dialog.isNewLayerRequired(),area, null);
                     Main.worker.submit(new PostDownloadHandler(task, future));
                     finish = true;
@@ -100,7 +104,4 @@
             }
         }
-
-        dialog = null;
-        dlg.dispose();
     }
 }
Index: /trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadTask.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadTask.java	(revision 2329)
+++ /trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadTask.java	(revision 2330)
@@ -11,13 +11,57 @@
 public interface DownloadTask {
     /**
-     * Execute the download using the given bounding box. Set silent on progressMonitor
-     * if no error messages should be popped up.
+     * Asynchronously launches the download task for a given bounding box.
+     *
+     * Set <code>progressMonitor</code> to null, if the task should create, open, and close a progress monitor.
+     * Set progressMonitor to {@see NullProgressMonitor#INSTANCE} if progress information is to
+     * be discarded.
+     * 
+     * You can wait for the asynchronous download task to finish by synchronizing on the returned
+     * {@see Future}, but make sure not to freeze up JOSM. Example:
+     * <pre>
+     *    Future<?> future = task.download(...);
+     *    // DON'T run this on the Swing EDT or JOSM will freeze 
+     *    future.get(); // waits for the dowload task to complete 
+     * </pre>
+     * 
+     * The following example uses a pattern which is better suited if a task is launched from
+     * the Swing EDT:
+     * <pre>
+     *    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();
+     *       }
+     *    }
+     *    Main.worker.submit(runAfterTask);
+     * </pre>
+     * 
+     * @param newLayer true, if the data is to be downloaded into a new layer. If false, the task
+     * selects one of the existing layers as download layer, preferably the active layer.
+     * 
+     * @param downloadArea the area to download
+     * @param progressMonitor the progressMonitor
+     * @return the future representing the asynchronous task
      */
     Future<?> download(boolean newLayer, Bounds downloadArea, ProgressMonitor progressMonitor);
 
     /**
-     * Execute the download using the given URL
-     * @param newLayer
-     * @param url
+     * Asynchronously launches the download task for a given bounding URL.
+     *
+     * Set progressMonitor to null, if the task should create, open, and close a progress monitor.
+     * Set progressMonitor to {@see NullProgressMonitor#INSTANCE} if progress information is to
+     * be discarded.
+ 
+     * @param newLayer newLayer true, if the data is to be downloaded into a new layer. If false, the task
+     * selects one of the existing layers as download layer, preferably the active layer.
+     * @param url the url to download from
+     * @param progressMonitor the progressMonitor
+     * @return the future representing the asynchronous task
+     * 
+     * @see #download(boolean, Bounds, ProgressMonitor)
      */
     Future<?> loadUrl(boolean newLayer, String url, ProgressMonitor progressMonitor);
@@ -28,11 +72,12 @@
      * Error objects are either {@see String}s with error messages or {@see Exception}s.
      *
-     * WARNING: Never call this in the same thread you requested the download() or it will cause a
-     * dead lock. See actions/downloadTasks/DownloadOsmTaskList.java for a proper implementation.
-     *
      * @return the list of error objects
      */
     List<Object> getErrorObjects();
 
+    /**
+     * Cancels the asynchronous download task.
+     * 
+     */
     public void cancel();
 }
Index: /trunk/src/org/openstreetmap/josm/gui/download/DownloadDialog.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/download/DownloadDialog.java	(revision 2329)
+++ /trunk/src/org/openstreetmap/josm/gui/download/DownloadDialog.java	(revision 2330)
@@ -148,5 +148,5 @@
      * @param eventSource - the DownloadSelection object that fired this notification.
      */
-    public void boundingBoxChanged(Bounds b, DownloadSelection eventSource) {
+    public void boundingBoxChanged(Bounds b, DownloadSelection eventSource) {        
         this.currentBounds = b;
         for (DownloadSelection s : downloadSelections) {
