Index: applications/editors/josm/plugins/cadastre-fr/build.xml
===================================================================
--- applications/editors/josm/plugins/cadastre-fr/build.xml	(revision 32309)
+++ applications/editors/josm/plugins/cadastre-fr/build.xml	(revision 32329)
@@ -4,5 +4,5 @@
     <property name="commit.message" value="Changed constructor for Plugin"/>
     <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
-    <property name="plugin.main.version" value="9759"/>
+    <property name="plugin.main.version" value="10279"/>
     
     <!-- Configure these properties (replace "..." accordingly).
Index: applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastreInterface.java
===================================================================
--- applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastreInterface.java	(revision 32309)
+++ applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastreInterface.java	(revision 32329)
@@ -576,5 +576,5 @@
     private static void checkLayerDuplicates(WMSLayer wmsLayer) throws DuplicateLayerException {
         if (Main.map != null) {
-            for (Layer l : Main.map.mapView.getAllLayers()) {
+            for (Layer l : Main.getLayerManager().getLayers()) {
                 if (l instanceof WMSLayer && l.getName().equals(wmsLayer.getName()) && (!l.equals(wmsLayer))) {
                     Main.info("Try to grab into a new layer when "+wmsLayer.getName()+" is already opened.");
Index: applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastrePlugin.java
===================================================================
--- applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastrePlugin.java	(revision 32309)
+++ applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastrePlugin.java	(revision 32329)
@@ -456,6 +456,6 @@
     public static void addWMSLayer(WMSLayer wmsLayer) {
         if (Main.map != null && Main.map.mapView != null) {
-            int wmsNewLayerPos = Main.map.mapView.getAllLayers().size();
-            for(Layer l : Main.map.mapView.getLayersOfType(WMSLayer.class)) {
+            int wmsNewLayerPos = Main.getLayerManager().getLayers().size();
+            for(Layer l : Main.getLayerManager().getLayersOfType(WMSLayer.class)) {
                 int wmsPos = Main.map.mapView.getLayerPos(l);
                 if (wmsPos < wmsNewLayerPos) wmsNewLayerPos = wmsPos;
Index: applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionGrabPlanImage.java
===================================================================
--- applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionGrabPlanImage.java	(revision 32309)
+++ applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionGrabPlanImage.java	(revision 32329)
@@ -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;
@@ -12,5 +12,4 @@
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.actions.JosmAction;
-import org.openstreetmap.josm.gui.layer.Layer;
 
 public class MenuActionGrabPlanImage extends JosmAction implements Runnable {
@@ -36,12 +35,12 @@
         if (wmsLayer == null || Main.map == null || Main.map.mapView == null) return;
         if (!rasterImageGeoreferencer.isRunning()) return;
-        for (Layer l : Main.map.mapView.getAllLayersAsList())
-            if (l == wmsLayer)
-                return;
+        if (Main.getLayerManager().containsLayer(wmsLayer))
+        	return;
         JOptionPane.showMessageDialog(Main.parent, tr("Georeferencing interrupted"));
         rasterImageGeoreferencer.actionInterrupted();
     }
 
-    public void actionPerformed(ActionEvent ae) {
+    @Override
+	public void actionPerformed(ActionEvent ae) {
         if (Main.map != null) {
             if (CadastrePlugin.isCadastreProjection()) {
@@ -58,5 +57,6 @@
     }
 
-    public void run() {
+    @Override
+	public void run() {
         // wait until plan image is fully loaded and joined into one single image
         boolean loadedFromCache = downloadWMSPlanImage.waitFinished();
Index: applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionLoadFromCache.java
===================================================================
--- applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionLoadFromCache.java	(revision 32309)
+++ applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionLoadFromCache.java	(revision 32329)
@@ -69,5 +69,5 @@
                     // check if the selected cache is not already displayed
                     if (Main.map != null) {
-                        for (Layer l : Main.map.mapView.getAllLayers()) {
+                        for (Layer l : Main.getLayerManager().getLayers()) {
                             if (l instanceof WMSLayer && l.getName().equals(location)) {
                                 JOptionPane.showMessageDialog(Main.parent, tr("The location {0} is already on screen. Cache not loaded.", filename), tr("Error"), JOptionPane.ERROR_MESSAGE);
Index: applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionNewLocation.java
===================================================================
--- applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionNewLocation.java	(revision 32309)
+++ applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionNewLocation.java	(revision 32329)
@@ -106,5 +106,5 @@
             Main.pref.put("cadastrewms.codeDepartement", codeDepartement);
             if (Main.map != null) {
-                for (Layer l : Main.map.mapView.getAllLayers()) {
+                for (Layer l : Main.getLayerManager().getLayers()) {
                     if (l instanceof WMSLayer && l.getName().equalsIgnoreCase(location)) {
                         return null;
@@ -118,6 +118,6 @@
             CadastrePlugin.addWMSLayer(wmsLayer);
             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();
+        } else if (existingLayers != null && existingLayers.size() > 0 && Main.getLayerManager().getActiveLayer() instanceof WMSLayer) {
+            wmsLayer = (WMSLayer)Main.getLayerManager().getActiveLayer();
         }
 
Index: applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/WMSAdjustAction.java
===================================================================
--- applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/WMSAdjustAction.java	(revision 32309)
+++ applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/WMSAdjustAction.java	(revision 32329)
@@ -41,6 +41,6 @@
     @Override public void enterMode() {
         if (Main.map != null) {
-            if (Main.map.mapView.getActiveLayer() instanceof WMSLayer) {
-                modifiedLayer = (WMSLayer)Main.map.mapView.getActiveLayer();
+            if (Main.getLayerManager().getActiveLayer() instanceof WMSLayer) {
+                modifiedLayer = (WMSLayer)Main.getLayerManager().getActiveLayer();
                 super.enterMode();
                 Main.map.mapView.addMouseListener(this);
Index: applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/WMSDownloadAction.java
===================================================================
--- applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/WMSDownloadAction.java	(revision 32309)
+++ applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/WMSDownloadAction.java	(revision 32329)
@@ -27,8 +27,8 @@
         ArrayList<WMSLayer> existingWMSlayers = new ArrayList<>();
         if (Main.map != null) {
-            Layer activeLayer = Main.map.mapView.getActiveLayer();
+            Layer activeLayer = Main.getLayerManager().getActiveLayer();
             if (activeLayer instanceof WMSLayer)
                 return (WMSLayer) activeLayer;
-            for (Layer l : Main.map.mapView.getAllLayers()) {
+            for (Layer l : Main.getLayerManager().getLayers()) {
                 if (l instanceof WMSLayer) {
                     existingWMSlayers.add((WMSLayer)l);
Index: applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/WMSLayer.java
===================================================================
--- applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/WMSLayer.java	(revision 32309)
+++ applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/WMSLayer.java	(revision 32329)
@@ -160,5 +160,5 @@
         grabThread.setGrabber(grabber);
         // if it is the first layer, use the communeBBox as grab bbox (and not divided)
-        if (Main.map.mapView.getAllLayers().size() == 1 ) {
+        if (Main.getLayerManager().getLayers().size() == 1 ) {
             final Bounds bounds = this.getCommuneBBox().toBounds();
             GuiHelper.runInEDTAndWait(new Runnable() {
