treemodel.html
来自「API資料大全」· HTML 代码 · 共 332 行 · 第 1/2 页
HTML
332 行
<P><!-- ============ FIELD DETAIL =========== --><!-- ========= CONSTRUCTOR DETAIL ======== --><!-- ============ 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="getRoot()"><!-- --></A><H3>getRoot</H3><PRE>public <A HREF="../../../java/lang/Object.html">Object</A> <B>getRoot</B>()</PRE><DL><DD>Returns the root of the tree. Returns null only if the tree has no nodes.<DD><DL><DT><B>Returns:</B><DD>the root of the tree</DL></DD></DL><HR><A NAME="getChild(java.lang.Object, int)"><!-- --></A><H3>getChild</H3><PRE>public <A HREF="../../../java/lang/Object.html">Object</A> <B>getChild</B>(<A HREF="../../../java/lang/Object.html">Object</A> parent, int index)</PRE><DL><DD>Returns the child of <I>parent</I> at index <I>index</I> in the parent's child array. <I>parent</I> must be a node previously obtained from this data source. This should not return null if <i>index</i> is a valid index for <i>parent</i> (that is <i>index</i> >= 0 && <i>index</i> < getChildCount(<i>parent</i>)).<DD><DL><DT><B>Parameters:</B><DD><CODE>parent</CODE> - a node in the tree, obtained from this data source<DT><B>Returns:</B><DD>the child of <I>parent</I> at index <I>index</I></DL></DD></DL><HR><A NAME="getChildCount(java.lang.Object)"><!-- --></A><H3>getChildCount</H3><PRE>public int <B>getChildCount</B>(<A HREF="../../../java/lang/Object.html">Object</A> parent)</PRE><DL><DD>Returns the number of children of <I>parent</I>. Returns 0 if the node is a leaf or if it has no children. <I>parent</I> must be a node previously obtained from this data source.<DD><DL><DT><B>Parameters:</B><DD><CODE>parent</CODE> - a node in the tree, obtained from this data source<DT><B>Returns:</B><DD>the number of children of the node <I>parent</I></DL></DD></DL><HR><A NAME="isLeaf(java.lang.Object)"><!-- --></A><H3>isLeaf</H3><PRE>public boolean <B>isLeaf</B>(<A HREF="../../../java/lang/Object.html">Object</A> node)</PRE><DL><DD>Returns true if <I>node</I> is a leaf. It is possible for this method to return false even if <I>node</I> has no children. A directory in a filesystem, for example, may contain no files; the node representing the directory is not a leaf, but it also has no children.<DD><DL><DT><B>Parameters:</B><DD><CODE>node</CODE> - a node in the tree, obtained from this data source<DT><B>Returns:</B><DD>true if <I>node</I> is a leaf</DL></DD></DL><HR><A NAME="valueForPathChanged(javax.swing.tree.TreePath, java.lang.Object)"><!-- --></A><H3>valueForPathChanged</H3><PRE>public void <B>valueForPathChanged</B>(<A HREF="../../../javax/swing/tree/TreePath.html">TreePath</A> path, <A HREF="../../../java/lang/Object.html">Object</A> newValue)</PRE><DL><DD>Messaged when the user has altered the value for the item identified by <I>path</I> to <I>newValue</I>. If <I>newValue</I> signifies a truly new value the model should post a treeNodesChanged event.<DD><DL><DT><B>Parameters:</B><DD><CODE>path</CODE> - path to the node that the user has altered.<DD><CODE>newValue</CODE> - the new value from the TreeCellEditor.</DL></DD></DL><HR><A NAME="getIndexOfChild(java.lang.Object, java.lang.Object)"><!-- --></A><H3>getIndexOfChild</H3><PRE>public int <B>getIndexOfChild</B>(<A HREF="../../../java/lang/Object.html">Object</A> parent, <A HREF="../../../java/lang/Object.html">Object</A> child)</PRE><DL><DD>Returns the index of child in parent.</DL><HR><A NAME="addTreeModelListener(javax.swing.event.TreeModelListener)"><!-- --></A><H3>addTreeModelListener</H3><PRE>public void <B>addTreeModelListener</B>(<A HREF="../../../javax/swing/event/TreeModelListener.html">TreeModelListener</A> l)</PRE><DL><DD>Adds a listener for the TreeModelEvent posted after the tree changes.<DD><DL><DT><B>Parameters:</B><DD><CODE>l</CODE> - the listener to add<DT><B>See Also: </B><DD><A HREF="../../../javax/swing/tree/TreeModel.html#removeTreeModelListener(javax.swing.event.TreeModelListener)"><CODE>removeTreeModelListener(javax.swing.event.TreeModelListener)</CODE></A></DL></DD></DL><HR><A NAME="removeTreeModelListener(javax.swing.event.TreeModelListener)"><!-- --></A><H3>removeTreeModelListener</H3><PRE>public void <B>removeTreeModelListener</B>(<A HREF="../../../javax/swing/event/TreeModelListener.html">TreeModelListener</A> l)</PRE><DL><DD>Removes a listener previously added with <B>addTreeModelListener()</B>.<DD><DL><DT><B>Parameters:</B><DD><CODE>l</CODE> - the listener to remove<DT><B>See Also: </B><DD><A HREF="../../../javax/swing/tree/TreeModel.html#addTreeModelListener(javax.swing.event.TreeModelListener)"><CODE>addTreeModelListener(javax.swing.event.TreeModelListener)</CODE></A></DL></DD></DL><!-- ========= END OF CLASS DATA ========= --><HR><!-- ========== START OF NAVBAR ========== --><A NAME="navbar_bottom"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3"> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/TreeModel.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM><b>Java<sup><font size=-2>TM</font></sup> 2 Platform<br>Std. Ed. v1.3</b></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../javax/swing/tree/TreeCellRenderer.html"><B>PREV CLASS</B></A> <A HREF="../../../javax/swing/tree/TreeNode.html"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html" TARGET="_top"><B>FRAMES</B></A> <A HREF="TreeModel.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: INNER | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><!-- =========== END OF NAVBAR =========== --><HR><font size="-1"><a href="http://java.sun.com/cgi-bin/bugreport.cgi">Submit a bug or feature</a><br>For further API reference and developer documentation, see <a href="http://java.sun.com/products/jdk/1.3/devdocs-vs-specs.html">Java 2 SDK SE Developer Documentation</a>. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples. <p>Java, Java 2D, and JDBC are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries.<br>Copyright 1993-2000 Sun Microsystems, Inc. 901 San Antonio Road<br>Palo Alto, California, 94303, U.S.A. All Rights Reserved.</font></BODY></HTML>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?