JAL-2499 JAL-2403 push 'configure for view' inside ScoreModels, defer
[jalview.git] / src / jalview / gui / AlignFrame.java
index bed434d..8eb09ab 100644 (file)
@@ -34,7 +34,6 @@ import jalview.api.AlignmentViewPanel;
 import jalview.api.FeatureSettingsControllerI;
 import jalview.api.SplitContainerI;
 import jalview.api.ViewStyleI;
-import jalview.api.analysis.ScoreModelI;
 import jalview.api.analysis.SimilarityParamsI;
 import jalview.bin.Cache;
 import jalview.bin.Jalview;
@@ -3546,35 +3545,6 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
     }
   }
 
-  /**
-   * DOCUMENT ME!
-   * 
-   * @param e
-   *          DOCUMENT ME!
-   */
-  @Override
-  public void PCAMenuItem_actionPerformed(ActionEvent e)
-  {
-    if (((viewport.getSelectionGroup() != null)
-            && (viewport.getSelectionGroup().getSize() < 4) && (viewport
-            .getSelectionGroup().getSize() > 0))
-            || (viewport.getAlignment().getHeight() < 4))
-    {
-      JvOptionPane
-              .showInternalMessageDialog(
-                      this,
-                      MessageManager
-                              .getString("label.principal_component_analysis_must_take_least_four_input_sequences"),
-                      MessageManager
-                              .getString("label.sequence_selection_insufficient"),
-                      JvOptionPane.WARNING_MESSAGE);
-
-      return;
-    }
-
-    new PCAPanel(alignPanel);
-  }
-
   @Override
   public void autoCalculate_actionPerformed(ActionEvent e)
   {
@@ -3603,16 +3573,17 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
    * 
    * @param type
    *          tree type (NJ or AV)
-   * @param sm
-   *          distance or similarity score model used to compute the tree
+   * @param modelName
+   *          name of score model used to compute the tree
    * @param options
    *          parameters for the distance or similarity calculation
    */
-  void newTreePanel(String type, ScoreModelI sm, SimilarityParamsI options)
+  void newTreePanel(String type, String modelName, SimilarityParamsI options)
   {
     String frameTitle = "";
     TreePanel tp;
 
+    boolean onSelection = false;
     if (viewport.getSelectionGroup() != null
             && viewport.getSelectionGroup().getSize() > 0)
     {
@@ -3648,9 +3619,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
           return;
         }
       }
-
-      tp = new TreePanel(alignPanel, type, sm, options);
-      frameTitle = tp.getPanelTitle() + " on region";
+      onSelection = true;
     }
     else
     {
@@ -3658,11 +3627,11 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
       {
         return;
       }
-
-      tp = new TreePanel(alignPanel, type, sm, options);
-      frameTitle = tp.getPanelTitle();
     }
 
+    tp = new TreePanel(alignPanel, type, modelName, options);
+    frameTitle = tp.getPanelTitle() + (onSelection ? " on region" : "");
+
     frameTitle += " from ";
 
     if (viewport.viewName != null)