Index: /applications/editors/josm/plugins/gpsblam/build.xml
===================================================================
--- /applications/editors/josm/plugins/gpsblam/build.xml	(revision 33775)
+++ /applications/editors/josm/plugins/gpsblam/build.xml	(revision 33776)
@@ -5,5 +5,5 @@
     <property name="commit.message" value="Commit message"/>
     <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
-    <property name="plugin.main.version" value="11713"/>
+    <property name="plugin.main.version" value="12636"/>
 
     <!--
Index: /applications/editors/josm/plugins/gpsblam/src/org/openstreetmap/josm/plugins/gpsblam/GPSBlamInputData.java
===================================================================
--- /applications/editors/josm/plugins/gpsblam/src/org/openstreetmap/josm/plugins/gpsblam/GPSBlamInputData.java	(revision 33775)
+++ /applications/editors/josm/plugins/gpsblam/src/org/openstreetmap/josm/plugins/gpsblam/GPSBlamInputData.java	(revision 33776)
@@ -14,4 +14,6 @@
 import org.openstreetmap.josm.data.gpx.GpxTrackSegment;
 import org.openstreetmap.josm.data.gpx.WayPoint;
+import org.openstreetmap.josm.data.projection.Projection;
+import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.gui.layer.GpxLayer;
 import org.openstreetmap.josm.gui.layer.Layer;
@@ -27,5 +29,6 @@
     // within given radius of line between given points
     GPSBlamInputData(Point p1, Point p2, int radius) {
-        Collection<Layer> layers = Main.getLayerManager().getLayers();
+        Collection<Layer> layers = MainApplication.getLayerManager().getLayers();
+        Projection projection = Main.getProjection();
         for (Layer l : layers) {
             if (l.isVisible() && l instanceof GpxLayer) {
@@ -33,9 +36,8 @@
                     for (GpxTrackSegment segment: track.getSegments()) {
                         for (WayPoint wayPoint : segment.getWayPoints()) {
-
                             if (p2.equals(p1)) {
                                 // circular selection
                                 CachedLatLon cll = new CachedLatLon(wayPoint.getCoor());
-                                Point p = Main.map.mapView.getPoint(cll.getEastNorth());
+                                Point p = MainApplication.getMap().mapView.getPoint(cll.getEastNorth(projection));
                                 if (p.distance(p1) < radius) {
                                     this.add(cll, wayPoint);
@@ -51,5 +53,5 @@
 
                                 CachedLatLon cll = new CachedLatLon(wayPoint.getCoor());
-                                Point p = Main.map.mapView.getPoint(cll.getEastNorth());
+                                Point p = MainApplication.getMap().mapView.getPoint(cll.getEastNorth(projection));
                                 double pX = p.x-p1.x, pY=p.y-p1.y; // vector from point clicked to waypoint
                                 double pPar = pX*dirX + pY*dirY; // parallel component
Index: /applications/editors/josm/plugins/gpsblam/src/org/openstreetmap/josm/plugins/gpsblam/GPSBlamMarker.java
===================================================================
--- /applications/editors/josm/plugins/gpsblam/src/org/openstreetmap/josm/plugins/gpsblam/GPSBlamMarker.java	(revision 33775)
+++ /applications/editors/josm/plugins/gpsblam/src/org/openstreetmap/josm/plugins/gpsblam/GPSBlamMarker.java	(revision 33776)
@@ -25,8 +25,9 @@
     /** construct a blammarker by analysis of selected GPS points */
     GPSBlamMarker(GPSBlamInputData inputData) {
+        Projection projection = Main.getProjection();
         // get mean east, north
         double meanEast=0.0, meanNorth=0.0;
         for (CachedLatLon cll : inputData) {
-            EastNorth en = cll.getEastNorth();
+            EastNorth en = cll.getEastNorth(projection);
             meanEast += en.east();
             meanNorth += en.north();
@@ -40,5 +41,5 @@
         double deast, dnorth;
         for (CachedLatLon cll : inputData) {
-            EastNorth en = cll.getEastNorth();
+            EastNorth en = cll.getEastNorth(projection);
             deast = en.east()-meanEast;
             dnorth = en.north()-meanNorth;
@@ -87,19 +88,20 @@
 
     void paint(Graphics2D g, MapView mv) {
+        Projection projection = Main.getProjection();
         g.setColor(Color.GREEN);
         g.setPaintMode();
         g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
         g.setStroke(new BasicStroke(2.0f));
-        Point hair1Point1 = mv.getPoint(hair1Coord1.getEastNorth());
-        Point hair1Point2 = mv.getPoint(hair1Coord2.getEastNorth());
-        Point hair2Point1 = mv.getPoint(hair2Coord1.getEastNorth());
-        Point hair2Point2 = mv.getPoint(hair2Coord2.getEastNorth());
+        Point hair1Point1 = mv.getPoint(hair1Coord1.getEastNorth(projection));
+        Point hair1Point2 = mv.getPoint(hair1Coord2.getEastNorth(projection));
+        Point hair2Point1 = mv.getPoint(hair2Coord1.getEastNorth(projection));
+        Point hair2Point2 = mv.getPoint(hair2Coord2.getEastNorth(projection));
         g.drawLine(hair1Point1.x, hair1Point1.y, hair1Point2.x, hair1Point2.y);
         g.drawLine(hair2Point1.x, hair2Point1.y, hair2Point2.x, hair2Point2.y);
 
-        Point2D meanPoint = mv.getPoint2D(mean.getEastNorth());
-        Point2D ellipsePoint1 = mv.getPoint2D(ellipseCoord1.getEastNorth());
-        Point2D ellipsePoint2 = mv.getPoint2D(ellipseCoord2.getEastNorth());
-        Point2D ellipsePoint3 = mv.getPoint2D(ellipseCoord3.getEastNorth());
+        Point2D meanPoint = mv.getPoint2D(mean.getEastNorth(projection));
+        Point2D ellipsePoint1 = mv.getPoint2D(ellipseCoord1.getEastNorth(projection));
+        Point2D ellipsePoint2 = mv.getPoint2D(ellipseCoord2.getEastNorth(projection));
+        Point2D ellipsePoint3 = mv.getPoint2D(ellipseCoord3.getEastNorth(projection));
         double majorAxis = ellipsePoint2.distance(ellipsePoint1);
         double minorAxis = ellipsePoint3.distance(ellipsePoint1);
Index: /applications/editors/josm/plugins/gpsblam/src/org/openstreetmap/josm/plugins/gpsblam/GPSBlamMode.java
===================================================================
--- /applications/editors/josm/plugins/gpsblam/src/org/openstreetmap/josm/plugins/gpsblam/GPSBlamMode.java	(revision 33775)
+++ /applications/editors/josm/plugins/gpsblam/src/org/openstreetmap/josm/plugins/gpsblam/GPSBlamMode.java	(revision 33776)
@@ -22,10 +22,12 @@
 import java.awt.geom.Path2D;
 
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.actions.mapmode.MapMode;
+import org.openstreetmap.josm.gui.MainApplication;
+import org.openstreetmap.josm.gui.MapView;
 import org.openstreetmap.josm.gui.layer.LayerManager.LayerAddEvent;
 import org.openstreetmap.josm.gui.layer.LayerManager.LayerChangeListener;
 import org.openstreetmap.josm.gui.layer.LayerManager.LayerOrderChangeEvent;
 import org.openstreetmap.josm.gui.layer.LayerManager.LayerRemoveEvent;
+import org.openstreetmap.josm.tools.Logging;
 
 class GPSBlamMode extends MapMode implements LayerChangeListener, MouseWheelListener, AWTEventListener {
@@ -45,11 +47,12 @@
     public void enterMode() {
         super.enterMode();
-        Main.map.mapView.addMouseListener(this);
-        Main.map.mapView.addMouseMotionListener(this);
-        Main.map.mapView.addMouseWheelListener(this);
+        MapView mapView = MainApplication.getMap().mapView;
+        mapView.addMouseListener(this);
+        mapView.addMouseMotionListener(this);
+        mapView.addMouseWheelListener(this);
         try {
             Toolkit.getDefaultToolkit().addAWTEventListener(this, AWTEvent.KEY_EVENT_MASK);
         } catch (SecurityException ex) {
-            Main.error(ex);
+            Logging.error(ex);
         }
 
@@ -72,7 +75,7 @@
         super.exitMode();
         getLayerManager().removeLayerChangeListener(this);
-        Main.map.mapView.removeMouseListener(this);
-        Main.map.mapView.removeMouseMotionListener(this);
-        Main.map.mapView.removeMouseWheelListener(this);
+        MainApplication.getMap().mapView.removeMouseListener(this);
+        MainApplication.getMap().mapView.removeMouseMotionListener(this);
+        MainApplication.getMap().mapView.removeMouseWheelListener(this);
         Toolkit.getDefaultToolkit().removeAWTEventListener(this);
     }
@@ -83,8 +86,8 @@
             pointPressed = new Point(e.getPoint());
             // gain exclusive use of mouse wheel for now
-            mapViewWheelListeners = Main.map.mapView.getMouseWheelListeners();
+            mapViewWheelListeners = MainApplication.getMap().mapView.getMouseWheelListeners();
             for (MouseWheelListener l : mapViewWheelListeners) {
                 if (l != this)
-                    Main.map.mapView.removeMouseWheelListener(l);
+                    MainApplication.getMap().mapView.removeMouseWheelListener(l);
             }
             paintBox(pointPressed, radius);
@@ -108,5 +111,5 @@
         for (MouseWheelListener l : mapViewWheelListeners) {
             if (l != this)
-                Main.map.mapView.addMouseWheelListener(l);
+                MainApplication.getMap().mapView.addMouseWheelListener(l);
         }
 
@@ -120,5 +123,5 @@
             }
             currentBlamLayer.addBlamMarker(new GPSBlamMarker(inputData));
-            Main.map.mapView.repaint();
+            MainApplication.getMap().mapView.repaint();
         }
 
@@ -144,6 +147,6 @@
 
     private void xorDrawBox(Point p1, Point p2, int radius){
-        if (Main.map != null) {
-            Graphics2D g = (Graphics2D) Main.map.mapView.getGraphics();
+        if (MainApplication.getMap() != null) {
+            Graphics2D g = (Graphics2D) MainApplication.getMap().mapView.getGraphics();
             g.setXORMode(Color.BLACK);
             g.setColor(Color.WHITE);
@@ -177,6 +180,6 @@
                 } catch (InternalError e) {
                     // Robustness against Java bug https://bugs.openjdk.java.net/browse/JDK-8041647
-                    Main.error(e);
-                    Main.error("Java bug JDK-8041647 occured. To avoid this bug, please consult https://bugs.openjdk.java.net/browse/JDK-8041647."
+                    Logging.error(e);
+                    Logging.error("Java bug JDK-8041647 occured. To avoid this bug, please consult https://bugs.openjdk.java.net/browse/JDK-8041647."
                             +" If the bug is fixed, please update your Java Runtime Environment.");
                 }
@@ -186,5 +189,5 @@
 
     private void paintBox(Point p2, int newRadius) {
-        if (Main.map != null) {
+        if (MainApplication.getMap() != null) {
             if (oldP2 != null) {
                 xorDrawBox(pointPressed, oldP2, radius); // clear old box
@@ -209,6 +212,6 @@
         if (e.getRemovedLayer() instanceof GPSBlamLayer) {
             currentBlamLayer = null;
-            if (Main.map.mapMode instanceof GPSBlamMode)
-                Main.map.selectSelectTool(false);
+            if (MainApplication.getMap().mapMode instanceof GPSBlamMode)
+                MainApplication.getMap().selectSelectTool(false);
         }
     }
