Home » openjdk-7 » javax » swing » event » [javadoc | source]
javax.swing.event
public class: TreeSelectionEvent [javadoc | source]
java.lang.Object
   java.util.EventObject
      javax.swing.event.TreeSelectionEvent
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 java.beans.XMLEncoder .

Field Summary
protected  TreePath[] paths    Paths this event represents. 
protected  boolean[] areNew    For each path identifies if that path is in fact new. 
protected  TreePath oldLeadSelectionPath    leadSelectionPath before the paths changed, may be null. 
protected  TreePath newLeadSelectionPath    leadSelectionPath after the paths changed, may be null. 
Constructor:
 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
 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.
Method from javax.swing.event.TreeSelectionEvent Summary:
cloneWithSource,   getNewLeadSelectionPath,   getOldLeadSelectionPath,   getPath,   getPaths,   isAddedPath,   isAddedPath,   isAddedPath
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from javax.swing.event.TreeSelectionEvent Detail:
 public Object cloneWithSource(Object newSource) 
    Returns a copy of the receiver, but with the source being newSource.
 public TreePath getNewLeadSelectionPath() 
    Returns the current lead path.
 public TreePath getOldLeadSelectionPath() 
    Returns the path that was previously the lead path.
 public TreePath getPath() 
    Returns the first path element.
 public TreePath[] getPaths() 
    Returns the paths that have been added or removed from the selection.
 public boolean isAddedPath() 
    Returns whether the path identified by {@code getPath} was added to the selection. A return value of {@code true} indicates the path identified by {@code getPath} was added to the selection. A return value of {@code false} indicates {@code getPath} was selected, but is no longer selected.
 public boolean isAddedPath(TreePath path) 
    Returns whether the specified path was added to the selection. A return value of {@code true} indicates the path identified by {@code path} was added to the selection. A return value of {@code false} indicates {@code path} is no longer selected. This method is only valid for the paths returned from {@code getPaths()}; invoking with a path not included in {@code getPaths()} throws an {@code IllegalArgumentException}.
 public boolean isAddedPath(int index) 
    Returns whether the path at {@code getPaths()[index]} was added to the selection. A return value of {@code true} indicates the path was added to the selection. A return value of {@code false} indicates the path is no longer selected.