* the screen point
* @return the edge at given point (or <code>null</code> if there is no
* such edge)
*/
public Edge getNearestEdge(JPowerGraphPoint point) {
Edge nearestEdge = null;
double minDistance = 4;
synchronized (m_graph) {
List edges = m_graph.getVisibleEdges();
ListIterator iterator = edges.listIterator(edges.size());
while (iterator.hasPrevious()) {
Edge edge = (Edge) iterator.previous();
EdgePainter edgePainter = getPainterForEdge(edge);
double distance = edgePainter.screenDistanceFromEdge(this, edge, point);
if (distance < minDistance) {
minDistance = distance;
nearestEdge = edge;