JAL-1632 add score model params to PCAModel and PCA constructors
[jalview.git] / src / jalview / gui / TreePanel.java
index 74dd29a..857e77c 100755 (executable)
@@ -23,6 +23,7 @@ package jalview.gui;
 import jalview.analysis.AlignmentSorter;
 import jalview.analysis.NJTree;
 import jalview.analysis.scoremodels.ScoreModels;
+import jalview.analysis.scoremodels.SimilarityParams;
 import jalview.api.analysis.ScoreModelI;
 import jalview.api.analysis.ViewBasedAnalysisI;
 import jalview.bin.Cache;
@@ -300,9 +301,8 @@ public class TreePanel extends GTreePanel
           seqs = av.getSelectionGroup().getSequencesInOrder(
                   av.getAlignment());
         }
-        ScoreModelI sm = ScoreModels.getInstance().forName(pwtype);
-        sm = configureScoreModel(sm);
-        tree = new NJTree(seqs, seqStrings, type, pwtype, sm, start, end);
+        ScoreModelI sm = configureScoreModel(pwtype);
+        tree = new NJTree(av, type, sm, SimilarityParams.Jalview);
         showDistances(true);
       }
 
@@ -883,14 +883,15 @@ public class TreePanel extends GTreePanel
   }
 
   /**
-   * If the score model is one that requires to get state data from the current
-   * view, allow it to do so
+   * Gets the score model for the given name. If the score model is one that
+   * requires to get state data from the current view, allow it to do so
    * 
    * @param sm
    * @return
    */
-  protected ScoreModelI configureScoreModel(ScoreModelI sm)
+  protected ScoreModelI configureScoreModel(String modelName)
   {
+    ScoreModelI sm = ScoreModels.getInstance().forName(modelName);
     if (sm instanceof ViewBasedAnalysisI)
     {
       try