JAL-1953 first pass of adding javadoc, some methods renamed
[jalview.git] / src / jalview / ext / treeviewer / TreeViewerBindingI.java
index da999c6..bb6eb19 100644 (file)
@@ -28,11 +28,13 @@ import jalview.structure.SelectionSource;
 
 import java.awt.event.ActionListener;
 import java.awt.event.MouseListener;
+import java.util.Map;
 
 /**
  * 
- * Interface for binding a tree viewer to Jalview alignments. Assumes a tree
- * viewer will both want to receive and send selection events.
+ * Interface for associating the nodes of a tree viewer with Jalview alignment
+ * sequences and communicating between the two. Assumes a tree viewer will both
+ * want to receive and send selection events.
  * 
  * @author kjvanderheide
  *
@@ -43,20 +45,49 @@ public interface TreeViewerBindingI
         SelectionSource
 {
   /**
+   * Gets the mapping for sequences with their associated tree nodes
+   * 
+   * @return
+   */
+  public Map<SequenceI, TreeNodeI> getAlignmentWithNodes();
+
+  /**
+   * Gets the mapping for tree nodes with their associated sequences
+   * 
+   * @return
+   */
+  public Map<TreeNodeI, SequenceI> getNodesWithAlignment();
+
+  /**
+   * 
+   * @param x
+   *          coordinate that functions as the clustering threshold
+   */
+  public void partitionTree(final int x);
+
+  public void showMatchingChildSequences(TreeNodeI parentNode);
+
+  public void showMatchingSequence(TreeNodeI nodeToMatch);
+
+  /**
    * If a node is selected in the tree panel this method highlights the
    * corresponding sequence in the Jalview alignment view. If an internal node
    * is selected all child sequences get highlighted as well.
    */
   public void showNodeSelectionOnAlign(TreeNodeI node);
 
-  public void treeSelectionChanged(SequenceI sequence);
-
-  public void showMatchingSequence(TreeNodeI nodeToMatch);
-
-  public void showMatchingChildSequences(TreeNodeI parentNode);
+  /**
+   * Sorts the given alignment by the order in which the sequences appear in the
+   * tree.
+   * 
+   * @param alignPanel
+   *          Panel containing the alignment to be sorted.
+   * @return the sorting Command
+   */
+  public CommandI sortAlignmentIn(AlignmentPanel alignPanel);
 
   public void sortByTree_actionPerformed();
 
-  public CommandI sortAlignmentIn(AlignmentPanel alignPanel);
+  public void treeSelectionChanged(SequenceI sequence);
 
 }