1 package jalview.ext.treeviewer;
3 import jalview.datamodel.SequenceI;
6 import java.io.IOException;
7 import java.util.Iterator;
11 * Interface for a generic phylogenetic tree, this does not necessarily have to
12 * be part of a tree panel.
14 * @author kjvanderheide
17 public interface TreeI
20 * Uses this tree as the basis for a new tree frame.
22 * @param instanceTitle
23 * name of the new tree frame.
26 TreeFrameI createTreeViewerFromTree(String instanceTitle);
28 public String[] getAllLeafNames();
30 public TreeNodeI[] getAllNodes();
32 public TreeNodeI getFurthestNode();
34 public double getHeight(boolean adjustForCollapsedSubtrees);
36 public List<SequenceI> getNodeSequences();
38 public TreeNodeI getNodeWithName(String name);
40 public TreeNodeI getRoot();
42 public String getTreeName();
45 * Check if the tree actually contains any nodes.
47 * @return true if tree has no nodes (or is deleted), false otherwise.
49 public boolean isEmpty();
51 public Iterator<TreeNodeI> iterateInLevelOrder();
53 public Iterator<TreeNodeI> iterateInPostOrder();
55 public Iterator<TreeNodeI> iterateInPreOrder();
58 * This should write the tree to the richest file format available for
59 * compatibility reasons as this is the method used when Jalview saves a tree
63 * File that tree should be written to
66 public void outputAsFile(File outputFile) throws IOException;
68 public void setRerootable(boolean b);
70 public void setRoot(TreeNodeI rootNode);
72 public void setRooted(boolean b);
74 public void setTreeName(String treeTitle);