protected int getMaxDepth(MindMapNode node) { if (node.isFolded() || !node.hasChildren()) return depth(node); int k = 0; for (Iterator i = node.childrenUnfolded(); i.hasNext(); ) { int l = getMaxDepth((MindMapNode) i.next()); if (l > k) k = l; } return k; }
public int getMinDepth(MindMapNode node) { if (node.isFolded()) return depth(node); if (!node.hasChildren()) return Integer.MAX_VALUE; int k = Integer.MAX_VALUE; for (Iterator i = node.childrenUnfolded(); i.hasNext(); ) { int l = getMinDepth((MindMapNode) i.next()); if (l < k) k = l; } return k; }
protected void setFolded(MindMapNode node, boolean state) { if (node.hasChildren() && (node.isFolded() != state)) { getMindMapController().setFolded(node, state); } }