org.opensourcephysics.tools
Class CheckTreeSelectionModel

java.lang.Object
  extended by javax.swing.tree.DefaultTreeSelectionModel
      extended by org.opensourcephysics.tools.CheckTreeSelectionModel
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, javax.swing.tree.TreeSelectionModel

public class CheckTreeSelectionModel
extends javax.swing.tree.DefaultTreeSelectionModel

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:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.tree.DefaultTreeSelectionModel
SELECTION_MODE_PROPERTY
 
Fields inherited from interface javax.swing.tree.TreeSelectionModel
CONTIGUOUS_TREE_SELECTION, DISCONTIGUOUS_TREE_SELECTION, SINGLE_TREE_SELECTION
 
Constructor Summary
CheckTreeSelectionModel(javax.swing.tree.TreeModel model)
          Constructor.
 
Method Summary
 void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
          Adds a PropertyChangeListener.
 void addSelectionPaths(javax.swing.tree.TreePath[] paths)
          Adds paths to the current selection
 boolean isPathOrAncestorSelected(javax.swing.tree.TreePath path)
          Returns true if the path or any ancestor is selected.
 boolean isPathUnselected(javax.swing.tree.TreePath path)
          Returns true if neither the path nor any descendant is selected.
 void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
          Removes a PropertyChangeListener.
 void removeSelectionPaths(javax.swing.tree.TreePath[] paths)
          Removes paths from the current selection
 void setSelectionPaths(javax.swing.tree.TreePath[] paths)
           
 
Methods inherited from class javax.swing.tree.DefaultTreeSelectionModel
addSelectionPath, addTreeSelectionListener, clearSelection, clone, getLeadSelectionPath, getLeadSelectionRow, getListeners, getMaxSelectionRow, getMinSelectionRow, getPropertyChangeListeners, getRowMapper, getSelectionCount, getSelectionMode, getSelectionPath, getSelectionPaths, getSelectionRows, getTreeSelectionListeners, isPathSelected, isRowSelected, isSelectionEmpty, removeSelectionPath, removeTreeSelectionListener, resetRowSelection, setRowMapper, setSelectionMode, setSelectionPath, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CheckTreeSelectionModel

public CheckTreeSelectionModel(javax.swing.tree.TreeModel model)
Constructor.

Parameters:
model - a TreeModel
Method Detail

isPathUnselected

public boolean isPathUnselected(javax.swing.tree.TreePath path)
Returns true if neither the path nor any descendant is selected.

Parameters:
path - the path to test

isPathOrAncestorSelected

public boolean isPathOrAncestorSelected(javax.swing.tree.TreePath path)
Returns true if the path or any ancestor is selected.

Parameters:
path - the path to test

setSelectionPaths

public void setSelectionPaths(javax.swing.tree.TreePath[] paths)
Specified by:
setSelectionPaths in interface javax.swing.tree.TreeSelectionModel
Overrides:
setSelectionPaths in class javax.swing.tree.DefaultTreeSelectionModel

addSelectionPaths

public void addSelectionPaths(javax.swing.tree.TreePath[] paths)
Adds paths to the current selection

Specified by:
addSelectionPaths in interface javax.swing.tree.TreeSelectionModel
Overrides:
addSelectionPaths in class javax.swing.tree.DefaultTreeSelectionModel
Parameters:
paths - the paths to add

removeSelectionPaths

public void removeSelectionPaths(javax.swing.tree.TreePath[] paths)
Removes paths from the current selection

Specified by:
removeSelectionPaths in interface javax.swing.tree.TreeSelectionModel
Overrides:
removeSelectionPaths in class javax.swing.tree.DefaultTreeSelectionModel
Parameters:
paths - the paths to remove

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Adds a PropertyChangeListener.

Specified by:
addPropertyChangeListener in interface javax.swing.tree.TreeSelectionModel
Overrides:
addPropertyChangeListener in class javax.swing.tree.DefaultTreeSelectionModel
Parameters:
listener - the object requesting property change notification

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Removes a PropertyChangeListener.

Specified by:
removePropertyChangeListener in interface javax.swing.tree.TreeSelectionModel
Overrides:
removePropertyChangeListener in class javax.swing.tree.DefaultTreeSelectionModel
Parameters:
listener - the listener requesting removal