JTree.java revision 2333
726N/A * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 0N/A * published by the Free Software Foundation. Sun designates this 0N/A * particular file as subject to the "Classpath" exception as provided 0N/A * by Sun in the LICENSE file that accompanied this code. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 0N/A * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 0N/A * CA 95054 USA or visit www.sun.com if you need additional information or 0N/A * have any questions. 0N/A * <a name="jtree_description"> 0N/A * A control that displays a set of hierarchical data as an outline. 0N/A * You can find task-oriented documentation and examples of using trees in 0N/A * a section in <em>The Java Tutorial.</em> 0N/A * A specific node in a tree can be identified either by a 0N/A * <code>TreePath</code> (an object 0N/A * that encapsulates a node and all of its ancestors), or by its 0N/A * display row, where each row in the display area displays one node. 0N/A * An <i>expanded</i> node is a non-leaf node (as identified by 0N/A * <code>TreeModel.isLeaf(node)</code> returning false) that will displays 0N/A * its children when all its ancestors are <i>expanded</i>. 0N/A * A <i>collapsed</i> 0N/A * node is one which hides them. A <i>hidden</i> node is one which is 0N/A * under a collapsed ancestor. All of a <i>viewable</i> nodes parents 0N/A * are expanded, but may or may not be displayed. A <i>displayed</i> node 0N/A * is both viewable and in the display area, where it can be seen. 0N/A * The following <code>JTree</code> methods use "visible" to mean "displayed": 0N/A * <li><code>isRootVisible()</code> 0N/A * <li><code>setRootVisible()</code> 0N/A * <li><code>scrollPathToVisible()</code> 0N/A * <li><code>scrollRowToVisible()</code> 0N/A * <li><code>getVisibleRowCount()</code> 0N/A * <li><code>setVisibleRowCount()</code> 0N/A * The next group of <code>JTree</code> methods use "visible" to mean 0N/A * "viewable" (under an expanded parent): 0N/A * <li><code>isVisible()</code> 0N/A * <li><code>makeVisible()</code> 0N/A * If you are interested in knowing when the selection changes implement 0N/A * the <code>TreeSelectionListener</code> interface and add the instance 0N/A * using the method <code>addTreeSelectionListener</code>. 0N/A * <code>valueChanged</code> will be invoked when the 0N/A * selection changes, that is if the user clicks twice on the same 0N/A * node <code>valueChanged</code> will only be invoked once. 0N/A * If you are interested in detecting either double-click events or when 0N/A * a user clicks on a node, regardless of whether or not it was selected, 0N/A * we recommend you do the following: 0N/A * final JTree tree = ...; 0N/A * MouseListener ml = new MouseAdapter() { 0N/A * public void <b>mousePressed</b>(MouseEvent e) { 0N/A * int selRow = tree.getRowForLocation(e.getX(), e.getY()); 0N/A * TreePath selPath = tree.getPathForLocation(e.getX(), e.getY()); 0N/A * if(selRow != -1) { 0N/A * if(e.getClickCount() == 1) { 0N/A * mySingleClick(selRow, selPath); 0N/A * else if(e.getClickCount() == 2) { 0N/A * myDoubleClick(selRow, selPath); 0N/A * tree.addMouseListener(ml); 0N/A * NOTE: This example obtains both the path and row, but you only need to 0N/A * get the one you're interested in. 0N/A * To use <code>JTree</code> to display compound nodes 0N/A * (for example, nodes containing both 0N/A * a graphic icon and text), subclass {@link TreeCellRenderer} and use 0N/A * {@link #setCellRenderer} to tell the tree to use it. To edit such nodes, 0N/A * subclass {@link TreeCellEditor} and use {@link #setCellEditor}. 0N/A * Like all <code>JComponent</code> classes, you can use {@link InputMap} and 0N/A * to associate an {@link Action} object with a {@link KeyStroke} 0N/A * and execute the action under specified conditions. 0N/A * <strong>Warning:</strong> Swing is not thread safe. For more 0N/A * information see <a 0N/A * <strong>Warning:</strong> 0N/A * Serialized objects of this class will not be compatible with 0N/A * future Swing releases. The current serialization support is 0N/A * appropriate for short term storage or RMI between applications running 0N/A * the same version of Swing. As of 1.4, support for long term storage 0N/A * of all JavaBeans<sup><font size="-2">TM</font></sup> 0N/A * has been added to the <code>java.beans</code> package. 0N/A * attribute: isContainer false 0N/A * description: A component that displays a set of hierarchical data as an outline. 0N/A * @author Scott Violet 0N/A * @see #getUIClassID 0N/A * The model that defines the tree displayed by this object. 0N/A * Models the set of selected nodes in this tree. 0N/A * True if the root node is displayed, false if its children are 0N/A * the highest visible nodes. 0N/A * The cell used to draw nodes. If <code>null</code>, the UI uses a default 0N/A * <code>cellRenderer</code>. 0N/A * Height to use for each display row. If this is <= 0 the renderer 0N/A * determines the height for each row. 0N/A * Maps from <code>TreePath</code> to <code>Boolean</code> 0N/A * indicating whether or not the 0N/A * particular path is expanded. This ONLY indicates whether a 0N/A * given path is expanded, and NOT if it is visible or not. That 0N/A * information must be determined by visiting all the parent 0N/A * paths and seeing if they are visible. 0N/A * True if handles are displayed at the topmost level of the tree. 0N/A * A handle is a small icon that displays adjacent to the node which 0N/A * allows the user to click once to expand or collapse the node. A 0N/A * common interface shows a plus sign (+) for a node which can be 0N/A * expanded and a minus sign (-) for a node which can be collapsed. 0N/A * Handles are always shown for nodes below the topmost level. 0N/A * If the <code>rootVisible</code> setting specifies that the root 0N/A * node is to be displayed, then that is the only node at the topmost 0N/A * level. If the root node is not displayed, then all of its 0N/A * children are at the topmost level of the tree. Handles are 0N/A * always displayed for nodes other than the topmost. 0N/A * If the root node isn't visible, it is generally a good to make 0N/A * this value true. Otherwise, the tree looks exactly like a list, 0N/A * and users may not know that the "list entries" are actually 0N/A * Creates a new event and passed it off the 0N/A * <code>selectionListeners</code>. 0N/A * Editor for the entries. Default is <code>null</code> 0N/A * (tree is not editable). 0N/A * Is the tree editable? Default is false. 0N/A * Is this tree a large model? This is a code-optimization setting. 0N/A * A large model can be used when the cell height is the same for all 0N/A * nodes. The UI will then cache very little information and instead 0N/A * continually message the model. Without a large model the UI caches 0N/A * most of the information, resulting in fewer method calls to the model. 0N/A * This value is only a suggestion to the UI. Not all UIs will 0N/A * take advantage of it. Default value is false. 0N/A * Number of rows to make visible at one time. This value is used for 0N/A * the <code>Scrollable</code> interface. It determines the preferred 0N/A * size of the display area. 0N/A * If true, when editing is to be stopped by way of selection changing, 0N/A * data in tree changing or other means <code>stopCellEditing</code> 0N/A * is invoked, and changes are saved. If false, 0N/A * <code>cancelCellEditing</code> is invoked, and changes 0N/A * are discarded. Default is false. 0N/A * If true, when a node is expanded, as many of the descendants are 0N/A * scrolled to be visible. 0N/A * Number of mouse clicks before a node is expanded. 0N/A * Updates the <code>expandedState</code>. 0N/A * Used when <code>setExpandedState</code> is invoked, 0N/A * will be a <code>Stack</code> of <code>Stack</code>s. 0N/A * Lead selection path, may not be <code>null</code>. 0N/A * True if paths in the selection should be expanded. 0N/A * This is set to true for the life of the <code>setUI</code> call. 0N/A /** If true, mouse presses on selections initiate a drag operation. */ 0N/A * The drop mode for this component. 0N/A * The drop location. 0N/A * A subclass of <code>TransferHandler.DropLocation</code> representing 0N/A * a drop location for a <code>JTree</code>. 0N/A * @see #getDropLocation 0N/A * Returns the index where the dropped data should be inserted 0N/A * with respect to the path returned by <code>getPath()</code>. 0N/A * For drop modes <code>DropMode.USE_SELECTION</code> and 0N/A * <code>DropMode.ON</code>, this index is unimportant (and it will 0N/A * always be <code>-1</code>) as the only interesting data is the 0N/A * path over which the drop operation occurred. 0N/A * For drop mode <code>DropMode.INSERT</code>, this index 0N/A * indicates the index at which the data should be inserted into 0N/A * the parent path represented by <code>getPath()</code>. 0N/A * <code>-1</code> indicates that the drop occurred over the 0N/A * parent itself, and in most cases should be treated as inserting 0N/A * into either the beginning or the end of the parent's list of 0N/A * For <code>DropMode.ON_OR_INSERT</code>, this value will be 0N/A * an insert index, as described above, or <code>-1</code> if 0N/A * the drop occurred over the path itself. 0N/A * @return the child index 0N/A * Returns the path where dropped data should be placed in the 0N/A * Interpretation of this value depends on the drop mode set on the 0N/A * component. If the drop mode is <code>DropMode.USE_SELECTION</code> 0N/A * or <code>DropMode.ON</code>, the return value is the path in the 0N/A * tree over which the data has been (or will be) dropped. 0N/A * <code>null</code> indicates that the drop is over empty space, 0N/A * not associated with a particular path. 0N/A * If the drop mode is <code>DropMode.INSERT</code>, the return value 0N/A * refers to the path that should become the parent of the new data, 0N/A * in which case <code>getChildIndex()</code> indicates where the 0N/A * new item should be inserted into this parent path. A 0N/A * <code>null</code> path indicates that no parent path has been 0N/A * determined, which can happen for multiple reasons: 0N/A * <li>The tree has no model 0N/A * <li>There is no root in the tree 0N/A * <li>The root is collapsed 0N/A * <li>The root is a leaf node 0N/A * It is up to the developer to decide if and how they wish to handle 0N/A * the <code>null</code> case. 0N/A * If the drop mode is <code>DropMode.ON_OR_INSERT</code>, 0N/A * <code>getChildIndex</code> can be used to determine whether the 0N/A * drop is on top of the path itself (<code>-1</code>) or the index 0N/A * at which it should be inserted into the path (values other than 0N/A * @return the drop path 0N/A * @see #getChildIndex 0N/A * Returns a string representation of this drop location. 0N/A * This method is intended to be used for debugging purposes, 0N/A * and the content and format of the returned string may vary 0N/A * between implementations. 0N/A * @return a string representation of this drop location 0N/A * The row to expand during DnD. 0N/A * A timer to expand nodes during drop. 0N/A * When <code>addTreeExpansionListener</code> is invoked, 0N/A * and <code>settingUI</code> is true, this ivar gets set to the passed in 0N/A * <code>Listener</code>. This listener is then notified first in 0N/A * <code>fireTreeCollapsed</code> and <code>fireTreeExpanded</code>. 0N/A * <p>This is an ugly workaround for a way to have the UI listener 0N/A * get notified before other listeners. 0N/A * Max number of stacks to keep around. 0N/A // Bound property names 0N/A /** Bound property name for <code>cellRenderer</code>. */ 0N/A /** Bound property name for <code>treeModel</code>. */ 0N/A /** Bound property name for <code>rootVisible</code>. */ 0N/A /** Bound property name for <code>showsRootHandles</code>. */ 0N/A /** Bound property name for <code>rowHeight</code>. */ 0N/A /** Bound property name for <code>cellEditor</code>. */ 0N/A /** Bound property name for <code>editable</code>. */ 0N/A /** Bound property name for <code>largeModel</code>. */ 0N/A /** Bound property name for selectionModel. */ 0N/A /** Bound property name for <code>visibleRowCount</code>. */ 0N/A /** Bound property name for <code>messagesStopCellEditing</code>. */ 0N/A /** Bound property name for <code>scrollsOnExpand</code>. */ 0N/A /** Bound property name for <code>toggleClickCount</code>. */ 0N/A /** Bound property name for <code>leadSelectionPath</code>. 0N/A /** Bound property name for anchor selection path. 0N/A /** Bound property name for expands selected paths property 0N/A * Creates and returns a sample <code>TreeModel</code>. 0N/A * Used primarily for beanbuilders to show something interesting. 0N/A * @return the default <code>TreeModel</code> 0N/A * Returns a <code>TreeModel</code> wrapping the specified object. 0N/A * If the object is:<ul> 0N/A * <li>an array of <code>Object</code>s, 0N/A * <li>a <code>Hashtable</code>, or 0N/A * <li>a <code>Vector</code> 0N/A * </ul>then a new root node is created with each of the incoming 0N/A * objects as children. Otherwise, a new root is created with 0N/A * a value of {@code "root"}. 0N/A * @param value the <code>Object</code> used as the foundation for 0N/A * the <code>TreeModel</code> 0N/A * @return a <code>TreeModel</code> wrapping the specified object 0N/A * Returns a <code>JTree</code> with a sample model. 0N/A * The default model used by the tree defines a leaf node as any node 0N/A * @see DefaultTreeModel#asksAllowsChildren 0N/A * Returns a <code>JTree</code> with each element of the 0N/A * specified array as the 0N/A * child of a new root node which is not displayed. 0N/A * By default, the tree defines a leaf node as any node without 0N/A * @param value an array of <code>Object</code>s 0N/A * @see DefaultTreeModel#asksAllowsChildren 0N/A * Returns a <code>JTree</code> with each element of the specified 0N/A * <code>Vector</code> as the 0N/A * child of a new root node which is not displayed. By default, the 0N/A * tree defines a leaf node as any node without children. 0N/A * @param value a <code>Vector</code> 0N/A * @see DefaultTreeModel#asksAllowsChildren 0N/A * Returns a <code>JTree</code> created from a <code>Hashtable</code> 0N/A * which does not display with root. 0N/A * Each value-half of the key/value pairs in the <code>HashTable</code> 0N/A * becomes a child of the new root node. By default, the tree defines 0N/A * a leaf node as any node without children. 0N/A * @param value a <code>Hashtable</code> 0N/A * @see DefaultTreeModel#asksAllowsChildren 0N/A * Returns a <code>JTree</code> with the specified 0N/A * <code>TreeNode</code> as its root, 0N/A * which displays the root node. 0N/A * By default, the tree defines a leaf node as any node without children. 0N/A * @param root a <code>TreeNode</code> object 0N/A * @see DefaultTreeModel#asksAllowsChildren 0N/A * Returns a <code>JTree</code> with the specified <code>TreeNode</code> 0N/A * as its root, which 0N/A * displays the root node and which decides whether a node is a 0N/A * leaf node in the specified manner. 0N/A * @param root a <code>TreeNode</code> object 0N/A * @param asksAllowsChildren if false, any node without children is a 0N/A * leaf node; if true, only nodes that do not allow 0N/A * children are leaf nodes 0N/A * @see DefaultTreeModel#asksAllowsChildren 0N/A * Returns an instance of <code>JTree</code> which displays the root node 0N/A * -- the tree is created using the specified data model. 0N/A * @param newModel the <code>TreeModel</code> to use as the data model 0N/A * Returns the L&F object that renders this component. 0N/A * @return the <code>TreeUI</code> object that renders this component 0N/A * Sets the L&F object that renders this component. 0N/A * This is a bound property. 0N/A * @param ui the <code>TreeUI</code> L&F object 0N/A * @see UIDefaults#getUI 0N/A * attribute: visualUpdate true 0N/A * description: The UI object that implements the Component's LookAndFeel. 0N/A * Notification from the <code>UIManager</code> that the L&F has changed. 0N/A * Replaces the current UI object with the latest version from the 0N/A * <code>UIManager</code>. 0N/A * @see JComponent#updateUI 0N/A * Returns the name of the L&F class that renders this component. 0N/A * @return the string "TreeUI" 0N/A * @see JComponent#getUIClassID 0N/A * @see UIDefaults#getUI 0N/A * Returns the current <code>TreeCellRenderer</code> 0N/A * that is rendering each cell. 0N/A * @return the <code>TreeCellRenderer</code> that is rendering each cell 0N/A * Sets the <code>TreeCellRenderer</code> that will be used to 0N/A * This is a bound property. 0N/A * @param x the <code>TreeCellRenderer</code> that is to render each cell 0N/A * description: The TreeCellRenderer that will be used to draw 0N/A * Determines whether the tree is editable. Fires a property 0N/A * change event if the new setting is different from the existing 0N/A * This is a bound property. 0N/A * @param flag a boolean value, true if the tree is editable 0N/A * description: Whether the tree is editable. 0N/A * Returns true if the tree is editable. 0N/A * @return true if the tree is editable 0N/A * Sets the cell editor. A <code>null</code> value implies that the 0N/A * tree cannot be edited. If this represents a change in the 0N/A * <code>cellEditor</code>, the <code>propertyChange</code> 0N/A * method is invoked on all listeners. 0N/A * This is a bound property. 0N/A * @param cellEditor the <code>TreeCellEditor</code> to use 0N/A * description: The cell editor. A null value implies the tree 0N/A * Returns the editor used to edit entries in the tree. 0N/A * @return the <code>TreeCellEditor</code> in use, 0N/A * or <code>null</code> if the tree cannot be edited 0N/A * Returns the <code>TreeModel</code> that is providing the data. 0N/A * @return the <code>TreeModel</code> that is providing the data 0N/A * Sets the <code>TreeModel</code> that will provide the data. 0N/A * This is a bound property. 0N/A * @param newModel the <code>TreeModel</code> that is to provide the data 0N/A * description: The TreeModel that will provide the data. 0N/A // Mark the root as expanded, if it isn't a leaf. 0N/A * Returns true if the root node of the tree is displayed. 0N/A * @return true if the root node of the tree is displayed 0N/A * Determines whether or not the root node from 0N/A * the <code>TreeModel</code> is visible. 0N/A * This is a bound property. 0N/A * @param rootVisible true if the root node of the tree is to be displayed 0N/A * description: Whether or not the root node 0N/A * from the TreeModel is visible. 0N/A * Sets the value of the <code>showsRootHandles</code> property, 0N/A * which specifies whether the node handles should be displayed. 0N/A * The default value of this property depends on the constructor 0N/A * used to create the <code>JTree</code>. 0N/A * Some look and feels might not support handles; 0N/A * they will ignore this property. 0N/A * This is a bound property. 0N/A * @param newValue <code>true</code> if root handles should be displayed; 0N/A * otherwise, <code>false</code> 0N/A * @see #showsRootHandles 0N/A * @see #getShowsRootHandles 0N/A * description: Whether the node handles are to be 0N/A * Returns the value of the <code>showsRootHandles</code> property. 0N/A * @return the value of the <code>showsRootHandles</code> property 0N/A * @see #showsRootHandles 0N/A * Sets the height of each cell, in pixels. If the specified value 0N/A * is less than or equal to zero the current cell renderer is 0N/A * queried for each row's height. 0N/A * This is a bound property. 0N/A * @param rowHeight the height of each cell, in pixels 0N/A * description: The height of each cell. 0N/A * Returns the height of each row. If the returned value is less than 0N/A * or equal to 0 the height for each row is determined by the 0N/A * Returns true if the height of each display row is a fixed size. 0N/A * @return true if the height of each row is a fixed size 0N/A * Specifies whether the UI should use a large model. 0N/A * (Not all UIs will implement this.) Fires a property change 0N/A * for the LARGE_MODEL_PROPERTY. 0N/A * This is a bound property. 0N/A * @param newValue true to suggest a large model to the UI 0N/A * description: Whether the UI should use a 0N/A * Returns true if the tree is configured for a large model. 0N/A * @return true if a large model is suggested 0N/A * Determines what happens when editing is interrupted by selecting 0N/A * another node in the tree, a change in the tree's data, or by some 0N/A * other means. Setting this property to <code>true</code> causes the 0N/A * changes to be automatically saved when editing is interrupted. 0N/A * Fires a property change for the INVOKES_STOP_CELL_EDITING_PROPERTY. 0N/A * @param newValue true means that <code>stopCellEditing</code> is invoked 0N/A * when editing is interrupted, and data is saved; false means that 0N/A * <code>cancelCellEditing</code> is invoked, and changes are lost 0N/A * description: Determines what happens when editing is interrupted, 0N/A * selecting another node in the tree, a change in the 0N/A * tree's data, or some other means. 0N/A * Returns the indicator that tells what happens when editing is 0N/A * @return the indicator that tells what happens when editing is 0N/A * @see #setInvokesStopCellEditing 0N/A * Sets the <code>scrollsOnExpand</code> property, 0N/A * which determines whether the 0N/A * tree might scroll to show previously hidden children. 0N/A * If this property is <code>true</code> (the default), 0N/A * when a node expands 0N/A * the tree can use scrolling to make 0N/A * the maximum possible number of the node's descendants visible. 0N/A * In some look and feels, trees might not need to scroll when expanded; 0N/A * those look and feels will ignore this property. 0N/A * This is a bound property. 0N/A * @param newValue <code>false</code> to disable scrolling on expansion; 0N/A * <code>true</code> to enable it 0N/A * @see #getScrollsOnExpand 0N/A * description: Indicates if a node descendant should be scrolled when expanded. 0N/A * Returns the value of the <code>scrollsOnExpand</code> property. 0N/A * @return the value of the <code>scrollsOnExpand</code> property 0N/A * Sets the number of mouse clicks before a node will expand or close. 0N/A * The default is two. 0N/A * This is a bound property. 0N/A * Returns the number of mouse clicks needed to expand or close a node. 0N/A * @return number of mouse clicks before node is expanded 0N/A * Configures the <code>expandsSelectedPaths</code> property. If 0N/A * true, any time the selection is changed, either via the 0N/A * <code>TreeSelectionModel</code>, or the cover methods provided by 0N/A * <code>JTree</code>, the <code>TreePath</code>s parents will be 0N/A * expanded to make them visible (visible meaning the parent path is 0N/A * expanded, not necessarily in the visible rectangle of the 0N/A * <code>JTree</code>). If false, when the selection 0N/A * changes the nodes parent is not made visible (all its parents expanded). 0N/A * This is useful if you wish to have your selection model maintain paths 0N/A * that are not always visible (all parents expanded). 0N/A * This is a bound property. 0N/A * @param newValue the new value for <code>expandsSelectedPaths</code> 0N/A * description: Indicates whether changes to the selection should make 0N/A * the parent of the path visible. 0N/A * Returns the <code>expandsSelectedPaths</code> property. 0N/A * @return true if selection changes result in the parent path being 0N/A * @see #setExpandsSelectedPaths 0N/A * Turns on or off automatic drag handling. In order to enable automatic 0N/A * drag handling, this property should be set to {@code true}, and the 0N/A * tree's {@code TransferHandler} needs to be {@code non-null}. 0N/A * The default value of the {@code dragEnabled} property is {@code false}. 0N/A * The job of honoring this property, and recognizing a user drag gesture, 0N/A * lies with the look and feel implementation, and in particular, the tree's 0N/A * {@code TreeUI}. When automatic drag handling is enabled, most look and 0N/A * feels (including those that subclass {@code BasicLookAndFeel}) begin a 0N/A * drag and drop operation whenever the user presses the mouse button over 0N/A * an item and then moves the mouse a few pixels. Setting this property to 0N/A * {@code true} can therefore have a subtle effect on how selections behave. 0N/A * If a look and feel is used that ignores this property, you can still 0N/A * begin a drag and drop operation by calling {@code exportAsDrag} on the 0N/A * tree's {@code TransferHandler}. 0N/A * @param b whether or not to enable automatic drag handling 0N/A * @exception HeadlessException if 0N/A * <code>b</code> is <code>true</code> and 0N/A * <code>GraphicsEnvironment.isHeadless()</code> 0N/A * returns <code>true</code> 0N/A * @see java.awt.GraphicsEnvironment#isHeadless 0N/A * @see #getDragEnabled 0N/A * @see #setTransferHandler 0N/A * @see TransferHandler 0N/A * description: determines whether automatic drag handling is enabled 0N/A * Returns whether or not automatic drag handling is enabled. 0N/A * @return the value of the {@code dragEnabled} property 0N/A * @see #setDragEnabled 0N/A * Sets the drop mode for this component. For backward compatibility, 0N/A * the default for this property is <code>DropMode.USE_SELECTION</code>. 0N/A * Usage of one of the other modes is recommended, however, for an 0N/A * improved user experience. <code>DropMode.ON</code>, for instance, 0N/A * offers similar behavior of showing items as selected, but does so without 0N/A * affecting the actual selection in the tree. 0N/A * <code>JTree</code> supports the following drop modes: 0N/A * <li><code>DropMode.USE_SELECTION</code></li> 0N/A * <li><code>DropMode.ON</code></li> 0N/A * <li><code>DropMode.INSERT</code></li> 0N/A * <li><code>DropMode.ON_OR_INSERT</code></li> 0N/A * The drop mode is only meaningful if this component has a 0N/A * <code>TransferHandler</code> that accepts drops. 0N/A * @param dropMode the drop mode to use 0N/A * @throws IllegalArgumentException if the drop mode is unsupported 0N/A * or <code>null</code> 0N/A * @see #getDropLocation 0N/A * @see #setTransferHandler 0N/A * @see TransferHandler 0N/A * Returns the drop mode for this component. 0N/A * @return the drop mode for this component 0N/A * Calculates a drop location in this component, representing where a 0N/A * drop at the given point should insert data. 0N/A * @param p the point to calculate a drop location for 0N/A * @return the drop location, or <code>null</code> 0N/A assert false :
"Unexpected drop mode";
0N/A * Called to set or clear the drop location during a DnD operation. 0N/A * In some cases, the component may need to use it's internal selection 0N/A * temporarily to indicate the drop location. To help facilitate this, 0N/A * this method returns and accepts as a parameter a state object. 0N/A * This state object can be used to store, and later restore, the selection 0N/A * state. Whatever this method returns will be passed back to it in 0N/A * future calls, as the state parameter. If it wants the DnD system to 0N/A * continue storing the same state, it must pass it back every time. 0N/A * Here's how this is used: 0N/A * Let's say that on the first call to this method the component decides 0N/A * to save some state (because it is about to use the selection to show 0N/A * a drop index). It can return a state object to the caller encapsulating 0N/A * any saved selection state. On a second call, let's say the drop location 0N/A * is being changed to something else. The component doesn't need to 0N/A * restore anything yet, so it simply passes back the same state object 0N/A * to have the DnD system continue storing it. Finally, let's say this 0N/A * method is messaged with <code>null</code>. This means DnD 0N/A * is finished with this component for now, meaning it should restore 0N/A * state. At this point, it can use the state parameter to restore 0N/A * said state, and of course return <code>null</code> since there's 0N/A * no longer anything to store. 0N/A * @param location the drop location (as calculated by 0N/A * <code>dropLocationForPoint</code>) or <code>null</code> 0N/A * if there's no longer a valid drop location 0N/A * @param state the state object saved earlier for this component, 0N/A * or <code>null</code> 0N/A * @param forDrop whether or not the method is being called because an 0N/A * actual drop occurred 0N/A * @return any saved state for this component, or <code>null</code> if none 0N/A * Called to indicate to this component that DnD is done. 0N/A * Allows for us to cancel the expand timer. 0N/A * Returns the location that this component should visually indicate 0N/A * as the drop location during a DnD operation over the component, 0N/A * or {@code null} if no location is to currently be shown. 0N/A * This method is not meant for querying the drop location 0N/A * from a {@code TransferHandler}, as the drop location is only 0N/A * set after the {@code TransferHandler}'s <code>canImport</code> 0N/A * has returned and has allowed for the location to be shown. 0N/A * When this property changes, a property change event with 0N/A * name "dropLocation" is fired by the component. 0N/A * @return the drop location 0N/A * @see TransferHandler#canImport(TransferHandler.TransferSupport) 0N/A * Returns <code>isEditable</code>. This is invoked from the UI before 0N/A * editing begins to insure that the given path can be edited. This 0N/A * is provided as an entry point for subclassers to add filtered 0N/A * editing without having to resort to creating a new editor. 0N/A * @return true if every parent node and the node itself is editable 0N/A * Overrides <code>JComponent</code>'s <code>getToolTipText</code> 0N/A * method in order to allow 0N/A * renderer's tips to be used if it has text set. 0N/A * NOTE: For <code>JTree</code> to properly display tooltips of its 0N/A * renderers, <code>JTree</code> must be a registered component with the 0N/A * <code>ToolTipManager</code>. This can be done by invoking 0N/A * <code>ToolTipManager.sharedInstance().registerComponent(tree)</code>. 0N/A * This is not done automatically! 0N/A * @param event the <code>MouseEvent</code> that initiated the 0N/A * <code>ToolTip</code> display 0N/A * @return a string containing the tooltip or <code>null</code> 0N/A * if <code>event</code> is null 0N/A // No tip from the renderer get our own tip 0N/A * Called by the renderers to convert the specified value to 0N/A * text. This implementation returns <code>value.toString</code>, ignoring 0N/A * all other arguments. To control the conversion, subclass this 0N/A * method and use any of the arguments you need. 0N/A * @param value the <code>Object</code> to convert to text 0N/A * @param selected true if the node is selected 0N/A * @param expanded true if the node is expanded 0N/A * @param leaf true if the node is a leaf node 0N/A * @param row an integer specifying the node's display row, where 0 is 0N/A * the first row in the display 0N/A * @param hasFocus true if the node has the focus 0N/A * @return the <code>String</code> representation of the node's value 0N/A // The following are convenience methods that get forwarded to the 0N/A * Returns the number of viewable nodes. A node is viewable if all of its 0N/A * parents are expanded. The root is only included in this count if 0N/A * {@code isRootVisible()} is {@code true}. This returns {@code 0} if 0N/A * the UI has not been set. 0N/A * @return the number of viewable nodes 0N/A * Selects the node identified by the specified path. If any 0N/A * component of the path is hidden (under a collapsed node), and 0N/A * <code>getExpandsSelectedPaths</code> is true it is 0N/A * exposed (made viewable). 0N/A * @param path the <code>TreePath</code> specifying the node to select 0N/A * Selects the nodes identified by the specified array of paths. 0N/A * If any component in any of the paths is hidden (under a collapsed 0N/A * node), and <code>getExpandsSelectedPaths</code> is true 0N/A * it is exposed (made viewable). 0N/A * @param paths an array of <code>TreePath</code> objects that specifies 0N/A * the nodes to select 0N/A * Sets the path identifies as the lead. The lead may not be selected. 0N/A * The lead is not maintained by <code>JTree</code>, 0N/A * rather the UI will update it. 0N/A * This is a bound property. 0N/A * @param newPath the new lead path 0N/A * description: Lead selection path 0N/A * Sets the path identified as the anchor. 0N/A * The anchor is not maintained by <code>JTree</code>, rather the UI will 0N/A * This is a bound property. 0N/A * @param newPath the new anchor path 0N/A * description: Anchor selection path 0N/A * Selects the node at the specified row in the display. 0N/A * @param row the row to select, where 0 is the first row in 0N/A * Selects the nodes corresponding to each of the specified rows 0N/A * in the display. If a particular element of <code>rows</code> is 0N/A * < 0 or >= <code>getRowCount</code>, it will be ignored. 0N/A * If none of the elements 0N/A * in <code>rows</code> are valid rows, the selection will 0N/A * be cleared. That is it will be as if <code>clearSelection</code> 0N/A * @param rows an array of ints specifying the rows to select, 0N/A * where 0 indicates the first row in the display 0N/A * Adds the node identified by the specified <code>TreePath</code> 0N/A * to the current selection. If any component of the path isn't 0N/A * viewable, and <code>getExpandsSelectedPaths</code> is true it is 0N/A * Note that <code>JTree</code> does not allow duplicate nodes to 0N/A * exist as children under the same parent -- each sibling must be 0N/A * @param path the <code>TreePath</code> to add 0N/A * Adds each path in the array of paths to the current selection. If 0N/A * any component of any of the paths isn't viewable and 0N/A * <code>getExpandsSelectedPaths</code> is true, it is 0N/A * Note that <code>JTree</code> does not allow duplicate nodes to 0N/A * exist as children under the same parent -- each sibling must be 0N/A * @param paths an array of <code>TreePath</code> objects that specifies 0N/A * Adds the path at the specified row to the current selection. 0N/A * @param row an integer specifying the row of the node to add, 0N/A * where 0 is the first row in the display 0N/A * Adds the paths at each of the specified rows to the current selection. 0N/A * @param rows an array of ints specifying the rows to add, 0N/A * where 0 indicates the first row in the display 0N/A * Returns the last path component of the selected path. This is 0N/A * a convenience method for 0N/A * {@code getSelectionModel().getSelectionPath().getLastPathComponent()}. 0N/A * This is typically only useful if the selection has one path. 0N/A * @return the last path component of the selected path, or 0N/A * <code>null</code> if nothing is selected 0N/A * @see TreePath#getLastPathComponent 0N/A * Returns the path identified as the lead. 0N/A * @return path identified as the lead 0N/A * Returns the path identified as the anchor. 0N/A * @return path identified as the anchor 0N/A * Returns the path to the first selected node. 0N/A * @return the <code>TreePath</code> for the first selected node, 0N/A * or <code>null</code> if nothing is currently selected 0N/A * Returns the paths of all selected values. 0N/A * @return an array of <code>TreePath</code> objects indicating the selected 0N/A * nodes, or <code>null</code> if nothing is currently selected 0N/A * Returns all of the currently selected rows. This method is simply 0N/A * forwarded to the <code>TreeSelectionModel</code>. 0N/A * If nothing is selected <code>null</code> or an empty array will 0N/A * be returned, based on the <code>TreeSelectionModel</code> 0N/A * @return an array of integers that identifies all currently selected rows 0N/A * where 0 is the first row in the display 0N/A * Returns the number of nodes selected. 0N/A * @return the number of nodes selected 0N/A * Returns the smallest selected row. If the selection is empty, or 0N/A * none of the selected paths are viewable, {@code -1} is returned. 0N/A * @return the smallest selected row 0N/A * Returns the largest selected row. If the selection is empty, or 0N/A * none of the selected paths are viewable, {@code -1} is returned. 0N/A * @return the largest selected row 0N/A * Returns the row index corresponding to the lead path. 0N/A * @return an integer giving the row index of the lead path, 0N/A * where 0 is the first row in the display; or -1 0N/A * if <code>leadPath</code> is <code>null</code> 0N/A * Returns true if the item identified by the path is currently selected. 0N/A * @param path a <code>TreePath</code> identifying a node 0N/A * @return true if the node is selected 0N/A * Returns true if the node identified by row is selected. 0N/A * @param row an integer specifying a display row, where 0 is the first 0N/A * row in the display 0N/A * @return true if the node is selected 0N/A * Returns an <code>Enumeration</code> of the descendants of the 0N/A * path <code>parent</code> that 0N/A * are currently expanded. If <code>parent</code> is not currently 0N/A * expanded, this will return <code>null</code>. 0N/A * iterating over the returned <code>Enumeration</code> 0N/A * this may not return all 0N/A * the expanded paths, or may return paths that are no longer expanded. 0N/A * @param parent the path which is to be examined 0N/A * @return an <code>Enumeration</code> of the descendents of 0N/A * <code>parent</code>, or <code>null</code> if 0N/A * <code>parent</code> is not currently expanded 0N/A // Add the path if it is expanded, a descendant of parent, 0N/A // and it is visible (all parents expanded). This is rather 0N/A * Returns true if the node identified by the path has ever been 0N/A * @return true if the <code>path</code> has ever been expanded 0N/A * Returns true if the node identified by the path is currently expanded, 0N/A * @param path the <code>TreePath</code> specifying the node to check 0N/A * @return false if any of the nodes in the node's path are collapsed, 0N/A * true if all nodes in the path are expanded 0N/A // Is this node expanded? 0N/A // It is, make sure its parent is also expanded. 0N/A * Returns true if the node at the specified display row is currently 0N/A * @param row the row to check, where 0 is the first row in the 0N/A * @return true if the node is currently expanded, otherwise false 0N/A * Returns true if the value identified by path is currently collapsed, 0N/A * this will return false if any of the values in path are currently 0N/A * not being displayed. 0N/A * @param path the <code>TreePath</code> to check 0N/A * @return true if any of the nodes in the node's path are collapsed, 0N/A * false if all nodes in the path are expanded 0N/A * Returns true if the node at the specified display row is collapsed. 0N/A * @param row the row to check, where 0 is the first row in the 0N/A * @return true if the node is currently collapsed, otherwise false 0N/A * Ensures that the node identified by path is currently viewable. 0N/A * @param path the <code>TreePath</code> to make visible 0N/A * Returns true if the value identified by path is currently viewable, 0N/A * which means it is either the root or all of its parents are expanded. 0N/A * Otherwise, this method returns false. 0N/A * @return true if the node is viewable, otherwise false 0N/A * Returns the <code>Rectangle</code> that the specified node will be drawn 0N/A * into. Returns <code>null</code> if any component in the path is hidden 0N/A * (under a collapsed parent). 0N/A * This method returns a valid rectangle, even if the specified 0N/A * node is not currently displayed. 0N/A * @param path the <code>TreePath</code> identifying the node 0N/A * @return the <code>Rectangle</code> the node is drawn in, 0N/A * or <code>null</code> 0N/A * Returns the <code>Rectangle</code> that the node at the specified row is 0N/A * @param row the row to be drawn, where 0 is the first row in the 0N/A * @return the <code>Rectangle</code> the node is drawn in 0N/A * Makes sure all the path components in path are expanded (except 0N/A * for the last path component) and scrolls so that the 0N/A * node identified by the path is displayed. Only works when this 0N/A * <code>JTree</code> is contained in a <code>JScrollPane</code>. 0N/A * @param path the <code>TreePath</code> identifying the node to 0N/A * Scrolls the item identified by row until it is displayed. The minimum 0N/A * of amount of scrolling necessary to bring the row into view 0N/A * is performed. Only works when this <code>JTree</code> is contained in a 0N/A * <code>JScrollPane</code>. 0N/A * @param row an integer specifying the row to scroll, where 0 is the 0N/A * first row in the display 0N/A * Returns the path for the specified row. If <code>row</code> is 0N/A * not visible, or a {@code TreeUI} has not been set, <code>null</code> 0N/A * @param row an integer specifying a row 0N/A * @return the <code>TreePath</code> to the specified node, 0N/A * <code>null</code> if <code>row < 0</code> 0N/A * or <code>row >= getRowCount()</code> 0N/A * Returns the row that displays the node identified by the specified 0N/A * @param path the <code>TreePath</code> identifying a node 0N/A * @return an integer specifying the display row, where 0 is the first 0N/A * row in the display, or -1 if any of the elements in path 0N/A * are hidden under a collapsed parent. 0N/A * Ensures that the node identified by the specified path is 0N/A * expanded and viewable. If the last item in the path is a 0N/A * leaf, this will have no effect. 0N/A * @param path the <code>TreePath</code> identifying a node 0N/A // Only expand if not leaf! 0N/A * Ensures that the node in the specified row is expanded and 0N/A * If <code>row</code> is < 0 or >= <code>getRowCount</code> this 0N/A * will have no effect. 0N/A * @param row an integer specifying a display row, where 0 is the 0N/A * first row in the display 0N/A * Ensures that the node identified by the specified path is 0N/A * collapsed and viewable. 0N/A * @param path the <code>TreePath</code> identifying a node 0N/A * Ensures that the node in the specified row is collapsed. 0N/A * If <code>row</code> is < 0 or >= <code>getRowCount</code> this 0N/A * will have no effect. 0N/A * @param row an integer specifying a display row, where 0 is the 0N/A * first row in the display 0N/A * Returns the path for the node at the specified location. 0N/A * @param x an integer giving the number of pixels horizontally from 0N/A * the left edge of the display area, minus any left margin 0N/A * @param y an integer giving the number of pixels vertically from 0N/A * the top of the display area, minus any top margin 0N/A * @return the <code>TreePath</code> for the node at that location 0N/A * Returns the row for the specified location. 0N/A * @param x an integer giving the number of pixels horizontally from 0N/A * the left edge of the display area, minus any left margin 0N/A * @param y an integer giving the number of pixels vertically from 0N/A * the top of the display area, minus any top margin 0N/A * @return the row corresponding to the location, or -1 if the 0N/A * location is not within the bounds of a displayed cell 0N/A * @see #getClosestRowForLocation 0N/A * Returns the path to the node that is closest to x,y. If 0N/A * no nodes are currently viewable, or there is no model, returns 0N/A * <code>null</code>, otherwise it always returns a valid path. To test if 0N/A * the node is exactly at x, y, get the node's bounds and 0N/A * test x, y against that. 0N/A * @param x an integer giving the number of pixels horizontally from 0N/A * the left edge of the display area, minus any left margin 0N/A * @param y an integer giving the number of pixels vertically from 0N/A * the top of the display area, minus any top margin 0N/A * @return the <code>TreePath</code> for the node closest to that location, 0N/A * <code>null</code> if nothing is viewable or there is no model 0N/A * @see #getPathForLocation 0N/A * @see #getPathBounds 0N/A * Returns the row to the node that is closest to x,y. If no nodes 0N/A * are viewable or there is no model, returns -1. Otherwise, 0N/A * it always returns a valid row. To test if the returned object is 0N/A * exactly at x, y, get the bounds for the node at the returned 0N/A * row and test x, y against that. 0N/A * @param x an integer giving the number of pixels horizontally from 0N/A * the left edge of the display area, minus any left margin 0N/A * @param y an integer giving the number of pixels vertically from 0N/A * the top of the display area, minus any top margin 0N/A * @return the row closest to the location, -1 if nothing is 0N/A * viewable or there is no model 0N/A * @see #getRowForLocation 0N/A * @see #getRowBounds 0N/A * Returns true if the tree is being edited. The item that is being 0N/A * edited can be obtained using <code>getSelectionPath</code>. 0N/A * @return true if the user is currently editing a node 0N/A * @see #getSelectionPath 0N/A * Ends the current editing session. 0N/A * (The <code>DefaultTreeCellEditor</code> 0N/A * object saves any edits that are currently in progress on a cell. 0N/A * Other implementations may operate differently.) 0N/A * Has no effect if the tree isn't being edited. 0N/A * To make edit-saves automatic whenever the user changes 0N/A * their position in the tree, use {@link #setInvokesStopCellEditing}. 0N/A * @return true if editing was in progress and is now stopped, 0N/A * false if editing was not in progress 0N/A * Cancels the current editing session. Has no effect if the 0N/A * tree isn't being edited. 0N/A * Selects the node identified by the specified path and initiates 0N/A * editing. The edit-attempt fails if the <code>CellEditor</code> 0N/A * editing for the specified item. 0N/A * @param path the <code>TreePath</code> identifying a node 0N/A * Returns the path to the element that is currently being edited. 0N/A * @return the <code>TreePath</code> for the node being edited 0N/A // Following are primarily convenience methods for mapping from 0N/A // row based selections to path selections. Sometimes it is 0N/A // easier to deal with these than paths (mouse downs, key downs 0N/A // usually just deal with index based selections). 0N/A // Since row based selections require a UI many of these won't work 0N/A * Sets the tree's selection model. When a <code>null</code> value is 0N/A * specified an empty 0N/A * <code>selectionModel</code> is used, which does not allow selections. 0N/A * This is a bound property. 0N/A * @param selectionModel the <code>TreeSelectionModel</code> to use, 0N/A * or <code>null</code> to disable selections 0N/A * @see TreeSelectionModel 0N/A * description: The tree's selection model. 0N/A * Returns the model for selections. This should always return a 0N/A * non-<code>null</code> value. If you don't want to allow anything 0N/A * set the selection model to <code>null</code>, which forces an empty 0N/A * selection model to be used. 0N/A * @see #setSelectionModel 0N/A * Returns the paths (inclusive) between the specified rows. If 0N/A * the specified indices are within the viewable set of rows, or 0N/A * bound the viewable set of rows, then the indices are 0N/A * constrained by the viewable set of rows. If the specified 0N/A * indices are not within the viewable set of rows, or do not 0N/A * bound the viewable set of rows, then an empty array is 0N/A * returned. For example, if the row count is {@code 10}, and this 0N/A * method is invoked with {@code -1, 20}, then the specified 0N/A * indices are constrained to the viewable set of rows, and this is 0N/A * treated as if invoked with {@code 0, 9}. On the other hand, if 0N/A * this were invoked with {@code -10, -1}, then the specified 0N/A * indices do not bound the viewable set of rows, and an empty 0N/A * array is returned. 0N/A * The parameters are not order dependent. That is, {@code 0N/A * getPathBetweenRows(x, y)} is equivalent to 0N/A * {@code getPathBetweenRows(y, x)}. 0N/A * An empty array is returned if the row count is {@code 0}, or 0N/A * the specified indices do not bound the viewable set of rows. 0N/A * @param index0 the first index in the range 0N/A * @param index1 the last index in the range 0N/A * @return the paths (inclusive) between the specified row indices 0N/A * Selects the rows in the specified interval (inclusive). If 0N/A * the specified indices are within the viewable set of rows, or bound 0N/A * the viewable set of rows, then the specified rows are constrained by 0N/A * the viewable set of rows. If the specified indices are not within the 0N/A * viewable set of rows, or do not bound the viewable set of rows, then 0N/A * the selection is cleared. For example, if the row count is {@code 0N/A * 10}, and this method is invoked with {@code -1, 20}, then the 0N/A * specified indices bounds the viewable range, and this is treated as 0N/A * if invoked with {@code 0, 9}. On the other hand, if this were 0N/A * invoked with {@code -10, -1}, then the specified indices do not 0N/A * bound the viewable set of rows, and the selection is cleared. 0N/A * The parameters are not order dependent. That is, {@code 0N/A * setSelectionInterval(x, y)} is equivalent to 0N/A * {@code setSelectionInterval(y, x)}. 0N/A * @param index0 the first index in the range to select 0N/A * @param index1 the last index in the range to select 0N/A * Adds the specified rows (inclusive) to the selection. If the 0N/A * specified indices are within the viewable set of rows, or bound 0N/A * the viewable set of rows, then the specified indices are 0N/A * constrained by the viewable set of rows. If the indices are not 0N/A * within the viewable set of rows, or do not bound the viewable 0N/A * set of rows, then the selection is unchanged. For example, if 0N/A * the row count is {@code 10}, and this method is invoked with 0N/A * {@code -1, 20}, then the specified indices bounds the viewable 0N/A * range, and this is treated as if invoked with {@code 0, 9}. On 0N/A * the other hand, if this were invoked with {@code -10, -1}, then 0N/A * the specified indices do not bound the viewable set of rows, 0N/A * and the selection is unchanged. 0N/A * The parameters are not order dependent. That is, {@code 0N/A * addSelectionInterval(x, y)} is equivalent to 0N/A * {@code addSelectionInterval(y, x)}. 0N/A * @param index0 the first index in the range to add to the selection 0N/A * @param index1 the last index in the range to add to the selection 0N/A * Removes the specified rows (inclusive) from the selection. If 0N/A * the specified indices are within the viewable set of rows, or bound 0N/A * the viewable set of rows, then the specified indices are constrained by 0N/A * the viewable set of rows. If the specified indices are not within the 0N/A * viewable set of rows, or do not bound the viewable set of rows, then 0N/A * the selection is unchanged. For example, if the row count is {@code 0N/A * 10}, and this method is invoked with {@code -1, 20}, then the 0N/A * specified range bounds the viewable range, and this is treated as 0N/A * if invoked with {@code 0, 9}. On the other hand, if this were 0N/A * invoked with {@code -10, -1}, then the specified range does not 0N/A * bound the viewable set of rows, and the selection is unchanged. 0N/A * The parameters are not order dependent. That is, {@code 0N/A * removeSelectionInterval(x, y)} is equivalent to 0N/A * {@code removeSelectionInterval(y, x)}. 0N/A * @param index0 the first row to remove from the selection 0N/A * @param index1 the last row to remove from the selection 0N/A * Removes the node identified by the specified path from the current 0N/A * @param path the <code>TreePath</code> identifying a node 0N/A * Removes the nodes identified by the specified paths from the 0N/A * current selection. 0N/A * @param paths an array of <code>TreePath</code> objects that 0N/A * specifies the nodes to remove 0N/A * Removes the row at the index <code>row</code> from the current 0N/A * @param row the row to remove 0N/A * Removes the rows that are selected at each of the specified 0N/A * @param rows an array of ints specifying display rows, where 0 is 0N/A * the first row in the display 0N/A * Clears the selection. 0N/A * Returns true if the selection is currently empty. 0N/A * @return true if the selection is currently empty 0N/A * Adds a listener for <code>TreeExpansion</code> events. 0N/A * @param tel a TreeExpansionListener that will be notified when 0N/A * a tree node is expanded or collapsed (a "negative 0N/A * Removes a listener for <code>TreeExpansion</code> events. 0N/A * @param tel the <code>TreeExpansionListener</code> to remove 0N/A * Returns an array of all the <code>TreeExpansionListener</code>s added 0N/A * to this JTree with addTreeExpansionListener(). 0N/A * @return all of the <code>TreeExpansionListener</code>s added or an empty 0N/A * array if no listeners have been added 0N/A * Adds a listener for <code>TreeWillExpand</code> events. 0N/A * @param tel a <code>TreeWillExpandListener</code> that will be notified 0N/A * when a tree node will be expanded or collapsed (a "negative 0N/A * Removes a listener for <code>TreeWillExpand</code> events. 0N/A * @param tel the <code>TreeWillExpandListener</code> to remove 0N/A * Returns an array of all the <code>TreeWillExpandListener</code>s added 0N/A * to this JTree with addTreeWillExpandListener(). 0N/A * @return all of the <code>TreeWillExpandListener</code>s added or an empty 0N/A * array if no listeners have been added 0N/A * Notifies all listeners that have registered interest for 0N/A * notification on this event type. The event instance 0N/A * is lazily created using the <code>path</code> parameter. 0N/A * @param path the <code>TreePath</code> indicating the node that was 0N/A * @see EventListenerList 0N/A // Guaranteed to return a non-null array 0N/A // Process the listeners last to first, notifying 0N/A // those that are interested in this event 0N/A // Lazily create the event: 0N/A * Notifies all listeners that have registered interest for 0N/A * notification on this event type. The event instance 0N/A * is lazily created using the <code>path</code> parameter. 0N/A * @param path the <code>TreePath</code> indicating the node that was 0N/A * @see EventListenerList 0N/A // Guaranteed to return a non-null array 0N/A // Process the listeners last to first, notifying 0N/A // those that are interested in this event 0N/A // Lazily create the event: 0N/A * Notifies all listeners that have registered interest for 0N/A * notification on this event type. The event instance 0N/A * is lazily created using the <code>path</code> parameter. 0N/A * @param path the <code>TreePath</code> indicating the node that was 0N/A * @see EventListenerList 0N/A // Guaranteed to return a non-null array 0N/A // Process the listeners last to first, notifying 0N/A // those that are interested in this event 0N/A // Lazily create the event: 0N/A * Notifies all listeners that have registered interest for 0N/A * notification on this event type. The event instance 0N/A * is lazily created using the <code>path</code> parameter. 0N/A * @param path the <code>TreePath</code> indicating the node that was 0N/A * @see EventListenerList 0N/A // Guaranteed to return a non-null array 0N/A // Process the listeners last to first, notifying 0N/A // those that are interested in this event 0N/A // Lazily create the event: 0N/A * Adds a listener for <code>TreeSelection</code> events. 0N/A * @param tsl the <code>TreeSelectionListener</code> that will be notified 0N/A * when a node is selected or deselected (a "negative 0N/A * Removes a <code>TreeSelection</code> listener. 0N/A * @param tsl the <code>TreeSelectionListener</code> to remove 0N/A * Returns an array of all the <code>TreeSelectionListener</code>s added 0N/A * to this JTree with addTreeSelectionListener(). 0N/A * @return all of the <code>TreeSelectionListener</code>s added or an empty 0N/A * array if no listeners have been added 0N/A * Notifies all listeners that have registered interest for 0N/A * notification on this event type. 0N/A * @param e the <code>TreeSelectionEvent</code> to be fired; 0N/A * <code>TreeSelectionModel</code> 0N/A * when a node is selected or deselected 0N/A * @see EventListenerList 0N/A // Guaranteed to return a non-null array 0N/A // Process the listeners last to first, notifying 0N/A // those that are interested in this event 0N/A // TreeSelectionEvent e = null; 0N/A // Lazily create the event: 0N/A // e = new ListSelectionEvent(this, firstIndex, lastIndex); 0N/A * Sent when the tree has changed enough that we need to resize 0N/A * the bounds, but not enough that we need to remove the 0N/A * expanded node set (e.g nodes were expanded or collapsed, or 0N/A * nodes were inserted into the tree). You should never have to 0N/A * invoke this, the UI will invoke this as it needs to. 0N/A * Sets the number of rows that are to be displayed. 0N/A * This will only work if the tree is contained in a 0N/A * <code>JScrollPane</code>, 0N/A * and will adjust the preferred size and size of that scrollpane. 0N/A * This is a bound property. 0N/A * @param newCount the number of rows to display 0N/A * description: The number of rows that are to be displayed. 0N/A * Returns the number of rows that are displayed in the display area. 0N/A * @return the number of rows displayed 0N/A * Expands the root path, assuming the current TreeModel has been set. 0N/A * Returns the TreePath to the next tree element that 0N/A * begins with a prefix. To handle the conversion of a 0N/A * <code>TreePath</code> into a String, <code>convertValueToText</code> 0N/A * @param prefix the string to test for a match 0N/A * @param startingRow the row for starting the search 0N/A * @param bias the search direction, either 0N/A * Position.Bias.Forward or Position.Bias.Backward. 0N/A * @return the TreePath of the next tree element that 0N/A * starts with the prefix; otherwise null 0N/A * @exception IllegalArgumentException if prefix is null 0N/A * or startingRow is out of bounds 0N/A // Serialization support. 0N/A // Save the cellRenderer, if its Serializable. 0N/A // Save the cellEditor, if its Serializable. 0N/A // Save the treeModel, if its Serializable. 0N/A // Save the selectionModel, if its Serializable. 0N/A // Create an instance of expanded state. 0N/A // Reinstall the redirector. 0N/A // Listener to TreeModel. 0N/A * Returns an object that can be archived indicating what nodes are 0N/A * expanded and what aren't. The objects from the model are NOT 0N/A * Updates the expanded state of nodes in the tree based on the 0N/A * previously archived state <code>state</code>. 0N/A * Returns an array of integers specifying the indexs of the 0N/A * components in the <code>path</code>. If <code>path</code> is 0N/A * the root, this will return an empty array. If <code>path</code> 0N/A * is <code>null</code>, <code>null</code> will be returned. 0N/A * Returns a <code>TreePath</code> created by obtaining the children 0N/A * for each of the indices in <code>indexs</code>. If <code>indexs</code> 0N/A * or the <code>TreeModel</code> is <code>null</code>, it will return 0N/A * <code>null</code>. 0N/A * <code>EmptySelectionModel</code> is a <code>TreeSelectionModel</code> 0N/A * that does not allow anything to be selected. 0N/A * <strong>Warning:</strong> 0N/A * Serialized objects of this class will not be compatible with 0N/A * future Swing releases. The current serialization support is 0N/A * appropriate for short term storage or RMI between applications running 0N/A * the same version of Swing. As of 1.4, support for long term storage 0N/A * of all JavaBeans<sup><font size="-2">TM</font></sup> 0N/A * has been added to the <code>java.beans</code> package. 0N/A * The single instance of {@code EmptySelectionModel}. 0N/A * Returns the single instance of {@code EmptySelectionModel}. 0N/A * @return single instance of {@code EmptySelectionModel} 0N/A * This is overriden to do nothing; {@code EmptySelectionModel} 0N/A * does not allow a selection. 0N/A * @param paths the paths to select; this is ignored 0N/A * This is overriden to do nothing; {@code EmptySelectionModel} 0N/A * does not allow a selection. 0N/A * @param paths the paths to add to the selection; this is ignored 0N/A * This is overriden to do nothing; {@code EmptySelectionModel} 0N/A * does not allow a selection. 0N/A * @param paths the paths to remove; this is ignored 0N/A * This is overriden to do nothing; {@code EmptySelectionModel} 0N/A * does not allow a selection. 0N/A * @param mode the selection mode; this is ignored 0N/A * This is overriden to do nothing; {@code EmptySelectionModel} 0N/A * does not allow a selection. 0N/A * @param mapper the {@code RowMapper} instance; this is ignored 0N/A * This is overriden to do nothing; {@code EmptySelectionModel} 0N/A * does not allow a selection. 0N/A * @param listener the listener to add; this is ignored 0N/A * This is overriden to do nothing; {@code EmptySelectionModel} 0N/A * does not allow a selection. 0N/A * @param listener the listener to remove; this is ignored 0N/A * This is overriden to do nothing; {@code EmptySelectionModel} 0N/A * does not allow a selection. 0N/A * @param listener the listener to add; this is ignored 0N/A * This is overriden to do nothing; {@code EmptySelectionModel} 0N/A * does not allow a selection. 0N/A * @param listener the listener to remove; this is ignored 0N/A * Handles creating a new <code>TreeSelectionEvent</code> with the 0N/A * <code>JTree</code> as the 0N/A * source and passing it off to all the listeners. 0N/A * <strong>Warning:</strong> 0N/A * Serialized objects of this class will not be compatible with 0N/A * future Swing releases. The current serialization support is 0N/A * appropriate for short term storage or RMI between applications running 0N/A * the same version of Swing. As of 1.4, support for long term storage 0N/A * of all JavaBeans<sup><font size="-2">TM</font></sup> 0N/A * has been added to the <code>java.beans</code> package. 0N/A * Invoked by the <code>TreeSelectionModel</code> when the 0N/A * selection changes. 0N/A * @param e the <code>TreeSelectionEvent</code> generated by the 0N/A * <code>TreeSelectionModel</code> 0N/A }
// End of class JTree.TreeSelectionRedirector 0N/A // Scrollable interface 0N/A * Returns the preferred display size of a <code>JTree</code>. The height is 0N/A * determined from <code>getVisibleRowCount</code> and the width 0N/A * is the current preferred width. 0N/A * @return a <code>Dimension</code> object containing the preferred size 0N/A * Returns the amount to increment when scrolling. The amount is 0N/A * the height of the first displayed row that isn't completely in view 0N/A * or, if it is totally displayed, the height of the next row in the 0N/A * scrolling direction. 0N/A * @param visibleRect the view area visible within the viewport 0N/A * @param orientation either <code>SwingConstants.VERTICAL</code> 0N/A * or <code>SwingConstants.HORIZONTAL</code> 0N/A * @param direction less than zero to scroll up/left, 0N/A * @return the "unit" increment for scrolling in the specified direction 0N/A * @see JScrollBar#setUnitIncrement(int) 0N/A * Returns the amount for a block increment, which is the height or 0N/A * width of <code>visibleRect</code>, based on <code>orientation</code>. 0N/A * @param visibleRect the view area visible within the viewport 0N/A * @param orientation either <code>SwingConstants.VERTICAL</code> 0N/A * or <code>SwingConstants.HORIZONTAL</code> 0N/A * @param direction less than zero to scroll up/left, 0N/A * @return the "block" increment for scrolling in the specified direction 0N/A * @see JScrollBar#setBlockIncrement(int) 0N/A * Returns false to indicate that the width of the viewport does not 0N/A * determine the width of the table, unless the preferred width of 0N/A * the tree is smaller than the viewports width. In other words: 0N/A * ensure that the tree is never smaller than its viewport. 0N/A * @return whether the tree should track the width of the viewport 0N/A * @see Scrollable#getScrollableTracksViewportWidth 0N/A * Returns false to indicate that the height of the viewport does not 0N/A * determine the height of the table, unless the preferred height 0N/A * of the tree is smaller than the viewports height. In other words: 0N/A * ensure that the tree is never smaller than its viewport. 0N/A * @return whether the tree should track the height of the viewport 0N/A * @see Scrollable#getScrollableTracksViewportHeight 0N/A * Sets the expanded state of this <code>JTree</code>. 0N/A * If <code>state</code> is 0N/A * true, all parents of <code>path</code> and path are marked as 0N/A * expanded. If <code>state</code> is false, all parents of 0N/A * <code>path</code> are marked EXPANDED, but <code>path</code> itself 0N/A * is marked collapsed.<p> 0N/A * This will fail if a <code>TreeWillExpandListener</code> vetos it. 0N/A // Make sure all parents of path are expanded. 0N/A // collapse last path. 0N/A // A descendant was selected, select the parent. 0N/A // Expand last path. 0N/A * Returns an <code>Enumeration</code> of <code>TreePaths</code> 0N/A * that have been expanded that 0N/A * are descendants of <code>parent</code>. 0N/A * Removes any descendants of the <code>TreePaths</code> in 0N/A * <code>toRemove</code> 0N/A * that have been expanded. 0N/A * @param toRemove an enumeration of the paths to remove; a value of 0N/A * {@code null} is ignored 0N/A * @throws ClassCastException if {@code toRemove} contains an 0N/A * element that is not a {@code TreePath}; {@code null} 0N/A * values are ignored 0N/A * Clears the cache of toggled tree paths. This does NOT send out 0N/A * any <code>TreeExpansionListener</code> events. 0N/A * Creates and returns an instance of <code>TreeModelHandler</code>. 0N/A * object is responsible for updating the expanded state when the 0N/A * <code>TreeModel</code> changes. 0N/A * For more information on what expanded state means, see the 0N/A * <a href=#jtree_description>JTree description</a> above. 0N/A * Removes any paths in the selection that are descendants of 0N/A * <code>path</code>. If <code>includePath</code> is true and 0N/A * <code>path</code> is selected, it will be removed from the selection. 0N/A * @return true if a descendant was selected 0N/A * Returns an array of paths in the selection that are descendants of 0N/A * <code>path</code>. The returned array may contain <code>null</code>s. 0N/A * Removes any paths from the selection model that are descendants of 0N/A * the nodes identified by in <code>e</code>. 0N/A // Might be better to call getDescendantSelectedPaths 0N/A // numerous times, then push to the model. 0N/A * Listens to the model and updates the <code>expandedState</code> 0N/A * accordingly when nodes are removed, or changed. 0N/A // NOTE: If I change this to NOT remove the descendants 0N/A // and update BasicTreeUIs treeStructureChanged method 0N/A // to update descendants in response to a treeStructureChanged 0N/A // event, all the children of the event won't collapse! 0N/A // New root, remove everything! 0N/A // Mark the root as expanded, if it isn't a leaf. 0N/A * <code>DynamicUtilTreeNode</code> can wrap 0N/A * create the appropriate children tree nodes as necessary. It is 0N/A * dynamic in that it will only create the children as necessary. 0N/A * <strong>Warning:</strong> 0N/A * Serialized objects of this class will not be compatible with 0N/A * future Swing releases. The current serialization support is 0N/A * appropriate for short term storage or RMI between applications running 0N/A * the same version of Swing. As of 1.4, support for long term storage 0N/A * of all JavaBeans<sup><font size="-2">TM</font></sup> 0N/A * has been added to the <code>java.beans</code> package. 0N/A * Does the this <code>JTree</code> have children? 0N/A * This property is currently not implemented. 0N/A /** Value to create children with. */ 0N/A /** Have the children been loaded yet? */ 0N/A * Adds to parent all the children in <code>children</code>. 0N/A * If <code>children</code> is an array or vector all of its 0N/A * elements are added is children, otherwise if <code>children</code> 0N/A * is a hashtable all the key/value pairs are added in the order 0N/A * <code>Enumeration</code> returns them. 0N/A * Creates a node with the specified object as its value and 0N/A * with the specified children. For the node to allow children, 0N/A * the children-object must be an array of objects, a 0N/A * <code>Vector</code>, or a <code>Hashtable</code> -- even 0N/A * if empty. Otherwise, the node is not 0N/A * allowed to have children. 0N/A * @param value the <code>Object</code> that is the value for the 0N/A * @param children an array of <code>Object</code>s, a 0N/A * <code>Vector</code>, or a <code>Hashtable</code> 0N/A * used to create the child nodes; if any other 0N/A * object is specified, or if the value is 0N/A * <code>null</code>, 0N/A * then the node is not allowed to have children 0N/A * Returns true if this node allows children. Whether the node 0N/A * allows children depends on how it was created. 0N/A * @return true if this node allows children, false otherwise 0N/A * @see #JTree.DynamicUtilTreeNode 0N/A * Returns the number of child nodes. 0N/A * @return the number of child nodes 0N/A * Loads the children based on <code>childValue</code>. 0N/A * If <code>childValue</code> is a <code>Vector</code> 0N/A * or array each element is added as a child, 0N/A * if <code>childValue</code> is a <code>Hashtable</code> 0N/A * <code>Enumeration</code> returns the keys. 0N/A * Subclassed to load the children, if necessary. 0N/A * Subclassed to load the children, if necessary. 0N/A * Returns a string representation of this <code>JTree</code>. 0N/A * is intended to be used only for debugging purposes, and the 0N/A * content and format of the returned string may vary between 0N/A * implementations. The returned string may be empty but may not 0N/A * be <code>null</code>. 0N/A * @return a string representation of this <code>JTree</code>. 0N/A// Accessibility support 0N/A * Gets the AccessibleContext associated with this JTree. 0N/A * For JTrees, the AccessibleContext takes the form of an 0N/A * A new AccessibleJTree instance is created if necessary. 0N/A * @return an AccessibleJTree that serves as the 0N/A * AccessibleContext of this JTree 0N/A * This class implements accessibility support for the 0N/A * <code>JTree</code> class. It provides an implementation of the 0N/A * Java Accessibility API appropriate to tree user-interface elements. 0N/A * <strong>Warning:</strong> 0N/A * Serialized objects of this class will not be compatible with 0N/A * future Swing releases. The current serialization support is 0N/A * appropriate for short term storage or RMI between applications running 0N/A * the same version of Swing. As of 1.4, support for long term storage 0N/A * of all JavaBeans<sup><font size="-2">TM</font></sup> 0N/A * has been added to the <code>java.beans</code> package. 0N/A // Add a tree model listener for JTree 0N/A * Tree Selection Listener value change method. Used to fire the 0N/A * @param e ListSelectionEvent 0N/A // Fixes 4546503 - JTree is sending incorrect active 0N/A // descendant events 0N/A // Set parent to null so AccessibleJTreeNode computes 0N/A * Fire a visible data property change notification. 0N/A * A 'visible' data property is one that represents 0N/A * something about the way the component appears on the 0N/A * display, where that appearance isn't bound to any other 0N/A * property. It notifies screen readers that the visual 0N/A * appearance of the component has changed, so they can 0N/A // Fire the visible data changes for the model changes. 0N/A * Tree Model Node change notification. 0N/A * @param e a Tree Model event 0N/A * Tree Model Node change notification. 0N/A * @param e a Tree node insertion event 0N/A * Tree Model Node change notification. 0N/A * @param e a Tree node(s) removal event 0N/A * Tree Model structure change change notification. 0N/A * @param e a Tree Model event 0N/A * Tree Collapsed notification. 0N/A * @param e a TreeExpansionEvent 0N/A // Set parent to null so AccessibleJTreeNode computes 0N/A * Tree Model Expansion notification. 0N/A * @param e a Tree node insertion event 0N/A // Set parent to null so AccessibleJTreeNode computes 0N/A // is the object visible? 0N/A // if so, get row, selected, focus & leaf state, 0N/A // and then get the renderer component and return it 0N/A // Overridden methods from AccessibleJComponent 0N/A * Get the role of this object. 0N/A * @return an instance of AccessibleRole describing the role of the 0N/A * @see AccessibleRole 0N/A * Returns the <code>Accessible</code> child, if one exists, 0N/A * contained at the local coordinate <code>Point</code>. 0N/A * Otherwise returns <code>null</code>. 0N/A * @param p point in local coordinates of this <code>Accessible</code> 0N/A * @return the <code>Accessible</code>, if it exists, 0N/A * at the specified location; else <code>null</code> 0N/A // JTree.this is NOT the parent; parent will get computed later 0N/A * Returns the number of top-level children nodes of this 0N/A * JTree. Each of these nodes may in turn have children nodes. 0N/A * @return the number of accessible children nodes in the tree. 0N/A return 1;
// the root node 0N/A // return the root's first set of children count 0N/A * Return the nth Accessible child of the object. 0N/A * @param i zero-based index of child 0N/A * @return the nth Accessible child of the object 0N/A if (i ==
0) {
// return the root node Accessible 0N/A // return Accessible for one of root's child nodes 0N/A * Get the index of this object in its accessible parent. 0N/A * @return the index of this object in its parent. Since a JTree 0N/A * top-level object does not have an accessible parent. 0N/A * @see #getAccessibleParent 0N/A // didn't ever need to override this... 0N/A // AccessibleSelection methods 0N/A * Get the AccessibleSelection associated with this object. In the 0N/A * implementation of the Java Accessibility API for this class, 0N/A * return this object, which is responsible for implementing the 0N/A * AccessibleSelection interface on behalf of itself. 0N/A * @return this object 0N/A * Returns the number of items currently selected. 0N/A * If no items are selected, the return value will be 0. 0N/A * @return the number of items currently selected. 0N/A * Returns an Accessible representing the specified selected item 0N/A * in the object. If there isn't a selection, or there are 0N/A * fewer items selected than the integer passed in, the return 0N/A * value will be null. 0N/A * @param i the zero-based index of selected items 0N/A * @return an Accessible containing the selected item 0N/A // The JTree can have only one accessible child, the root. 0N/A * Returns true if the current child of this object is selected. 0N/A * @param i the zero-based index of the child in this Accessible object. 0N/A * @see AccessibleContext#getAccessibleChild 0N/A // The JTree can have only one accessible child, the root. 0N/A * Adds the specified selected item in the object to the object's 0N/A * selection. If the object supports multiple selections, 0N/A * the specified item is added to any existing selection, otherwise 0N/A * it replaces any existing selection in the object. If the 0N/A * specified item is already selected, this method has no effect. 0N/A * @param i the zero-based index of selectable items 0N/A * Removes the specified selected item in the object from the object's 0N/A * selection. If the specified item isn't currently selected, this 0N/A * method has no effect. 0N/A * @param i the zero-based index of selectable items 0N/A * Clears the selection in the object, so that nothing in the 0N/A * object is selected. 0N/A * Causes every selected item in the object to be selected 0N/A * if the object supports multiple selections. 0N/A * This class implements accessibility support for the 0N/A * <code>JTree</code> child. It provides an implementation of the 0N/A * Java Accessibility API appropriate to tree nodes. 0N/A * Constructs an AccessibleJTreeNode 0N/A // Tree nodes can't be so complex that they have 0N/A // two sets of children -> we're ignoring that case 0N/A * Get the AccessibleContext associated with this tree node. 0N/A * In the implementation of the Java Accessibility API for 0N/A * this class, return this object, which is its own 0N/A * AccessibleContext. 0N/A * @return this object 0N/A // is the object visible? 0N/A // if so, get row, selected, focus & leaf state, 0N/A // and then get the renderer component and return it 0N/A // AccessibleContext methods 0N/A * Get the accessible name of this object. 0N/A * @return the localized name of the object; null if this 0N/A * object does not have a name 0N/A // fall back to the client property 0N/A * Set the localized accessible name of this object. 0N/A * @param s the new localized name of the object. 0N/A // *** should check tooltip text for desc. (needs MouseEvent) 0N/A * Get the accessible description of this object. 0N/A * @return the localized description of the object; null if 0N/A * this object does not have a description 0N/A * Set the accessible description of this object. 0N/A * @param s the new localized description of the object 0N/A * Get the role of this object. 0N/A * @return an instance of AccessibleRole describing the role of the object 0N/A * @see AccessibleRole 0N/A * Get the state set of this object. 0N/A * @return an instance of AccessibleStateSet containing the 0N/A * current state set of the object 0N/A * @see AccessibleState 0N/A // need to test here, 'cause the underlying component 0N/A // is a cellRenderer, which is never showing... 0N/A * Get the Accessible parent of this object. 0N/A * @return the Accessible parent of this object; null if this 0N/A * object does not have an Accessible parent 0N/A // someone wants to know, so we need to create our parent 0N/A // if we don't have one (hey, we're a talented kid!) 0N/A * Get the index of this object in its accessible parent. 0N/A * @return the index of this object in its parent; -1 if this 0N/A * object does not have an accessible parent. 0N/A * @see #getAccessibleParent 0N/A // index is invalid 'till we have an accessibleParent... 0N/A * Returns the number of accessible children in the object. 0N/A * @return the number of accessible children in the object. 0N/A // Tree nodes can't be so complex that they have 0N/A // two sets of children -> we're ignoring that case 0N/A * Return the specified Accessible child of the object. 0N/A * @param i zero-based index of child 0N/A * @return the Accessible child of the object 0N/A // Tree nodes can't be so complex that they have 0N/A // two sets of children -> we're ignoring that case 0N/A * Gets the locale of the component. If the component does not have 0N/A * a locale, then the locale of its parent is returned. 0N/A * @return This component's locale. If this component does not have 0N/A * a locale, the locale of its parent is returned. 0N/A * @exception IllegalComponentStateException 0N/A * If the Component does not have its own locale and has not yet 0N/A * been added to a containment hierarchy such that the locale can be 0N/A * determined from the containing parent. 0N/A * Add a PropertyChangeListener to the listener list. 0N/A * The listener is registered for all properties. 0N/A * @param l The PropertyChangeListener to be added 0N/A * Remove a PropertyChangeListener from the listener list. 0N/A * This removes a PropertyChangeListener that was registered 0N/A * for all properties. 0N/A * @param l The PropertyChangeListener to be removed 0N/A * Get the AccessibleAction associated with this object. In the 0N/A * implementation of the Java Accessibility API for this class, 0N/A * return this object, which is responsible for implementing the 0N/A * AccessibleAction interface on behalf of itself. 0N/A * @return this object 0N/A * Get the AccessibleComponent associated with this object. In the 0N/A * implementation of the Java Accessibility API for this class, 0N/A * return this object, which is responsible for implementing the 0N/A * AccessibleComponent interface on behalf of itself. 0N/A * @return this object 0N/A return this;
// to override getBounds() 0N/A * Get the AccessibleSelection associated with this object if one 0N/A * exists. Otherwise return null. 0N/A * @return the AccessibleSelection, or null 0N/A * Get the AccessibleText associated with this object if one 0N/A * exists. Otherwise return null. 0N/A * @return the AccessibleText, or null 0N/A * Get the AccessibleValue associated with this object if one 0N/A * exists. Otherwise return null. 0N/A * @return the AccessibleValue, or null 0N/A // AccessibleComponent methods 0N/A * Get the background color of this object. 0N/A * @return the background color, if supported, of the object; 0N/A * Set the background color of this object. 0N/A * @param c the new Color for the background 0N/A * Get the foreground color of this object. 0N/A * @return the foreground color, if supported, of the object; 0N/A * Returns the <code>Accessible</code> child, if one exists, 0N/A * contained at the local coordinate <code>Point</code>. 0N/A * Otherwise returns <code>null</code>. 0N/A * @param p point in local coordinates of this 0N/A * <code>Accessible</code> 0N/A * @return the <code>Accessible</code>, if it exists, 0N/A * at the specified location; else <code>null</code> 0N/A // AccessibleSelection methods 0N/A * Returns the number of items currently selected. 0N/A * If no items are selected, the return value will be 0. 0N/A * @return the number of items currently selected. 0N/A * Returns an Accessible representing the specified selected item 0N/A * in the object. If there isn't a selection, or there are 0N/A * fewer items selected than the integer passed in, the return 0N/A * value will be null. 0N/A * @param i the zero-based index of selected items 0N/A * @return an Accessible containing the selected item 0N/A * Returns true if the current child of this object is selected. 0N/A * @param i the zero-based index of the child in this Accessible 0N/A * @see AccessibleContext#getAccessibleChild 0N/A return false;
// out of range 0N/A * Adds the specified selected item in the object to the object's 0N/A * selection. If the object supports multiple selections, 0N/A * the specified item is added to any existing selection, otherwise 0N/A * it replaces any existing selection in the object. If the 0N/A * specified item is already selected, this method has no effect. 0N/A * @param i the zero-based index of selectable items 0N/A * Removes the specified selected item in the object from the 0N/A * selection. If the specified item isn't currently selected, this 0N/A * method has no effect. 0N/A * @param i the zero-based index of selectable items 0N/A * Clears the selection in the object, so that nothing in the 0N/A * object is selected. 0N/A * Causes every selected item in the object to be selected 0N/A * if the object supports multiple selections. 0N/A // AccessibleAction methods 0N/A * Returns the number of accessible actions available in this 0N/A * tree node. If this node is not a leaf, there is at least 0N/A * one action (toggle expand), in addition to any available 0N/A * on the object behind the TreeCellRenderer. 0N/A * @return the number of Actions in this object 0N/A * Return a description of the specified action of the tree node. 0N/A * If this node is not a leaf, there is at least one action 0N/A * description (toggle expand), in addition to any available 0N/A * on the object behind the TreeCellRenderer. 0N/A * @param i zero-based index of the actions 0N/A * @return a description of the action 0N/A * Perform the specified Action on the tree node. If this node 0N/A * is not a leaf, there is at least one action which can be 0N/A * done (toggle expand), in addition to any available on the 0N/A * object behind the TreeCellRenderer. 0N/A * @param i zero-based index of actions 0N/A * @return true if the the action was performed; else false. 0N/A }
// inner class AccessibleJTreeNode 0N/A }
// inner class AccessibleJTree 0N/A}
// End of class JTree