JAL-2794 disabled branch colors on selection for now
authorkjvdheide <kjvanderheide@dundee.ac.uk>
Wed, 6 Dec 2017 16:07:42 +0000 (16:07 +0000)
committerkjvdheide <kjvanderheide@dundee.ac.uk>
Wed, 6 Dec 2017 16:07:42 +0000 (16:07 +0000)
src/jalview/ext/archaeopteryx/JalviewBinding.java

index eca66ae..41d18f5 100644 (file)
@@ -58,6 +58,8 @@ import org.forester.phylogeny.data.BranchColor;
 public final class JalviewBinding
         implements ExternalTreeViewerBindingI<PhylogenyNode>
 {
+  private final MainFrame aptxFrame;
+
   private org.forester.archaeopteryx.TreePanel treeView;
 
   private AlignmentViewport parentAvport;
@@ -107,10 +109,11 @@ public final class JalviewBinding
               MessageManager.getString("label.tabs_detected_archaeopteryx"),
               MessageManager.getString("label.problem_reading_tree_file"),
               JvOptionPane.WARNING_MESSAGE);
-      ;
+
     }
 
     // deal with/prohibit null values here as that will cause problems
+    aptxFrame = archaeopteryx;
     parentAvport = jalviewAlignmentViewport;
     sequencesBoundToNodes = alignMappedToNodes;
     nodesBoundToSequences = nodesMappedToAlign;
@@ -121,17 +124,19 @@ public final class JalviewBinding
     
     ssm.addSelectionListener(this);
     treeView.addMouseListener(this);
+
     PaintRefresher.Register(treeView, parentAvport.getSequenceSetId());
     associatedPanels = PaintRefresher
             .getAssociatedPanels(parentAvport.getSequenceSetId());
 
-    archaeopteryx.addInternalFrameListener(new InternalFrameAdapter()
+    aptxFrame.addInternalFrameListener(new InternalFrameAdapter()
     {
 
       @Override
       public void internalFrameClosed(InternalFrameEvent e)
       {
-        AptxInit.getAllAptxFrames().remove(archaeopteryx);
+        AptxInit.getAllAptxFrames().remove(aptxFrame);
+        ssm.removeSelectionListener(JalviewBinding.this);
       }
 
     });
@@ -172,6 +177,8 @@ public final class JalviewBinding
   @Override
   public void actionPerformed(ActionEvent e)
   {
+    // aptxFrame.actionPerformed(e);
+
   }
 
   @Override
@@ -245,6 +252,7 @@ public final class JalviewBinding
       treeView.setFoundNodes0(
               new HashSet<Long>(seqsel.getSequences().size()));
 
+
       for (SequenceI selectedSequence : seqsel.getSequences())
       {
         PhylogenyNode matchingNode = sequencesBoundToNodes.get(selectedSequence);
@@ -255,10 +263,10 @@ public final class JalviewBinding
 
           if (!matchingNode.getBranchData().isHasBranchColor())
           {
-            Color foundNodesColour = treeView.getTreeColorSet()
-                    .getFoundColor0();
-          matchingNode.getBranchData()
-                    .setBranchColor(new BranchColor(foundNodesColour));
+            // Color foundNodesColour = treeView.getTreeColorSet()
+            // .getFoundColor0();
+            // matchingNode.getBranchData()
+            // .setBranchColor(new BranchColor(foundNodesColour));
 
           }
 
@@ -527,6 +535,8 @@ public final class JalviewBinding
   @Override
   public void showMatchingChildSequences(final PhylogenyNode parentNode)
   {
+    // redundancy here, Forester already iterates through tree to get all
+    // descendants
     List<PhylogenyNode> childNodes = PhylogenyMethods
             .getAllDescendants(parentNode);