178 lines
8.7 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<div class="header">
<div class="subTitle">
javax.swing.tree
</div>
<h2 class="title" title="Interface TreeNode">Interface TreeNode</h2>
</div><div class="contentContainer">
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>
All Known Subinterfaces:
</dt>
<dd>
<span><a href="../../../javax/swing/tree/MutableTreeNode.html" title="javax.swing.tree中的接口">MutableTreeNode</a></span>
</dd>
</dl>
<dl>
<dt>
所有已知实现类:
</dt>
<dd>
<span><a href="../../../javax/swing/text/AbstractDocument.AbstractElement.html" title="javax.swing.text中的类">AbstractDocument.AbstractElement</a> <a href="../../../javax/swing/text/AbstractDocument.BranchElement.html" title="javax.swing.text中的类">AbstractDocument.BranchElement</a> <a href="../../../javax/swing/text/AbstractDocument.LeafElement.html" title="javax.swing.text中的类">AbstractDocument.LeafElement</a> <a href="../../../javax/swing/tree/DefaultMutableTreeNode.html" title="javax.swing.tree中的类">DefaultMutableTreeNode</a> <a href="../../../javax/swing/text/DefaultStyledDocument.SectionElement.html" title="javax.swing.text中的类">DefaultStyledDocument.SectionElement</a> <a href="../../../javax/swing/text/html/HTMLDocument.BlockElement.html" title="javax.swing.text.html中的类">HTMLDocument.BlockElement</a> <a href="../../../javax/swing/text/html/HTMLDocument.RunElement.html" title="javax.swing.text.html中的类">HTMLDocument.RunElement</a> <a href="../../../javax/swing/JTree.DynamicUtilTreeNode.html" title="javax.swing中的类">JTree.DynamicUtilTreeNode</a></span>
</dd>
</dl>
<hr/> <br/> <pre>public interface <span class="typeNameLabel">TreeNode</span></pre>
<div class="block">
<span>定义可以用作JTree中的树节点的对象的要求。</span>
<p> <span>的实现<code>TreeNode</code>重写<code>equals</code>通常需要重写<code>hashCode</code>为好。</span> <span>请参阅<a href="../../../javax/swing/tree/TreeModel.html" title="javax.swing.tree中的接口"><code>TreeModel</code></a>以获取更多信息。</span> <span>有关使用树节点的更多信息和示例,请参阅<em>Java教程</em><em></em> <a href="http://docs.oracle.com/javase/tutorial/uiswing/components/tree.html">How to Use Tree Nodes</a> <em></em></span> </p>
</div> </li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!-- --> </a> <h3>方法摘要</h3>
<table border="0" cellpadding="3" cellspacing="0" class="memberSummary" summary="Method Summary table, listing methods, and an explanation">
<caption>
<span class="activeTableTab" id="t0"><span>所有方法</span><span class="tabEnd"> </span></span>
<span class="tableTab" id="t2"><span><a href="javascript:show(2);">接口方法</a></span><span class="tabEnd"> </span></span>
<span class="tableTab" id="t3"><span><a href="javascript:show(4);">抽象方法</a></span><span class="tabEnd"> </span></span>
</caption>
<tbody>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr class="altColor" id="i0">
<td class="colFirst"><code><a href="../../../java/util/Enumeration.html" title="interface in java.util">Enumeration</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/swing/tree/TreeNode.html#children--">children</a></span>()</code>
<div class="block">
作为
<code>Enumeration</code>返回接收者的
<code>Enumeration</code>
</div> </td>
</tr>
<tr class="rowColor" id="i1">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/swing/tree/TreeNode.html#getAllowsChildren--">getAllowsChildren</a></span>()</code>
<div class="block">
如果接收器允许孩子则返回true。
</div> </td>
</tr>
<tr class="altColor" id="i2">
<td class="colFirst"><code><a href="../../../javax/swing/tree/TreeNode.html" title="interface in javax.swing.tree">TreeNode</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/swing/tree/TreeNode.html#getChildAt-int-">getChildAt</a></span>(int childIndex)</code>
<div class="block">
返回子
<code>TreeNode</code>索引
<code>childIndex</code>
</div> </td>
</tr>
<tr class="rowColor" id="i3">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/swing/tree/TreeNode.html#getChildCount--">getChildCount</a></span>()</code>
<div class="block">
返回接收者包含的孩子数
<code>TreeNode</code>
</div> </td>
</tr>
<tr class="altColor" id="i4">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/swing/tree/TreeNode.html#getIndex-javax.swing.tree.TreeNode-">getIndex</a></span>(<a href="../../../javax/swing/tree/TreeNode.html" title="interface in javax.swing.tree">TreeNode</a> node)</code>
<div class="block">
返回的索引
<code>node</code>接收机中的孩子。
</div> </td>
</tr>
<tr class="rowColor" id="i5">
<td class="colFirst"><code><a href="../../../javax/swing/tree/TreeNode.html" title="interface in javax.swing.tree">TreeNode</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/swing/tree/TreeNode.html#getParent--">getParent</a></span>()</code>
<div class="block">
返回接收者的父级
<code>TreeNode</code>
</div> </td>
</tr>
<tr class="altColor" id="i6">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/swing/tree/TreeNode.html#isLeaf--">isLeaf</a></span>()</code>
<div class="block">
如果接收者是叶子则返回true。
</div> </td>
</tr>
</tbody>
</table> </li>
</ul> </li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- --> </a> <h3>方法详细信息</h3> <a name="getChildAt-int-">
<!-- --> </a>
<ul class="blockList">
<li class="blockList"> <h4>getChildAt</h4> <pre><a href="../../../javax/swing/tree/TreeNode.html" title="interface in javax.swing.tree">TreeNode</a> getChildAt(int childIndex)</pre>
<div class="block">
返回子
<code>TreeNode</code>索引
<code>childIndex</code>
</div> </li>
</ul> <a name="getChildCount--">
<!-- --> </a>
<ul class="blockList">
<li class="blockList"> <h4>getChildCount</h4> <pre>int getChildCount()</pre>
<div class="block">
返回接收器包含的子数
<code>TreeNode</code>
</div> </li>
</ul> <a name="getParent--">
<!-- --> </a>
<ul class="blockList">
<li class="blockList"> <h4>getParent</h4> <pre><a href="../../../javax/swing/tree/TreeNode.html" title="interface in javax.swing.tree">TreeNode</a> getParent()</pre>
<div class="block">
返回接收方的父级
<code>TreeNode</code>
</div> </li>
</ul> <a name="getIndex-javax.swing.tree.TreeNode-">
<!-- --> </a>
<ul class="blockList">
<li class="blockList"> <h4>getIndex</h4> <pre>int getIndex(<a href="../../../javax/swing/tree/TreeNode.html" title="interface in javax.swing.tree">TreeNode</a> node)</pre>
<div class="block">
<span>返回的索引<code>node</code>接收机中的孩子。</span>
<span>如果接收方不包含<code>node</code> ,则返回-1。</span>
</div> </li>
</ul> <a name="getAllowsChildren--">
<!-- --> </a>
<ul class="blockList">
<li class="blockList"> <h4>getAllowsChildren</h4> <pre>boolean getAllowsChildren()</pre>
<div class="block">
如果接收器允许孩子则返回true。
</div> </li>
</ul> <a name="isLeaf--">
<!-- --> </a>
<ul class="blockList">
<li class="blockList"> <h4>isLeaf</h4> <pre>boolean isLeaf()</pre>
<div class="block">
如果接收者是叶子则返回true。
</div> </li>
</ul> <a name="children--">
<!-- --> </a>
<ul class="blockListLast">
<li class="blockList"> <h4>children</h4> <pre><a href="../../../java/util/Enumeration.html" title="interface in java.util">Enumeration</a> children()</pre>
<div class="block">
作为
<code>Enumeration</code>返回接收者的
<code>Enumeration</code>
</div> </li>
</ul> </li>
</ul> </li>
</ul>
</div>
</div>