JAL-4159 suppress pairwise alignment display options when not available from pasimap
authorJim Procter <jprocter@dundee.ac.uk>
Wed, 7 Aug 2024 14:09:55 +0000 (15:09 +0100)
committerJim Procter <jprocter@dundee.ac.uk>
Wed, 7 Aug 2024 14:09:55 +0000 (15:09 +0100)
src/jalview/gui/PaSiMapPanel.java
src/jalview/gui/PairwiseAlignPanel.java
src/jalview/jbgui/GPaSiMapPanel.java

index bc6e477..bf965a5 100644 (file)
@@ -239,6 +239,8 @@ public class PaSiMapPanel extends GPaSiMapPanel
       getPasimapModel().calculate(pap);
       if (!getPasimapModel().isCancelled())
       {
+        // TODO: fix outputAlignment so it uses the compact form if no text report is available
+        outputAlignment.setVisible(!pap.isDiscardAlignments() && !pap.isQuiet());
         xCombobox.setSelectedIndex(0);
         yCombobox.setSelectedIndex(1);
         zCombobox.setSelectedIndex(2);
index 9071c31..c3085d8 100755 (executable)
@@ -426,6 +426,14 @@ public class PairwiseAlignPanel extends GPairwiseAlignPanel
   {
     this.quiet = quiet;
   }
+  
+  /**
+   * @return true if no textual alignment report was generated 
+   */
+  public boolean isQuiet()
+  {
+    return quiet;
+  }
 
   /**
    * set this if you are only interested in final alignment scores
@@ -436,7 +444,20 @@ public class PairwiseAlignPanel extends GPairwiseAlignPanel
   {
     discardAlignments = discard;
   }
+  
+  /**
+   * @return true if no alignments were saved
+   * @return
+   */
+  public boolean isDiscardAlignments()
+  {
+    return discardAlignments;
+  }
 
+  /**
+   * 
+   * @return true if the calculation was cancelled before completion
+   */
   public boolean isCancelled()
   {
     return cancelled;
index 3c7fb5a..333975f 100755 (executable)
@@ -65,6 +65,8 @@ public class GPaSiMapPanel extends JInternalFrame
 
   protected JMenuItem originalSeqData;
 
+  protected JMenuItem outputAlignment;
+
   /**
    * Constructor
    */
@@ -223,7 +225,7 @@ public class GPaSiMapPanel extends JInternalFrame
         print_actionPerformed();
       }
     });
-    JMenuItem outputAlignment = new JMenuItem();
+    outputAlignment = new JMenuItem();
     outputAlignment
             .setText(MessageManager.getString("label.output_alignment"));
     outputAlignment.addActionListener(new ActionListener()