Ejemplo n.º 1
0
 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;
 }
Ejemplo n.º 2
0
 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;
 }
Ejemplo n.º 3
0
 protected void setFolded(MindMapNode node, boolean state) {
   if (node.hasChildren() && (node.isFolded() != state)) {
     getMindMapController().setFolded(node, state);
   }
 }