public class TreeSelectionEvent extends EventObject
警告:序列化该类的对象与以后的Swing版本不兼容。当前的序列化支持适用于短期贮藏或RMI运行相同Swing版本的应用程序之间。为1.4,为所有JavaBeans™长期存储的支持已被添加到java.beans包。请看XMLEncoder。
| Modifier and Type | Field and Description |
|---|---|
protected boolean[] |
areNew
对于每个路径标识,如果该路径实际上是新的。
|
protected TreePath |
newLeadSelectionPath
后leadselectionpath路径改变,可能是空的。
|
protected TreePath |
oldLeadSelectionPath
在leadselectionpath路径改变,可能是空的。
|
protected TreePath[] |
paths
此事件表示的路径。
|
source| Constructor and Description |
|---|
TreeSelectionEvent(Object source, TreePath[] paths, boolean[] areNew, TreePath oldLeadSelectionPath, TreePath newLeadSelectionPath)
代表一个treeselectionmodel选择改变。
|
TreeSelectionEvent(Object source, TreePath path, boolean isNew, TreePath oldLeadSelectionPath, TreePath newLeadSelectionPath)
代表一个treeselectionmodel选择改变。
|
| Modifier and Type | Method and Description |
|---|---|
Object |
cloneWithSource(Object newSource)
返回一个接收器,但与源新源。
|
TreePath |
getNewLeadSelectionPath()
返回当前的引导路径。
|
TreePath |
getOldLeadSelectionPath()
返回先前引导路径的路径。
|
TreePath |
getPath()
返回第一个路径元素。
|
TreePath[] |
getPaths()
返回已添加或从选择中删除的路径。
|
boolean |
isAddedPath()
返回路径是否被
getPath添加到选择。
|
boolean |
isAddedPath(int index)
返回是否在
getPaths()[index]路径添加到选择。
|
boolean |
isAddedPath(TreePath path)
返回指定路径是否被添加到选择中。
|
getSource, toStringprotected 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 TreePath[] getPaths()
public TreePath getPath()
public boolean isAddedPath()
getPath添加到选择。一个
true返回值指示路径确定的
getPath添加到选择。一个
false返回值指示选择
getPath,但不再是选择。
true如果
getPath添加到选择,
false否则
public boolean isAddedPath(TreePath path)
true返回值指示路径确定的
path添加到选择。一个
false返回值指示
path不再选择。这种方法是唯一有效的路径返回
getPaths();调用路径不包含在
getPaths()抛出一个
IllegalArgumentException。
path -路径的测试
true如果
path添加到选择,
false否则
IllegalArgumentException -如果
path不包含在
getPaths
getPaths()
public boolean isAddedPath(int index)
getPaths()[index]路径添加到选择。一个
true返回值指示路径添加到选择。一个
false返回值指示路径不再选择。
index -路径的测试指标
true如果路径添加到选择,
false否则
IllegalArgumentException如果索引是在
getPaths范围
getPaths()
public TreePath getOldLeadSelectionPath()
public TreePath getNewLeadSelectionPath()
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.