From: amwaterhouse Date: Mon, 23 May 2005 16:31:07 +0000 (+0000) Subject: make sure fonts are not null X-Git-Tag: Release_2_0~232 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=a33d19728e33ab67aacdb990e190cba2ef53e1af;p=jalview.git make sure fonts are not null --- diff --git a/src/jalview/gui/Preferences.java b/src/jalview/gui/Preferences.java index c11e545..398c5be 100755 --- a/src/jalview/gui/Preferences.java +++ b/src/jalview/gui/Preferences.java @@ -20,9 +20,9 @@ public class Preferences extends GPreferences public static boolean showConservation=true; public static boolean showQuality=true; public static boolean showIdentity=true; - public static String fontName; - public static String fontSize; - public static String fontStyle; + public static String fontName="SansSerif"; + public static String fontSize="10"; + public static String fontStyle=Font.PLAIN+""; public static char gapSymbol='-'; public static String defaultColour=null; public static boolean showStartupFile=true; @@ -62,9 +62,18 @@ public class Preferences extends GPreferences if(string!=null) showFullId = Boolean.valueOf(string).booleanValue(); - fontName = Cache.getProperty("FONT_NAME"); - fontStyle = Cache.getProperty("FONT_STYLE"); - fontSize = Cache.getProperty("FONT_SIZE"); + string = Cache.getProperty("FONT_NAME"); + if (string != null) + fontName = string; + + string = Cache.getProperty("FONT_STYLE"); + if (string != null) + fontStyle = string; + + string = Cache.getProperty("FONT_SIZE"); + if (string != null) + fontSize = string; + string = Cache.getProperty("DEFAULT_COLOUR"); if(string!=null) @@ -83,8 +92,7 @@ public class Preferences extends GPreferences public Preferences() { - if(!preferencesLoaded) - initPreferences(); + initPreferences(); frame = new JInternalFrame(); frame.setContentPane(this);