From 63e2c6409683ec4c05b569b376480eca49fc9128 Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Wed, 15 May 2024 16:44:23 +0100 Subject: [PATCH] JAL-4416 make sure the structure viewer is actually opened when handling local file view --- src/jalview/gui/StructureChooser.java | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/src/jalview/gui/StructureChooser.java b/src/jalview/gui/StructureChooser.java index 6132908..851bd32 100644 --- a/src/jalview/gui/StructureChooser.java +++ b/src/jalview/gui/StructureChooser.java @@ -1344,10 +1344,10 @@ public class StructureChooser extends GStructureChooser selectedSequence = userSelectedSeq; } String pdbFilename = selectedPdbFileName; - + // TODO - tidy up this ugly hack so we call launchStructureViewer too StructureChooser.openStructureFileForSequence(ssm, sc, ap, - selectedSequence, true, pdbFilename, tft, paeFilename, - true); + selectedSequence, true, pdbFilename, tft, paeFilename,false, + true,true,getTargetedStructureViewer(ssm).getViewerType()); } SwingUtilities.invokeLater(new Runnable() { @@ -1806,6 +1806,22 @@ public class StructureChooser extends GStructureChooser paeFilename, false, true, doXferSettings, null); } + /** + * + * @param ssm + * @param sc + * @param ap + * @param seq + * @param prompt + * @param sFilename + * @param tft + * @param paeFilename + * @param forceHeadless + * @param showRefAnnotations + * @param doXferSettings + * @param viewerType - when not null means the viewer will be opened, providing forceHeadless/headless is not true + * @return + */ public static StructureViewer openStructureFileForSequence( StructureSelectionManager ssm, StructureChooser sc, AlignmentPanel ap, SequenceI seq, boolean prompt, @@ -1828,7 +1844,7 @@ public class StructureChooser extends GStructureChooser ssm = ap.getStructureSelectionManager(); StructureSelectionManager.doConfigureStructurePrefs(ssm); } - + PDBEntry fileEntry = new AssociatePdbFileWithSeq().associatePdbWithSeq( sFilename, DataSourceType.FILE, seq, prompt, Desktop.instance, tft, paeFilename, doXferSettings); -- 1.7.10.2