| 
JavaTM 2 Platform Standard Ed. 6  | 
|||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
java.lang.Objectjava.util.EventObject
javax.swing.event.TreeSelectionEvent
public class TreeSelectionEvent
描述当前选择中的更改的事件。该更改以任意数量的路径为基础。TreeSelectionListener 通常将查询事件源,以获得每个可能更改行的新选定状态。
警告:此类的序列化对象将与以后的 Swing 版本不兼容。当前的序列化支持适用于短期存储或运行相同 Swing 版本的应用程序之间的 RMI。从 1.4 版本开始,已在 java.beans 包中添加了支持所有 JavaBeansTM 长期存储的功能。请参见 XMLEncoder。
TreeSelectionListener,
TreeSelectionModel| 字段摘要 | |
|---|---|
protected  boolean[] | 
areNew
对于每条路径,标识该路径实际上是否为一条新路径。  | 
protected  TreePath | 
newLeadSelectionPath
在路径被更改之后的 leadSelectionPath,可能为 null。  | 
protected  TreePath | 
oldLeadSelectionPath
在路径被更改之前的 leadSelectionPath,可能为 null。  | 
protected  TreePath[] | 
paths
此事件表示的路径。  | 
| 从类 java.util.EventObject 继承的字段 | 
|---|
source | 
| 构造方法摘要 | |
|---|---|
TreeSelectionEvent(Object source,
TreePath[] paths,
boolean[] areNew,
TreePath oldLeadSelectionPath,
TreePath newLeadSelectionPath)
表示 TreeSelectionModel 选择中的更改。  | 
|
TreeSelectionEvent(Object source,
TreePath path,
boolean isNew,
TreePath oldLeadSelectionPath,
TreePath newLeadSelectionPath)
表示 TreeSelectionModel 选择中的更改。  | 
|
| 方法摘要 | |
|---|---|
 Object | 
cloneWithSource(Object newSource)
返回接收方的副本,但带有将成为 newSource 的源。  | 
 TreePath | 
getNewLeadSelectionPath()
返回当前前导路径。  | 
 TreePath | 
getOldLeadSelectionPath()
返回以前是前导路径的路径。  | 
 TreePath | 
getPath()
返回第一个路径元素。  | 
 TreePath[] | 
getPaths()
返回已经添加到该选择中或已从中移除的路径。  | 
 boolean | 
isAddedPath()
如果已经将第一个路径元素添加到选择中,则返回 true。  | 
 boolean | 
isAddedPath(int index)
如果由 index 标识的路径被添加到选择中,则返回 true。 | 
 boolean | 
isAddedPath(TreePath path)
如果 path 标识的路径被添加到选择中,则返回 true。  | 
| 从类 java.util.EventObject 继承的方法 | 
|---|
getSource, toString | 
| 从类 java.lang.Object 继承的方法 | 
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait | 
| 字段详细信息 | 
|---|
protected TreePath[] paths
protected boolean[] areNew
protected TreePath oldLeadSelectionPath
protected TreePath newLeadSelectionPath
| 构造方法详细信息 | 
|---|
public TreeSelectionEvent(Object source,
                          TreePath[] paths,
                          boolean[] areNew,
                          TreePath oldLeadSelectionPath,
                          TreePath newLeadSelectionPath)
source - 事件源paths - 在该选择中发生更改的路径
public TreeSelectionEvent(Object source,
                          TreePath path,
                          boolean isNew,
                          TreePath oldLeadSelectionPath,
                          TreePath newLeadSelectionPath)
source - 事件源path - 在该选择中发生更改的路径isNew - 某条路径对于该选择而言是否为新路径,false 表示路径从该选择中被移除。| 方法详细信息 | 
|---|
public TreePath[] getPaths()
public TreePath getPath()
public boolean isAddedPath()
public boolean isAddedPath(TreePath path)
public boolean isAddedPath(int index)
index 标识的路径被添加到选择中,则返回 true。返回 false 值意味着该路径过去在该选择中,但现在不再在该选择中。如果 index < 0 || >= getPaths.length,则此方法将被激活。
public TreePath getOldLeadSelectionPath()
public TreePath getNewLeadSelectionPath()
public Object cloneWithSource(Object newSource)
  | 
JavaTM 2 Platform Standard Ed. 6  | 
|||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
版权所有 2008 Sun Microsystems, Inc. 保留所有权利。请遵守GNU General Public License, version 2 only。