Index: /applications/editors/josm/plugins/geochat/build.xml
===================================================================
--- /applications/editors/josm/plugins/geochat/build.xml	(revision 33544)
+++ /applications/editors/josm/plugins/geochat/build.xml	(revision 33545)
@@ -5,5 +5,5 @@
     <property name="commit.message" value="[josm_geochat] copypaste from keyboard, font size advanced parameters"/>
     <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
-    <property name="plugin.main.version" value="10580"/>
+    <property name="plugin.main.version" value="12643"/>
 
     <property name="plugin.author" value="Ilya Zverev"/>
Index: /applications/editors/josm/plugins/geochat/src/geochat/ChatMessage.java
===================================================================
--- /applications/editors/josm/plugins/geochat/src/geochat/ChatMessage.java	(revision 33544)
+++ /applications/editors/josm/plugins/geochat/src/geochat/ChatMessage.java	(revision 33545)
@@ -84,8 +84,5 @@
         }
         final ChatMessage other = (ChatMessage) obj;
-        if (this.id != other.id) {
-            return false;
-        }
-        return true;
+        return this.id == other.id;
     }
 
Index: /applications/editors/josm/plugins/geochat/src/geochat/ChatPaneManager.java
===================================================================
--- /applications/editors/josm/plugins/geochat/src/geochat/ChatPaneManager.java	(revision 33544)
+++ /applications/editors/josm/plugins/geochat/src/geochat/ChatPaneManager.java	(revision 33545)
@@ -25,4 +25,5 @@
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.gui.util.GuiHelper;
+import org.openstreetmap.josm.tools.Logging;
 
 /**
@@ -116,5 +117,5 @@
                     doc.insertString(doc.getLength(), nline, attrs);
                 } catch (BadLocationException ex) {
-                    Main.warn(ex);
+                    Logging.warn(ex);
                 }
                 thepane.setCaretPosition(doc.getLength());
Index: /applications/editors/josm/plugins/geochat/src/geochat/ChatServerConnection.java
===================================================================
--- /applications/editors/josm/plugins/geochat/src/geochat/ChatServerConnection.java	(revision 33544)
+++ /applications/editors/josm/plugins/geochat/src/geochat/ChatServerConnection.java	(revision 33545)
@@ -23,5 +23,7 @@
 import org.openstreetmap.josm.data.coor.LatLon;
 import org.openstreetmap.josm.data.projection.Projection;
+import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.gui.MapView;
+import org.openstreetmap.josm.tools.Logging;
 
 /**
@@ -122,5 +124,5 @@
                     }
                 } catch (InterruptedException e) {
-                    Main.warn(e);
+                    Logging.warn(e);
                 }
                 autoLogin(userName);
@@ -164,5 +166,5 @@
             });
         } catch (UnsupportedEncodingException e) {
-            Main.error(e);
+            Logging.error(e);
         }
     }
@@ -266,5 +268,5 @@
             });
         } catch (UnsupportedEncodingException e) {
-            Main.error(e);
+            Logging.error(e);
         }
     }
@@ -274,10 +276,10 @@
      */
     private static LatLon getPosition() {
-        if (Main.map == null || Main.map.mapView == null)
+        if (!MainApplication.isDisplayingMapView())
             return null;
         if (getCurrentZoom() < 10)
             return null;
         Projection proj = Main.getProjection();
-        return proj.eastNorth2latlon(Main.map.mapView.getCenter());
+        return proj.eastNorth2latlon(MainApplication.getMap().mapView.getCenter());
     }
 
@@ -294,8 +296,8 @@
 
     public static int getCurrentZoom() {
-        if (Main.map == null || Main.map.mapView == null) {
+        if (!MainApplication.isDisplayingMapView()) {
             return 1;
         }
-        MapView mv = Main.map.mapView;
+        MapView mv = MainApplication.getMap().mapView;
         LatLon topLeft = mv.getLatLon(0, 0);
         LatLon botRight = mv.getLatLon(mv.getWidth(), mv.getHeight());
@@ -434,5 +436,5 @@
                     result.add(cm);
                 } catch (JsonException e) {
-                    Main.trace(e);
+                    Logging.trace(e);
                 }
             }
@@ -450,5 +452,5 @@
                     result.put(name, new LatLon(lat, lon));
                 } catch (JsonException e) {
-                    Main.trace(e);
+                    Logging.trace(e);
                 }
             }
Index: /applications/editors/josm/plugins/geochat/src/geochat/GeoChatPanel.java
===================================================================
--- /applications/editors/josm/plugins/geochat/src/geochat/GeoChatPanel.java	(revision 33544)
+++ /applications/editors/josm/plugins/geochat/src/geochat/GeoChatPanel.java	(revision 33545)
@@ -37,11 +37,10 @@
 import org.openstreetmap.josm.data.Bounds;
 import org.openstreetmap.josm.data.coor.LatLon;
-import org.openstreetmap.josm.gui.JosmUserIdentityManager;
-import org.openstreetmap.josm.gui.MapView;
-import org.openstreetmap.josm.gui.Notification;
+import org.openstreetmap.josm.gui.*;
 import org.openstreetmap.josm.gui.dialogs.ToggleDialog;
 import org.openstreetmap.josm.gui.layer.MapViewPaintable;
 import org.openstreetmap.josm.gui.util.GuiHelper;
 import org.openstreetmap.josm.tools.GBC;
+import org.openstreetmap.josm.tools.Logging;
 
 /**
@@ -156,5 +155,5 @@
             }
         } catch (IOException e) {
-            Main.warn("Failed to logout from geochat server: " + e.getMessage());
+            Logging.warn("Failed to logout from geochat server: " + e.getMessage());
         }
         super.destroy();
@@ -317,6 +316,6 @@
         this.users = newUsers;
         updateTitleAlarm();
-        if (userLayerActive && Main.map.mapView != null)
-            Main.map.mapView.repaint();
+        if (userLayerActive && MainApplication.isDisplayingMapView())
+            MainApplication.getMap().mapView.repaint();
     }
 
Index: /applications/editors/josm/plugins/geochat/src/geochat/GeoChatPopupAdapter.java
===================================================================
--- /applications/editors/josm/plugins/geochat/src/geochat/GeoChatPopupAdapter.java	(revision 33544)
+++ /applications/editors/josm/plugins/geochat/src/geochat/GeoChatPopupAdapter.java	(revision 33545)
@@ -13,5 +13,5 @@
 import javax.swing.JPopupMenu;
 
-import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.gui.MainApplication;
 
 /**
@@ -114,17 +114,17 @@
         ToggleUserLayerAction() {
             super(tr("Show users on map"));
-            putValue(SELECTED_KEY, Boolean.valueOf(panel.userLayerActive));
+            putValue(SELECTED_KEY, panel.userLayerActive);
         }
 
         @Override
         public void actionPerformed(ActionEvent e) {
-            if (Main.map == null || Main.map.mapView == null)
+            if (!MainApplication.isDisplayingMapView())
                 return;
-            boolean wasAdded = Main.map.mapView.addTemporaryLayer(panel);
+            boolean wasAdded = MainApplication.getMap().mapView.addTemporaryLayer(panel);
             if (!wasAdded)
-                Main.map.mapView.removeTemporaryLayer(panel);
+                MainApplication.getMap().mapView.removeTemporaryLayer(panel);
             panel.userLayerActive = wasAdded;
-            putValue(SELECTED_KEY, Boolean.valueOf(panel.userLayerActive));
-            Main.map.mapView.repaint();
+            putValue(SELECTED_KEY, panel.userLayerActive);
+            MainApplication.getMap().mapView.repaint();
         }
     }
Index: /applications/editors/josm/plugins/geochat/src/geochat/JPanelTextField.java
===================================================================
--- /applications/editors/josm/plugins/geochat/src/geochat/JPanelTextField.java	(revision 33544)
+++ /applications/editors/josm/plugins/geochat/src/geochat/JPanelTextField.java	(revision 33545)
@@ -16,5 +16,5 @@
 import javax.swing.text.DefaultEditorKit;
 
-import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.gui.widgets.PopupMenuLauncher;
 
@@ -87,6 +87,6 @@
                 }
             } else if (code == KeyEvent.VK_ESCAPE) {
-                if (Main.map != null && Main.map.mapView != null)
-                    Main.map.mapView.requestFocus();
+                if (MainApplication.isDisplayingMapView())
+                    MainApplication.getMap().mapView.requestFocus();
             }
 
Index: /applications/editors/josm/plugins/geochat/src/geochat/JsonQueryUtil.java
===================================================================
--- /applications/editors/josm/plugins/geochat/src/geochat/JsonQueryUtil.java	(revision 33544)
+++ /applications/editors/josm/plugins/geochat/src/geochat/JsonQueryUtil.java	(revision 33545)
@@ -14,4 +14,6 @@
 
 import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.gui.MainApplication;
+import org.openstreetmap.josm.tools.Logging;
 
 /**
@@ -70,5 +72,5 @@
      */
     public static void queryAsync(String query, JsonQueryCallback callback) {
-        Main.worker.submit(new JsonQueryUtil(query, callback));
+        MainApplication.worker.submit(new JsonQueryUtil(query, callback));
     }
 
@@ -78,5 +80,5 @@
             obj = query(query);
         } catch (IOException e) {
-            Main.warn(e.getClass().getName() + " while connecting to a chat server: " + e.getMessage());
+            Logging.warn(e.getClass().getName() + " while connecting to a chat server: " + e.getMessage());
             obj = null;
         }
