org.openstreetmap.josm.actions.mapmode
Class ImproveWayAccuracyHelper

java.lang.Object
  extended by org.openstreetmap.josm.actions.mapmode.ImproveWayAccuracyHelper

 class ImproveWayAccuracyHelper
extends java.lang.Object

This static class contains functions used to find target way, node to move or segment to divide.


Constructor Summary
ImproveWayAccuracyHelper()
           
 
Method Summary
static Node findCandidateNode(MapView mv, Way w, java.awt.Point p)
          Returns the nearest node to cursor.
static WaySegment findCandidateSegment(MapView mv, Way w, java.awt.Point p)
          Returns the nearest way segment to cursor.
static Way findWay(MapView mv, java.awt.Point p)
          Finds the way to work on.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImproveWayAccuracyHelper

ImproveWayAccuracyHelper()
Method Detail

findWay

public static Way findWay(MapView mv,
                          java.awt.Point p)
Finds the way to work on. If the mouse is on the node, extracts one of the ways containing it. If the mouse is on the way, simply returns it.

Parameters:
mv -
p -
Returns:
Way or null in case there is nothing under the cursor.

findCandidateNode

public static Node findCandidateNode(MapView mv,
                                     Way w,
                                     java.awt.Point p)
Returns the nearest node to cursor. All nodes that are ???behind??? segments are neglected. This is to avoid way self-intersection after moving the candidateNode to a new place.

Parameters:
mv -
w -
p -
Returns:

findCandidateSegment

public static WaySegment findCandidateSegment(MapView mv,
                                              Way w,
                                              java.awt.Point p)
Returns the nearest way segment to cursor. The distance to segment ab is the length of altitude from p to ab (say, c) or the minimum distance from p to a or b if c is out of ab. The priority is given to segments where c is in ab. Otherwise, a segment with the largest angle apb is chosen.

Parameters:
mv -
w -
p -
Returns:


JOSM