JAL-1953 2.11.2 with Archeopteryx!
[jalview.git] / src / jalview / ext / treeviewer / TreeNodeI.java
diff --git a/src/jalview/ext/treeviewer/TreeNodeI.java b/src/jalview/ext/treeviewer/TreeNodeI.java
new file mode 100644 (file)
index 0000000..33cb080
--- /dev/null
@@ -0,0 +1,59 @@
+package jalview.ext.treeviewer;
+
+import jalview.datamodel.SequenceI;
+
+import java.awt.Color;
+import java.util.List;
+
+/**
+ * Interface for implementing a tree node, these nodes might -but do not have
+ * to- be part of a {@link TreeI}.
+ * 
+ * @author kjvanderheide
+ *
+ */
+public interface TreeNodeI
+{
+
+  public void addAsChild(TreeNodeI childNode);
+
+  public List<TreeNodeI> getAllDescendants();
+
+  /**
+   * Returns only the immediate descendants of this node, so any nodes whose
+   * parent is this node.
+   * 
+   * @return
+   */
+  public List<TreeNodeI> getDirectChildren();
+
+  /**
+   * Gets just the nodes downwards from this node that are external/leafs.
+   * 
+   * @return
+   */
+  public List<TreeNodeI> getExternalDescendants();
+
+  public long getId();
+
+  public String getNodeName();
+
+  public SequenceI getSequence();
+
+  public float getXcoord();
+
+  public float getYcoord();
+
+  /**
+   * 
+   * @return True if the node is internal, false if it's external (a leaf).
+   */
+  public boolean isInternal();
+
+  public boolean isCollapsed();
+
+  public void setBranchColor(Color branchColor);
+
+  public void setSequence(SequenceI seq);
+
+}