private ProgramNode getMouseNode(Point popupPoint) {

		TreePath mousePath = getPathForLocation((int) popupPoint.getX(), (int) popupPoint.getY());
		if (mousePath != null) {
			ProgramNode node = (ProgramNode) mousePath.getLastPathComponent();
			if (!isPathSelected(mousePath)) {
				setSelectionPath(mousePath); // add the right-clicked node to the selection
			}
			return node;
		}
		return null;
	}
Adjust the selection based on the given popupPoint.
@param  event mouse event
@return node that is selected
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/programtree/ProgramDnDTree.java