TreePath getTreePath(Node node) { return new TreePath(treeModel.getPathToRoot(VisualizerNode.getVisualizer(null, node))); }
/** Test whether a node is expanded in the tree or not * @param n the node to test * @return true if the node is expanded */ public boolean isExpanded (Node n) { TreePath treePath = new TreePath ( treeModel.getPathToRoot ( VisualizerNode.getVisualizer (null, n) ) ); return tree.isExpanded (treePath); }
/** Collapses the tree under given node. * * @param n node to collapse */ public void collapseNode (Node n) { TreePath treePath = new TreePath ( treeModel.getPathToRoot ( VisualizerNode.getVisualizer (null, n) ) ); tree.collapsePath (treePath); }
/** Test whether a node is expanded in the tree or not * @param n the node to test * @return true if the node is expanded */ public boolean isExpanded (Node n) { TreePath treePath = new TreePath ( treeModel.getPathToRoot ( VisualizerNode.getVisualizer (null, n) ) ); return tree.isExpanded (treePath); }
/** Collapses the tree under given node. * * @param n node to collapse */ public void collapseNode (Node n) { TreePath treePath = new TreePath ( treeModel.getPathToRoot ( VisualizerNode.getVisualizer (null, n) ) ); tree.collapsePath (treePath); }
/** Collapses the tree under given node. * * @param n node to collapse */ public void collapseNode(Node n) { if (n == null) { throw new IllegalArgumentException(); } TreePath treePath = new TreePath(treeModel.getPathToRoot(VisualizerNode.getVisualizer(null, n))); getOutline().collapsePath(treePath); }
/** Test whether a node is expanded in the tree or not * @param n the node to test * @return true if the node is expanded */ public boolean isExpanded(Node n) { TreePath treePath = new TreePath(treeModel.getPathToRoot(VisualizerNode.getVisualizer(null, n))); return getOutline().isExpanded(treePath); }
/** Synchronize the explored context from the manager of this Explorer. */ final void synchronizeExploredContext() { Node n = manager.getExploredContext (); if (n != null) { TreePath treePath = new TreePath (treeModel.getPathToRoot (VisualizerNode.getVisualizer (null, n))); showPath(treePath); } }
/** Synchronize the explored context from the manager of this Explorer. */ final void synchronizeExploredContext() { Node n = manager.getExploredContext (); if (n != null) { TreePath treePath = new TreePath (treeModel.getPathToRoot (VisualizerNode.getVisualizer (null, n))); showPath(treePath); } }
void scrollTreeToVisible(TreePath path, TreeNode child) { Rectangle base = tree.getVisibleRect(); Rectangle b1 = tree.getPathBounds(path); Rectangle b2 = tree.getPathBounds(new TreePath(treeModel.getPathToRoot(child))); if ((base != null) && (b1 != null) && (b2 != null)) { tree.scrollRectToVisible(new Rectangle(base.x, b1.y, 1, b2.y - b1.y + b2.height)); } }
/** Expandes the node in the tree. * * @param n node */ public void expandNode (Node n) { lookupExplorerManager (); TreePath treePath = new TreePath ( treeModel.getPathToRoot ( VisualizerNode.getVisualizer (null, n) ) ); tree.expandPath (treePath); }
void scrollTreeToVisible(TreePath path, TreeNode child) { Rectangle base = tree.getVisibleRect(); Rectangle b1 = tree.getPathBounds(path); Rectangle b2 = tree.getPathBounds(new TreePath(treeModel.getPathToRoot(child))); if (base != null && b1 != null && b2 != null) { tree.scrollRectToVisible(new Rectangle(base.x, b1.y, 1, b2.y - b1.y + b2.height)); } }
/** Expands the node in the tree. * * @param n node */ public void expandNode(Node n) { if (n == null) { throw new IllegalArgumentException(); } lookupExplorerManager(); TreePath treePath = new TreePath(treeModel.getPathToRoot(VisualizerNode.getVisualizer(null, n))); getOutline().expandPath(treePath); }
/** Expandes the node in the tree. * * @param n node */ public void expandNode (Node n) { lookupExplorerManager (); TreePath treePath = new TreePath ( treeModel.getPathToRoot ( VisualizerNode.getVisualizer (null, n) ) ); tree.expandPath (treePath); }
void scrollTreeToVisible(TreePath path, TreeNode child) { Rectangle base = tree.getVisibleRect(); Rectangle b1 = tree.getPathBounds(path); Rectangle b2 = tree.getPathBounds(new TreePath(treeModel.getPathToRoot(child))); if (base != null && b1 != null && b2 != null) { tree.scrollRectToVisible(new Rectangle(base.x, b1.y, 1, b2.y - b1.y + b2.height)); } }
/** Synchronize the selected nodes from the manager of this Explorer. * The default implementation does nothing. */ final void synchronizeSelectedNodes() { // #40152: if there is any scheduled change to view, perform it now VisualizerNode.runQueue(); Node[] arr = manager.getSelectedNodes (); TreePath[] paths = new TreePath[arr.length]; for (int i = 0; i < arr.length; i++) { TreePath treePath = new TreePath (treeModel.getPathToRoot (VisualizerNode.getVisualizer (null, arr[i]))); paths[i] = treePath; } tree.getSelectionModel().removeTreeSelectionListener(managerListener); showSelection (paths); tree.getSelectionModel().addTreeSelectionListener(managerListener); }
/** Synchronize the selected nodes from the manager of this Explorer. * The default implementation does nothing. */ final void synchronizeSelectedNodes() { // #40152: if there is any scheduled change to view, perform it now VisualizerNode.runQueue(); Node[] arr = manager.getSelectedNodes (); TreePath[] paths = new TreePath[arr.length]; for (int i = 0; i < arr.length; i++) { TreePath treePath = new TreePath (treeModel.getPathToRoot (VisualizerNode.getVisualizer (null, arr[i]))); paths[i] = treePath; } tree.getSelectionModel().removeTreeSelectionListener(managerListener); showSelection (paths); tree.getSelectionModel().addTreeSelectionListener(managerListener); }
Object[] path = getPathToRoot(node);
expandNode ((Node)toBeExpaned.get (j)); TreePath treePath = new TreePath (treeModel.getPathToRoot (VisualizerNode.getVisualizer (null, nodes[i]))); paths[i] = treePath;
expandNode ((Node)toBeExpaned.get (j)); TreePath treePath = new TreePath (treeModel.getPathToRoot (VisualizerNode.getVisualizer (null, nodes[i]))); paths[i] = treePath;