/** * Returns the number of children that are expanded to <code>stopIndex</code>. This does not * include the number of children that the child at <code>stopIndex</code> might have. */ protected int getNumExpandedChildrenTo(int stopIndex) { FHTreeStateNode aChild; int retCount = stopIndex; for (int counter = 0, maxCounter = getChildCount(); counter < maxCounter; counter++) { aChild = (FHTreeStateNode) getChildAt(counter); if (aChild.childIndex >= stopIndex) return retCount; else { retCount += aChild.getTotalChildCount(); } } return retCount; }
/** * Asks all the children of the receiver for their totalChildCount and returns this value (plus * stopIndex). */ protected int getCountTo(int stopIndex) { FHTreeStateNode aChild; int retCount = stopIndex + 1; for (int counter = 0, maxCounter = getChildCount(); counter < maxCounter; counter++) { aChild = (FHTreeStateNode) getChildAt(counter); if (aChild.childIndex >= stopIndex) counter = maxCounter; else retCount += aChild.getTotalChildCount(); } if (parent != null) return retCount + ((FHTreeStateNode) getParent()).getCountTo(childIndex); if (!isRootVisible()) return (retCount - 1); return retCount; }
/** Returns the number of visible children for row. */ public int getVisibleChildCount(TreePath path) { FHTreeStateNode node = getNodeForPath(path, true, false); if (node == null) return 0; return node.getTotalChildCount(); }