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, selectionModeFields inherited from interface javax.swing.tree.TreeSelectionModel
CONTIGUOUS_TREE_SELECTION, DISCONTIGUOUS_TREE_SELECTION, SINGLE_TREE_SELECTION -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a PropertyChangeListener.voidaddSelectionPaths(TreePath[] paths) Adds paths to the current selectionbooleanReturns true if the path or any ancestor is selected.booleanisPathUnselected(TreePath path) Returns true if neither the path nor any descendant is selected.voidRemoves a PropertyChangeListener.voidremoveSelectionPaths(TreePath[] paths) Removes paths from the current selectionvoidsetSelectionPaths(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:
setSelectionPathsin interfaceTreeSelectionModel- Overrides:
setSelectionPathsin classDefaultTreeSelectionModel
-
addSelectionPaths
Adds paths to the current selection- Specified by:
addSelectionPathsin interfaceTreeSelectionModel- Overrides:
addSelectionPathsin classDefaultTreeSelectionModel- Parameters:
paths- the paths to add
-
removeSelectionPaths
Removes paths from the current selection- Specified by:
removeSelectionPathsin interfaceTreeSelectionModel- Overrides:
removeSelectionPathsin classDefaultTreeSelectionModel- Parameters:
paths- the paths to remove
-
addPropertyChangeListener
Adds a PropertyChangeListener.- Specified by:
addPropertyChangeListenerin interfaceTreeSelectionModel- Overrides:
addPropertyChangeListenerin classDefaultTreeSelectionModel- Parameters:
listener- the object requesting property change notification
-
removePropertyChangeListener
Removes a PropertyChangeListener.- Specified by:
removePropertyChangeListenerin interfaceTreeSelectionModel- Overrides:
removePropertyChangeListenerin classDefaultTreeSelectionModel- Parameters:
listener- the listener requesting removal
-