JAL-1690 'scale protein as cDNA' options in Preferences, FontChooser
[jalview.git] / src / jalview / gui / Preferences.java
index 2a24491..ef9b030 100755 (executable)
  */
 package jalview.gui;
 
-import jalview.analysis.AnnotationSorter.SequenceAnnotationOrder;
-import jalview.bin.Cache;
-import jalview.gui.Help.HelpId;
-import jalview.gui.StructureViewer.ViewerType;
-import jalview.io.JalviewFileChooser;
-import jalview.io.JalviewFileView;
-import jalview.jbgui.GPreferences;
-import jalview.jbgui.GSequenceLink;
-import jalview.schemes.ColourSchemeProperty;
-import jalview.util.MessageManager;
-
 import java.awt.BorderLayout;
 import java.awt.Color;
 import java.awt.Dimension;
@@ -53,6 +42,17 @@ import javax.swing.JPanel;
 
 import ext.edu.ucsf.rbvi.strucviz2.StructureManager;
 
+import jalview.analysis.AnnotationSorter.SequenceAnnotationOrder;
+import jalview.bin.Cache;
+import jalview.gui.Help.HelpId;
+import jalview.gui.StructureViewer.ViewerType;
+import jalview.io.JalviewFileChooser;
+import jalview.io.JalviewFileView;
+import jalview.jbgui.GPreferences;
+import jalview.jbgui.GSequenceLink;
+import jalview.schemes.ColourSchemeProperty;
+import jalview.util.MessageManager;
+
 /**
  * DOCUMENT ME!
  * 
@@ -62,6 +62,8 @@ import ext.edu.ucsf.rbvi.strucviz2.StructureManager;
 public class Preferences extends GPreferences
 {
 
+  public static final String SCALE_PROTEIN_TO_CDNA = "SCALE_PROTEIN_TO_CDNA";
+
   public static final String DEFAULT_COLOUR = "DEFAULT_COLOUR";
 
   public static final String DEFAULT_COLOUR_PROT = "DEFAULT_COLOUR_PROT";
@@ -171,11 +173,11 @@ public class Preferences extends GPreferences
     dasTab.add(dasSource, BorderLayout.CENTER);
     wsPrefs = new WsPreferences();
     wsTab.add(wsPrefs, BorderLayout.CENTER);
-    int width = 500, height = 420;
+    int width = 500, height = 450;
     if (new jalview.util.Platform().isAMac())
     {
       width = 570;
-      height = 460;
+      height = 480;
     }
 
     Desktop.addInternalFrame(frame,
@@ -231,6 +233,8 @@ public class Preferences extends GPreferences
             + ""));
 
     smoothFont.setSelected(Cache.getDefault("ANTI_ALIAS", false));
+    scaleProteinToCdna.setSelected(Cache.getDefault(SCALE_PROTEIN_TO_CDNA,
+            false));
 
     idItalics.setSelected(Cache.getDefault("ID_ITALICS", true));
 
@@ -430,6 +434,8 @@ public class Preferences extends GPreferences
             Boolean.toString(showConsensLogo.isSelected()));
     Cache.applicationProperties.setProperty("ANTI_ALIAS",
             Boolean.toString(smoothFont.isSelected()));
+    Cache.applicationProperties.setProperty(SCALE_PROTEIN_TO_CDNA,
+            Boolean.toString(scaleProteinToCdna.isSelected()));
     Cache.applicationProperties.setProperty("SHOW_NPFEATS_TOOLTIP",
             Boolean.toString(showNpTooltip.isSelected()));
     Cache.applicationProperties.setProperty("SHOW_DBREFS_TOOLTIP",