1 package net.mograsim.preferences;
3 import net.mograsim.preferences.ColorDefinition.BuiltInColor;
5 public class DefaultPreferences extends Preferences
8 public boolean getBoolean(String name)
12 case "net.mograsim.logic.model.improvetext":
14 case "net.mograsim.logic.model.debug.openhlsshell":
17 throw new IllegalArgumentException("Unknown boolean preference name: " + name);
22 public int getInt(String name)
26 case "net.mograsim.logic.model.debug.hlsshelldepth":
29 throw new IllegalArgumentException("Unknown int preference name: " + name);
34 public double getDouble(String name)
38 case "net.mograsim.logic.model.linewidth.default":
40 case "net.mograsim.logic.model.linewidth.wire.singlebit":
42 case "net.mograsim.logic.model.linewidth.wire.multibit":
44 case "net.mograsim.logic.model.submodel.zoomalpha0":
46 case "net.mograsim.logic.model.submodel.zoomalpha1":
49 throw new IllegalArgumentException("Unknown double preference name: " + name);
54 public ColorDefinition getColorDefinition(String name)
58 case "net.mograsim.logic.model.color.bit.one":
59 return new ColorDefinition(BuiltInColor.COLOR_GREEN);
60 case "net.mograsim.logic.model.color.bit.u":
61 return new ColorDefinition(BuiltInColor.COLOR_CYAN);
62 case "net.mograsim.logic.model.color.bit.x":
63 return new ColorDefinition(BuiltInColor.COLOR_RED);
64 case "net.mograsim.logic.model.color.bit.z":
65 return new ColorDefinition(BuiltInColor.COLOR_YELLOW);
66 case "net.mograsim.logic.model.color.bit.zero":
67 return new ColorDefinition(BuiltInColor.COLOR_GRAY);
68 case "net.mograsim.logic.model.color.background":
69 return new ColorDefinition(BuiltInColor.COLOR_WHITE);
70 case "net.mograsim.logic.model.color.foreground":
71 return new ColorDefinition(BuiltInColor.COLOR_BLACK);
72 case "net.mograsim.logic.model.color.text":
73 return new ColorDefinition(BuiltInColor.COLOR_BLACK);
75 throw new IllegalArgumentException("Unknown color preference name: " + name);