Index: /trunk/src/org/openstreetmap/josm/Main.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/Main.java	(revision 5356)
+++ /trunk/src/org/openstreetmap/josm/Main.java	(revision 5357)
@@ -96,5 +96,5 @@
      * it only shows the MOTD panel.
      *
-     * @return true if JOSM currently displays a map view
+     * @return <code>true</code> if JOSM currently displays a map view
      */
     static public boolean isDisplayingMapView() {
@@ -133,5 +133,5 @@
     public static MapFrame map;
     /**
-     * True, when in applet mode
+     * Set to <code>true</code>, when in applet mode
      */
     public static boolean applet = false;
@@ -376,7 +376,7 @@
 
     /**
-     * Replies true if there is an edit layer
+     * Replies <code>true</code> if there is an edit layer
      *
-     * @return true if there is an edit layer
+     * @return <code>true</code> if there is an edit layer
      */
     public boolean hasEditLayer() {
@@ -388,5 +388,5 @@
      * Replies the current edit layer
      *
-     * @return the current edit layer. null, if no current edit layer exists
+     * @return the current edit layer. <code>null</code>, if no current edit layer exists
      */
     public OsmDataLayer getEditLayer() {
@@ -399,5 +399,5 @@
      * Replies the current data set.
      *
-     * @return the current data set. null, if no current data set exists
+     * @return the current data set. <code>null</code>, if no current data set exists
      */
     public DataSet getCurrentDataSet() {
@@ -409,5 +409,5 @@
      * Returns the currently active  layer
      *
-     * @return the currently active layer. null, if currently no active layer exists
+     * @return the currently active layer. <code>null</code>, if currently no active layer exists
      */
     public Layer getActiveLayer() {
@@ -807,5 +807,5 @@
      * Replies the current projection.
      *
-     * @return
+     * @return the currently active projection
      */
     public static Projection getProjection() {
@@ -859,5 +859,5 @@
      * Register a projection change listener
      *
-     * @param listener the listener. Ignored if null.
+     * @param listener the listener. Ignored if <code>null</code>.
      */
     public static void addProjectionChangeListener(ProjectionChangeListener listener) {
@@ -875,5 +875,5 @@
      * Removes a projection change listener
      *
-     * @param listener the listener. Ignored if null.
+     * @param listener the listener. Ignored if <code>null</code>.
      */
     public static void removeProjectionChangeListener(ProjectionChangeListener listener) {
Index: /trunk/src/org/openstreetmap/josm/gui/bbox/SlippyMapBBoxChooser.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/bbox/SlippyMapBBoxChooser.java	(revision 5356)
+++ /trunk/src/org/openstreetmap/josm/gui/bbox/SlippyMapBBoxChooser.java	(revision 5357)
@@ -184,4 +184,5 @@
     public SlippyMapBBoxChooser() {
         super();
+        TMSLayer.setMaxWorkers();
         cachedLoader = null;
         String cachePath = TMSLayer.PROP_TILECACHE_DIR.get();
Index: /trunk/src/org/openstreetmap/josm/gui/layer/TMSLayer.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/layer/TMSLayer.java	(revision 5356)
+++ /trunk/src/org/openstreetmap/josm/gui/layer/TMSLayer.java	(revision 5357)
@@ -105,4 +105,5 @@
     //public static final BooleanProperty PROP_DRAW_DEBUG = new BooleanProperty(PREFERENCE_PREFIX + ".draw_debug", false);
     public static final BooleanProperty PROP_ADD_TO_SLIPPYMAP_CHOOSER = new BooleanProperty(PREFERENCE_PREFIX + ".add_to_slippymap_chooser", true);
+    public static final IntegerProperty PROP_TMS_JOBS = new IntegerProperty("tmsloader.maxjobs", 25);
     public static final StringProperty PROP_TILECACHE_DIR;
 
@@ -121,5 +122,4 @@
     protected TileSource tileSource;
     protected OsmTileLoader tileLoader;
-    JobDispatcher jobDispatcher = JobDispatcher.getInstance();
 
     HashSet<Tile> tileRequestsOutstanding = new HashSet<Tile>();
@@ -441,8 +441,18 @@
     }
 
+    /**
+     * Function to set the maximum number of workers for tile loading to the value defined
+     * in preferences.
+     */
+    static public void setMaxWorkers() {
+        JobDispatcher.getInstance().setMaxWorkers(PROP_TMS_JOBS.get());
+        JobDispatcher.getInstance().setLIFO(true);
+    }
+
     @SuppressWarnings("serial")
     public TMSLayer(ImageryInfo info) {
         super(info);
 
+        setMaxWorkers();
         if(!isProjectionSupported(Main.getProjection())) {
             JOptionPane.showMessageDialog(Main.parent,
@@ -650,5 +660,5 @@
         }*/
         needRedraw = true;
-        jobDispatcher.cancelOutstandingJobs();
+        JobDispatcher.getInstance().cancelOutstandingJobs();
         tileRequestsOutstanding.clear();
     }
@@ -778,6 +788,5 @@
             return false;
         tileRequestsOutstanding.add(tile);
-        jobDispatcher.addJob(tileLoader.createTileLoaderJob(tileSource,
-                tile.getXtile(), tile.getYtile(), tile.getZoom()));
+        JobDispatcher.getInstance().addJob(tileLoader.createTileLoaderJob(tile));
         return true;
     }
