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, toString
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 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.