📄 defaultmutabletreenode.html
字号:
<BR> Returns true if <code>aNode</code> is a child of this node.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/swing/tree/DefaultMutableTreeNode.html#isNodeDescendant(javax.swing.tree.DefaultMutableTreeNode)">isNodeDescendant</A></B>(<A HREF="../../../javax/swing/tree/DefaultMutableTreeNode.html">DefaultMutableTreeNode</A> anotherNode)</CODE><BR> Returns true if <code>anotherNode</code> is a descendant of this node -- if it is this node, one of this node's children, or a descendant of one of this node's children.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/swing/tree/DefaultMutableTreeNode.html#isNodeRelated(javax.swing.tree.DefaultMutableTreeNode)">isNodeRelated</A></B>(<A HREF="../../../javax/swing/tree/DefaultMutableTreeNode.html">DefaultMutableTreeNode</A> aNode)</CODE><BR> Returns true if and only if <code>aNode</code> is in the same tree as this node.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/swing/tree/DefaultMutableTreeNode.html#isNodeSibling(javax.swing.tree.TreeNode)">isNodeSibling</A></B>(<A HREF="../../../javax/swing/tree/TreeNode.html">TreeNode</A> anotherNode)</CODE><BR> Returns true if <code>anotherNode</code> is a sibling of (has the same parent as) this node.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/swing/tree/DefaultMutableTreeNode.html#isRoot()">isRoot</A></B>()</CODE><BR> Returns true if this node is the root of the tree.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../../java/util/Enumeration.html">Enumeration</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/swing/tree/DefaultMutableTreeNode.html#pathFromAncestorEnumeration(javax.swing.tree.TreeNode)">pathFromAncestorEnumeration</A></B>(<A HREF="../../../javax/swing/tree/TreeNode.html">TreeNode</A> ancestor)</CODE><BR> Creates and returns an enumeration that follows the path from <code>ancestor</code> to this node.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../../java/util/Enumeration.html">Enumeration</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/swing/tree/DefaultMutableTreeNode.html#postorderEnumeration()">postorderEnumeration</A></B>()</CODE><BR> Creates and returns an enumeration that traverses the subtree rooted at this node in postorder.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../../java/util/Enumeration.html">Enumeration</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/swing/tree/DefaultMutableTreeNode.html#preorderEnumeration()">preorderEnumeration</A></B>()</CODE><BR> Creates and returns an enumeration that traverses the subtree rooted at this node in preorder.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/swing/tree/DefaultMutableTreeNode.html#remove(int)">remove</A></B>(int childIndex)</CODE><BR> Removes the child at the specified index from this node's children and sets that node's parent to null.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/swing/tree/DefaultMutableTreeNode.html#remove(javax.swing.tree.MutableTreeNode)">remove</A></B>(<A HREF="../../../javax/swing/tree/MutableTreeNode.html">MutableTreeNode</A> aChild)</CODE><BR> Removes <code>aChild</code> from this node's child array, giving it a null parent.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/swing/tree/DefaultMutableTreeNode.html#removeAllChildren()">removeAllChildren</A></B>()</CODE><BR> Removes all of this node's children, setting their parents to null.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/swing/tree/DefaultMutableTreeNode.html#removeFromParent()">removeFromParent</A></B>()</CODE><BR> Removes the subtree rooted at this node from the tree, giving this node a null parent.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/swing/tree/DefaultMutableTreeNode.html#setAllowsChildren(boolean)">setAllowsChildren</A></B>(boolean allows)</CODE><BR> Determines whether or not this node is allowed to have children.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/swing/tree/DefaultMutableTreeNode.html#setParent(javax.swing.tree.MutableTreeNode)">setParent</A></B>(<A HREF="../../../javax/swing/tree/MutableTreeNode.html">MutableTreeNode</A> newParent)</CODE><BR> Sets this node's parent to <code>newParent</code> but does not change the parent's child array.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/swing/tree/DefaultMutableTreeNode.html#setUserObject(java.lang.Object)">setUserObject</A></B>(<A HREF="../../../java/lang/Object.html">Object</A> userObject)</CODE><BR> Sets the user object for this node to <code>userObject</code>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../../java/lang/String.html">String</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/swing/tree/DefaultMutableTreeNode.html#toString()">toString</A></B>()</CODE><BR> Returns the result of sending <code>toString()</code> to this node's user object, or null if this node has no user object.</TD></TR></TABLE> <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Methods inherited from class java.lang.<A HREF="../../../java/lang/Object.html">Object</A></B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="../../../java/lang/Object.html#equals(java.lang.Object)">equals</A>, <A HREF="../../../java/lang/Object.html#finalize()">finalize</A>, <A HREF="../../../java/lang/Object.html#getClass()">getClass</A>, <A HREF="../../../java/lang/Object.html#hashCode()">hashCode</A>, <A HREF="../../../java/lang/Object.html#notify()">notify</A>, <A HREF="../../../java/lang/Object.html#notifyAll()">notifyAll</A>, <A HREF="../../../java/lang/Object.html#wait()">wait</A>, <A HREF="../../../java/lang/Object.html#wait(long)">wait</A>, <A HREF="../../../java/lang/Object.html#wait(long, int)">wait</A></CODE></TD></TR></TABLE> <P><!-- ============ FIELD DETAIL =========== --><A NAME="field_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Field Detail</B></FONT></TD></TR></TABLE><A NAME="EMPTY_ENUMERATION"><!-- --></A><H3>EMPTY_ENUMERATION</H3><PRE>public static final <A HREF="../../../java/util/Enumeration.html">Enumeration</A> <B>EMPTY_ENUMERATION</B></PRE><DL><DD>An enumeration that is always empty. This is used when an enumeration of a leaf node's children is requested.</DL><HR><A NAME="parent"><!-- --></A><H3>parent</H3><PRE>protected <A HREF="../../../javax/swing/tree/MutableTreeNode.html">MutableTreeNode</A> <B>parent</B></PRE><DL><DD>this node's parent, or null if this node has no parent</DL><HR><A NAME="children"><!-- --></A><H3>children</H3><PRE>protected <A HREF="../../../java/util/Vector.html">Vector</A> <B>children</B></PRE><DL><DD>array of children, may be null if this node has no children</DL><HR><A NAME="userObject"><!-- --></A><H3>userObject</H3><PRE>protected transient <A HREF="../../../java/lang/Object.html">Object</A> <B>userObject</B></PRE><DL><DD>optional user object</DL><HR><A NAME="allowsChildren"><!-- --></A><H3>allowsChildren</H3><PRE>protected boolean <B>allowsChildren</B></PRE><DL><DD>true if the node is able to have children</DL><!-- ========= CONSTRUCTOR DETAIL ======== --><A NAME="constructor_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Constructor Detail</B></FONT></TD></TR></TABLE><A NAME="DefaultMutableTreeNode()"><!-- --></A><H3>DefaultMutableTreeNode</H3><PRE>public <B>DefaultMutableTreeNode</B>()</PRE><DL><DD>Creates a tree node that has no parent and no children, but which allows children.</DL><HR><A NAME="DefaultMutableTreeNode(java.lang.Object)"><!-- --></A><H3>DefaultMutableTreeNode</H3><PRE>public <B>DefaultMutableTreeNode</B>(<A HREF="../../../java/lang/Object.html">Object</A> userObject)</PRE><DL><DD>Creates a tree node with no parent, no children, but which allows children, and initializes it with the specified user object.<DD><DL><DT><B>Parameters:</B><DD><CODE>userObject</CODE> - an Object provided by the user that constitutes the node's data</DL></DD></DL><HR><A NAME="DefaultMutableTreeNode(java.lang.Object, boolean)"><!-- --></A><H3>DefaultMutableTreeNode</H3><PRE>public <B>DefaultMutableTreeNode</B>(<A HREF="../../../java/lang/Object.html">Object</A> userObject, boolean allowsChildren)</PRE><DL><DD>Creates a tree node with no parent, no children, initialized with the specified user object, and that allows children only if specified.<DD><DL><DT><B>Parameters:</B><DD><CODE>userObject</CODE> - an Object provided by the user that constitutes the node's data<DD><CODE>allowsChildren</CODE> - if true, the node is allowed to have child nodes -- otherwise, it is always a leaf node</DL></DD></DL><!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Method Detail</B></FONT></TD></TR></TABLE><A NAME="insert(javax.swing.tree.MutableTreeNode, int)"><!-- --></A><H3>insert</H3><PRE>public void <B>insert</B>(<A HREF="../../../javax/swing/tree/MutableTreeNode.html">MutableTreeNode</A> newChild, int childIndex)</PRE><DL><DD>Removes <code>newChild</code> from its present parent (if it has a parent), sets the child's parent to this node, and then adds the child
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -