Index: /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastrePlugin.java
===================================================================
--- /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastrePlugin.java	(revision 25044)
+++ /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastrePlugin.java	(revision 25045)
@@ -124,6 +124,4 @@
     static JMenu cadastreJMenu;
 
-    public static CadastreGrabber cadastreGrabber = new CadastreGrabber();
-
     public static String source = "";
 
Index: /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/DownloadSVGBuilding.java
===================================================================
--- /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/DownloadSVGBuilding.java	(revision 25044)
+++ /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/DownloadSVGBuilding.java	(revision 25045)
@@ -37,5 +37,4 @@
 
     private WMSLayer wmsLayer;
-    private CadastreGrabber grabber = CadastrePlugin.cadastreGrabber;
     private CadastreInterface wmsInterface;
     private String svg = null;
@@ -49,5 +48,5 @@
 
         this.wmsLayer = wmsLayer;
-        this.wmsInterface = grabber.getWmsInterface();
+        this.wmsInterface = wmsLayer.grabber.getWmsInterface();
     }
 
@@ -70,5 +69,5 @@
         } catch (WMSException e) {
             errorMessage = e.getMessage();
-            grabber.getWmsInterface().resetCookie();
+            wmsLayer.grabber.getWmsInterface().resetCookie();
         }
     }
@@ -76,5 +75,5 @@
     @Override
     protected void cancel() {
-        grabber.getWmsInterface().cancel();
+        wmsLayer.grabber.getWmsInterface().cancel();
     }
 
Index: /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/DownloadSVGTask.java
===================================================================
--- /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/DownloadSVGTask.java	(revision 25044)
+++ /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/DownloadSVGTask.java	(revision 25045)
@@ -42,5 +42,4 @@
 
     private WMSLayer wmsLayer;
-    private CadastreGrabber grabber = CadastrePlugin.cadastreGrabber;
     private CadastreInterface wmsInterface;
     private String svg = null;
@@ -52,5 +51,5 @@
 
         this.wmsLayer = wmsLayer;
-        this.wmsInterface = grabber.getWmsInterface();
+        this.wmsInterface = wmsLayer.grabber.getWmsInterface();
     }
 
@@ -75,5 +74,5 @@
         } catch (WMSException e) {
             errorMessage = e.getMessage();
-            grabber.getWmsInterface().resetCookie();
+            wmsLayer.grabber.getWmsInterface().resetCookie();
         }
     }
@@ -81,5 +80,5 @@
     @Override
     protected void cancel() {
-        grabber.getWmsInterface().cancel();
+        wmsLayer.grabber.getWmsInterface().cancel();
     }
 
Index: /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/DownloadWMSPlanImage.java
===================================================================
--- /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/DownloadWMSPlanImage.java	(revision 25044)
+++ /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/DownloadWMSPlanImage.java	(revision 25045)
@@ -24,5 +24,4 @@
     
     private class Task extends PleaseWaitRunnable {
-        private CadastreGrabber grabber = CadastrePlugin.cadastreGrabber;
         public Task(WMSLayer wmsLayer, Bounds bounds) {
             super(tr("Downloading {0}", wmsLayer.getName()));
@@ -34,5 +33,5 @@
             errorMessage = null;
             try {
-                if (grabber.getWmsInterface().retrieveInterface(wmsLayer)) {
+                if (wmsLayer.grabber.getWmsInterface().retrieveInterface(wmsLayer)) {
                     if (!wmsLayer.getImages().isEmpty()) {
                         //JOptionPane.showMessageDialog(Main.parent,tr("Image already loaded"));
@@ -46,5 +45,5 @@
                         // till here
                         dontGeoreference = true;
-                    } else if (grabber.getWmsInterface().downloadCancelled){
+                    } else if (wmsLayer.grabber.getWmsInterface().downloadCancelled){
                         // do nothing
                     } else {
@@ -59,9 +58,9 @@
                         if (wmsLayer.isRaster()) {
                             // set raster image commune bounding box based on current view (before adjustment)
-                            grabber.getWmsInterface().retrieveCommuneBBox(wmsLayer);
+                            wmsLayer.grabber.getWmsInterface().retrieveCommuneBBox(wmsLayer);
                             wmsLayer.setRasterBounds(bounds);
                             // grab new images from wms server into active layer
-                            wmsLayer.grab(grabber, bounds);
-                            if (grabber.getWmsInterface().downloadCancelled) {
+                            wmsLayer.grab(bounds);
+                            if (wmsLayer.grabber.getWmsInterface().downloadCancelled) {
                                 wmsLayer.clearImages();
                                 Main.map.mapView.repaint();
@@ -89,5 +88,5 @@
             } catch (WMSException e) {
                 errorMessage = e.getMessage();
-                grabber.getWmsInterface().resetCookie();
+                wmsLayer.grabber.getWmsInterface().resetCookie();
             }
         }
@@ -95,5 +94,5 @@
         @Override
         protected void cancel() {
-            grabber.getWmsInterface().cancel();
+            wmsLayer.grabber.getWmsInterface().cancel();
             dontGeoreference = true;
         }
Index: /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/DownloadWMSVectorImage.java
===================================================================
--- /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/DownloadWMSVectorImage.java	(revision 25044)
+++ /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/DownloadWMSVectorImage.java	(revision 25045)
@@ -17,5 +17,4 @@
     private WMSLayer wmsLayer;
     private Bounds bounds;
-    private CadastreGrabber grabber = CadastrePlugin.cadastreGrabber;
     private static String errorMessage;
 
@@ -32,5 +31,5 @@
         errorMessage = null;
         try {
-            if (grabber.getWmsInterface().retrieveInterface(wmsLayer)) {
+            if (wmsLayer.grabber.getWmsInterface().retrieveInterface(wmsLayer)) {
                 if (wmsLayer.getImages().isEmpty()) {
                     // first time we grab an image for this layer
@@ -50,9 +49,9 @@
                     } else {
                         // set vectorized commune bounding box by opening the standard web window
-                        grabber.getWmsInterface().retrieveCommuneBBox(wmsLayer);
+                        wmsLayer.grabber.getWmsInterface().retrieveCommuneBBox(wmsLayer);
                     }
                 }
                 // grab new images from wms server into active layer
-                wmsLayer.grab(grabber, bounds);
+                wmsLayer.grab(bounds);
             }
         } catch (DuplicateLayerException e) {
@@ -61,5 +60,5 @@
         } catch (WMSException e) {
             errorMessage = e.getMessage();
-            grabber.getWmsInterface().resetCookie();
+            wmsLayer.grabber.getWmsInterface().resetCookie();
         }
     }
@@ -67,5 +66,5 @@
     @Override
     protected void cancel() {
-        grabber.getWmsInterface().cancel();
+        wmsLayer.grabber.getWmsInterface().cancel();
         if (wmsLayer != null)
             wmsLayer.grabThread.setCancelled(true);
Index: /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/GrabThread.java
===================================================================
--- /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/GrabThread.java	(revision 25044)
+++ /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/GrabThread.java	(revision 25045)
@@ -1,2 +1,3 @@
+// License: GPL. v2 and later. Copyright 2008-2009 by Pieren <pieren3@gmail.com> and others
 package cadastre_fr;
 
Index: /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionNewLocation.java
===================================================================
--- /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionNewLocation.java	(revision 25044)
+++ /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionNewLocation.java	(revision 25045)
@@ -65,5 +65,4 @@
         String codeDepartement = "";
         String codeCommune = "";
-        boolean changeInterface = false;
         JLabel labelSectionNewLocation = new JLabel(tr("Add a new municipality layer"));
         JPanel p = new JPanel(new GridBagLayout());
@@ -105,5 +104,4 @@
             location = inputTown.getText().toUpperCase();
             codeDepartement = departements[inputDepartement.getSelectedIndex()*2];
-            changeInterface = true;
             Main.pref.put("cadastrewms.location", location);
             Main.pref.put("cadastrewms.codeCommune", codeCommune);
@@ -130,9 +128,6 @@
         } else if (existingLayers != null && existingLayers.size() > 0 && Main.map.mapView.getActiveLayer() instanceof WMSLayer) {
             wmsLayer = (WMSLayer)Main.map.mapView.getActiveLayer();
-            changeInterface = true;
         }
 
-        if (changeInterface)
-            CadastrePlugin.cadastreGrabber.getWmsInterface().resetInterfaceRefIfNewLayer(wmsLayer.getName());
         return wmsLayer;
     }
Index: /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionResetCookie.java
===================================================================
--- /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionResetCookie.java	(revision 25044)
+++ /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionResetCookie.java	(revision 25045)
@@ -20,5 +20,5 @@
 
     public void actionPerformed(ActionEvent e) {
-        CadastrePlugin.cadastreGrabber.getWmsInterface().resetCookie();
+        //CadastrePlugin.cadastreGrabber.getWmsInterface().resetCookie();
     }
 }
Index: /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/WMSLayer.java
===================================================================
--- /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/WMSLayer.java	(revision 25044)
+++ /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/WMSLayer.java	(revision 25045)
@@ -46,4 +46,6 @@
     private int lambertZone = -1;
 
+    public CadastreGrabber grabber = new CadastreGrabber();
+
     protected static final Icon icon = new ImageIcon(Toolkit.getDefaultToolkit().createImage(
             CadastrePlugin.class.getResource("/images/cadastre_small.png")));
@@ -126,5 +128,5 @@
     }
 
-    public void grab(CadastreGrabber grabber, Bounds b) throws IOException {
+    public void grab(Bounds b) throws IOException {
         grabThread.setCancelled(false);
         grabThread.setGrabber(grabber);
