private void reorderNode(ProgramNode destNode, int dropAction, int relativeMousePos,
			ProgramNode parentNode, ProgramNode dropNode)
			throws NotFoundException, CircularDependencyException, DuplicateGroupException {

		if (!reorderChildren(destNode, dropNode, relativeMousePos)) {
			int index;

			// this is the case where destNode and dropNode have different parents...        
			if (relativeMousePos < 0) {
				if (parentNode == null) {
					return;
				}
				index = parentNode.getIndex(destNode);
			}
			else {
				// if destNode is a module and if it is expanded,
				// then dropNode will go inside the module
				if (destNode.isModule() && tree.isExpanded(destNode.getTreePath())) {
					index = 0;
					destNode = (ProgramNode) destNode.getChildAt(0);
				}
				else {
					// destNode is a module or a fragment, but place
					// destNode after it
					index = parentNode.getIndex(destNode);
					++index;
				}

			}
			addGroup(destNode, dropNode, index, dropAction);
			ProgramNode child = (ProgramNode) parentNode.getChildAt(index);
			selectNode(dropNode, child);
		}
	}
Add the given data to the destination node.
@param destNode destination node for the data.
@param dropNode data to add
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/programtree/ReorderManager.java