0a9e43231d856c0162ce4155610de63e98b9e559
[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 ColorDefinition getColorDefinition(String name)
65         {
66                 switch (name)
67                 {
68                 case BIT_ONE_COLOR:
69                         return new ColorDefinition(BuiltInColor.COLOR_GREEN);
70                 case BIT_U_COLOR:
71                         return new ColorDefinition(BuiltInColor.COLOR_CYAN);
72                 case BIT_X_COLOR:
73                         return new ColorDefinition(BuiltInColor.COLOR_RED);
74                 case BIT_Z_COLOR:
75                         return new ColorDefinition(BuiltInColor.COLOR_YELLOW);
76                 case BIT_ZERO_COLOR:
77                         return new ColorDefinition(BuiltInColor.COLOR_GRAY);
78                 case BACKGROUND_COLOR:
79                         return new ColorDefinition(BuiltInColor.COLOR_WHITE);
80                 case FOREGROUND_COLOR:
81                         return new ColorDefinition(BuiltInColor.COLOR_BLACK);
82                 case TEXT_COLOR:
83                         return new ColorDefinition(BuiltInColor.COLOR_BLACK);
84                 default:
85                         throw new IllegalArgumentException("Unknown color preference name: " + name);
86                 }
87         }
88 }