From: Ben Soares Date: Fri, 15 Dec 2023 21:30:13 +0000 (+0000) Subject: Merge branch 'bug/JAL-4290_headless_alignment_export_with_structure_annotations_doesn... X-Git-Tag: Release_2_11_3_3~7^2~2^2~8 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=cb3f31e3aacf81fa2b33f9eab9657ed40a66161e;hp=25513f2ce9d341344e29677335022a94e7822202;p=jalview.git Merge branch 'bug/JAL-4290_headless_alignment_export_with_structure_annotations_doesnt_include_secondary_structure_and_temperature_factor' of https://source.jalview.org/git/jalview into bug/JAL-4290_headless_alignment_export_with_structure_annotations_doesnt_include_secondary_structure_and_temperature_factor --- diff --git a/src/jalview/bin/Commands.java b/src/jalview/bin/Commands.java index dbc5e23..5f723c1 100644 --- a/src/jalview/bin/Commands.java +++ b/src/jalview/bin/Commands.java @@ -908,12 +908,7 @@ public class Commands boolean showSSAnnotations, boolean showAnnotations, boolean hideTFrows) { - Console.debug( - "##### Setting showSSAnnotations to " + showSSAnnotations); - Console.debug("##### Setting showAnnotations to " + showAnnotations); - Console.debug("##### Setting hideTFrows to " + hideTFrows); af.setAnnotationsVisibility(showSSAnnotations, true, false); - af.setAnnotationsVisibility(showAnnotations, false, true); // show temperature factor annotations? diff --git a/src/jalview/gui/Desktop.java b/src/jalview/gui/Desktop.java index 35c7818..bbd4dae 100644 --- a/src/jalview/gui/Desktop.java +++ b/src/jalview/gui/Desktop.java @@ -680,22 +680,7 @@ public class Desktop extends jalview.jbgui.GDesktop // configure services StructureSelectionManager ssm = StructureSelectionManager .getStructureSelectionManager(this); - if (Cache.getDefault(Preferences.ADD_SS_ANN, true)) - { - ssm.setAddTempFacAnnot( - Cache.getDefault(Preferences.ADD_TEMPFACT_ANN, true)); - ssm.setProcessSecondaryStructure( - Cache.getDefault(Preferences.STRUCT_FROM_PDB, true)); - // JAL-3915 - RNAView is no longer an option so this has no effect - ssm.setSecStructServices( - Cache.getDefault(Preferences.USE_RNAVIEW, false)); - } - else - { - ssm.setAddTempFacAnnot(false); - ssm.setProcessSecondaryStructure(false); - ssm.setSecStructServices(false); - } + StructureSelectionManager.doConfigureStructurePrefs(ssm); } public void checkForNews() diff --git a/src/jalview/gui/StructureChooser.java b/src/jalview/gui/StructureChooser.java index 666ff74..6132908 100644 --- a/src/jalview/gui/StructureChooser.java +++ b/src/jalview/gui/StructureChooser.java @@ -1826,6 +1826,7 @@ public class StructureChooser extends GStructureChooser if (ssm == null) { ssm = ap.getStructureSelectionManager(); + StructureSelectionManager.doConfigureStructurePrefs(ssm); } PDBEntry fileEntry = new AssociatePdbFileWithSeq().associatePdbWithSeq( diff --git a/src/jalview/structure/StructureSelectionManager.java b/src/jalview/structure/StructureSelectionManager.java index ec3e0a0..9a9e2a2 100644 --- a/src/jalview/structure/StructureSelectionManager.java +++ b/src/jalview/structure/StructureSelectionManager.java @@ -34,6 +34,7 @@ import java.util.Vector; import jalview.analysis.AlignSeq; import jalview.api.StructureSelectionManagerProvider; +import jalview.bin.Cache; import jalview.bin.Console; import jalview.commands.CommandI; import jalview.commands.EditCommand; @@ -50,6 +51,7 @@ import jalview.datamodel.SearchResultsI; import jalview.datamodel.SequenceI; import jalview.ext.jmol.JmolParser; import jalview.gui.IProgressIndicator; +import jalview.gui.Preferences; import jalview.io.AppletFormatAdapter; import jalview.io.DataSourceType; import jalview.io.StructureFile; @@ -1665,4 +1667,34 @@ public class StructureSelectionManager return pdbIdFileName; } + public static void doConfigureStructurePrefs( + StructureSelectionManager ssm) + { + doConfigureStructurePrefs(ssm, + Cache.getDefault(Preferences.ADD_SS_ANN, true), + Cache.getDefault(Preferences.ADD_TEMPFACT_ANN, true), + Cache.getDefault(Preferences.STRUCT_FROM_PDB, true), + Cache.getDefault(Preferences.USE_RNAVIEW, false)); + } + + public static void doConfigureStructurePrefs( + StructureSelectionManager ssm, boolean add_ss_ann, + boolean add_tempfact_ann, boolean struct_from_pdb, + boolean use_rnaview) + { + if (add_ss_ann) + { + ssm.setAddTempFacAnnot(add_tempfact_ann); + ssm.setProcessSecondaryStructure(struct_from_pdb); + // JAL-3915 - RNAView is no longer an option so this has no effect + ssm.setSecStructServices(use_rnaview); + } + else + { + ssm.setAddTempFacAnnot(false); + ssm.setProcessSecondaryStructure(false); + ssm.setSecStructServices(false); + } + } + }