Index: /trunk/src/org/openstreetmap/josm/actions/DownloadAlongAction.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/DownloadAlongAction.java	(revision 6054)
+++ /trunk/src/org/openstreetmap/josm/actions/DownloadAlongAction.java	(revision 6054)
@@ -0,0 +1,120 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.actions;
+
+import static org.openstreetmap.josm.tools.I18n.tr;
+
+import java.awt.GridBagLayout;
+import java.awt.geom.Area;
+import java.awt.geom.Rectangle2D;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import java.util.concurrent.Future;
+
+import javax.swing.JLabel;
+import javax.swing.JOptionPane;
+import javax.swing.JPanel;
+
+import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.actions.downloadtasks.DownloadTaskList;
+import org.openstreetmap.josm.gui.progress.PleaseWaitProgressMonitor;
+import org.openstreetmap.josm.gui.progress.ProgressMonitor;
+import org.openstreetmap.josm.tools.GBC;
+import org.openstreetmap.josm.tools.Shortcut;
+
+/**
+ * Abstract superclass of DownloadAlongTrackAction and DownloadAlongWayAction
+ * @since 6054
+ */
+public abstract class DownloadAlongAction extends JosmAction {
+
+    /**
+     * Constructs a new {@code DownloadAlongAction}
+     * @param name the action's text as displayed in the menu
+     * @param iconName the filename of the icon to use
+     * @param tooltip  a longer description of the action that will be displayed in the tooltip. Please note
+     *           that html is not supported for menu actions on some platforms.
+     * @param shortcut a ready-created shortcut object or null if you don't want a shortcut. But you always
+     *            do want a shortcut, remember you can always register it with group=none, so you
+     *            won't be assigned a shortcut unless the user configures one. If you pass null here,
+     *            the user CANNOT configure a shortcut for your action.
+     * @param registerInToolbar register this action for the toolbar preferences?
+     */
+    public DownloadAlongAction(String name, String iconName, String tooltip, Shortcut shortcut, boolean registerInToolbar) {
+        super(name, iconName, tooltip, shortcut, registerInToolbar);
+    }
+    
+    protected static void addToDownload(Area a, Rectangle2D r, Collection<Rectangle2D> results, double max_area) {
+        Area tmp = new Area(r);
+        // intersect with sought-after area
+        tmp.intersect(a);
+        if (tmp.isEmpty()) {
+            return;
+        }
+        Rectangle2D bounds = tmp.getBounds2D();
+        if (bounds.getWidth() * bounds.getHeight() > max_area) {
+            // the rectangle gets too large; split it and make recursive call.
+            Rectangle2D r1;
+            Rectangle2D r2;
+            if (bounds.getWidth() > bounds.getHeight()) {
+                // rectangles that are wider than high are split into a left and right half,
+                r1 = new Rectangle2D.Double(bounds.getX(), bounds.getY(), bounds.getWidth() / 2, bounds.getHeight());
+                r2 = new Rectangle2D.Double(bounds.getX() + bounds.getWidth() / 2, bounds.getY(),
+                        bounds.getWidth() / 2, bounds.getHeight());
+            } else {
+                // others into a top and bottom half.
+                r1 = new Rectangle2D.Double(bounds.getX(), bounds.getY(), bounds.getWidth(), bounds.getHeight() / 2);
+                r2 = new Rectangle2D.Double(bounds.getX(), bounds.getY() + bounds.getHeight() / 2, bounds.getWidth(),
+                        bounds.getHeight() / 2);
+            }
+            addToDownload(a, r1, results, max_area);
+            addToDownload(a, r2, results, max_area);
+        } else {
+            results.add(bounds);
+        }
+    }
+    
+    /**
+     * Area "a" contains the hull that we would like to download data for. however we
+     * can only download rectangles, so the following is an attempt at finding a number of
+     * rectangles to download.
+     *
+     * The idea is simply: Start out with the full bounding box. If it is too large, then
+     * split it in half and repeat recursively for each half until you arrive at something
+     * small enough to download. The algorithm is improved by always using the intersection
+     * between the rectangle and the actual desired area. For example, if you have a track
+     * that goes like this: +----+ | /| | / | | / | |/ | +----+ then we would first look at
+     * downloading the whole rectangle (assume it's too big), after that we split it in half
+     * (upper and lower half), but we donot request the full upper and lower rectangle, only
+     * the part of the upper/lower rectangle that actually has something in it.
+     *
+     * This functions calculates the rectangles, asks the user to continue and downloads
+     * the areas if applicable.
+     */
+    protected static void confirmAndDownloadAreas(Area a, double max_area, boolean osmDownload, boolean gpxDownload, String title, ProgressMonitor progressMonitor) {
+        List<Rectangle2D> toDownload = new ArrayList<Rectangle2D>();
+        addToDownload(a, a.getBounds(), toDownload, max_area);
+        if (toDownload.isEmpty()) {
+            return;
+        }
+        JPanel msg = new JPanel(new GridBagLayout());
+        msg.add(new JLabel(tr("<html>This action will require {0} individual<br>" + "download requests. Do you wish<br>to continue?</html>", toDownload.size())), GBC.eol());
+        if (JOptionPane.OK_OPTION != JOptionPane.showConfirmDialog(Main.parent, msg, title, JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE)) {
+            return;
+        }
+        final PleaseWaitProgressMonitor monitor = new PleaseWaitProgressMonitor(tr("Download data"));
+        final Future<?> future = new DownloadTaskList().download(false, toDownload, osmDownload, gpxDownload, monitor);
+        Main.worker.submit(new Runnable() {
+            @Override
+            public void run() {
+                try {
+                    future.get();
+                } catch (Exception e) {
+                    e.printStackTrace();
+                    return;
+                }
+                monitor.close();
+            }
+        });
+    }
+}
Index: /trunk/src/org/openstreetmap/josm/data/Preferences.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/Preferences.java	(revision 6053)
+++ /trunk/src/org/openstreetmap/josm/data/Preferences.java	(revision 6054)
@@ -1633,5 +1633,9 @@
     public void removeObsolete() {
         String[] obsolete = {
-                "color.Imagery fade",              // 08/2012 - wrong property caused by #6723, can be removed mid-2013
+                "downloadAlong.downloadAlongTrack.distance",   // 07/2013 - can be removed mid-2014. Replaced by downloadAlongWay.distance
+                "downloadAlong.downloadAlongTrack.area",       // 07/2013 - can be removed mid-2014. Replaced by downloadAlongWay.area
+                "gpxLayer.downloadAlongTrack.distance",        // 07/2013 - can be removed mid-2014. Replaced by downloadAlongTrack.distance
+                "gpxLayer.downloadAlongTrack.area",            // 07/2013 - can be removed mid-2014. Replaced by downloadAlongTrack.area
+                "gpxLayer.downloadAlongTrack.near",            // 07/2013 - can be removed mid-2014. Replaced by downloadAlongTrack.near
         };
         for (String key : obsolete) {
Index: /trunk/src/org/openstreetmap/josm/gui/layer/gpx/DownloadAlongPanel.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/layer/gpx/DownloadAlongPanel.java	(revision 6054)
+++ /trunk/src/org/openstreetmap/josm/gui/layer/gpx/DownloadAlongPanel.java	(revision 6054)
@@ -0,0 +1,219 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.gui.layer.gpx;
+
+import static org.openstreetmap.josm.tools.I18n.tr;
+
+import java.awt.GridBagLayout;
+
+import javax.swing.JCheckBox;
+import javax.swing.JLabel;
+import javax.swing.JList;
+import javax.swing.JOptionPane;
+import javax.swing.JPanel;
+import javax.swing.event.ChangeEvent;
+import javax.swing.event.ChangeListener;
+
+import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.gui.HelpAwareOptionPane;
+import org.openstreetmap.josm.gui.HelpAwareOptionPane.ButtonSpec;
+import org.openstreetmap.josm.tools.GBC;
+import org.openstreetmap.josm.tools.ImageProvider;
+
+/**
+ * Panel displayed in "Download along..." dialogs
+ * @since 6054
+ */
+public class DownloadAlongPanel extends JPanel {
+	
+	// Preferences keys
+	private final String prefOsm;
+	private final String prefGps;
+	private final String prefDist;
+	private final String prefArea;
+	private final String prefNear;
+
+	// Data types to download
+    private final JCheckBox cbDownloadOsmData;
+    private final JCheckBox cbDownloadGpxData;
+
+    // Legacy list of values
+	private static final Integer dist[] = { 5000, 500, 50 };
+	private static final Integer area[] = { 20, 10, 5, 1 };
+	
+	private final JList buffer;
+	private final JList maxRect;
+	private final JList downloadNear;
+	
+	/**
+	 * Constructs a new {@code DownloadPanel}.
+	 * @param prefOsm Preference key determining if OSM data should be downloaded
+	 * @param prefGps Preference key determining if GPS data should be downloaded
+	 * @param prefDist Preference key determining maximum distance
+	 * @param prefArea Preference key determining maximum area
+	 * @param prefNear Preference key determining "near" parameter. Can be {@code null}
+	 */
+	public DownloadAlongPanel(String prefOsm, String prefGps, String prefDist, String prefArea, String prefNear) {
+		super(new GridBagLayout());
+		
+		this.prefOsm = prefOsm;
+		this.prefGps = prefGps;
+		this.prefDist = prefDist;
+		this.prefArea = prefArea;
+		this.prefNear = prefNear;
+
+		cbDownloadOsmData = new JCheckBox(tr("OpenStreetMap data"), Main.pref.getBoolean(prefOsm, true));
+        cbDownloadOsmData.setToolTipText(tr("Select to download OSM data."));
+        add(cbDownloadOsmData,  GBC.std().insets(1,5,1,5));
+        cbDownloadGpxData = new JCheckBox(tr("Raw GPS data"), Main.pref.getBoolean(prefGps, false));
+        cbDownloadGpxData.setToolTipText(tr("Select to download GPS traces."));
+        add(cbDownloadGpxData,  GBC.eol().insets(5,5,1,5));
+        
+		add(new JLabel(tr("Download everything within:")), GBC.eol());
+		String s[] = new String[dist.length];
+		for (int i = 0; i < dist.length; ++i) {
+			s[i] = tr("{0} meters", dist[i]);
+		}
+		buffer = new JList(s);
+		
+		double distanceValue = Main.pref.getDouble(prefDist, dist[0]);
+		int distanceLegacyIndex = 0;
+		for (int i = 0; i < dist.length; i++) {
+			if (dist[i] == (int)distanceValue) {
+				distanceLegacyIndex = i;
+				break;
+			}
+		}
+		
+		buffer.setSelectedIndex(distanceLegacyIndex);
+		add(buffer, GBC.eol());
+
+		add(new JLabel(tr("Maximum area per request:")), GBC.eol());
+		s = new String[area.length];
+		for (int i = 0; i < area.length; ++i) {
+			s[i] = tr("{0} sq km", area[i]);
+		}
+		maxRect = new JList(s);
+
+		double areaValue = Main.pref.getDouble(prefArea, area[0]);
+		int areaLegacyIndex = 0;
+		for (int i = 0; i < area.length; i++) {
+			if (area[i] == (int)areaValue) {
+				areaLegacyIndex = i;
+				break;
+			}
+		}
+		
+		maxRect.setSelectedIndex(areaLegacyIndex);
+		add(maxRect, GBC.eol());
+		
+		if (prefNear != null) {
+            add(new JLabel(tr("Download near:")), GBC.eol());
+            downloadNear = new JList(new String[]{tr("track only"), tr("waypoints only"), tr("track and waypoints")});
+            downloadNear.setSelectedIndex(Main.pref.getInteger(prefNear, 0));
+            add(downloadNear, GBC.eol());
+		} else {
+		    downloadNear = null;
+		}
+	}
+	
+	/**
+	 * Gets the maximum distance in meters
+	 * @return The maximum distance, in meters
+	 */
+	public final double getDistance() {
+		return dist[buffer.getSelectedIndex()];
+	}
+
+	/**
+	 * Gets the maximum area in squared kilometers
+	 * @return The maximum distance, in squared kilometers
+	 */
+	public final double getArea() {
+		return area[maxRect.getSelectedIndex()];
+	}
+	
+	/**
+	 * Gets the "download near" choosen value
+	 * @return the "download near" choosen value (0: track only, 1: waypoints only, 2: both)
+	 */
+	public final int getNear() {
+	    return downloadNear.getSelectedIndex();
+	}
+	
+    /**
+     * Replies true if the user selected to download OSM data
+     *
+     * @return true if the user selected to download OSM data
+     */
+    public boolean isDownloadOsmData() {
+        return cbDownloadOsmData.isSelected();
+    }
+
+    /**
+     * Replies true if the user selected to download GPX data
+     *
+     * @return true if the user selected to download GPX data
+     */
+    public boolean isDownloadGpxData() {
+        return cbDownloadGpxData.isSelected();
+    }
+	
+    /**
+     * Remembers the current settings in the download panel
+     */
+    protected final void rememberSettings() {
+		Main.pref.put(prefOsm, isDownloadOsmData());
+		Main.pref.put(prefGps, isDownloadGpxData());
+		Main.pref.putDouble(prefDist, getDistance());
+		Main.pref.putDouble(prefArea, getArea());
+		if (prefNear != null) {
+		    Main.pref.putInteger(prefNear, getNear());
+		}
+    }
+    
+    /**
+     * Adds a change listener to comboboxes
+     * @param listener The listener that will be notified of each combobox change
+     */
+    protected final void addChangeListener(ChangeListener listener) {
+    	cbDownloadGpxData.addChangeListener(listener);
+    	cbDownloadOsmData.addChangeListener(listener);
+    }
+
+    /**
+     * Show this panel in a new "Download along" help-aware dialog
+     * @param title The dialog title
+     * @param helpTopic The dialog help topic
+     * @return The selected button index (0 for download, 1 for cancel, 2 for dialog closure)
+     */
+    public int showInDownloadDialog(String title, String helpTopic) {
+        final ButtonSpec[] options = new ButtonSpec[] {
+                new ButtonSpec(
+                        tr("Download"),
+                        ImageProvider.get("download"),
+                        tr("Click to download"),
+                        null // no specific help text
+                ),
+                new ButtonSpec(
+                        tr("Cancel"),
+                        ImageProvider.get("cancel"),
+                        tr("Click to cancel"),
+                        null // no specific help text
+                )
+        };
+        
+        addChangeListener(new ChangeListener() {
+            @Override public void stateChanged(ChangeEvent e) {
+                options[0].setEnabled(isDownloadOsmData() || isDownloadGpxData());
+            }
+        });
+
+        int ret = HelpAwareOptionPane.showOptionDialog(Main.parent, this, title,
+                JOptionPane.QUESTION_MESSAGE, null, options, options[0], helpTopic);
+        if (0 == ret) {
+            rememberSettings();
+        }
+
+        return ret;
+    }
+}
Index: /trunk/src/org/openstreetmap/josm/gui/layer/gpx/DownloadAlongTrackAction.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/layer/gpx/DownloadAlongTrackAction.java	(revision 6053)
+++ /trunk/src/org/openstreetmap/josm/gui/layer/gpx/DownloadAlongTrackAction.java	(revision 6054)
@@ -4,21 +4,10 @@
 import static org.openstreetmap.josm.tools.I18n.tr;
 
-import java.awt.GridBagLayout;
 import java.awt.event.ActionEvent;
 import java.awt.geom.Area;
 import java.awt.geom.Rectangle2D;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-import java.util.concurrent.Future;
-
-import javax.swing.AbstractAction;
-import javax.swing.JLabel;
-import javax.swing.JList;
-import javax.swing.JOptionPane;
-import javax.swing.JPanel;
 
 import org.openstreetmap.josm.Main;
-import org.openstreetmap.josm.actions.downloadtasks.DownloadTaskList;
+import org.openstreetmap.josm.actions.DownloadAlongAction;
 import org.openstreetmap.josm.data.coor.LatLon;
 import org.openstreetmap.josm.data.gpx.GpxData;
@@ -27,9 +16,6 @@
 import org.openstreetmap.josm.data.gpx.WayPoint;
 import org.openstreetmap.josm.gui.PleaseWaitRunnable;
+import org.openstreetmap.josm.gui.help.HelpUtil;
 import org.openstreetmap.josm.gui.progress.NullProgressMonitor;
-import org.openstreetmap.josm.gui.progress.PleaseWaitProgressMonitor;
-import org.openstreetmap.josm.gui.progress.ProgressMonitor;
-import org.openstreetmap.josm.tools.GBC;
-import org.openstreetmap.josm.tools.ImageProvider;
 
 /**
@@ -38,21 +24,25 @@
  * @author fred
  */
-public class DownloadAlongTrackAction extends AbstractAction {
+public class DownloadAlongTrackAction extends DownloadAlongAction {
+    
     static final int NEAR_TRACK = 0;
     static final int NEAR_WAYPOINTS = 1;
     static final int NEAR_BOTH = 2;
-    
-    private static final String PREF_DOWNLOAD_ALONG_TRACK_DISTANCE = "gpxLayer.downloadAlongTrack.distance";
-    private static final String PREF_DOWNLOAD_ALONG_TRACK_AREA = "gpxLayer.downloadAlongTrack.area";
-    private static final String PREF_DOWNLOAD_ALONG_TRACK_NEAR = "gpxLayer.downloadAlongTrack.near";
 
-    
-    private final Integer[] dist = {5000, 500, 50};
-    private final Integer[] area = {20, 10, 5, 1};
+    private static final String PREF_DOWNLOAD_ALONG_TRACK_OSM = "downloadAlongTrack.download.osm";
+    private static final String PREF_DOWNLOAD_ALONG_TRACK_GPS = "downloadAlongTrack.download.gps";
+
+    private static final String PREF_DOWNLOAD_ALONG_TRACK_DISTANCE = "downloadAlongTrack.distance";
+    private static final String PREF_DOWNLOAD_ALONG_TRACK_AREA = "downloadAlongTrack.area";
+    private static final String PREF_DOWNLOAD_ALONG_TRACK_NEAR = "downloadAlongTrack.near";
     
     private final GpxData data;
 
+    /**
+     * Constructs a new {@code DownloadAlongTrackAction}
+     * @param data The GPX data used to download along
+     */
     public DownloadAlongTrackAction(GpxData data) {
-        super(tr("Download from OSM along this track"), ImageProvider.get("downloadalongtrack"));
+        super(tr("Download from OSM along this track"), "downloadalongtrack", null, null, true);
         this.data = data;
     }
@@ -60,40 +50,15 @@
     @Override
     public void actionPerformed(ActionEvent e) {
-        /*
-         * build selection dialog
-         */
-        JPanel msg = new JPanel(new GridBagLayout());
-        msg.add(new JLabel(tr("Download everything within:")), GBC.eol());
-        String[] s = new String[dist.length];
-        for (int i = 0; i < dist.length; ++i) {
-            s[i] = tr("{0} meters", dist[i]);
+        
+        final DownloadAlongPanel panel = new DownloadAlongPanel(
+                PREF_DOWNLOAD_ALONG_TRACK_OSM, PREF_DOWNLOAD_ALONG_TRACK_GPS,
+                PREF_DOWNLOAD_ALONG_TRACK_DISTANCE, PREF_DOWNLOAD_ALONG_TRACK_AREA, PREF_DOWNLOAD_ALONG_TRACK_NEAR);
+
+        if (0 != panel.showInDownloadDialog(tr("Download from OSM along this track"), HelpUtil.ht("/Action/DownloadAlongTrack"))) {
+            return;
         }
-        JList buffer = new JList(s);
-        buffer.setSelectedIndex(Main.pref.getInteger(PREF_DOWNLOAD_ALONG_TRACK_DISTANCE, 0));
-        msg.add(buffer, GBC.eol());
-        msg.add(new JLabel(tr("Maximum area per request:")), GBC.eol());
-        s = new String[area.length];
-        for (int i = 0; i < area.length; ++i) {
-            s[i] = tr("{0} sq km", area[i]);
-        }
-        JList maxRect = new JList(s);
-        maxRect.setSelectedIndex(Main.pref.getInteger(PREF_DOWNLOAD_ALONG_TRACK_AREA, 0));
-        msg.add(maxRect, GBC.eol());
-        msg.add(new JLabel(tr("Download near:")), GBC.eol());
-        JList downloadNear = new JList(new String[]{tr("track only"), tr("waypoints only"), tr("track and waypoints")});
-        downloadNear.setSelectedIndex(Main.pref.getInteger(PREF_DOWNLOAD_ALONG_TRACK_NEAR, 0));
-        msg.add(downloadNear, GBC.eol());
-        int ret = JOptionPane.showConfirmDialog(Main.parent, msg, tr("Download from OSM along this track"), JOptionPane.OK_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE);
-        switch (ret) {
-            case JOptionPane.CANCEL_OPTION:
-            case JOptionPane.CLOSED_OPTION:
-                return;
-            default:
-        // continue
-        }
-        Main.pref.putInteger(PREF_DOWNLOAD_ALONG_TRACK_DISTANCE, buffer.getSelectedIndex());
-        Main.pref.putInteger(PREF_DOWNLOAD_ALONG_TRACK_AREA, maxRect.getSelectedIndex());
-        final int near = downloadNear.getSelectedIndex();
-        Main.pref.putInteger(PREF_DOWNLOAD_ALONG_TRACK_NEAR, near);
+        
+        final int near = panel.getNear();
+
         /*
          * Find the average latitude for the data we're contemplating, so we can know how many
@@ -126,8 +91,6 @@
          * and then stop because it has more than 50k nodes.
          */
-        Integer i = buffer.getSelectedIndex();
-        final int buffer_dist = dist[i < 0 ? 0 : i];
-        i = maxRect.getSelectedIndex();
-        final double max_area = area[i < 0 ? 0 : i] / 10000.0 / scale;
+        final double buffer_dist = panel.getDistance();
+        final double max_area = panel.getArea() / 10000.0 / scale;
         final double buffer_y = buffer_dist / 100000.0;
         final double buffer_x = buffer_y / scale;
@@ -161,5 +124,6 @@
                     return;
                 }
-                confirmAndDownloadAreas(a, max_area, progressMonitor);
+                confirmAndDownloadAreas(a, max_area, panel.isDownloadOsmData(), panel.isDownloadGpxData(), 
+                        tr("Download from OSM along this track"), progressMonitor);
             }
 
@@ -223,85 +187,3 @@
         Main.worker.submit(new CalculateDownloadArea());
     }
-
-    /**
-     * Area "a" contains the hull that we would like to download data for. however we
-     * can only download rectangles, so the following is an attempt at finding a number of
-     * rectangles to download.
-     *
-     * The idea is simply: Start out with the full bounding box. If it is too large, then
-     * split it in half and repeat recursively for each half until you arrive at something
-     * small enough to download. The algorithm is improved by always using the intersection
-     * between the rectangle and the actual desired area. For example, if you have a track
-     * that goes like this: +----+ | /| | / | | / | |/ | +----+ then we would first look at
-     * downloading the whole rectangle (assume it's too big), after that we split it in half
-     * (upper and lower half), but we donot request the full upper and lower rectangle, only
-     * the part of the upper/lower rectangle that actually has something in it.
-     *
-     * This functions calculates the rectangles, asks the user to continue and downloads
-     * the areas if applicable.
-     */
-    private void confirmAndDownloadAreas(Area a, double max_area, ProgressMonitor progressMonitor) {
-        List<Rectangle2D> toDownload = new ArrayList<Rectangle2D>();
-        addToDownload(a, a.getBounds(), toDownload, max_area);
-        if (toDownload.isEmpty()) {
-            return;
-        }
-        JPanel msg = new JPanel(new GridBagLayout());
-        msg.add(new JLabel(tr("<html>This action will require {0} individual<br>" + "download requests. Do you wish<br>to continue?</html>", toDownload.size())), GBC.eol());
-        if (toDownload.size() > 1) {
-            int ret = JOptionPane.showConfirmDialog(Main.parent, msg, tr("Download from OSM along this track"), JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE);
-            switch (ret) {
-                case JOptionPane.CANCEL_OPTION:
-                case JOptionPane.CLOSED_OPTION:
-                    return;
-                default:
-            // continue
-            }
-        }
-        final PleaseWaitProgressMonitor monitor = new PleaseWaitProgressMonitor(tr("Download data"));
-        final Future<?> future = new DownloadTaskList().download(false, toDownload, true, false, monitor);
-        Main.worker.submit(new Runnable() {
-            @Override
-            public void run() {
-                try {
-                    future.get();
-                } catch (Exception e) {
-                    e.printStackTrace();
-                    return;
-                }
-                monitor.close();
-            }
-        });
-    }
-    
-     private static void addToDownload(Area a, Rectangle2D r, Collection<Rectangle2D> results, double max_area) {
-        Area tmp = new Area(r);
-        // intersect with sought-after area
-        tmp.intersect(a);
-        if (tmp.isEmpty()) {
-             return;
-         }
-        Rectangle2D bounds = tmp.getBounds2D();
-        if (bounds.getWidth() * bounds.getHeight() > max_area) {
-            // the rectangle gets too large; split it and make recursive call.
-            Rectangle2D r1;
-            Rectangle2D r2;
-            if (bounds.getWidth() > bounds.getHeight()) {
-                // rectangles that are wider than high are split into a left and right half,
-                r1 = new Rectangle2D.Double(bounds.getX(), bounds.getY(), bounds.getWidth() / 2, bounds.getHeight());
-                r2 = new Rectangle2D.Double(bounds.getX() + bounds.getWidth() / 2, bounds.getY(),
-                        bounds.getWidth() / 2, bounds.getHeight());
-            } else {
-                // others into a top and bottom half.
-                r1 = new Rectangle2D.Double(bounds.getX(), bounds.getY(), bounds.getWidth(), bounds.getHeight() / 2);
-                r2 = new Rectangle2D.Double(bounds.getX(), bounds.getY() + bounds.getHeight() / 2, bounds.getWidth(),
-                        bounds.getHeight() / 2);
-            }
-            addToDownload(a, r1, results, max_area);
-            addToDownload(a, r2, results, max_area);
-        } else {
-            results.add(bounds);
-        }
-    }
-    
 }
