Made FreeUpMemoryTest compatible with modified CalculationChooser
authorkjvdheide <kjvanderheide@dundee.ac.uk>
Thu, 26 Oct 2017 20:37:40 +0000 (21:37 +0100)
committerkjvdheide <kjvanderheide@dundee.ac.uk>
Thu, 26 Oct 2017 20:39:04 +0000 (21:39 +0100)
src/jalview/gui/CalculationChooser.java
test/jalview/gui/FreeUpMemoryTest.java

index ebb12b9..11ee1a0 100644 (file)
@@ -477,17 +477,9 @@ 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());
 
-      ArchaeopteryxInit.createInstance(calculatedTree);
-
-      TreeModel tree = new TreeModel(calculatedTree);
-      openTreePanel(tree, treeAlgo, substitutionMatrix);
 
 
 
@@ -497,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());
+
+    ArchaeopteryxInit.createInstance(calculatedTree);
 
+    TreeModel tree = new TreeModel(calculatedTree);
+    openTreePanel(tree, treeAlgo, substitutionMatrix);
+  }
 
 
   protected String determineTreeAlgo() // to be modified & expanded
index 3f8e792..1534f3e 100644 (file)
@@ -161,8 +161,7 @@ public class FreeUpMemoryTest
     af.openTreePcaDialog();
     CalculationChooser dialog = af.alignPanel.getCalculationDialog();
     dialog.openPcaPanel("BLOSUM62", dialog.getSimilarityParameters(true));
-    // dialog.openTreePanel("BLOSUM62", dialog.getSimilarityParameters(false));
-    // to be adapted
+    dialog.createTree("BLOSUM62",dialog.getSimilarityParameters(false));
 
     /*
      * wait until Tree and PCA have been computed