JAL-2805 Jalview sequence binding interface expanded
authorkjvdheide <kjvanderheide@dundee.ac.uk>
Mon, 13 Nov 2017 19:47:19 +0000 (19:47 +0000)
committerkjvdheide <kjvanderheide@dundee.ac.uk>
Mon, 13 Nov 2017 19:47:19 +0000 (19:47 +0000)
src/jalview/ext/archaeopteryx/ArchaeopteryxInit.java
src/jalview/ext/archaeopteryx/JalviewAptxBinding.java
src/jalview/ext/archaeopteryx/JalviewTreeViewerBindingI.java

index ce0917d..bd7de87 100644 (file)
@@ -54,10 +54,10 @@ public final class ArchaeopteryxInit
   public static MainFrame createInstance(
           final TreeBuilder calculatedTree) // very dense method, to be split up
   {
-    ArchaeopteryxTreeConverter aptxTreeBuilder = new ArchaeopteryxTreeConverter(
+    ExternalTreeBuilderI<Phylogeny, PhylogenyNode> aptxTreeBuilder = new ArchaeopteryxTreeBuilder(
             calculatedTree);
 
-    Phylogeny aptxTree = aptxTreeBuilder.buildAptxTree();
+    Phylogeny aptxTree = aptxTreeBuilder.buildTree();
     Phylogeny[] aptxTrees = { aptxTree }; // future possibility to load in
                                           // several trees simultaneously
 
@@ -81,7 +81,7 @@ public final class ArchaeopteryxInit
     return aptxApp;
   }
 
-  public static JalviewTreeViewerBindingI bindNodesToJalviewSequences(
+  public static JalviewTreeViewerBindingI<?> bindNodesToJalviewSequences(
           final MainFrame aptxApp,
           final AlignmentViewport jalviewAlignViewport,
           final Map<SequenceI, PhylogenyNode> alignMappedToNodes,
index f3305fd..0a444b2 100644 (file)
@@ -28,7 +28,8 @@ import org.forester.phylogeny.PhylogenyNode;
  * @author kjvanderheide
  *
  */
-public final class JalviewAptxBinding implements JalviewTreeViewerBindingI
+public final class JalviewAptxBinding
+        implements JalviewTreeViewerBindingI<PhylogenyNode>
 {
   private org.forester.archaeopteryx.TreePanel treeView;
 
@@ -166,6 +167,7 @@ public final class JalviewAptxBinding implements JalviewTreeViewerBindingI
 
 
 
+  @Override
   public void showMatchingSequence(final PhylogenyNode nodeToMatch)
   {
     SequenceI matchingSequence = nodesBoundToSequences.get(nodeToMatch);
@@ -177,6 +179,7 @@ public final class JalviewAptxBinding implements JalviewTreeViewerBindingI
     }
   }
 
+  @Override
   public void showMatchingChildSequences(final PhylogenyNode parentNode)
   {
     final List<PhylogenyNode> childNodes = PhylogenyMethods
index f506024..f7183af 100644 (file)
@@ -35,13 +35,16 @@ import java.awt.event.MouseListener;
  * @author kjvanderheide
  *
  */
-interface JalviewTreeViewerBindingI
+interface JalviewTreeViewerBindingI<N>
         extends ActionListener, MouseListener, SelectionListener,
         SelectionSource
 {
   public void showNodeSelectionOnAlign(MouseEvent e);
 
-  public void treeSelectionChanged(final SequenceI sequence);
+  public void treeSelectionChanged(SequenceI sequence);
 
+  public void showMatchingSequence(N nodeToMatch);
+
+  public void showMatchingChildSequences(N parentNode);
 
 }