43d58c7fc8aba557f0798e74e63f288bd06d84ae
[Mograsim.git] /
1 package net.mograsim.logic.model.preferences;
2
3 import net.mograsim.preferences.ColorDefinition;
4 import net.mograsim.preferences.ColorDefinition.BuiltInColor;
5 import net.mograsim.preferences.DefaultPreferences;
6
7 public class DefaultRenderPreferences extends DefaultPreferences implements RenderPreferences
8 {
9         @Override
10         public boolean getBoolean(String name)
11         {
12                 switch (name)
13                 {
14                 case IMPROVE_SCALING:
15                         return true;
16                 case DEBUG_OPEN_HLSSHELL:
17                         return false;
18                 default:
19                         throw new IllegalArgumentException("Unknown boolean preference name: " + name);
20                 }
21         }
22
23         @Override
24         public int getInt(String name)
25         {
26                 switch (name)
27                 {
28                 case DEBUG_HLSSHELL_DEPTH:
29                         return 0;
30                 case ACTION_BUTTON:
31                         return 1;
32                 case DRAG_BUTTON:
33                         return 3;
34                 case ZOOM_BUTTON:
35                         return 2;
36                 default:
37                         throw new IllegalArgumentException("Unknown int preference name: " + name);
38                 }
39         }
40
41         @Override
42         public double getDouble(String name)
43         {
44                 switch (name)
45                 {
46                 case LINE_DASH_IMPROVEMENT_FACTOR:
47                         return 100.0;
48                 case DEFAULT_LINE_WIDTH:
49                         return 0.5;
50                 case WIRE_WIDTH_SINGLEBIT:
51                         return 0.5;
52                 case WIRE_WIDTH_MULTIBIT:
53                         return 0.85;
54                 case SUBMODEL_ZOOM_ALPHA_0:
55                         return 0.1;
56                 case SUBMODEL_ZOOM_ALPHA_1:
57                         return 0.2;
58                 default:
59                         throw new IllegalArgumentException("Unknown double preference name: " + name);
60                 }
61         }
62
63         @Override
64         public String getString(String name)
65         {
66                 switch (name)
67                 {
68                 default:
69                         throw new IllegalArgumentException("Unknown string preference name: " + name);
70                 }
71         }
72
73         @Override
74         public ColorDefinition getColorDefinition(String name)
75         {
76                 switch (name)
77                 {
78                 case BIT_ONE_COLOR:
79                         return new ColorDefinition(BuiltInColor.COLOR_GREEN);
80                 case BIT_U_COLOR:
81                         return new ColorDefinition(BuiltInColor.COLOR_CYAN);
82                 case BIT_X_COLOR:
83                         return new ColorDefinition(BuiltInColor.COLOR_RED);
84                 case BIT_Z_COLOR:
85                         return new ColorDefinition(BuiltInColor.COLOR_YELLOW);
86                 case BIT_ZERO_COLOR:
87                         return new ColorDefinition(BuiltInColor.COLOR_GRAY);
88                 case BACKGROUND_COLOR:
89                         return new ColorDefinition(BuiltInColor.COLOR_WHITE);
90                 case FOREGROUND_COLOR:
91                         return new ColorDefinition(BuiltInColor.COLOR_BLACK);
92                 case TEXT_COLOR:
93                         return new ColorDefinition(BuiltInColor.COLOR_BLACK);
94                 default:
95                         throw new IllegalArgumentException("Unknown color preference name: " + name);
96                 }
97         }
98 }