Index: applications/editors/josm/plugins/junctionchecking/build.xml
===================================================================
--- applications/editors/josm/plugins/junctionchecking/build.xml	(revision 33777)
+++ applications/editors/josm/plugins/junctionchecking/build.xml	(revision 33778)
@@ -3,5 +3,5 @@
     <property name="commit.message" value="Changed the constructor signature of the plugin main class"/>
     <!-- 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"/>
     
     <!-- Configure these properties (replace "..." accordingly).
Index: applications/editors/josm/plugins/junctionchecking/src/org/openstreetmap/josm/plugins/JunctionChecker/DigraphCreationTask.java
===================================================================
--- applications/editors/josm/plugins/junctionchecking/src/org/openstreetmap/josm/plugins/JunctionChecker/DigraphCreationTask.java	(revision 33777)
+++ applications/editors/josm/plugins/junctionchecking/src/org/openstreetmap/josm/plugins/JunctionChecker/DigraphCreationTask.java	(revision 33778)
@@ -12,7 +12,9 @@
 import org.openstreetmap.josm.data.Bounds;
 import org.openstreetmap.josm.data.DataSource;
+import org.openstreetmap.josm.data.osm.DataSet;
 import org.openstreetmap.josm.data.osm.Node;
 import org.openstreetmap.josm.data.osm.Relation;
 import org.openstreetmap.josm.data.osm.Way;
+import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.gui.PleaseWaitRunnable;
 import org.openstreetmap.josm.gui.layer.OsmDataLayer;
@@ -62,6 +64,6 @@
     private void removeDigraphLayer() {
         ChannelDiGraphLayer layer = plugin.getChannelDigraphLayer();
-        if (Main.getLayerManager().containsLayer(layer)) {
-            Main.getLayerManager().removeLayer(layer);
+        if (MainApplication.getLayerManager().containsLayer(layer)) {
+            MainApplication.getLayerManager().removeLayer(layer);
         }
     }
@@ -71,6 +73,6 @@
     OsmTransferException {
         //Prüfen, ob der ausgewählte Layer ein OSMDataLayer ist
-        if (Main.map == null
-                || !Main.map.isVisible() || !(Main.getLayerManager().getActiveLayer() instanceof OsmDataLayer)) {
+        if (MainApplication.getMap() == null
+                || !MainApplication.getMap().isVisible() || !(MainApplication.getLayerManager().getActiveLayer() instanceof OsmDataLayer)) {
             JOptionPane.showMessageDialog(Main.parent, tr("this layer is no osm data layer"));
             return;
@@ -91,21 +93,19 @@
         OSMGraph graph = new OSMGraph();
         //Der vom Benutzer in JOSM ausgewählte, zur Zeit aktive Layer wird der PLugin-OSM-Layer
-        plugin.setOsmlayer((OsmDataLayer) Main.getLayerManager().getActiveLayer());
-        Iterator<Node> it = Main.getLayerManager().getEditDataSet().getNodes().iterator();
+        plugin.setOsmlayer((OsmDataLayer) MainApplication.getLayerManager().getActiveLayer());
+        DataSet ds = MainApplication.getLayerManager().getEditDataSet();
+        Iterator<Node> it = ds.getNodes().iterator();
         while (it.hasNext()) {
             graph.addNode(it.next());
         }
-
-        Iterator<Way> itway = Main.getLayerManager().getEditDataSet().getWays()
-        .iterator();
+        Iterator<Way> itway = ds.getWays().iterator();
         while (itway.hasNext()) {
             graph.addWay(itway.next());
         }
-        Iterator<Relation> itrel = Main.getLayerManager().getEditDataSet().getRelations()
-        .iterator();
+        Iterator<Relation> itrel = ds.getRelations().iterator();
         while (itrel.hasNext()) {
             graph.addRelation(itrel.next());
         }
-        Iterator<DataSource> itdata = Main.getLayerManager().getEditDataSet().getDataSources().iterator();
+        Iterator<DataSource> itdata = ds.getDataSources().iterator();
         while (itdata.hasNext()) {
             Bounds b = itdata.next().bounds;
@@ -151,8 +151,8 @@
         plugin.setChannelDigraph(cdgb.getDigraph());
         plugin.getJcMapMode().setDigraph(cdgb.getDigraph());
-        plugin.setNormalMapMode(Main.map.mapMode);
-        Main.map.selectMapMode(plugin.getJcMapMode());
-        Main.getLayerManager().addLayer(plugin.getChannelDigraphLayer());
-        Main.getLayerManager().setActiveLayer(plugin.getChannelDigraphLayer());
+        plugin.setNormalMapMode(MainApplication.getMap().mapMode);
+        MainApplication.getMap().selectMapMode(plugin.getJcMapMode());
+        MainApplication.getLayerManager().addLayer(plugin.getChannelDigraphLayer());
+        MainApplication.getLayerManager().setActiveLayer(plugin.getChannelDigraphLayer());
     }
 }
Index: applications/editors/josm/plugins/junctionchecking/src/org/openstreetmap/josm/plugins/JunctionChecker/JunctionCheckDialog.java
===================================================================
--- applications/editors/josm/plugins/junctionchecking/src/org/openstreetmap/josm/plugins/JunctionChecker/JunctionCheckDialog.java	(revision 33777)
+++ applications/editors/josm/plugins/junctionchecking/src/org/openstreetmap/josm/plugins/JunctionChecker/JunctionCheckDialog.java	(revision 33778)
@@ -19,5 +19,5 @@
 import javax.swing.border.TitledBorder;
 
-import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.gui.SideButton;
 import org.openstreetmap.josm.gui.dialogs.ToggleDialog;
@@ -95,7 +95,6 @@
             @Override
             public void actionPerformed(ActionEvent e) {
-                    DigraphCreationTask dct = new DigraphCreationTask(plugin, digraphsealcb.isSelected(), sccCB.isSelected());
-                    Main.worker.submit(dct);
-                    setActivateJunctionCheckOrSearch(true);
+                MainApplication.worker.submit(new DigraphCreationTask(plugin, digraphsealcb.isSelected(), sccCB.isSelected()));
+                setActivateJunctionCheckOrSearch(true);
             }
         });
@@ -108,6 +107,5 @@
             @Override
             public void actionPerformed(ActionEvent e) {
-                PrepareJunctionCheckorSearch pjc = new PrepareJunctionCheckorSearch(plugin, smodel.getNumber().intValue(), produceRelation.isSelected());
-                pjc.prepareJunctionCheck();
+                new PrepareJunctionCheckorSearch(plugin, smodel.getNumber().intValue(), produceRelation.isSelected()).prepareJunctionCheck();
             }
         });
@@ -121,6 +119,5 @@
             @Override
             public void actionPerformed(ActionEvent e) {
-                PrepareJunctionCheckorSearch pjc = new PrepareJunctionCheckorSearch(plugin, smodel.getNumber().intValue(), produceRelation.isSelected());
-                pjc.prepareJunctionSearch();
+                new PrepareJunctionCheckorSearch(plugin, smodel.getNumber().intValue(), produceRelation.isSelected()).prepareJunctionSearch();
             }
         });
@@ -131,5 +128,4 @@
         }));
     }
-
 
     /**
Index: applications/editors/josm/plugins/junctionchecking/src/org/openstreetmap/josm/plugins/JunctionChecker/JunctionCheckTask.java
===================================================================
--- applications/editors/josm/plugins/junctionchecking/src/org/openstreetmap/josm/plugins/JunctionChecker/JunctionCheckTask.java	(revision 33777)
+++ applications/editors/josm/plugins/junctionchecking/src/org/openstreetmap/josm/plugins/JunctionChecker/JunctionCheckTask.java	(revision 33778)
@@ -11,4 +11,5 @@
 
 import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.gui.PleaseWaitRunnable;
 import org.openstreetmap.josm.io.OsmTransferException;
@@ -89,5 +90,5 @@
             plugin.getChannelDigraph().addJunctioncandidateChannel(jc.getSubJunction().get(i));
         }
-        Main.getLayerManager().setActiveLayer(plugin.getChannelDigraphLayer());
+        MainApplication.getLayerManager().setActiveLayer(plugin.getChannelDigraphLayer());
     }
 }
Index: applications/editors/josm/plugins/junctionchecking/src/org/openstreetmap/josm/plugins/JunctionChecker/JunctionCheckerMapMode.java
===================================================================
--- applications/editors/josm/plugins/junctionchecking/src/org/openstreetmap/josm/plugins/JunctionChecker/JunctionCheckerMapMode.java	(revision 33777)
+++ applications/editors/josm/plugins/junctionchecking/src/org/openstreetmap/josm/plugins/JunctionChecker/JunctionCheckerMapMode.java	(revision 33778)
@@ -14,4 +14,5 @@
 import org.openstreetmap.josm.actions.mapmode.MapMode;
 import org.openstreetmap.josm.data.coor.LatLon;
+import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.gui.MapFrame;
 import org.openstreetmap.josm.gui.layer.Layer;
@@ -40,18 +41,18 @@
     @Override public void enterMode() {
         super.enterMode();
-        Main.map.mapView.addMouseListener(this);
-        Main.map.mapView.addMouseMotionListener(this);
-        Main.getLayerManager().addActiveLayerChangeListener(this);
+        MainApplication.getMap().mapView.addMouseListener(this);
+        MainApplication.getMap().mapView.addMouseMotionListener(this);
+        MainApplication.getLayerManager().addActiveLayerChangeListener(this);
     }
 
     @Override public void exitMode() {
         super.exitMode();
-        Main.map.mapView.removeMouseListener(this);
-        Main.map.mapView.removeMouseMotionListener(this);
+        MainApplication.getMap().mapView.removeMouseListener(this);
+        MainApplication.getMap().mapView.removeMouseMotionListener(this);
     }
 
     @Override
     public void activeOrEditLayerChanged(ActiveLayerChangeEvent e) {
-        Layer newLayer = Main.getLayerManager().getActiveLayer();
+        Layer newLayer = MainApplication.getLayerManager().getActiveLayer();
         if (newLayer instanceof ChannelDiGraphLayer) {
             layer = (ChannelDiGraphLayer) newLayer;
@@ -91,10 +92,10 @@
         //go through nodes and mark the ones in the selection rect as deleted
         if (layer != null && digraph != null) {
-            LatLon lefttop = Main.map.mapView.getLatLon(r.x + r.width, r.y + r.height);
-            LatLon rightbottom = Main.map.mapView.getLatLon(r.x, r.y);
+            LatLon lefttop = MainApplication.getMap().mapView.getLatLon(r.x + r.width, r.y + r.height);
+            LatLon rightbottom = MainApplication.getMap().mapView.getLatLon(r.x, r.y);
             digraph.detectSelectedChannels(rightbottom.lon(), rightbottom.lat(), lefttop.lon(), lefttop.lat());
         }
         oldRect = null;
-        Main.map.mapView.repaint();
+        MainApplication.getMap().mapView.repaint();
 
     }
@@ -164,5 +165,5 @@
     public void destroy() {
         super.destroy();
-        Main.getLayerManager().removeActiveLayerChangeListener(this);
+        MainApplication.getLayerManager().removeActiveLayerChangeListener(this);
     }
 }
Index: applications/editors/josm/plugins/junctionchecking/src/org/openstreetmap/josm/plugins/JunctionChecker/JunctionCheckerPlugin.java
===================================================================
--- applications/editors/josm/plugins/junctionchecking/src/org/openstreetmap/josm/plugins/JunctionChecker/JunctionCheckerPlugin.java	(revision 33777)
+++ applications/editors/josm/plugins/junctionchecking/src/org/openstreetmap/josm/plugins/JunctionChecker/JunctionCheckerPlugin.java	(revision 33778)
@@ -8,4 +8,5 @@
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.actions.mapmode.MapMode;
+import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.gui.MapFrame;
 import org.openstreetmap.josm.gui.layer.Layer;
@@ -54,7 +55,7 @@
             junctionCheckDialog = new JunctionCheckDialog(this);
             newFrame.addToggleDialog(junctionCheckDialog);
-            Main.getLayerManager().addLayerChangeListener(this);
+            MainApplication.getLayerManager().addLayerChangeListener(this);
         } else
-            Main.getLayerManager().removeLayerChangeListener(this);
+            MainApplication.getLayerManager().removeLayerChangeListener(this);
     }
 
@@ -64,10 +65,10 @@
             this.getJunctionCheckDialog().setActivateJunctionCheckOrSearch(false);
             if (normalMapMode != null) {
-                Main.map.selectMapMode(normalMapMode);
+                MainApplication.getMap().selectMapMode(normalMapMode);
             }
         } else if (newLayer instanceof ChannelDiGraphLayer) {
             this.getJunctionCheckDialog().setActivateCreateDigraph(false);
             this.getJunctionCheckDialog().setActivateJunctionCheckOrSearch(true);
-            Main.map.selectMapMode(jcMapMode);
+            MainApplication.getMap().selectMapMode(jcMapMode);
         }
     }
Index: applications/editors/josm/plugins/junctionchecking/src/org/openstreetmap/josm/plugins/JunctionChecker/PrepareJunctionCheckorSearch.java
===================================================================
--- applications/editors/josm/plugins/junctionchecking/src/org/openstreetmap/josm/plugins/JunctionChecker/PrepareJunctionCheckorSearch.java	(revision 33777)
+++ applications/editors/josm/plugins/junctionchecking/src/org/openstreetmap/josm/plugins/JunctionChecker/PrepareJunctionCheckorSearch.java	(revision 33778)
@@ -7,4 +7,5 @@
 
 import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.plugins.JunctionChecker.datastructure.Channel;
 
@@ -31,5 +32,5 @@
         if (prepareSubset()) {
             jct = new JunctionCheckTask(plugin, n, subset, produceRelation);
-            Main.worker.submit(jct);
+            MainApplication.worker.submit(jct);
         }
     }
@@ -37,6 +38,5 @@
     protected void prepareJunctionSearch() {
         if (prepareSubset()) {
-            JunctionSearchTask jst = new JunctionSearchTask(plugin, n, subset, produceRelation);
-            Main.worker.submit(jst);
+            MainApplication.worker.submit(new JunctionSearchTask(plugin, n, subset, produceRelation));
         }
     }
Index: applications/editors/josm/plugins/junctionchecking/src/org/openstreetmap/josm/plugins/JunctionChecker/util/RelationProducer.java
===================================================================
--- applications/editors/josm/plugins/junctionchecking/src/org/openstreetmap/josm/plugins/JunctionChecker/util/RelationProducer.java	(revision 33777)
+++ applications/editors/josm/plugins/junctionchecking/src/org/openstreetmap/josm/plugins/JunctionChecker/util/RelationProducer.java	(revision 33778)
@@ -6,9 +6,9 @@
 import java.util.LinkedList;
 
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
 import org.openstreetmap.josm.data.osm.OsmPrimitiveType;
 import org.openstreetmap.josm.data.osm.Relation;
 import org.openstreetmap.josm.data.osm.RelationMember;
+import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.plugins.JunctionChecker.JunctionCheckerPlugin;
 import org.openstreetmap.josm.plugins.JunctionChecker.datastructure.Channel;
@@ -43,5 +43,5 @@
             }
         }
-        Main.getLayerManager().setActiveLayer(plugin.getOsmlayer());
+        MainApplication.getLayerManager().setActiveLayer(plugin.getOsmlayer());
         plugin.getOsmlayer().data.setSelected(ways);
 
