Package org.opensourcephysics.tools
Class CheckTreeSelectionModel
java.lang.Object
javax.swing.tree.DefaultTreeSelectionModel
org.opensourcephysics.tools.CheckTreeSelectionModel
- All Implemented Interfaces:
Serializable
,Cloneable
,TreeSelectionModel
A checkbox tree selection model.
- Author:
- Doug Brown Based on code by Santhosh Kumar T - santhosh@in.fiorano.com See http://www.jroller.com/page/santhosh/20050610
- See Also:
-
Field Summary
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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a PropertyChangeListener.void
addSelectionPaths
(TreePath[] paths) Adds paths to the current selectionboolean
Returns true if the path or any ancestor is selected.boolean
isPathUnselected
(TreePath path) Returns true if neither the path nor any descendant is selected.void
Removes a PropertyChangeListener.void
removeSelectionPaths
(TreePath[] paths) Removes paths from the current selectionvoid
setSelectionPaths
(TreePath[] paths) Methods inherited from class javax.swing.tree.DefaultTreeSelectionModel
addSelectionPath, addTreeSelectionListener, arePathsContiguous, canPathsBeAdded, canPathsBeRemoved, clearSelection, clone, fireValueChanged, getLeadSelectionPath, getLeadSelectionRow, getListeners, getMaxSelectionRow, getMinSelectionRow, getPropertyChangeListeners, getRowMapper, getSelectionCount, getSelectionMode, getSelectionPath, getSelectionPaths, getSelectionRows, getTreeSelectionListeners, insureRowContinuity, insureUniqueness, isPathSelected, isRowSelected, isSelectionEmpty, notifyPathChange, removeSelectionPath, removeTreeSelectionListener, resetRowSelection, setRowMapper, setSelectionMode, setSelectionPath, toString, updateLeadIndex
-
Constructor Details
-
CheckTreeSelectionModel
Constructor.- Parameters:
model
- a TreeModel
-
-
Method Details
-
isPathUnselected
Returns true if neither the path nor any descendant is selected.- Parameters:
path
- the path to test
-
isPathOrAncestorSelected
Returns true if the path or any ancestor is selected.- Parameters:
path
- the path to test
-
setSelectionPaths
- Specified by:
setSelectionPaths
in interfaceTreeSelectionModel
- Overrides:
setSelectionPaths
in classDefaultTreeSelectionModel
-
addSelectionPaths
Adds paths to the current selection- Specified by:
addSelectionPaths
in interfaceTreeSelectionModel
- Overrides:
addSelectionPaths
in classDefaultTreeSelectionModel
- Parameters:
paths
- the paths to add
-
removeSelectionPaths
Removes paths from the current selection- Specified by:
removeSelectionPaths
in interfaceTreeSelectionModel
- Overrides:
removeSelectionPaths
in classDefaultTreeSelectionModel
- Parameters:
paths
- the paths to remove
-
addPropertyChangeListener
Adds a PropertyChangeListener.- Specified by:
addPropertyChangeListener
in interfaceTreeSelectionModel
- Overrides:
addPropertyChangeListener
in classDefaultTreeSelectionModel
- Parameters:
listener
- the object requesting property change notification
-
removePropertyChangeListener
Removes a PropertyChangeListener.- Specified by:
removePropertyChangeListener
in interfaceTreeSelectionModel
- Overrides:
removePropertyChangeListener
in classDefaultTreeSelectionModel
- Parameters:
listener
- the listener requesting removal
-