Fixed a bug in Am2900; created dlatch8/80; relayouted some components
[Mograsim.git] / net.mograsim.preferences / src / net / mograsim / preferences / Preferences.java
index 70505ca..f249856 100644 (file)
@@ -1,14 +1,16 @@
 package net.mograsim.preferences;
 
+import java.util.Objects;
+
+import org.eclipse.swt.graphics.Color;
+
 public abstract class Preferences
 {
        private static Preferences currentPreferences;
 
        public static void setPreferences(Preferences preferences)
        {
-               if (preferences == null)
-                       throw new NullPointerException();
-               currentPreferences = preferences;
+               currentPreferences = Objects.requireNonNull(preferences);
        }
 
        public static Preferences current()
@@ -18,5 +20,16 @@ public abstract class Preferences
                return currentPreferences;
        }
 
-       public abstract ColorDefinition getColor(String name);
+       public abstract boolean getBoolean(String name);
+
+       public abstract int getInt(String name);
+
+       public abstract double getDouble(String name);
+
+       public abstract ColorDefinition getColorDefinition(String name);
+
+       public Color getColor(String name)
+       {
+               return ColorManager.current().toColor(getColorDefinition(name));
+       }
 }