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":
28 case "net.mograsim.logic.model.button.action":
30 case "net.mograsim.logic.model.button.drag":
32 case "net.mograsim.logic.model.button.zoom":
35 throw new IllegalArgumentException("Unknown int preference name: " + name);
40 public double getDouble(String name)
44 case "net.mograsim.logic.model.linewidth.default":
46 case "net.mograsim.logic.model.linewidth.wire.singlebit":
48 case "net.mograsim.logic.model.linewidth.wire.multibit":
50 case "net.mograsim.logic.model.submodel.zoomalpha0":
52 case "net.mograsim.logic.model.submodel.zoomalpha1":
55 throw new IllegalArgumentException("Unknown double preference name: " + name);
60 public ColorDefinition getColorDefinition(String name)
64 case "net.mograsim.logic.model.color.bit.one":
65 return new ColorDefinition(BuiltInColor.COLOR_GREEN);
66 case "net.mograsim.logic.model.color.bit.u":
67 return new ColorDefinition(BuiltInColor.COLOR_CYAN);
68 case "net.mograsim.logic.model.color.bit.x":
69 return new ColorDefinition(BuiltInColor.COLOR_RED);
70 case "net.mograsim.logic.model.color.bit.z":
71 return new ColorDefinition(BuiltInColor.COLOR_YELLOW);
72 case "net.mograsim.logic.model.color.bit.zero":
73 return new ColorDefinition(BuiltInColor.COLOR_GRAY);
74 case "net.mograsim.logic.model.color.background":
75 return new ColorDefinition(BuiltInColor.COLOR_WHITE);
76 case "net.mograsim.logic.model.color.foreground":
77 return new ColorDefinition(BuiltInColor.COLOR_BLACK);
78 case "net.mograsim.logic.model.color.text":
79 return new ColorDefinition(BuiltInColor.COLOR_BLACK);
81 throw new IllegalArgumentException("Unknown color preference name: " + name);