Index: /applications/editors/josm/plugins/surveyor/build.xml
===================================================================
--- /applications/editors/josm/plugins/surveyor/build.xml	(revision 33823)
+++ /applications/editors/josm/plugins/surveyor/build.xml	(revision 33824)
@@ -7,5 +7,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="10580"/>
+    <property name="plugin.main.version" value="12636"/>
     <property name="livegpsplugin.jar" value="${plugin.dist.dir}/livegps.jar"/>
 
Index: /applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/AutoSaveAction.java
===================================================================
--- /applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/AutoSaveAction.java	(revision 33823)
+++ /applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/AutoSaveAction.java	(revision 33824)
@@ -13,8 +13,8 @@
 import javax.swing.AbstractButton;
 
-import livegps.LiveGpsLayer;
-
 import org.openstreetmap.josm.actions.JosmAction;
 import org.openstreetmap.josm.tools.Shortcut;
+
+import livegps.LiveGpsLayer;
 
 /**
Index: /applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/AutoSaveEditLayerTimerTask.java
===================================================================
--- /applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/AutoSaveEditLayerTimerTask.java	(revision 33823)
+++ /applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/AutoSaveEditLayerTimerTask.java	(revision 33824)
@@ -14,7 +14,9 @@
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.osm.DataSet;
+import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.gui.layer.OsmDataLayer;
 import org.openstreetmap.josm.io.OsmWriter;
 import org.openstreetmap.josm.io.OsmWriterFactory;
+import org.openstreetmap.josm.tools.Logging;
 
 /**
@@ -31,5 +33,5 @@
     @Override
     public void run() {
-        OsmDataLayer layer = Main.getLayerManager().getEditLayer();
+        OsmDataLayer layer = MainApplication.getLayerManager().getEditLayer();
         if (layer == null) {
             return;
@@ -50,8 +52,8 @@
             tmpFile.renameTo(file);
             System.out.println("AutoSaving finished");
-        } catch (IOException x) {
-            x.printStackTrace();
+        } catch (IOException ex) {
+            Logging.error(ex);
             JOptionPane.showMessageDialog(Main.parent,
-                tr("Error while exporting {0}: {1}", file.getAbsoluteFile(), x.getMessage()),
+                tr("Error while exporting {0}: {1}", file.getAbsoluteFile(), ex.getMessage()),
                 tr("Error"),
                 JOptionPane.ERROR_MESSAGE);
Index: /applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/SurveyorActionDescription.java
===================================================================
--- /applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/SurveyorActionDescription.java	(revision 33823)
+++ /applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/SurveyorActionDescription.java	(revision 33824)
@@ -7,5 +7,5 @@
 
 import org.dinopolis.util.io.Tokenizer;
-import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.tools.Logging;
 
 /**
@@ -98,5 +98,5 @@
             params = tokenizer.nextLine();
         } catch (IOException ignore) {
-            Main.debug(ignore);
+            Logging.debug(ignore);
         }
     }
Index: /applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/SurveyorComponent.java
===================================================================
--- /applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/SurveyorComponent.java	(revision 33823)
+++ /applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/SurveyorComponent.java	(revision 33824)
@@ -22,9 +22,9 @@
 import javax.swing.JPanel;
 
-import livegps.LiveGpsData;
-
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.tools.XmlObjectParser;
 import org.xml.sax.SAXException;
+
+import livegps.LiveGpsData;
 
 /**
Index: /applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/SurveyorPlugin.java
===================================================================
--- /applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/SurveyorPlugin.java	(revision 33823)
+++ /applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/SurveyorPlugin.java	(revision 33824)
@@ -8,9 +8,9 @@
 import javax.swing.JMenu;
 
-import livegps.LiveGpsPlugin;
-
 import org.openstreetmap.josm.gui.MainMenu;
 import org.openstreetmap.josm.plugins.PluginHandler;
 import org.openstreetmap.josm.plugins.PluginInformation;
+
+import livegps.LiveGpsPlugin;
 
 // CHECKSTYLE.OFF: HideUtilityClassConstructorCheck
Index: /applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/SurveyorShowAction.java
===================================================================
--- /applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/SurveyorShowAction.java	(revision 33823)
+++ /applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/SurveyorShowAction.java	(revision 33824)
@@ -20,8 +20,8 @@
 import javax.swing.KeyStroke;
 
-import livegps.LiveGpsPlugin;
-
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.actions.JosmAction;
+import org.openstreetmap.josm.gui.MainApplication;
+import org.openstreetmap.josm.tools.Logging;
 import org.openstreetmap.josm.tools.Shortcut;
 import org.openstreetmap.josm.tools.XmlObjectParser;
@@ -29,4 +29,5 @@
 
 import at.dallermassl.josm.plugin.surveyor.util.ResourceLoader;
+import livegps.LiveGpsPlugin;
 
 /**
@@ -64,6 +65,6 @@
                 @Override
                 public void actionPerformed(ActionEvent e) {
-                    if (Main.map != null && Main.map.mapView != null) {
-                        Main.map.mapView.zoomToFactor(2);
+                    if (MainApplication.getMap() != null && MainApplication.getMap().mapView != null) {
+                        MainApplication.getMap().mapView.zoomToFactor(2);
                     }
                 }
@@ -74,6 +75,6 @@
                 @Override
                 public void actionPerformed(ActionEvent e) {
-                    if (Main.map != null && Main.map.mapView != null) {
-                        Main.map.mapView.zoomToFactor(1/2);
+                    if (MainApplication.getMap() != null && MainApplication.getMap().mapView != null) {
+                        MainApplication.getMap().mapView.zoomToFactor(1/2);
                     }
                 }
@@ -117,8 +118,8 @@
             return createComponent(in);
         } catch (IOException e) {
-            Main.error(e);
+            Logging.error(e);
             JOptionPane.showMessageDialog(Main.parent, tr("Could not read surveyor definition: {0}", source));
         } catch (SAXException e) {
-            Main.error(e);
+            Logging.error(e);
             JOptionPane.showMessageDialog(Main.parent, tr("Error parsing {0}: {1}", source, e.getMessage()));
         }
@@ -155,5 +156,5 @@
                 actions.add((SurveyorActionDescription) object);
             } else {
-                Main.error("surveyor: unknown xml element: " + object);
+                Logging.error("surveyor: unknown xml element: " + object);
             }
         }
Index: /applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/action/BeepAction.java
===================================================================
--- /applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/action/BeepAction.java	(revision 33823)
+++ /applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/action/BeepAction.java	(revision 33824)
@@ -5,5 +5,6 @@
 import java.util.List;
 
-import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.gui.MainApplication;
+import org.openstreetmap.josm.tools.Logging;
 
 import at.dallermassl.josm.plugin.surveyor.GpsActionEvent;
@@ -20,5 +21,5 @@
     public void actionPerformed(GpsActionEvent event) {
         // run as a separate thread
-        Main.worker.execute(new Runnable() {
+        MainApplication.worker.execute(new Runnable() {
             public void run() {
                 for (int index = 0; index < beepNumber; ++index) {
@@ -27,5 +28,5 @@
                         Thread.sleep(200);
                     } catch (InterruptedException ignore) {
-                        Main.debug(ignore);
+                        Logging.debug(ignore);
                     }
                 }
@@ -40,5 +41,5 @@
         } catch (NumberFormatException e) {
             // print but recover
-            Main.warn(e);
+            Logging.warn(e);
         }
     }
Index: /applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/action/PlayAudioAction.java
===================================================================
--- /applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/action/PlayAudioAction.java	(revision 33823)
+++ /applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/action/PlayAudioAction.java	(revision 33824)
@@ -15,5 +15,5 @@
 import javax.sound.sampled.UnsupportedAudioFileException;
 
-import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.gui.MainApplication;
 
 import at.dallermassl.josm.plugin.surveyor.GpsActionEvent;
@@ -32,5 +32,5 @@
     public void actionPerformed(GpsActionEvent event) {
         // run as a separate thread
-        Main.worker.execute(new Runnable() {
+        MainApplication.worker.execute(new Runnable() {
             public void run() {
                 try {
Index: /applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/action/SetNodeAction.java
===================================================================
--- /applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/action/SetNodeAction.java	(revision 33823)
+++ /applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/action/SetNodeAction.java	(revision 33824)
@@ -6,8 +6,8 @@
 import java.util.List;
 
-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.gui.MainApplication;
 import org.openstreetmap.josm.tools.Pair;
 
@@ -60,5 +60,5 @@
         }
         synchronized (SurveyorLock.class) {
-            DataSet ds = Main.getLayerManager().getEditDataSet();
+            DataSet ds = MainApplication.getLayerManager().getEditDataSet();
             if (ds != null) {
                 ds.addPrimitive(node);
@@ -66,5 +66,5 @@
             }
         }
-        Main.map.repaint();
+        MainApplication.getMap().repaint();
     }
 }
Index: /applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/action/SetWaypointAction.java
===================================================================
--- /applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/action/SetWaypointAction.java	(revision 33823)
+++ /applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/action/SetWaypointAction.java	(revision 33824)
@@ -8,13 +8,12 @@
 import javax.swing.JToggleButton;
 
-import livegps.LiveGpsLayer;
-
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.gpx.GpxData;
 import org.openstreetmap.josm.data.gpx.WayPoint;
+import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.gui.layer.GpxLayer;
 import org.openstreetmap.josm.gui.layer.Layer;
 import org.openstreetmap.josm.gui.layer.markerlayer.Marker;
 import org.openstreetmap.josm.gui.layer.markerlayer.MarkerLayer;
+import org.openstreetmap.josm.tools.Logging;
 
 import at.dallermassl.josm.plugin.surveyor.GpsActionEvent;
@@ -24,4 +23,5 @@
 import at.dallermassl.josm.plugin.surveyor.action.gui.WaypointDialog;
 import at.dallermassl.josm.plugin.surveyor.util.LayerUtil;
+import livegps.LiveGpsLayer;
 
 /**
@@ -63,5 +63,5 @@
                 timeout = Integer.parseInt(getParameters().get(2));
             } catch (NumberFormatException e) {
-                Main.error(e.getMessage());
+                Logging.error(e.getMessage());
             }
         }
@@ -96,5 +96,5 @@
         }
 
-        Main.map.repaint();
+        MainApplication.getMap().repaint();
     }
 
@@ -110,5 +110,5 @@
                 // not found, add a new one
                 markerLayer = new MarkerLayer(new GpxData(), MARKER_LAYER_NAME, null, null);
-                Main.getLayerManager().addLayer(markerLayer);
+                MainApplication.getLayerManager().addLayer(markerLayer);
             }
         }
@@ -122,5 +122,5 @@
     public GpxLayer getGpxLayer() {
         if (liveGpsLayer == null) {
-            Collection<Layer> layers = Main.getLayerManager().getLayers();
+            Collection<Layer> layers = MainApplication.getLayerManager().getLayers();
             for (Layer layer : layers) {
                 if (layer instanceof LiveGpsLayer) {
Index: /applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/action/SystemExecuteAction.java
===================================================================
--- /applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/action/SystemExecuteAction.java	(revision 33823)
+++ /applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/action/SystemExecuteAction.java	(revision 33824)
@@ -7,5 +7,5 @@
 import java.io.InputStreamReader;
 
-import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.tools.Logging;
 
 import at.dallermassl.josm.plugin.surveyor.GpsActionEvent;
@@ -22,5 +22,5 @@
         builder.directory(new File(System.getProperty("user.home")));
 
-        Main.debug("Directory : " + builder.directory());
+        Logging.debug("Directory : " + builder.directory());
         Thread executionThread = new Thread() {
 
@@ -35,10 +35,10 @@
 
                     while ((line = br.readLine()) != null) {
-                        Main.info(getClass().getSimpleName() + ": " + line);
+                        Logging.info(getClass().getSimpleName() + ": " + line);
                     }
 
-                    Main.info(getClass().getSimpleName() + "Program terminated!");
+                    Logging.info(getClass().getSimpleName() + "Program terminated!");
                 } catch (Exception t) {
-                    Main.error(t);
+                    Logging.error(t);
                 }
             }
Index: /applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/action/gui/DialogClosingThread.java
===================================================================
--- /applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/action/gui/DialogClosingThread.java	(revision 33823)
+++ /applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/action/gui/DialogClosingThread.java	(revision 33824)
@@ -12,5 +12,5 @@
 import javax.swing.event.DocumentListener;
 
-import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.tools.Logging;
 
 /**
@@ -47,5 +47,5 @@
                 sleep(1000);
             } catch (InterruptedException ignore) {
-                Main.debug(ignore);
+                Logging.debug(ignore);
             }
         }
@@ -62,5 +62,5 @@
     public void keyPressed(KeyEvent e) {
         reset();
-        Main.debug("keypressed: " + e.getKeyCode());
+        Logging.debug("keypressed: " + e.getKeyCode());
     }
 
@@ -68,5 +68,5 @@
     public void keyReleased(KeyEvent e) {
         reset();
-        Main.debug("keyreleased: " + e.getKeyCode());
+        Logging.debug("keyreleased: " + e.getKeyCode());
     }
 
@@ -74,5 +74,5 @@
     public void keyTyped(KeyEvent e) {
         reset();
-        Main.debug("keytyped: " + e.getKeyCode());
+        Logging.debug("keytyped: " + e.getKeyCode());
     }
 
@@ -98,5 +98,5 @@
     public void changedUpdate(DocumentEvent e) {
         reset();
-        Main.debug("changedUpdate: " + e);
+        Logging.debug("changedUpdate: " + e);
     }
 
@@ -104,5 +104,5 @@
     public void insertUpdate(DocumentEvent e) {
         reset();
-        Main.debug("insertUpdate: " + e);
+        Logging.debug("insertUpdate: " + e);
     }
 
@@ -110,5 +110,5 @@
     public void removeUpdate(DocumentEvent e) {
         reset();
-        Main.debug("removeUpdate: " + e);
+        Logging.debug("removeUpdate: " + e);
     }
 }
Index: /applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/util/LayerUtil.java
===================================================================
--- /applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/util/LayerUtil.java	(revision 33823)
+++ /applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/util/LayerUtil.java	(revision 33824)
@@ -2,5 +2,5 @@
 package at.dallermassl.josm.plugin.surveyor.util;
 
-import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.gui.layer.Layer;
 
@@ -25,6 +25,6 @@
     public static <LayerType extends Layer> LayerType findGpsLayer(String layerName, Class<LayerType> layerType) {
         Layer result = null;
-        if (Main.map != null && Main.map.mapView != null) {
-            for (Layer layer : Main.getLayerManager().getLayers()) {
+        if (MainApplication.getMap() != null && MainApplication.getMap().mapView != null) {
+            for (Layer layer : MainApplication.getLayerManager().getLayers()) {
                 if (layerName.equals(layer.getName()) && layerType.isAssignableFrom(layer.getClass())) {
                     result = layer;
