From 0c8213058cfc306cf459355543bcb93c546047dc Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Wed, 7 Aug 2024 15:09:55 +0100 Subject: [PATCH] JAL-4159 suppress pairwise alignment display options when not available from pasimap --- src/jalview/gui/PaSiMapPanel.java | 2 ++ src/jalview/gui/PairwiseAlignPanel.java | 21 +++++++++++++++++++++ src/jalview/jbgui/GPaSiMapPanel.java | 4 +++- 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/src/jalview/gui/PaSiMapPanel.java b/src/jalview/gui/PaSiMapPanel.java index bc6e477..bf965a5 100644 --- a/src/jalview/gui/PaSiMapPanel.java +++ b/src/jalview/gui/PaSiMapPanel.java @@ -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); diff --git a/src/jalview/gui/PairwiseAlignPanel.java b/src/jalview/gui/PairwiseAlignPanel.java index 9071c31..c3085d8 100755 --- a/src/jalview/gui/PairwiseAlignPanel.java +++ b/src/jalview/gui/PairwiseAlignPanel.java @@ -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; diff --git a/src/jalview/jbgui/GPaSiMapPanel.java b/src/jalview/jbgui/GPaSiMapPanel.java index 3c7fb5a..333975f 100755 --- a/src/jalview/jbgui/GPaSiMapPanel.java +++ b/src/jalview/jbgui/GPaSiMapPanel.java @@ -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() -- 1.7.10.2