GroupView getGroupView() {
		List<TreePath> viewList = tree.getViewList();
		ArrayList<GroupPath> list = new ArrayList<GroupPath>();
		for (TreePath p : viewList) {
			ProgramNode node = (ProgramNode) p.getLastPathComponent();
			GroupPath gp = node.getGroupPath();
			if (gp != null) {
				list.add(gp);
			}
		}
		GroupPath[] gps = new GroupPath[list.size()];
		gps = list.toArray(gps);
		return new GroupView(gps);
	}
Get the currently viewed group paths.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/programtree/ProgramTreePanel.java