Index: /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/Address.java
===================================================================
--- /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/Address.java	(revision 30858)
+++ /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/Address.java	(revision 30859)
@@ -43,4 +43,5 @@
 
 import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.actions.mapmode.MapMode;
 import org.openstreetmap.josm.command.AddCommand;
 import org.openstreetmap.josm.command.ChangeCommand;
@@ -48,5 +49,4 @@
 import org.openstreetmap.josm.command.Command;
 import org.openstreetmap.josm.command.SequenceCommand;
-import org.openstreetmap.josm.actions.mapmode.MapMode;
 import org.openstreetmap.josm.data.coor.EastNorth;
 import org.openstreetmap.josm.data.osm.Node;
@@ -65,5 +65,5 @@
 public class Address extends MapMode implements MouseListener, MouseMotionListener, ActionListener {
     private static final long serialVersionUID = 1L;
-    
+
     // perhaps make all these tags configurable in the future
     private String tagHighway = "highway";
@@ -76,5 +76,5 @@
     private String relationAddrStreetRole = "street";
     private String relationMemberHouse = "house";
-    
+
     private JRadioButton plus_one = new JRadioButton("+1", false);
     private JRadioButton plus_two = new JRadioButton("+2", true); // enable this by default
@@ -93,5 +93,5 @@
 
     public Address(MapFrame mapFrame) {
-        super(tr("Add address"), "buildings", 
+        super(tr("Add address"), "buildings",
                 tr("Helping tool for tag address"),
                 Shortcut.registerShortcut("mapmode:cadastre-fr-buildings", tr("Mode: {0}", tr("CadastreFR - Buildings")), KeyEvent.VK_E, Shortcut.DIRECT),
@@ -153,9 +153,9 @@
                     try {
                         // add new address
-                        Integer.parseInt(num); 
+                        Integer.parseInt(num);
                         inputNumber.setText(num);
                         applyInputNumberChange();
                     } catch (NumberFormatException en) {
-                        System.out.println("Unable to parse house number \"" + num + "\"");
+                        Main.warn("Unable to parse house number \"" + num + "\"");
                     }
                 }
@@ -202,5 +202,5 @@
                 setNewSelection(mouseOnExistingWays.get(0));
             } else if (mouseOnExistingWays.size() == 0) {
-                // clicked a non highway and not a node => add the new address 
+                // clicked a non highway and not a node => add the new address
                 if (inputStreet.getText().equals("") || inputNumber.getText().equals("")) {
                     Toolkit.getDefaultToolkit().beep();
@@ -221,5 +221,5 @@
 
     }
-    
+
     private Way findWayInRelationAddr(Node n) {
         List<OsmPrimitive> l = n.getReferrers();
@@ -238,5 +238,5 @@
         return null;
     }
-    
+
     private void addAddrToPolygon(List<Way> mouseOnExistingBuildingWays, Collection<Command> cmds) {
         for (Way w:mouseOnExistingBuildingWays) {
@@ -244,5 +244,5 @@
         }
     }
-    
+
     private void addAddrToPrimitive(OsmPrimitive osm, Collection<Command> cmds) {
         // add the current tag addr:housenumber in node and member in relation (if so configured)
@@ -251,5 +251,5 @@
                 revertInputNumberChange();
             } catch (NumberFormatException en) {
-                System.out.println("Unable to parse house number \"" + inputNumber.getText() + "\"");
+            	Main.warn("Unable to parse house number \"" + inputNumber.getText() + "\"");
             }
 
@@ -263,8 +263,8 @@
             setNewSelection(osm);
         } catch (NumberFormatException en) {
-            System.out.println("Unable to parse house number \"" + inputNumber.getText() + "\"");
-        }
-    }
-    
+        	Main.warn("Unable to parse house number \"" + inputNumber.getText() + "\"");
+        }
+    }
+
     private Relation findRelationAddr(Way w) {
         List<OsmPrimitive> l = w.getReferrers();
@@ -276,5 +276,5 @@
         return null;
     }
-    
+
     private void addStreetNameOrRelation(OsmPrimitive osm, Collection<Command> cmds) {
         if (Main.pref.getBoolean("cadastrewms.addr.dontUseRelation", false)) {
@@ -339,5 +339,5 @@
         return n;
     }
-    
+
     private static void adjustNode(Collection<Pair<Node,Node>> segs, Node n) {
 
@@ -395,5 +395,5 @@
         }
     }
-    
+
     static double det(double a, double b, double c, double d) {
         return a * d - b * c;
@@ -422,5 +422,5 @@
         return Cursor.getPredefinedCursor(Cursor.CROSSHAIR_CURSOR);
     }
-    
+
     private void applyInputNumberChange() {
         Integer num = Integer.parseInt(inputNumber.getText());
@@ -435,5 +435,5 @@
         inputNumber.setText(num.toString());
     }
-    
+
     private void revertInputNumberChange() {
         Integer num = Integer.parseInt(inputNumber.getText());
@@ -448,5 +448,5 @@
         inputNumber.setText(num.toString());
     }
-    
+
     private void createDialog() {
         ImageIcon iconLink = ImageProvider.get(null, "Mf_relation.png");
@@ -466,5 +466,6 @@
         clearButton = new JButton("Clear");
         clearButton.addActionListener(new ActionListener() {
-            public void actionPerformed(ActionEvent e) {
+            @Override
+			public void actionPerformed(ActionEvent e) {
                 inputNumber.setText("");
                 inputStreet.setText("");
@@ -491,5 +492,5 @@
         p.add(plus_two, GBC.std().insets(0, 0, 10, 0));
         p.add(clearButton, GBC.eol().fill(GBC.HORIZONTAL).insets(0, 0, 0, 0));
-    
+
         final Object[] options = {};
         final JOptionPane pane = new JOptionPane(p,
@@ -516,10 +517,16 @@
                 Main.map.selectMapMode((MapMode)Main.map.getDefaultButtonAction());
             }
-            public void windowClosed(WindowEvent e) {}
-            public void windowActivated(WindowEvent arg0) {}
-            public void windowDeactivated(WindowEvent arg0) {}
-            public void windowDeiconified(WindowEvent arg0) {}
-            public void windowIconified(WindowEvent arg0) {}
-            public void windowOpened(WindowEvent arg0) {}
+            @Override
+			public void windowClosed(WindowEvent e) {}
+            @Override
+			public void windowActivated(WindowEvent arg0) {}
+            @Override
+			public void windowDeactivated(WindowEvent arg0) {}
+            @Override
+			public void windowDeiconified(WindowEvent arg0) {}
+            @Override
+			public void windowIconified(WindowEvent arg0) {}
+            @Override
+			public void windowOpened(WindowEvent arg0) {}
         });
         String bounds = Main.pref.get("cadastrewms.addr.bounds",null);
@@ -530,5 +537,5 @@
         }
 }
-    
+
     private void setSelectedWay(Way w) {
         this.selectedWay = w;
@@ -539,5 +546,5 @@
         link.repaint();
     }
-    
+
     private void setNewSelection(OsmPrimitive osm) {
         Collection<OsmPrimitive> newSelection = new LinkedList<>(Main.main.getCurrentDataSet().getSelected());
Index: /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CacheControl.java
===================================================================
--- /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CacheControl.java	(revision 30858)
+++ /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CacheControl.java	(revision 30859)
@@ -92,5 +92,5 @@
             }
             if (size > (long)cacheSize*1024*1024) {
-                System.out.println("Delete oldest file  \""+ files[oldestFile].getName()
+            	Main.info("Delete oldest file  \""+ files[oldestFile].getName()
                         + "\" in cache dir to stay under the limit of " + cacheSize + " MB.");
                 files[oldestFile].delete();
@@ -126,5 +126,5 @@
             }
         } catch (Exception e) {
-            e.printStackTrace(System.out);
+            Main.error(e);
         }
         return false;
@@ -135,10 +135,10 @@
             delete(new File(CadastrePlugin.cacheDir + wmsLayer.getName() + "." + WMSFileExtension()));
         } catch (Exception e) {
-            e.printStackTrace(System.out);
+        	Main.error(e);
         }
     }
 
     private void delete(File file) {
-        System.out.println("Delete file "+file);
+        Main.info("Delete file "+file);
         if (file.exists())
             file.delete();
@@ -155,5 +155,5 @@
             successfulRead = wmsLayer.read(file, ois, currentLambertZone);
         } catch (Exception ex) {
-            ex.printStackTrace(System.out);
+            Main.error(ex);
             JOptionPane.showMessageDialog(Main.parent, tr("Error loading file.\nProbably an old version of the cache file."), tr("Error"), JOptionPane.ERROR_MESSAGE);
             return false;
@@ -211,5 +211,5 @@
             }
             try {wait();} catch (InterruptedException e) {
-                e.printStackTrace(System.out);
+                Main.error(e);
             }
         }
Index: /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastreGrabber.java
===================================================================
--- /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastreGrabber.java	(revision 30858)
+++ /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastreGrabber.java	(revision 30859)
@@ -13,4 +13,5 @@
 import javax.imageio.ImageIO;
 
+import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.coor.EastNorth;
 import org.openstreetmap.josm.gui.progress.NullProgressMonitor;
@@ -55,5 +56,5 @@
         str += (int)(cRasterX*(wmsLayer.communeBBox.max.getY() - wmsLayer.communeBBox.min.getY())/(wmsLayer.communeBBox.max.getX() - wmsLayer.communeBBox.min.getX()));
         str += "&exception=application/vnd.ogc.se_inimage&styles="; // required for raster images
-        System.out.println("URL="+str);
+        Main.info("URL="+str);
         return new URL(str.replace(" ", "%20"));
     }
@@ -73,5 +74,5 @@
         str += "&exception=application/vnd.ogc.se_inimage"; // works also without (but slower ?)
         str += "&styles=" + styles;
-        System.out.println("URL="+str);
+        Main.info("URL="+str);
         return new URL(str.replace(" ", "%20"));
     }
Index: /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastreInterface.java
===================================================================
--- /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastreInterface.java	(revision 30858)
+++ /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastreInterface.java	(revision 30859)
@@ -115,5 +115,5 @@
                 urlConn.connect();
                 if (urlConn.getResponseCode() == HttpURLConnection.HTTP_OK) {
-                    System.out.println("GET "+searchFormURL);
+                    Main.info("GET "+searchFormURL);
                     BufferedReader in = new BufferedReader(new InputStreamReader(urlConn.getInputStream()));
                     while(in.readLine() != null) {}  // read the buffer otherwise we sent POST too early
@@ -124,10 +124,10 @@
                             cookie = cookie.substring(0, cookie.indexOf(";"));
                             cookieTimestamp = new Date().getTime();
-                            System.out.println("received cookie=" + cookie + " at " + new Date(cookieTimestamp));
+                            Main.info("received cookie=" + cookie + " at " + new Date(cookieTimestamp));
                             cookied = true;
                         }
                     }
                 } else {
-                    System.out.println("Request to home page failed. Http error:"+urlConn.getResponseCode()+". Try again "+retries+" times");
+                    Main.warn("Request to home page failed. Http error:"+urlConn.getResponseCode()+". Try again "+retries+" times");
                     CadastrePlugin.safeSleep(3000);
                     retries --;
@@ -135,6 +135,5 @@
             }
         } catch (MalformedURLException e) {
-            throw (IOException) new IOException(
-                "Illegal url.").initCause(e);
+            throw new IOException("Illegal url.", e);
         }
     }
@@ -148,5 +147,5 @@
         long now = new Date().getTime();
         if ((now - cookieTimestamp) > cCookieExpiration) {
-            System.out.println("cookie received at "+new Date(cookieTimestamp)+" expired (now is "+new Date(now)+")");
+            Main.info("cookie received at "+new Date(cookieTimestamp)+" expired (now is "+new Date(now)+")");
             return true;
         }
@@ -222,5 +221,5 @@
                 throw new IOException("Cannot open Cadastre interface. GET response:"+urlConn.getResponseCode());
             }
-            System.out.println("GET "+interfaceURL);
+            Main.info("GET "+interfaceURL);
             BufferedReader in = new BufferedReader(new InputStreamReader(urlConn.getInputStream()));
             // read the buffer otherwise we sent POST too early
@@ -305,5 +304,5 @@
                     lines = lines.substring(lines.indexOf(cInterfaceVector),lines.length());
                     lines = lines.substring(0, lines.indexOf("'"));
-                    System.out.println("interface ref.:"+lines);
+                    Main.info("interface ref.:"+lines);
                     return lines;
                 } else if (wmsLayer.isRaster() && lines.indexOf(cInterfaceRasterTA) != -1) { // "afficherCarteTa.do"
@@ -320,5 +319,5 @@
                                 wmsLayer.setCodeCommune(listOfFeuilles.elementAt(res).ref);
                                 lines = buildRasterFeuilleInterfaceRef(listOfFeuilles.elementAt(res).ref);
-                                System.out.println("interface ref.:"+lines);
+                                Main.info("interface ref.:"+lines);
                                 return lines;
                             }
@@ -351,8 +350,8 @@
                     String lov = new String(input.substring(i+c0ptionListStart.length()-1, j));
                     if (lov.indexOf(">") != -1) {
-                        System.out.println("parse "+lov);
+                    	Main.info("parse "+lov);
                         listOfCommunes.add(lov);
                     } else
-                        System.err.println("unable to parse commune string:"+lov);
+                        Main.error("unable to parse commune string:"+lov);
                 }
                 input = input.substring(j+cOptionListEnd.length());
@@ -481,5 +480,5 @@
             throw new IOException("Cannot get Cadastre response.");
         }
-        System.out.println("GET "+searchFormURL);
+        Main.info("GET "+searchFormURL);
         try (BufferedReader in = new BufferedReader(new InputStreamReader(urlConn.getInputStream()))) {
             while ((ln = in.readLine()) != null) {
@@ -541,5 +540,5 @@
 //                wmsLayer.Y0 = Y0;
 //            }
-//            System.out.println("parse georef:"+unknown_yet+","+angle+","+scale_origin+","+dpi+","+fX+","+
+//            Main.info("parse georef:"+unknown_yet+","+angle+","+scale_origin+","+dpi+","+fX+","+
 //                    fY+","+X0+","+Y0);
 //        }
@@ -550,5 +549,5 @@
             for (Layer l : Main.map.mapView.getAllLayers()) {
                 if (l instanceof WMSLayer && l.getName().equals(wmsLayer.getName()) && (l != wmsLayer)) {
-                    System.out.println("Try to grab into a new layer when "+wmsLayer.getName()+" is already opened.");
+                	Main.info("Try to grab into a new layer when "+wmsLayer.getName()+" is already opened.");
                     // remove the duplicated layer
                     Main.main.removeLayer(wmsLayer);
Index: /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastrePlugin.java
===================================================================
--- /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastrePlugin.java	(revision 30858)
+++ /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastrePlugin.java	(revision 30859)
@@ -451,5 +451,5 @@
                 dialog.setAlwaysOnTop(true);
             } catch(SecurityException e) {
-                System.out.println(tr("Warning: failed to put option pane dialog always on top. Exception was: {0}", e.toString()));
+            	Main.warn(tr("Warning: failed to put option pane dialog always on top. Exception was: {0}", e.toString()));
             }
         }
@@ -490,5 +490,5 @@
         } catch (NumberFormatException e) {}
         if (srcYear.equals("AAAA") || (year != null && year < currentYear)) {
-            System.out.println("Replace source year "+srcYear+" by current year "+currentYear);
+        	Main.info("Replace source year "+srcYear+" by current year "+currentYear);
             src = src.substring(0, src.lastIndexOf(" ")+1)+currentYear;
             Main.pref.put("cadastrewms.source", src);
Index: /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/DownloadSVGBuilding.java
===================================================================
--- /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/DownloadSVGBuilding.java	(revision 30858)
+++ /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/DownloadSVGBuilding.java	(revision 30859)
@@ -68,5 +68,5 @@
             }
         } catch (DuplicateLayerException e) {
-            System.err.println("removed a duplicated layer");
+        	Main.warn("removed a duplicated layer");
         } catch (WMSException e) {
             errorMessage = e.getMessage();
@@ -91,5 +91,5 @@
             return true;
         }
-        System.out.println("Unable to parse SVG data (viewBox)");
+        Main.warn("Unable to parse SVG data (viewBox)");
         return false;
     }
@@ -233,5 +233,5 @@
         str += "&styles=";
         str += "LS2_90";
-        System.out.println("URL="+str);
+        Main.info("URL="+str);
         return new URL(str.replace(" ", "%20"));
     }
Index: /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/DownloadSVGTask.java
===================================================================
--- /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/DownloadSVGTask.java	(revision 30858)
+++ /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/DownloadSVGTask.java	(revision 30859)
@@ -74,5 +74,5 @@
             }
         } catch (DuplicateLayerException e) {
-            System.err.println("removed a duplicated layer");
+        	Main.warn("removed a duplicated layer");
         } catch (WMSException e) {
             errorMessage = e.getMessage();
@@ -97,5 +97,5 @@
             return true;
         }
-        System.out.println("Unable to parse SVG data (viewBox)");
+        Main.warn("Unable to parse SVG data (viewBox)");
         return false;
     }
@@ -188,5 +188,5 @@
         str += "&styles=";
         str += "COMMUNE_90";
-        System.out.println("URL="+str);
+        Main.info("URL="+str);
         return new URL(str.replace(" ", "%20"));
     }
Index: /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/DownloadWMSPlanImage.java
===================================================================
--- /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/DownloadWMSPlanImage.java	(revision 30858)
+++ /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/DownloadWMSPlanImage.java	(revision 30859)
@@ -16,5 +16,5 @@
 
 public class DownloadWMSPlanImage {
-    
+
     private Future<Task> task = null;
     private WMSLayer wmsLayer;
@@ -22,5 +22,5 @@
     private static boolean dontGeoreference = false;
     private static String errorMessage;
-    
+
     private class Task extends PleaseWaitRunnable {
         public Task(WMSLayer wmsLayer, Bounds bounds) {
@@ -85,5 +85,5 @@
             } catch (DuplicateLayerException e) {
                 // we tried to grab onto a duplicated layer (removed)
-                System.err.println("removed a duplicated layer");
+            	Main.warn("removed a duplicated layer");
             } catch (WMSException e) {
                 errorMessage = e.getMessage();
@@ -91,5 +91,5 @@
             }
         }
-        
+
         @Override
         protected void cancel() {
@@ -102,5 +102,5 @@
         }
     }
-    
+
     public void download(WMSLayer wmsLayer) {
         MapView mv = Main.map.mapView;
Index: /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/DownloadWMSVectorImage.java
===================================================================
--- /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/DownloadWMSVectorImage.java	(revision 30858)
+++ /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/DownloadWMSVectorImage.java	(revision 30859)
@@ -59,5 +59,5 @@
         } catch (DuplicateLayerException e) {
             // we tried to grab onto a duplicated layer (removed)
-            System.err.println("removed a duplicated layer");
+        	Main.warn("removed a duplicated layer");
         } catch (WMSException e) {
             errorMessage = e.getMessage();
Index: /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/GrabThread.java
===================================================================
--- /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/GrabThread.java	(revision 30858)
+++ /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/GrabThread.java	(revision 30859)
@@ -28,5 +28,5 @@
 
     private CacheControl cacheControl = null;
-    
+
     private EastNorthBound currentGrabImage;
 
@@ -34,5 +34,5 @@
 
     /**
-     * Call directly grabber for raster images or prepare thread for vector images 
+     * Call directly grabber for raster images or prepare thread for vector images
      * @param moreImages
      */
@@ -44,5 +44,5 @@
             this.notify();
         }
-        System.out.println("Added " + moreImages.size() + " to the grab thread");
+        Main.info("Added " + moreImages.size() + " to the grab thread");
         if (wmsLayer.isRaster()) {
             waitNotification();
@@ -56,7 +56,7 @@
         return size;
     }
-    
+
     public ArrayList<EastNorthBound> getImagesToGrabCopy() {
-        ArrayList<EastNorthBound> copyList = new ArrayList<>(); 
+        ArrayList<EastNorthBound> copyList = new ArrayList<>();
         lockImagesToGrag.lock();
         for (EastNorthBound img : imagesToGrab) {
@@ -67,11 +67,11 @@
         return copyList;
     }
-    
-    public void clearImagesToGrab() {        
+
+    public void clearImagesToGrab() {
         lockImagesToGrag.lock();
         imagesToGrab.clear();
         lockImagesToGrag.unlock();
     }
-    
+
     @Override
     public void run() {
@@ -92,42 +92,41 @@
                         newImage = grabber.grab(wmsLayer, currentGrabImage.min, currentGrabImage.max);
                     } catch (IOException e) {
-                        System.out
-                                .println("Download action canceled by user or server did not respond");
+                    	Main.warn("Download action canceled by user or server did not respond");
                         setCanceled(true);
                         break;
                     } catch (OsmTransferException e) {
-                        System.out.println("OSM transfer failed");
+                        Main.error("OSM transfer failed");
                         setCanceled(true);
                         break;
                     }
                     if (grabber.getWmsInterface().downloadCanceled) {
-                        System.out.println("Download action canceled by user");
+                        Main.info("Download action canceled by user");
                         setCanceled(true);
                         break;
                     }
                     try {
-                    if (CadastrePlugin.backgroundTransparent) {
-                        wmsLayer.imagesLock.lock();
-                        for (GeorefImage img : wmsLayer.getImages()) {
-                            if (img.overlap(newImage))
-                                // mask overlapping zone in already grabbed image
-                                img.withdraw(newImage);
-                            else
-                                // mask overlapping zone in new image only when new image covers completely the 
-                                // existing image
-                                newImage.withdraw(img);
-                        }
-                        wmsLayer.imagesLock.unlock();
-                    }
-                    wmsLayer.addImage(newImage);
-                    Main.map.mapView.repaint();
-                    saveToCache(newImage);
+	                    if (CadastrePlugin.backgroundTransparent) {
+	                        wmsLayer.imagesLock.lock();
+	                        for (GeorefImage img : wmsLayer.getImages()) {
+	                            if (img.overlap(newImage))
+	                                // mask overlapping zone in already grabbed image
+	                                img.withdraw(newImage);
+	                            else
+	                                // mask overlapping zone in new image only when new image covers completely the
+	                                // existing image
+	                                newImage.withdraw(img);
+	                        }
+	                        wmsLayer.imagesLock.unlock();
+	                    }
+	                    wmsLayer.addImage(newImage);
+	                    Main.map.mapView.repaint();
+	                    saveToCache(newImage);
                     } catch (NullPointerException e) {
-                        System.out.println("Layer destroyed. Cancel grab thread");
+                        Main.info("Layer destroyed. Cancel grab thread");
                         setCanceled(true);
                     }
                 }
             }
-            System.out.println("grab thread list empty");
+            Main.info("grab thread list empty");
             lockCurrentGrabImage.lock();
             currentGrabImage = null;
@@ -163,6 +162,5 @@
         if (cacheControl != null) {
             while (!cacheControl.isCachePipeEmpty()) {
-                System.out
-                        .println("Try to close a WMSLayer which is currently saving in cache : wait 1 sec.");
+                Main.info("Try to close a WMSLayer which is currently saving in cache : wait 1 sec.");
                 CadastrePlugin.safeSleep(1000);
             }
@@ -193,5 +191,5 @@
         lockCurrentGrabImage.unlock();
     }
-    
+
     private void paintBox(Graphics g, MapView mv, EastNorthBound img, Color color) {
         Point[] croppedPoint = new Point[5];
@@ -206,5 +204,5 @@
         }
     }
-    
+
     public boolean isCanceled() {
         return canceled;
@@ -231,7 +229,6 @@
             wait();
         } catch (InterruptedException e) {
-            e.printStackTrace(System.out);
-        }
-    }
-
+            Main.error(e);
+        }
+    }
 }
Index: /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionLoadFromCache.java
===================================================================
--- /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionLoadFromCache.java	(revision 30858)
+++ /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionLoadFromCache.java	(revision 30859)
@@ -2,9 +2,10 @@
 package cadastre_fr;
 
+import static org.openstreetmap.josm.tools.I18n.marktr;
 import static org.openstreetmap.josm.tools.I18n.tr;
-import static org.openstreetmap.josm.tools.I18n.marktr;
 
 import java.awt.event.ActionEvent;
 import java.io.File;
+
 import javax.swing.JFileChooser;
 import javax.swing.JOptionPane;
@@ -23,5 +24,6 @@
     }
 
-    public void actionPerformed(ActionEvent e) {
+    @Override
+	public void actionPerformed(ActionEvent e) {
         JFileChooser fc = createAndOpenFileChooser();
         if (fc == null)
@@ -56,5 +58,5 @@
                                 continue nextFile;
                             } else
-                                System.out.println("Load cache " + filename);
+                                Main.info("Load cache " + filename);
                         }
                     } catch (NumberFormatException ex) {
Index: /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionNewLocation.java
===================================================================
--- /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionNewLocation.java	(revision 30858)
+++ /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionNewLocation.java	(revision 30859)
@@ -52,5 +52,6 @@
     }
 
-    public void actionPerformed(ActionEvent e) {
+    @Override
+	public void actionPerformed(ActionEvent e) {
         WMSLayer wmsLayer = addNewLayer(new ArrayList<WMSLayer>());
         if (wmsLayer != null)
@@ -116,5 +117,5 @@
             wmsLayer.setDepartement(codeDepartement);
             CadastrePlugin.addWMSLayer(wmsLayer);
-            System.out.println("Add new layer with Location:" + inputTown.getText());
+            Main.info("Add new layer with Location:" + inputTown.getText());
         } else if (existingLayers != null && existingLayers.size() > 0 && Main.map.mapView.getActiveLayer() instanceof WMSLayer) {
             wmsLayer = (WMSLayer)Main.map.mapView.getActiveLayer();
@@ -123,4 +124,3 @@
         return wmsLayer;
     }
-
 }
Index: /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionRefineGeoRef.java
===================================================================
--- /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionRefineGeoRef.java	(revision 30858)
+++ /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionRefineGeoRef.java	(revision 30859)
@@ -6,4 +6,5 @@
 import java.awt.event.ActionEvent;
 
+import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.actions.JosmAction;
 
@@ -23,7 +24,6 @@
     @Override
     public void actionPerformed(ActionEvent arg0) {
-        if(!wmsLayer.isRaster())
-        {
-            System.out.println("MenuActionRefineGeoRef called for unexpected layer type");
+        if(!wmsLayer.isRaster()) {
+            Main.info("MenuActionRefineGeoRef called for unexpected layer type");
             return;
         }
@@ -36,4 +36,3 @@
         rasterImageGeoreferencer.startGeoreferencing(wmsLayer);
     }
-
 }
Index: /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionSaveRasterAs.java
===================================================================
--- /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionSaveRasterAs.java	(revision 30858)
+++ /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionSaveRasterAs.java	(revision 30859)
@@ -2,6 +2,6 @@
 package cadastre_fr;
 
+import static org.openstreetmap.josm.tools.I18n.marktr;
 import static org.openstreetmap.josm.tools.I18n.tr;
-import static org.openstreetmap.josm.tools.I18n.marktr;
 
 import java.awt.event.ActionEvent;
@@ -30,15 +30,15 @@
 
     public static String name = marktr("Save image as...");
-    
+
     private static final long serialVersionUID = 1L;
-    
+
     private WMSLayer wmsLayer;
-    
+
     public class FiltrePng extends FileFilter {
         @Override
         public boolean accept(File file) {
-            if (file.isDirectory()) { 
+            if (file.isDirectory()) {
                 return true;
-            } 
+            }
             return file.getName().toLowerCase().endsWith(".png");
         }
@@ -52,7 +52,7 @@
         @Override
         public boolean accept(File file) {
-            if (file.isDirectory()) { 
+            if (file.isDirectory()) {
                 return true;
-            } 
+            }
             return file.getName().toLowerCase().endsWith(".tif");
         }
@@ -71,5 +71,6 @@
     }
 
-    public void actionPerformed(ActionEvent arg0) {
+    @Override
+	public void actionPerformed(ActionEvent arg0) {
         File file;
         JFileChooser fc = new JFileChooser();
@@ -80,5 +81,5 @@
         if (returnVal == JFileChooser.APPROVE_OPTION) {
             file = fc.getSelectedFile();
-            BufferedImage bi = wmsLayer.getImage(0).image; 
+            BufferedImage bi = wmsLayer.getImage(0).image;
             if (fc.getFileFilter().equals(filtrePng))
             {
@@ -101,10 +102,10 @@
             {
                 boolean alpha = bi.getColorModel().hasAlpha();
-                System.out.println("image with alpha channel : " + alpha);
+                Main.info("image with alpha channel : " + alpha);
                 try {
                     double x = wmsLayer.getImage(0).min.east();
                     double y = wmsLayer.getImage(0).min.north();
-                    Envelope2D bbox = new Envelope2D(CRS.decode("EPSG:27561"), 
-                            x, y, 
+                    Envelope2D bbox = new Envelope2D(CRS.decode("EPSG:27561"),
+                            x, y,
                             wmsLayer.getImage(0).max.east()-x, wmsLayer.getImage(0).max.north()-y);
                     GridCoverageFactory factory = new GridCoverageFactory();
@@ -122,11 +123,11 @@
                                     .setValue(wp);
 
-                    gtwriter.write(coverage, (GeneralParameterValue[]) params.values().toArray(new GeneralParameterValue[1]));
+                    gtwriter.write(coverage, params.values().toArray(new GeneralParameterValue[1]));
                     gtwriter.dispose();
-                    coverage.dispose(true); 
+                    coverage.dispose(true);
                 } catch (Exception e) {
                     // TODO Auto-generated catch block
                     e.printStackTrace();
-                } 
+                }
             }
         }
Index: /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/RasterImageGeoreferencer.java
===================================================================
--- /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/RasterImageGeoreferencer.java	(revision 30858)
+++ /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/RasterImageGeoreferencer.java	(revision 30859)
@@ -91,5 +91,5 @@
   }
 
- 
+
   public boolean isRunning()
   {
@@ -97,7 +97,8 @@
   }
 
-  public void mouseClicked(MouseEvent e) {
+  @Override
+public void mouseClicked(MouseEvent e) {
       if (System.currentTimeMillis() - mouseClickedTime < initialClickDelay) {
-          System.out.println("mouse click bounce detected");
+          Main.info("mouse click bounce detected");
           return; // mouse click anti-bounce
       }
@@ -108,5 +109,5 @@
       if (ignoreMouseClick) return; // In case we are currently just allowing zooming to read lambert coordinates
       EastNorth ea = Main.getProjection().latlon2eastNorth(Main.map.mapView.getLatLon(e.getX(), e.getY()));
-      System.out.println("clic:"+countMouseClicked+" ,"+ea+", mode:"+mode);
+      Main.info("click:"+countMouseClicked+" ,"+ea+", mode:"+mode);
       if (clickOnTheMap) {
           clickOnTheMap = false;
@@ -117,5 +118,5 @@
                   || ea.north() < wmsLayer.getImage(0).min.north() || ea.north() > wmsLayer.getImage(0).max.north())
           {
-              System.out.println("ignore clic outside the image");
+              Main.info("ignore click outside the image");
               return;
           }
@@ -182,5 +183,5 @@
                  tr("Ooops. I failed to catch all coordinates\n"+
                     "correctly. Retry please."));
-         System.out.println("failed to transform: one coordinate missing:"
+         Main.warn("failed to transform: one coordinate missing:"
                     +"org1="+org1+", org2="+org2+", dst1="+dst1+", dst2="+dst2);
          return;
@@ -249,5 +250,6 @@
      dialog.setVisible(true);
      pane.addPropertyChangeListener(new PropertyChangeListener() {
-         public void propertyChange(PropertyChangeEvent evt) {
+         @Override
+		public void propertyChange(PropertyChangeEvent evt) {
              if (JOptionPane.VALUE_PROPERTY.equals(evt.getPropertyName())) {
                  ignoreMouseClick = false;
@@ -352,14 +354,18 @@
  }
 
- public void mouseEntered(MouseEvent arg0) {
- }
-
- public void mouseExited(MouseEvent arg0) {
- }
-
- public void mousePressed(MouseEvent arg0) {
- }
-
- public void mouseReleased(MouseEvent arg0) {
+ @Override
+public void mouseEntered(MouseEvent arg0) {
+ }
+
+ @Override
+public void mouseExited(MouseEvent arg0) {
+ }
+
+ @Override
+public void mousePressed(MouseEvent arg0) {
+ }
+
+ @Override
+public void mouseReleased(MouseEvent arg0) {
  }
 
Index: /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/WMSLayer.java
===================================================================
--- /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/WMSLayer.java	(revision 30858)
+++ /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/WMSLayer.java	(revision 30859)
@@ -93,6 +93,6 @@
 
     private Action cancelGrab;
-    
-    private Action refineGeoRef; 
+
+    private Action refineGeoRef;
 
     @SuppressWarnings("serial")
@@ -107,11 +107,11 @@
             Main.map.mapView.repaint();
         }
-        
-    }
-    
+
+    }
+
     public boolean adjustModeEnabled;
 
     public GrabThread grabThread;
-    
+
     public WMSLayer() {
         this(tr("Blank Layer"), "", -1);
@@ -138,5 +138,5 @@
         images = null;
         dividedBbox = null;
-        System.out.println("Layer "+location+" destroyed");
+        Main.info("Layer "+location+" destroyed");
     }
 
@@ -173,5 +173,5 @@
     /**
      * Divides the bounding box in smaller squares. Their size (and quantity) is configurable in Preferences.
-     * 
+     *
      * @param b      the original bbox, usually the current bbox on screen
      * @param factor 1 = source bbox 1:1
@@ -326,5 +326,5 @@
                 cancelGrab,
                 refineGeoRef,
-                resetOffset, 
+                resetOffset,
                 new LayerListPopup.InfoAction(this),
 
@@ -527,5 +527,5 @@
             }
         }
-        System.out.println("Cache loaded for location "+location+" with "+images.size()+" images");
+        Main.info("Cache loaded for location "+location+" with "+images.size()+" images");
         return true;
     }
@@ -593,5 +593,5 @@
         return communeBBox;
     }
-    
+
     public EastNorthBound getFirstViewFromCacheBBox() {
         if (isRaster) {
@@ -604,7 +604,7 @@
         for (GeorefImage image:images){
             min_x = image.min.east() < min_x ? image.min.east() : min_x;
-            max_x = image.max.east() > max_x ? image.max.east() : max_x; 
+            max_x = image.max.east() > max_x ? image.max.east() : max_x;
             min_y = image.min.north() < min_y ? image.min.north() : min_y;
-            max_y = image.max.north() > max_y ? image.max.north() : max_y; 
+            max_y = image.max.north() > max_y ? image.max.north() : max_y;
         }
         EastNorthBound maxGrabbedBBox = new EastNorthBound(new EastNorth(min_x, min_y), new EastNorth(max_x, max_y));
@@ -619,5 +619,6 @@
      * Method required by ImageObserver when drawing an image
      */
-    public boolean imageUpdate(Image img, int infoflags, int x, int y, int width, int height) {
+    @Override
+	public boolean imageUpdate(Image img, int infoflags, int x, int y, int width, int height) {
         return false;
     }
@@ -690,14 +691,14 @@
             img = this.images.get(index);
         } catch (ArrayIndexOutOfBoundsException e) {
-            e.printStackTrace(System.out);
+            Main.error(e);
         }
         imagesLock.unlock();
         return img;
     }
-    
+
     public Vector<GeorefImage> getImages() {
         return this.images;
     }
-    
+
     public void addImage(GeorefImage img) {
         imagesLock.lock();
@@ -705,5 +706,5 @@
         imagesLock.unlock();
     }
-    
+
     public void setImages(Vector<GeorefImage> images) {
         imagesLock.lock();
@@ -711,5 +712,5 @@
         imagesLock.unlock();
     }
-    
+
     public void clearImages() {
         imagesLock.lock();
