Index: applications/editors/josm/plugins/surveyor/build.xml
===================================================================
--- applications/editors/josm/plugins/surveyor/build.xml	(revision 12984)
+++ applications/editors/josm/plugins/surveyor/build.xml	(revision 13332)
@@ -1,23 +1,23 @@
 <project name="surveyor" default="dist" basedir=".">
-<!-- josm "user home" directory depends on the platform used (windows has a different place than unix/linux) -->
-    <property environment="env"/>
-    <condition property="josm.home.dir" value="${env.APPDATA}/JOSM" else="${user.home}/.josm">
-        <and>
-            <os family="windows"/>
-        </and>
-    </condition>
-<!-- compilation properties -->
-    <property name="josm.build.dir"   value="../../core"/>
-    <property name="josm.plugins.dir" value="${josm.home.dir}/plugins"/>
-    <property name="josm"         location="../../core/dist/josm-custom.jar" />
-    <property name="plugin.build.dir" value="build"/>
-    <property name="plugin.dist.dir"  value="../../dist"/>
-    <property name="plugin.name"      value="${ant.project.name}"/>
-    <property name="plugin.jar"       value="../../dist/${plugin.name}.jar"/>
-    <property name="livegpsplugin.jar" value="../../dist/livegps.jar"/>
-    <property name="plugin.description" value="Allow adding markers/nodes on current gps positions."/>
-    <property name="plugin.stage" value="60"/>
-    <property name="plugin.class" value="at.dallermassl.josm.plugin.surveyor.SurveyorPlugin"/>
+    <property name="josm"                   location="../../core/dist/josm-custom.jar" />
+    <property name="plugin.dist.dir"        value="../../dist"/>
+    <property name="plugin.build.dir"       value="build"/>
+    <property name="plugin.jar"             value="${plugin.dist.dir}/${ant.project.name}.jar"/>
+    <property name="livegpsplugin.jar"      value="${plugin.dist.dir}/livegps.jar"/>
     <property name="ant.build.javac.target" value="1.5"/>
+    <target name="init">
+        <mkdir dir="${plugin.build.dir}"/>
+    </target>
+    <target name="compile" depends="init">
+        <echo message="creating ${plugin.jar}"/>
+        <javac srcdir="src" destdir="${plugin.build.dir}" debug="true">
+            <compilerarg value="-Xlint:deprecation"/>
+            <compilerarg value="-Xlint:unchecked"/>
+            <classpath>
+                <pathelement location="${josm}"/>
+                <pathelement location="${livegpsplugin.jar}"/>
+            </classpath>
+        </javac>
+    </target>
     <target name="dist" depends="compile">
         <exec append="false" output="REVISION" executable="svn" failifexecutionfails="false">
@@ -29,5 +29,4 @@
         <xmlproperty file="REVISION" prefix="version" keepRoot="false" collapseAttributes="true"/>
         <delete file="REVISION"/>
-<!-- images -->
         <copy todir="${plugin.build.dir}/">
             <fileset dir="resources">
@@ -36,39 +35,18 @@
             </fileset>
         </copy>
-<!-- create jar file -->
+        <copy todir="${plugin.build.dir}/images" >
+            <fileset dir="images" />
+        </copy>
         <jar destfile="${plugin.jar}" basedir="${plugin.build.dir}">
             <manifest>
-                <attribute name="Plugin-Class" value="${plugin.class}" />
-                <attribute name="Plugin-Description" value="${plugin.description}" />
-                <attribute name="Plugin-Stage" value="${plugin.stage}" />
+                <attribute name="Plugin-Class" value="at.dallermassl.josm.plugin.surveyor.SurveyorPlugin" />
+                <attribute name="Plugin-Description" value="Allow adding markers/nodes on current gps positions." />
+                <attribute name="Plugin-Stage" value="60" />
                 <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
                 <attribute name="Plugin-Date" value="${version.entry.commit.date}"/>
-                <attribute name="Plugin-Mainversion" value="1180" />
+                <attribute name="Plugin-Mainversion" value="1326" />
+                <attribute name="Plugin-Requires" value="livegps" />
             </manifest>
         </jar>
-    </target>
-    <target name="compile" depends="init">
-        <echo message="creating ${plugin.jar}"/>
-        <mkdir dir="${plugin.build.dir}"/>
-        <copy todir="build/images" >
-            <fileset dir="images" />
-        </copy>
-        <javac srcdir="src" destdir="${plugin.build.dir}" debug="true" source="1.5" target="1.5">
-            <compilerarg value="-Xlint:deprecation"/>
-            <compilerarg value="-Xlint:unchecked"/>
-            <classpath>
-                <pathelement path="${josm.build.dir}/build"/>
-                <fileset dir="${josm.build.dir}/lib">
-                    <include name="**/*.jar"/>
-                </fileset>
-                <pathelement location="${livegpsplugin.jar}"/>
-            </classpath>
-        </javac>
-    </target>
-    <target name="install" depends="dist">
-        <copy file="${plugin.jar}" todir="${josm.plugins.dir}"/>
-    </target>
-    <target name="init">
-        <echo>java version: ${java.version}</echo>
     </target>
     <target name="clean">
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 12984)
+++ applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/SurveyorPlugin.java	(revision 13332)
@@ -22,5 +22,5 @@
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.gui.MainMenu;
-import org.openstreetmap.josm.plugins.PluginProxy;
+import org.openstreetmap.josm.plugins.PluginHandler;
 
 /**
@@ -44,35 +44,5 @@
         super();
 
-        // try to determine if the livegps plugin was already loaded:
-//        PluginInformation pluginInfo = PluginInformation.getLoaded("livegps");
-//        if (pluginInfo == null) {
-//          JOptionPane.showMessageDialog(null, "Please install wmsplugin");
-//          return;
-//        }
-//        if (!pluginInfo.version.equals("2")) {
-//          JOptionPane.showMessageDialog(null, "livegps Version 2 required.");
-//          return;
-//        }
-        try {
-            Class.forName("livegps.LiveGpsPlugin");
-        } catch(ClassNotFoundException cnfe) {
-            String message =
-                tr("SurveyorPlugin depends on LiveGpsPlugin!") + "\n" +
-                tr("LiveGpsPlugin not found, please install and activate.") + "\n" +
-                tr("SurveyorPlugin is disabled for the moment");
-            JOptionPane.showMessageDialog(Main.parent, message, tr("SurveyorPlugin"), JOptionPane.ERROR_MESSAGE);
-            return;
-        }
-
-
-        LiveGpsPlugin gpsPlugin = null;
-        Iterator<PluginProxy> proxyIter = Main.plugins.iterator();
-        while(proxyIter.hasNext()) {
-            Object plugin = proxyIter.next().plugin;
-            if(plugin instanceof LiveGpsPlugin) {
-                gpsPlugin = (LiveGpsPlugin) plugin;
-                break;
-            }
-        }
+        LiveGpsPlugin gpsPlugin = (LiveGpsPlugin) PluginHandler.getPlugin("livegps");
         if(gpsPlugin == null)
             throw new IllegalStateException(tr("SurveyorPlugin needs LiveGpsPlugin, but could not find it!"));
