javax.swing.event
Class TreeSelectionEvent

java.lang.Object
  |
  +--java.util.EventObject
        |
        +--javax.swing.event.TreeSelectionEvent
All Implemented Interfaces:
Serializable

public class TreeSelectionEvent
extends EventObject

Safe:

See Also:
Serialized Form

Field Summary
protected  boolean[] areNew
          For each path identifies if that is path is in fact new.
protected  javax.swing.tree.TreePath newLeadSelectionPath
          leadSelectionPath after the paths changed, may be null.
protected  javax.swing.tree.TreePath oldLeadSelectionPath
          leadSelectionPath before the paths changed, may be null.
protected  javax.swing.tree.TreePath[] paths
          Paths this event represents.
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
TreeSelectionEvent(Object source, javax.swing.tree.TreePath[] paths, boolean[] areNew, javax.swing.tree.TreePath oldLeadSelectionPath, javax.swing.tree.TreePath newLeadSelectionPath)
          Suppressed: Represents a change in the selection of a TreeSelectionModel.
TreeSelectionEvent(Object source, javax.swing.tree.TreePath path, boolean isNew, javax.swing.tree.TreePath oldLeadSelectionPath, javax.swing.tree.TreePath newLeadSelectionPath)
          Suppressed: Represents a change in the selection of a TreeSelectionModel.
 
Method Summary
 Object cloneWithSource(Object newSource)
          Suppressed: Returns a copy of the receiver, but with the source being newSource.
 javax.swing.tree.TreePath getNewLeadSelectionPath()
          Enabled: Returns the current lead path.
 javax.swing.tree.TreePath getOldLeadSelectionPath()
          Enabled: Returns the path that was previously the lead path.
 javax.swing.tree.TreePath getPath()
          Enabled: Returns the first path element.
 javax.swing.tree.TreePath[] getPaths()
          Enabled: Returns the paths that have been added or removed from the selection.
 boolean isAddedPath()
          Enabled: 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)
          Enabled: Returns true if the path identified by index was added to the selection.
 boolean isAddedPath(javax.swing.tree.TreePath path)
          Enabled: 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, wait, wait, wait
 

Field Detail

paths

protected javax.swing.tree.TreePath[] paths
Paths this event represents.


areNew

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


oldLeadSelectionPath

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


newLeadSelectionPath

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

Constructor Detail

TreeSelectionEvent

public TreeSelectionEvent(Object source,
                          javax.swing.tree.TreePath[] paths,
                          boolean[] areNew,
                          javax.swing.tree.TreePath oldLeadSelectionPath,
                          javax.swing.tree.TreePath newLeadSelectionPath)
Suppressed: 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

TreeSelectionEvent

public TreeSelectionEvent(Object source,
                          javax.swing.tree.TreePath path,
                          boolean isNew,
                          javax.swing.tree.TreePath oldLeadSelectionPath,
                          javax.swing.tree.TreePath newLeadSelectionPath)
Suppressed: 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 Detail

getPaths

public javax.swing.tree.TreePath[] getPaths()
Enabled: Returns the paths that have been added or removed from the selection.


getPath

public javax.swing.tree.TreePath getPath()
Enabled: Returns the first path element.


isAddedPath

public boolean isAddedPath()
Enabled: 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(javax.swing.tree.TreePath path)
Enabled: 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.


isAddedPath

public boolean isAddedPath(int index)
Enabled: 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.

Since:
1.3

getOldLeadSelectionPath

public javax.swing.tree.TreePath getOldLeadSelectionPath()
Enabled: Returns the path that was previously the lead path.


getNewLeadSelectionPath

public javax.swing.tree.TreePath getNewLeadSelectionPath()
Enabled: Returns the current lead path.


cloneWithSource

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



comments?