private void setCursorPos(int x, int y, EventTrigger trigger) {
			currentField = null;
			// delegate to the appropriate layout to do the work
			Layout layout = findLayoutAt(y);
			if (layout == null) {
				x = 0;
				y = 0;
				layout = findLayoutAt(y);
			}
			if (layout != null) {
				FieldLocation newCursorPosition = new FieldLocation();
				lastX = layout.setCursor(newCursorPosition, x, y);
				currentField = layout.getField(newCursorPosition.fieldNum);
				if (!newCursorPosition.equals(cursorPosition) ||
					EventTrigger.MODEL_CHANGE.equals(trigger)) {
					cursorPosition = newCursorPosition;
					notifyCursorChanged(trigger);
				}
				scrollToCursor();
				repaint();
			}
		}
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