src/share/classes/javax/swing/JTree.java

Print this page




  27 
  28 import java.awt.*;
  29 import java.awt.event.*;
  30 import java.beans.*;
  31 import java.io.*;
  32 import java.util.*;
  33 import javax.swing.event.*;
  34 import javax.swing.plaf.*;
  35 import javax.swing.tree.*;
  36 import javax.swing.text.Position;
  37 import javax.accessibility.*;
  38 import sun.swing.SwingUtilities2;
  39 import sun.swing.SwingUtilities2.Section;
  40 import static sun.swing.SwingUtilities2.Section.*;
  41 
  42 
  43 /**
  44  * <a name="jtree_description"></a>
  45  * A control that displays a set of hierarchical data as an outline.
  46  * You can find task-oriented documentation and examples of using trees in
  47  * <a href="http://java.sun.com/docs/books/tutorial/uiswing/components/tree.html">How to Use Trees</a>,
  48  * a section in <em>The Java Tutorial.</em>
  49  * <p>
  50  * A specific node in a tree can be identified either by a
  51  * <code>TreePath</code> (an object
  52  * that encapsulates a node and all of its ancestors), or by its
  53  * display row, where each row in the display area displays one node.
  54  * An <i>expanded</i> node is a non-leaf node (as identified by
  55  * <code>TreeModel.isLeaf(node)</code> returning false) that will displays
  56  * its children when all its ancestors are <i>expanded</i>.
  57  * A <i>collapsed</i>
  58  * node is one which hides them. A <i>hidden</i> node is one which is
  59  * under a collapsed ancestor. All of a <i>viewable</i> nodes parents
  60  * are expanded, but may or may not be displayed. A <i>displayed</i> node
  61  * is both viewable and in the display area, where it can be seen.
  62  * </p>
  63  * The following <code>JTree</code> methods use "visible" to mean "displayed":
  64  * <ul>
  65  * <li><code>isRootVisible()</code>
  66  * <li><code>setRootVisible()</code>
  67  * <li><code>scrollPathToVisible()</code>




  27 
  28 import java.awt.*;
  29 import java.awt.event.*;
  30 import java.beans.*;
  31 import java.io.*;
  32 import java.util.*;
  33 import javax.swing.event.*;
  34 import javax.swing.plaf.*;
  35 import javax.swing.tree.*;
  36 import javax.swing.text.Position;
  37 import javax.accessibility.*;
  38 import sun.swing.SwingUtilities2;
  39 import sun.swing.SwingUtilities2.Section;
  40 import static sun.swing.SwingUtilities2.Section.*;
  41 
  42 
  43 /**
  44  * <a name="jtree_description"></a>
  45  * A control that displays a set of hierarchical data as an outline.
  46  * You can find task-oriented documentation and examples of using trees in
  47  * <a href="http://docs.oracle.com/javase/tutorial/uiswing/components/tree.html">How to Use Trees</a>,
  48  * a section in <em>The Java Tutorial.</em>
  49  * <p>
  50  * A specific node in a tree can be identified either by a
  51  * <code>TreePath</code> (an object
  52  * that encapsulates a node and all of its ancestors), or by its
  53  * display row, where each row in the display area displays one node.
  54  * An <i>expanded</i> node is a non-leaf node (as identified by
  55  * <code>TreeModel.isLeaf(node)</code> returning false) that will displays
  56  * its children when all its ancestors are <i>expanded</i>.
  57  * A <i>collapsed</i>
  58  * node is one which hides them. A <i>hidden</i> node is one which is
  59  * under a collapsed ancestor. All of a <i>viewable</i> nodes parents
  60  * are expanded, but may or may not be displayed. A <i>displayed</i> node
  61  * is both viewable and in the display area, where it can be seen.
  62  * </p>
  63  * The following <code>JTree</code> methods use "visible" to mean "displayed":
  64  * <ul>
  65  * <li><code>isRootVisible()</code>
  66  * <li><code>setRootVisible()</code>
  67  * <li><code>scrollPathToVisible()</code>