From: James Procter Date: Wed, 22 Feb 2023 13:34:54 +0000 (+0000) Subject: JAL-629 make sure we show GUI when not driven programmatically X-Git-Tag: Release_2_11_3_0~18^2~8 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=b8f69c187f02cf7213b92b4882afe36c7c16a733;p=jalview.git JAL-629 make sure we show GUI when not driven programmatically --- diff --git a/src/jalview/gui/StructureChooser.java b/src/jalview/gui/StructureChooser.java index 9f259bb..04cc94e 100644 --- a/src/jalview/gui/StructureChooser.java +++ b/src/jalview/gui/StructureChooser.java @@ -119,18 +119,18 @@ public class StructureChooser extends GStructureChooser List seqsWithoutSourceDBRef = null; - private boolean noChooserGUI = false; + private boolean showChooserGUI = true; private static StructureViewer lastTargetedView = null; public StructureChooser(SequenceI[] selectedSeqs, SequenceI selectedSeq, AlignmentPanel ap) { - this(selectedSeqs, selectedSeq, ap, false); + this(selectedSeqs, selectedSeq, ap, true); } public StructureChooser(SequenceI[] selectedSeqs, SequenceI selectedSeq, - AlignmentPanel ap, boolean noChooserGUI) + AlignmentPanel ap, boolean showGUI) { // which FTS engine to use data = StructureChooserQuerySource.getQuerySourceFor(selectedSeqs); @@ -140,7 +140,7 @@ public class StructureChooser extends GStructureChooser this.selectedSequence = selectedSeq; this.selectedSequences = selectedSeqs; this.progressIndicator = (ap == null) ? null : ap.alignFrame; - this.noChooserGUI = noChooserGUI; + this.showChooserGUI = showGUI; init(); } @@ -256,7 +256,7 @@ public class StructureChooser extends GStructureChooser populateFilterComboBox(isStructuresDiscovered(), cachedPDBExists); discoverStructureViews(); updateProgressIndicator(null, startTime); - mainFrame.setVisible(noChooserGUI); + mainFrame.setVisible(showChooserGUI); updateCurrentView(); } @@ -1586,8 +1586,9 @@ public class StructureChooser extends GStructureChooser public static void openStructureFileForSequence(AlignmentPanel ap, SequenceI seq, File sFile) { + //Open the chooser headlessly. Not sure this is actually needed ? StructureChooser sc = new StructureChooser(new SequenceI[] { seq }, seq, - ap, true); + ap, false); StructureSelectionManager ssm = ap.getStructureSelectionManager(); PDBEntry fileEntry = null; try @@ -1606,7 +1607,6 @@ public class StructureChooser extends GStructureChooser new PDBEntry[] { fileEntry }, ap, new SequenceI[] { seq }); - sc.mainFrame.dispose(); - sc.noChooserGUI = false; + sc.mainFrame.dispose(); } }