JAL-2476 ability to drag and drop score matrix file to desktop, simplify
[jalview.git] / src / jalview / gui / Preferences.java
index fbf31ff..cf80a6d 100755 (executable)
@@ -29,7 +29,9 @@ import jalview.io.JalviewFileChooser;
 import jalview.io.JalviewFileView;
 import jalview.jbgui.GPreferences;
 import jalview.jbgui.GSequenceLink;
-import jalview.schemes.ColourSchemeProperty;
+import jalview.schemes.ColourSchemeI;
+import jalview.schemes.ColourSchemes;
+import jalview.schemes.ResidueColourScheme;
 import jalview.urls.UrlLinkTableModel;
 import jalview.urls.api.UrlProviderFactoryI;
 import jalview.urls.api.UrlProviderI;
@@ -284,12 +286,16 @@ public class Preferences extends GPreferences
     /*
      * Set Colours tab defaults
      */
-    for (int i = ColourSchemeProperty.FIRST_COLOUR; i <= ColourSchemeProperty.LAST_COLOUR; i++)
+    protColour.addItem(ResidueColourScheme.NONE);
+    nucColour.addItem(ResidueColourScheme.NONE);
+    for (ColourSchemeI cs : ColourSchemes.getInstance().getColourSchemes())
     {
-      protColour.addItem(ColourSchemeProperty.getColourName(i));
-      nucColour.addItem(ColourSchemeProperty.getColourName(i));
+      String name = cs.getSchemeName();
+      protColour.addItem(name);
+      nucColour.addItem(name);
     }
-    String oldProp = Cache.getDefault(DEFAULT_COLOUR, "None");
+    String oldProp = Cache.getDefault(DEFAULT_COLOUR,
+            ResidueColourScheme.NONE);
     String newProp = Cache.getDefault(DEFAULT_COLOUR_PROT, null);
     protColour.setSelectedItem(newProp != null ? newProp : oldProp);
     newProp = Cache.getDefault(DEFAULT_COLOUR_NUC, null);
@@ -459,8 +465,6 @@ public class Preferences extends GPreferences
 
     useProxy.setSelected(Cache.getDefault("USE_PROXY", false));
     useProxy_actionPerformed(); // make sure useProxy is correctly initialised
-    proxyServerTB.setEnabled(useProxy.isSelected());
-    proxyPortTB.setEnabled(useProxy.isSelected());
     proxyServerTB.setText(Cache.getDefault("PROXY_SERVER", ""));
     proxyPortTB.setText(Cache.getDefault("PROXY_PORT", ""));
 
@@ -809,7 +813,7 @@ public class Preferences extends GPreferences
       if (format != null)
       {
         Cache.applicationProperties.setProperty("DEFAULT_FILE_FORMAT",
-                format.toString());
+                format.getName());
       }
       startupFileTextfield.setText(chooser.getSelectedFile()
               .getAbsolutePath());