JAL-1152 annotation sorting preferences and help documentation
[jalview.git] / src / jalview / bin / Cache.java
index 2a9f53d..21a030b 100755 (executable)
@@ -32,8 +32,11 @@ import java.io.InputStream;
 import java.io.InputStreamReader;
 import java.text.DateFormat;
 import java.text.SimpleDateFormat;
+import java.util.Collections;
 import java.util.Date;
+import java.util.Enumeration;
 import java.util.Properties;
+import java.util.TreeSet;
 
 import org.apache.log4j.ConsoleAppender;
 import org.apache.log4j.Level;
@@ -204,13 +207,26 @@ public class Cache
 
   public static final String DAS_ACTIVE_SOURCE = "DAS_ACTIVE_SOURCE";
 
+  /*
+   * Property key/value constants
+   */
+  public static final String SORT_ANNOTATIONS = "SORT_ANNOTATIONS";
+
+  public static final String SHOW_AUTOCALC_ABOVE = "SHOW_AUTOCALC_ABOVE";
+
   /**
    * Initialises the Jalview Application Log
    */
   public static Logger log;
 
   /** Jalview Properties */
-  public static Properties applicationProperties = new Properties();
+  public static Properties applicationProperties = new Properties() {
+    // override results in properties output in alphabetical order
+    @Override
+    public synchronized Enumeration<Object> keys() {
+        return Collections.enumeration(new TreeSet<Object>(super.keySet()));
+    }
+  };
 
   /** Default file is ~/.jalview_properties */
   static String propertiesFile;