コード例 #1
0
 private static void expandNodeIfNotTooWide(Tree tree, PackageDependenciesNode node) {
   int count = node.getChildCount();
   if (count > 5) return;
   // another level of nesting
   if (count == 1 && node.getChildAt(0).getChildCount() > 5) {
     return;
   }
   tree.expandPath(new TreePath(node.getPath()));
 }
コード例 #2
0
 private static void expandFirstLevel(Tree tree) {
   PackageDependenciesNode root = (PackageDependenciesNode) tree.getModel().getRoot();
   int count = root.getChildCount();
   if (count < 10) {
     for (int i = 0; i < count; i++) {
       PackageDependenciesNode child = (PackageDependenciesNode) root.getChildAt(i);
       expandNodeIfNotTooWide(tree, child);
     }
   }
 }