JAL-4416 make sure the structure viewer is actually opened when handling local file...
authorJim Procter <jprocter@dundee.ac.uk>
Wed, 15 May 2024 15:44:23 +0000 (16:44 +0100)
committerJim Procter <jprocter@dundee.ac.uk>
Wed, 15 May 2024 15:44:23 +0000 (16:44 +0100)
src/jalview/gui/StructureChooser.java

index 6132908..851bd32 100644 (file)
@@ -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);