uTools-Manuals/docs/java/javax/swing/ListSelectionModel.html

663 lines
30 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
</div>
<h2 class="title" title="Interface ListSelectionModel">Interface ListSelectionModel</h2>
</div><div class="contentContainer">
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>
所有已知实现类:
</dt>
<dd>
<span><a href="../../javax/swing/DefaultListSelectionModel.html" title="javax.swing中的类">DefaultListSelectionModel</a></span>
</dd>
</dl>
<hr/> <br/> <pre>public interface <span class="typeNameLabel">ListSelectionModel</span></pre>
<div class="block">
<span>此接口表示显示具有稳定索引的值列表的任何组件的选择的当前状态。</span>
<span>选择被建模为一组间隔,每个间隔表示所选列表元素的连续范围。</span>
<span>修改所选间隔集合的方法都采用一对索引index0和index1它们表示一个闭合的间隔即间隔包括index0和index1。</span>
</div>
<dl>
<dt>
<span class="seeLabel">另请参见:</span>
</dt>
<dd>
<span><a href="../../javax/swing/DefaultListSelectionModel.html" title="javax.swing中的类"><code>DefaultListSelectionModel</code></a></span>
</dd>
</dl> </li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- =========== FIELD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="field.summary">
<!-- --> </a> <h3>Field Summary</h3>
<table border="0" cellpadding="3" cellspacing="0" class="memberSummary" summary="Field Summary table, listing fields, and an explanation">
<caption>
<span>Fields</span>
<span class="tabEnd"> </span>
</caption>
<tbody>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Field and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../javax/swing/ListSelectionModel.html#MULTIPLE_INTERVAL_SELECTION">MULTIPLE_INTERVAL_SELECTION</a></span></code>
<div class="block">
selectionMode属性的值一次选择一个或多个连续的索引范围。
</div> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../javax/swing/ListSelectionModel.html#SINGLE_INTERVAL_SELECTION">SINGLE_INTERVAL_SELECTION</a></span></code>
<div class="block">
selectionMode属性的值一次选择一个连续的索引范围。
</div> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../javax/swing/ListSelectionModel.html#SINGLE_SELECTION">SINGLE_SELECTION</a></span></code>
<div class="block">
selectionMode属性的值一次选择一个列表索引。
</div> </td>
</tr>
</tbody>
</table> </li>
</ul>
<!-- ========== 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>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../javax/swing/ListSelectionModel.html#addListSelectionListener-javax.swing.event.ListSelectionListener-">addListSelectionListener</a></span>(<a href="../../javax/swing/event/ListSelectionListener.html" title="interface in javax.swing.event">ListSelectionListener</a> x)</code>
<div class="block">
将侦听器添加到每次发生更改选择时通知的列表。
</div> </td>
</tr>
<tr class="rowColor" id="i1">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../javax/swing/ListSelectionModel.html#addSelectionInterval-int-int-">addSelectionInterval</a></span>(int index0, int index1)</code>
<div class="block">
将选择更改为当前选择的集合,以及
<code>index0</code>
<code>index1</code>之间的索引。
</div> </td>
</tr>
<tr class="altColor" id="i2">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../javax/swing/ListSelectionModel.html#clearSelection--">clearSelection</a></span>()</code>
<div class="block">
将选择更改为空集。
</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/ListSelectionModel.html#getAnchorSelectionIndex--">getAnchorSelectionIndex</a></span>()</code>
<div class="block">
从最近调用setSelectionIntervaladdSelectionInterval或removeSelectionInterval返回第一个索引参数。
</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/ListSelectionModel.html#getLeadSelectionIndex--">getLeadSelectionIndex</a></span>()</code>
<div class="block">
将第二个索引参数从最近的调用返回给setSelectionIntervaladdSelectionInterval或removeSelectionInterval
</div> </td>
</tr>
<tr class="rowColor" id="i5">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../javax/swing/ListSelectionModel.html#getMaxSelectionIndex--">getMaxSelectionIndex</a></span>()</code>
<div class="block">
返回最后选择的索引,如果选择为空,则返回-1。
</div> </td>
</tr>
<tr class="altColor" id="i6">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../javax/swing/ListSelectionModel.html#getMinSelectionIndex--">getMinSelectionIndex</a></span>()</code>
<div class="block">
返回第一个选择的索引,如果选择为空,则返回-1。
</div> </td>
</tr>
<tr class="rowColor" id="i7">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../javax/swing/ListSelectionModel.html#getSelectionMode--">getSelectionMode</a></span>()</code>
<div class="block">
返回当前选择模式。
</div> </td>
</tr>
<tr class="altColor" id="i8">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../javax/swing/ListSelectionModel.html#getValueIsAdjusting--">getValueIsAdjusting</a></span>()</code>
<div class="block">
如果选择正在进行一系列更改,则返回
<code>true</code>
</div> </td>
</tr>
<tr class="rowColor" id="i9">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../javax/swing/ListSelectionModel.html#insertIndexInterval-int-int-boolean-">insertIndexInterval</a></span>(int index, int length, boolean before)</code>
<div class="block">
在索引之前/之后插入长度索引。
</div> </td>
</tr>
<tr class="altColor" id="i10">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../javax/swing/ListSelectionModel.html#isSelectedIndex-int-">isSelectedIndex</a></span>(int index)</code>
<div class="block">
如果选择了指定的索引则返回true。
</div> </td>
</tr>
<tr class="rowColor" id="i11">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../javax/swing/ListSelectionModel.html#isSelectionEmpty--">isSelectionEmpty</a></span>()</code>
<div class="block">
如果没有选择索引则返回true。
</div> </td>
</tr>
<tr class="altColor" id="i12">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../javax/swing/ListSelectionModel.html#removeIndexInterval-int-int-">removeIndexInterval</a></span>(int index0, int index1)</code>
<div class="block">
从选择模型中删除间隔index0index1包括中的索引。
</div> </td>
</tr>
<tr class="rowColor" id="i13">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../javax/swing/ListSelectionModel.html#removeListSelectionListener-javax.swing.event.ListSelectionListener-">removeListSelectionListener</a></span>(<a href="../../javax/swing/event/ListSelectionListener.html" title="interface in javax.swing.event">ListSelectionListener</a> x)</code>
<div class="block">
从列表中删除一个侦听器,每次发生更改时都会通知该侦听器。
</div> </td>
</tr>
<tr class="altColor" id="i14">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../javax/swing/ListSelectionModel.html#removeSelectionInterval-int-int-">removeSelectionInterval</a></span>(int index0, int index1)</code>
<div class="block">
将选择更改为当前选择的设置差异和
<code>index0</code>
<code>index1</code>之间的指数。
</div> </td>
</tr>
<tr class="rowColor" id="i15">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../javax/swing/ListSelectionModel.html#setAnchorSelectionIndex-int-">setAnchorSelectionIndex</a></span>(int index)</code>
<div class="block">
设置锚选择索引。
</div> </td>
</tr>
<tr class="altColor" id="i16">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../javax/swing/ListSelectionModel.html#setLeadSelectionIndex-int-">setLeadSelectionIndex</a></span>(int index)</code>
<div class="block">
设置主导选择指标。
</div> </td>
</tr>
<tr class="rowColor" id="i17">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../javax/swing/ListSelectionModel.html#setSelectionInterval-int-int-">setSelectionInterval</a></span>(int index0, int index1)</code>
<div class="block">
将选择更改为
<code>index0</code>
<code>index1</code>包括)之间。
</div> </td>
</tr>
<tr class="altColor" id="i18">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../javax/swing/ListSelectionModel.html#setSelectionMode-int-">setSelectionMode</a></span>(int selectionMode)</code>
<div class="block">
设置选择模式。
</div> </td>
</tr>
<tr class="rowColor" id="i19">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../javax/swing/ListSelectionModel.html#setValueIsAdjusting-boolean-">setValueIsAdjusting</a></span>(boolean valueIsAdjusting)</code>
<div class="block">
设置
<code>valueIsAdjusting</code>属性,其指示即将到来的选择更改是否应被视为单个更改的一部分。
</div> </td>
</tr>
</tbody>
</table> </li>
</ul> </li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ FIELD DETAIL =========== -->
<ul class="blockList">
<li class="blockList"><a name="field.detail">
<!-- --> </a> <h3>字段详细信息</h3> <a name="SINGLE_SELECTION">
<!-- --> </a>
<ul class="blockList">
<li class="blockList"> <h4>SINGLE_SELECTION</h4> <pre>static final int SINGLE_SELECTION</pre>
<div class="block">
selectionMode属性的值一次选择一个列表索引。
</div>
<dl>
<dt>
<span class="seeLabel">另请参见:</span>
</dt>
<dd>
<a href="../../javax/swing/ListSelectionModel.html#setSelectionMode-int-"><code>setSelectionMode(int)</code></a>
<a href="../../constant-values.html#javax.swing.ListSelectionModel.SINGLE_SELECTION">Constant Field Values</a>
</dd>
</dl> </li>
</ul> <a name="SINGLE_INTERVAL_SELECTION">
<!-- --> </a>
<ul class="blockList">
<li class="blockList"> <h4>SINGLE_INTERVAL_SELECTION</h4> <pre>static final int SINGLE_INTERVAL_SELECTION</pre>
<div class="block">
selectionMode属性的值一次选择一个连续的索引范围。
</div>
<dl>
<dt>
<span class="seeLabel">另请参见:</span>
</dt>
<dd>
<a href="../../javax/swing/ListSelectionModel.html#setSelectionMode-int-"><code>setSelectionMode(int)</code></a>
<a href="../../constant-values.html#javax.swing.ListSelectionModel.SINGLE_INTERVAL_SELECTION">Constant Field Values</a>
</dd>
</dl> </li>
</ul> <a name="MULTIPLE_INTERVAL_SELECTION">
<!-- --> </a>
<ul class="blockListLast">
<li class="blockList"> <h4>MULTIPLE_INTERVAL_SELECTION</h4> <pre>static final int MULTIPLE_INTERVAL_SELECTION</pre>
<div class="block">
selectionMode属性的值一次选择一个或多个连续的索引范围。
</div>
<dl>
<dt>
<span class="seeLabel">另请参见:</span>
</dt>
<dd>
<a href="../../javax/swing/ListSelectionModel.html#setSelectionMode-int-"><code>setSelectionMode(int)</code></a>
<a href="../../constant-values.html#javax.swing.ListSelectionModel.MULTIPLE_INTERVAL_SELECTION">Constant Field Values</a>
</dd>
</dl> </li>
</ul> </li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- --> </a> <h3>方法详细信息</h3> <a name="setSelectionInterval-int-int-">
<!-- --> </a>
<ul class="blockList">
<li class="blockList"> <h4>setSelectionInterval</h4> <pre>void setSelectionInterval(int index0,
int index1)</pre>
<div class="block">
<span>将选择更改为<code>index0</code><code>index1</code>之间。</span>
<span><code>index0</code>不一定要小于或等于<code>index1</code></span>
<p> <span><code>SINGLE_SELECTION</code>选择模式下,仅使用第二个索引。</span> </p>
<p> <span>如果这表示对当前选择的更改,则通知每个<code>ListSelectionListener</code>更改。</span> </p>
</div>
<dl>
<dt>
<span class="paramLabel">参数</span>
</dt>
<dd>
<code>index0</code> - 间隔的一端。
</dd>
<dd>
<code>index1</code> - 间隔的另一端
</dd>
<dt>
<span class="seeLabel">另请参见:</span>
</dt>
<dd>
<a href="../../javax/swing/ListSelectionModel.html#addListSelectionListener-javax.swing.event.ListSelectionListener-"><code>addListSelectionListener(javax.swing.event.ListSelectionListener)</code></a>
</dd>
</dl> </li>
</ul> <a name="addSelectionInterval-int-int-">
<!-- --> </a>
<ul class="blockList">
<li class="blockList"> <h4>addSelectionInterval</h4> <pre>void addSelectionInterval(int index0,
int index1)</pre>
<div class="block">
<span>将选择更改为当前选择的集合,以及<code>index0</code><code>index1</code>之间的索引。</span>
<span><code>index0</code>不一定要小于或等于<code>index1</code></span>
<p> <span><code>SINGLE_SELECTION</code>选择模式下,这相当于调用<code>setSelectionInterval</code> ,只使用第二个索引。</span> <span><code>SINGLE_INTERVAL_SELECTION</code>选择模式中,该方法的行为类似于<code>setSelectionInterval</code> ,除非给定的间隔与现有选择紧邻或重叠,因此可用于增长选择。</span> </p>
<p> <span>如果这表示对当前选择的更改,则通知每个<code>ListSelectionListener</code>更改。</span> </p>
</div>
<dl>
<dt>
<span class="paramLabel">参数</span>
</dt>
<dd>
<code>index0</code> - 间隔的一端。
</dd>
<dd>
<code>index1</code> - 间隔的另一端
</dd>
<dt>
<span class="seeLabel">另请参见:</span>
</dt>
<dd>
<a href="../../javax/swing/ListSelectionModel.html#addListSelectionListener-javax.swing.event.ListSelectionListener-"><code>addListSelectionListener(javax.swing.event.ListSelectionListener)</code></a>
<a href="../../javax/swing/ListSelectionModel.html#setSelectionInterval-int-int-"><code>setSelectionInterval(int, int)</code></a>
</dd>
</dl> </li>
</ul> <a name="removeSelectionInterval-int-int-">
<!-- --> </a>
<ul class="blockList">
<li class="blockList"> <h4>removeSelectionInterval</h4> <pre>void removeSelectionInterval(int index0,
int index1)</pre>
<div class="block">
<span>将选择更改为当前选择的设置差异和<code>index0</code><code>index1</code>之间的指数。</span>
<span><code>index0</code>不一定要小于或等于<code>index1</code></span>
<p> <span><code>SINGLE_INTERVAL_SELECTION</code>选择模式下,如果删除将产生两个不相交选择,则删除将通过更大的选择结束延长。</span> <span>例如,如果选择为<code>0-10</code> ,并且您提供指数<code>5,6</code> (按任何顺序),则所得的选择为<code>0-4</code></span> </p>
<p> <span>如果这表示对当前选择的更改,则通知每个<code>ListSelectionListener</code>更改。</span> </p>
</div>
<dl>
<dt>
<span class="paramLabel">参数</span>
</dt>
<dd>
<code>index0</code> - 间隔的一端。
</dd>
<dd>
<code>index1</code> - 间隔的另一端
</dd>
<dt>
<span class="seeLabel">另请参见:</span>
</dt>
<dd>
<a href="../../javax/swing/ListSelectionModel.html#addListSelectionListener-javax.swing.event.ListSelectionListener-"><code>addListSelectionListener(javax.swing.event.ListSelectionListener)</code></a>
</dd>
</dl> </li>
</ul> <a name="getMinSelectionIndex--">
<!-- --> </a>
<ul class="blockList">
<li class="blockList"> <h4>getMinSelectionIndex</h4> <pre>int getMinSelectionIndex()</pre>
<div class="block">
返回第一个选择的索引,如果选择为空,则返回-1。
</div> </li>
</ul> <a name="getMaxSelectionIndex--">
<!-- --> </a>
<ul class="blockList">
<li class="blockList"> <h4>getMaxSelectionIndex</h4> <pre>int getMaxSelectionIndex()</pre>
<div class="block">
返回最后选择的索引,如果选择为空,则返回-1。
</div> </li>
</ul> <a name="isSelectedIndex-int-">
<!-- --> </a>
<ul class="blockList">
<li class="blockList"> <h4>isSelectedIndex</h4> <pre>boolean isSelectedIndex(int index)</pre>
<div class="block">
如果选择了指定的索引则返回true。
</div> </li>
</ul> <a name="getAnchorSelectionIndex--">
<!-- --> </a>
<ul class="blockList">
<li class="blockList"> <h4>getAnchorSelectionIndex</h4> <pre>int getAnchorSelectionIndex()</pre>
<div class="block">
<span>从最近调用setSelectionIntervaladdSelectionInterval或removeSelectionInterval返回第一个索引参数。</span>
<span>最近的index0被认为是“锚”最近的index1被认为是“引导”。</span>
<span>一些界面特别显示这些索引例如Windows95显示带有虚线黄色轮廓的引导索引。</span>
</div>
<dl>
<dt>
<span class="seeLabel">另请参见:</span>
</dt>
<dd>
<a href="../../javax/swing/ListSelectionModel.html#getLeadSelectionIndex--"><code>getLeadSelectionIndex()</code></a>
<a href="../../javax/swing/ListSelectionModel.html#setSelectionInterval-int-int-"><code>setSelectionInterval(int, int)</code></a>
<a href="../../javax/swing/ListSelectionModel.html#addSelectionInterval-int-int-"><code>addSelectionInterval(int, int)</code></a>
</dd>
</dl> </li>
</ul> <a name="setAnchorSelectionIndex-int-">
<!-- --> </a>
<ul class="blockList">
<li class="blockList"> <h4>setAnchorSelectionIndex</h4> <pre>void setAnchorSelectionIndex(int index)</pre>
<div class="block">
设置锚选择索引。
</div>
<dl>
<dt>
<span class="seeLabel">另请参见:</span>
</dt>
<dd>
<a href="../../javax/swing/ListSelectionModel.html#getAnchorSelectionIndex--"><code>getAnchorSelectionIndex()</code></a>
</dd>
</dl> </li>
</ul> <a name="getLeadSelectionIndex--">
<!-- --> </a>
<ul class="blockList">
<li class="blockList"> <h4>getLeadSelectionIndex</h4> <pre>int getLeadSelectionIndex()</pre>
<div class="block">
将第二个索引参数从最近的调用返回给setSelectionIntervaladdSelectionInterval或removeSelectionInterval
</div>
<dl>
<dt>
<span class="seeLabel">另请参见:</span>
</dt>
<dd>
<a href="../../javax/swing/ListSelectionModel.html#getAnchorSelectionIndex--"><code>getAnchorSelectionIndex()</code></a>
<a href="../../javax/swing/ListSelectionModel.html#setSelectionInterval-int-int-"><code>setSelectionInterval(int, int)</code></a>
<a href="../../javax/swing/ListSelectionModel.html#addSelectionInterval-int-int-"><code>addSelectionInterval(int, int)</code></a>
</dd>
</dl> </li>
</ul> <a name="setLeadSelectionIndex-int-">
<!-- --> </a>
<ul class="blockList">
<li class="blockList"> <h4>setLeadSelectionIndex</h4> <pre>void setLeadSelectionIndex(int index)</pre>
<div class="block">
设置主导选择指标。
</div>
<dl>
<dt>
<span class="seeLabel">另请参见:</span>
</dt>
<dd>
<a href="../../javax/swing/ListSelectionModel.html#getLeadSelectionIndex--"><code>getLeadSelectionIndex()</code></a>
</dd>
</dl> </li>
</ul> <a name="clearSelection--">
<!-- --> </a>
<ul class="blockList">
<li class="blockList"> <h4>clearSelection</h4> <pre>void clearSelection()</pre>
<div class="block">
<span>将选择更改为空集。</span>
<span>如果这表示对当前选择的更改则通知每个ListSelectionListener。</span>
</div>
<dl>
<dt>
<span class="seeLabel">另请参见:</span>
</dt>
<dd>
<a href="../../javax/swing/ListSelectionModel.html#addListSelectionListener-javax.swing.event.ListSelectionListener-"><code>addListSelectionListener(javax.swing.event.ListSelectionListener)</code></a>
</dd>
</dl> </li>
</ul> <a name="isSelectionEmpty--">
<!-- --> </a>
<ul class="blockList">
<li class="blockList"> <h4>isSelectionEmpty</h4> <pre>boolean isSelectionEmpty()</pre>
<div class="block">
如果没有选择索引则返回true。
</div> </li>
</ul> <a name="insertIndexInterval-int-int-boolean-">
<!-- --> </a>
<ul class="blockList">
<li class="blockList"> <h4>insertIndexInterval</h4> <pre>void insertIndexInterval(int index,
int length,
boolean before)</pre>
<div class="block">
<span>在索引之前/之后插入长度索引。</span>
<span>这通常被称为将选择模型与数据模型中的相应变化同步。</span>
</div> </li>
</ul> <a name="removeIndexInterval-int-int-">
<!-- --> </a>
<ul class="blockList">
<li class="blockList"> <h4>removeIndexInterval</h4> <pre>void removeIndexInterval(int index0,
int index1)</pre>
<div class="block">
<span>从选择模型中删除间隔index0index1包括中的索引。</span>
<span>这通常被称为将选择模型宽度与数据模型中的相应变化同步。</span>
</div> </li>
</ul> <a name="setValueIsAdjusting-boolean-">
<!-- --> </a>
<ul class="blockList">
<li class="blockList"> <h4>setValueIsAdjusting</h4> <pre>void setValueIsAdjusting(boolean valueIsAdjusting)</pre>
<div class="block">
<span>设置<code>valueIsAdjusting</code>属性,其指示即将到来的选择更改是否应被视为单个更改的一部分。</span>
<span>该属性的值用于初始化生成的<code>ListSelectionEvent</code> s的<code>valueIsAdjusting</code>属性。</span>
<p> <span>例如,如果选择是响应于用户拖动被更新,该属性可以被设置为<code>true</code>当拖动开始,并设置为<code>false</code>当拖动结束。</span> <span>在拖动期间,监听器接收一个<code>valueIsAdjusting</code>属性设置为<code>true</code></span> <span>拖动结束时,当更改完成时,监听器将收到一个值设置为<code>false</code>的事件。</span> <span>如果希望仅在更改完成后更新,则侦听器可以使用此模式。</span> </p>
<p> <span>将此属性设置为<code>true</code>开始一系列将被视为单个更改的一部分的更改。</span> <span>当属性更改为<code>false</code>时,会发送一个事件,表征整个选择更改(如果有的话),事件的<code>valueIsAdjusting</code>属性设置为<code>false</code></span> </p>
</div>
<dl>
<dt>
<span class="paramLabel">参数</span>
</dt>
<dd>
<code>valueIsAdjusting</code> - 该物业的新值
</dd>
<dt>
<span class="seeLabel">另请参见:</span>
</dt>
<dd>
<a href="../../javax/swing/ListSelectionModel.html#getValueIsAdjusting--"><code>getValueIsAdjusting()</code></a>
<a href="../../javax/swing/event/ListSelectionEvent.html#getValueIsAdjusting--"><code>ListSelectionEvent.getValueIsAdjusting()</code></a>
</dd>
</dl> </li>
</ul> <a name="getValueIsAdjusting--">
<!-- --> </a>
<ul class="blockList">
<li class="blockList"> <h4>getValueIsAdjusting</h4> <pre>boolean getValueIsAdjusting()</pre>
<div class="block">
如果选择正在进行一系列更改,则返回
<code>true</code>
</div>
<dl>
<dt>
<span class="returnLabel">结果</span>
</dt>
<dd>
如果选择正在进行一系列更改则为true
</dd>
<dt>
<span class="seeLabel">另请参见:</span>
</dt>
<dd>
<a href="../../javax/swing/ListSelectionModel.html#setValueIsAdjusting-boolean-"><code>setValueIsAdjusting(boolean)</code></a>
</dd>
</dl> </li>
</ul> <a name="setSelectionMode-int-">
<!-- --> </a>
<ul class="blockList">
<li class="blockList"> <h4>setSelectionMode</h4> <pre>void setSelectionMode(int selectionMode)</pre>
<div class="block">
<span>设置选择模式。</span>
<span>以下列表描述了接受的选择模式:</span>
<ul>
<li> <span><code>ListSelectionModel.SINGLE_SELECTION</code> - 一次只能选择一个列表索引。</span> <span>在这种模式下, <code>setSelectionInterval</code><code>addSelectionInterval</code>是等价的都将当前选择替换为由第二个参数“lead”表示的索引。</span> </li>
<li> <span><code>ListSelectionModel.SINGLE_INTERVAL_SELECTION</code> - 一次只能选择一个连续的间隔。</span> <span>在这种模式下, <code>addSelectionInterval</code>行为就像<code>setSelectionInterval</code> (替换当前的选择),除非给定的时间间隔与现有的选择紧邻或重叠,因此可以用来增长它。</span> </li>
<li> <span><code>ListSelectionModel.MULTIPLE_INTERVAL_SELECTION</code> - 在这种模式下,对什么可以选择没有限制。</span> </li>
</ul>
</div>
<dl>
<dt>
<span class="throwsLabel">异常</span>
</dt>
<dd>
<code><a href="../../java/lang/IllegalArgumentException.html" title="class in java.lang">IllegalArgumentException</a></code> - 如果选择模式不是允许的模式之一
</dd>
<dt>
<span class="seeLabel">另请参见:</span>
</dt>
<dd>
<a href="../../javax/swing/ListSelectionModel.html#getSelectionMode--"><code>getSelectionMode()</code></a>
</dd>
</dl> </li>
</ul> <a name="getSelectionMode--">
<!-- --> </a>
<ul class="blockList">
<li class="blockList"> <h4>getSelectionMode</h4> <pre>int getSelectionMode()</pre>
<div class="block">
返回当前选择模式。
</div>
<dl>
<dt>
<span class="returnLabel">结果</span>
</dt>
<dd>
当前选择模式
</dd>
<dt>
<span class="seeLabel">另请参见:</span>
</dt>
<dd>
<a href="../../javax/swing/ListSelectionModel.html#setSelectionMode-int-"><code>setSelectionMode(int)</code></a>
</dd>
</dl> </li>
</ul> <a name="addListSelectionListener-javax.swing.event.ListSelectionListener-">
<!-- --> </a>
<ul class="blockList">
<li class="blockList"> <h4>addListSelectionListener</h4> <pre>void addListSelectionListener(<a href="../../javax/swing/event/ListSelectionListener.html" title="interface in javax.swing.event">ListSelectionListener</a> x)</pre>
<div class="block">
将侦听器添加到每次发生更改选择时通知的列表。
</div>
<dl>
<dt>
<span class="paramLabel">参数</span>
</dt>
<dd>
<code>x</code> - ListSelectionListener
</dd>
<dt>
<span class="seeLabel">另请参见:</span>
</dt>
<dd>
<a href="../../javax/swing/ListSelectionModel.html#removeListSelectionListener-javax.swing.event.ListSelectionListener-"><code>removeListSelectionListener(javax.swing.event.ListSelectionListener)</code></a>
<a href="../../javax/swing/ListSelectionModel.html#setSelectionInterval-int-int-"><code>setSelectionInterval(int, int)</code></a>
<a href="../../javax/swing/ListSelectionModel.html#addSelectionInterval-int-int-"><code>addSelectionInterval(int, int)</code></a>
<a href="../../javax/swing/ListSelectionModel.html#removeSelectionInterval-int-int-"><code>removeSelectionInterval(int, int)</code></a>
<a href="../../javax/swing/ListSelectionModel.html#clearSelection--"><code>clearSelection()</code></a>
<a href="../../javax/swing/ListSelectionModel.html#insertIndexInterval-int-int-boolean-"><code>insertIndexInterval(int, int, boolean)</code></a>
<a href="../../javax/swing/ListSelectionModel.html#removeIndexInterval-int-int-"><code>removeIndexInterval(int, int)</code></a>
</dd>
</dl> </li>
</ul> <a name="removeListSelectionListener-javax.swing.event.ListSelectionListener-">
<!-- --> </a>
<ul class="blockListLast">
<li class="blockList"> <h4>removeListSelectionListener</h4> <pre>void removeListSelectionListener(<a href="../../javax/swing/event/ListSelectionListener.html" title="interface in javax.swing.event">ListSelectionListener</a> x)</pre>
<div class="block">
从列表中删除一个侦听器,每次发生更改时都会通知该侦听器。
</div>
<dl>
<dt>
<span class="paramLabel">参数</span>
</dt>
<dd>
<code>x</code> - ListSelectionListener
</dd>
<dt>
<span class="seeLabel">另请参见:</span>
</dt>
<dd>
<a href="../../javax/swing/ListSelectionModel.html#addListSelectionListener-javax.swing.event.ListSelectionListener-"><code>addListSelectionListener(javax.swing.event.ListSelectionListener)</code></a>
</dd>
</dl> </li>
</ul> </li>
</ul> </li>
</ul>
</div>
</div>