MainMemoryBlockExtension now throttles firing of content change events
[Mograsim.git] / plugins / net.mograsim.preferences / src / net / mograsim / preferences / DefaultPreferences.java
1 package net.mograsim.preferences;
2
3 import net.mograsim.preferences.ColorDefinition.BuiltInColor;
4
5 public class DefaultPreferences extends Preferences
6 {
7         @Override
8         public boolean getBoolean(String name)
9         {
10                 switch (name)
11                 {
12                 case "net.mograsim.logic.model.improvetext":
13                         return true;
14                 case "net.mograsim.logic.model.debug.openhlsshell":
15                         return false;
16                 default:
17                         throw new IllegalArgumentException("Unknown boolean preference name: " + name);
18                 }
19         }
20
21         @Override
22         public int getInt(String name)
23         {
24                 switch (name)
25                 {
26                 case "net.mograsim.logic.model.debug.hlsshelldepth":
27                         return 0;
28                 case "net.mograsim.logic.model.button.action":
29                         return 3;
30                 case "net.mograsim.logic.model.button.drag":
31                         return 1;
32                 case "net.mograsim.logic.model.button.zoom":
33                         return 2;
34                 case "net.mograsim.plugin.core.simspeedprecision":
35                         return 6;
36                 case "net.mograsim.plugin.core.maxmemchangeinterval":
37                         return 1000;
38                 default:
39                         throw new IllegalArgumentException("Unknown int preference name: " + name);
40                 }
41         }
42
43         @Override
44         public double getDouble(String name)
45         {
46                 switch (name)
47                 {
48                 case "net.mograsim.logic.model.linewidth.default":
49                         return 0.5;
50                 case "net.mograsim.logic.model.linewidth.wire.singlebit":
51                         return 0.5;
52                 case "net.mograsim.logic.model.linewidth.wire.multibit":
53                         return 0.85;
54                 case "net.mograsim.logic.model.submodel.zoomalpha0":
55                         return 0.8;
56                 case "net.mograsim.logic.model.submodel.zoomalpha1":
57                         return 0.9;
58                 default:
59                         throw new IllegalArgumentException("Unknown double preference name: " + name);
60                 }
61         }
62
63         @Override
64         public ColorDefinition getColorDefinition(String name)
65         {
66                 switch (name)
67                 {
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);
84                 default:
85                         throw new IllegalArgumentException("Unknown color preference name: " + name);
86                 }
87         }
88 }