JAL-1705 (new preference option to) hide introns when fetching genomic
[jalview.git] / src / jalview / gui / Preferences.java
index 885a62f..8b33deb 100755 (executable)
@@ -30,6 +30,7 @@ import jalview.jbgui.GPreferences;
 import jalview.jbgui.GSequenceLink;
 import jalview.schemes.ColourSchemeProperty;
 import jalview.util.MessageManager;
+import jalview.ws.sifts.SiftsSettings;
 
 import java.awt.BorderLayout;
 import java.awt.Color;
@@ -87,6 +88,8 @@ public class Preferences extends GPreferences
 
   public static final String SHOW_AUTOCALC_ABOVE = "SHOW_AUTOCALC_ABOVE";
 
+  public static final String HIDE_INTRONS = "HIDE_INTRONS";
+
   private static final int MIN_FONT_SIZE = 1;
 
   private static final int MAX_FONT_SIZE = 30;
@@ -174,11 +177,11 @@ public class Preferences extends GPreferences
     dasTab.add(dasSource, BorderLayout.CENTER);
     wsPrefs = new WsPreferences();
     wsTab.add(wsPrefs, BorderLayout.CENTER);
-    int width = 500, height = 450;
+    int width = 500, height = 470;
     if (new jalview.util.Platform().isAMac())
     {
       width = 570;
-      height = 480;
+      height = 500;
     }
 
     Desktop.addInternalFrame(frame,
@@ -240,6 +243,7 @@ public class Preferences extends GPreferences
     idItalics.setSelected(Cache.getDefault("ID_ITALICS", true));
 
     wrap.setSelected(Cache.getDefault("WRAP_ALIGNMENT", false));
+    hideIntrons.setSelected(Cache.getDefault(HIDE_INTRONS, true));
 
     gapSymbolCB.addItem("-");
     gapSymbolCB.addItem(".");
@@ -322,6 +326,9 @@ public class Preferences extends GPreferences
       nwMapping.setSelected(true);
     }
 
+    SiftsSettings
+            .setMapWithSifts(Cache.getDefault("MAP_WITH_SIFTS", false));
+
     /*
      * Set Connections tab defaults
      */
@@ -454,6 +461,8 @@ public class Preferences extends GPreferences
 
     Cache.applicationProperties.setProperty("WRAP_ALIGNMENT",
             Boolean.toString(wrap.isSelected()));
+    Cache.applicationProperties.setProperty(HIDE_INTRONS,
+            Boolean.toString(hideIntrons.isSelected()));
 
     Cache.applicationProperties.setProperty("STARTUP_FILE",
             startupFileTextfield.getText());
@@ -504,6 +513,7 @@ public class Preferences extends GPreferences
     Cache.setOrRemove(CHIMERA_PATH, chimeraPath.getText());
     Cache.applicationProperties.setProperty("MAP_WITH_SIFTS",
             Boolean.toString(siftsMapping.isSelected()));
+    SiftsSettings.setMapWithSifts(siftsMapping.isSelected());
 
     /*
      * Save Output settings