DefaultTreeSelectionModel (Java Platform SE 8 ) (original) (raw)
Modifier and Type
Method
Description
void
[addPropertyChangeListener](../../../javax/swing/tree/DefaultTreeSelectionModel.html#addPropertyChangeListener-java.beans.PropertyChangeListener-)([PropertyChangeListener](../../../java/beans/PropertyChangeListener.html "interface in java.beans") listener)
Adds a PropertyChangeListener to the listener list.
void
[addSelectionPath](../../../javax/swing/tree/DefaultTreeSelectionModel.html#addSelectionPath-javax.swing.tree.TreePath-)([TreePath](../../../javax/swing/tree/TreePath.html "class in javax.swing.tree") path)
Adds path to the current selection.
void
[addSelectionPaths](../../../javax/swing/tree/DefaultTreeSelectionModel.html#addSelectionPaths-javax.swing.tree.TreePath:A-)([TreePath](../../../javax/swing/tree/TreePath.html "class in javax.swing.tree")[] paths)
Adds paths to the current selection.
void
[addTreeSelectionListener](../../../javax/swing/tree/DefaultTreeSelectionModel.html#addTreeSelectionListener-javax.swing.event.TreeSelectionListener-)([TreeSelectionListener](../../../javax/swing/event/TreeSelectionListener.html "interface in javax.swing.event") x)
Adds x to the list of listeners that are notified each time the set of selected TreePaths changes.
protected boolean
[arePathsContiguous](../../../javax/swing/tree/DefaultTreeSelectionModel.html#arePathsContiguous-javax.swing.tree.TreePath:A-)([TreePath](../../../javax/swing/tree/TreePath.html "class in javax.swing.tree")[] paths)
Returns true if the paths are contiguous, or this object has no RowMapper.
protected boolean
[canPathsBeAdded](../../../javax/swing/tree/DefaultTreeSelectionModel.html#canPathsBeAdded-javax.swing.tree.TreePath:A-)([TreePath](../../../javax/swing/tree/TreePath.html "class in javax.swing.tree")[] paths)
Used to test if a particular set of TreePath
s can be added.
protected boolean
[canPathsBeRemoved](../../../javax/swing/tree/DefaultTreeSelectionModel.html#canPathsBeRemoved-javax.swing.tree.TreePath:A-)([TreePath](../../../javax/swing/tree/TreePath.html "class in javax.swing.tree")[] paths)
Returns true if the paths can be removed without breaking the continuity of the model.
void
[clearSelection](../../../javax/swing/tree/DefaultTreeSelectionModel.html#clearSelection--)()
Empties the current selection.
[Object](../../../java/lang/Object.html "class in java.lang")
[clone](../../../javax/swing/tree/DefaultTreeSelectionModel.html#clone--)()
Returns a clone of this object with the same selection.
protected void
[fireValueChanged](../../../javax/swing/tree/DefaultTreeSelectionModel.html#fireValueChanged-javax.swing.event.TreeSelectionEvent-)([TreeSelectionEvent](../../../javax/swing/event/TreeSelectionEvent.html "class in javax.swing.event") e)
Notifies all listeners that are registered for tree selection events on this object.
[TreePath](../../../javax/swing/tree/TreePath.html "class in javax.swing.tree")
[getLeadSelectionPath](../../../javax/swing/tree/DefaultTreeSelectionModel.html#getLeadSelectionPath--)()
Returns the last path that was added.
int
[getLeadSelectionRow](../../../javax/swing/tree/DefaultTreeSelectionModel.html#getLeadSelectionRow--)()
Returns the lead selection index.
<T extends [EventListener](../../../java/util/EventListener.html "interface in java.util")> T[]
[getListeners](../../../javax/swing/tree/DefaultTreeSelectionModel.html#getListeners-java.lang.Class-)([Class](../../../java/lang/Class.html "class in java.lang")<T> listenerType)
Returns an array of all the objects currently registered as _Foo_Listener
s upon this model.
int
[getMaxSelectionRow](../../../javax/swing/tree/DefaultTreeSelectionModel.html#getMaxSelectionRow--)()
Returns the largest value obtained from the RowMapper for the current set of selected TreePaths.
int
[getMinSelectionRow](../../../javax/swing/tree/DefaultTreeSelectionModel.html#getMinSelectionRow--)()
Returns the smallest value obtained from the RowMapper for the current set of selected TreePaths.
[PropertyChangeListener](../../../java/beans/PropertyChangeListener.html "interface in java.beans")[]
[getPropertyChangeListeners](../../../javax/swing/tree/DefaultTreeSelectionModel.html#getPropertyChangeListeners--)()
Returns an array of all the property change listeners registered on this DefaultTreeSelectionModel
.
[RowMapper](../../../javax/swing/tree/RowMapper.html "interface in javax.swing.tree")
[getRowMapper](../../../javax/swing/tree/DefaultTreeSelectionModel.html#getRowMapper--)()
Returns the RowMapper instance that is able to map a TreePath to a row.
int
[getSelectionCount](../../../javax/swing/tree/DefaultTreeSelectionModel.html#getSelectionCount--)()
Returns the number of paths that are selected.
int
[getSelectionMode](../../../javax/swing/tree/DefaultTreeSelectionModel.html#getSelectionMode--)()
Returns the selection mode, one of SINGLE_TREE_SELECTION
,DISCONTIGUOUS_TREE_SELECTION
orCONTIGUOUS_TREE_SELECTION
.
[TreePath](../../../javax/swing/tree/TreePath.html "class in javax.swing.tree")
[getSelectionPath](../../../javax/swing/tree/DefaultTreeSelectionModel.html#getSelectionPath--)()
Returns the first path in the selection.
[TreePath](../../../javax/swing/tree/TreePath.html "class in javax.swing.tree")[]
[getSelectionPaths](../../../javax/swing/tree/DefaultTreeSelectionModel.html#getSelectionPaths--)()
Returns the selection.
int[]
[getSelectionRows](../../../javax/swing/tree/DefaultTreeSelectionModel.html#getSelectionRows--)()
Returns the selection in terms of rows.
[TreeSelectionListener](../../../javax/swing/event/TreeSelectionListener.html "interface in javax.swing.event")[]
[getTreeSelectionListeners](../../../javax/swing/tree/DefaultTreeSelectionModel.html#getTreeSelectionListeners--)()
Returns an array of all the tree selection listeners registered on this model.
protected void
[insureRowContinuity](../../../javax/swing/tree/DefaultTreeSelectionModel.html#insureRowContinuity--)()
Makes sure the currently selected TreePath
s are valid for the current selection mode.
protected void
[insureUniqueness](../../../javax/swing/tree/DefaultTreeSelectionModel.html#insureUniqueness--)()
This method is obsolete and its implementation is now a noop.
boolean
[isPathSelected](../../../javax/swing/tree/DefaultTreeSelectionModel.html#isPathSelected-javax.swing.tree.TreePath-)([TreePath](../../../javax/swing/tree/TreePath.html "class in javax.swing.tree") path)
Returns true if the path, path
, is in the current selection.
boolean
[isRowSelected](../../../javax/swing/tree/DefaultTreeSelectionModel.html#isRowSelected-int-)(int row)
Returns true if the row identified by row
is selected.
boolean
[isSelectionEmpty](../../../javax/swing/tree/DefaultTreeSelectionModel.html#isSelectionEmpty--)()
Returns true if the selection is currently empty.
protected void
[notifyPathChange](../../../javax/swing/tree/DefaultTreeSelectionModel.html#notifyPathChange-java.util.Vector-javax.swing.tree.TreePath-)([Vector](../../../java/util/Vector.html "class in java.util")<?> changedPaths,[TreePath](../../../javax/swing/tree/TreePath.html "class in javax.swing.tree") oldLeadSelection)
Deprecated.
As of JDK version 1.7
void
[removePropertyChangeListener](../../../javax/swing/tree/DefaultTreeSelectionModel.html#removePropertyChangeListener-java.beans.PropertyChangeListener-)([PropertyChangeListener](../../../java/beans/PropertyChangeListener.html "interface in java.beans") listener)
Removes a PropertyChangeListener from the listener list.
void
[removeSelectionPath](../../../javax/swing/tree/DefaultTreeSelectionModel.html#removeSelectionPath-javax.swing.tree.TreePath-)([TreePath](../../../javax/swing/tree/TreePath.html "class in javax.swing.tree") path)
Removes path from the selection.
void
[removeSelectionPaths](../../../javax/swing/tree/DefaultTreeSelectionModel.html#removeSelectionPaths-javax.swing.tree.TreePath:A-)([TreePath](../../../javax/swing/tree/TreePath.html "class in javax.swing.tree")[] paths)
Removes paths from the selection.
void
[removeTreeSelectionListener](../../../javax/swing/tree/DefaultTreeSelectionModel.html#removeTreeSelectionListener-javax.swing.event.TreeSelectionListener-)([TreeSelectionListener](../../../javax/swing/event/TreeSelectionListener.html "interface in javax.swing.event") x)
Removes x from the list of listeners that are notified each time the set of selected TreePaths changes.
void
[resetRowSelection](../../../javax/swing/tree/DefaultTreeSelectionModel.html#resetRowSelection--)()
Updates this object's mapping from TreePath to rows.
void
[setRowMapper](../../../javax/swing/tree/DefaultTreeSelectionModel.html#setRowMapper-javax.swing.tree.RowMapper-)([RowMapper](../../../javax/swing/tree/RowMapper.html "interface in javax.swing.tree") newMapper)
Sets the RowMapper instance.
void
[setSelectionMode](../../../javax/swing/tree/DefaultTreeSelectionModel.html#setSelectionMode-int-)(int mode)
Sets the selection model, which must be one of SINGLE_TREE_SELECTION, CONTIGUOUS_TREE_SELECTION or DISCONTIGUOUS_TREE_SELECTION.
void
[setSelectionPath](../../../javax/swing/tree/DefaultTreeSelectionModel.html#setSelectionPath-javax.swing.tree.TreePath-)([TreePath](../../../javax/swing/tree/TreePath.html "class in javax.swing.tree") path)
Sets the selection to path.
void
[setSelectionPaths](../../../javax/swing/tree/DefaultTreeSelectionModel.html#setSelectionPaths-javax.swing.tree.TreePath:A-)([TreePath](../../../javax/swing/tree/TreePath.html "class in javax.swing.tree")[] pPaths)
Sets the selection.
[String](../../../java/lang/String.html "class in java.lang")
[toString](../../../javax/swing/tree/DefaultTreeSelectionModel.html#toString--)()
Returns a string that displays and identifies this object's properties.
protected void
[updateLeadIndex](../../../javax/swing/tree/DefaultTreeSelectionModel.html#updateLeadIndex--)()
Updates the leadIndex instance variable.