comparison src/org/tn5250j/TN5250jConstants.java @ 107:afe6962769b9

use hash map rather than linear search thru arrays
author Carl Byington <carl@five-ten-sg.com>
date Wed, 18 Jun 2014 11:43:08 -0700
parents bf01d1eec5c6
children ae3092cd9cbf
comparison
equal deleted inserted replaced
106:12425771714d 107:afe6962769b9
18 * Boston, MA 02111-1307 USA 18 * Boston, MA 02111-1307 USA
19 * 19 *
20 */ 20 */
21 21
22 package org.tn5250j; 22 package org.tn5250j;
23 import java.util.HashMap;
23 24
24 public interface TN5250jConstants { 25 public interface TN5250jConstants {
25 26
26 // Version information 27 // Version information
27 public static final String tn5250jRelease = "0"; 28 public static final String tn5250jRelease = "0";
28 public static final String tn5250jVersion = ".7"; 29 public static final String tn5250jVersion = ".7";
29 public static final String tn5250jSubVer= ".3"; 30 public static final String tn5250jSubVer= ".3";
30 31
31 public static final String VERSION_INFO = tn5250jRelease + tn5250jVersion + tn5250jSubVer; 32 public static final String VERSION_INFO = tn5250jRelease + tn5250jVersion + tn5250jSubVer;
32 33
33 // STATE 34 // STATE
34 static final int STATE_DISCONNECTED = 0; 35 static final int STATE_DISCONNECTED = 0;
35 static final int STATE_CONNECTED = 1; 36 static final int STATE_CONNECTED = 1;
182 public static final int PF21 = 0xB9; 183 public static final int PF21 = 0xB9;
183 public static final int PF22 = 0xBA; 184 public static final int PF22 = 0xBA;
184 public static final int PF23 = 0xBB; 185 public static final int PF23 = 0xBB;
185 public static final int PF24 = 0xBC; 186 public static final int PF24 = 0xBC;
186 187
187 public static final String mnemonicData[] = { 188 public static final HashMap<String,Integer> mnemonicMap = new HashMap<String,Integer>();
188 "[backspace]", "[backtab]", "[up]", "[down]", "[left]", 189 static {
189 "[right]", "[delete]", "[tab]", "[eof]", "[eraseeof]", 190 mnemonicMap.put("[backspace]", 1001);
190 "[erasefld]", "[insert]", "[home]", "[keypad0]", "[keypad1]", 191 mnemonicMap.put("[backtab]", 1002);
191 "[keypad2]", "[keypad3]", "[keypad4]", "[keypad5]", "[keypad6]", 192 mnemonicMap.put("[up]", 1003);
192 "[keypad7]", "[keypad8]", "[keypad9]", "[keypad.]", "[keypad,]", 193 mnemonicMap.put("[down]", 1004);
193 "[keypad-]", "[fldext]", "[field+]", "[field-]", "[bof]", 194 mnemonicMap.put("[left]", 1005);
194 "[enter]","[pf1]","[pf2]","[pf3]","[pf4]", 195
195 "[pf5]","[pf6]","[pf7]","[pf8]","[pf9]", 196 mnemonicMap.put("[right]", 1006);
196 "[pf10]","[pf11]","[pf12]","[pf13]","[pf14]", 197 mnemonicMap.put("[delete]", 1007);
197 "[pf15]","[pf16]","[pf17]","[pf18]","[pf19]", 198 mnemonicMap.put("[tab]", 1008);
198 "[pf20]","[pf21]","[pf22]","[pf23]","[pf24]", 199 mnemonicMap.put("[eof]", 1009);
199 "[clear]", "[help]", "[pgup]", "[pgdown]", "[rollleft]", 200 mnemonicMap.put("[eraseeof]", 1010);
200 "[rollright]", "[hostprint]", "[pa1]", "[pa2]", "[pa3]", 201
201 "[sysreq]","[reset]","[nextword]", "[prevword]", "[copy]", 202 mnemonicMap.put("[erasefld]", 1011);
202 "[paste]","[attn]","[markup]", "[markdown]", "[markleft]", 203 mnemonicMap.put("[insert]", 1012);
203 "[markright]","[dupfield]","[newline]","[jumpnext]","[jumpprev]", 204 mnemonicMap.put("[home]", 1013);
204 "[opennew]","[togcon]","[hotspots]","[gui]","[dspmsgs]", 205 mnemonicMap.put("[keypad0]", 1014);
205 "[dspattr]","[print]","[cursor]","[debug]","[close]", 206 mnemonicMap.put("[keypad1]", 1015);
206 "[transfer]","[e-mail]","[runscript]","[spoolfile]","[quick-mail]", 207
207 "[open-same]","[fastcursordown]","[fastcursorup]","[fastcursorright]","[fastcursorleft]" 208 mnemonicMap.put("[keypad2]", 1016);
208 }; 209 mnemonicMap.put("[keypad3]", 1017);
209 210 mnemonicMap.put("[keypad4]", 1018);
210 public static final int mnemonicValue[] = { 211 mnemonicMap.put("[keypad5]", 1019);
211 1001, 1002, 1003, 1004, 1005, 212 mnemonicMap.put("[keypad6]", 1020);
212 1006, 1007, 1008, 1009, 1010, 213
213 1011, 1012, 1013, 1014, 1015, 214 mnemonicMap.put("[keypad7]", 1021);
214 1016, 1017, 1018, 1019, 1020, 215 mnemonicMap.put("[keypad8]", 1022);
215 1021, 1022, 1023, 1024, 1025, 216 mnemonicMap.put("[keypad9]", 1023);
216 1026, 1027, 1028, 1029, 1030, 217 mnemonicMap.put("[keypad.]", 1024);
217 0xF1, 0x31, 0x32, 0x33, 0x34, 218 mnemonicMap.put("[keypad,]", 1025);
218 0x35, 0x36, 0x37, 0x38, 0x39, 219
219 0x3A, 0x3B, 0x3C, 0xB1, 0xB2, 220 mnemonicMap.put("[keypad-]", 1026);
220 0xB3, 0xB4, 0xB5, 0xB6, 0xB7, 221 mnemonicMap.put("[fldext]", 1027);
221 0xB8, 0xB9, 0xBA, 0xBB, 0xBC, 222 mnemonicMap.put("[field+]", 1028);
222 0xBD, 0xF3, 0xF4, 0xF5, 0xD9, 223 mnemonicMap.put("[field-]", 1029);
223 0xDA, 0xF6, 0x6C, 0x6E, 0x6B, 224 mnemonicMap.put("[bof]", 1030);
224 1031, 1032, 1033, 1034, 1035, 225
225 1036, 1037, 1038, 1039, 1040, 226 mnemonicMap.put("[enter]", 0xF1);
226 1041, 1042, 1043, 5000, 5001, 227 mnemonicMap.put("[pf1]", 0x31);
227 5002, 5003, 5004, 5005, 5006, 228 mnemonicMap.put("[pf2]", 0x32);
228 5007, 5008, 5009, 5010, 5011, 229 mnemonicMap.put("[pf3]", 0x33);
229 5012, 5013, 5014, 5015, 5016, 230 mnemonicMap.put("[pf4]", 0x34);
230 5017, 5018, 5019, 5020, 5021 231
231 }; 232 mnemonicMap.put("[pf5]", 0x35);
233 mnemonicMap.put("[pf6]", 0x36);
234 mnemonicMap.put("[pf7]", 0x37);
235 mnemonicMap.put("[pf8]", 0x38);
236 mnemonicMap.put("[pf9]", 0x39);
237
238 mnemonicMap.put("[pf10]", 0x3A);
239 mnemonicMap.put("[pf11]", 0x3B);
240 mnemonicMap.put("[pf12]", 0x3C);
241 mnemonicMap.put("[pf13]", 0xB1);
242 mnemonicMap.put("[pf14]", 0xB2);
243
244 mnemonicMap.put("[pf15]", 0xB3);
245 mnemonicMap.put("[pf16]", 0xB4);
246 mnemonicMap.put("[pf17]", 0xB5);
247 mnemonicMap.put("[pf18]", 0xB6);
248 mnemonicMap.put("[pf19]", 0xB7);
249
250 mnemonicMap.put("[pf20]", 0xB8);
251 mnemonicMap.put("[pf21]", 0xB9);
252 mnemonicMap.put("[pf22]", 0xBA);
253 mnemonicMap.put("[pf23]", 0xBB);
254 mnemonicMap.put("[pf24]", 0xBC);
255
256 mnemonicMap.put("[clear]", 0xBD);
257 mnemonicMap.put("[help]", 0xF3);
258 mnemonicMap.put("[pgup]", 0xF4);
259 mnemonicMap.put("[pgdown]", 0xF5);
260 mnemonicMap.put("[rollleft]", 0xD9);
261
262 mnemonicMap.put("[rollright]", 0xDA);
263 mnemonicMap.put("[hostprint]", 0xF6);
264 mnemonicMap.put("[pa1]", 0x6C);
265 mnemonicMap.put("[pa2]", 0x6E);
266 mnemonicMap.put("[pa3]", 0x6B);
267
268 mnemonicMap.put("[sysreq]", 1031);
269 mnemonicMap.put("[reset]", 1032);
270 mnemonicMap.put("[nextword]", 1033);
271 mnemonicMap.put("[prevword]", 1034);
272 mnemonicMap.put("[copy]", 1035);
273
274 mnemonicMap.put("[paste]", 1036);
275 mnemonicMap.put("[attn]", 1037);
276 mnemonicMap.put("[markup]", 1038);
277 mnemonicMap.put("[markdown]", 1039);
278 mnemonicMap.put("[markleft]", 1040);
279
280 mnemonicMap.put("[markright]", 1041);
281 mnemonicMap.put("[dupfield]", 1042);
282 mnemonicMap.put("[newline]", 1043);
283 mnemonicMap.put("[jumpnext]", 5000);
284 mnemonicMap.put("[jumpprev]", 5001);
285
286 mnemonicMap.put("[opennew]", 5002);
287 mnemonicMap.put("[togcon]", 5003);
288 mnemonicMap.put("[hotspots]", 5004);
289 mnemonicMap.put("[gui]", 5005);
290 mnemonicMap.put("[dspmsgs]", 5006);
291
292 mnemonicMap.put("[dspattr]", 5007);
293 mnemonicMap.put("[print]", 5008);
294 mnemonicMap.put("[cursor]", 5009);
295 mnemonicMap.put("[debug]", 5010);
296 mnemonicMap.put("[close]", 5011);
297
298 mnemonicMap.put("[transfer]", 5012);
299 mnemonicMap.put("[e-mail]", 5013);
300 mnemonicMap.put("[runscript]", 5014);
301 mnemonicMap.put("[spoolfile]", 5015);
302 mnemonicMap.put("[quick-mail]", 5016);
303
304 mnemonicMap.put("[open-same]", 5017);
305 mnemonicMap.put("[fastcursordown]", 5018);
306 mnemonicMap.put("[fastcursorup]", 5019);
307 mnemonicMap.put("[fastcursorright]", 5020);
308 mnemonicMap.put("[fastcursorleft]", 5021);
309 };
232 310
233 public static final String MNEMONIC_CLEAR = "[clear]"; 311 public static final String MNEMONIC_CLEAR = "[clear]";
234 public static final String MNEMONIC_ENTER = "[enter]"; 312 public static final String MNEMONIC_ENTER = "[enter]";
235 public static final String MNEMONIC_HELP = "[help]"; 313 public static final String MNEMONIC_HELP = "[help]";
236 public static final String MNEMONIC_PAGE_DOWN = "[pgdown]"; 314 public static final String MNEMONIC_PAGE_DOWN = "[pgdown]";
424 public static final char COLOR_FG_LIGHT_CYAN = 0xB; 502 public static final char COLOR_FG_LIGHT_CYAN = 0xB;
425 public static final char COLOR_FG_LIGHT_RED = 0xC; 503 public static final char COLOR_FG_LIGHT_RED = 0xC;
426 public static final char COLOR_FG_LIGHT_MAGENTA = 0xD; 504 public static final char COLOR_FG_LIGHT_MAGENTA = 0xD;
427 public static final char COLOR_FG_BROWN = 0xE; 505 public static final char COLOR_FG_BROWN = 0xE;
428 public static final char COLOR_FG_WHITE_HIGH = 0xF; 506 public static final char COLOR_FG_WHITE_HIGH = 0xF;
429 507
430 public static final int EXTENDED_5250_REVERSE = 0x10; 508 public static final int EXTENDED_5250_REVERSE = 0x10;
431 public static final int EXTENDED_5250_UNDERLINE = 0x08; 509 public static final int EXTENDED_5250_UNDERLINE = 0x08;
432 public static final int EXTENDED_5250_BLINK = 0x04; 510 public static final int EXTENDED_5250_BLINK = 0x04;
433 public static final int EXTENDED_5250_COL_SEP = 0x02; 511 public static final int EXTENDED_5250_COL_SEP = 0x02;
434 public static final int EXTENDED_5250_NON_DSP = 0x01; 512 public static final int EXTENDED_5250_NON_DSP = 0x01;