View Javadoc

1   // Copyright 2004, FreeHEP.
2   package hep.wired.util;
3   
4   import javax.swing.tree.*;
5   
6   import hep.wired.util.TristateCheckBox.State;
7   
8   /***
9    *
10   * @author Mark Donszelmann
11   * @version $Id: TristateTreeNode.java 1860 2005-06-08 23:04:05Z duns $
12   */
13  public interface TristateTreeNode extends MutableTreeNode {
14          
15      /***
16       * Returns the state, derived from the node's "include" and "selected" state.
17       */
18      public State getState();
19      
20      /***
21       * Returns true if this node's include state is set.
22       */
23      public boolean isIncluded();
24      
25      /***
26       * Includes/excludes this node (and acts on supernodes and subnodes if necessary).
27       */
28      public void include(boolean included);
29      
30      /***
31       * Sets the include state of this node only. To be used to restore/copy a tree
32       */
33      public void setIncluded(boolean included);
34      
35      /***
36       * Returns true if this node is selected.
37       */ 
38      public boolean isSelected();
39      
40      /***
41       * Selects/deselectes this node (and acts on supernodes and subnodes if necessary).
42       */    
43      public void select(boolean selected);
44  
45      /***
46       * Sets the selected state of this node only. To be used to restore/copy a tree
47       */
48      public void setSelected(boolean selected);
49          
50      public TreeNode getChildAt(int index);
51  
52      public Object getUserObject();
53  
54      public void add(MutableTreeNode newChild);
55  }