| 
JavaTM 2 Platform Standard Ed. 5.0  | 
|||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
public interface ListSelectionModel
此接口表示任何组件的当前选择状态,该组件显示一个具有稳定索引的值列表。该选择被建模为一组区间,每个区间表示一个选定列表元素的连续范围。修改该组选定区间的方法都采用一对索引:index0 和 index1,这对索引表示一个闭区间,即该区间同时包括 index0 和 index1。
DefaultListSelectionModel| 字段摘要 | |
|---|---|
static int | 
MULTIPLE_INTERVAL_SELECTION
selectionMode 属性的值:一次选择一个或多个连续的索引范围。  | 
static int | 
SINGLE_INTERVAL_SELECTION
selectionMode 属性的值:一次选择一个连续的索引范围。  | 
static int | 
SINGLE_SELECTION
selectionMode 属性的值:一次选择一个列表索引。  | 
| 方法摘要 | |
|---|---|
 void | 
addListSelectionListener(ListSelectionListener x)
将侦听器添加到每次在选择发生更改时都得到通知的列表。  | 
 void | 
addSelectionInterval(int index0,
                     int index1)
将该选择更改为当前选择与 index0 和 index1(包括)之间索引的并集。  | 
 void | 
clearSelection()
将该选择更改为空集。  | 
 int | 
getAnchorSelectionIndex()
从对 setSelectionInterval()、addSelectionInterval() 或 removeSelectionInterval() 的最近调用中返回第一个索引参数。  | 
 int | 
getLeadSelectionIndex()
从对 setSelectionInterval()、addSelectionInterval() 或 removeSelectionInterval() 的最近调用中返回第二个索引参数。  | 
 int | 
getMaxSelectionIndex()
返回最后选择的索引,如果选择为空,则返回 -1。  | 
 int | 
getMinSelectionIndex()
返回第一个选择的索引,如果选择为空,则返回 -1。  | 
 int | 
getSelectionMode()
返回当前选择模式。  | 
 boolean | 
getValueIsAdjusting()
如果该值在进行一系列更改,则返回 true。  | 
 void | 
insertIndexInterval(int index,
                    int length,
                    boolean before)
在 index 之前/之后开始插入 length 个索引。  | 
 boolean | 
isSelectedIndex(int index)
如果选择了指定的索引,则返回 true。  | 
 boolean | 
isSelectionEmpty()
如果没有选择索引,则返回 true。  | 
 void | 
removeIndexInterval(int index0,
                    int index1)
从选择模型中移除区间 index0、index1(包括)中的索引。  | 
 void | 
removeListSelectionListener(ListSelectionListener x)
将侦听器从每次在选择发生更改时都得到通知的列表中移除。  | 
 void | 
removeSelectionInterval(int index0,
                        int index1)
将该选择更改为当前选择与 index0 和 index1(包括)之间索引的差集。  | 
 void | 
setAnchorSelectionIndex(int index)
设置 anchor 选择索引。  | 
 void | 
setLeadSelectionIndex(int index)
设置 lead 选择索引。  | 
 void | 
setSelectionInterval(int index0,
                     int index1)
更改要位于 index0 和 index1(包括)之间的选择。  | 
 void | 
setSelectionMode(int selectionMode)
设置选择模式。  | 
 void | 
setValueIsAdjusting(boolean valueIsAdjusting)
如果将来对该模型的值的更改被视为单个事件,则此属性为 true。  | 
| 字段详细信息 | 
|---|
static final int SINGLE_SELECTION
setSelectionMode(int), 
常量字段值static final int SINGLE_INTERVAL_SELECTION
setSelectionMode(int), 
常量字段值static final int MULTIPLE_INTERVAL_SELECTION
setSelectionMode(int), 
常量字段值| 方法详细信息 | 
|---|
void setSelectionInterval(int index0,
                          int index1)
index0 - 区间的一端。index1 - 区间的另一端addListSelectionListener(javax.swing.event.ListSelectionListener)
void addSelectionInterval(int index0,
                          int index1)
index0 - 区间的一端。index1 - 区间的另一端addListSelectionListener(javax.swing.event.ListSelectionListener)
void removeSelectionInterval(int index0,
                             int index1)
index0 - 区间的一端。index1 - 区间的另一端addListSelectionListener(javax.swing.event.ListSelectionListener)int getMinSelectionIndex()
int getMaxSelectionIndex()
boolean isSelectedIndex(int index)
int getAnchorSelectionIndex()
getLeadSelectionIndex(), 
setSelectionInterval(int, int), 
addSelectionInterval(int, int)void setAnchorSelectionIndex(int index)
getAnchorSelectionIndex()int getLeadSelectionIndex()
getAnchorSelectionIndex(), 
setSelectionInterval(int, int), 
addSelectionInterval(int, int)void setLeadSelectionIndex(int index)
getLeadSelectionIndex()void clearSelection()
addListSelectionListener(javax.swing.event.ListSelectionListener)boolean isSelectionEmpty()
void insertIndexInterval(int index,
                         int length,
                         boolean before)
void removeIndexInterval(int index0,
                         int index1)
void setValueIsAdjusting(boolean valueIsAdjusting)
valueIsAdjusting - 属性的新值。getValueIsAdjusting()boolean getValueIsAdjusting()
setValueIsAdjusting(boolean)void setSelectionMode(int selectionMode)
SINGLE_SELECTION 一次只能选择一个列表索引。在此模式中,setSelectionInterval 和 addSelectionInterval 方法是等效的,而且仅使用第二个索引参数(“lead 索引”)。
SINGLE_INTERVAL_SELECTION 一次只能选择一个连续索引区间。在此模式中,setSelectionInterval 和 addSelectionInterval 是等效的。
MULTIPLE_INTERVAL_SELECTION 在此模式中,对选择内容无任何限制。
 
getSelectionMode()int getSelectionMode()
setSelectionMode(int)void addListSelectionListener(ListSelectionListener x)
x - ListSelectionListenerremoveListSelectionListener(javax.swing.event.ListSelectionListener), 
setSelectionInterval(int, int), 
addSelectionInterval(int, int), 
removeSelectionInterval(int, int), 
clearSelection(), 
insertIndexInterval(int, int, boolean), 
removeIndexInterval(int, int)void removeListSelectionListener(ListSelectionListener x)
x - ListSelectionListeneraddListSelectionListener(javax.swing.event.ListSelectionListener)
  | 
JavaTM 2 Platform Standard Ed. 5.0  | 
|||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
版权所有 2004 Sun Microsystems, Inc. 保留所有权利。 请遵守许可证条款。另请参阅文档重新分发政策。