/** * Builds the parents of vis. node up to and including the root node * from VisualizerNode hierarchy */ VisualizerNode[] getPathToRoot() { return getPathToRoot(0); }
VisualizerNode[] getPathToRoot(int depth) { depth++; VisualizerNode[] retNodes; if (parent == null || parent.parent == null) { retNodes = new VisualizerNode[depth]; } else { retNodes = parent.parent.getPathToRoot(depth); } retNodes[retNodes.length - depth] = this; return retNodes; } }
visHolder.removeRecur(vn.getChildren(false)); if (selPaths != null) { TreePath path = new TreePath(vn.getPathToRoot()); for(TreePath tp : selPaths) { if (path.isDescendant(tp)) {