|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectechopoint.tree.DefaultTreeSelectionModel
public class DefaultTreeSelectionModel
Implementation of TreeSelectionModel.
| Field Summary | |
|---|---|
protected java.beans.PropertyChangeSupport |
changeSupport
Used to messaged registered listeners. |
protected int |
leadIndex
Index of the lead path in selection. |
protected TreePath |
leadPath
Last path that was added. |
protected int |
leadRow
Lead row. |
protected EventListenerList |
listenerList
Event listener list. |
protected TreeListSelectionModel |
listSelectionModel
Handles maintaining the list selection model. |
protected RowMapper |
rowMapper
Provides a row for a given path. |
protected TreePath[] |
selection
Paths that are currently selected. |
static java.lang.String |
SELECTION_MODE_PROPERTY
Property name for selectionMode. |
protected int |
selectionMode
Mode for the selection, will be either SINGLE_TREE_SELECTION, CONTIGUOUS_TREE_SELECTION or DISCONTIGUOUS_TREE_SELECTION. |
| Fields inherited from interface echopoint.tree.TreeSelectionModel |
|---|
CONTIGUOUS_TREE_SELECTION, DISCONTIGUOUS_TREE_SELECTION, SINGLE_TREE_SELECTION |
| Constructor Summary | |
|---|---|
DefaultTreeSelectionModel()
Creates a new instance of DefaultTreeSelectionModel that is empty, and having a selection mode of DISCONTIGUOUS_TREE_SELECTION. |
|
| 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. |
protected boolean |
arePathsContiguous(TreePath[] paths)
Returns true if the paths are contiguous. |
protected boolean |
canPathsBeAdded(TreePath[] paths)
Returns true if the paths can be added without breaking the continuity of the model. |
protected 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. |
protected 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. |
protected void |
insureRowContinuity()
Useful for CONTIGUOUS_TREE_SELECTION. |
protected 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. |
protected void |
notifyPathChange(java.util.Vector changedPaths,
TreePath oldLeadSelection)
Notifies listeners of a change in path. changePaths should contain instances of TreeSpot. |
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_NONE, 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()
Returns a string that displays and identifies this object's properties. |
protected void |
updateLeadIndex()
Updates the leadIndex instance variable. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String SELECTION_MODE_PROPERTY
protected java.beans.PropertyChangeSupport changeSupport
protected int leadIndex
protected TreePath leadPath
protected int leadRow
protected EventListenerList listenerList
protected TreeListSelectionModel listSelectionModel
protected transient RowMapper rowMapper
protected TreePath[] selection
protected int selectionMode
| Constructor Detail |
|---|
public DefaultTreeSelectionModel()
| Method Detail |
|---|
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
addPropertyChangeListener in interface TreeSelectionModellistener - The PropertyChangeListener to be addedpublic void addSelectionPath(TreePath path)
addSelectionPath in interface TreeSelectionModelpath - the new path to add to the current selection.public void addSelectionPaths(TreePath[] paths)
addSelectionPaths in interface TreeSelectionModelpaths - the new paths to add to the current selection.public void addTreeSelectionListener(TreeSelectionListener x)
addTreeSelectionListener in interface TreeSelectionModelx - the new listener to be added.protected boolean arePathsContiguous(TreePath[] paths)
protected boolean canPathsBeAdded(TreePath[] paths)
protected boolean canPathsBeRemoved(TreePath[] paths)
public void clearSelection()
clearSelection in interface TreeSelectionModelprotected void fireValueChanged(TreeSelectionEvent e)
public TreePath getLeadSelectionPath()
getLeadSelectionPath in interface TreeSelectionModelpublic int getLeadSelectionRow()
public int getMaxSelectionRow()
public int getMinSelectionRow()
public RowMapper getRowMapper()
public int getSelectionCount()
getSelectionCount in interface TreeSelectionModelpublic int getSelectionMode()
getSelectionMode in interface TreeSelectionModelpublic TreePath getSelectionPath()
getSelectionPath in interface TreeSelectionModelpublic TreePath[] getSelectionPaths()
getSelectionPaths in interface TreeSelectionModelpublic int[] getSelectionRows()
protected void insureRowContinuity()
protected void insureUniqueness()
public boolean isPathSelected(TreePath path)
isPathSelected in interface TreeSelectionModelpublic boolean isRowSelected(int row)
public boolean isSelectionEmpty()
isSelectionEmpty in interface TreeSelectionModel
protected void notifyPathChange(java.util.Vector changedPaths,
TreePath oldLeadSelection)
public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
removePropertyChangeListener in interface TreeSelectionModellistener - The PropertyChangeListener to be removedpublic void removeSelectionPath(TreePath path)
removeSelectionPath in interface TreeSelectionModelpath - the path to remove from the selection.public void removeSelectionPaths(TreePath[] paths)
removeSelectionPaths in interface TreeSelectionModelpaths - the paths to remove from the selection.public void removeTreeSelectionListener(TreeSelectionListener x)
removeTreeSelectionListener in interface TreeSelectionModelx - the listener to remove.public void resetRowSelection()
public void setRowMapper(RowMapper newMapper)
public void setSelectionMode(int mode)
setSelectionMode in interface TreeSelectionModelpublic void setSelectionPath(TreePath path)
setSelectionPath in interface TreeSelectionModelpath - new path to selectpublic void setSelectionPaths(TreePath[] pPaths)
setSelectionPaths in interface TreeSelectionModelpPaths - new selection.public java.lang.String toString()
toString in class java.lang.Objectprotected void updateLeadIndex()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||