JAL-2805 interface comments
authorkjvdheide <kjvanderheide@dundee.ac.uk>
Mon, 13 Nov 2017 20:19:43 +0000 (20:19 +0000)
committerkjvdheide <kjvanderheide@dundee.ac.uk>
Mon, 13 Nov 2017 20:21:08 +0000 (20:21 +0000)
src/jalview/ext/archaeopteryx/ArchaeopteryxTreeBuilder.java
src/jalview/ext/archaeopteryx/ExternalLoadedTreeAssociationI.java
src/jalview/ext/archaeopteryx/ExternalTreeBuilderI.java
src/jalview/ext/archaeopteryx/ExternalTreeViewerBindingI.java
src/jalview/ext/forester/io/ExternalTreeParserI.java

index af270c2..9166497 100644 (file)
@@ -40,9 +40,9 @@ public class ArchaeopteryxTreeBuilder
 
   private PhylogenyNode rootNode;
 
-  private final Map<SequenceI, PhylogenyNode> alignmentBoundNodes;
+  private final Map<SequenceI, PhylogenyNode> alignmentWithNodes;
 
-  private final Map<PhylogenyNode, SequenceI> nodesBoundAlignment;
+  private final Map<PhylogenyNode, SequenceI> nodesWithAlignment;
 
   public ArchaeopteryxTreeBuilder(final TreeBuilder calculatedTree)
   {
@@ -50,10 +50,13 @@ public class ArchaeopteryxTreeBuilder
     sequences = jalviewTree.getSequences();
     distances = ForesterMatrix.convertJalviewToForester(
             jalviewTree.getDistances(), sequences);
+
     aptxTree = new Phylogeny();
     rootNode = new PhylogenyNode();
-    alignmentBoundNodes = new HashMap<>(distances.getSize());
-    nodesBoundAlignment = new HashMap<>(distances.getSize());
+
+    int amountOfSequences = distances.getSize();
+    alignmentWithNodes = new HashMap<>(amountOfSequences);
+    nodesWithAlignment = new HashMap<>(amountOfSequences);
 
 
   }
@@ -83,11 +86,12 @@ public class ArchaeopteryxTreeBuilder
       Sequence seq = ForesterDataConversions
               .createForesterSequence(sequence, true);
       PhylogenyNode sequenceNode = new PhylogenyNode(sequence.getName());
+
       NodeData nodeData = sequenceNode.getNodeData();
       nodeData.setSequence(seq);
 
-      nodesBoundAlignment.put(sequenceNode, sequence);
-      alignmentBoundNodes.put(sequence, sequenceNode);
+      nodesWithAlignment.put(sequenceNode, sequence);
+      alignmentWithNodes.put(sequence, sequenceNode);
       rootNode.addAsChild(sequenceNode);
     }
 
@@ -104,13 +108,13 @@ public class ArchaeopteryxTreeBuilder
   @Override
   public Map<SequenceI, PhylogenyNode> getAlignmentBoundNodes()
   {
-    return alignmentBoundNodes;
+    return alignmentWithNodes;
   }
 
   @Override
   public Map<PhylogenyNode, SequenceI> getNodesBoundAlignment()
   {
-    return nodesBoundAlignment;
+    return nodesWithAlignment;
   }
 
   private Phylogeny clusterNodes()
index 9c84527..08a0cdc 100644 (file)
@@ -8,6 +8,7 @@ import jalview.datamodel.SequenceI;
  * @author kjvanderheide
  *
  * @param <T>
+ *          Tree object.
  */
 interface ExternalLoadedTreeAssociationI<T>
 {
index f27117d..8f10e73 100644 (file)
@@ -4,6 +4,15 @@ import jalview.datamodel.SequenceI;
 
 import java.util.Map;
 
+/**
+ * 
+ * @author kjvanderheide
+ *
+ * @param <T>
+ *          Tree object that the tree viewer requires.
+ * @param <N>
+ *          Tree node object that the tree viewer requires.
+ */
 interface ExternalTreeBuilderI<T, N>
 {
   public T buildTree(N treeRoot);
index 2bef9d6..c9f5820 100644 (file)
@@ -29,11 +29,14 @@ import java.awt.event.MouseEvent;
 import java.awt.event.MouseListener;
 
 /**
+ * 
  * Interface for binding a tree viewer to Jalview alignments. Assumes a tree
  * viewer will both want to receive and send selection events.
  * 
  * @author kjvanderheide
  *
+ * @param <N>
+ *          Tree node object.
  */
 interface ExternalTreeViewerBindingI<N>
         extends ActionListener, MouseListener, SelectionListener,
index 9095a0f..2c26623 100644 (file)
@@ -2,6 +2,13 @@ package jalview.ext.forester.io;
 
 import javax.swing.JInternalFrame;
 
+/**
+ * 
+ * @author kjvanderheide
+ *
+ * @param <F>
+ *          Frame containing the tree viewer.
+ */
 public interface ExternalTreeParserI<F extends JInternalFrame>
 {
   public F loadTree();