JAL-2499 JAL-2403 push 'configure for view' inside ScoreModels, defer
[jalview.git] / src / jalview / gui / CalculationChooser.java
index 7b3bf22..ee67d06 100644 (file)
@@ -321,22 +321,21 @@ public class CalculationChooser extends JPanel
   }
 
   /**
-   * Open and calculate the selected tree on 'OK'
+   * Open and calculate the selected tree or PCA on 'OK'
    */
   protected void ok_actionPerformed()
   {
     boolean doPCA = pca.isSelected();
-    ScoreModelI sm = ScoreModels.getInstance().forName(
-            modelNames.getSelectedItem().toString());
+    String modelName = modelNames.getSelectedItem().toString();
     SimilarityParamsI params = getSimilarityParameters(doPCA);
 
     if (doPCA)
     {
-      openPcaPanel(sm, params);
+      openPcaPanel(modelName, params);
     }
     else
     {
-      openTreePanel(sm, params);
+      openTreePanel(modelName, params);
     }
 
     // closeFrame();
@@ -345,23 +344,23 @@ public class CalculationChooser extends JPanel
   /**
    * Open a new Tree panel on the desktop
    * 
-   * @param sm
+   * @param modelName
    * @param params
    */
-  protected void openTreePanel(ScoreModelI sm, SimilarityParamsI params)
+  protected void openTreePanel(String modelName, SimilarityParamsI params)
   {
     String treeType = neighbourJoining.isSelected() ? TreeBuilder.NEIGHBOUR_JOINING
             : TreeBuilder.AVERAGE_DISTANCE;
-    af.newTreePanel(treeType, sm, params);
+    af.newTreePanel(treeType, modelName, params);
   }
 
   /**
    * Open a new PCA panel on the desktop
    * 
-   * @param sm
+   * @param modelName
    * @param params
    */
-  protected void openPcaPanel(ScoreModelI sm, SimilarityParamsI params)
+  protected void openPcaPanel(String modelName, SimilarityParamsI params)
   {
     AlignViewport viewport = af.getViewport();
     if (((viewport.getSelectionGroup() != null)
@@ -379,7 +378,7 @@ public class CalculationChooser extends JPanel
                       JvOptionPane.WARNING_MESSAGE);
       return;
     }
-    new PCAPanel(af.alignPanel, sm, params);
+    new PCAPanel(af.alignPanel, modelName, params);
   }
 
   /**