qflib 0.98.0

de.qfs.lib.gui
Class LevelTreeSelectionModel

java.lang.Object
  |
  +--javax.swing.tree.DefaultTreeSelectionModel
        |
        +--de.qfs.lib.gui.LevelTreeSelectionModel
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable, javax.swing.tree.TreeSelectionModel

public class LevelTreeSelectionModel
extends javax.swing.tree.DefaultTreeSelectionModel

This class enables the selection of multiple nodes of a JTree, as long as the nodes are siblings.

Version:
$Revision: 1.7 $
Author:
Gregor Schmid
See Also:
Serialized Form

Fields inherited from class javax.swing.tree.DefaultTreeSelectionModel
changeSupport, leadIndex, leadPath, leadRow, listenerList, listSelectionModel, rowMapper, selection, SELECTION_MODE_PROPERTY, selectionMode
 
Fields inherited from interface javax.swing.tree.TreeSelectionModel
CONTIGUOUS_TREE_SELECTION, DISCONTIGUOUS_TREE_SELECTION, SINGLE_TREE_SELECTION
 
Constructor Summary
LevelTreeSelectionModel()
          Create a new LevelTreeSelectionModel.
 
Method Summary
 void addSelectionPath(javax.swing.tree.TreePath path)
          Add a path to the selection.
 void addSelectionPaths(javax.swing.tree.TreePath[] paths)
          Add some paths to the selection.
protected  boolean canPathsBeAdded(javax.swing.tree.TreePath[] paths)
          Decide wheter some paths can be added to the selection.
protected  boolean canPathsBeRemoved(javax.swing.tree.TreePath[] paths)
          Paths can always be removed.
 void setSelectionPaths(javax.swing.tree.TreePath[] paths)
          Set the paths of the selection.
 
Methods inherited from class javax.swing.tree.DefaultTreeSelectionModel
addPropertyChangeListener, addTreeSelectionListener, arePathsContiguous, clearSelection, clone, fireValueChanged, getLeadSelectionPath, getLeadSelectionRow, getListeners, getMaxSelectionRow, getMinSelectionRow, getRowMapper, getSelectionCount, getSelectionMode, getSelectionPath, getSelectionPaths, getSelectionRows, insureRowContinuity, insureUniqueness, isPathSelected, isRowSelected, isSelectionEmpty, notifyPathChange, removePropertyChangeListener, removeSelectionPath, removeSelectionPaths, removeTreeSelectionListener, resetRowSelection, setRowMapper, setSelectionMode, setSelectionPath, toString, updateLeadIndex
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LevelTreeSelectionModel

public LevelTreeSelectionModel()
Create a new LevelTreeSelectionModel.
Method Detail

canPathsBeAdded

protected boolean canPathsBeAdded(javax.swing.tree.TreePath[] paths)
Decide wheter some paths can be added to the selection.
Overrides:
canPathsBeAdded in class javax.swing.tree.DefaultTreeSelectionModel
Parameters:
paths - The paths to add.
Returns:
True if the paths can be added.

canPathsBeRemoved

protected boolean canPathsBeRemoved(javax.swing.tree.TreePath[] paths)
Paths can always be removed.
Overrides:
canPathsBeRemoved in class javax.swing.tree.DefaultTreeSelectionModel
Parameters:
paths - The paths to remove.
Returns:
Always true.

addSelectionPath

public void addSelectionPath(javax.swing.tree.TreePath path)
Add a path to the selection.
Overrides:
addSelectionPath in class javax.swing.tree.DefaultTreeSelectionModel
Parameters:
path - The path to add.

addSelectionPaths

public void addSelectionPaths(javax.swing.tree.TreePath[] paths)
Add some paths to the selection.
Overrides:
addSelectionPaths in class javax.swing.tree.DefaultTreeSelectionModel
Parameters:
paths - The paths to add.

setSelectionPaths

public void setSelectionPaths(javax.swing.tree.TreePath[] paths)
Set the paths of the selection.
Overrides:
setSelectionPaths in class javax.swing.tree.DefaultTreeSelectionModel
Parameters:
paths - The paths to set.

qflib 0.98.0