Index: /applications/editors/josm/plugins/surveyor/build.xml
===================================================================
--- /applications/editors/josm/plugins/surveyor/build.xml	(revision 34557)
+++ /applications/editors/josm/plugins/surveyor/build.xml	(revision 34558)
@@ -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="12636"/>
+    <property name="plugin.main.version" value="14153"/>
     <property name="livegpsplugin.jar" value="${plugin.dist.dir}/livegps.jar"/>
 
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 34557)
+++ /applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/AutoSaveEditLayerTimerTask.java	(revision 34558)
@@ -12,5 +12,4 @@
 import javax.swing.JOptionPane;
 
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.osm.DataSet;
 import org.openstreetmap.josm.gui.MainApplication;
@@ -54,5 +53,5 @@
         } catch (IOException ex) {
             Logging.error(ex);
-            JOptionPane.showMessageDialog(Main.parent,
+            JOptionPane.showMessageDialog(MainApplication.getMainFrame(),
                 tr("Error while exporting {0}: {1}", file.getAbsoluteFile(), ex.getMessage()),
                 tr("Error"),
Index: /applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/AutoSaveGpsLayerTimerTask.java
===================================================================
--- /applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/AutoSaveGpsLayerTimerTask.java	(revision 34557)
+++ /applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/AutoSaveGpsLayerTimerTask.java	(revision 34558)
@@ -13,5 +13,5 @@
 import javax.swing.JOptionPane;
 
-import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.gui.layer.GpxLayer;
 import org.openstreetmap.josm.io.GpxWriter;
@@ -71,5 +71,5 @@
         } catch (IOException ioExc) {
             ioExc.printStackTrace();
-            JOptionPane.showMessageDialog(Main.parent,
+            JOptionPane.showMessageDialog(MainApplication.getMainFrame(),
                 tr("Error while exporting {0}: {1}", file.getAbsoluteFile(), ioExc.getMessage()),
                 tr("Error"),
Index: /applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/ButtonDescription.java
===================================================================
--- /applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/ButtonDescription.java	(revision 34557)
+++ /applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/ButtonDescription.java	(revision 34558)
@@ -232,5 +232,6 @@
             button.addItemListener(this);
         }
-        
+
+        @Override
         public void itemStateChanged(ItemEvent e) {
             boolean value = e.getStateChange() == ItemEvent.SELECTED;
@@ -239,4 +240,5 @@
         }
 
+        @Override
         public void propertyChange(PropertyChangeEvent evt) {
             if (evt.getPropertyName().equals(ActionConstants.SELECTED_KEY)) {
Index: /applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/MetaAction.java
===================================================================
--- /applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/MetaAction.java	(revision 34557)
+++ /applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/MetaAction.java	(revision 34558)
@@ -9,5 +9,5 @@
 import javax.swing.JFrame;
 
-import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.spi.preferences.Config;
 
 import livegps.LiveGpsData;
@@ -85,5 +85,5 @@
             System.out.println("Surveyor: no gps data available!");
             // TEST for offline test only:
-            if (Main.pref.getBoolean("surveyor.debug")) {
+            if (Config.getPref().getBoolean("surveyor.debug")) {
                 for (SurveyorActionDescription action : actions) {
                     action.actionPerformed(new GpsActionEvent(e, 0, 0));
Index: /applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/SurveyorActionFactory.java
===================================================================
--- /applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/SurveyorActionFactory.java	(revision 34557)
+++ /applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/SurveyorActionFactory.java	(revision 34558)
@@ -27,17 +27,13 @@
             if (action == null) {
                 try {
-                    action = (SurveyorAction) Class.forName(actionClass).newInstance();
+                    action = (SurveyorAction) Class.forName(actionClass).getDeclaredConstructor().newInstance();
                 } catch (ClassNotFoundException e) {
                     actionClass = DEFAULT_PACKAGE + "." + actionClass;
-                    action = (SurveyorAction) Class.forName(actionClass).newInstance();
+                    action = (SurveyorAction) Class.forName(actionClass).getDeclaredConstructor().newInstance();
                 }
                 actionCache.put(actionClass, action);
             }
             return action;
-        } catch (InstantiationException e) {
-            throw new RuntimeException("Could not create action class '" + actionClass + "'", e);
-        } catch (IllegalAccessException e) {
-            throw new RuntimeException("Could not create action class '" + actionClass + "'", e);
-        } catch (ClassNotFoundException e) {
+        } catch (ReflectiveOperationException e) {
             throw new RuntimeException("Could not create action class '" + actionClass + "'", e);
         }
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 34557)
+++ /applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/SurveyorComponent.java	(revision 34558)
@@ -22,5 +22,7 @@
 import javax.swing.JPanel;
 
-import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.gui.MainApplication;
+import org.openstreetmap.josm.spi.preferences.Config;
+import org.openstreetmap.josm.tools.Logging;
 import org.openstreetmap.josm.tools.XmlObjectParser;
 import org.xml.sax.SAXException;
@@ -48,6 +50,6 @@
         setLayout(new BorderLayout());
         streetLabel = new JLabel(tr("Way: "));
-        float fontSize = Float.parseFloat(Main.pref.get(SurveyorPlugin.PREF_KEY_STREET_NAME_FONT_SIZE, "35"));
-        Main.pref.put(SurveyorPlugin.PREF_KEY_STREET_NAME_FONT_SIZE, String.valueOf(fontSize));
+        float fontSize = Float.parseFloat(Config.getPref().get(SurveyorPlugin.PREF_KEY_STREET_NAME_FONT_SIZE, "35"));
+        Config.getPref().put(SurveyorPlugin.PREF_KEY_STREET_NAME_FONT_SIZE, String.valueOf(fontSize));
         streetLabel.setFont(streetLabel.getFont().deriveFont(35f));
         add(streetLabel, BorderLayout.NORTH);
@@ -103,5 +105,5 @@
     public void addButton(ButtonDescription description) {
         if (description.getHotkey() != "" && hotKeys.contains(description.getHotkey())) {
-            JOptionPane.showMessageDialog(Main.parent, 
+            JOptionPane.showMessageDialog(MainApplication.getMainFrame(), 
                     tr("Duplicate hotkey for button ''{0}'' - button will be ignored!", description.getLabel()));
         } else {
@@ -128,5 +130,5 @@
             parser.start(in);
         } catch (SAXException e) {
-            e.printStackTrace();
+            Logging.error(e);
         }
         List<SurveyorActionDescription> actions = new ArrayList<>();
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 34557)
+++ /applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/SurveyorShowAction.java	(revision 34558)
@@ -20,7 +20,7 @@
 import javax.swing.KeyStroke;
 
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.actions.JosmAction;
 import org.openstreetmap.josm.gui.MainApplication;
+import org.openstreetmap.josm.spi.preferences.Config;
 import org.openstreetmap.josm.tools.Logging;
 import org.openstreetmap.josm.tools.Shortcut;
@@ -107,8 +107,8 @@
 
     public SurveyorComponent createComponent() {
-        String source = Main.pref.get("surveyor.source");
+        String source = Config.getPref().get("surveyor.source");
         if (source == null || source.length() == 0) {
             source = DEFAULT_SOURCE;
-            Main.pref.put("surveyor.source", DEFAULT_SOURCE);
+            Config.getPref().put("surveyor.source", DEFAULT_SOURCE);
             // <FIXXME date="04.05.2007" author="cdaller">
             // TODO copy xml file to .josm directory if it does not exist!
@@ -119,8 +119,8 @@
         } catch (IOException e) {
             Logging.error(e);
-            JOptionPane.showMessageDialog(Main.parent, tr("Could not read surveyor definition: {0}", source));
+            JOptionPane.showMessageDialog(MainApplication.getMainFrame(), tr("Could not read surveyor definition: {0}", source));
         } catch (SAXException e) {
             Logging.error(e);
-            JOptionPane.showMessageDialog(Main.parent, tr("Error parsing {0}: {1}", source, e.getMessage()));
+            JOptionPane.showMessageDialog(MainApplication.getMainFrame(), tr("Error parsing {0}: {1}", source, e.getMessage()));
         }
         return null;
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 34557)
+++ /applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/action/BeepAction.java	(revision 34558)
@@ -21,13 +21,11 @@
     public void actionPerformed(GpsActionEvent event) {
         // run as a separate thread
-        MainApplication.worker.execute(new Runnable() {
-            public void run() {
-                for (int index = 0; index < beepNumber; ++index) {
-                    Toolkit.getDefaultToolkit().beep();
-                    try {
-                        Thread.sleep(200);
-                    } catch (InterruptedException ignore) {
-                        Logging.debug(ignore);
-                    }
+        MainApplication.worker.execute(() -> {
+            for (int index = 0; index < beepNumber; ++index) {
+                Toolkit.getDefaultToolkit().beep();
+                try {
+                    Thread.sleep(200);
+                } catch (InterruptedException ignore) {
+                    Logging.debug(ignore);
                 }
             }
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 34557)
+++ /applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/action/PlayAudioAction.java	(revision 34558)
@@ -5,5 +5,4 @@
 import java.io.IOException;
 import java.io.InputStream;
-import java.net.MalformedURLException;
 
 import javax.sound.sampled.AudioFormat;
@@ -16,4 +15,5 @@
 
 import org.openstreetmap.josm.gui.MainApplication;
+import org.openstreetmap.josm.tools.Logging;
 
 import at.dallermassl.josm.plugin.surveyor.GpsActionEvent;
@@ -32,47 +32,39 @@
     public void actionPerformed(GpsActionEvent event) {
         // run as a separate thread
-        MainApplication.worker.execute(new Runnable() {
-            public void run() {
-                try {
-                    if (audioSource == null) {
-                        audioSource = getParameters().get(0);
-                    }
-                    InputStream in = new BufferedInputStream(ResourceLoader.getInputStream(audioSource));
-                    AudioInputStream stream = AudioSystem.getAudioInputStream(in);
+        MainApplication.worker.execute(() -> {
+            try {
+                if (audioSource == null) {
+                    audioSource = getParameters().get(0);
+                }
+                InputStream in = new BufferedInputStream(ResourceLoader.getInputStream(audioSource));
+                AudioInputStream stream = AudioSystem.getAudioInputStream(in);
 
-                    // At present, ALAW and ULAW encodings must be converted
-                    // to PCM_SIGNED before it can be played
-                    AudioFormat format = stream.getFormat();
-                    if (format.getEncoding() != AudioFormat.Encoding.PCM_SIGNED) {
-                        format = new AudioFormat(
-                            AudioFormat.Encoding.PCM_SIGNED,
-                            format.getSampleRate(),
-                            format.getSampleSizeInBits()*2,
-                            format.getChannels(),
-                            format.getFrameSize()*2,
-                            format.getFrameRate(),
-                            true);        // big endian
-                        stream = AudioSystem.getAudioInputStream(format, stream);
-                    }
+                // At present, ALAW and ULAW encodings must be converted
+                // to PCM_SIGNED before it can be played
+                AudioFormat format = stream.getFormat();
+                if (format.getEncoding() != AudioFormat.Encoding.PCM_SIGNED) {
+                    format = new AudioFormat(
+                        AudioFormat.Encoding.PCM_SIGNED,
+                        format.getSampleRate(),
+                        format.getSampleSizeInBits()*2,
+                        format.getChannels(),
+                        format.getFrameSize()*2,
+                        format.getFrameRate(),
+                        true);        // big endian
+                    stream = AudioSystem.getAudioInputStream(format, stream);
+                }
 
-                    // Create the clip
-                    DataLine.Info info = new DataLine.Info(
-                        Clip.class, stream.getFormat(), ((int) stream.getFrameLength()*format.getFrameSize()));
-                    Clip clip = (Clip) AudioSystem.getLine(info);
+                // Create the clip
+                DataLine.Info info = new DataLine.Info(
+                    Clip.class, stream.getFormat(), ((int) stream.getFrameLength()*format.getFrameSize()));
+                Clip clip = (Clip) AudioSystem.getLine(info);
 
-                    // This method does not return until the audio file is completely loaded
-                    clip.open(stream);
+                // This method does not return until the audio file is completely loaded
+                clip.open(stream);
 
-                    // Start playing
-                    clip.start();
-                } catch (MalformedURLException e) {
-                    e.printStackTrace();
-                } catch (IOException e) {
-                    e.printStackTrace();
-                } catch (LineUnavailableException e) {
-                    e.printStackTrace();
-                } catch (UnsupportedAudioFileException e) {
-                    e.printStackTrace();
-                }
+                // Start playing
+                clip.start();
+            } catch (IOException | LineUnavailableException | UnsupportedAudioFileException e1) {
+                Logging.error(e1);
             }
         });
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 34557)
+++ /applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/action/SetWaypointAction.java	(revision 34558)
@@ -45,4 +45,5 @@
     }
 
+    @Override
     public void actionPerformed(GpsActionEvent event) {
         String markerTitle = getParameters().get(0);
