Index: trunk/src/org/openstreetmap/josm/gui/bbox/SlippyMapBBoxChooser.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/bbox/SlippyMapBBoxChooser.java	(revision 12926)
+++ trunk/src/org/openstreetmap/josm/gui/bbox/SlippyMapBBoxChooser.java	(revision 12927)
@@ -7,6 +7,9 @@
 import java.awt.Dimension;
 import java.awt.Graphics;
+import java.awt.Graphics2D;
 import java.awt.Point;
 import java.awt.Rectangle;
+import java.awt.geom.Area;
+import java.awt.geom.Path2D;
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -42,5 +45,8 @@
 import org.openstreetmap.josm.data.osm.BBox;
 import org.openstreetmap.josm.data.preferences.StringProperty;
+import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.gui.layer.AbstractCachedTileSourceLayer;
+import org.openstreetmap.josm.gui.layer.MainLayerManager;
+import org.openstreetmap.josm.gui.layer.OsmDataLayer;
 import org.openstreetmap.josm.gui.layer.TMSLayer;
 import org.openstreetmap.josm.spi.preferences.Config;
@@ -50,5 +56,5 @@
  * This panel displays a map and lets the user chose a {@link BBox}.
  */
-public class SlippyMapBBoxChooser extends JMapViewer implements BBoxChooser {
+public class SlippyMapBBoxChooser extends JMapViewer implements BBoxChooser, MainLayerManager.ActiveLayerChangeListener {
 
     /**
@@ -190,4 +196,6 @@
         }
 
+        MainApplication.getLayerManager().addActiveLayerChangeListener(this);
+
         new SlippyMapControler(this, this);
     }
@@ -215,6 +223,36 @@
      */
     @Override
-    public void paint(Graphics g) {
-        super.paint(g);
+    public void paintComponent(Graphics g) {
+        super.paintComponent(g);
+        Graphics2D g2d = (Graphics2D)g;
+
+        // draw shaded area for non-downloaded region of current "edit layer", but only if there *is* a current "edit layer",
+        // and it has defined bounds. Routine is analogous to that in OsmDataLayer's paint routine (but just different
+        // enough to make sharing code impractical)
+        final OsmDataLayer editLayer = MainApplication.getLayerManager().getEditLayer();
+        if (editLayer != null && Config.getPref().getBoolean("draw.data.downloaded_area", true) && !editLayer.data.getDataSources().isEmpty()) {
+            // initialize area with current viewport
+            Rectangle b = this.getBounds();
+            // ensure we comfortably cover full area
+            b.grow(100, 100);
+            Path2D p = new Path2D.Float();
+
+            // combine successively downloaded areas after converting to screen-space
+            for (Bounds bounds : editLayer.data.getDataSourceBounds()) {
+                if (bounds.isCollapsed()) {
+                    continue;
+                }
+                Rectangle r = new Rectangle(this.getMapPosition(bounds.getMinLat(), bounds.getMinLon(), false));
+                r.add(this.getMapPosition(bounds.getMaxLat(), bounds.getMaxLon(), false));
+                p.append(r, false);
+            }
+            // subtract combined areas
+            Area a = new Area(b);
+            a.subtract(new Area(p));
+
+            // paint remainder
+            g2d.setPaint(new Color(0, 0, 0, 32));
+            g2d.fill(a);
+        }
 
         // draw selection rectangle
@@ -229,4 +267,9 @@
             g.drawRect(box.x, box.y, box.width, box.height);
         }
+    }
+
+    @Override
+    public void activeOrEditLayerChanged(MainLayerManager.ActiveLayerChangeEvent e) {
+        this.repaint();
     }
 
