JAL-3485 (enum) constants for Auto-annotation label and preference key
[jalview.git] / src / jalview / gui / Preferences.java
index ab09f74..663390d 100755 (executable)
@@ -40,6 +40,7 @@ import jalview.urls.desktop.DesktopUrlProviderFactory;
 import jalview.util.MessageManager;
 import jalview.util.Platform;
 import jalview.util.UrlConstants;
+import jalview.viewmodel.AlignmentViewport.AutoAnnotation;
 import jalview.ws.sifts.SiftsSettings;
 
 import java.awt.BorderLayout;
@@ -108,8 +109,6 @@ public class Preferences extends GPreferences
 
   public static final String SHOW_AUTOCALC_ABOVE = "SHOW_AUTOCALC_ABOVE";
 
-  public static final String SHOW_OCCUPANCY = "SHOW_OCCUPANCY";
-
   public static final String SHOW_OV_HIDDEN_AT_START = "SHOW_OV_HIDDEN_AT_START";
 
   public static final String USE_LEGACY_GAP = "USE_LEGACY_GAP";
@@ -211,13 +210,17 @@ public class Preferences extends GPreferences
     fullScreen.setSelected(Cache.getDefault("SHOW_FULLSCREEN", false));
     annotations.setSelected(Cache.getDefault("SHOW_ANNOTATIONS", true));
 
-    conservation.setSelected(Cache.getDefault("SHOW_CONSERVATION", true));
-    quality.setSelected(Cache.getDefault("SHOW_QUALITY", true));
-    identity.setSelected(Cache.getDefault("SHOW_IDENTITY", true));
+    conservation.setSelected(Cache
+            .getDefault(AutoAnnotation.CONSERVATION.preferenceKey, true));
+    quality.setSelected(
+            Cache.getDefault(AutoAnnotation.QUALITY.preferenceKey, true));
+    identity.setSelected(
+            Cache.getDefault(AutoAnnotation.CONSENSUS.preferenceKey, true));
     openoverv.setSelected(Cache.getDefault("SHOW_OVERVIEW", false));
     showUnconserved
             .setSelected(Cache.getDefault("SHOW_UNCONSERVED", false));
-    showOccupancy.setSelected(Cache.getDefault(SHOW_OCCUPANCY, false));
+    showOccupancy.setSelected(Cache
+            .getDefault(AutoAnnotation.OCCUPANCY.preferenceKey, false));
     showGroupConsensus
             .setSelected(Cache.getDefault("SHOW_GROUP_CONSENSUS", false));
     showGroupConservation.setSelected(
@@ -582,12 +585,18 @@ public class Preferences extends GPreferences
             Boolean.toString(openoverv.isSelected()));
     Cache.applicationProperties.setProperty("SHOW_ANNOTATIONS",
             Boolean.toString(annotations.isSelected()));
-    Cache.applicationProperties.setProperty("SHOW_CONSERVATION",
+    Cache.applicationProperties.setProperty(
+            AutoAnnotation.CONSERVATION.preferenceKey,
             Boolean.toString(conservation.isSelected()));
-    Cache.applicationProperties.setProperty("SHOW_QUALITY",
+    Cache.applicationProperties.setProperty(
+            AutoAnnotation.QUALITY.preferenceKey,
             Boolean.toString(quality.isSelected()));
-    Cache.applicationProperties.setProperty("SHOW_IDENTITY",
+    Cache.applicationProperties.setProperty(
+            AutoAnnotation.CONSENSUS.preferenceKey,
             Boolean.toString(identity.isSelected()));
+    Cache.applicationProperties.setProperty(
+            AutoAnnotation.OCCUPANCY.preferenceKey,
+            Boolean.toString(showOccupancy.isSelected()));
 
     Cache.applicationProperties.setProperty("GAP_SYMBOL",
             gapSymbolCB.getSelectedItem().toString());
@@ -603,8 +612,6 @@ public class Preferences extends GPreferences
             Boolean.toString(idItalics.isSelected()));
     Cache.applicationProperties.setProperty("SHOW_UNCONSERVED",
             Boolean.toString(showUnconserved.isSelected()));
-    Cache.applicationProperties.setProperty(SHOW_OCCUPANCY,
-            Boolean.toString(showOccupancy.isSelected()));
     Cache.applicationProperties.setProperty("SHOW_GROUP_CONSENSUS",
             Boolean.toString(showGroupConsensus.isSelected()));
     Cache.applicationProperties.setProperty("SHOW_GROUP_CONSERVATION",