Overview | Package | Class | Tree | Deprecated | Index | Help |
Java Platform 1.1.7 |
||
PREV CLASS | NEXT CLASS | FRAMES | NO FRAMES | ||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.sun.java.swing.tree.DefaultTreeSelectionModel
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 Swing1.0 applications. It will not be possible to load serialized Swing1.0 objects with future releases of Swing. The JDK1.2 release of Swing will be the compatibility baseline for the serialized form of Swing objects.
Field Summary | |
java.beans.PropertyChangeSupport | changeSupport
Used to messaged registered listeners. |
int | leadIndex
Index of the lead path in selection. |
TreePath | leadPath
Last path that was added. |
int | leadRow
Lead row. |
EventListenerList | listenerList
Event listener list. |
DefaultListSelectionModel | listSelectionModel
Handles maintaining the list selection model. |
RowMapper | rowMapper
Provides a row for a given path. |
static java.lang.String | SELECTION_MODE_PROPERTY
Property name for selectionMode. |
TreePath[] | selection
Paths that are currently selected. |
int | selectionMode
Mode for the selection, will be either SINGLE_TREE_SELECTION, CONTIGUOUS_TREE_SELECTION or DISCONTIGUOUS_TREE_SELECTION. |
Constructor Summary | |
DefaultTreeSelectionModel()
|
Method Summary | |
void | addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Add a PropertyChangeListener to the listener list. |
void | addSelectionPath(TreePath path)
Adds path to the current selection. |
void | addSelectionPaths(TreePath[] paths)
Adds paths to the current selection. |
void | addTreeSelectionListener(TreeSelectionListener x)
Adds x to the list of listeners that are notified each time the selection changes. |
boolean | arePathsContiguous(TreePath[] paths)
Returns true if the paths are contiguous. |
boolean | canPathsBeAdded(TreePath[] paths)
Returns true if the paths can be added without breaking the continuity of the model. |
boolean | canPathsBeRemoved(TreePath[] paths)
Returns true if the paths can be removed without breaking the continuity of the model. |
void | clearSelection()
Empties the current selection. |
java.lang.Object | clone()
Returns a clone of the reciever with the same selection. selectionListeners, and PropertyListeners are not duplicated. |
void | fireValueChanged(TreeSelectionEvent e)
|
TreePath | getLeadSelectionPath()
Returns the last path that was added. |
int | getLeadSelectionRow()
Returns the lead selection index. |
int | getMaxSelectionRow()
Gets the last selected row. |
int | getMinSelectionRow()
Gets the first selected row. |
RowMapper | getRowMapper()
Returns the RowMapper instance that is able to map a path to a row. |
int | getSelectionCount()
Returns the number of paths that are selected. |
int | getSelectionMode()
Returns the selection mode. |
TreePath | getSelectionPath()
Returns the first path in the selection. |
TreePath[] | getSelectionPaths()
Returns the paths in the selection. |
int[] | getSelectionRows()
Returns all of the currently selected rows. |
void | insureRowContinuity()
Useful for CONTIGUOUS_TREE_SELECTION. If the rows that are selected are not contiguous then the selection is reset to be contiguous. |
void | insureUniqueness()
Insures that all the elements in path are unique. |
boolean | isPathSelected(TreePath path)
Returns true if the path, path, is in the current selection. |
boolean | isRowSelected(int row)
Returns true if the row identitifed by row is selected. |
boolean | isSelectionEmpty()
Returns true if the selection is currently empty. |
void | notifyPathChange(java.util.Vector changedPaths,
TreePath oldLeadSelection)
Notifies listeners of a change in path. changePaths should contain instances of PathPlaceHolder. |
void | removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Remove a PropertyChangeListener from the listener list. |
void | removeSelectionPath(TreePath path)
Removes path from the selection. |
void | removeSelectionPaths(TreePath[] paths)
Removes paths from the selection. |
void | removeTreeSelectionListener(TreeSelectionListener x)
Removes x from the list of listeners that are notified each time the selection changes. |
void | resetRowSelection()
Recalculates what rows are selected by asking the RowMapper for the row for each path. |
void | setRowMapper(RowMapper newMapper)
Sets the RowMapper instance. |
void | setSelectionMode(int mode)
Sets the selection model, which must be one of SINGLE_TREE_SELECTION, CONTIGUOUS_TREE_SELECTION or DISCONTIGUOUS_TREE_SELECTION. |
void | setSelectionPath(TreePath path)
Sets the selection to path. |
void | setSelectionPaths(TreePath[] pPaths)
Sets the selection to the paths in paths. |
java.lang.String | toString()
|
void | updateLeadIndex()
Updates the leadIndex instance variable. |
Methods inherited from class java.lang.Object | |
clone, equals, finalize, getClass, hashCode, notifyAll, notify, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String SELECTION_MODE_PROPERTY
protected java.beans.PropertyChangeSupport changeSupport
protected TreePath[] selection
protected EventListenerList listenerList
protected transient RowMapper rowMapper
protected DefaultListSelectionModel listSelectionModel
protected int selectionMode
protected TreePath leadPath
protected int leadIndex
protected int leadRow
Constructor Detail |
public DefaultTreeSelectionModel()
Method Detail |
public void setRowMapper(RowMapper newMapper)
public RowMapper getRowMapper()
public void setSelectionMode(int mode)
public int getSelectionMode()
public void setSelectionPath(TreePath path)
path
- new path to selectpublic void setSelectionPaths(TreePath[] pPaths)
paths
- new selection.public void addSelectionPath(TreePath path)
path
- the new path to add to the current selection.public void addSelectionPaths(TreePath[] paths)
path
- the new path to add to the current selection.public void removeSelectionPath(TreePath path)
path
- the path to remove from the selection.public void removeSelectionPaths(TreePath[] paths)
path
- the path to remove from the selection.public TreePath getSelectionPath()
public TreePath[] getSelectionPaths()
public int getSelectionCount()
public boolean isPathSelected(TreePath path)
public boolean isSelectionEmpty()
public void clearSelection()
public void addTreeSelectionListener(TreeSelectionListener x)
x
- the new listener to be added.public void removeTreeSelectionListener(TreeSelectionListener x)
x
- the listener to remove.protected void fireValueChanged(TreeSelectionEvent e)
public int[] getSelectionRows()
public int getMinSelectionRow()
public int getMaxSelectionRow()
public boolean isRowSelected(int row)
public void resetRowSelection()
public int getLeadSelectionRow()
public TreePath getLeadSelectionPath()
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
A PropertyChangeEvent will get fired in response to an explicit setFont, setBackground, or SetForeground on the current component. Note that if the current component is inheriting its foreground, background, or font from its container, then no event will be fired in response to a change in the inherited property.
listener
- The PropertyChangeListener to be addedpublic void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
listener
- The PropertyChangeListener to be removedprotected void insureRowContinuity()
protected boolean arePathsContiguous(TreePath[] paths)
protected boolean canPathsBeAdded(TreePath[] paths)
protected boolean canPathsBeRemoved(TreePath[] paths)
protected void notifyPathChange(java.util.Vector changedPaths, TreePath oldLeadSelection)
protected void updateLeadIndex()
protected void insureUniqueness()
public java.lang.String toString()
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
method.Overview | Package | Class | Tree | Deprecated | Index | Help |
Java Platform 1.1.7 |
||
PREV CLASS | NEXT CLASS | FRAMES | NO FRAMES | ||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |