Index: applications/editors/josm/plugins/routing/build.xml
===================================================================
--- applications/editors/josm/plugins/routing/build.xml	(revision 33741)
+++ applications/editors/josm/plugins/routing/build.xml	(revision 33794)
@@ -5,5 +5,5 @@
     <property name="commit.message" value="added one-way support in roundabouts"/>
     <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
-    <property name="plugin.main.version" value="10580"/>
+    <property name="plugin.main.version" value="12840"/>
 
     <!--
Index: applications/editors/josm/plugins/routing/src/com/innovant/josm/jrt/core/RoutingGraph.java
===================================================================
--- applications/editors/josm/plugins/routing/src/com/innovant/josm/jrt/core/RoutingGraph.java	(revision 33741)
+++ applications/editors/josm/plugins/routing/src/com/innovant/josm/jrt/core/RoutingGraph.java	(revision 33794)
@@ -13,9 +13,9 @@
 import org.jgrapht.alg.DijkstraShortestPath;
 import org.jgrapht.graph.DirectedWeightedMultigraph;
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.coor.LatLon;
 import org.openstreetmap.josm.data.osm.DataSet;
 import org.openstreetmap.josm.data.osm.Node;
 import org.openstreetmap.josm.data.osm.Way;
+import org.openstreetmap.josm.gui.MainApplication;
 
 import com.innovant.josm.jrt.osm.OsmEdge;
@@ -318,5 +318,5 @@
         Graph<Node, OsmEdge> g;
         double totalWeight = 0;
-        RoutingLayer layer = (RoutingLayer) Main.getLayerManager().getActiveLayer();
+        RoutingLayer layer = (RoutingLayer) MainApplication.getLayerManager().getActiveLayer();
         RoutingModel routingModel = layer.getRoutingModel();
 
Index: applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/RoutingLayer.java
===================================================================
--- applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/RoutingLayer.java	(revision 33741)
+++ applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/RoutingLayer.java	(revision 33794)
@@ -26,4 +26,5 @@
 import org.openstreetmap.josm.data.osm.Way;
 import org.openstreetmap.josm.data.osm.visitor.BoundingXYVisitor;
+import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.gui.MapView;
 import org.openstreetmap.josm.gui.NavigatableComponent;
@@ -102,5 +103,5 @@
 
         this.routingModel.routingGraph.createGraph();    /* construct the graph right after we we create the layer */
-        Main.map.repaint();                            /* update MapView */
+        invalidate();                            /* update MapView */
     }
 
@@ -135,5 +136,5 @@
                 if (n.isDeleted() || n.isIncomplete()) continue;
 
-                Point P = Main.map.mapView.getPoint(n);
+                Point P = MainApplication.getMap().mapView.getPoint(n);
                 double dist = p.distance(P);
                 if (dist < snapDistance) {
Index: applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/RoutingPlugin.java
===================================================================
--- applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/RoutingPlugin.java	(revision 33741)
+++ applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/RoutingPlugin.java	(revision 33794)
@@ -9,5 +9,4 @@
 import org.apache.log4j.Logger;
 import org.apache.log4j.xml.DOMConfigurator;
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.osm.event.AbstractDatasetChangedEvent;
 import org.openstreetmap.josm.data.osm.event.DataSetListenerAdapter;
@@ -15,4 +14,5 @@
 import org.openstreetmap.josm.data.osm.event.DatasetEventManager.FireMode;
 import org.openstreetmap.josm.gui.IconToggleButton;
+import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.gui.MapFrame;
 import org.openstreetmap.josm.gui.layer.Layer;
@@ -25,4 +25,5 @@
 import org.openstreetmap.josm.plugins.Plugin;
 import org.openstreetmap.josm.plugins.PluginInformation;
+import org.openstreetmap.josm.tools.Logging;
 
 import com.innovant.josm.plugin.routing.actions.AddRouteNodeAction;
@@ -128,5 +129,5 @@
         menu = new RoutingMenu();
         // Register this class as LayerChangeListener
-        Main.getLayerManager().addLayerChangeListener(this);
+        MainApplication.getLayerManager().addLayerChangeListener(this);
         DatasetEventManager.getInstance().addDatasetListener(datasetAdapter, FireMode.IN_EDT_CONSOLIDATED);
         logger.debug("Finished loading plugin");
@@ -150,9 +151,9 @@
 
     public void addLayer() {
-        OsmDataLayer osmLayer = Main.getLayerManager().getEditLayer();
+        OsmDataLayer osmLayer = MainApplication.getLayerManager().getEditLayer();
         if (osmLayer != null) {
             RoutingLayer layer = new RoutingLayer(tr("Routing") + " [" + osmLayer.getName() + "]", osmLayer);
             layers.add(layer);
-            Main.getLayerManager().addLayer(layer);
+            MainApplication.getLayerManager().addLayer(layer);
         }
     }
@@ -162,7 +163,7 @@
         if (newFrame != null) {
             // Create plugin map modes
-            addRouteNodeAction = new AddRouteNodeAction(newFrame);
-            removeRouteNodeAction = new RemoveRouteNodeAction(newFrame);
-            moveRouteNodeAction = new MoveRouteNodeAction(newFrame);
+            addRouteNodeAction = new AddRouteNodeAction();
+            removeRouteNodeAction = new RemoveRouteNodeAction();
+            moveRouteNodeAction = new MoveRouteNodeAction();
             // Create plugin buttons and add them to the toolbar
             addRouteNodeButton = new IconToggleButton(addRouteNodeAction);
@@ -216,5 +217,5 @@
             menu.enableRestOfItems();
             // Set layer on top and select layer, also refresh toggleDialog to reflect selection
-            Main.map.mapView.moveLayer(newLayer, 0);
+            MainApplication.getMap().mapView.moveLayer(newLayer, 0);
             logger.debug("Added routing layer.");
         }
@@ -241,7 +242,7 @@
                     try {
                         // Remove layer
-                        Main.getLayerManager().removeLayer(layersArray[i]);
+                        MainApplication.getLayerManager().removeLayer(layersArray[i]);
                     } catch (IllegalArgumentException e) {
-                        Main.error(e);
+                        Logging.error(e);
                     }
                 }
Index: applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/actions/AddRouteNodeAction.java
===================================================================
--- applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/actions/AddRouteNodeAction.java	(revision 33741)
+++ applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/actions/AddRouteNodeAction.java	(revision 33794)
@@ -7,8 +7,7 @@
 
 import org.apache.log4j.Logger;
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.actions.mapmode.MapMode;
 import org.openstreetmap.josm.data.osm.Node;
-import org.openstreetmap.josm.gui.MapFrame;
+import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.gui.layer.Layer;
 import org.openstreetmap.josm.tools.ImageProvider;
@@ -35,19 +34,19 @@
      * @param mapFrame map frame
      */
-    public AddRouteNodeAction(MapFrame mapFrame) {
+    public AddRouteNodeAction() {
         // TODO Use constructor with shortcut
         super(tr("Routing"), "add",
                 tr("Click to add destination."),
-                mapFrame, ImageProvider.getCursor("crosshair", null));
+                ImageProvider.getCursor("crosshair", null));
     }
 
     @Override public void enterMode() {
         super.enterMode();
-        Main.map.mapView.addMouseListener(this);
+        MainApplication.getMap().mapView.addMouseListener(this);
     }
 
     @Override public void exitMode() {
         super.exitMode();
-        Main.map.mapView.removeMouseListener(this);
+        MainApplication.getMap().mapView.removeMouseListener(this);
     }
 
@@ -57,6 +56,6 @@
             // Search for nearest highway node
             Node node = null;
-            if (Main.getLayerManager().getActiveLayer() instanceof RoutingLayer) {
-                RoutingLayer layer = (RoutingLayer) Main.getLayerManager().getActiveLayer();
+            if (MainApplication.getLayerManager().getActiveLayer() instanceof RoutingLayer) {
+                RoutingLayer layer = (RoutingLayer) MainApplication.getLayerManager().getActiveLayer();
                 node = layer.getNearestHighwayNode(e.getPoint());
                 if (node == null) {
@@ -69,5 +68,5 @@
             }
         }
-        Main.map.repaint();
+        MainApplication.getMap().repaint();
     }
 
Index: applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/actions/MoveRouteNodeAction.java
===================================================================
--- applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/actions/MoveRouteNodeAction.java	(revision 33741)
+++ applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/actions/MoveRouteNodeAction.java	(revision 33794)
@@ -9,8 +9,7 @@
 
 import org.apache.log4j.Logger;
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.actions.mapmode.MapMode;
 import org.openstreetmap.josm.data.osm.Node;
-import org.openstreetmap.josm.gui.MapFrame;
+import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.gui.layer.Layer;
 import org.openstreetmap.josm.tools.ImageProvider;
@@ -49,19 +48,19 @@
      * @param mapFrame map frame
      */
-    public MoveRouteNodeAction(MapFrame mapFrame) {
+    public MoveRouteNodeAction() {
         // TODO Use constructor with shortcut
         super(tr("Routing"), "move",
                 tr("Click and drag to move destination"),
-                mapFrame, ImageProvider.getCursor("normal", "move"));
+                ImageProvider.getCursor("normal", "move"));
     }
 
     @Override public void enterMode() {
         super.enterMode();
-        Main.map.mapView.addMouseListener(this);
+        MainApplication.getMap().mapView.addMouseListener(this);
     }
 
     @Override public void exitMode() {
         super.exitMode();
-        Main.map.mapView.removeMouseListener(this);
+        MainApplication.getMap().mapView.removeMouseListener(this);
     }
 
@@ -69,7 +68,7 @@
         // If left button is pressed
         if (e.getButton() == MouseEvent.BUTTON1) {
-            if (Main.getLayerManager().getActiveLayer() instanceof RoutingLayer) {
+            if (MainApplication.getLayerManager().getActiveLayer() instanceof RoutingLayer) {
                 requestFocusInMapView();
-                RoutingLayer layer = (RoutingLayer) Main.getLayerManager().getActiveLayer();
+                RoutingLayer layer = (RoutingLayer) MainApplication.getLayerManager().getActiveLayer();
                 RoutingModel routingModel = layer.getRoutingModel();
                 // Search for the nearest node in the list
@@ -79,5 +78,5 @@
                 for (int i = 0; i < nl.size(); i++) {
                     Node node = nl.get(i);
-                    double d = Main.map.mapView.getPoint(node).distanceSq(e.getPoint());
+                    double d = MainApplication.getMap().mapView.getPoint(node).distanceSq(e.getPoint());
                     if (d < dmax) {
                         dmax = d;
@@ -102,6 +101,6 @@
 
     private void searchAndReplaceNode(Point point) {
-        if (Main.getLayerManager().getActiveLayer() instanceof RoutingLayer) {
-            RoutingLayer layer = (RoutingLayer) Main.getLayerManager().getActiveLayer();
+        if (MainApplication.getLayerManager().getActiveLayer() instanceof RoutingLayer) {
+            RoutingLayer layer = (RoutingLayer) MainApplication.getLayerManager().getActiveLayer();
             RoutingModel routingModel = layer.getRoutingModel();
             RoutingDialog routingDialog = RoutingPlugin.getInstance().getRoutingDialog();
@@ -118,5 +117,5 @@
             routingModel.insertNode(index, node);
             routingDialog.insertNode(index, node);
-            Main.map.repaint();
+            MainApplication.getMap().repaint();
         }
     }
Index: applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/actions/RemoveRouteNodeAction.java
===================================================================
--- applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/actions/RemoveRouteNodeAction.java	(revision 33741)
+++ applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/actions/RemoveRouteNodeAction.java	(revision 33794)
@@ -8,8 +8,7 @@
 
 import org.apache.log4j.Logger;
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.actions.mapmode.MapMode;
 import org.openstreetmap.josm.data.osm.Node;
-import org.openstreetmap.josm.gui.MapFrame;
+import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.gui.layer.Layer;
 import org.openstreetmap.josm.tools.ImageProvider;
@@ -38,19 +37,19 @@
     static Logger logger = Logger.getLogger(RoutingLayer.class);
 
-    public RemoveRouteNodeAction(MapFrame mapFrame) {
+    public RemoveRouteNodeAction() {
         // TODO Use constructor with shortcut
         super(tr("Routing"), "remove",
                 tr("Click to remove destination"),
-                mapFrame, ImageProvider.getCursor("normal", "delete"));
+                ImageProvider.getCursor("normal", "delete"));
     }
 
     @Override public void enterMode() {
         super.enterMode();
-        Main.map.mapView.addMouseListener(this);
+        MainApplication.getMap().mapView.addMouseListener(this);
     }
 
     @Override public void exitMode() {
         super.exitMode();
-        Main.map.mapView.removeMouseListener(this);
+        MainApplication.getMap().mapView.removeMouseListener(this);
     }
 
@@ -58,6 +57,6 @@
         // If left button is clicked
         if (e.getButton() == MouseEvent.BUTTON1) {
-            if (Main.getLayerManager().getActiveLayer() instanceof RoutingLayer) {
-                RoutingLayer layer = (RoutingLayer) Main.getLayerManager().getActiveLayer();
+            if (MainApplication.getLayerManager().getActiveLayer() instanceof RoutingLayer) {
+                RoutingLayer layer = (RoutingLayer) MainApplication.getLayerManager().getActiveLayer();
                 RoutingModel routingModel = layer.getRoutingModel();
                 // Search for the nearest node in the list
@@ -67,5 +66,5 @@
                 for (int i = 0; i < nl.size(); i++) {
                     Node node = nl.get(i);
-                    double d = Main.map.mapView.getPoint(node).distanceSq(e.getPoint());
+                    double d = MainApplication.getMap().mapView.getPoint(node).distanceSq(e.getPoint());
                     if (d < dmax) {
                         dmax = d;
@@ -79,5 +78,5 @@
                     routingModel.removeNode(index);
                     RoutingPlugin.getInstance().getRoutingDialog().removeNode(index);
-                    Main.map.repaint();
+                    MainApplication.getMap().repaint();
                 } else {
                     logger.debug("Can't find a node to remove.");
Index: applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/gui/RoutingDialog.java
===================================================================
--- applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/gui/RoutingDialog.java	(revision 33741)
+++ applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/gui/RoutingDialog.java	(revision 33794)
@@ -11,6 +11,6 @@
 import javax.swing.JScrollPane;
 
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.osm.Node;
+import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.gui.dialogs.ToggleDialog;
 import org.openstreetmap.josm.tools.Shortcut;
@@ -101,6 +101,6 @@
     public void refresh() {
         clearNodes();
-        if (Main.getLayerManager().getActiveLayer() instanceof RoutingLayer) {
-            RoutingLayer routingLayer = (RoutingLayer) Main.getLayerManager().getActiveLayer();
+        if (MainApplication.getLayerManager().getActiveLayer() instanceof RoutingLayer) {
+            RoutingLayer routingLayer = (RoutingLayer) MainApplication.getLayerManager().getActiveLayer();
             RoutingModel routingModel = routingLayer.getRoutingModel();
             for (Node n : routingModel.getSelectedNodes()) {
Index: applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/gui/RoutingMenu.java
===================================================================
--- applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/gui/RoutingMenu.java	(revision 33741)
+++ applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/gui/RoutingMenu.java	(revision 33794)
@@ -17,5 +17,5 @@
 import javax.swing.JRadioButtonMenuItem;
 
-import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.gui.MainMenu;
 
@@ -47,5 +47,5 @@
      */
     public RoutingMenu() {
-        MainMenu mm = Main.main.menu;
+        MainMenu mm = MainApplication.getMenu();
         menu = mm.addMenu("Routing", tr("Routing"), KeyEvent.VK_O, mm.getDefaultMenuPos(), ht("/Plugin/Routing"));
 
@@ -69,6 +69,6 @@
             @Override
             public void itemStateChanged(ItemEvent e) {
-                if (Main.getLayerManager().getActiveLayer() instanceof RoutingLayer) {
-                    RoutingLayer layer = (RoutingLayer) Main.getLayerManager().getActiveLayer();
+                if (MainApplication.getLayerManager().getActiveLayer() instanceof RoutingLayer) {
+                    RoutingLayer layer = (RoutingLayer) MainApplication.getLayerManager().getActiveLayer();
                     RoutingModel routingModel = layer.getRoutingModel();
                     if (e.getStateChange() == ItemEvent.SELECTED) {
@@ -82,5 +82,5 @@
                     //FIXME: do not change node but recalculate routing.
                     routingModel.setNodesChanged();
-                    Main.map.repaint();
+                    MainApplication.getMap().repaint();
                 }
             }
@@ -99,6 +99,6 @@
             @Override
             public void itemStateChanged(ItemEvent e) {
-                if (Main.getLayerManager().getActiveLayer() instanceof RoutingLayer) {
-                    RoutingLayer layer = (RoutingLayer) Main.getLayerManager().getActiveLayer();
+                if (MainApplication.getLayerManager().getActiveLayer() instanceof RoutingLayer) {
+                    RoutingLayer layer = (RoutingLayer) MainApplication.getLayerManager().getActiveLayer();
                     RoutingModel routingModel = layer.getRoutingModel();
                     if (e.getStateChange() == ItemEvent.SELECTED)
@@ -108,5 +108,5 @@
                     routingModel.setNodesChanged();
                     routingModel.setOnewayChanged();
-                    Main.map.repaint();
+                    MainApplication.getMap().repaint();
                 }
             }
@@ -120,9 +120,9 @@
             @Override
             public void actionPerformed(ActionEvent e) {
-                if (Main.getLayerManager().getActiveLayer() instanceof RoutingLayer) {
-                    RoutingLayer layer = (RoutingLayer) Main.getLayerManager().getActiveLayer();
+                if (MainApplication.getLayerManager().getActiveLayer() instanceof RoutingLayer) {
+                    RoutingLayer layer = (RoutingLayer) MainApplication.getLayerManager().getActiveLayer();
                     RoutingModel routingModel = layer.getRoutingModel();
                     routingModel.reverseNodes();
-                    Main.map.repaint();
+                    MainApplication.getMap().repaint();
                 }
             }
@@ -134,11 +134,11 @@
             @Override
             public void actionPerformed(ActionEvent e) {
-                if (Main.getLayerManager().getActiveLayer() instanceof RoutingLayer) {
-                    RoutingLayer layer = (RoutingLayer) Main.getLayerManager().getActiveLayer();
+                if (MainApplication.getLayerManager().getActiveLayer() instanceof RoutingLayer) {
+                    RoutingLayer layer = (RoutingLayer) MainApplication.getLayerManager().getActiveLayer();
                     RoutingModel routingModel = layer.getRoutingModel();
                     // Reset routing nodes and paths
                     routingModel.reset();
                     RoutingPlugin.getInstance().getRoutingDialog().clearNodes();
-                    Main.map.repaint();
+                    MainApplication.getMap().repaint();
                 }
             }
@@ -150,16 +150,13 @@
             @Override
             public void actionPerformed(ActionEvent e) {
-
-                if (Main.getLayerManager().getActiveLayer() instanceof RoutingLayer) {
-                    RoutingLayer layer = (RoutingLayer) Main.getLayerManager().getActiveLayer();
+                if (MainApplication.getLayerManager().getActiveLayer() instanceof RoutingLayer) {
+                    RoutingLayer layer = (RoutingLayer) MainApplication.getLayerManager().getActiveLayer();
                     RoutingModel routingModel = layer.getRoutingModel();
                     routingModel.routingGraph.resetGraph();
                     routingModel.routingGraph.createGraph();
                 }
-
             }
         });
         menu.add(regraphMI);
-
 
         // Initially disabled
Index: applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/gui/RoutingPreferenceDialog.java
===================================================================
--- applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/gui/RoutingPreferenceDialog.java	(revision 33741)
+++ applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/gui/RoutingPreferenceDialog.java	(revision 33794)
@@ -193,5 +193,5 @@
             logger.debug("Loading Default Preferences.");
             for (OsmWayTypes owt : OsmWayTypes.values()) {
-                Main.pref.putInteger("routing.profile.default.speed."
+                Main.pref.putInt("routing.profile.default.speed."
                         + owt.getTag(), owt.getSpeed());
             }
