📄 defaulttreemodel.html
字号:
<TD><CODE><B><A HREF="../../../javax/swing/tree/DefaultTreeModel.html#getIndexOfChild(java.lang.Object, java.lang.Object)">getIndexOfChild</A></B>(<A HREF="../../../java/lang/Object.html">Object</A> parent, <A HREF="../../../java/lang/Object.html">Object</A> child)</CODE><BR> Returns the index of child in parent.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../../java/util/EventListener.html">EventListener</A>[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/swing/tree/DefaultTreeModel.html#getListeners(java.lang.Class)">getListeners</A></B>(<A HREF="../../../java/lang/Class.html">Class</A> listenerType)</CODE><BR> Return an array of all the listeners of the given type that were added to this model.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../../javax/swing/tree/TreeNode.html">TreeNode</A>[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/swing/tree/DefaultTreeModel.html#getPathToRoot(javax.swing.tree.TreeNode)">getPathToRoot</A></B>(<A HREF="../../../javax/swing/tree/TreeNode.html">TreeNode</A> aNode)</CODE><BR> Builds the parents of node up to and including the root node, where the original node is the last element in the returned array.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected <A HREF="../../../javax/swing/tree/TreeNode.html">TreeNode</A>[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/swing/tree/DefaultTreeModel.html#getPathToRoot(javax.swing.tree.TreeNode, int)">getPathToRoot</A></B>(<A HREF="../../../javax/swing/tree/TreeNode.html">TreeNode</A> aNode, int depth)</CODE><BR> Builds the parents of node up to and including the root node, where the original node is the last element in the returned array.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../../java/lang/Object.html">Object</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/swing/tree/DefaultTreeModel.html#getRoot()">getRoot</A></B>()</CODE><BR> Returns the root of the tree.</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/DefaultTreeModel.html#insertNodeInto(javax.swing.tree.MutableTreeNode, javax.swing.tree.MutableTreeNode, int)">insertNodeInto</A></B>(<A HREF="../../../javax/swing/tree/MutableTreeNode.html">MutableTreeNode</A> newChild, <A HREF="../../../javax/swing/tree/MutableTreeNode.html">MutableTreeNode</A> parent, int index)</CODE><BR> Invoked this to insert newChild at location index in parents 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/DefaultTreeModel.html#isLeaf(java.lang.Object)">isLeaf</A></B>(<A HREF="../../../java/lang/Object.html">Object</A> node)</CODE><BR> Returns whether the specified node is a leaf node.</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/DefaultTreeModel.html#nodeChanged(javax.swing.tree.TreeNode)">nodeChanged</A></B>(<A HREF="../../../javax/swing/tree/TreeNode.html">TreeNode</A> node)</CODE><BR> Invoke this method after you've changed how node is to be represented in the tree.</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/DefaultTreeModel.html#nodesChanged(javax.swing.tree.TreeNode, int[])">nodesChanged</A></B>(<A HREF="../../../javax/swing/tree/TreeNode.html">TreeNode</A> node, int[] childIndices)</CODE><BR> Invoke this method after you've changed how the children identified by childIndicies are to be represented in the tree.</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/DefaultTreeModel.html#nodeStructureChanged(javax.swing.tree.TreeNode)">nodeStructureChanged</A></B>(<A HREF="../../../javax/swing/tree/TreeNode.html">TreeNode</A> node)</CODE><BR> Invoke this method if you've totally changed the children of node and its childrens 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/DefaultTreeModel.html#nodesWereInserted(javax.swing.tree.TreeNode, int[])">nodesWereInserted</A></B>(<A HREF="../../../javax/swing/tree/TreeNode.html">TreeNode</A> node, int[] childIndices)</CODE><BR> Invoke this method after you've inserted some TreeNodes into node.</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/DefaultTreeModel.html#nodesWereRemoved(javax.swing.tree.TreeNode, int[], java.lang.Object[])">nodesWereRemoved</A></B>(<A HREF="../../../javax/swing/tree/TreeNode.html">TreeNode</A> node, int[] childIndices, <A HREF="../../../java/lang/Object.html">Object</A>[] removedChildren)</CODE><BR> Invoke this method after you've removed some TreeNodes from node.</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/DefaultTreeModel.html#reload()">reload</A></B>()</CODE><BR> Invoke this method if you've modified the TreeNodes upon which this model depends.</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/DefaultTreeModel.html#reload(javax.swing.tree.TreeNode)">reload</A></B>(<A HREF="../../../javax/swing/tree/TreeNode.html">TreeNode</A> node)</CODE><BR> Invoke this method if you've modified the TreeNodes upon which this model depends.</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/DefaultTreeModel.html#removeNodeFromParent(javax.swing.tree.MutableTreeNode)">removeNodeFromParent</A></B>(<A HREF="../../../javax/swing/tree/MutableTreeNode.html">MutableTreeNode</A> node)</CODE><BR> Message this to remove node from its 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/DefaultTreeModel.html#removeTreeModelListener(javax.swing.event.TreeModelListener)">removeTreeModelListener</A></B>(<A HREF="../../../javax/swing/event/TreeModelListener.html">TreeModelListener</A> l)</CODE><BR> Removes a listener previously added with <B>addTreeModelListener()</B>.</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/DefaultTreeModel.html#setAsksAllowsChildren(boolean)">setAsksAllowsChildren</A></B>(boolean newValue)</CODE><BR> Sets whether or not to test leafness by asking getAllowsChildren() or isLeaf() to the TreeNodes.</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/DefaultTreeModel.html#setRoot(javax.swing.tree.TreeNode)">setRoot</A></B>(<A HREF="../../../javax/swing/tree/TreeNode.html">TreeNode</A> root)</CODE><BR> Sets the root to <code>root</code>.</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/DefaultTreeModel.html#valueForPathChanged(javax.swing.tree.TreePath, java.lang.Object)">valueForPathChanged</A></B>(<A HREF="../../../javax/swing/tree/TreePath.html">TreePath</A> path, <A HREF="../../../java/lang/Object.html">Object</A> newValue)</CODE><BR> This sets the user object of the TreeNode identified by path and posts a node changed.</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#clone()">clone</A>, <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#toString()">toString</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="root"><!-- --></A><H3>root</H3><PRE>protected <A HREF="../../../javax/swing/tree/TreeNode.html">TreeNode</A> <B>root</B></PRE><DL><DD>Root of the tree.</DL><HR><A NAME="listenerList"><!-- --></A><H3>listenerList</H3><PRE>protected <A HREF="../../../javax/swing/event/EventListenerList.html">EventListenerList</A> <B>listenerList</B></PRE><DL><DD>Listeners.</DL><HR><A NAME="asksAllowsChildren"><!-- --></A><H3>asksAllowsChildren</H3><PRE>protected boolean <B>asksAllowsChildren</B></PRE><DL><DD>Determines how the <code>isLeaf</code> method figures out if a node is a leaf node. If true, a node is a leaf node if it does not allow children. (If it allows children, it is not a leaf node, even if no children are present.) That lets you distinguish between <i>folder</i> nodes and <i>file</i> nodes in a file system, for example. <p> If this value is false, then any node which has no children is a leaf node, and any node may acquire children.<DD><DL><DT><B>See Also: </B><DD><A HREF="../../../javax/swing/tree/TreeNode.html#getAllowsChildren()"><CODE>TreeNode.getAllowsChildren()</CODE></A>, <A HREF="../../../javax/swing/tree/TreeModel.html#isLeaf(java.lang.Object)"><CODE>TreeModel.isLeaf(java.lang.Object)</CODE></A>, <A HREF="../../../javax/swing/tree/DefaultTreeModel.html#setAsksAllowsChildren(boolean)"><CODE>setAsksAllowsChildren(boolean)</CODE></A></DL></DD></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="DefaultTreeModel(javax.swing.tree.TreeNode)"><!-- --></A><H3>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -