Index: applications/editors/josm/plugins/splinex/build.xml
===================================================================
--- applications/editors/josm/plugins/splinex/build.xml	(revision 33201)
+++ applications/editors/josm/plugins/splinex/build.xml	(revision 33534)
@@ -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="10580"/>
+    <property name="plugin.main.version" value="12663"/>
 
     <!-- Configure these properties (replace "..." accordingly).
Index: applications/editors/josm/plugins/splinex/src/org/openstreetmap/josm/plugins/Splinex/DrawSplineAction.java
===================================================================
--- applications/editors/josm/plugins/splinex/src/org/openstreetmap/josm/plugins/Splinex/DrawSplineAction.java	(revision 33201)
+++ applications/editors/josm/plugins/splinex/src/org/openstreetmap/josm/plugins/Splinex/DrawSplineAction.java	(revision 33534)
@@ -29,4 +29,5 @@
 import org.openstreetmap.josm.data.osm.visitor.paint.MapPaintSettings;
 import org.openstreetmap.josm.data.preferences.ColorProperty;
+import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.gui.MapFrame;
 import org.openstreetmap.josm.gui.MapView;
@@ -41,12 +42,13 @@
 import org.openstreetmap.josm.gui.layer.OsmDataLayer;
 import org.openstreetmap.josm.gui.util.KeyPressReleaseListener;
-import org.openstreetmap.josm.gui.util.ModifierListener;
+import org.openstreetmap.josm.gui.util.ModifierExListener;
 import org.openstreetmap.josm.plugins.Splinex.Spline.PointHandle;
 import org.openstreetmap.josm.plugins.Splinex.Spline.SplinePoint;
 import org.openstreetmap.josm.tools.ImageProvider;
+import org.openstreetmap.josm.tools.Logging;
 import org.openstreetmap.josm.tools.Shortcut;
 
 @SuppressWarnings("serial")
-public class DrawSplineAction extends MapMode implements MapViewPaintable, KeyPressReleaseListener, ModifierListener,
+public class DrawSplineAction extends MapMode implements MapViewPaintable, KeyPressReleaseListener, ModifierExListener,
         LayerChangeListener, ActiveLayerChangeListener {
     private final Cursor cursorJoinNode;
@@ -64,5 +66,5 @@
                 "spline2", // icon name
                 tr("Draw a spline curve"), // tooltip
-                mapFrame, getCursor());
+                getCursor());
 
         backspaceShortcut = Shortcut.registerShortcut("mapmode:backspace", tr("Backspace in Add mode"),
@@ -71,6 +73,6 @@
         cursorJoinNode = ImageProvider.getCursor("crosshair", "joinnode");
         cursorJoinWay = ImageProvider.getCursor("crosshair", "joinway");
-        Main.getLayerManager().addLayerChangeListener(this);
-        Main.getLayerManager().addActiveLayerChangeListener(this);
+        MainApplication.getLayerManager().addLayerChangeListener(this);
+        MainApplication.getLayerManager().addActiveLayerChangeListener(this);
         readPreferences();
     }
@@ -80,5 +82,5 @@
             return ImageProvider.getCursor("crosshair", "spline");
         } catch (Exception e) {
-            Main.error(e);
+            Logging.error(e);
         }
         return Cursor.getPredefinedCursor(Cursor.CROSSHAIR_CURSOR);
@@ -91,12 +93,13 @@
         super.enterMode();
 
-        Main.registerActionShortcut(backspaceAction, backspaceShortcut);
-
-        Main.map.mapView.addMouseListener(this);
-        Main.map.mapView.addMouseMotionListener(this);
-        Main.map.mapView.addTemporaryLayer(this);
-
-        Main.map.keyDetector.addModifierListener(this);
-        Main.map.keyDetector.addKeyListener(this);
+        MainApplication.registerActionShortcut(backspaceAction, backspaceShortcut);
+
+        MapFrame map = MainApplication.getMap();
+        map.mapView.addMouseListener(this);
+        map.mapView.addMouseMotionListener(this);
+        map.mapView.addTemporaryLayer(this);
+
+        map.keyDetector.addModifierExListener(this);
+        map.keyDetector.addKeyListener(this);
     }
 
@@ -115,19 +118,20 @@
     public void exitMode() {
         super.exitMode();
-        Main.map.mapView.removeMouseListener(this);
-        Main.map.mapView.removeMouseMotionListener(this);
-        Main.map.mapView.removeTemporaryLayer(this);
-        Main.unregisterActionShortcut(backspaceAction, backspaceShortcut);
-
-        Main.map.statusLine.activateAnglePanel(false);
-        Main.map.keyDetector.removeModifierListener(this);
-        Main.map.keyDetector.removeKeyListener(this);
+        MapFrame map = MainApplication.getMap();
+        map.mapView.removeMouseListener(this);
+        map.mapView.removeMouseMotionListener(this);
+        map.mapView.removeTemporaryLayer(this);
+        MainApplication.unregisterActionShortcut(backspaceAction, backspaceShortcut);
+
+        map.statusLine.activateAnglePanel(false);
+        map.keyDetector.removeModifierExListener(this);
+        map.keyDetector.removeKeyListener(this);
         removeHighlighting();
-        Main.map.mapView.repaint();
-    }
-
-    @Override
-    public void modifiersChanged(int modifiers) {
-        updateKeyModifiers(modifiers);
+        map.mapView.repaint();
+    }
+
+    @Override
+    public void modifiersExChanged(int modifiers) {
+        updateKeyModifiersEx(modifiers);
     }
 
@@ -150,5 +154,5 @@
             return;
         }
-        if (!Main.map.mapView.isActiveLayerDrawable()) return;
+        if (!MainApplication.getMap().mapView.isActiveLayerDrawable()) return;
         Spline spl = getSpline();
         if (spl == null) return;
@@ -157,13 +161,13 @@
         dragSpline = false;
         mouseDownTime = System.currentTimeMillis();
-        ph = spl.getNearestPoint(Main.map.mapView, e.getPoint());
+        ph = spl.getNearestPoint(MainApplication.getMap().mapView, e.getPoint());
         if (e.getClickCount() == 2) {
             if (!spl.isClosed() && spl.nodeCount() > 1 && ph != null && ph.point == SplinePoint.ENDPOINT
                     && ((ph.idx == 0 && direction == 1) || (ph.idx == spl.nodeCount() - 1 && direction == -1))) {
-                Main.main.undoRedo.add(spl.new CloseSplineCommand());
+                MainApplication.undoRedo.add(spl.new CloseSplineCommand());
                 return;
             }
             spl.finishSpline();
-            Main.map.repaint();
+            MainApplication.getMap().repaint();
             return;
         }
@@ -181,6 +185,6 @@
                         + ph.sn.cnext.north()) < EPSILON);
             }
-            if (ph.point == SplinePoint.ENDPOINT && !Main.main.undoRedo.commands.isEmpty()) {
-                Command cmd = Main.main.undoRedo.commands.getLast();
+            if (ph.point == SplinePoint.ENDPOINT && !MainApplication.undoRedo.commands.isEmpty()) {
+                Command cmd = MainApplication.undoRedo.commands.getLast();
                 if (cmd instanceof MoveCommand) {
                     mc = (MoveCommand) cmd;
@@ -192,6 +196,6 @@
                 }
             }
-            if (ph.point != SplinePoint.ENDPOINT && !Main.main.undoRedo.commands.isEmpty()) {
-                Command cmd = Main.main.undoRedo.commands.getLast();
+            if (ph.point != SplinePoint.ENDPOINT && !MainApplication.undoRedo.commands.isEmpty()) {
+                Command cmd = MainApplication.undoRedo.commands.getLast();
                 if (!(cmd instanceof Spline.EditSplineCommand && ((Spline.EditSplineCommand) cmd).sn == ph.sn))
                     dragControl = true;
@@ -199,5 +203,5 @@
             return;
         }
-        if (!ctrl && spl.doesHit(e.getX(), e.getY(), Main.map.mapView)) {
+        if (!ctrl && spl.doesHit(e.getX(), e.getY(), MainApplication.getMap().mapView)) {
             dragSpline = true;
             return;
@@ -212,16 +216,16 @@
         boolean existing = false;
         if (!ctrl) {
-            n = Main.map.mapView.getNearestNode(e.getPoint(), OsmPrimitive::isUsable);
+            n = MainApplication.getMap().mapView.getNearestNode(e.getPoint(), OsmPrimitive::isUsable);
             existing = true;
         }
         if (n == null) {
-            n = new Node(Main.map.mapView.getLatLon(e.getX(), e.getY()));
+            n = new Node(MainApplication.getMap().mapView.getLatLon(e.getX(), e.getY()));
             existing = false;
         }
         int idx = direction == -1 ? 0 : spl.nodeCount();
-        Main.main.undoRedo.add(spl.new AddSplineNodeCommand(new Spline.SNode(n), existing, idx));
+        MainApplication.undoRedo.add(spl.new AddSplineNodeCommand(new Spline.SNode(n), existing, idx));
         ph = spl.new PointHandle(idx, direction == -1 ? SplinePoint.CONTROL_PREV : SplinePoint.CONTROL_NEXT);
         lockCounterpart = true;
-        Main.map.repaint();
+        MainApplication.getMap().repaint();
     }
 
@@ -245,5 +249,5 @@
         updateKeyModifiers(e);
         if (mouseDownTime == null) return;
-        if (!Main.map.mapView.isActiveLayerDrawable()) return;
+        if (!MainApplication.getMap().mapView.isActiveLayerDrawable()) return;
         if (System.currentTimeMillis() - mouseDownTime < initialMoveDelay) return;
         Spline spl = getSpline();
@@ -252,15 +256,15 @@
         if (clickPos != null && clickPos.distanceSq(e.getPoint()) < initialMoveThreshold)
             return;
-        EastNorth en = Main.map.mapView.getEastNorth(e.getX(), e.getY());
+        EastNorth en = MainApplication.getMap().mapView.getEastNorth(e.getX(), e.getY());
         if (Main.getProjection().eastNorth2latlon(en).isOutSideWorld())
             return;
         if (dragSpline) {
             if (mc == null) {
-                mc = new MoveCommand(spl.getNodes(), Main.map.mapView.getEastNorth(clickPos.x, clickPos.y), en);
-                Main.main.undoRedo.add(mc);
+                mc = new MoveCommand(spl.getNodes(), MainApplication.getMap().mapView.getEastNorth(clickPos.x, clickPos.y), en);
+                MainApplication.undoRedo.add(mc);
                 clickPos = null;
             } else
                 mc.applyVectorTo(en);
-            Main.map.repaint();
+            MainApplication.getMap().repaint();
             return;
         }
@@ -270,10 +274,10 @@
             if (mc == null) {
                 mc = new MoveCommand(ph.sn.node, ph.sn.node.getEastNorth(), en);
-                Main.main.undoRedo.add(mc);
+                MainApplication.undoRedo.add(mc);
             } else
                 mc.applyVectorTo(en);
         } else {
             if (dragControl) {
-                Main.main.undoRedo.add(new Spline.EditSplineCommand(ph.sn));
+                MainApplication.undoRedo.add(new Spline.EditSplineCommand(ph.sn));
                 dragControl = false;
             }
@@ -286,5 +290,5 @@
             }
         }
-        Main.map.repaint();
+        MainApplication.getMap().repaint();
     }
 
@@ -295,5 +299,5 @@
     public void mouseMoved(MouseEvent e) {
         updateKeyModifiers(e);
-        if (!Main.map.mapView.isActiveLayerDrawable()) return;
+        if (!MainApplication.getMap().mapView.isActiveLayerDrawable()) return;
         Spline spl = getSpline();
         if (spl == null) return;
@@ -301,26 +305,26 @@
         PointHandle oldph = ph;
         boolean redraw = false;
-        ph = spl.getNearestPoint(Main.map.mapView, e.getPoint());
+        ph = spl.getNearestPoint(MainApplication.getMap().mapView, e.getPoint());
         if (ph == null)
-            if (!ctrl && spl.doesHit(e.getX(), e.getY(), Main.map.mapView)) {
+            if (!ctrl && spl.doesHit(e.getX(), e.getY(), MainApplication.getMap().mapView)) {
                 helperEndpoint = null;
-                Main.map.mapView.setNewCursor(Cursor.MOVE_CURSOR, this);
+                MainApplication.getMap().mapView.setNewCursor(Cursor.MOVE_CURSOR, this);
             } else {
                 Node n = null;
                 if (!ctrl)
-                    n = Main.map.mapView.getNearestNode(e.getPoint(), OsmPrimitive::isUsable);
+                    n = MainApplication.getMap().mapView.getNearestNode(e.getPoint(), OsmPrimitive::isUsable);
                 if (n == null) {
                     redraw = removeHighlighting();
                     helperEndpoint = e.getPoint();
-                    Main.map.mapView.setNewCursor(cursor, this);
+                    MainApplication.getMap().mapView.setNewCursor(cursor, this);
                 } else {
                     redraw = setHighlight(n);
-                    Main.map.mapView.setNewCursor(cursorJoinNode, this);
-                    helperEndpoint = Main.map.mapView.getPoint(n);
+                    MainApplication.getMap().mapView.setNewCursor(cursorJoinNode, this);
+                    helperEndpoint = MainApplication.getMap().mapView.getPoint(n);
                 }
             }
         else {
             helperEndpoint = null;
-            Main.map.mapView.setNewCursor(cursorJoinWay, this);
+            MainApplication.getMap().mapView.setNewCursor(cursorJoinWay, this);
             if (ph.point == SplinePoint.ENDPOINT)
                 redraw = setHighlight(ph.sn.node);
@@ -333,5 +337,5 @@
         if (redraw || oldHelperEndpoint != helperEndpoint || (oldph == null && ph != null)
                 || (oldph != null && !oldph.equals(ph)))
-            Main.map.repaint();
+            MainApplication.getMap().repaint();
     }
 
@@ -341,9 +345,9 @@
     @Override
     public void mouseExited(MouseEvent e) {
-        if (!Main.map.mapView.isActiveLayerDrawable())
+        if (!MainApplication.getMap().mapView.isActiveLayerDrawable())
             return;
         removeHighlighting();
         helperEndpoint = null;
-        Main.map.mapView.repaint();
+        MainApplication.getMap().mapView.repaint();
     }
 
@@ -396,5 +400,5 @@
         @Override
         public void actionPerformed(ActionEvent e) {
-            Main.main.undoRedo.undo();
+            MainApplication.undoRedo.undo();
         }
     }
@@ -417,5 +421,5 @@
     @Override
     public void activeOrEditLayerChanged(ActiveLayerChangeEvent e) {
-        splCached = layerSplines.get(Main.getLayerManager().getActiveLayer());
+        splCached = layerSplines.get(MainApplication.getLayerManager().getActiveLayer());
     }
 
@@ -444,10 +448,10 @@
             if (spl.nodeCount() == 3 && spl.isClosed() && ph.idx == 1)
                 return; // Don't allow to delete node when it results with two-node closed spline
-            Main.main.undoRedo.add(spl.new DeleteSplineNodeCommand(ph.idx));
+            MainApplication.undoRedo.add(spl.new DeleteSplineNodeCommand(ph.idx));
             e.consume();
         }
         if (e.getKeyCode() == KeyEvent.VK_ESCAPE && direction != 0) {
             direction = 0;
-            Main.map.mapView.repaint();
+            MainApplication.getMap().mapView.repaint();
             e.consume();
         }
Index: applications/editors/josm/plugins/splinex/src/org/openstreetmap/josm/plugins/Splinex/Spline.java
===================================================================
--- applications/editors/josm/plugins/splinex/src/org/openstreetmap/josm/plugins/Splinex/Spline.java	(revision 33201)
+++ applications/editors/josm/plugins/splinex/src/org/openstreetmap/josm/plugins/Splinex/Spline.java	(revision 33534)
@@ -28,9 +28,10 @@
 import org.openstreetmap.josm.command.SequenceCommand;
 import org.openstreetmap.josm.data.coor.EastNorth;
+import org.openstreetmap.josm.data.osm.DefaultNameFormatter;
 import org.openstreetmap.josm.data.osm.Node;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
 import org.openstreetmap.josm.data.osm.Way;
 import org.openstreetmap.josm.data.preferences.IntegerProperty;
-import org.openstreetmap.josm.gui.DefaultNameFormatter;
+import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.gui.MapView;
 import org.openstreetmap.josm.gui.NavigatableComponent;
@@ -273,5 +274,5 @@
         if (!cmds.isEmpty())
             cmds.add(new AddCommand(w));
-        Main.main.undoRedo.add(new FinishSplineCommand(cmds));
+        MainApplication.undoRedo.add(new FinishSplineCommand(cmds));
     }
 
Index: applications/editors/josm/plugins/splinex/src/org/openstreetmap/josm/plugins/Splinex/SplineHitTest.java
===================================================================
--- applications/editors/josm/plugins/splinex/src/org/openstreetmap/josm/plugins/Splinex/SplineHitTest.java	(revision 33201)
+++ applications/editors/josm/plugins/splinex/src/org/openstreetmap/josm/plugins/Splinex/SplineHitTest.java	(revision 33534)
@@ -3,4 +3,5 @@
 
 import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.tools.Logging;
 
 public class SplineHitTest {
@@ -29,6 +30,6 @@
     }
     public boolean checkCurve(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4, int depth) {
-        if (Main.isDebugEnabled()) {
-            Main.debug("checkCurve {0} {1} {2} {3} {4} {5} {6} {7}", x1, y1, x2, y2, x3, y3, x4, y4);
+        if (Logging.isDebugEnabled()) {
+            Logging.debug("checkCurve {0} {1} {2} {3} {4} {5} {6} {7}", x1, y1, x2, y2, x3, y3, x4, y4);
         }
         //chkCnt++;
Index: applications/editors/josm/plugins/splinex/src/org/openstreetmap/josm/plugins/Splinex/SplinexPlugin.java
===================================================================
--- applications/editors/josm/plugins/splinex/src/org/openstreetmap/josm/plugins/Splinex/SplinexPlugin.java	(revision 33201)
+++ applications/editors/josm/plugins/splinex/src/org/openstreetmap/josm/plugins/Splinex/SplinexPlugin.java	(revision 33534)
@@ -2,6 +2,6 @@
 package org.openstreetmap.josm.plugins.Splinex;
 
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.gui.IconToggleButton;
+import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.gui.MapFrame;
 import org.openstreetmap.josm.gui.preferences.PreferenceSetting;
@@ -26,5 +26,6 @@
     public void mapFrameInitialized(MapFrame oldFrame, MapFrame newFrame) {
         if (oldFrame == null && newFrame != null) { // map frame added
-            Main.map.addMapMode(new IconToggleButton(new DrawSplineAction(Main.map)));
+            MapFrame map = MainApplication.getMap();
+            map.addMapMode(new IconToggleButton(new DrawSplineAction(map)));
         }
     }
Index: applications/editors/josm/plugins/splinex/src/org/openstreetmap/josm/plugins/Splinex/UndeleteNodeCommand.java
===================================================================
--- applications/editors/josm/plugins/splinex/src/org/openstreetmap/josm/plugins/Splinex/UndeleteNodeCommand.java	(revision 33201)
+++ applications/editors/josm/plugins/splinex/src/org/openstreetmap/josm/plugins/Splinex/UndeleteNodeCommand.java	(revision 33534)
@@ -7,7 +7,7 @@
 
 import org.openstreetmap.josm.command.Command;
+import org.openstreetmap.josm.data.osm.DefaultNameFormatter;
 import org.openstreetmap.josm.data.osm.Node;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
-import org.openstreetmap.josm.gui.DefaultNameFormatter;
 
 class UndeleteNodeCommand extends Command {
