private boolean doSetCursorPosition(BigInteger index, int fieldNum, int row, int col,
				EventTrigger trigger) {
			currentField = null;
			if (!cursorOn) {
				return false;
			}

			// Make sure the position is valid
			if ((index.compareTo(BigInteger.ZERO) < 0) ||
				(index.compareTo(model.getNumIndexes()) >= 0)) {
				notifyCursorChanged(trigger);
				return false;
			}

			Layout layout = model.getLayout(index);
			if (layout == null) {
				return false;
			}

			if (fieldNum >= layout.getNumFields()) {
				fieldNum = 0;
			}
			currentField = layout.getField(fieldNum);

			if (!currentField.isValid(row, col)) {
				row = 0;
				col = 0;
			}
			cursorPosition.setIndex(index);
			cursorPosition.fieldNum = fieldNum;
			cursorPosition.row = row;
			cursorPosition.col = col;
			lastX = currentField.getX(row, col);
			notifyCursorChanged(trigger);
			return true;
		}
Sets the cursor as close to the given point as possible.

@param x the horizontal coordinate.
@param y the vertical coordinate.
Ghidra/Framework/Docking/src/main/java/docking/widgets/fieldpanel/FieldPanel.java