JAL-4290 Add method to allow for specific settings. Revert setting show annotations.
authorBen Soares <b.soares@dundee.ac.uk>
Fri, 15 Dec 2023 21:29:59 +0000 (21:29 +0000)
committerBen Soares <b.soares@dundee.ac.uk>
Fri, 15 Dec 2023 21:29:59 +0000 (21:29 +0000)
src/jalview/bin/Commands.java
src/jalview/structure/StructureSelectionManager.java

index ece573d..5f723c1 100644 (file)
@@ -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)
index 5865b7f..9a9e2a2 100644 (file)
@@ -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
     {