| Method from javax.swing.event.TreeSelectionEvent Detail: |
public Object cloneWithSource(Object newSource) {
// Fix for IE bug - crashing
return new TreeSelectionEvent(newSource, paths,areNew,
oldLeadSelectionPath,
newLeadSelectionPath);
}
Returns a copy of the receiver, but with the source being newSource. |
public TreePath getNewLeadSelectionPath() {
return newLeadSelectionPath;
}
Returns the current lead path. |
public TreePath getOldLeadSelectionPath() {
return oldLeadSelectionPath;
}
Returns the path that was previously the lead path. |
public TreePath getPath() {
return paths[0];
}
Returns the first path element. |
public TreePath[] getPaths() {
int numPaths;
TreePath[] retPaths;
numPaths = paths.length;
retPaths = new TreePath[numPaths];
System.arraycopy(paths, 0, retPaths, 0, numPaths);
return retPaths;
}
Returns the paths that have been added or removed from the
selection. |
public boolean isAddedPath() {
return areNew[0];
}
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) {
for(int counter = paths.length - 1; counter >= 0; counter--)
if(paths[counter].equals(path))
return areNew[counter];
throw new IllegalArgumentException("path is not a path identified by the TreeSelectionEvent");
}
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) {
if (paths == null || index < 0 || index >= paths.length) {
throw new IllegalArgumentException("index is beyond range of added paths identified by TreeSelectionEvent");
}
return areNew[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. |