Merge branch 'kjvdh/features/PhylogenyViewer' of
[jalview.git] / src / jalview / gui / CalculationChooser.java
index 8b4c212..30a9b3d 100644 (file)
@@ -28,7 +28,7 @@ import jalview.analysis.scoremodels.SimilarityParams;
 import jalview.api.analysis.ScoreModelI;
 import jalview.api.analysis.SimilarityParamsI;
 import jalview.datamodel.SequenceGroup;
-import jalview.ext.archaeopteryx.ArchaeopteryxInit;
+import jalview.ext.archaeopteryx.AptxInit;
 import jalview.util.MessageManager;
 
 import java.awt.BorderLayout;
@@ -477,16 +477,10 @@ public class CalculationChooser extends JPanel
     }
     else
     {
+      createTree(substitutionMatrix, params);
+
 
-      String treeAlgo = determineTreeAlgo();
-      TreeCalculator treeCalculator = new TreeCalculator(treeAlgo,
-              substitutionMatrix, params);
-      TreeBuilder calculatedTree = treeCalculator
-              .makeTree(af.getViewport());
-      TreeModel tree = new TreeModel(calculatedTree);
 
-      openTreePanel(tree, treeAlgo, substitutionMatrix);
-      ArchaeopteryxInit.createInstance(calculatedTree);
 
 
 
@@ -495,7 +489,19 @@ public class CalculationChooser extends JPanel
     // closeFrame();
   }
 
+  protected void createTree(String substitutionMatrix,
+          SimilarityParamsI params)
+  {
+    String treeAlgo = determineTreeAlgo();
+    TreeCalculator treeCalculator = new TreeCalculator(treeAlgo,
+            substitutionMatrix, params);
+    TreeBuilder calculatedTree = treeCalculator.makeTree(af.getViewport());
+
+    AptxInit.createInstance(calculatedTree);
 
+    TreeModel tree = new TreeModel(calculatedTree);
+    openTreePanel(tree, treeAlgo, substitutionMatrix);
+  }
 
 
   protected String determineTreeAlgo() // to be modified & expanded