This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.


javax.swing.event
class TreeSelectionEvent

java.lang.Object extended by java.util.EventObject extended by javax.swing.event.TreeSelectionEvent
All Implemented Interfaces:
Serializable

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

          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

          Returns the first path element.
 TreePath[]

          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

          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

areNew

protected boolean[] areNew
For each path identifies if that path is in fact new.

newLeadSelectionPath

protected TreePath newLeadSelectionPath
leadSelectionPath after the paths changed, may be null.

oldLeadSelectionPath

protected TreePath oldLeadSelectionPath
leadSelectionPath before the paths changed, may be null.

paths

protected TreePath[] paths
Paths this event represents.
Constructor Detail

TreeSelectionEvent

public TreeSelectionEvent(Object source,
                          TreePath path,
                          boolean isNew,
                          TreePath oldLeadSelectionPath,
                          TreePath newLeadSelectionPath)
Represents a change in the selection of a TreeSelectionModel. path identifies the path that have been either added or removed from the selection.

Parameters:
source - source of event
path - the path that has changed in the selection
isNew - whether or not the path is new to the selection, false means path was removed from the selection.
oldLeadSelectionPath
newLeadSelectionPath

TreeSelectionEvent

public TreeSelectionEvent(Object source,
                          TreePath[] paths,
                          boolean[] areNew,
                          TreePath oldLeadSelectionPath,
                          TreePath newLeadSelectionPath)
Represents a change in the selection of a TreeSelectionModel. paths identifies the paths that have been either added or removed from the selection.

Parameters:
source - source of event
paths - the paths that have changed in the selection
areNew
oldLeadSelectionPath
newLeadSelectionPath
Method Detail

cloneWithSource

public Object cloneWithSource(Object newSource)
Returns a copy of the receiver, but with the source being newSource.

Parameters:
newSource

getNewLeadSelectionPath

public TreePath getNewLeadSelectionPath()
Returns the current lead path.


getOldLeadSelectionPath

public TreePath getOldLeadSelectionPath()
Returns the path that was previously the lead path.


getPath

public TreePath getPath()
Returns the first path element.


getPaths

public TreePath[] getPaths()
Returns the paths that have been added or removed from the selection.


isAddedPath

public boolean isAddedPath()
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.


isAddedPath

public boolean isAddedPath(int index)
Returns true if the path identified by 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.

Parameters:
index

isAddedPath

public boolean isAddedPath(TreePath path)
Returns true if the path identified by path 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 path is not one of the paths identified by this event.

Parameters:
path


This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.
This page displays the Jadeite version of the documention, which is derived from the offical documentation that contains this copyright notice:
Copyright 2008 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.
The official Sun™ documentation can be found here at http://java.sun.com/javase/6/docs/api/.