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":
34 case "net.mograsim.plugin.core.simspeedprecision":
36 case "net.mograsim.plugin.core.maxmemchangeinterval":
39 throw new IllegalArgumentException("Unknown int preference name: " + name);
44 public double getDouble(String name)
48 case "net.mograsim.logic.model.linewidth.default":
50 case "net.mograsim.logic.model.linewidth.wire.singlebit":
52 case "net.mograsim.logic.model.linewidth.wire.multibit":
54 case "net.mograsim.logic.model.submodel.zoomalpha0":
56 case "net.mograsim.logic.model.submodel.zoomalpha1":
59 throw new IllegalArgumentException("Unknown double preference name: " + name);
64 public ColorDefinition getColorDefinition(String name)
68 case "net.mograsim.logic.model.color.bit.one":
69 return new ColorDefinition(BuiltInColor.COLOR_GREEN);
70 case "net.mograsim.logic.model.color.bit.u":
71 return new ColorDefinition(BuiltInColor.COLOR_CYAN);
72 case "net.mograsim.logic.model.color.bit.x":
73 return new ColorDefinition(BuiltInColor.COLOR_RED);
74 case "net.mograsim.logic.model.color.bit.z":
75 return new ColorDefinition(BuiltInColor.COLOR_YELLOW);
76 case "net.mograsim.logic.model.color.bit.zero":
77 return new ColorDefinition(BuiltInColor.COLOR_GRAY);
78 case "net.mograsim.logic.model.color.background":
79 return new ColorDefinition(BuiltInColor.COLOR_WHITE);
80 case "net.mograsim.logic.model.color.foreground":
81 return new ColorDefinition(BuiltInColor.COLOR_BLACK);
82 case "net.mograsim.logic.model.color.text":
83 return new ColorDefinition(BuiltInColor.COLOR_BLACK);
85 throw new IllegalArgumentException("Unknown color preference name: " + name);