Package com.jidesoft.swing
Class LegacyCheckBoxTreeSelectionModel
java.lang.Object
javax.swing.tree.DefaultTreeSelectionModel
com.jidesoft.swing.LegacyCheckBoxTreeSelectionModel
- All Implemented Interfaces:
Serializable
,Cloneable
,EventListener
,TreeModelListener
,TreeSelectionModel
public class LegacyCheckBoxTreeSelectionModel
extends DefaultTreeSelectionModel
implements TreeModelListener
Deprecated.
This class is deprecated and provided to support compatibility with
LegacyTristateCheckBox
. We will not provide support
for this class. You likely want to use CheckBoxTreeSelectionModel
.
CheckBoxTreeSelectionModel
is a selection _model based on DefaultTreeSelectionModel
and use in
CheckBoxTree
to keep track of the checked tree paths.- Author:
- Santhosh Kumar T
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionDeprecated.Used inareSiblingsSelected(javax.swing.tree.TreePath)
for those paths pending added so that they are not in the selection model right now.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
ConstructorsConstructorDescriptionDeprecated.LegacyCheckBoxTreeSelectionModel
(TreeModel model, boolean digIn) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addSelectionPaths
(TreePath[] paths) Deprecated.Overrides the method in DefaultTreeSelectionModel to consider digIn mode.protected void
addSelectionPaths
(TreePath[] paths, boolean needCheckPathSelection) Deprecated.Add the selection paths.protected boolean
areSiblingsSelected
(TreePath path) Deprecated.tells whether all siblings of given path are selected.protected Object
Deprecated.Get the child of node in the designated index.protected int
getChildrenCount
(Object node) Deprecated.Get the children countgetModel()
Deprecated.boolean
isDigIn()
Deprecated.Gets the dig-in mode.protected boolean
isParentActuallySelected
(TreePath path, TreePath parent) Deprecated.Check if the parent path is really selected.boolean
isPartiallySelected
(TreePath path) Deprecated.Tests whether there is any unselected node in the subtree of given path.boolean
isPathSelected
(TreePath path, boolean digIn) Deprecated.Tells whether given path is selected.boolean
isRowSelected
(int row) Deprecated.boolean
Deprecated.protected void
notifyPathChange
(Vector changedPaths, TreePath oldLeadSelection) Deprecated.protected void
notifyPathChange
(TreePath[] changedPaths, boolean isNew, TreePath oldLeadSelection) Deprecated.Notifies listeners of a change in path.void
removeSelectionPaths
(TreePath[] paths) Deprecated.void
removeSelectionPaths
(TreePath[] paths, boolean doFireEvent) Deprecated.void
setBatchMode
(boolean batchMode) Deprecated.void
setDigIn
(boolean digIn) Deprecated.Sets the dig-in mode.void
Deprecated.void
setSelectionPaths
(TreePath[] pPaths) Deprecated.Overrides the method in DefaultTreeSelectionModel to consider digIn mode.void
setSingleEventMode
(boolean singleEventMode) Deprecated.Single event mode is a mode that always fires only one event when you select or deselect a tree node.void
Deprecated.void
Deprecated.void
Deprecated.void
Deprecated.Methods inherited from class javax.swing.tree.DefaultTreeSelectionModel
addPropertyChangeListener, addSelectionPath, addTreeSelectionListener, arePathsContiguous, canPathsBeAdded, canPathsBeRemoved, clearSelection, clone, fireValueChanged, getLeadSelectionPath, getLeadSelectionRow, getListeners, getMaxSelectionRow, getMinSelectionRow, getPropertyChangeListeners, getRowMapper, getSelectionCount, getSelectionMode, getSelectionPath, getSelectionPaths, getSelectionRows, getTreeSelectionListeners, insureRowContinuity, insureUniqueness, isPathSelected, isSelectionEmpty, removePropertyChangeListener, removeSelectionPath, removeTreeSelectionListener, resetRowSelection, setRowMapper, setSelectionMode, setSelectionPath, toString, updateLeadIndex
-
Field Details
-
_pathHasAdded
Deprecated.Used inareSiblingsSelected(javax.swing.tree.TreePath)
for those paths pending added so that they are not in the selection model right now.
-
-
Constructor Details
-
LegacyCheckBoxTreeSelectionModel
Deprecated. -
LegacyCheckBoxTreeSelectionModel
Deprecated.
-
-
Method Details
-
getModel
Deprecated. -
setModel
Deprecated. -
isDigIn
public boolean isDigIn()Deprecated.Gets the dig-in mode. If the CheckBoxTree is in dig-in mode, checking the parent node will check all the children. Correspondingly, getSelectionPaths() will only return the parent tree path. If not in dig-in mode, each tree node can be checked or unchecked independently- Returns:
- true or false.
-
setDigIn
public void setDigIn(boolean digIn) Deprecated.Sets the dig-in mode. If the CheckBoxTree is in dig-in mode, checking the parent node will check all the children. Correspondingly, getSelectionPaths() will only return the parent tree path. If not in dig-in mode, each tree node can be checked or unchecked independently- Parameters:
digIn
- true to enable dig-in mode. False to disable it.
-
isPartiallySelected
Deprecated.Tests whether there is any unselected node in the subtree of given path. Inherited from JTree, the TreePath must be a path instance inside the tree model. If you populate a new TreePath instance on the fly, it would not work.- Parameters:
path
- check if the path is partially selected.- Returns:
- true if partially. Otherwise false.
-
isRowSelected
public boolean isRowSelected(int row) Deprecated.- Specified by:
isRowSelected
in interfaceTreeSelectionModel
- Overrides:
isRowSelected
in classDefaultTreeSelectionModel
-
isParentActuallySelected
Deprecated.Check if the parent path is really selected. The default implementation is just return true. In filterable scenario, you could override this method to check more. Inherited from JTree, the TreePath must be a path instance inside the tree model. If you populate a new TreePath instance on the fly, it would not work.- Parameters:
path
- the original path to be checkedparent
- the parent part which is closest to the original path and is selected- Returns:
- true if the path is actually selected without any doubt. Otherwise false.
-
isPathSelected
Deprecated.Tells whether given path is selected. if dig is true, then a path is assumed to be selected, if one of its ancestor is selected. Inherited from JTree, the TreePath must be a path instance inside the tree model. If you populate a new TreePath instance on the fly, it would not work.- Parameters:
path
- check if the path is selected.digIn
- whether we will check its descendants.- Returns:
- true if the path is selected.
-
notifyPathChange
Deprecated.- Overrides:
notifyPathChange
in classDefaultTreeSelectionModel
-
setSelectionPaths
Deprecated.Overrides the method in DefaultTreeSelectionModel to consider digIn mode. Inherited from JTree, the TreePath must be a path instance inside the tree model. If you populate a new TreePath instance on the fly, it would not work.- Specified by:
setSelectionPaths
in interfaceTreeSelectionModel
- Overrides:
setSelectionPaths
in classDefaultTreeSelectionModel
- Parameters:
pPaths
- the tree paths to be selected.
-
addSelectionPaths
Deprecated.Overrides the method in DefaultTreeSelectionModel to consider digIn mode. Inherited from JTree, the TreePath must be a path instance inside the tree model. If you populate a new TreePath instance on the fly, it would not work.- Specified by:
addSelectionPaths
in interfaceTreeSelectionModel
- Overrides:
addSelectionPaths
in classDefaultTreeSelectionModel
- Parameters:
paths
- the tree paths to be added to selection paths.
-
addSelectionPaths
Deprecated.Add the selection paths.- Parameters:
paths
- the paths to be addedneedCheckPathSelection
- the flag to indicating if the path selection should be checked to improve performance
-
areSiblingsSelected
Deprecated.tells whether all siblings of given path are selected. Inherited from JTree, the TreePath must be a path instance inside the tree model. If you populate a new TreePath instance on the fly, it would not work.- Parameters:
path
- the tree path- Returns:
- true if the siblings are all selected.
-
removeSelectionPaths
Deprecated.- Specified by:
removeSelectionPaths
in interfaceTreeSelectionModel
- Overrides:
removeSelectionPaths
in classDefaultTreeSelectionModel
-
removeSelectionPaths
Deprecated. -
getChild
Deprecated.Get the child of node in the designated index.- Parameters:
node
- the parent nodei
- the child index- Returns:
- the child node
-
getChildrenCount
Deprecated.Get the children count- Parameters:
node
- the parent node- Returns:
- the children count of the parent node.
-
isSingleEventMode
public boolean isSingleEventMode()Deprecated. -
setSingleEventMode
public void setSingleEventMode(boolean singleEventMode) Deprecated.Single event mode is a mode that always fires only one event when you select or deselect a tree node. Taking this tree as an example,
Case 1: Assuming b and c are selected at this point, you click on a.A -- a |- b |- c
- In non-single event mode, you will get select-A, deselect-b and deselect-c three events
- In single event mode, you will only get select-a.
- In non-single event mode, you will get only select-A event.
- In single event mode, you will only get select-A too.
- In non-single event mode, you will get select-A event as well as deselect-b and deselect-c event.
- In single event mode, you will only get select-A.
DefaultTreeSelectionModel.getSelectionPaths()
to find out. In non-single event mode, the events reflect what happened inside the selection model. So you can get a complete picture of the exact state without asking the selection model. The downside is it will generate too many events. With this option, you can decide which mode you want to use that is the best for your case. By default, singleEventMode is set to false to be compatible with the older versions that don't have this option.- Parameters:
singleEventMode
- true or false.
-
notifyPathChange
Deprecated.Notifies listeners of a change in path. changePaths should contain instances of PathPlaceHolder.- Parameters:
changedPaths
- the paths that are changed.isNew
- is it a new path.oldLeadSelection
- the old selection.
-
setBatchMode
public void setBatchMode(boolean batchMode) Deprecated. -
treeNodesChanged
Deprecated.- Specified by:
treeNodesChanged
in interfaceTreeModelListener
-
treeNodesInserted
Deprecated.- Specified by:
treeNodesInserted
in interfaceTreeModelListener
-
treeNodesRemoved
Deprecated.- Specified by:
treeNodesRemoved
in interfaceTreeModelListener
-
treeStructureChanged
Deprecated.- Specified by:
treeStructureChanged
in interfaceTreeModelListener
-
CheckBoxTreeSelectionModel
.