| |||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public class TreeSelectionEvent extends EventObject
An event that characterizes a change in the current selection. The change is based on any number of paths. TreeSelectionListeners will generally query the source of the event for the new selected status of each potentially changed row.
Warning:
Serialized objects of this class will not be compatible with
future Swing releases. The current serialization support is
appropriate for short term storage or RMI between applications running
the same version of Swing. As of 1.4, support for long term storage
of all JavaBeansTM
has been added to the java.beans
package.
Please see {@link java.beans.XMLEncoder}.
Field Summary | |
---|---|
protected boolean[] |
areNew
For each path identifies if that path is in fact new. |
protected TreePath |
newLeadSelectionPath
leadSelectionPath after the paths changed, may be null. |
protected TreePath |
oldLeadSelectionPath
leadSelectionPath before the paths changed, may be null. |
protected TreePath[] |
paths
Paths this event represents. |
Fields inherited from class java.util.EventObject |
---|
source |
Constructor Summary | |
---|---|
TreeSelectionEvent(Object source, TreePath path, boolean isNew, TreePath oldLeadSelectionPath, TreePath newLeadSelectionPath) Represents a change in the selection of a TreeSelectionModel. |
|
TreeSelectionEvent(Object source, TreePath[] paths, boolean[] areNew, TreePath oldLeadSelectionPath, TreePath newLeadSelectionPath) Represents a change in the selection of a TreeSelectionModel. |
Method Summary | |
---|---|
Object |
cloneWithSource(Object newSource) Returns a copy of the receiver, but with the source being newSource. |
TreePath |
Returns the current lead path. |
TreePath |
Returns the path that was previously the lead path. |
TreePath |
getPath() Returns the first path element. |
TreePath[] |
getPaths() Returns the paths that have been added or removed from the selection. |
boolean |
Returns true if the first path element has been added to the selection, a return value of false means the first path has been removed from the selection. |
boolean |
isAddedPath(int index) Returns true if the path identified by index was added to
the selection.
|
boolean |
isAddedPath(TreePath path) Returns true if the path identified by path was added to the selection. |
Methods inherited from class java.util.EventObject |
---|
getSource, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected boolean[] areNew
protected TreePath newLeadSelectionPath
protected TreePath oldLeadSelectionPath
protected TreePath[] paths
Constructor Detail |
---|
public TreeSelectionEvent(Object source, TreePath path, boolean isNew, TreePath oldLeadSelectionPath, TreePath newLeadSelectionPath)
source
- source of eventpath
- the path that has changed in the selectionisNew
- whether or not the path is new to the selection, false
means path was removed from the selection.oldLeadSelectionPath
newLeadSelectionPath
public TreeSelectionEvent(Object source, TreePath[] paths, boolean[] areNew, TreePath oldLeadSelectionPath, TreePath newLeadSelectionPath)
source
- source of eventpaths
- the paths that have changed in the selectionareNew
oldLeadSelectionPath
newLeadSelectionPath
Method Detail |
---|
public Object cloneWithSource(Object newSource)
newSource
public TreePath getNewLeadSelectionPath()
public TreePath getOldLeadSelectionPath()
public TreePath getPath()
public TreePath[] getPaths()
public boolean isAddedPath()
public boolean isAddedPath(int index)
index
was added to
the selection. A return value of false means the path was in the
selection but is no longer in the selection. This will raise if
index < 0 || >= getPaths
.length.
index
public boolean isAddedPath(TreePath path)
path
| |||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |