JAL-1953 2.11.2 with Archeopteryx!
[jalview.git] / src / jalview / ext / treeviewer / TreeNodeI.java
1 package jalview.ext.treeviewer;
2
3 import jalview.datamodel.SequenceI;
4
5 import java.awt.Color;
6 import java.util.List;
7
8 /**
9  * Interface for implementing a tree node, these nodes might -but do not have
10  * to- be part of a {@link TreeI}.
11  * 
12  * @author kjvanderheide
13  *
14  */
15 public interface TreeNodeI
16 {
17
18   public void addAsChild(TreeNodeI childNode);
19
20   public List<TreeNodeI> getAllDescendants();
21
22   /**
23    * Returns only the immediate descendants of this node, so any nodes whose
24    * parent is this node.
25    * 
26    * @return
27    */
28   public List<TreeNodeI> getDirectChildren();
29
30   /**
31    * Gets just the nodes downwards from this node that are external/leafs.
32    * 
33    * @return
34    */
35   public List<TreeNodeI> getExternalDescendants();
36
37   public long getId();
38
39   public String getNodeName();
40
41   public SequenceI getSequence();
42
43   public float getXcoord();
44
45   public float getYcoord();
46
47   /**
48    * 
49    * @return True if the node is internal, false if it's external (a leaf).
50    */
51   public boolean isInternal();
52
53   public boolean isCollapsed();
54
55   public void setBranchColor(Color branchColor);
56
57   public void setSequence(SequenceI seq);
58
59 }