Index: applications/editors/josm/plugins/slippymap/src/org/openstreetmap/josm/plugins/slippymap/SlippyMapLayer.java
===================================================================
--- applications/editors/josm/plugins/slippymap/src/org/openstreetmap/josm/plugins/slippymap/SlippyMapLayer.java	(revision 18590)
+++ applications/editors/josm/plugins/slippymap/src/org/openstreetmap/josm/plugins/slippymap/SlippyMapLayer.java	(revision 18593)
@@ -5,6 +5,6 @@
 import java.awt.Color;
 import java.awt.Component;
-import java.awt.Dimension;
 import java.awt.Graphics;
+import java.awt.Graphics2D;
 import java.awt.Image;
 import java.awt.Point;
@@ -16,21 +16,27 @@
 import java.awt.image.ImageObserver;
 import java.util.ArrayList;
-import java.util.Comparator;
-import java.util.Enumeration;
-import java.util.Hashtable;
+import java.util.HashSet;
+import java.util.LinkedList;
 import java.util.List;
-import java.util.LinkedList;
-import java.util.HashSet;
 
 import javax.swing.AbstractAction;
 import javax.swing.Icon;
+import javax.swing.JCheckBoxMenuItem;
 import javax.swing.JMenuItem;
-import javax.swing.JCheckBoxMenuItem;
 import javax.swing.JPopupMenu;
 import javax.swing.JSeparator;
 import javax.swing.SwingUtilities;
 
+import org.openstreetmap.gui.jmapviewer.JobDispatcher;
+import org.openstreetmap.gui.jmapviewer.MemoryTileCache;
+import org.openstreetmap.gui.jmapviewer.OsmFileCacheTileLoader;
+import org.openstreetmap.gui.jmapviewer.Tile;
+import org.openstreetmap.gui.jmapviewer.interfaces.TileCache;
+import org.openstreetmap.gui.jmapviewer.interfaces.TileLoader;
+import org.openstreetmap.gui.jmapviewer.interfaces.TileLoaderListener;
+import org.openstreetmap.gui.jmapviewer.interfaces.TileSource;
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.actions.RenameLayerAction;
+import org.openstreetmap.josm.data.Bounds;
 import org.openstreetmap.josm.data.Preferences.PreferenceChangedListener;
 import org.openstreetmap.josm.data.coor.LatLon;
@@ -41,8 +47,4 @@
 import org.openstreetmap.josm.gui.layer.Layer;
 import org.openstreetmap.josm.tools.ImageProvider;
-
-import org.openstreetmap.gui.jmapviewer.*;
-import org.openstreetmap.gui.jmapviewer.interfaces.*;
-import org.openstreetmap.gui.jmapviewer.Tile;
 
 /**
@@ -501,5 +503,5 @@
         //int otherZooms[] = {-5, -4, -3, 2, -2, 1, -1};
         int otherZooms[] = { -1, 1, -2, 2, -3, -4, -5};
-        int painted = 0;;
+        int painted = 0;
         debug = true;
         for (int zoomOff : otherZooms) {
@@ -604,5 +606,5 @@
     // The "border" tile tells us the boundaries of where we may
     // draw.  It will not be from the zoom level that is being
-    // drawn currently.  If drawing the currentZoomLevel, 
+    // drawn currently.  If drawing the currentZoomLevel,
     // border is null and we draw the entire tile set.
     List<Tile> paintTileImages(Graphics g, TileSet ts, int zoom, Tile border) {
@@ -616,5 +618,5 @@
             if (img == null) {
                 if (debug)
-                    out("missed tile: " + tile); 
+                    out("missed tile: " + tile);
                 missedTiles.add(tile);
                 continue;
@@ -808,9 +810,9 @@
      */
     @Override
-    public void paint(Graphics g, MapView mv) {
-        long start = System.currentTimeMillis();
+    public void paint(Graphics2D g, MapView mv, Bounds bounds) {
+        //long start = System.currentTimeMillis();
         LatLon topLeft = mv.getLatLon(0, 0);
         LatLon botRight = mv.getLatLon(mv.getWidth(), mv.getHeight());
-        Graphics oldg = g;
+        Graphics2D oldg = g;
 
         if (botRight.lon() == 0.0 || botRight.lat() == 0) {
@@ -834,5 +836,5 @@
         lastBotRight = botRight;
         bufferImage = mv.createImage(mv.getWidth(), mv.getHeight());
-        g = bufferImage.getGraphics();
+        g = (Graphics2D) bufferImage.getGraphics();
 
         int zoom = currentZoomLevel;
@@ -844,5 +846,5 @@
                     out("too many tiles, decreasing zoom from " + currentZoomLevel);
                 if (decreaseZoomLevel())
-                    this.paint(oldg, mv);
+                    this.paint(oldg, mv, bounds);
                 return;
             }
@@ -852,5 +854,5 @@
                         + "), increasing zoom from " + currentZoomLevel);
                 if (increaseZoomLevel())
-                     this.paint(oldg, mv);
+                     this.paint(oldg, mv, bounds);
                 return;
             }
@@ -899,5 +901,4 @@
             this.paintTileText(ts, t, g, mv, currentZoomLevel, t);
         }
-        float fadeBackground = SlippyMapPreferences.getFadeBackground();
         oldg.drawImage(bufferImage, 0, 0, null);
 
@@ -909,5 +910,5 @@
                     out("autozoom increase: scale: " + lastImageScale);
                 increaseZoomLevel();
-                this.paint(oldg, mv);
+                this.paint(oldg, mv, bounds);
             // If each source image pixel is being squished into > 0.32
             // of a drawn pixels, zoom out.
@@ -916,5 +917,5 @@
                     out("autozoom decrease: scale: " + lastImageScale);
                 decreaseZoomLevel();
-                this.paint(oldg, mv);
+                this.paint(oldg, mv, bounds);
             }
         }
