Index: /trunk/src/org/openstreetmap/josm/Main.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/Main.java	(revision 12641)
+++ /trunk/src/org/openstreetmap/josm/Main.java	(revision 12642)
@@ -150,6 +150,8 @@
     /**
      * The main panel.
+     * @deprecated Use {@link MainApplication#getMainPanel} instead
      * @since 12125
      */
+    @Deprecated
     public MainPanel panel;
 
Index: /trunk/src/org/openstreetmap/josm/gui/ImageryMenu.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/ImageryMenu.java	(revision 12641)
+++ /trunk/src/org/openstreetmap/josm/gui/ImageryMenu.java	(revision 12642)
@@ -198,5 +198,5 @@
         JMenu subMenu = Main.main.menu.imagerySubMenu;
         int heightUnrolled = 30*(getItemCount()+subMenu.getItemCount());
-        if (heightUnrolled < Main.main.panel.getHeight()) {
+        if (heightUnrolled < MainApplication.getMainPanel().getHeight()) {
             // add all items of submenu if they will fit on screen
             int n = subMenu.getItemCount();
Index: /trunk/src/org/openstreetmap/josm/gui/MainApplication.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/MainApplication.java	(revision 12641)
+++ /trunk/src/org/openstreetmap/josm/gui/MainApplication.java	(revision 12642)
@@ -136,5 +136,5 @@
 
     /**
-     * The same panel as {@link Main#panel}, required to be static for {@link MapFrameListener} handling.
+     * The main panel, required to be static for {@link MapFrameListener} handling.
      */
     static MainPanel mainPanel;
@@ -165,13 +165,13 @@
 
     /**
+     * Provides access to the layers displayed in the main view.
+     */
+    private static final MainLayerManager layerManager = new MainLayerManager();
+
+    /**
      * The commands undo/redo handler.
      * @since 12641 (as a replacement to {@code Main.main.undoRedo})
      */
-    public static final UndoRedoHandler undoRedo = new UndoRedoHandler();
-
-    /**
-     * Provides access to the layers displayed in the main view.
-     */
-    private static final MainLayerManager layerManager = new MainLayerManager();
+    public static final UndoRedoHandler undoRedo = new UndoRedoHandler(); // Must be declared after layerManager
 
     /**
@@ -271,16 +271,19 @@
 
     @Override
+    @SuppressWarnings("deprecation")
     protected void initializeMainWindow() {
         if (mainFrame != null) {
-            panel = mainFrame.getPanel();
+            mainPanel = mainFrame.getPanel();
+            panel = mainPanel;
             mainFrame.initialize();
             menu = mainFrame.getMenu();
         } else {
             // required for running some tests.
-            panel = new MainPanel(layerManager);
+            mainPanel = new MainPanel(layerManager);
+            panel = mainPanel;
             menu = new MainMenu();
         }
-        panel.addMapFrameListener((o, n) -> redoUndoListener.commandChanged(0, 0));
-        panel.reAddListeners();
+        mainPanel.addMapFrameListener((o, n) -> redoUndoListener.commandChanged(0, 0));
+        mainPanel.reAddListeners();
     }
 
@@ -365,4 +368,13 @@
     public static MapFrame getMap() {
         return map;
+    }
+
+    /**
+     * Returns the main panel.
+     * @return the main panel
+     * @since 12642 (as a replacement to {@code Main.main.panel})
+     */
+    public static MainPanel getMainPanel() {
+        return mainPanel;
     }
 
Index: /trunk/src/org/openstreetmap/josm/gui/datatransfer/OsmTransferHandler.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/datatransfer/OsmTransferHandler.java	(revision 12641)
+++ /trunk/src/org/openstreetmap/josm/gui/datatransfer/OsmTransferHandler.java	(revision 12642)
@@ -10,7 +10,7 @@
 import java.util.Collections;
 
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.coor.EastNorth;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
+import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.gui.datatransfer.importers.AbstractOsmDataPaster;
 import org.openstreetmap.josm.gui.datatransfer.importers.FilePaster;
@@ -72,5 +72,5 @@
      */
     public void pasteOn(OsmDataLayer editLayer, EastNorth mPosition, Transferable transferable) {
-        importData(new TransferSupport(Main.main.panel, transferable), editLayer, mPosition);
+        importData(new TransferSupport(MainApplication.getMainPanel(), transferable), editLayer, mPosition);
     }
 
@@ -81,5 +81,5 @@
     public void pasteTags(Collection<? extends OsmPrimitive> primitives) {
         Transferable transferable = ClipboardUtils.getClipboardContent();
-        importTags(new TransferSupport(Main.main.panel, transferable), primitives);
+        importTags(new TransferSupport(MainApplication.getMainPanel(), transferable), primitives);
     }
 
Index: /trunk/test/unit/org/openstreetmap/josm/JOSMFixture.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/JOSMFixture.java	(revision 12641)
+++ /trunk/test/unit/org/openstreetmap/josm/JOSMFixture.java	(revision 12642)
@@ -140,4 +140,5 @@
     }
 
+    @SuppressWarnings("deprecation")
     private void setupGUI() {
         JOSMTestRules.cleanLayerEnvironment();
@@ -154,5 +155,5 @@
             if (Main.main.panel == null) {
                 initMainPanel(false);
-                Main.main.panel = MainApplicationTest.getMainPanel();
+                Main.main.panel = MainApplication.getMainPanel();
             }
             Main.main.panel.reAddListeners();
Index: /trunk/test/unit/org/openstreetmap/josm/gui/MainApplicationTest.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/gui/MainApplicationTest.java	(revision 12641)
+++ /trunk/test/unit/org/openstreetmap/josm/gui/MainApplicationTest.java	(revision 12642)
@@ -80,4 +80,5 @@
      * @param reAddListeners {@code true} to re-add listeners
      */
+    @SuppressWarnings("deprecation")
     public static void initMainPanel(boolean reAddListeners) {
         if (MainApplication.mainPanel == null) {
@@ -90,12 +91,4 @@
             Main.main.panel = MainApplication.mainPanel;
         }
-    }
-
-    /**
-     * Returns {@link MainApplication#mainPanel} (not public).
-     * @return {@link MainApplication#mainPanel}
-     */
-    public static MainPanel getMainPanel() {
-        return MainApplication.mainPanel;
     }
 
