GroupPath[] getViewedGroups() {
		ArrayList<TreePath> list = new ArrayList<TreePath>(tree.getViewList());
		Collections.sort(list, nodeComparator);
		GroupPath[] gp = new GroupPath[list.size()];
		for (int i = 0; i < gp.length; i++) {
			TreePath path = list.get(i);
			ProgramNode node = (ProgramNode) path.getLastPathComponent();
			gp[i] = node.getGroupPath();
		}
		return gp;
	}
Set whether this tree has focus.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/programtree/ProgramTreePanel.java