Class MultipleToggleCheckboxTree

java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JTree
eu.essilab.lablib.checkboxtree.MultipleToggleCheckboxTree
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, Scrollable

public class MultipleToggleCheckboxTree extends JTree
This class was attached to ticket #5. It is supposed to implement multiple nodes selection/deselection, but it doesn't seem to work.
See Also:
  • Constructor Details

    • MultipleToggleCheckboxTree

      public MultipleToggleCheckboxTree()
      For GUI builders. It returns a CheckboxTree with a default tree model to show something interesting. Creates a CheckboxTree with visible handles, a default CheckboxTreeCellRenderer and a default TreeCheckingModel.
    • MultipleToggleCheckboxTree

      public MultipleToggleCheckboxTree(TreeModel treemodel)
      Creates a CheckboxTree with visible handles, a default CheckboxTreeCellRenderer and a default TreeCheckingModel. The tree is based on the specified tree model.
    • MultipleToggleCheckboxTree

      public MultipleToggleCheckboxTree(TreeNode root)
      Creates a CheckboxTree with visible handles, a default CheckboxTreeCellRenderer and a default TreeCheckingModel. The tree root is the specified tree node.
      Parameters:
      root - the root of the tree
  • Method Details

    • addCheckingPath

      public void addCheckingPath(TreePath path)
      Add a path in the checking.
    • addCheckingPaths

      public void addCheckingPaths(TreePath[] paths)
      Add paths in the checking.
    • addTreeCheckingListener

      public void addTreeCheckingListener(TreeCheckingListener tsl)
      Adds a listener for TreeChecking events.
      Parameters:
      tsl - the TreeCheckingListener that will be notified when a node is checked
    • clearChecking

      public void clearChecking()
      Clears the checking.
    • expandAll

      public void expandAll()
      Expand completely a tree
    • getCheckingModel

      public TreeCheckingModel getCheckingModel()
      Returns:
      Returns the TreeCheckingModel.
    • getCheckingPaths

      public TreePath[] getCheckingPaths()
      Return paths that are in the checking.
    • getCheckingRoots

      public TreePath[] getCheckingRoots()
      Returns:
      Returns the paths that are in the checking set and are the (upper) roots of checked trees.
    • getGreyingPaths

      public TreePath[] getGreyingPaths()
      Returns:
      Returns the paths that are in the greying.
    • isPathChecked

      public boolean isPathChecked(TreePath path)
      Returns true if the item identified by the path is currently checked.
      Parameters:
      path - a TreePath identifying a node
      Returns:
      true if the node is checked
    • removeCheckingPath

      public void removeCheckingPath(TreePath path)
      Remove a path from the checking.
    • removeCheckingPaths

      public void removeCheckingPaths(TreePath[] paths)
      Remove paths from the checking.
    • removeTreeCheckingListener

      public void removeTreeCheckingListener(TreeCheckingListener tsl)
      Removes a TreeChecking listener.
      Parameters:
      tsl - the TreeChckingListener to remove
    • setCellRenderer

      public void setCellRenderer(CheckboxTreeCellRenderer x)
      Sets the CheckboxTreeCellRenderer that will be used to draw each cell.
      Parameters:
      x - the TreeCellRenderer that is to render each cell
    • setCheckingModel

      public void setCheckingModel(TreeCheckingModel newCheckingModel)
      Set the checking model of this CheckboxTree.
      Parameters:
      newCheckingModel - The new TreeCheckingModel.
    • setCheckingPath

      public void setCheckingPath(TreePath path)
      Set path in the checking.
    • setCheckingPaths

      public void setCheckingPaths(TreePath[] paths)
      Set paths that are in the checking.
    • setModel

      public void setModel(TreeModel newModel)
      Sets the TreeModel and links it to the existing checkingModel.
      Overrides:
      setModel in class JTree
    • toString

      public String toString()
      Overrides:
      toString in class Component
      Returns:
      a string representation of the tree, including the checking, enabling and greying sets.
    • main

      public static void main(String[] args)
      Test function. NEW
      Parameters:
      args -