JAL-1953 first pass of adding javadoc, some methods renamed
[jalview.git] / src / jalview / ext / archaeopteryx / JalviewBinding.java
index 822f749..f0c2866 100644 (file)
@@ -178,7 +178,7 @@ public final class JalviewBinding
       LoadedTreeSequenceAssociation bindAptxNodes = new LoadedTreeSequenceAssociation(
               parentAvport.getAlignment().getSequencesArray(),
               treeView.getTree());
-      bindAptxNodes.associateLeavesToSequences();
+      bindAptxNodes.associateNodesToSequences();
       sequencesBoundToNodes = bindAptxNodes.getAlignmentWithNodes();
       nodesBoundToSequences = bindAptxNodes.getNodesWithAlignment();
       TreeViewerUtils.associateNodesWithJalviewSequences(aptxFrame,
@@ -336,18 +336,14 @@ public final class JalviewBinding
       rootX = tree.getRoot().getXcoord();
 
       // don't bother if 0 distance tree or clicked x lies outside of tree
-      if (furthestNodeX != rootX && !(x > furthestNodeX))
-      {
+      // if (furthestNodeX != rootX && !(x > furthestNodeX))
+
         float threshold = (x - rootX) / (furthestNodeX - rootX);
         List<TreeNodeI> foundNodes = getNodesAboveThreshold(
                 threshold,
                 tree.getRoot());
 
-      }
-      else
-      {
-        // clear previous colours?
-      }
+
     }
 
 
@@ -529,10 +525,7 @@ public final class JalviewBinding
 
   }
 
-  /**
-   * may or may not need an extra repaint on the alignment view (check what kira
-   * does)
-   */
+
   @Override
   public void showNodeSelectionOnAlign(final TreeNodeI node)
   {
@@ -578,8 +571,6 @@ public final class JalviewBinding
 
     for (TreeNodeI childNode : childNodes)
     {
-      // childNode.getBranchData().setBranchColor(new BranchColor(Color.BLUE));
-
       SequenceI matchingSequence = nodesBoundToSequences.get(childNode);
       if (matchingSequence != null)
       {
@@ -596,12 +587,7 @@ public final class JalviewBinding
 
   }
 
-  /**
-   * Refactored from TreeCanvas.
-   * 
-   * @param sequence
-   *          of the node selected in the tree viewer.
-   */
+
   @Override
   public void treeSelectionChanged(final SequenceI sequence)
   {
@@ -739,6 +725,17 @@ public final class JalviewBinding
             .getAssociatedPanels(parentAvport.getSequenceSetId());
   }
 
+  @Override
+  public Map<SequenceI, TreeNodeI> getAlignmentWithNodes()
+  {
+    return sequencesBoundToNodes;
+  }
+
+  @Override
+  public Map<TreeNodeI, SequenceI> getNodesWithAlignment()
+  {
+    return nodesBoundToSequences;
+  }
 
 
 }