From 8b46f39580d6fe338c3dc15375863067bca2b543 Mon Sep 17 00:00:00 2001 From: James Procter Date: Mon, 1 May 2023 17:54:05 +0100 Subject: [PATCH] =?utf8?q?JAL-4177=20disable=20=E2=80=98Cancel=E2=80=99=20as?= =?utf8?q?=20well=20-=20since=20we=20as=20yet=20do=20not=20support=20cancell?= =?utf8?q?ing=20the=20structure=20view=E2=80=A6.=20Inability=20to=20cancel=20?= =?utf8?q?reported=20under=20JAL-4178?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- resources/lang/Messages.properties | 1 + src/jalview/gui/StructureChooser.java | 8 ++++++++ src/jalview/jbgui/GStructureChooser.java | 7 +++++-- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/resources/lang/Messages.properties b/resources/lang/Messages.properties index 463cab1..5d457a2 100644 --- a/resources/lang/Messages.properties +++ b/resources/lang/Messages.properties @@ -1452,3 +1452,4 @@ label.choose_tempfac_type = Choose Temperature Factor type label.interpret_tempfac_as = Interpret Temperature Factor as label.add_pae_matrix_file = Add PAE matrix file label.nothing_selected = Nothing selected +label.working_ellipsis = Working ... \ No newline at end of file diff --git a/src/jalview/gui/StructureChooser.java b/src/jalview/gui/StructureChooser.java index 4e5378e..5cd339b 100644 --- a/src/jalview/gui/StructureChooser.java +++ b/src/jalview/gui/StructureChooser.java @@ -1203,6 +1203,11 @@ public class StructureChooser extends GStructureChooser final int preferredHeight = pnl_filter.getHeight(); btn_add.setEnabled(false); btn_newView.setEnabled(false); + btn_cancel.setEnabled(false); + actionsPanel.setEnabled(false); + + final String progress=MessageManager.getString("label.working_ellipsis"); + setProgressBar(progress, progress.hashCode()); Runnable viewStruc = new Runnable() { @Override @@ -1293,7 +1298,9 @@ public class StructureChooser extends GStructureChooser .getCmb_assSeq().getSelectedItem(); SequenceI userSelectedSeq = assSeqOpt.getSequence(); if (userSelectedSeq != null) + { selectedSequence = userSelectedSeq; + } String pdbFilename = selectedPdbFileName; StructureChooser.openStructureFileForSequence(ssm, sc, ap, @@ -1304,6 +1311,7 @@ public class StructureChooser extends GStructureChooser @Override public void run() { + setProgressBar("Complete.", progress.hashCode()); closeAction(preferredHeight); mainFrame.dispose(); } diff --git a/src/jalview/jbgui/GStructureChooser.java b/src/jalview/jbgui/GStructureChooser.java index 64fffc4..d5e36c1 100644 --- a/src/jalview/jbgui/GStructureChooser.java +++ b/src/jalview/jbgui/GStructureChooser.java @@ -106,6 +106,8 @@ public abstract class GStructureChooser extends JPanel */ protected static final String VIEWS_LOCAL_PDB = "VIEWS_LOCAL_PDB"; + protected JPanel actionsPanel; + protected JPanel statusPanel = new JPanel(); public JLabel statusBar = new JLabel(); @@ -121,6 +123,7 @@ public abstract class GStructureChooser extends JPanel protected StringBuilder errorWarning = new StringBuilder(); + protected JButton btn_cancel; protected JButton btn_add; protected JButton btn_newView; @@ -414,7 +417,7 @@ public abstract class GStructureChooser extends JPanel } }); - JButton btn_cancel = new JButton( + btn_cancel = new JButton( MessageManager.getString("action.cancel")); btn_cancel.setFont(VERDANA_12); btn_cancel.addActionListener(new ActionListener() @@ -679,7 +682,7 @@ public abstract class GStructureChooser extends JPanel targetView.setVisible(false); - JPanel actionsPanel = new JPanel(new MigLayout()); + actionsPanel = new JPanel(new MigLayout()); actionsPanel.add(targetView, "left"); actionsPanel.add(btn_add, "wrap"); actionsPanel.add(chk_superpose, "left"); -- 1.7.10.2