if (traverseMode == FIRST_ADDED_ON_TOP) { iterator = targets.listIterator(); while (iterator.hasNext()) { graphic = (OMGraphic) iterator.next();
synchronized (graphics) { if (traverseMode == FIRST_ADDED_ON_TOP) { iterator = targets.listIterator(); while (iterator.hasNext()) { graphic = (OMGraphic) iterator.next();
    protected OMGeometry _selectClosest(int x, int y, float limit) {	java.util.List targets = getTargets();	ListIterator iterator;        OMGeometry ret = null;	OMGeometry graphic, current;        float closestDistance = Float.MAX_VALUE;	float currentDistance;	if (size() != 0) {	    if (traverseMode == FIRST_ADDED_ON_TOP) {		iterator = targets.listIterator();		while (iterator.hasNext()) {		    graphic = (OMGraphic) iterator.next();		    if (!graphic.isVisible()) continue;		    current = graphic;		    currentDistance = current.distance(x, y);		    if (currentDistance < limit && 			currentDistance < closestDistance) {			if (ret != null) ret.deselect();			ret = current;			ret.select();			closestDistance = currentDistance;		    } else {			// in case this graphic was the last closest			current.deselect();		    }		}	    } else {		iterator = targets.listIterator(targets.size());		while (iterator.hasPrevious()) {		    graphic = (OMGraphic) iterator.previous();		    if (!graphic.isVisible()) continue;		    current = graphic;		    currentDistance = current.distance(x, y);		    if (currentDistance < limit && 			currentDistance < closestDistance) {			if (ret != null) ret.deselect();			ret = current;			ret.select();			closestDistance = currentDistance;		    } else {			// in case this graphic was the last closest			current.deselect();		    }		}	    }	}	return ret;    }