Lines Matching refs:path

109  * NOTE: This example obtains both the path and row, but you only need to
185 * particular path is expanded. This ONLY indicates whether a
186 * given path is expanded, and NOT if it is visible or not. That
287 * Lead selection path, may not be <code>null</code>.
292 * Anchor path.
327 private final TreePath path;
330 private DropLocation(Point p, TreePath path, int index) {
332 this.path = path;
338 * with respect to the path returned by <code>getPath()</code>.
343 * path over which the drop operation occurred.
347 * the parent path represented by <code>getPath()</code>.
355 * the drop occurred over the path itself.
365 * Returns the path where dropped data should be placed in the
370 * or <code>DropMode.ON</code>, the return value is the path in the
373 * not associated with a particular path.
376 * refers to the path that should become the parent of the new data,
378 * new item should be inserted into this parent path. A
379 * <code>null</code> path indicates that no parent path has been
392 * drop is on top of the path itself (<code>-1</code>) or the index
393 * at which it should be inserted into the path (values other than
396 * @return the drop path
400 return path;
414 + "path=" + path + ","
487 /** Bound property name for anchor selection path.
1144 * expanded to make them visible (visible meaning the parent path is
1159 * the parent of the path visible.
1171 * @return true if selection changes result in the parent path being
1505 * editing begins to insure that the given path can be edited. This
1512 public boolean isPathEditable(TreePath path) {
1541 TreePath path = getPathForRow(selRow);
1542 Object lastPath = path.getLastPathComponent();
1550 Rectangle pathBounds = getPathBounds(path);
1623 * Selects the node identified by the specified path. If any
1624 * component of the path is hidden (under a collapsed node), and
1628 * @param path the <code>TreePath</code> specifying the node to select
1630 public void setSelectionPath(TreePath path) {
1631 getSelectionModel().setSelectionPath(path);
1648 * Sets the path identifies as the lead. The lead may not be selected.
1654 * @param newPath the new lead path
1658 * description: Lead selection path
1668 * Sets the path identified as the anchor.
1674 * @param newPath the new anchor path
1678 * description: Anchor selection path
1727 * to the current selection. If any component of the path isn't
1735 * @param path the <code>TreePath</code> to add
1737 public void addSelectionPath(TreePath path) {
1738 getSelectionModel().addSelectionPath(path);
1742 * Adds each path in the array of paths to the current selection. If
1759 * Adds the path at the specified row to the current selection.
1790 * Returns the last path component of the selected path. This is
1793 * This is typically only useful if the selection has one path.
1795 * @return the last path component of the selected path, or
1808 * Returns the path identified as the lead.
1809 * @return path identified as the lead
1816 * Returns the path identified as the anchor.
1817 * @return path identified as the anchor
1825 * Returns the path to the first selected node.
1890 * Returns the row index corresponding to the lead path.
1892 * @return an integer giving the row index of the lead path,
1906 * Returns true if the item identified by the path is currently selected.
1908 * @param path a <code>TreePath</code> identifying a node
1911 public boolean isPathSelected(TreePath path) {
1912 return getSelectionModel().isPathSelected(path);
1928 * path <code>parent</code> that
1936 * @param parent the path which is to be examined
1947 TreePath path;
1952 path = toggledPaths.nextElement();
1953 value = expandedState.get(path);
1954 // Add the path if it is expanded, a descendant of parent,
1957 if(path != parent && value != null &&
1959 parent.isDescendant(path) && isVisible(path)) {
1963 elements.addElement(path);
1975 * Returns true if the node identified by the path has ever been
1977 * @return true if the <code>path</code> has ever been expanded
1979 public boolean hasBeenExpanded(TreePath path) {
1980 return (path != null && expandedState.get(path) != null);
1984 * Returns true if the node identified by the path is currently expanded,
1986 * @param path the <code>TreePath</code> specifying the node to check
1987 * @return false if any of the nodes in the node's path are collapsed,
1988 * true if all nodes in the path are expanded
1990 public boolean isExpanded(TreePath path) {
1992 if(path == null)
1997 value = expandedState.get(path);
2000 } while( (path=path.getParentPath())!=null );
2017 TreePath path = tree.getPathForRow(this, row);
2019 if(path != null) {
2020 Boolean value = expandedState.get(path);
2029 * Returns true if the value identified by path is currently collapsed,
2030 * this will return false if any of the values in path are currently
2033 * @param path the <code>TreePath</code> to check
2034 * @return true if any of the nodes in the node's path are collapsed,
2035 * false if all nodes in the path are expanded
2037 public boolean isCollapsed(TreePath path) {
2038 return !isExpanded(path);
2053 * Ensures that the node identified by path is currently viewable.
2055 * @param path the <code>TreePath</code> to make visible
2057 public void makeVisible(TreePath path) {
2058 if(path != null) {
2059 TreePath parentPath = path.getParentPath();
2068 * Returns true if the value identified by path is currently viewable,
2074 public boolean isVisible(TreePath path) {
2075 if(path != null) {
2076 TreePath parentPath = path.getParentPath();
2088 * into. Returns <code>null</code> if any component in the path is hidden
2095 * @param path the <code>TreePath</code> identifying the node
2099 public Rectangle getPathBounds(TreePath path) {
2103 return tree.getPathBounds(this, path);
2120 * Makes sure all the path components in path are expanded (except
2121 * for the last path component) and scrolls so that the
2122 * node identified by the path is displayed. Only works when this
2125 * @param path the <code>TreePath</code> identifying the node to
2128 public void scrollPathToVisible(TreePath path) {
2129 if(path != null) {
2130 makeVisible(path);
2132 Rectangle bounds = getPathBounds(path);
2157 * Returns the path for the specified row. If <code>row</code> is
2176 * path.
2178 * @param path the <code>TreePath</code> identifying a node
2180 * row in the display, or -1 if any of the elements in path
2183 public int getRowForPath(TreePath path) {
2187 return tree.getRowForPath(this, path);
2192 * Ensures that the node identified by the specified path is
2193 * expanded and viewable. If the last item in the path is a
2196 * @param path the <code>TreePath</code> identifying a node
2198 public void expandPath(TreePath path) {
2202 if(path != null && model != null &&
2203 !model.isLeaf(path.getLastPathComponent())) {
2204 setExpandedState(path, true);
2223 * Ensures that the node identified by the specified path is
2226 * @param path the <code>TreePath</code> identifying a node
2228 public void collapsePath(TreePath path) {
2229 setExpandedState(path, false);
2246 * Returns the path for the node at the specified location.
2284 * Returns the path to the node that is closest to x,y. If
2286 * <code>null</code>, otherwise it always returns a valid path. To test if
2379 * Selects the node identified by the specified path and initiates
2384 * @param path the <code>TreePath</code> identifying a node
2386 public void startEditingAtPath(TreePath path) {
2390 tree.startEditingAtPath(this, path);
2394 * Returns the path to the element that is currently being edited.
2408 // row based selections to path selections. Sometimes it is
2603 * Removes the node identified by the specified path from the current
2606 * @param path the <code>TreePath</code> identifying a node
2608 public void removeSelectionPath(TreePath path) {
2609 this.getSelectionModel().removeSelectionPath(path);
2744 * is lazily created using the <code>path</code> parameter.
2746 * @param path the <code>TreePath</code> indicating the node that was
2750 public void fireTreeExpanded(TreePath path) {
2755 e = new TreeExpansionEvent(this, path);
2765 e = new TreeExpansionEvent(this, path);
2775 * is lazily created using the <code>path</code> parameter.
2777 * @param path the <code>TreePath</code> indicating the node that was
2781 public void fireTreeCollapsed(TreePath path) {
2786 e = new TreeExpansionEvent(this, path);
2796 e = new TreeExpansionEvent(this, path);
2806 * is lazily created using the <code>path</code> parameter.
2808 * @param path the <code>TreePath</code> indicating the node that was
2812 public void fireTreeWillExpand(TreePath path) throws ExpandVetoException {
2822 e = new TreeExpansionEvent(this, path);
2832 * is lazily created using the <code>path</code> parameter.
2834 * @param path the <code>TreePath</code> indicating the node that was
2838 public void fireTreeWillCollapse(TreePath path) throws ExpandVetoException {
2848 e = new TreeExpansionEvent(this, path);
2971 * Expands the root path, assuming the current TreeModel has been set.
3014 TreePath path = getPathForRow(row);
3016 path.getLastPathComponent(), isRowSelected(row),
3020 return path;
3137 TreePath path = paths.nextElement();
3141 archivePath = getModelIndexsForPath(path);
3147 state.addElement(expandedState.get(path));
3166 TreePath path;
3169 path = getPathForIndexs((int[])paths.elementAt(counter));
3170 if(path != null)
3171 expandedState.put(path, eState);
3179 * components in the <code>path</code>. If <code>path</code> is
3180 * the root, this will return an empty array. If <code>path</code>
3183 private int[] getModelIndexsForPath(TreePath path) {
3184 if(path != null) {
3186 int count = path.getPathCount();
3192 (parent, path.getPathComponent(counter));
3193 parent = path.getPathComponent(counter);
3527 * true, all parents of <code>path</code> and path are marked as
3529 * <code>path</code> are marked EXPANDED, but <code>path</code> itself
3533 protected void setExpandedState(TreePath path, boolean state) {
3534 if(path != null) {
3535 // Make sure all parents of path are expanded.
3537 TreePath parentPath = path.getParentPath();
3581 // collapse last path.
3582 Object cValue = expandedState.get(path);
3586 fireTreeWillCollapse(path);
3591 expandedState.put(path, Boolean.FALSE);
3592 fireTreeCollapsed(path);
3593 if (removeDescendantSelectedPaths(path, false) &&
3594 !isPathSelected(path)) {
3596 addSelectionPath(path);
3605 // Expand last path.
3606 Object cValue = expandedState.get(path);
3610 fireTreeWillExpand(path);
3615 expandedState.put(path, Boolean.TRUE);
3616 fireTreeExpanded(path);
3641 TreePath path = nodes.nextElement();
3642 if(parent.isDescendant(path))
3643 descendants.addElement(path);
3699 * <code>path</code>. If <code>includePath</code> is true and
3700 * <code>path</code> is selected, it will be removed from the selection.
3705 protected boolean removeDescendantSelectedPaths(TreePath path,
3707 TreePath[] toRemove = getDescendantSelectedPaths(path, includePath);
3718 * <code>path</code>. The returned array may contain <code>null</code>s.
3720 private TreePath[] getDescendantSelectedPaths(TreePath path,
3731 path.isDescendant(selPaths[counter]) &&
3732 (!path.equals(selPaths[counter]) || includePath))
4206 TreePath path = e.getPath();
4207 if (path != null) {
4211 path,
4229 TreePath path = e.getPath();
4230 if (path != null) {
4235 path,
4264 TreePath path = new TreePath(model.getRoot());
4265 if (JTree.this.isVisible(path)) {
4269 int row = ui.getRowForPath(JTree.this, path);
4273 boolean selected = JTree.this.isPathSelected(path);
4274 boolean expanded = JTree.this.isExpanded(path);
4307 TreePath path = getClosestPathForLocation(p.x, p.y);
4308 if (path != null) {
4310 return new AccessibleJTreeNode(JTree.this, path, null);
4349 TreePath path = new TreePath(objPath);
4350 return new AccessibleJTreeNode(JTree.this, path, JTree.this);
4363 TreePath path = new TreePath(objPath);
4364 return new AccessibleJTreeNode(JTree.this, path, JTree.this);
4463 TreePath path = new TreePath(objPath);
4464 JTree.this.addSelectionPath(path);
4481 TreePath path = new TreePath(objPath);
4482 JTree.this.removeSelectionPath(path);
4506 TreePath path = new TreePath(objPath);
4507 JTree.this.addSelectionPath(path);
4523 private TreePath path = null;
4534 path = p;
4550 Object[] objPath = path.getPath();
4583 if (tree.isVisible(path)) {
4590 int row = ui.getRowForPath(JTree.this, path);
4591 boolean selected = tree.isPathSelected(path);
4592 boolean expanded = tree.isExpanded(path);
4715 if (tree.isPathSelected(path)){
4718 if (path == getLeadSelectionPath()) {
4724 if (tree.isExpanded(path)) {
4745 Object[] objPath = path.getPath();
4780 Object[] objPath = path.getPath();
4814 Object[] objPath = path.getPath();
5115 Rectangle pathBounds = tree.getPathBounds(path);
5147 Rectangle pathBounds = tree.getPathBounds(path);
5162 Rectangle r = tree.getPathBounds(path);
5183 Rectangle r = tree.getPathBounds(path);
5373 TreePath path = getChildTreePath(i);
5374 JTree.this.addSelectionPath(path);
5391 TreePath path = getChildTreePath(i);
5392 JTree.this.removeSelectionPath(path);
5416 TreePath path;
5418 path = getChildTreePath(i);
5419 JTree.this.addSelectionPath(path);
5486 if (JTree.this.isExpanded(path)) {
5487 JTree.this.collapsePath(path);
5489 JTree.this.expandPath(path);