Index: applications/editors/josm/plugins/nearclick/.classpath
===================================================================
--- applications/editors/josm/plugins/nearclick/.classpath	(revision 4087)
+++ applications/editors/josm/plugins/nearclick/.classpath	(revision 4088)
@@ -3,5 +3,6 @@
 	<classpathentry kind="src" path="src"/>
 	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-	<classpathentry combineaccessrules="false" kind="src" path="/josm"/>
+	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+	<classpathentry kind="src" path="/josm"/>
 	<classpathentry kind="output" path="bin"/>
 </classpath>
Index: applications/editors/josm/plugins/nearclick/.project
===================================================================
--- applications/editors/josm/plugins/nearclick/.project	(revision 4087)
+++ applications/editors/josm/plugins/nearclick/.project	(revision 4088)
@@ -11,7 +11,18 @@
 			</arguments>
 		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.ManifestBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.SchemaBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
 	</buildSpec>
 	<natures>
 		<nature>org.eclipse.jdt.core.javanature</nature>
+		<nature>org.eclipse.pde.PluginNature</nature>
 	</natures>
 </projectDescription>
Index: applications/editors/josm/plugins/nearclick/build.xml
===================================================================
--- applications/editors/josm/plugins/nearclick/build.xml	(revision 4087)
+++ applications/editors/josm/plugins/nearclick/build.xml	(revision 4088)
@@ -8,6 +8,6 @@
 	<!-- Windows has a different home directory scheme then unix/linux -->
 	<!-- I don't know an automatic way to find it with ant :-(, if you know, please fix -->
-	<property name="plugins" location="${user.home}/.josm/plugins" ></property>
-	<!--<property name="plugins" location="${user.home}/Anwendungsdaten/JOSM/plugins" ></property>-->
+	<!--<property name="plugins" location="${user.home}/.josm/plugins" ></property>-->
+	<property name="plugins" location="${user.home}/Application Data/JOSM/plugins" ></property>
 
 	<!-- you should not need to modify anything below this! -->
@@ -20,5 +20,5 @@
 
 	<target name="compile" depends="init">
-		<javac srcdir="src" classpath="${josm}" destdir="build" debug="true">
+		<javac srcdir="src" target="1.5" classpath="${josm}" destdir="build" debug="true">
 			<include name="**/*.java" />
 		</javac>
Index: applications/editors/josm/plugins/nearclick/src/nearclick/NearClickPlugin.java
===================================================================
--- applications/editors/josm/plugins/nearclick/src/nearclick/NearClickPlugin.java	(revision 4087)
+++ applications/editors/josm/plugins/nearclick/src/nearclick/NearClickPlugin.java	(revision 4088)
@@ -8,4 +8,5 @@
 import java.awt.event.AWTEventListener;
 import java.awt.event.MouseEvent;
+import org.openstreetmap.josm.Main;
 
 public class NearClickPlugin implements AWTEventListener {
@@ -14,7 +15,17 @@
     private int mouseDownY = -1;
     private long mouseDownTime = -1;
+    private int radiussquared = 49;
+    private int delay = 250;
 
     public NearClickPlugin() {
         Toolkit.getDefaultToolkit().addAWTEventListener(this, AWTEvent.MOUSE_EVENT_MASK | AWTEvent.MOUSE_MOTION_EVENT_MASK);
+	try {
+	    int radius = Integer.parseInt(Main.pref.get("nearclick.radius", "7"));
+	    radiussquared = radius * radius;
+	    delay = Integer.parseInt(Main.pref.get("nearclick.delay", "250"));
+	} catch (NumberFormatException ex) {
+	    delay = 250;
+	    radiussquared = 7 * 7;
+	}
     }
 
@@ -24,10 +35,13 @@
             if ( e.getButton() != MouseEvent.BUTTON1 )
                 return;
+	    int xdiff = e.getPoint().x - mouseDownX;
+	    int ydiff = e.getPoint().y - mouseDownY;
+	    
             if (e.getID() == MouseEvent.MOUSE_RELEASED) {
-                if ( e.getWhen() - mouseDownTime < 250 &&
-                        e.getPoint().x - mouseDownX < 7 &&
-                        e.getPoint().y - mouseDownY < 7 &&
-                        e.getPoint().x != mouseDownX &&
-                        e.getPoint().y != mouseDownY ) {
+                if ( e.getWhen() - mouseDownTime < delay &&
+		     ( e.getPoint().x != mouseDownX ||
+		       e.getPoint().y != mouseDownY) &&
+		     xdiff * xdiff + ydiff * ydiff < radiussquared
+		   ) {
                     try {
                         Robot r = new Robot(GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice());
