make sure fonts are not null
authoramwaterhouse <Andrew Waterhouse>
Mon, 23 May 2005 16:31:07 +0000 (16:31 +0000)
committeramwaterhouse <Andrew Waterhouse>
Mon, 23 May 2005 16:31:07 +0000 (16:31 +0000)
src/jalview/gui/Preferences.java

index c11e545..398c5be 100755 (executable)
@@ -20,9 +20,9 @@ public class Preferences extends GPreferences
   public static boolean showConservation=true;\r
   public static boolean showQuality=true;\r
   public static boolean showIdentity=true;\r
-  public static String fontName;\r
-  public static String fontSize;\r
-  public static String fontStyle;\r
+  public static String fontName="SansSerif";\r
+  public static String fontSize="10";\r
+  public static String fontStyle=Font.PLAIN+"";\r
   public static char gapSymbol='-';\r
   public static String defaultColour=null;\r
   public static boolean showStartupFile=true;\r
@@ -62,9 +62,18 @@ public class Preferences extends GPreferences
     if(string!=null)\r
       showFullId = Boolean.valueOf(string).booleanValue();\r
 \r
-  fontName = Cache.getProperty("FONT_NAME");\r
-  fontStyle = Cache.getProperty("FONT_STYLE");\r
-  fontSize = Cache.getProperty("FONT_SIZE");\r
+    string = Cache.getProperty("FONT_NAME");\r
+    if (string != null)\r
+      fontName = string;\r
+\r
+    string = Cache.getProperty("FONT_STYLE");\r
+    if (string != null)\r
+      fontStyle = string;\r
+\r
+    string = Cache.getProperty("FONT_SIZE");\r
+    if (string != null)\r
+      fontSize = string;\r
+\r
 \r
   string = Cache.getProperty("DEFAULT_COLOUR");\r
   if(string!=null)\r
@@ -83,8 +92,7 @@ public class Preferences extends GPreferences
 \r
   public Preferences()\r
   {\r
-    if(!preferencesLoaded)\r
-      initPreferences();\r
+    initPreferences();\r
 \r
     frame = new JInternalFrame();\r
     frame.setContentPane(this);\r