| |
|
| java.lang.Object java.util.EventObject javax.swing.event.TreeSelectionEvent
TreeSelectionEvent | public class TreeSelectionEvent extends EventObject (Code) | | 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 .
See Also: TreeSelectionListener See Also: javax.swing.tree.TreeSelectionModel version: 1.35 05/05/07 author: Scott Violet |
Method Summary | |
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
getPath was
added to the selection. | public boolean | isAddedPath(TreePath path) Returns whether the specified path was added to the selection.
A return value of
true indicates the path identified by
path was added to the selection. | public boolean | isAddedPath(int index) Returns whether the path at
getPaths()[index] was added
to the selection. |
areNew | protected boolean[] areNew(Code) | | For each path identifies if that path is in fact new.
|
newLeadSelectionPath | protected TreePath newLeadSelectionPath(Code) | | leadSelectionPath after the paths changed, may be null.
|
oldLeadSelectionPath | protected TreePath oldLeadSelectionPath(Code) | | leadSelectionPath before the paths changed, may be null.
|
TreeSelectionEvent | public TreeSelectionEvent(Object source, TreePath[] paths, boolean[] areNew, TreePath oldLeadSelectionPath, TreePath newLeadSelectionPath)(Code) | | 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 Parameters: paths - the paths that have changed in the selection |
TreeSelectionEvent | public TreeSelectionEvent(Object source, TreePath path, boolean isNew, TreePath oldLeadSelectionPath, TreePath newLeadSelectionPath)(Code) | | 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 Parameters: path - the path that has changed in the selection Parameters: isNew - whether or not the path is new to the selection, falsemeans path was removed from the selection. |
cloneWithSource | public Object cloneWithSource(Object newSource)(Code) | | Returns a copy of the receiver, but with the source being newSource.
|
getNewLeadSelectionPath | public TreePath getNewLeadSelectionPath()(Code) | | Returns the current lead path.
|
getOldLeadSelectionPath | public TreePath getOldLeadSelectionPath()(Code) | | Returns the path that was previously the lead path.
|
getPath | public TreePath getPath()(Code) | | Returns the first path element.
|
getPaths | public TreePath[] getPaths()(Code) | | Returns the paths that have been added or removed from the
selection.
|
isAddedPath | public boolean isAddedPath()(Code) | | Returns whether the path identified by
getPath was
added to the selection. A return value of
true indicates the path identified by
getPath was added to
the selection. A return value of
false indicates
getPath was selected, but is no longer selected.
true if getPath was added to the selection, false otherwise |
isAddedPath | public boolean isAddedPath(TreePath path)(Code) | | Returns whether the specified path was added to the selection.
A return value of
true indicates the path identified by
path was added to the selection. A return value of
false indicates
path is no longer selected. This method
is only valid for the paths returned from
getPaths() ; invoking
with a path not included in
getPaths() throws an
IllegalArgumentException .
Parameters: path - the path to test true if path was added to the selection, false otherwise throws: IllegalArgumentException - if path is not containedin getPaths See Also: TreeSelectionEvent.getPaths |
isAddedPath | public boolean isAddedPath(int index)(Code) | | Returns whether the path at
getPaths()[index] was added
to the selection. A return value of
true indicates the
path was added to the selection. A return value of
false indicates the path is no longer selected.
Parameters: index - the index of the path to test true if the path was added to the selection, false otherwise throws: IllegalArgumentException - if index is outside the range of getPaths See Also: TreeSelectionEvent.getPaths since: 1.3 |
|
|
|