-
Notifications
You must be signed in to change notification settings - Fork 5
/
TwidorConstants.java
149 lines (130 loc) · 4.86 KB
/
TwidorConstants.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
/*
Twidor: the twiddler typing tutor.
Copyright (C) 2005 James Fusia
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA.
*/
/**
* CCG: Twidor- The Twiddler Tutor!
* <pre>
* TwidorConstants.java, the file where we make a whole bunch of silly things
* static. Like Color. And Title. Bleh.
* How dare you write Easily Maintained code!
*
* Revisions:
* 0.5 17 July 2003
* Completed Tutor
* 0.1 22 May 2003
* Created interface TwidorConstants
* </pre>
* @author <a href="mailto:[email protected]">James Fusia</a>
* @version Version 0.5; 17 July 2003
*/
import java.awt.Color;
public interface TwidorConstants {
/**
* Debug Variable
*/
public static final boolean bDEBUG = false;
/**
* Window Attributes
*/
public static final String windowTitle = "Twidor: The Twiddler Tutor!";
public static final int windowX = 640;
public static final int windowY = 400;
public static final int twiddlerX = 120;
public static final Color windowBackground = Color.white;
public static final boolean windowResizable = true;
/**
* button attributes
*/
public static final int buttonX = (twiddlerX - 30) / 6;
public static final int buttonY = windowY * 2 / 15; // 2/3 of 1/4 of 4/5 of windowY
public static final Color buttonBackground = Color.LIGHT_GRAY;
public static final Color buttonHighlight = Color.yellow;
public static final Color mccHighlight = Color.green;
public static final Color twiddlerBackground = Color.GRAY;
/**
* icons
*/
public static final String ICON_RED = "red.gif";
public static final String ICON_BLUE = "blue.gif";
public static final String ICON_GREEN = "green.gif";
/**
* character colors
*/
public static final Color TEXT_DEFAULT = Color.BLACK;
public static final Color TEXT_ERROR = Color.RED;
public static final Color TEXT_GOOD = Color.GRAY;
public static final Color TEXT_BLINK = Color.BLUE;
public static final Color TEXT_BACKGROUND = Color.WHITE;
public static final Color TEXT_CURSOR = Color.BLUE;
public static final String CURSOR = "_";
/**
* Files that are searched for by the program when none are specified
*/
public static final String DEFAULT_KEYMAP = "keymap.txt";
public static final String DEFAULT_LESSON = "lessons.txt";
public static final boolean DEFAULT_THUMB_ORIENTATION = true;
public static final boolean DEFAULT_FINGER_ORIENTATION = true;
/**
* In-program settings
*/
/* Menu stuff: Twidor */
public static final String QUIT_TEXT = "Quit";
/* Tutor */
public static final String HIGHLIGHT_HINT_TEXT = "Highlight Hint";
public boolean HIGHLIGHT_HINT = true;
public static final String HIGHLIGHT_KEYPRESS_TEXT = "Highlight Keypress";
public boolean HIGHLIGHT_KEYPRESS = true;
public static final String HIGHLIGHT_ERRORS_TEXT = "Highlight Errors";
public boolean HIGHLIGHT_ERRORS = true;
/* Twiddler */
public static final String TWIDDLER_SHOW_TEXT = "Show Twiddler";
public boolean TWIDDLER_SHOW = true;
public static final String TWIDDLER_MIRROR_TEXT = "Mirror Twiddler";
public boolean TWIDDLER_MIRROR = false;
public static final String TWIDDLER_SHOW_LETTERS_TEXT = "Show Twiddler Letters";
public boolean TWIDDLER_SHOW_LETTERS = true;
public static final String MACRO_REGEXP = "\"\\w*\"";
/**
* For consistency when accessing the KeyElement button Vector.
*/
public static final int FINGER_OFFSET = 3;
public static final int INDEX_OFFSET = 0;
public static final int MIDDLE_OFFSET = 3;
public static final int RING_OFFSET = 6;
public static final int PINKY_OFFSET = 9;
public static final int THUMB_OFFSET = 12;
public static final int B_NUM = 0;
public static final int B_ALT = 1;
public static final int B_CTRL = 2;
public static final int B_SHIFT = 3;
public static final int B_LEFT = 0;
public static final int B_MIDDLE = 1;
public static final int B_RIGHT = 2;
/**
* And because they might change...
*/
public static final int KEY_BACKSPACE = 8;
public static final int KEY_ENTER = 13;
public static final int KEY_SPACE = 32;
public static final int KEY_DELETE = 127;
/* I'm not sure why this is different from KEY_ENTER, but it makes a
* difference */
public static final int KEY_EOL = 10;
public static final int C = 0;
public static final int F = 1;
public static final int IF = 2;
public static final int INF = 3;
}// end interface TwidorConstants