JAL-4159 JAL-789 report pasimap and pairwise alignment parameters in window title
authorJim Procter <jprocter@dundee.ac.uk>
Wed, 7 Aug 2024 14:11:03 +0000 (15:11 +0100)
committerJim Procter <jprocter@dundee.ac.uk>
Wed, 7 Aug 2024 14:11:03 +0000 (15:11 +0100)
src/jalview/gui/AlignFrame.java

index f61c073..7f6646f 100644 (file)
@@ -3962,18 +3962,36 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
     }
 
     tp = new TreePanel(alignPanel, type, modelName, options);
-    frameTitle = tp.getPanelTitle() + (onSelection ? " on region" : "");
+    
+    frameTitle = formCalculationTitle(tp.getPanelTitle(),onSelection, viewport.getViewName(),this.title);
+    
+    Desktop.addInternalFrame(tp, frameTitle, 600, 500);
+  }
+
+  /**
+   * 
+   * @param panelTitle - calculation name
+   * @param onSelection - true if a selection was analysed
+   * @param viewName - null or current view name
+   * @param title - alignment frame title
+   * @return <calculation Name> (?on region) from (?viewName of) alignment name 
+   */
+  private String formCalculationTitle(String panelTitle,
+          boolean onSelection, String viewName, String title)
+  {
+    String frameTitle = panelTitle;
+    
+    frameTitle += (onSelection ? " on region" : "");
 
     frameTitle += " from ";
 
-    if (viewport.getViewName() != null)
+    if (viewName!=null)
     {
       frameTitle += viewport.getViewName() + " of ";
     }
 
-    frameTitle += this.title;
-
-    Desktop.addInternalFrame(tp, frameTitle, 600, 500);
+    frameTitle += title;
+    return frameTitle;
   }
 
   /**