private LinkedHashSet<TreePath> getViewPaths(int limit) {

		Rectangle r = tree.getViewRect();
		JTree jTree = tree.getJTree();
		int top = jTree.getClosestRowForLocation(r.x, r.y);
		int bottom = jTree.getClosestRowForLocation(r.x, r.y + r.height);

		// JTree Note: the getClosestRowForLocation() call will return the row that is 
		//             closest to the point *and* that is not clipped.   So, when we get the 
		//             top and bottom values, the user can see more items at the edges past the
		//             top and bottom.   Lets compensate by adding 1 to both values so that the
		//             rows in the view contains all that the user can see.
		top -= 1;
		bottom += 1;

		//
		// 				Unusual Code Alert!
		//
		// Due to how the JTree scrolls, the best path to save is the bottom-most path.  When
		// you ask the tree to scroll to a path, it will only scroll until that path is just
		// in the view, which is at the bottom.  By saving the bottom-most, even if we don't 
		// save all of the view paths, the view will often appear unchanged, since by putting
		// the bottom path in the view, those paths above it may still be visible.
		//
		int end = bottom - limit;
		end = Math.max(end, top); // constrain 'end' when the limit is larger than the view size

		LinkedHashSet<TreePath> result = new LinkedHashSet<>();
		for (int i = bottom; i > end; i--) {
			TreePath path = jTree.getPathForRow(i);
			if (path == null) {
				// the top or bottom is out-of-range (can happen due to how we fudged the
				// 'top' and 'bottom' above)
				continue;
			}

			result.add(path);
		}
		return result;
	}
Returns the top few paths that are visible in the view.
@return the top few paths that are visible in the view.
Ghidra/Framework/Docking/src/main/java/docking/widgets/tree/GTreeState.java