/** * Finds the cursor under the given point. * * @param aPoint the coordinate of the potential cursor, cannot be <code>null</code>. * @return the cursor index, or -1 if not found. */ protected final Cursor findCursor(final Point aPoint) { final SignalDiagramModel model = getModel(); final long refIdx = model.locationToTimestamp(aPoint); final double snapArea = CURSOR_SENSITIVITY_AREA / model.getZoomFactor(); for (Cursor cursor : model.getDefinedCursors()) { if (cursor.inArea(refIdx, snapArea)) { return cursor; } } return null; }