From 89f6194d4bba6f8c9efa916e02e6fba2130c5e0f Mon Sep 17 00:00:00 2001 From: Ben Soares Date: Fri, 15 Dec 2023 21:29:59 +0000 Subject: [PATCH] JAL-4290 Add method to allow for specific settings. Revert setting show annotations. --- src/jalview/bin/Commands.java | 3 ++- .../structure/StructureSelectionManager.java | 23 ++++++++++++++------ 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/src/jalview/bin/Commands.java b/src/jalview/bin/Commands.java index ece573d..5f723c1 100644 --- a/src/jalview/bin/Commands.java +++ b/src/jalview/bin/Commands.java @@ -908,7 +908,8 @@ public class Commands boolean showSSAnnotations, boolean showAnnotations, boolean hideTFrows) { - af.setAnnotationsVisibility(true, showSSAnnotations, showAnnotations); + af.setAnnotationsVisibility(showSSAnnotations, true, false); + af.setAnnotationsVisibility(showAnnotations, false, true); // show temperature factor annotations? if (hideTFrows) diff --git a/src/jalview/structure/StructureSelectionManager.java b/src/jalview/structure/StructureSelectionManager.java index 5865b7f..9a9e2a2 100644 --- a/src/jalview/structure/StructureSelectionManager.java +++ b/src/jalview/structure/StructureSelectionManager.java @@ -1670,15 +1670,24 @@ public class StructureSelectionManager public static void doConfigureStructurePrefs( StructureSelectionManager ssm) { - if (Cache.getDefault(Preferences.ADD_SS_ANN, true)) + 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( - Cache.getDefault(Preferences.ADD_TEMPFACT_ANN, true)); - ssm.setProcessSecondaryStructure( - Cache.getDefault(Preferences.STRUCT_FROM_PDB, true)); + 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( - Cache.getDefault(Preferences.USE_RNAVIEW, false)); + ssm.setSecStructServices(use_rnaview); } else { -- 1.7.10.2