Mercurial > 510Connectbot
annotate app/src/main/java/org/tn5250j/framework/tn5250/Screen5250.java @ 475:0fb80a0d6be9
add fg/bg color setting to global:// section of deployment.connections file
author | Carl Byington <carl@five-ten-sg.com> |
---|---|
date | Sun, 20 Oct 2019 14:08:46 -0700 |
parents | d29cce60f393 |
children |
rev | line source |
---|---|
183
97848d5dd28f
automatic reset to clear error codes on next keystroke
Carl Byington <carl@five-ten-sg.com>
parents:
152
diff
changeset
|
1 /* |
3 | 2 * Title: Screen5250.java |
3 * Copyright: Copyright (c) 2001 - 2004 | |
4 * Company: | |
5 * @author Kenneth J. Pouncey | |
6 * @version 0.5 | |
7 * | |
8 * Description: | |
9 * | |
10 * This program is free software; you can redistribute it and/or modify | |
11 * it under the terms of the GNU General Public License as published by | |
12 * the Free Software Foundation; either version 2, or (at your option) | |
13 * any later version. | |
14 * | |
15 * This program is distributed in the hope that it will be useful, | |
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
18 * GNU General Public License for more details. | |
19 * | |
20 * You should have received a copy of the GNU General Public License | |
21 * along with this software; see the file COPYING. If not, write to | |
22 * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, | |
23 * Boston, MA 02111-1307 USA | |
24 * | |
25 */ | |
26 package org.tn5250j.framework.tn5250; | |
27 | |
28 import static org.tn5250j.TN5250jConstants.*; | |
29 | |
30 import java.text.DecimalFormat; | |
31 import java.text.DecimalFormatSymbols; | |
32 import java.text.NumberFormat; | |
33 import java.text.ParseException; | |
34 import java.util.Vector; | |
35 | |
36 import org.tn5250j.TN5250jConstants; | |
108
ae3092cd9cbf
use hash map rather than linear search thru arrays
Carl Byington <carl@five-ten-sg.com>
parents:
107
diff
changeset
|
37 |
25
5949eb469a79
adding tn5250 files, native android logging
Carl Byington <carl@five-ten-sg.com>
parents:
10
diff
changeset
|
38 import android.util.Log; |
108
ae3092cd9cbf
use hash map rather than linear search thru arrays
Carl Byington <carl@five-ten-sg.com>
parents:
107
diff
changeset
|
39 import de.mud.terminal.VDUBuffer; |
33
2a8b52dbc104
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
32
diff
changeset
|
40 import de.mud.terminal.vt320; |
140
4fe73e73d4d7
fill vt320 buffer from tn5250 buffer when font size shrinks
Carl Byington <carl@five-ten-sg.com>
parents:
139
diff
changeset
|
41 import com.five_ten_sg.connectbot.service.FontSizeChangedListener; |
4fe73e73d4d7
fill vt320 buffer from tn5250 buffer when font size shrinks
Carl Byington <carl@five-ten-sg.com>
parents:
139
diff
changeset
|
42 |
4fe73e73d4d7
fill vt320 buffer from tn5250 buffer when font size shrinks
Carl Byington <carl@five-ten-sg.com>
parents:
139
diff
changeset
|
43 |
4fe73e73d4d7
fill vt320 buffer from tn5250 buffer when font size shrinks
Carl Byington <carl@five-ten-sg.com>
parents:
139
diff
changeset
|
44 public class Screen5250 implements FontSizeChangedListener { |
26
9ae1c889a64c
adding tn5250 files, native android logging
Carl Byington <carl@five-ten-sg.com>
parents:
25
diff
changeset
|
45 private static final String TAG = "Screen5250"; |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
46 private ScreenFields screenFields; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
47 private int lastAttr; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
48 private int lastPos; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
49 private int lenScreen; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
50 private KeyStrokenizer strokenizer; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
51 private tnvt sessionVT; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
52 private vt320 buffer; // used to draw the screen |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
53 private int numRows = 0; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
54 private int numCols = 0; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
55 protected static final int initAttr = 32; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
56 protected static final char initChar = 0; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
57 public boolean cursorActive = false; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
58 public boolean cursorShown = false; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
59 protected boolean insertMode = false; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
60 private boolean keyProcessed = false; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
61 private Rect dirtyScreen = new Rect(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
62 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
63 public int homePos = 0; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
64 public int saveHomePos = 0; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
65 private String bufferedKeys; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
66 public boolean pendingInsert = false; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
67 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
68 public final static byte STATUS_SYSTEM = 1; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
69 public final static byte STATUS_ERROR_CODE = 2; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
70 public final static byte STATUS_VALUE_ON = 1; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
71 public final static byte STATUS_VALUE_OFF = 2; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
72 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
73 private StringBuffer hsMore = new StringBuffer("More..."); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
74 private StringBuffer hsBottom = new StringBuffer("Bottom"); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
75 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
76 // error codes to be sent to the host on an error |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
77 private final static int ERR_CURSOR_PROTECTED = 0x05; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
78 private final static int ERR_INVALID_SIGN = 0x11; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
79 private final static int ERR_NO_ROOM_INSERT = 0x12; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
80 private final static int ERR_NUMERIC_ONLY = 0x09; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
81 private final static int ERR_DUP_KEY_NOT_ALLOWED = 0x19; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
82 private final static int ERR_NUMERIC_09 = 0x10; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
83 private final static int ERR_FIELD_MINUS = 0x16; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
84 private final static int ERR_FIELD_EXIT_INVALID = 0x18; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
85 private final static int ERR_ENTER_NO_ALLOWED = 0x20; |
348
29076621bab0
merge tn5250j r1227; fix spelling
Carl Byington <carl@five-ten-sg.com>
parents:
307
diff
changeset
|
86 private final static int ERR_MANDATORY_ENTER = 0x21; |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
87 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
88 private boolean guiInterface = false; |
183
97848d5dd28f
automatic reset to clear error codes on next keystroke
Carl Byington <carl@five-ten-sg.com>
parents:
152
diff
changeset
|
89 private boolean resetRequired = false; |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
90 private boolean backspaceError = true; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
91 private boolean feError; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
92 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
93 // Operator Information Area |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
94 private ScreenOIA oia; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
95 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
96 // screen planes |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
97 protected ScreenPlanes planes; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
98 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
99 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
100 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
101 public Screen5250() { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
102 try { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
103 jbInit(); |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
104 } |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
105 catch (Exception ex) { |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
106 Log.w(TAG, "In constructor: ", ex); |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
107 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
108 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
109 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
110 void jbInit() throws Exception { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
111 lastAttr = 32; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
112 // default number of rows and columns |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
113 numRows = 24; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
114 numCols = 80; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
115 setCursor(1, 1); // set initial cursor position |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
116 oia = new ScreenOIA(this); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
117 oia.setKeyBoardLocked(true); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
118 lenScreen = numRows * numCols; |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
119 planes = new ScreenPlanes(this, numRows); |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
120 screenFields = new ScreenFields(this); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
121 strokenizer = new KeyStrokenizer(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
122 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
123 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
124 protected ScreenPlanes getPlanes() { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
125 return planes; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
126 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
127 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
128 public final ScreenOIA getOIA() { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
129 return oia; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
130 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
131 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
132 protected final void setRowsCols(int rows, int cols) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
133 int oldRows = numRows; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
134 int oldCols = numCols; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
135 // default number of rows and columns |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
136 numRows = rows; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
137 numCols = cols; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
138 lenScreen = numRows * numCols; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
139 planes.setSize(rows); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
140 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
141 // If they are not the same then we need to inform the listeners that |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
142 // the size changed. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
143 if (oldRows != numRows || oldCols != numCols) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
144 fireScreenSizeChanged(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
145 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
146 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
147 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
148 public boolean isCursorActive() { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
149 return cursorActive; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
150 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
151 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
152 public boolean isCursorShown() { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
153 return cursorShown; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
154 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
155 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
156 public void setUseGUIInterface(boolean gui) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
157 guiInterface = gui; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
158 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
159 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
160 public void toggleGUIInterface() { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
161 guiInterface = !guiInterface; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
162 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
163 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
164 public void setResetRequired(boolean reset) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
165 resetRequired = reset; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
166 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
167 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
168 public void setBackspaceError(boolean onError) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
169 backspaceError = onError; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
170 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
171 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
172 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
173 * Copy & Paste support |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
174 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
175 * @see {@link #pasteText(String, boolean)} |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
176 * @see {@link #copyTextField(int)} |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
177 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
178 public final String copyText(Rect area) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
179 StringBuilder sb = new StringBuilder(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
180 Rect workR = new Rect(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
181 workR.setBounds(area); |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
182 Log.d(TAG, "Copying " + workR); |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
183 // loop through all the screen characters to send them to the clip board |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
184 int m = workR.x; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
185 int i = 0; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
186 int t = 0; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
187 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
188 while (workR.height-- > 0) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
189 t = workR.width; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
190 i = workR.y; |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
191 |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
192 while (t-- > 0) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
193 // only copy printable characters (in this case >= ' ') |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
194 char c = planes.getChar(getPos(m - 1, i - 1)); |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
195 |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
196 if (c >= ' ' && (planes.screenExtended[getPos(m - 1, i - 1)] & EXTENDED_5250_NON_DSP) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
197 == 0) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
198 sb.append(c); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
199 else |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
200 sb.append(' '); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
201 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
202 i++; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
203 } |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
204 |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
205 sb.append('\n'); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
206 m++; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
207 } |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
208 |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
209 return sb.toString(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
210 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
211 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
212 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
213 * Copy & Paste support |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
214 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
215 * @param content |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
216 * @see {@link #copyText(Rectangle)} |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
217 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
218 public final void pasteText(String content, boolean special) { |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
219 Log.d(TAG, "Pasting, special:" + special); |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
220 setCursorActive(false); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
221 StringBuilder sb = new StringBuilder(content); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
222 StringBuilder pd = new StringBuilder(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
223 // character counters within the string to be pasted. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
224 int nextChar = 0; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
225 int nChars = sb.length(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
226 int lr = getRow(lastPos); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
227 int lc = getCol(lastPos); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
228 resetDirty(lastPos); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
229 int cpos = lastPos; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
230 int length = getScreenLength(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
231 char c = 0; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
232 boolean setIt; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
233 // save our current place within the FFT. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
234 screenFields.saveCurrentField(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
235 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
236 for (int x = nextChar; x < nChars; x++) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
237 c = sb.charAt(x); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
238 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
239 if ((c == '\n') || (c == '\r')) { |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
240 Log.i(TAG, "pasted cr-lf>" + pd + "<"); |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
241 pd.setLength(0); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
242 // if we read in a cr lf in the data stream we need to go |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
243 // to the starting column of the next row and start from there |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
244 cpos = getPos(getRow(cpos) + 1, lc); |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
245 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
246 // If we go paste the end of the screen then let's start over from |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
247 // the beginning of the screen space. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
248 if (cpos > length) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
249 cpos = 0; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
250 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
251 else { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
252 // we will default to set the character always. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
253 setIt = true; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
254 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
255 // If we are in a special paste scenario then we check for valid |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
256 // characters to paste. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
257 if (special && (!Character.isLetter(c) && !Character.isDigit(c))) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
258 setIt = false; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
259 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
260 // we will only push a character to the screen space if we are in |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
261 // a field |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
262 if (isInField(cpos) && setIt) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
263 planes.setChar(cpos, c); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
264 setDirty(cpos); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
265 screenFields.setCurrentFieldMDT(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
266 } |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
267 |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
268 // If we placed a character then we go to the next position. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
269 if (setIt) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
270 cpos++; |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
271 |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
272 // we will append the information to our debug buffer. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
273 pd.append(c); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
274 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
275 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
276 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
277 // if we have anything else not logged then log it out. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
278 if (pd.length() > 0) |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
279 Log.i(TAG, "pasted >" + pd + "<"); |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
280 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
281 // restore out position within the FFT. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
282 screenFields.restoreCurrentField(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
283 updateDirty(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
284 // restore our cursor position. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
285 setCursor(lr + 1, lc + 1); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
286 setCursorActive(true); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
287 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
288 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
289 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
290 * Copy & Paste support |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
291 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
292 * @param position |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
293 * @return |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
294 * @see {@link #copyText(int)} |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
295 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
296 public final String copyTextField(int position) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
297 screenFields.saveCurrentField(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
298 isInField(position); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
299 String result = screenFields.getCurrentFieldText(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
300 screenFields.restoreCurrentField(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
301 return result; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
302 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
303 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
304 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
305 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
306 * Copy & Paste end code |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
307 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
308 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
309 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
310 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
311 * Sum them |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
312 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
313 * @param which |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
314 * formatting option to use |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
315 * @return vector string of numberic values |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
316 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
317 public final Vector<Double> sumThem(boolean which, Rect area) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
318 StringBuilder sb = new StringBuilder(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
319 Rect workR = new Rect(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
320 workR.setBounds(area); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
321 // gui.rubberband.reset(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
322 // gui.repaint(); |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
323 Log.d(TAG, "Summing"); |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
324 // obtain the decimal format for parsing |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
325 DecimalFormat df = (DecimalFormat) NumberFormat.getInstance(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
326 DecimalFormatSymbols dfs = df.getDecimalFormatSymbols(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
327 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
328 if (which) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
329 dfs.setDecimalSeparator('.'); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
330 dfs.setGroupingSeparator(','); |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
331 } |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
332 else { |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
333 dfs.setDecimalSeparator(','); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
334 dfs.setGroupingSeparator('.'); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
335 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
336 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
337 df.setDecimalFormatSymbols(dfs); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
338 Vector<Double> sumVector = new Vector<Double>(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
339 // loop through all the screen characters to send them to the clip board |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
340 int m = workR.x; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
341 int i = 0; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
342 int t = 0; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
343 double sum = 0.0; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
344 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
345 while (workR.height-- > 0) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
346 t = workR.width; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
347 i = workR.y; |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
348 |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
349 while (t-- > 0) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
350 // only copy printable numeric characters (in this case >= ' ') |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
351 // char c = screen[getPos(m - 1, i - 1)].getChar(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
352 char c = planes.getChar(getPos(m - 1, i - 1)); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
353 // if (((c >= '0' && c <= '9') || c == '.' || c == ',' || c == '-') |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
354 // && !screen[getPos(m - 1, i - 1)].nonDisplay) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
355 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
356 // TODO: update me here to implement the nonDisplay check as well |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
357 if (((c >= '0' && c <= '9') || c == '.' || c == ',' || c == '-')) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
358 sb.append(c); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
359 } |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
360 |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
361 i++; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
362 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
363 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
364 if (sb.length() > 0) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
365 if (sb.charAt(sb.length() - 1) == '-') { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
366 sb.insert(0, '-'); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
367 sb.deleteCharAt(sb.length() - 1); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
368 } |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
369 |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
370 try { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
371 Number n = df.parse(sb.toString()); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
372 // System.out.println(s + " " + n.doubleValue()); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
373 sumVector.add(new Double(n.doubleValue())); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
374 sum += n.doubleValue(); |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
375 } |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
376 catch (ParseException pe) { |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
377 Log.w(TAG, pe.getMessage() + " at " |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
378 + pe.getErrorOffset()); |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
379 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
380 } |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
381 |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
382 sb.setLength(0); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
383 m++; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
384 } |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
385 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
386 Log.d(TAG, "" + sum); |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
387 return sumVector; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
388 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
389 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
390 public void setVT(tnvt v) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
391 sessionVT = v; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
392 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
393 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
394 public void setBuffer(vt320 buffer) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
395 this.buffer = buffer; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
396 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
397 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
398 /** |
107
afe6962769b9
use hash map rather than linear search thru arrays
Carl Byington <carl@five-ten-sg.com>
parents:
106
diff
changeset
|
399 * converts mnemonic string values into aid integers |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
400 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
401 * @see #sendKeys |
107
afe6962769b9
use hash map rather than linear search thru arrays
Carl Byington <carl@five-ten-sg.com>
parents:
106
diff
changeset
|
402 * @param mnem string mnemonic value |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
403 * @return key value of Mnemonic |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
404 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
405 private int getMnemonicValue(String mnem) { |
108
ae3092cd9cbf
use hash map rather than linear search thru arrays
Carl Byington <carl@five-ten-sg.com>
parents:
107
diff
changeset
|
406 if (mnemonicMap.containsKey(mnem)) return mnemonicMap.get(mnem); |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
407 |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
408 return 0; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
409 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
410 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
411 protected void setPrehelpState(boolean setErrorCode, boolean lockKeyboard, |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
412 boolean unlockIfLocked) { |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
413 if (oia.isKeyBoardLocked() && unlockIfLocked) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
414 oia.setKeyBoardLocked(false); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
415 else |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
416 oia.setKeyBoardLocked(lockKeyboard); |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
417 |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
418 bufferedKeys = null; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
419 oia.setKeysBuffered(false); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
420 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
421 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
422 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
423 * Activate the cursor on screen |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
424 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
425 * @param activate |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
426 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
427 public void setCursorActive(boolean activate) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
428 // System.out.println("cursor active " + updateCursorLoc + " " + |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
429 // cursorActive + " " + activate); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
430 if (cursorActive && !activate) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
431 setCursorOff(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
432 cursorActive = activate; |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
433 } |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
434 else { |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
435 if (!cursorActive && activate) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
436 cursorActive = activate; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
437 setCursorOn(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
438 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
439 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
440 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
441 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
442 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
443 * Set the cursor on |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
444 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
445 public void setCursorOn() { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
446 cursorShown = true; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
447 updateCursorLoc(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
448 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
449 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
450 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
451 * Set the cursor off |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
452 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
453 public void setCursorOff() { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
454 cursorShown = false; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
455 updateCursorLoc(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
456 // System.out.println("cursor off " + updateCursorLoc + " " + |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
457 // cursorActive); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
458 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
459 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
460 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
461 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
462 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
463 private void updateCursorLoc() { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
464 if (cursorActive) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
465 fireCursorChanged(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
466 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
467 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
468 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
469 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
470 * The sendKeys method sends a string of keys to the virtual screen. This |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
471 * method acts as if keystrokes were being typed from the keyboard. The |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
472 * keystrokes will be sent to the location given. The string being passed |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
473 * can also contain mnemonic values such as [enter] enter key,[tab] tab key, |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
474 * [pf1] pf1 etc... |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
475 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
476 * These will be processed as if you had pressed these keys from the |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
477 * keyboard. All the valid special key values are contained in the MNEMONIC |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
478 * enumeration: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
479 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
480 * <table BORDER COLS=2 WIDTH="50%" > |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
481 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
482 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
483 * <td>MNEMONIC_CLEAR</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
484 * <td>[clear]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
485 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
486 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
487 * <td>MNEMONIC_ENTER</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
488 * <td>[enter]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
489 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
490 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
491 * <td>MNEMONIC_HELP</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
492 * <td>[help]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
493 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
494 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
495 * <td>MNEMONIC_PAGE_DOWN</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
496 * <td>[pgdown]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
497 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
498 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
499 * <td>MNEMONIC_PAGE_UP</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
500 * <td>[pgup]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
501 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
502 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
503 * <td>MNEMONIC_PRINT</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
504 * <td>[print]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
505 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
506 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
507 * <td>MNEMONIC_PF1</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
508 * <td>[pf1]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
509 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
510 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
511 * <td>MNEMONIC_PF2</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
512 * <td>[pf2]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
513 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
514 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
515 * <td>MNEMONIC_PF3</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
516 * <td>[pf3]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
517 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
518 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
519 * <td>MNEMONIC_PF4</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
520 * <td>[pf4]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
521 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
522 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
523 * <td>MNEMONIC_PF5</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
524 * <td>[pf5]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
525 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
526 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
527 * <td>MNEMONIC_PF6</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
528 * <td>[pf6]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
529 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
530 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
531 * <td>MNEMONIC_PF7</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
532 * <td>[pf7]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
533 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
534 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
535 * <td>MNEMONIC_PF8</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
536 * <td>[pf8]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
537 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
538 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
539 * <td>MNEMONIC_PF9</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
540 * <td>[pf9]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
541 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
542 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
543 * <td>MNEMONIC_PF10</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
544 * <td>[pf10]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
545 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
546 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
547 * <td>MNEMONIC_PF11</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
548 * <td>[pf11]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
549 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
550 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
551 * <td>MNEMONIC_PF12</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
552 * <td>[pf12]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
553 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
554 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
555 * <td>MNEMONIC_PF13</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
556 * <td>[pf13]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
557 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
558 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
559 * <td>MNEMONIC_PF14</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
560 * <td>[pf14]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
561 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
562 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
563 * <td>MNEMONIC_PF15</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
564 * <td>[pf15]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
565 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
566 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
567 * <td>MNEMONIC_PF16</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
568 * <td>[pf16]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
569 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
570 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
571 * <td>MNEMONIC_PF17</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
572 * <td>[pf17]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
573 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
574 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
575 * <td>MNEMONIC_PF18</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
576 * <td>[pf18]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
577 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
578 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
579 * <td>MNEMONIC_PF19</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
580 * <td>[pf19]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
581 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
582 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
583 * <td>MNEMONIC_PF20</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
584 * <td>[pf20]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
585 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
586 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
587 * <td>MNEMONIC_PF21</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
588 * <td>[pf21]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
589 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
590 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
591 * <td>MNEMONIC_PF22</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
592 * <td>[pf22]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
593 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
594 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
595 * <td>MNEMONIC_PF23</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
596 * <td>[pf23]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
597 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
598 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
599 * <td>MNEMONIC_PF24</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
600 * <td>[pf24]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
601 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
602 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
603 * <td>MNEMONIC_BACK_SPACE</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
604 * <td>[backspace]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
605 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
606 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
607 * <td>MNEMONIC_BACK_TAB</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
608 * <td>[backtab]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
609 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
610 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
611 * <td>MNEMONIC_UP</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
612 * <td>[up]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
613 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
614 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
615 * <td>MNEMONIC_DOWN</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
616 * <td>[down]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
617 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
618 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
619 * <td>MNEMONIC_LEFT</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
620 * <td>[left]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
621 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
622 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
623 * <td>MNEMONIC_RIGHT</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
624 * <td>[right]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
625 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
626 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
627 * <td>MNEMONIC_DELETE</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
628 * <td>[delete]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
629 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
630 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
631 * <td>MNEMONIC_TAB</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
632 * <td>"[tab]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
633 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
634 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
635 * <td>MNEMONIC_END_OF_FIELD</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
636 * <td>[eof]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
637 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
638 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
639 * <td>MNEMONIC_ERASE_EOF</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
640 * <td>[eraseeof]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
641 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
642 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
643 * <td>MNEMONIC_ERASE_FIELD</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
644 * <td>[erasefld]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
645 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
646 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
647 * <td>MNEMONIC_INSERT</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
648 * <td>[insert]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
649 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
650 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
651 * <td>MNEMONIC_HOME</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
652 * <td>[home]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
653 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
654 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
655 * <td>MNEMONIC_KEYPAD0</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
656 * <td>[keypad0]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
657 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
658 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
659 * <td>MNEMONIC_KEYPAD1</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
660 * <td>[keypad1]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
661 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
662 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
663 * <td>MNEMONIC_KEYPAD2</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
664 * <td>[keypad2]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
665 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
666 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
667 * <td>MNEMONIC_KEYPAD3</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
668 * <td>[keypad3]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
669 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
670 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
671 * <td>MNEMONIC_KEYPAD4</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
672 * <td>[keypad4]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
673 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
674 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
675 * <td>MNEMONIC_KEYPAD5</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
676 * <td>[keypad5]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
677 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
678 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
679 * <td>MNEMONIC_KEYPAD6</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
680 * <td>[keypad6]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
681 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
682 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
683 * <td>MNEMONIC_KEYPAD7</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
684 * <td>[keypad7]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
685 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
686 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
687 * <td>MNEMONIC_KEYPAD8</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
688 * <td>[keypad8]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
689 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
690 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
691 * <td>MNEMONIC_KEYPAD9</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
692 * <td>[keypad9]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
693 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
694 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
695 * <td>MNEMONIC_KEYPAD_PERIOD</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
696 * <td>[keypad.]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
697 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
698 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
699 * <td>MNEMONIC_KEYPAD_COMMA</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
700 * <td>[keypad,]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
701 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
702 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
703 * <td>MNEMONIC_KEYPAD_MINUS</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
704 * <td>[keypad-]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
705 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
706 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
707 * <td>MNEMONIC_FIELD_EXIT</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
708 * <td>[fldext]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
709 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
710 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
711 * <td>MNEMONIC_FIELD_PLUS</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
712 * <td>[field+]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
713 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
714 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
715 * <td>MNEMONIC_FIELD_MINUS</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
716 * <td>[field-]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
717 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
718 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
719 * <td>MNEMONIC_BEGIN_OF_FIELD</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
720 * <td>[bof]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
721 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
722 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
723 * <td>MNEMONIC_PA1</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
724 * <td>[pa1]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
725 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
726 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
727 * <td>MNEMONIC_PA2</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
728 * <td>[pa2]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
729 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
730 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
731 * <td>MNEMONIC_PA3</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
732 * <td>[pa3]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
733 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
734 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
735 * <td>MNEMONIC_SYSREQ</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
736 * <td>[sysreq]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
737 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
738 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
739 * <td>MNEMONIC_RESET</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
740 * <td>[reset]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
741 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
742 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
743 * <td>MNEMONIC_ATTN</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
744 * <td>[attn]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
745 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
746 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
747 * <td>MNEMONIC_MARK_LEFT</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
748 * <td>[markleft]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
749 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
750 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
751 * <td>MNEMONIC_MARK_RIGHT</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
752 * <td>[markright]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
753 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
754 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
755 * <td>MNEMONIC_MARK_UP</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
756 * <td>[markup]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
757 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
758 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
759 * <td>MNEMONIC_MARK_DOWN</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
760 * <td>[markdown]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
761 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
762 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
763 * </table> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
764 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
765 * @param text |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
766 * The string of characters to be sent |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
767 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
768 * @see #sendAid |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
769 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
770 */ |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
771 |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
772 public synchronized void sendKeys(String text) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
773 if (isStatusErrorCode() && !resetRequired) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
774 setCursorActive(false); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
775 simulateMnemonic(getMnemonicValue("[reset]")); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
776 setCursorActive(true); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
777 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
778 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
779 if (oia.isKeyBoardLocked()) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
780 if (text.equals("[reset]") || text.equals("[sysreq]") |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
781 || text.equals("[attn]")) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
782 setCursorActive(false); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
783 simulateMnemonic(getMnemonicValue(text)); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
784 setCursorActive(true); |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
785 } |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
786 else { |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
787 if (isStatusErrorCode()) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
788 sessionVT.signalBell(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
789 return; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
790 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
791 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
792 oia.setKeysBuffered(true); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
793 |
42
7ac846a07ed4
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
41
diff
changeset
|
794 if (bufferedKeys == null) bufferedKeys = text; |
7ac846a07ed4
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
41
diff
changeset
|
795 else bufferedKeys += text; |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
796 |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
797 return; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
798 } |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
799 } |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
800 else { |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
801 if (oia.isKeysBuffered()) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
802 if (bufferedKeys != null) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
803 text = bufferedKeys + text; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
804 } |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
805 |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
806 oia.setKeysBuffered(false); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
807 bufferedKeys = null; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
808 } |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
809 |
184
cdaaa53b5eca
setfield positions the cursor properly as if the characters were typed
Carl Byington <carl@five-ten-sg.com>
parents:
183
diff
changeset
|
810 isInField(); |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
811 |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
812 if (text.length() == 1 && !text.equals("[") && !text.equals("]")) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
813 setCursorActive(false); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
814 simulateKeyStroke(text.charAt(0)); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
815 setCursorActive(true); |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
816 } |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
817 else { |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
818 strokenizer.setKeyStrokes(text); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
819 String s; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
820 boolean done = false; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
821 // setCursorOff2(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
822 setCursorActive(false); |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
823 |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
824 while (!done) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
825 if (strokenizer.hasMoreKeyStrokes()) { |
184
cdaaa53b5eca
setfield positions the cursor properly as if the characters were typed
Carl Byington <carl@five-ten-sg.com>
parents:
183
diff
changeset
|
826 isInField(); |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
827 s = strokenizer.nextKeyStroke(); |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
828 |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
829 if (s.length() == 1) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
830 simulateKeyStroke(s.charAt(0)); |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
831 } |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
832 else { |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
833 simulateMnemonic(getMnemonicValue(s)); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
834 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
835 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
836 if (oia.isKeyBoardLocked()) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
837 bufferedKeys = strokenizer |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
838 .getUnprocessedKeyStroked(); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
839 |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
840 if (bufferedKeys != null) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
841 oia.setKeysBuffered(true); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
842 } |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
843 |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
844 done = true; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
845 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
846 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
847 else { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
848 done = true; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
849 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
850 } |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
851 |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
852 setCursorActive(true); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
853 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
854 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
855 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
856 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
857 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
858 * The sendAid method sends an "aid" keystroke to the virtual screen. These |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
859 * aid keys can be thought of as special keystrokes, like the Enter key, |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
860 * PF1-24 keys or the Page Up key. All the valid special key values are |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
861 * contained in the AID_ enumeration: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
862 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
863 * @param aidKey |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
864 * The aid key to be sent to the host |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
865 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
866 * @see #sendKeys |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
867 * @see TN5250jConstants#AID_CLEAR |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
868 * @see #AID_ENTER |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
869 * @see #AID_HELP |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
870 * @see #AID_ROLL_UP |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
871 * @see #AID_ROLL_DOWN |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
872 * @see #AID_ROLL_LEFT |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
873 * @see #AID_ROLL_RIGHT |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
874 * @see #AID_PRINT |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
875 * @see #AID_PF1 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
876 * @see #AID_PF2 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
877 * @see #AID_PF3 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
878 * @see #AID_PF4 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
879 * @see #AID_PF5 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
880 * @see #AID_PF6 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
881 * @see #AID_PF7 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
882 * @see #AID_PF8 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
883 * @see #AID_PF9 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
884 * @see #AID_PF10 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
885 * @see #AID_PF11 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
886 * @see #AID_PF12 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
887 * @see #AID_PF13 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
888 * @see #AID_PF14 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
889 * @see #AID_PF15 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
890 * @see #AID_PF16 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
891 * @see #AID_PF17 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
892 * @see #AID_PF18 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
893 * @see #AID_PF19 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
894 * @see #AID_PF20 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
895 * @see #AID_PF21 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
896 * @see #AID_PF22 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
897 * @see #AID_PF23 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
898 * @see #AID_PF24 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
899 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
900 public void sendAid(int aidKey) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
901 sessionVT.sendAidKey(aidKey); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
902 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
903 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
904 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
905 * Restores the error line and sets the error mode off. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
906 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
907 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
908 protected void resetError() { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
909 restoreErrorLine(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
910 setStatus(STATUS_ERROR_CODE, STATUS_VALUE_OFF, ""); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
911 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
912 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
913 protected boolean simulateMnemonic(int mnem) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
914 boolean simulated = false; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
915 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
916 switch (mnem) { |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
917 case AID_CLEAR: |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
918 case AID_ENTER: |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
919 case AID_PF1: |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
920 case AID_PF2: |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
921 case AID_PF3: |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
922 case AID_PF4: |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
923 case AID_PF5: |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
924 case AID_PF6: |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
925 case AID_PF7: |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
926 case AID_PF8: |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
927 case AID_PF9: |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
928 case AID_PF10: |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
929 case AID_PF11: |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
930 case AID_PF12: |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
931 case AID_PF13: |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
932 case AID_PF14: |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
933 case AID_PF15: |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
934 case AID_PF16: |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
935 case AID_PF17: |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
936 case AID_PF18: |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
937 case AID_PF19: |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
938 case AID_PF20: |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
939 case AID_PF21: |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
940 case AID_PF22: |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
941 case AID_PF23: |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
942 case AID_PF24: |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
943 case AID_ROLL_DOWN: |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
944 case AID_ROLL_UP: |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
945 case AID_ROLL_LEFT: |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
946 case AID_ROLL_RIGHT: |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
947 if (!screenFields.isCanSendAid()) { |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
948 displayError(ERR_ENTER_NO_ALLOWED); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
949 } |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
950 else |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
951 sendAid(mnem); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
952 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
953 simulated = true; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
954 break; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
955 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
956 case AID_HELP: |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
957 sessionVT.sendHelpRequest(); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
958 simulated = true; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
959 break; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
960 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
961 case AID_PRINT: |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
962 sessionVT.hostPrint(1); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
963 simulated = true; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
964 break; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
965 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
966 case BACK_SPACE: |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
967 if (screenFields.getCurrentField() != null |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
968 && screenFields.withinCurrentField(lastPos) |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
969 && !screenFields.isCurrentFieldBypassField()) { |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
970 if (screenFields.getCurrentField().startPos() == lastPos) { |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
971 if (backspaceError) |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
972 displayError(ERR_CURSOR_PROTECTED); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
973 else { |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
974 gotoFieldPrev(); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
975 goto_XY(screenFields.getCurrentField().endPos()); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
976 updateDirty(); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
977 } |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
978 } |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
979 else { |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
980 screenFields.getCurrentField().getKeyPos(lastPos); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
981 screenFields.getCurrentField().changePos(-1); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
982 resetDirty(screenFields.getCurrentField().getCurrentPos()); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
983 shiftLeft(screenFields.getCurrentField().getCurrentPos()); |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
984 updateDirty(); |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
985 screenFields.setCurrentFieldMDT(); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
986 simulated = true; |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
987 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
988 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
989 else { |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
990 displayError(ERR_CURSOR_PROTECTED); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
991 } |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
992 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
993 break; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
994 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
995 case BACK_TAB: |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
996 if (screenFields.getCurrentField() != null |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
997 && screenFields.isCurrentFieldHighlightedEntry()) { |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
998 resetDirty(screenFields.getCurrentField().startPos); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
999 gotoFieldPrev(); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1000 updateDirty(); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1001 } |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1002 else |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1003 gotoFieldPrev(); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1004 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1005 if (screenFields.isCurrentFieldContinued()) { |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1006 do { |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1007 gotoFieldPrev(); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1008 } |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1009 while (screenFields.isCurrentFieldContinuedMiddle() |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1010 || screenFields.isCurrentFieldContinuedLast()); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1011 } |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1012 |
184
cdaaa53b5eca
setfield positions the cursor properly as if the characters were typed
Carl Byington <carl@five-ten-sg.com>
parents:
183
diff
changeset
|
1013 isInField(); |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1014 simulated = true; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1015 break; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1016 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1017 case UP: |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1018 case MARK_UP: |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1019 process_XY(lastPos - numCols); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1020 simulated = true; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1021 break; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1022 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1023 case DOWN: |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1024 case MARK_DOWN: |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1025 process_XY(lastPos + numCols); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1026 simulated = true; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1027 break; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1028 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1029 case LEFT: |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1030 case MARK_LEFT: |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1031 process_XY(lastPos - 1); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1032 simulated = true; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1033 break; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1034 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1035 case RIGHT: |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1036 case MARK_RIGHT: |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1037 process_XY(lastPos + 1); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1038 simulated = true; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1039 break; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1040 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1041 case NEXTWORD: |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1042 gotoNextWord(); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1043 simulated = true; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1044 break; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1045 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1046 case PREVWORD: |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1047 gotoPrevWord(); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1048 simulated = true; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1049 break; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1050 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1051 case DELETE: |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1052 if (screenFields.getCurrentField() != null |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1053 && screenFields.withinCurrentField(lastPos) |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1054 && !screenFields.isCurrentFieldBypassField()) { |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1055 resetDirty(lastPos); |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1056 screenFields.getCurrentField().getKeyPos(lastPos); |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1057 shiftLeft(screenFields.getCurrentFieldPos()); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1058 screenFields.setCurrentFieldMDT(); |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1059 updateDirty(); |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1060 simulated = true; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1061 } |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1062 else { |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1063 displayError(ERR_CURSOR_PROTECTED); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1064 } |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1065 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1066 break; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1067 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1068 case TAB: |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1069 if (screenFields.getCurrentField() != null |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1070 && !screenFields.isCurrentFieldContinued()) { |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1071 if (screenFields.isCurrentFieldHighlightedEntry()) { |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1072 resetDirty(screenFields.getCurrentField().startPos); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1073 gotoFieldNext(); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1074 updateDirty(); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1075 } |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1076 else |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1077 gotoFieldNext(); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1078 } |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1079 else { |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1080 do { |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1081 gotoFieldNext(); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1082 } |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1083 while (screenFields.getCurrentField() != null |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1084 && (screenFields.isCurrentFieldContinuedMiddle() || screenFields |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1085 .isCurrentFieldContinuedLast())); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1086 } |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1087 |
184
cdaaa53b5eca
setfield positions the cursor properly as if the characters were typed
Carl Byington <carl@five-ten-sg.com>
parents:
183
diff
changeset
|
1088 isInField(); |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1089 simulated = true; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1090 break; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1091 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1092 case EOF: |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1093 if (screenFields.getCurrentField() != null |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1094 && screenFields.withinCurrentField(lastPos) |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1095 && !screenFields.isCurrentFieldBypassField()) { |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1096 int where = endOfField(screenFields.getCurrentField() |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1097 .startPos(), true); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1098 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1099 if (where > 0) { |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1100 setCursor((where / numCols) + 1, (where % numCols) + 1); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1101 } |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1102 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1103 simulated = true; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1104 } |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1105 else { |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1106 displayError(ERR_CURSOR_PROTECTED); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1107 } |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1108 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1109 resetDirty(lastPos); |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1110 break; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1111 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1112 case ERASE_EOF: |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1113 if (screenFields.getCurrentField() != null |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1114 && screenFields.withinCurrentField(lastPos) |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1115 && !screenFields.isCurrentFieldBypassField()) { |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1116 int where = lastPos; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1117 resetDirty(lastPos); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1118 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1119 if (fieldExit()) { |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1120 screenFields.setCurrentFieldMDT(); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1121 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1122 if (!screenFields.isCurrentFieldContinued()) { |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1123 gotoFieldNext(); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1124 } |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1125 else { |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1126 do { |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1127 gotoFieldNext(); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1128 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1129 if (screenFields.isCurrentFieldContinued()) |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1130 fieldExit(); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1131 } |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1132 while (screenFields.isCurrentFieldContinuedMiddle() |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1133 || screenFields.isCurrentFieldContinuedLast()); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1134 } |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1135 } |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1136 |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1137 updateDirty(); |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1138 goto_XY(where); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1139 simulated = true; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1140 } |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1141 else { |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1142 displayError(ERR_CURSOR_PROTECTED); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1143 } |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1144 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1145 break; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1146 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1147 case ERASE_FIELD: |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1148 if (screenFields.getCurrentField() != null |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1149 && screenFields.withinCurrentField(lastPos) |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1150 && !screenFields.isCurrentFieldBypassField()) { |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1151 int where = lastPos; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1152 lastPos = screenFields.getCurrentField().startPos(); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1153 resetDirty(lastPos); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1154 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1155 if (fieldExit()) { |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1156 screenFields.setCurrentFieldMDT(); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1157 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1158 if (!screenFields.isCurrentFieldContinued()) { |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1159 gotoFieldNext(); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1160 } |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1161 else { |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1162 do { |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1163 gotoFieldNext(); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1164 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1165 if (screenFields.isCurrentFieldContinued()) |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1166 fieldExit(); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1167 } |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1168 while (screenFields.isCurrentFieldContinuedMiddle() |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1169 || screenFields.isCurrentFieldContinuedLast()); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1170 } |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1171 } |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1172 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1173 updateDirty(); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1174 goto_XY(where); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1175 simulated = true; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1176 } |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1177 else { |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1178 displayError(ERR_CURSOR_PROTECTED); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1179 } |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1180 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1181 break; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1182 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1183 case INSERT: |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1184 // we toggle it |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1185 oia.setInsertMode(oia.isInsertMode() ? false : true); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1186 break; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1187 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1188 case HOME: |
307 | 1189 |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1190 // position to the home position set |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1191 if (lastPos + numCols + 1 != homePos) { |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1192 goto_XY(homePos - numCols - 1); |
184
cdaaa53b5eca
setfield positions the cursor properly as if the characters were typed
Carl Byington <carl@five-ten-sg.com>
parents:
183
diff
changeset
|
1193 isInField(); |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1194 } |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1195 else |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1196 gotoField(1); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1197 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1198 break; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1199 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1200 case KEYPAD_0: |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1201 simulated = simulateKeyStroke('0'); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1202 break; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1203 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1204 case KEYPAD_1: |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1205 simulated = simulateKeyStroke('1'); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1206 break; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1207 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1208 case KEYPAD_2: |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1209 simulated = simulateKeyStroke('2'); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1210 break; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1211 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1212 case KEYPAD_3: |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1213 simulated = simulateKeyStroke('3'); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1214 break; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1215 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1216 case KEYPAD_4: |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1217 simulated = simulateKeyStroke('4'); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1218 break; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1219 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1220 case KEYPAD_5: |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1221 simulated = simulateKeyStroke('5'); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1222 break; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1223 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1224 case KEYPAD_6: |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1225 simulated = simulateKeyStroke('6'); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1226 break; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1227 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1228 case KEYPAD_7: |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1229 simulated = simulateKeyStroke('7'); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1230 break; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1231 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1232 case KEYPAD_8: |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1233 simulated = simulateKeyStroke('8'); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1234 break; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1235 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1236 case KEYPAD_9: |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1237 simulated = simulateKeyStroke('9'); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1238 break; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1239 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1240 case KEYPAD_PERIOD: |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1241 simulated = simulateKeyStroke('.'); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1242 break; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1243 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1244 case KEYPAD_COMMA: |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1245 simulated = simulateKeyStroke(','); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1246 break; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1247 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1248 case KEYPAD_MINUS: |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1249 if (screenFields.getCurrentField() != null |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1250 && screenFields.withinCurrentField(lastPos) |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1251 && !screenFields.isCurrentFieldBypassField()) { |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1252 int s = screenFields.getCurrentField().getFieldShift(); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1253 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1254 if (s == 3 || s == 5 || s == 7) { |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1255 planes.setChar(lastPos, '-'); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1256 resetDirty(lastPos); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1257 advancePos(); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1258 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1259 if (fieldExit()) { |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1260 screenFields.setCurrentFieldMDT(); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1261 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1262 if (!screenFields.isCurrentFieldContinued()) { |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1263 gotoFieldNext(); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1264 } |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1265 else { |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1266 do { |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1267 gotoFieldNext(); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1268 } |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1269 while (screenFields |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1270 .isCurrentFieldContinuedMiddle() |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1271 || screenFields |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1272 .isCurrentFieldContinuedLast()); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1273 } |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1274 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1275 simulated = true; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1276 updateDirty(); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1277 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1278 if (screenFields.isCurrentFieldAutoEnter()) |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1279 sendAid(AID_ENTER); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1280 } |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1281 } |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1282 else { |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1283 displayError(ERR_FIELD_MINUS); |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1284 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1285 } |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1286 else { |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1287 displayError(ERR_CURSOR_PROTECTED); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1288 } |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1289 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1290 break; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1291 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1292 case FIELD_EXIT: |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1293 if (screenFields.getCurrentField() != null |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1294 && screenFields.withinCurrentField(lastPos) |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1295 && !screenFields.isCurrentFieldBypassField()) { |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1296 resetDirty(lastPos); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1297 boolean autoFE = screenFields.isCurrentFieldAutoEnter(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1298 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1299 if (fieldExit()) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1300 screenFields.setCurrentFieldMDT(); |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1301 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1302 if (!screenFields.isCurrentFieldContinued() && |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1303 !screenFields.isCurrentFieldAutoEnter()) { |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1304 gotoFieldNext(); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1305 } |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1306 else { |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1307 do { |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1308 gotoFieldNext(); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1309 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1310 if (screenFields.isCurrentFieldContinued()) |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1311 fieldExit(); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1312 } |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1313 while (screenFields.isCurrentFieldContinuedMiddle() |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1314 || screenFields.isCurrentFieldContinuedLast()); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1315 } |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1316 } |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1317 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1318 updateDirty(); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1319 simulated = true; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1320 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1321 if (autoFE) |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1322 sendAid(AID_ENTER); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1323 } |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1324 else { |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1325 displayError(ERR_CURSOR_PROTECTED); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1326 } |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1327 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1328 break; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1329 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1330 case FIELD_PLUS: |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1331 if (screenFields.getCurrentField() != null |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1332 && screenFields.withinCurrentField(lastPos) |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1333 && !screenFields.isCurrentFieldBypassField()) { |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1334 resetDirty(lastPos); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1335 boolean autoFE = screenFields.isCurrentFieldAutoEnter(); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1336 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1337 if (fieldExit()) { |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1338 screenFields.setCurrentFieldMDT(); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1339 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1340 if (!screenFields.isCurrentFieldContinued() && |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1341 !screenFields.isCurrentFieldAutoEnter()) { |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1342 gotoFieldNext(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1343 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1344 else { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1345 do { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1346 gotoFieldNext(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1347 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1348 while (screenFields.isCurrentFieldContinuedMiddle() |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1349 || screenFields.isCurrentFieldContinuedLast()); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1350 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1351 } |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1352 |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1353 updateDirty(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1354 simulated = true; |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1355 |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1356 if (autoFE) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1357 sendAid(AID_ENTER); |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1358 } |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1359 else { |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1360 displayError(ERR_CURSOR_PROTECTED); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1361 } |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1362 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1363 break; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1364 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1365 case FIELD_MINUS: |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1366 if (screenFields.getCurrentField() != null |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1367 && screenFields.withinCurrentField(lastPos) |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1368 && !screenFields.isCurrentFieldBypassField()) { |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1369 int s = screenFields.getCurrentField().getFieldShift(); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1370 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1371 if (s == 3 || s == 5 || s == 7) { |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1372 planes.setChar(lastPos, '-'); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1373 resetDirty(lastPos); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1374 advancePos(); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1375 boolean autoFE = screenFields.isCurrentFieldAutoEnter(); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1376 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1377 if (fieldExit()) { |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1378 screenFields.setCurrentFieldMDT(); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1379 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1380 if (!screenFields.isCurrentFieldContinued() |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1381 && !screenFields.isCurrentFieldAutoEnter()) { |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1382 gotoFieldNext(); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1383 } |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1384 else { |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1385 do { |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1386 gotoFieldNext(); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1387 } |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1388 while (screenFields.isCurrentFieldContinuedMiddle() |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1389 || screenFields.isCurrentFieldContinuedLast()); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1390 } |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1391 } |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1392 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1393 updateDirty(); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1394 simulated = true; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1395 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1396 if (autoFE) |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1397 sendAid(AID_ENTER); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1398 } |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1399 else { |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1400 displayError(ERR_FIELD_MINUS); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1401 } |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1402 } |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1403 else { |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1404 displayError(ERR_CURSOR_PROTECTED); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1405 } |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1406 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1407 break; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1408 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1409 case BOF: |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1410 if (screenFields.getCurrentField() != null |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1411 && screenFields.withinCurrentField(lastPos) |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1412 && !screenFields.isCurrentFieldBypassField()) { |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1413 int where = screenFields.getCurrentField().startPos(); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1414 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1415 if (where > 0) { |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1416 goto_XY(where); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1417 } |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1418 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1419 simulated = true; |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1420 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1421 else { |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1422 displayError(ERR_CURSOR_PROTECTED); |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1423 } |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1424 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1425 resetDirty(lastPos); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1426 break; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1427 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1428 case SYSREQ: |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1429 sessionVT.systemRequest(); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1430 simulated = true; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1431 break; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1432 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1433 case RESET: |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1434 if (isStatusErrorCode()) { |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1435 resetError(); |
184
cdaaa53b5eca
setfield positions the cursor properly as if the characters were typed
Carl Byington <carl@five-ten-sg.com>
parents:
183
diff
changeset
|
1436 isInField(); |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1437 updateDirty(); |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1438 } |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1439 else { |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1440 setPrehelpState(false, oia.isKeyBoardLocked(), false); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1441 } |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1442 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1443 simulated = true; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1444 break; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1445 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1446 case ATTN: |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1447 sessionVT.sendAttentionKey(); |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1448 simulated = true; |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1449 break; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1450 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1451 case DUP_FIELD: |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1452 if (screenFields.getCurrentField() != null |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1453 && screenFields.withinCurrentField(lastPos) |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1454 && !screenFields.isCurrentFieldBypassField()) { |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1455 if (screenFields.isCurrentFieldDupEnabled()) { |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1456 resetDirty(lastPos); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1457 screenFields.getCurrentField().setFieldChar(lastPos, |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1458 (char) 0x1C); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1459 screenFields.setCurrentFieldMDT(); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1460 gotoFieldNext(); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1461 updateDirty(); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1462 simulated = true; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1463 } |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1464 else { |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1465 displayError(ERR_DUP_KEY_NOT_ALLOWED); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1466 } |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1467 } |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1468 else { |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1469 displayError(ERR_CURSOR_PROTECTED); |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1470 } |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1471 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1472 break; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1473 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1474 case NEW_LINE: |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1475 if (screenFields.getSize() > 0) { |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1476 int startRow = getRow(lastPos) + 1; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1477 int startPos = lastPos; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1478 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1479 if (startRow == getRows()) |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1480 startRow = 0; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1481 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1482 setCursor(++startRow, 1); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1483 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1484 if (!isInField() && screenFields.getCurrentField() != null |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1485 && !screenFields.isCurrentFieldBypassField()) { |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1486 while (!isInField() |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1487 && screenFields.getCurrentField() != null |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1488 && !screenFields.isCurrentFieldBypassField()) { |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1489 // lets keep going |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1490 advancePos(); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1491 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1492 // Have we looped the screen? |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1493 if (lastPos == startPos) { |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1494 // if so then go back to starting point |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1495 goto_XY(startPos); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1496 break; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1497 } |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1498 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1499 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1500 } |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1501 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1502 simulated = true; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1503 break; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1504 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1505 case FAST_CURSOR_DOWN: |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1506 int rowNow = (getCurrentRow() - 1) + 3; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1507 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1508 if (rowNow > getRows() - 1) |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1509 rowNow = rowNow - getRows(); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1510 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1511 this.goto_XY(getPos(rowNow, getCurrentCol() - 1)); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1512 simulated = true; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1513 break; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1514 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1515 case FAST_CURSOR_UP: |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1516 rowNow = (getCurrentRow() - 1) - 3; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1517 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1518 if (rowNow < 0) |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1519 rowNow = (getRows()) + rowNow; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1520 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1521 this.goto_XY(getPos(rowNow, getCurrentCol() - 1)); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1522 simulated = true; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1523 break; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1524 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1525 case FAST_CURSOR_LEFT: |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1526 int colNow = (getCurrentCol() - 1) - 3; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1527 rowNow = getCurrentRow() - 1; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1528 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1529 if (colNow <= 0) { |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1530 colNow = getColumns() + colNow; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1531 rowNow--; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1532 } |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1533 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1534 if (rowNow < 0) |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1535 rowNow = getRows() - 1; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1536 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1537 process_XY(getPos(rowNow, colNow)); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1538 simulated = true; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1539 break; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1540 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1541 case FAST_CURSOR_RIGHT: |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1542 colNow = (getCurrentCol() - 1) + 3; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1543 rowNow = getCurrentRow() - 1; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1544 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1545 if (colNow >= getColumns()) { |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1546 colNow = colNow - getColumns(); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1547 rowNow++; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1548 } |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1549 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1550 if (rowNow > getRows() - 1) |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1551 rowNow = getRows() - rowNow; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1552 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1553 process_XY(getPos(rowNow, colNow)); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1554 simulated = true; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1555 break; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1556 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1557 default: |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1558 Log.i(TAG, " Mnemonic not supported " + mnem); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1559 break; |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1560 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1561 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1562 return simulated; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1563 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1564 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1565 protected boolean simulateKeyStroke(char c) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1566 if (isStatusErrorCode() && !Character.isISOControl(c) && !keyProcessed) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1567 if (resetRequired) return false; |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1568 |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1569 resetError(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1570 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1571 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1572 boolean updateField = false; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1573 boolean numericError = false; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1574 boolean updatePos = false; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1575 boolean autoEnter = false; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1576 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1577 if (!Character.isISOControl(c)) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1578 if (screenFields.getCurrentField() != null |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1579 && screenFields.withinCurrentField(lastPos) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1580 && !screenFields.isCurrentFieldBypassField()) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1581 if (screenFields.isCurrentFieldFER() |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1582 && !screenFields.withinCurrentField(screenFields |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1583 .getCurrentFieldPos()) |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1584 && lastPos == screenFields.getCurrentField().endPos() |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1585 && screenFields.getCurrentFieldPos() > screenFields |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1586 .getCurrentField().endPos()) { |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1587 displayError(ERR_FIELD_EXIT_INVALID); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1588 feError = true; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1589 return false; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1590 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1591 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1592 switch (screenFields.getCurrentFieldShift()) { |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1593 case 0: // Alpha shift |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1594 case 2: // Numeric Shift |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1595 case 4: // Kakana Shift |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1596 updateField = true; |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1597 break; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1598 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1599 case 1: // Alpha Only |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1600 if (Character.isLetter(c) || c == ',' || c == '-' |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1601 || c == '.' || c == ' ') |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1602 updateField = true; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1603 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1604 break; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1605 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1606 case 3: // Numeric only |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1607 if (Character.isDigit(c) || c == '+' || c == ',' |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1608 || c == '-' || c == '.' || c == ' ') |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1609 updateField = true; |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1610 else |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1611 numericError = true; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1612 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1613 break; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1614 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1615 case 5: // Digits only |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1616 if (Character.isDigit(c)) |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1617 updateField = true; |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1618 else |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1619 displayError(ERR_NUMERIC_09); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1620 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1621 break; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1622 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1623 case 7: // Signed numeric |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1624 if (Character.isDigit(c) || c == '+' || c == '-') |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1625 if (lastPos == screenFields.getCurrentField().endPos() |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1626 && (c != '+' && c != '-')) |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1627 displayError(ERR_INVALID_SIGN); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1628 else |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1629 updateField = true; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1630 else |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1631 displayError(ERR_NUMERIC_09); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1632 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1633 break; |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1634 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1635 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1636 if (updateField) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1637 if (screenFields.isCurrentFieldToUpper()) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1638 c = Character.toUpperCase(c); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1639 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1640 updatePos = true; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1641 resetDirty(lastPos); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1642 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1643 if (oia.isInsertMode()) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1644 if (endOfField(false) != screenFields.getCurrentField() |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1645 .endPos()) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1646 shiftRight(lastPos); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1647 else { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1648 displayError(ERR_NO_ROOM_INSERT); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1649 updatePos = false; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1650 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1651 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1652 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1653 if (updatePos) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1654 screenFields.getCurrentField().getKeyPos( |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1655 getRow(lastPos), getCol(lastPos)); |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1656 screenFields.getCurrentField().changePos(1); |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1657 planes.setChar(lastPos, c); |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1658 screenFields.setCurrentFieldMDT(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1659 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1660 // if we have gone passed the end of the field then goto |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1661 // the next field |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1662 if (!screenFields.withinCurrentField(screenFields |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1663 .getCurrentFieldPos())) { |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1664 if (screenFields.isCurrentFieldAutoEnter()) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1665 autoEnter = true; |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1666 } |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1667 else if (!screenFields.isCurrentFieldFER()) |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1668 gotoFieldNext(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1669 else { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1670 // screenFields.getCurrentField().changePos(1); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1671 // |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1672 // if (screenFields. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1673 // cursorPos == endPos) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1674 // System.out.println("end of field"); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1675 // |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1676 // feError != feError; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1677 // if (feError) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1678 // displayError(ERR_FIELD_EXIT_INVALID); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1679 } |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1680 } |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1681 else |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1682 setCursor(screenFields.getCurrentField() |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1683 .getCursorRow() + 1, screenFields |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1684 .getCurrentField().getCursorCol() + 1); |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1685 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1686 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1687 fireScreenChanged(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1688 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1689 if (autoEnter) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1690 sendAid(AID_ENTER); |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1691 } |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1692 else { |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1693 if (numericError) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1694 displayError(ERR_NUMERIC_ONLY); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1695 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1696 } |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1697 } |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1698 else { |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1699 displayError(ERR_CURSOR_PROTECTED); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1700 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1701 } |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1702 |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1703 return updatePos; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1704 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1705 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1706 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1707 * Method: endOfField |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1708 * <p> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1709 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1710 * convenience method that call endOfField with lastRow lastCol and passes |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1711 * the posSpace to that method |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1712 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1713 * @param posSpace |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1714 * value of type boolean - specifying to return the position of |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1715 * the the last space or not |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1716 * @return a value of type int - the screen postion (row * columns) + col |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1717 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1718 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1719 private int endOfField(boolean posSpace) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1720 return endOfField(lastPos, posSpace); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1721 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1722 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1723 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1724 * Method: endOfField |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1725 * <p> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1726 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1727 * gets the position of the last character of the current field posSpace |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1728 * parameter tells the routine whether to return the position of the last |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1729 * space ( <= ' ') or the last non space posSpace == true last occurrence of |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1730 * char <= ' ' posSpace == false last occurrence of char > ' ' |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1731 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1732 * @param pos |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1733 * value of type int - position to start from |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1734 * @param posSpace |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1735 * value of type boolean - specifying to return the position of |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1736 * the the last space or not |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1737 * @return a value of type int - the screen postion (row * columns) + col |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1738 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1739 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1740 private int endOfField(int pos, boolean posSpace) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1741 int endPos = screenFields.getCurrentField().endPos(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1742 int fePos = endPos; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1743 // get the number of characters to the right |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1744 int count = endPos - pos; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1745 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1746 // first lets get the real ending point without spaces and the such |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1747 while (planes.getChar(endPos) <= ' ' && count-- > 0) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1748 endPos--; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1749 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1750 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1751 if (endPos == fePos) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1752 return endPos; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1753 } |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1754 |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1755 screenFields.getCurrentField().getKeyPos(endPos); |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1756 |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1757 if (posSpace) screenFields.getCurrentField().changePos(+1); |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1758 |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1759 return screenFields.getCurrentFieldPos(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1760 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1761 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1762 private boolean fieldExit() { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1763 int pos = lastPos; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1764 boolean mdt = false; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1765 int end = endOfField(false); // get the ending position of the first |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1766 // non blank character in field |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1767 ScreenField sf = screenFields.getCurrentField(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1768 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1769 if (sf.isMandatoryEnter() && end == sf.startPos()) { |
348
29076621bab0
merge tn5250j r1227; fix spelling
Carl Byington <carl@five-ten-sg.com>
parents:
307
diff
changeset
|
1770 displayError(ERR_MANDATORY_ENTER); |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1771 return false; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1772 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1773 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1774 // save off the current pos of the field for checking field exit required |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1775 // positioning. the getKeyPos resets this information so it is useless |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1776 // for comparing if we are positioned passed the end of field. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1777 // Maybe this should be changed to not update the current cursor position |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1778 // of the field. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1779 int currentPos = sf.getCurrentPos(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1780 // get the number of characters to the right |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1781 int count = (end - sf.startPos()) - sf.getKeyPos(pos); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1782 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1783 if (count == 0 && sf.isFER()) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1784 if (currentPos > sf.endPos()) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1785 mdt = true; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1786 return mdt; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1787 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1788 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1789 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1790 for (; count >= 0; count--) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1791 planes.setChar(pos, initChar); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1792 setDirty(pos); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1793 pos++; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1794 mdt = true; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1795 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1796 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1797 // This checks for a field minus because a field minus places |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1798 // a negative sign and then advances a position. If it is the |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1799 // end of the field where the minus is placed then this offset will |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1800 // place the count as -1. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1801 if (count == -1) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1802 int s = sf.getFieldShift(); |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1803 |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1804 if (s == 3 || s == 5 || s == 7) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1805 mdt = true; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1806 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1807 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1808 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1809 int adj = sf.getAdjustment(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1810 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1811 if (adj != 0) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1812 switch (adj) { |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1813 case 5: |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1814 rightAdjustField('0'); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1815 sf.setRightAdjusted(); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1816 break; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1817 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1818 case 6: |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1819 rightAdjustField(' '); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1820 sf.setRightAdjusted(); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1821 break; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1822 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1823 case 7: |
348
29076621bab0
merge tn5250j r1227; fix spelling
Carl Byington <carl@five-ten-sg.com>
parents:
307
diff
changeset
|
1824 sf.setMandatoryEntered(); |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1825 break; |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1826 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1827 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1828 else { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1829 // we need to right adjust signed numeric fields as well. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1830 if (sf.isSignedNumeric()) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1831 rightAdjustField(' '); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1832 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1833 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1834 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1835 return mdt; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1836 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1837 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1838 private void rightAdjustField(char fill) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1839 int end = endOfField(false); // get the ending position of the first |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1840 // non blank character in field |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1841 // get the number of characters to the right |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1842 int count = screenFields.getCurrentField().endPos() - end; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1843 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1844 // subtract 1 from count for signed numeric - note for later |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1845 if (screenFields.getCurrentField().isSignedNumeric()) { |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1846 if (planes.getChar(end - 1) != '-') |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1847 count--; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1848 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1849 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1850 int pos = screenFields.getCurrentField().startPos(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1851 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1852 while (count-- >= 0) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1853 shiftRight(pos); |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1854 planes.setChar(pos, fill); |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1855 setDirty(pos); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1856 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1857 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1858 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1859 private void shiftLeft(int sPos) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1860 int endPos = 0; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1861 int pos = sPos; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1862 int pPos = sPos; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1863 ScreenField sf = screenFields.getCurrentField(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1864 int end; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1865 int count; |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1866 |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1867 do { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1868 end = endOfField(pPos, false); // get the ending position of the |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1869 // first |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1870 // non blank character in field |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1871 count = (end - screenFields.getCurrentField().startPos()) |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1872 - screenFields.getCurrentField().getKeyPos(pPos); |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1873 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1874 // now we loop through and shift the remaining characters to the |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1875 // left |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1876 while (count-- > 0) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1877 pos++; |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1878 planes.setChar(pPos, planes.getChar(pos)); |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1879 setDirty(pPos); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1880 pPos = pos; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1881 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1882 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1883 if (screenFields.isCurrentFieldContinued()) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1884 gotoFieldNext(); |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1885 |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1886 if (screenFields.getCurrentField().isContinuedFirst()) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1887 break; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1888 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1889 pos = screenFields.getCurrentField().startPos(); |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1890 planes.setChar(pPos, planes.getChar(pos)); |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1891 setDirty(pPos); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1892 pPos = pos; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1893 } |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1894 } |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1895 while (screenFields.isCurrentFieldContinued() |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1896 && !screenFields.getCurrentField().isContinuedFirst()); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1897 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1898 if (end >= 0 && count >= -1) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1899 endPos = end; |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1900 } |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1901 else { |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1902 endPos = sPos; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1903 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1904 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1905 screenFields.setCurrentField(sf); |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1906 planes.setChar(endPos, initChar); |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1907 setDirty(endPos); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1908 goto_XY(screenFields.getCurrentFieldPos()); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1909 sf = null; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1910 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1911 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1912 private void shiftRight(int sPos) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1913 int end = endOfField(true); // get the ending position of the first |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1914 // non blank character in field |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1915 int pos = end; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1916 int pPos = end; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1917 int count = end - sPos; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1918 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1919 // now we loop through and shift the remaining characters to the right |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1920 while (count-- > 0) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1921 pos--; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1922 planes.setChar(pPos, planes.getChar(pos)); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1923 setDirty(pPos); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1924 pPos = pos; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1925 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1926 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1927 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1928 public int getRow(int pos) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1929 // if (pos == 0) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1930 // return 1; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1931 int row = pos / numCols; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1932 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1933 if (row < 0) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1934 row = lastPos / numCols; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1935 } |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1936 |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1937 if (row > (lenScreen / numCols) - 1) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1938 row = (lenScreen / numCols) - 1; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1939 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1940 return row; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1941 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1942 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1943 public int getCol(int pos) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1944 int col = pos % (getColumns()); |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1945 |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1946 if (col > 0) return col; |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
1947 |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1948 return 0; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1949 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1950 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1951 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1952 * This routine is 0 based offset. So to get row 20,1 then pass row 19,0 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1953 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1954 * @param row |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1955 * @param col |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1956 * @return |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1957 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1958 public int getPos(int row, int col) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1959 return (row * numCols) + col; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1960 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1961 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1962 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1963 * Current position is based on offsets of 1,1 not 0,0 of the current |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1964 * position of the screen |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1965 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1966 * @return int |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1967 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1968 public int getCurrentPos() { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1969 // return lastPos + numCols + 1; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1970 return lastPos + 1; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1971 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1972 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1973 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1974 * I got this information from a tcp trace of each error. I could not find |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1975 * any documenation for this. Maybe there is but I could not find it. If |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1976 * anybody finds this documention could you please send me a copy. Please |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1977 * note that I did not look that hard either. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1978 * <p> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1979 * 0000: 00 50 73 1D 89 81 00 50 DA 44 C8 45 08 00 45 00 .Ps....P.D.E..E. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1980 * </p> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1981 * <p> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1982 * 0010: 00 36 E9 1C 40 00 80 06 9B F9 C1 A8 33 58 C0 A8 .6..@...k....3X.. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1983 * </p> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1984 * <p> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1985 * 0020: C0 02 06 0E 00 17 00 52 6E 88 73 40 DE CB 50 18 .......Rn.s@..P. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1986 * </p> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1987 * <p> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1988 * 0030: 20 12 3C 53 00 00 00 0C 12 A0 00 00 04 01 00 00 . <S............ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1989 * </p> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1990 * <p> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1991 * 0040: 00 05 FF EF .... ----------|| The 00 XX is the code to be sent. I |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1992 * found the following <table BORDER COLS=2 WIDTH="50%" > |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1993 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1994 * <td>ERR_CURSOR_PROTECTED</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1995 * <td>0x05</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1996 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1997 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1998 * <td>ERR_INVALID_SIGN</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1999 * <td>0x11</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2000 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2001 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2002 * <td>ERR_NO_ROOM_INSERT</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2003 * <td>0x12</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2004 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2005 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2006 * <td>ERR_NUMERIC_ONLY</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2007 * <td>0x09</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2008 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2009 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2010 * <td>ERR_NUMERIC_09</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2011 * <td>0x10</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2012 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2013 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2014 * <td>ERR_FIELD_MINUS</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2015 * <td>0x16</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2016 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2017 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2018 * <td>ERR_ENTER_NOT_ALLOWED</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2019 * <td>0x20</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2020 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2021 * <tr> |
348
29076621bab0
merge tn5250j r1227; fix spelling
Carl Byington <carl@five-ten-sg.com>
parents:
307
diff
changeset
|
2022 * <td>ERR_MANDATORY_ENTER</td> |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2023 * <td>0x21</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2024 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2025 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2026 * <td>ERR_ENTER_NOT_ALLOWED</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2027 * <td>0x20</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2028 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2029 * </table> I am tired of typing and they should be self explanitory. Finding |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2030 * them in the first place was the pain. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2031 * </p> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2032 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2033 * @param ec error code |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2034 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2035 private void displayError(int ec) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2036 saveHomePos = homePos; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2037 homePos = lastPos + numCols + 1; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2038 pendingInsert = true; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2039 sessionVT.sendNegResponse2(ec); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2040 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2041 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2042 private void process_XY(int pos) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2043 if (pos < 0) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2044 pos = lenScreen + pos; |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2045 |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2046 if (pos > lenScreen - 1) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2047 pos = pos - lenScreen; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2048 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2049 // if there was a field exit error then we need to treat the movement |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2050 // of the cursor in a special way that equals that of Client Access. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2051 // If the cursor is moved from the field then we need to reset the |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2052 // position within the field so that the last character can be typed |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2053 // over again instead of sending the field exit error again. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2054 // We also need to reset the field exit error flag. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2055 // |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2056 // How we know we have a field exit error is when the field position is |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2057 // set beyond the end of the field and a character is then typed we can |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2058 // not position that character. To reset this we need to set the next |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2059 // position of the field to not be beyond the end of field but to the |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2060 // last character. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2061 // |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2062 // Now to make it work like Client Access if the cursor is a back space |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2063 // then do not move the cursor but place it on the last field. All |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2064 // other keys will reset the field position so that entering over the |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2065 // last character will not cause an error but replace that character or |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2066 // just plain move the cursor if the key was to do that. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2067 ScreenField sf = screenFields.getCurrentField(); |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2068 |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2069 if (feError) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2070 feError = false; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2071 sf.changePos(-1); |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2072 } |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2073 else { |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2074 if (sf != null && sf.isFER()) { |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2075 if ((sf.getCurrentPos() |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2076 > sf.endPos())) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2077 if (sf.withinField(pos)) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2078 sf.getKeyPos(pos); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2079 return; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2080 } |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2081 |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2082 sf.getKeyPos(sf.endPos()); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2083 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2084 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2085 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2086 goto_XY(pos); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2087 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2088 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2089 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2090 public boolean isUsingGuiInterface() { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2091 return guiInterface; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2092 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2093 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2094 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2095 * Convinience class to return if the cursor is in a field or not. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2096 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2097 * @return true or false |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2098 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2099 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2100 protected boolean isInField() { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2101 return isInField(lastPos, true); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2102 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2103 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2104 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2105 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2106 * Convinience class to return if the position that is passed is in a field |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2107 * or not. If it is then the chgToField parameter will change the current |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2108 * field to this field where the position indicates |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2109 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2110 * @param pos |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2111 * @param chgToField |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2112 * @return true or false |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2113 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2114 public boolean isInField(int pos, boolean chgToField) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2115 return screenFields.isInField(pos, chgToField); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2116 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2117 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2118 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2119 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2120 * Convinience class to return if the position that is passed is in a field |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2121 * or not. If it is then the field at this position becomes the current |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2122 * working field |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2123 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2124 * @param pos |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2125 * @return true or false |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2126 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2127 public boolean isInField(int pos) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2128 return screenFields.isInField(pos, true); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2129 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2130 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2131 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2132 * Convinience class to return if the position at row and column that is |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2133 * passed is in a field or not. If it is then the field at this position |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2134 * becomes the current working field. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2135 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2136 * @param row |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2137 * @param col |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2138 * @return true or false |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2139 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2140 public boolean isInField(int row, int col) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2141 return isInField(row, col, true); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2142 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2143 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2144 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2145 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2146 * Convinience class to return if the position at row and column that is |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2147 * passed is in a field or not. If it is then the chgToField parameter will |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2148 * change the current field to this field where the row and column |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2149 * indicates. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2150 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2151 * @param row |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2152 * @param col |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2153 * @param chgToField |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2154 * @return true or false |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2155 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2156 public boolean isInField(int row, int col, boolean chgToField) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2157 return screenFields.isInField((row * numCols) + col, chgToField); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2158 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2159 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2160 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2161 * Gets the length of the screen - number of rows times number of columns |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2162 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2163 * @return int value of screen length |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2164 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2165 public int getScreenLength() { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2166 return lenScreen; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2167 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2168 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2169 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2170 * Get the number or rows available. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2171 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2172 * @return number of rows |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2173 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2174 public int getRows() { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2175 return numRows; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2176 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2177 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2178 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2179 * Get the number of columns available. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2180 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2181 * @return number of columns |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2182 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2183 public int getColumns() { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2184 return numCols; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2185 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2186 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2187 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2188 * Get the current row where the cursor is |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2189 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2190 * @return the cursor current row position 1,1 based |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2191 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2192 public int getCurrentRow() { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2193 return (lastPos / numCols) + 1; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2194 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2195 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2196 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2197 * Get the current column where the cursor is |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2198 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2199 * @return the cursor current column position 1,1 based |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2200 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2201 public int getCurrentCol() { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2202 return (lastPos % numCols) + 1; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2203 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2204 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2205 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2206 * The last position of the cursor on the screen - Note - position is based |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2207 * 0,0 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2208 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2209 * @return last position |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2210 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2211 protected int getLastPos() { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2212 return lastPos; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2213 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2214 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2215 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2216 * Hotspot More... string |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2217 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2218 * @return string literal of More... |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2219 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2220 public StringBuffer getHSMore() { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2221 return hsMore; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2222 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2223 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2224 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2225 * Hotspot Bottom string |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2226 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2227 * @return string literal of Bottom |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2228 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2229 public StringBuffer getHSBottom() { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2230 return hsBottom; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2231 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2232 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2233 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2234 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2235 * Return the screen represented as a character array |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2236 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2237 * @return character array containing the text |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2238 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2239 public char[] getScreenAsChars() { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2240 char[] sac = new char[lenScreen]; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2241 char c; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2242 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2243 for (int x = 0; x < lenScreen; x++) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2244 c = planes.getChar(x); |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2245 |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2246 // only draw printable characters (in this case >= ' ') |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2247 if ((c >= ' ') && (!planes.isAttributePlace(x))) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2248 sac[x] = c; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2249 // TODO: implement the underline check here |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2250 // if (screen[x].underLine && c <= ' ') |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2251 // sac[x] = '_'; |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2252 } |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2253 else |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2254 sac[x] = ' '; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2255 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2256 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2257 return sac; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2258 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2259 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2260 public char[] getData(int startRow, int startCol, int endRow, int endCol, int plane) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2261 try { |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2262 int from = getPos(startRow, startCol); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2263 int to = getPos(endRow, endCol); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2264 |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2265 if (from > to) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2266 int f = from; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2267 to = f; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2268 from = f; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2269 } |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2270 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2271 return planes.getPlaneData(from, to, plane); |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2272 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2273 catch (Exception oe) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2274 return null; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2275 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2276 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2277 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2278 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2279 * <p> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2280 * GetScreen retrieves the various planes associated with the presentation |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2281 * space. The data is returned as a linear array of character values in the |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2282 * array provided. The array is not terminated by a null character except |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2283 * when data is retrieved from the text plane, in which case a single null |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2284 * character is appended. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2285 * </p> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2286 * <p> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2287 * The application must supply a buffer for the returned data and the length |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2288 * of the buffer. Data is returned starting from the beginning of the |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2289 * presentation space and continuing until the buffer is full or the entire |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2290 * plane has been copied. For text plane data, the buffer must include one |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2291 * extra position for the terminating null character. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2292 * <p> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2293 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2294 * @param buffer |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2295 * @param bufferLength |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2296 * @param plane |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2297 * @return The number of characters copied to the buffer |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2298 * @throws OhioException |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2299 */ |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2300 |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2301 public synchronized int GetScreen(char buffer[], int bufferLength, int plane) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2302 // throws OhioException { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2303 { |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2304 return GetScreen(buffer, bufferLength, 0, lenScreen, plane); |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2305 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2306 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2307 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2308 * <p> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2309 * GetScreen retrieves the various planes associated with the presentation |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2310 * space. The data is returned as a linear array of character values in the |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2311 * array provided. The array is not terminated by a null character except |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2312 * when data is retrieved from the text plane, in which case a single null |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2313 * character is appended. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2314 * </p> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2315 * <p> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2316 * The application must supply a buffer for the returned data and the length |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2317 * of the buffer. Data is returned starting from the given position and |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2318 * continuing until the specified number of characters have been copied, the |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2319 * buffer is full or the entire plane has been copied. For text plane data, |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2320 * the buffer must include one extra position for the terminating null character. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2321 * </p> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2322 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2323 * @param buffer |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2324 * @param bufferLength |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2325 * @param from |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2326 * @param length |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2327 * @param plane |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2328 * @return The number of characters copied to the buffer |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2329 * @throws OhioException |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2330 */ |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2331 |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2332 public synchronized int GetScreen(char buffer[], int bufferLength, int from, |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2333 int length, int plane) |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2334 // throws OhioException { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2335 { |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2336 return planes.GetScreen(buffer, bufferLength, from, length, plane); |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2337 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2338 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2339 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2340 * <p> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2341 * GetScreen retrieves the various planes associated with the presentation |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2342 * space. The data is returned as a linear array of character values in the |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2343 * array provided. The array is not terminated by a null character except |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2344 * when data is retrieved from the text plane, in which case a single null |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2345 * character is appended. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2346 * </p> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2347 * <p> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2348 * The application must supply a buffer for the returned data and the length |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2349 * of the buffer. Data is returned starting from the given coordinates and |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2350 * continuing until the specified number of characters have been copied, |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2351 * the buffer is full, or the entire plane has been copied. For text plane |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2352 * data, the buffer must include one extra position for the terminating null |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2353 * character. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2354 * </p> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2355 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2356 * @param buffer |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2357 * @param bufferLength |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2358 * @param row |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2359 * @param col |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2360 * @param length |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2361 * @param plane |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2362 * @return The number of characters copied to the buffer. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2363 * @throws OhioException |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2364 */ |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2365 |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2366 public synchronized int GetScreen(char buffer[], int bufferLength, int row, |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2367 int col, int length, int plane) |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2368 // throws OhioException { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2369 { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2370 // Call GetScreen function after converting row and column to |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2371 // a position. |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2372 return planes.GetScreen(buffer, bufferLength, row, col, length, plane); |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2373 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2374 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2375 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2376 * <p> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2377 * GetScreenRect retrieves data from the various planes associated with the |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2378 * presentation space. The data is returned as a linear array of character |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2379 * values in the buffer provided. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2380 * </p> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2381 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2382 * <p> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2383 * The application supplies two positions that represent opposing corners of |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2384 * a rectangle within the presentation space. The starting and ending |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2385 * positions can have any spatial relationship to each other. The data |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2386 * returned starts from the row containing the upper-most point to the row |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2387 * containing the lower-most point, and from the left-most column to the |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2388 * right-most column. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2389 * </p> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2390 * <p> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2391 * The specified buffer must be at least large enough to contain the number |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2392 * of characters in the rectangle. If the buffer is too small, no data is |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2393 * copied and zero is returned by the method. Otherwise, the method returns |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2394 * the number of characters copied. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2395 * </p> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2396 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2397 * @param buffer |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2398 * @param bufferLength |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2399 * @param startPos |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2400 * @param endPos |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2401 * @param plane |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2402 * @return The number of characters copied to the buffer |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2403 * @throws OhioException |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2404 */ |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2405 |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2406 public synchronized int GetScreenRect(char buffer[], int bufferLength, |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2407 int startPos, int endPos, int plane) |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2408 // throws OhioException { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2409 { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2410 return planes.GetScreenRect(buffer, bufferLength, startPos, endPos, plane); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2411 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2412 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2413 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2414 * <p> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2415 * GetScreenRect retrieves data from the various planes associated with the |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2416 * presentation space. The data is returned as a linear array of character |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2417 * values in the buffer provided. The buffer is not terminated by a null |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2418 * character. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2419 * </p> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2420 * <p> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2421 * The application supplies two coordinates that represent opposing corners |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2422 * of a rectangle within the presentation space. The starting and ending |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2423 * coordinates can have any spatial relationship to each other. The data |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2424 * returned starts from the row containing the upper-most point to the row |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2425 * containing the lower-most point, and from the left-most column to the |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2426 * right-most column. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2427 * </p> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2428 * <p> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2429 * The specified buffer must be at least large enough to contain the number |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2430 * of characters in the rectangle. If the buffer is too small, no data is |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2431 * copied and zero is returned by the method. Otherwise, the method returns |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2432 * the number of characters copied. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2433 * </p> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2434 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2435 * @param buffer |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2436 * @param bufferLength |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2437 * @param startRow |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2438 * @param startCol |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2439 * @param endRow |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2440 * @param endCol |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2441 * @param plane |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2442 * @return The number characters copied to the buffer |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2443 * @throws OhioException |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2444 */ |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2445 |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2446 public synchronized int GetScreenRect(char buffer[], int bufferLength, |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2447 int startRow, int startCol, |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2448 int endRow, int endCol, int plane) |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2449 // throws OhioException { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2450 { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2451 return planes.GetScreenRect(buffer, bufferLength, startRow, startCol, endRow, |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2452 endCol, plane); |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2453 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2454 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2455 public synchronized boolean[] getActiveAidKeys() { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2456 return sessionVT.getActiveAidKeys(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2457 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2458 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2459 protected synchronized void setScreenData(String text, int location) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2460 // throws OhioException { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2461 if (location < 0 || location > lenScreen) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2462 return; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2463 // throw new OhioException(sessionVT.getSessionConfiguration(), |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2464 // OhioScreen5250.class.getName(), "osohio.screen.ohio00300", 1); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2465 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2466 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2467 int pos = location; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2468 int l = text.length(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2469 boolean updated = false; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2470 boolean flag = false; |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2471 int x = 0; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2472 |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2473 for (; x < l; x++) { |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2474 if (isInField(pos + x, true)) { |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2475 if (!screenFields.getCurrentField().isBypassField()) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2476 if (!flag) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2477 screenFields.getCurrentField().setMDT(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2478 updated = true; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2479 resetDirty(pos + x); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2480 screenFields.setMasterMDT(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2481 flag = true; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2482 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2483 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2484 planes.screen[pos + x] = text.charAt(x); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2485 setDirty(pos + x); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2486 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2487 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2488 } |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2489 |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2490 lastPos = pos + x; |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2491 |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2492 if (updated) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2493 fireScreenChanged(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2494 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2495 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2496 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2497 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2498 * This routine is based on offset 1,1 not 0,0 it will translate to offset |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2499 * 0,0 and call the goto_XY(int pos) it is mostly used from external classes |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2500 * that use the 1,1 offset |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2501 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2502 * @param row |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2503 * @param col |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2504 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2505 public void setCursor(int row, int col) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2506 goto_XY(((row - 1) * numCols) + (col - 1)); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2507 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2508 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2509 // this routine is based on offset 0,0 not 1,1 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2510 protected void goto_XY(int pos) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2511 lastPos = pos; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2512 updateCursorLoc(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2513 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2514 |
69
294435151b0c
use 5250 encryption config entry
Carl Byington <carl@five-ten-sg.com>
parents:
60
diff
changeset
|
2515 /* |
105
1b5887a3bb1c
setField() needs to dirty the modified screen positions
Carl Byington <carl@five-ten-sg.com>
parents:
82
diff
changeset
|
2516 * set the content of the field at (l,c) to data |
1b5887a3bb1c
setField() needs to dirty the modified screen positions
Carl Byington <carl@five-ten-sg.com>
parents:
82
diff
changeset
|
2517 * if l == -1, set the current field contents to data |
69
294435151b0c
use 5250 encryption config entry
Carl Byington <carl@five-ten-sg.com>
parents:
60
diff
changeset
|
2518 */ |
105
1b5887a3bb1c
setField() needs to dirty the modified screen positions
Carl Byington <carl@five-ten-sg.com>
parents:
82
diff
changeset
|
2519 public void setField(int l, int c, char [] data) { |
69
294435151b0c
use 5250 encryption config entry
Carl Byington <carl@five-ten-sg.com>
parents:
60
diff
changeset
|
2520 ScreenField cf; |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2521 |
69
294435151b0c
use 5250 encryption config entry
Carl Byington <carl@five-ten-sg.com>
parents:
60
diff
changeset
|
2522 if (l >= 0) { |
208
561caa2f7c17
more testing on cursor movement
Carl Byington <carl@five-ten-sg.com>
parents:
187
diff
changeset
|
2523 lastPos = l * numCols + c; |
307 | 2524 |
208
561caa2f7c17
more testing on cursor movement
Carl Byington <carl@five-ten-sg.com>
parents:
187
diff
changeset
|
2525 while (!isInField()) advancePos(); |
307 | 2526 |
141
13cea57ac61e
test setfield() cursor movement always sets the field contents
Carl Byington <carl@five-ten-sg.com>
parents:
140
diff
changeset
|
2527 setDirty(lastPos); |
146
8754f293f2fd
testing setfield functions
Carl Byington <carl@five-ten-sg.com>
parents:
141
diff
changeset
|
2528 fireCursorChanged(); |
69
294435151b0c
use 5250 encryption config entry
Carl Byington <carl@five-ten-sg.com>
parents:
60
diff
changeset
|
2529 } |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2530 |
105
1b5887a3bb1c
setField() needs to dirty the modified screen positions
Carl Byington <carl@five-ten-sg.com>
parents:
82
diff
changeset
|
2531 if ((data != null) && (data.length > 0)) { |
69
294435151b0c
use 5250 encryption config entry
Carl Byington <carl@five-ten-sg.com>
parents:
60
diff
changeset
|
2532 cf = screenFields.getCurrentField(); |
105
1b5887a3bb1c
setField() needs to dirty the modified screen positions
Carl Byington <carl@five-ten-sg.com>
parents:
82
diff
changeset
|
2533 cf.setString(new String(data)); |
69
294435151b0c
use 5250 encryption config entry
Carl Byington <carl@five-ten-sg.com>
parents:
60
diff
changeset
|
2534 lastPos = cf.getStartPos(); |
105
1b5887a3bb1c
setField() needs to dirty the modified screen positions
Carl Byington <carl@five-ten-sg.com>
parents:
82
diff
changeset
|
2535 setDirty(lastPos); |
106
12425771714d
setField() needs to dirty the modified screen positions
Carl Byington <carl@five-ten-sg.com>
parents:
105
diff
changeset
|
2536 setDirty(lastPos + cf.getLength()); |
184
cdaaa53b5eca
setfield positions the cursor properly as if the characters were typed
Carl Byington <carl@five-ten-sg.com>
parents:
183
diff
changeset
|
2537 lastPos += data.length; |
307 | 2538 |
184
cdaaa53b5eca
setfield positions the cursor properly as if the characters were typed
Carl Byington <carl@five-ten-sg.com>
parents:
183
diff
changeset
|
2539 if (!isInField()) { |
cdaaa53b5eca
setfield positions the cursor properly as if the characters were typed
Carl Byington <carl@five-ten-sg.com>
parents:
183
diff
changeset
|
2540 gotoFieldNext(); |
cdaaa53b5eca
setfield positions the cursor properly as if the characters were typed
Carl Byington <carl@five-ten-sg.com>
parents:
183
diff
changeset
|
2541 isInField(); |
185
c51bcf9f0516
setfield positions the cursor properly as if the characters were typed
Carl Byington <carl@five-ten-sg.com>
parents:
184
diff
changeset
|
2542 cf = screenFields.getCurrentField(); |
c51bcf9f0516
setfield positions the cursor properly as if the characters were typed
Carl Byington <carl@five-ten-sg.com>
parents:
184
diff
changeset
|
2543 lastPos = cf.getStartPos(); |
184
cdaaa53b5eca
setfield positions the cursor properly as if the characters were typed
Carl Byington <carl@five-ten-sg.com>
parents:
183
diff
changeset
|
2544 } |
307 | 2545 |
184
cdaaa53b5eca
setfield positions the cursor properly as if the characters were typed
Carl Byington <carl@five-ten-sg.com>
parents:
183
diff
changeset
|
2546 setDirty(lastPos); |
cdaaa53b5eca
setfield positions the cursor properly as if the characters were typed
Carl Byington <carl@five-ten-sg.com>
parents:
183
diff
changeset
|
2547 fireCursorChanged(); |
69
294435151b0c
use 5250 encryption config entry
Carl Byington <carl@five-ten-sg.com>
parents:
60
diff
changeset
|
2548 } |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2549 |
69
294435151b0c
use 5250 encryption config entry
Carl Byington <carl@five-ten-sg.com>
parents:
60
diff
changeset
|
2550 updateDirty(); |
294435151b0c
use 5250 encryption config entry
Carl Byington <carl@five-ten-sg.com>
parents:
60
diff
changeset
|
2551 } |
294435151b0c
use 5250 encryption config entry
Carl Byington <carl@five-ten-sg.com>
parents:
60
diff
changeset
|
2552 |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2553 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2554 * Set the current working field to the field number specified. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2555 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2556 * @param f - |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2557 * numeric field number on the screen |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2558 * @return true or false whether it was sucessful |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2559 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2560 public boolean gotoField(int f) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2561 int sizeFields = screenFields.getSize(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2562 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2563 if (f > sizeFields || f <= 0) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2564 return false; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2565 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2566 screenFields.setCurrentField(screenFields.getField(f - 1)); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2567 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2568 while (screenFields.isCurrentFieldBypassField() && f < sizeFields) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2569 screenFields.setCurrentField(screenFields.getField(f++)); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2570 } |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2571 |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2572 return gotoField(screenFields.getCurrentField()); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2573 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2574 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2575 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2576 * Convenience method to set the field object passed as the currect working |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2577 * screen field |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2578 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2579 * @param f |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2580 * @return true or false whether it was sucessful |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2581 * @see org.tn5250j.ScreenField |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2582 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2583 protected boolean gotoField(ScreenField f) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2584 if (f != null) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2585 goto_XY(f.startPos()); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2586 return true; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2587 } |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2588 |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2589 return false; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2590 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2591 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2592 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2593 * Convenience class to position the cursor to the next word on the screen |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2594 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2595 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2596 private void gotoNextWord() { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2597 int pos = lastPos; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2598 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2599 if (planes.getChar(lastPos) > ' ') { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2600 advancePos(); |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2601 |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2602 // get the next space character |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2603 while (planes.getChar(lastPos) > ' ' && pos != lastPos) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2604 advancePos(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2605 } |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2606 } |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2607 else |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2608 advancePos(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2609 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2610 // now that we are positioned on the next space character get the |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2611 // next none space character |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2612 while (planes.getChar(lastPos) <= ' ' && pos != lastPos) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2613 advancePos(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2614 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2615 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2616 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2617 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2618 * Convenience class to position the cursor to the previous word on the |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2619 * screen |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2620 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2621 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2622 private void gotoPrevWord() { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2623 int pos = lastPos; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2624 changePos(-1); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2625 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2626 // position previous white space character |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2627 while (planes.getChar(lastPos) <= ' ') { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2628 changePos(-1); |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2629 |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2630 if (pos == lastPos) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2631 break; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2632 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2633 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2634 changePos(-1); |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2635 |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2636 // get the previous space character |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2637 while (planes.getChar(lastPos) > ' ' && pos != lastPos) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2638 changePos(-1); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2639 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2640 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2641 // and position one position more should give us the beginning of word |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2642 advancePos(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2643 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2644 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2645 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2646 * Convinience class to position to the next field on the screen. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2647 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2648 * @see org.tn5250j.ScreenFields |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2649 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2650 private void gotoFieldNext() { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2651 if (screenFields.isCurrentFieldHighlightedEntry()) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2652 unsetFieldHighlighted(screenFields.getCurrentField()); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2653 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2654 screenFields.gotoFieldNext(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2655 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2656 if (screenFields.isCurrentFieldHighlightedEntry()) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2657 setFieldHighlighted(screenFields.getCurrentField()); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2658 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2659 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2660 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2661 * Convinience class to position to the previous field on the screen. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2662 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2663 * @see org.tn5250j.ScreenFields |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2664 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2665 private void gotoFieldPrev() { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2666 if (screenFields.isCurrentFieldHighlightedEntry()) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2667 unsetFieldHighlighted(screenFields.getCurrentField()); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2668 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2669 screenFields.gotoFieldPrev(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2670 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2671 if (screenFields.isCurrentFieldHighlightedEntry()) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2672 setFieldHighlighted(screenFields.getCurrentField()); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2673 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2674 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2675 /* *** NEVER USED LOCALLY ************************************************** */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2676 // /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2677 // * Used to restrict the cursor to a particular position on the screen. Used |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2678 // * in combination with windows to restrict the cursor to the active window |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2679 // * show on the screen. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2680 // * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2681 // * Not supported yet. Please implement me :-( |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2682 // * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2683 // * @param depth |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2684 // * @param width |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2685 // */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2686 // protected void setRestrictCursor(int depth, int width) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2687 // |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2688 // restrictCursor = true; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2689 // // restriction |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2690 // |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2691 // } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2692 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2693 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2694 * Creates a window on the screen |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2695 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2696 * @param depth |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2697 * @param width |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2698 * @param type |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2699 * @param gui |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2700 * @param monoAttr |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2701 * @param colorAttr |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2702 * @param ul |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2703 * @param upper |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2704 * @param ur |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2705 * @param left |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2706 * @param right |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2707 * @param ll |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2708 * @param bottom |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2709 * @param lr |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2710 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2711 protected void createWindow(int depth, int width, int type, boolean gui, |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2712 int monoAttr, int colorAttr, int ul, int upper, int ur, int left, |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2713 int right, int ll, int bottom, int lr) { |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2714 int c = getCol(lastPos); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2715 int w = 0; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2716 width++; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2717 w = width; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2718 // set leading attribute byte |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2719 // screen[lastPos].setCharAndAttr(initChar, initAttr, true); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2720 planes.setScreenCharAndAttr(lastPos, initChar, initAttr, true); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2721 setDirty(lastPos); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2722 advancePos(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2723 // set upper left |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2724 // screen[lastPos].setCharAndAttr((char) ul, colorAttr, false); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2725 planes.setScreenCharAndAttr(lastPos, (char) ul, colorAttr, false); |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2726 |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2727 if (gui) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2728 // screen[lastPos].setUseGUI(UPPER_LEFT); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2729 planes.setUseGUI(lastPos, UPPER_LEFT); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2730 } |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2731 |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2732 setDirty(lastPos); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2733 advancePos(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2734 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2735 // draw top row |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2736 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2737 while (w-- >= 0) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2738 // screen[lastPos].setCharAndAttr((char) upper, colorAttr, false); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2739 planes.setScreenCharAndAttr(lastPos, (char) upper, colorAttr, false); |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2740 |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2741 if (gui) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2742 // screen[lastPos].setUseGUI(UPPER); |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2743 planes.setUseGUI(lastPos, UPPER); |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2744 } |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2745 |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2746 setDirty(lastPos); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2747 advancePos(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2748 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2749 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2750 // set upper right |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2751 // screen[lastPos].setCharAndAttr((char) ur, colorAttr, false); |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2752 planes.setScreenCharAndAttr(lastPos, (char) ur, colorAttr, false); |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2753 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2754 if (gui) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2755 // screen[lastPos].setUseGUI(UPPER_RIGHT); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2756 planes.setUseGUI(lastPos, UPPER_RIGHT); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2757 } |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2758 |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2759 setDirty(lastPos); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2760 advancePos(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2761 // set ending attribute byte |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2762 planes.setScreenCharAndAttr(lastPos, initChar, initAttr, true); |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2763 setDirty(lastPos); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2764 lastPos = ((getRow(lastPos) + 1) * numCols) + c; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2765 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2766 // now handle body of window |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2767 while (depth-- > 0) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2768 // set leading attribute byte |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2769 planes.setScreenCharAndAttr(lastPos, initChar, initAttr, true); |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2770 setDirty(lastPos); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2771 advancePos(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2772 // set left |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2773 planes.setScreenCharAndAttr(lastPos, (char) left, colorAttr, false); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2774 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2775 if (gui) { |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2776 planes.setUseGUI(lastPos, GUI_LEFT); |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2777 } |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2778 |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2779 setDirty(lastPos); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2780 advancePos(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2781 w = width; |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2782 |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2783 // fill it in |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2784 while (w-- >= 0) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2785 // screen[lastPos].setCharAndAttr(initChar, initAttr, true); |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2786 planes.setScreenCharAndAttr(lastPos, initChar, initAttr, true); |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2787 // screen[lastPos].setUseGUI(NO_GUI); |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2788 planes.setUseGUI(lastPos, NO_GUI); |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2789 setDirty(lastPos); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2790 advancePos(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2791 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2792 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2793 // set right |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2794 // screen[lastPos].setCharAndAttr((char) right, colorAttr, false); |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2795 planes.setScreenCharAndAttr(lastPos, (char) right, colorAttr, false); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2796 |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2797 if (gui) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2798 // screen[lastPos].setUseGUI(RIGHT); |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2799 planes.setUseGUI(lastPos, GUI_RIGHT); |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2800 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2801 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2802 setDirty(lastPos); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2803 advancePos(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2804 // set ending attribute byte |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2805 // screen[lastPos].setCharAndAttr(initChar, initAttr, true); |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2806 planes.setScreenCharAndAttr(lastPos, initChar, initAttr, true); |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2807 setDirty(lastPos); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2808 lastPos = ((getRow(lastPos) + 1) * numCols) + c; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2809 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2810 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2811 // set leading attribute byte |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2812 // screen[lastPos].setCharAndAttr(initChar, initAttr, true); |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2813 planes.setScreenCharAndAttr(lastPos, initChar, initAttr, true); |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2814 setDirty(lastPos); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2815 advancePos(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2816 // set lower left |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2817 // screen[lastPos].setCharAndAttr((char) ll, colorAttr, false); |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2818 planes.setScreenCharAndAttr(lastPos, (char) ll, colorAttr, false); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2819 |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2820 if (gui) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2821 // screen[lastPos].setUseGUI(LOWER_LEFT); |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2822 planes.setUseGUI(lastPos, LOWER_LEFT); |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2823 } |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2824 |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2825 setDirty(lastPos); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2826 advancePos(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2827 w = width; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2828 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2829 // draw bottom row |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2830 while (w-- >= 0) { |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2831 planes.setScreenCharAndAttr(lastPos, (char) bottom, colorAttr, false); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2832 |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2833 if (gui) { |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2834 planes.setUseGUI(lastPos, BOTTOM); |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2835 } |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2836 |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2837 setDirty(lastPos); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2838 advancePos(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2839 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2840 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2841 // set lower right |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2842 planes.setScreenCharAndAttr(lastPos, (char) lr, colorAttr, false); |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2843 |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2844 if (gui) { |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2845 planes.setUseGUI(lastPos, LOWER_RIGHT); |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2846 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2847 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2848 setDirty(lastPos); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2849 advancePos(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2850 // set ending attribute byte |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2851 planes.setScreenCharAndAttr(lastPos, initChar, initAttr, true); |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2852 setDirty(lastPos); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2853 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2854 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2855 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2856 * Creates a scroll bar on the screen using the parameters provided. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2857 * ** we only support vertical scroll bars at the time. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2858 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2859 * @param flag - |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2860 * type to draw - vertical or horizontal |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2861 * @param totalRowScrollable |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2862 * @param totalColScrollable |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2863 * @param sliderRowPos |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2864 * @param sliderColPos |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2865 * @param sbSize |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2866 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2867 protected void createScrollBar(int flag, int totalRowScrollable, |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2868 int totalColScrollable, int sliderRowPos, int sliderColPos, |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2869 int sbSize) { |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2870 // System.out.println("Scrollbar flag: " + flag + |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2871 // " scrollable Rows: " + totalRowScrollable + |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2872 // " scrollable Cols: " + totalColScrollable + |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2873 // " thumb Row: " + sliderRowPos + |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2874 // " thumb Col: " + sliderColPos + |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2875 // " size: " + sbSize + |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2876 // " row: " + getRow(lastPos) + |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2877 // " col: " + getCol(lastPos)); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2878 int sp = lastPos; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2879 int size = sbSize - 2; |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2880 int thumbPos = (int)(size * ((float) sliderColPos / (float) totalColScrollable)); |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2881 // System.out.println(thumbPos); |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2882 planes.setScreenCharAndAttr(sp, ' ', 32, false); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2883 planes.setUseGUI(sp, BUTTON_SB_UP); |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2884 int ctr = 0; |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2885 |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2886 while (ctr < size) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2887 sp += numCols; |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2888 planes.setScreenCharAndAttr(sp, ' ', 32, false); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2889 |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2890 if (ctr == thumbPos) |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2891 planes.setUseGUI(sp, BUTTON_SB_THUMB); |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2892 else |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2893 planes.setUseGUI(sp, BUTTON_SB_GUIDE); |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2894 |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2895 ctr++; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2896 } |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2897 |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2898 sp += numCols; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2899 planes.setScreenCharAndAttr(sp, ' ', 32, false); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2900 planes.setUseGUI(sp, BUTTON_SB_DN); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2901 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2902 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2903 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2904 * Write the title of the window that is on the screen |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2905 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2906 * @param pos |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2907 * @param depth |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2908 * @param width |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2909 * @param orientation |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2910 * @param monoAttr |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2911 * @param colorAttr |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2912 * @param title |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2913 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2914 protected void writeWindowTitle(int pos, int depth, int width, |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2915 byte orientation, int monoAttr, int colorAttr, StringBuffer title) { |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2916 int len = title.length(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2917 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2918 // get bit 0 and 1 for interrogation |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2919 switch (orientation & 0xc0) { |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2920 case 0x40: // right |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2921 pos += (4 + width - len); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2922 break; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2923 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2924 case 0x80: // left |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2925 pos += 2; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2926 break; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2927 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2928 default: // center |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2929 // this is to place the position to the first text position of the |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2930 // window |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2931 // the position passed in is the first attribute position, the next |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2932 // is the border character and then there is another attribute after |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2933 // that. |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2934 pos += (3 + ((width / 2) - (len / 2))); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2935 break; |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2936 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2937 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2938 // if bit 2 is on then this is a footer |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2939 if ((orientation & 0x20) == 0x20) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2940 pos += ((depth + 1) * numCols); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2941 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2942 // System.out.println(pos + "," + width + "," + len+ "," + getRow(pos) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2943 // + "," + getCol(pos) + "," + ((orientation >> 6) & 0xf0)); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2944 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2945 for (int x = 0; x < len; x++) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2946 planes.setChar(pos, title.charAt(x)); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2947 planes.setUseGUI(pos++, NO_GUI); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2948 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2949 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2950 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2951 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2952 * Roll the screen up or down. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2953 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2954 * Byte 1: Bit 0 0 = Roll up 1 = Roll down Bits 1-2 Reserved Bits 3-7 Number |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2955 * of lines that the designated area is to be rolled Byte 2: Bits 0-7 Line |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2956 * number defining the top line of the area that will participate in the |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2957 * roll. Byte 3: Bits 0-7 Line number defining the bottom line of the area |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2958 * that will participate in the roll. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2959 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2960 * @param direction |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2961 * @param topLine |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2962 * @param bottomLine |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2963 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2964 protected void rollScreen(int direction, int topLine, int bottomLine) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2965 // get the number of lines which are the last 5 bits |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2966 /* int lines = direction & 0x7F; */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2967 // get the direction of the roll which is the first bit |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2968 // 0 - up |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2969 // 1 - down |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2970 int updown = direction & 0x80; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2971 final int lines = direction & 0x7F; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2972 // calculate the reference points for the move. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2973 int start = this.getPos(topLine - 1, 0); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2974 int end = this.getPos(bottomLine - 1, numCols - 1); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2975 int len = end - start; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2976 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2977 // System.out.println(" starting roll"); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2978 // dumpScreen(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2979 switch (updown) { |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2980 case 0: |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2981 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2982 // Now round em up and head em UP. |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2983 for (int x = start; x < end + numCols; x++) { |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2984 if (x + lines * numCols >= lenScreen) { |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2985 //Clear at the end |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2986 planes.setChar(x, ' '); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2987 } |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2988 else { |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2989 planes.setChar(x, planes.getChar(x + lines * numCols)); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2990 } |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2991 } |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2992 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2993 break; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2994 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2995 case 1: |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2996 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2997 // Now round em up and head em DOWN. |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2998 for (int x = end + numCols; x > 0; x--) { |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
2999 if ((x - lines * numCols) < 0) { |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3000 //Do nothing ... tooo small!!! |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3001 } |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3002 else { |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3003 planes.setChar(x - lines * numCols, planes.getChar(x)); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3004 //and clear |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3005 planes.setChar(x, ' '); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3006 } |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3007 } |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3008 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3009 break; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3010 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3011 default: |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3012 Log.w(TAG, " Invalid roll parameter - please report this"); |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3013 } |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3014 |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3015 // System.out.println(" end roll"); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3016 // dumpScreen(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3017 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3018 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3019 public void dumpScreen() { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3020 StringBuffer sb = new StringBuffer(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3021 char[] s = getScreenAsChars(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3022 int c = getColumns(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3023 int l = getRows() * c; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3024 int col = 0; |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3025 |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3026 for (int x = 0; x < l; x++, col++) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3027 sb.append(s[x]); |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3028 |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3029 if (col == c) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3030 sb.append('\n'); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3031 col = 0; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3032 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3033 } |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3034 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3035 Log.i(TAG, sb.toString()); |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3036 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3037 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3038 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3039 * Add a field to the field format table. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3040 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3041 * @param attr - Field attribute |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3042 * @param len - length of field |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3043 * @param ffw1 - Field format word 1 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3044 * @param ffw2 - Field format word 2 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3045 * @param fcw1 - Field control word 1 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3046 * @param fcw2 - Field control word 2 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3047 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3048 protected void addField(int attr, int len, int ffw1, int ffw2, int fcw1, |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3049 int fcw2) { |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3050 lastAttr = attr; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3051 planes.setScreenCharAndAttr(lastPos, initChar, lastAttr, true); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3052 setDirty(lastPos); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3053 advancePos(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3054 ScreenField sf = null; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3055 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3056 // from 14.6.12 for Start of Field Order 5940 function manual |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3057 // examine the format table for an entry that begins at the current |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3058 // starting address plus 1. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3059 if (screenFields.existsAtPos(lastPos)) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3060 screenFields.setCurrentFieldFFWs(ffw1, ffw2); |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3061 } |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3062 else { |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3063 sf = screenFields.setField(attr, getRow(lastPos), getCol(lastPos), |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3064 len, ffw1, ffw2, fcw1, fcw2); |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3065 lastPos = sf.startPos(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3066 int x = len; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3067 boolean gui = guiInterface; |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3068 |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3069 if (sf.isBypassField()) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3070 gui = false; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3071 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3072 while (x-- > 0) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3073 if (planes.getChar(lastPos) == 0) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3074 planes.setScreenCharAndAttr(lastPos, ' ', lastAttr, false); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3075 else |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3076 planes.setScreenAttr(lastPos, lastAttr); |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3077 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3078 if (gui) { |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3079 planes.setUseGUI(lastPos, FIELD_MIDDLE); |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3080 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3081 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3082 // now we set the field plane attributes |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3083 planes.setScreenFieldAttr(lastPos, ffw1); |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3084 advancePos(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3085 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3086 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3087 if (gui) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3088 if (len > 1) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3089 planes.setUseGUI(sf.startPos(), FIELD_LEFT); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3090 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3091 if (lastPos > 0) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3092 planes.setUseGUI(lastPos - 1, FIELD_RIGHT); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3093 else |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3094 planes.setUseGUI(lastPos, FIELD_RIGHT); |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3095 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3096 else { |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3097 planes.setUseGUI(lastPos - 1, FIELD_ONE); |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3098 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3099 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3100 // screen[lastPos].setCharAndAttr(initChar,initAttr,true); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3101 setEndingAttr(initAttr); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3102 lastPos = sf.startPos(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3103 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3104 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3105 // if (fcw1 != 0 || fcw2 != 0) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3106 // System.out.println("lr = " + lastRow + " lc = " + lastCol + " " + |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3107 // sf.toString()); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3108 // } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3109 sf = null; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3110 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3111 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3112 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3113 // public void addChoiceField(int attr, int len, int ffw1, int ffw2, int |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3114 // fcw1, int fcw2) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3115 // |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3116 // lastAttr = attr; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3117 // |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3118 // screen[lastPos].setCharAndAttr(initChar,lastAttr,true); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3119 // setDirty(lastPos); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3120 // |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3121 // advancePos(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3122 // |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3123 // boolean found = false; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3124 // ScreenField sf = null; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3125 // |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3126 // // from 14.6.12 for Start of Field Order 5940 function manual |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3127 // // examine the format table for an entry that begins at the current |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3128 // // starting address plus 1. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3129 // for (int x = 0;x < sizeFields; x++) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3130 // sf = screenFields[x]; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3131 // |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3132 // if (lastPos == sf.startPos()) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3133 // screenFields.getCurrentField() = sf; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3134 // screenFields.getCurrentField().setFFWs(ffw1,ffw2); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3135 // found = true; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3136 // } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3137 // |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3138 // } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3139 // |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3140 // if (!found) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3141 // sf = |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3142 // setField(attr,getRow(lastPos),getCol(lastPos),len,ffw1,ffw2,fcw1,fcw2); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3143 // |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3144 // lastPos = sf.startPos(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3145 // int x = len; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3146 // |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3147 // boolean gui = guiInterface; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3148 // if (sf.isBypassField()) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3149 // gui = false; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3150 // |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3151 // while (x-- > 0) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3152 // |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3153 // if (screen[lastPos].getChar() == 0) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3154 // screen[lastPos].setCharAndAttr(' ',lastAttr,false); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3155 // else |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3156 // screen[lastPos].setAttribute(lastAttr); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3157 // |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3158 // if (gui) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3159 // screen[lastPos].setUseGUI(FIELD_MIDDLE); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3160 // |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3161 // advancePos(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3162 // |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3163 // } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3164 // |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3165 // if (gui) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3166 // if (len > 1) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3167 // screen[sf.startPos()].setUseGUI(FIELD_LEFT); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3168 // if (lastPos > 0) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3169 // screen[lastPos-1].setUseGUI(FIELD_RIGHT); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3170 // else |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3171 // screen[lastPos].setUseGUI(FIELD_RIGHT); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3172 // |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3173 // } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3174 // else |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3175 // screen[lastPos-1].setUseGUI(FIELD_ONE); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3176 // |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3177 // setEndingAttr(initAttr); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3178 // |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3179 // lastPos = sf.startPos(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3180 // } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3181 // |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3182 // // if (fcw1 != 0 || fcw2 != 0) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3183 // // |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3184 // // System.out.println("lr = " + lastRow + " lc = " + lastCol + " " + |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3185 // sf.toString()); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3186 // // } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3187 // sf = null; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3188 // |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3189 // } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3190 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3191 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3192 * Return the fields that are contained in the Field Format Table |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3193 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3194 * @return ScreenFields object |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3195 * @see org.tn5250j.ScreenFields |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3196 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3197 public ScreenFields getScreenFields() { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3198 return screenFields; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3199 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3200 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3201 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3202 * Redraw the fields on the screen. Used for gui enhancement to redraw the |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3203 * fields when toggling |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3204 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3205 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3206 protected void drawFields() { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3207 ScreenField sf; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3208 int sizeFields = screenFields.getSize(); |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3209 |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3210 for (int x = 0; x < sizeFields; x++) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3211 sf = screenFields.getField(x); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3212 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3213 if (!sf.isBypassField()) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3214 int pos = sf.startPos(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3215 int l = sf.length; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3216 boolean f = true; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3217 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3218 if (l >= lenScreen) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3219 l = lenScreen - 1; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3220 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3221 if (l > 1) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3222 while (l-- > 0) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3223 if (guiInterface && f) { |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3224 planes.setUseGUI(pos, FIELD_LEFT); |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3225 f = false; |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3226 } |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3227 else { |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3228 planes.setUseGUI(pos, FIELD_MIDDLE); |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3229 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3230 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3231 if (guiInterface && l == 0) { |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3232 planes.setUseGUI(pos, FIELD_RIGHT); |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3233 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3234 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3235 setDirty(pos++); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3236 } |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3237 } |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3238 else { |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3239 planes.setUseGUI(pos, FIELD_ONE); |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3240 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3241 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3242 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3243 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3244 //updateDirty(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3245 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3246 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3247 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3248 * Draws the field on the screen. Used to redraw or change the attributes of |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3249 * the field. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3250 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3251 * @param sf - |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3252 * Field to be redrawn |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3253 * @see org.tn5250j.ScreenField.java |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3254 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3255 protected void drawField(ScreenField sf) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3256 int pos = sf.startPos(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3257 int x = sf.length; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3258 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3259 while (x-- > 0) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3260 setDirty(pos++); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3261 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3262 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3263 updateDirty(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3264 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3265 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3266 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3267 * Set the field to be displayed as highlighted. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3268 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3269 * @param sf - |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3270 * Field to be highlighted |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3271 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3272 protected void setFieldHighlighted(ScreenField sf) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3273 int pos = sf.startPos(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3274 int x = sf.length; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3275 int na = sf.getHighlightedAttr(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3276 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3277 while (x-- > 0) { |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3278 planes.setScreenAttr(pos, na); |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3279 setDirty(pos++); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3280 } |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3281 |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3282 fireScreenChanged(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3283 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3284 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3285 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3286 * Draw the field as un higlighted. This is used to reset the field |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3287 * presentation on the screen after the field is exited. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3288 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3289 * @param sf - |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3290 * Field to be unhighlighted |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3291 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3292 protected void unsetFieldHighlighted(ScreenField sf) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3293 int pos = sf.startPos(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3294 int x = sf.length; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3295 int na = sf.getAttr(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3296 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3297 while (x-- > 0) { |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3298 planes.setScreenAttr(pos, na); |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3299 setDirty(pos++); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3300 } |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3301 |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3302 fireScreenChanged(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3303 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3304 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3305 protected void setChar(int cByte) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3306 if (lastPos > 0) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3307 lastAttr = planes.getCharAttr(lastPos - 1); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3308 } |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3309 |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3310 if (cByte > 0 && (char)cByte < ' ') { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3311 planes.setScreenCharAndAttr(lastPos, (char) 0x00, 33, false); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3312 setDirty(lastPos); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3313 advancePos(); |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3314 } |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3315 else { |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3316 planes.setScreenCharAndAttr(lastPos, (char) cByte, lastAttr, false); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3317 setDirty(lastPos); |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3318 |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3319 if (guiInterface && !isInField(lastPos, false)) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3320 planes.setUseGUI(lastPos, NO_GUI); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3321 } |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3322 |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3323 advancePos(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3324 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3325 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3326 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3327 protected void setEndingAttr(int cByte) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3328 int attr = lastAttr; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3329 setAttr(cByte); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3330 lastAttr = attr; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3331 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3332 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3333 protected void setAttr(int cByte) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3334 lastAttr = cByte; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3335 // int sattr = screen[lastPos].getCharAttr(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3336 // System.out.println("changing from " + sattr + " to attr " + lastAttr |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3337 // + |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3338 // " at " + (this.getRow(lastPos) + 1) + "," + (this.getCol(lastPos) + |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3339 // 1)); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3340 planes.setScreenCharAndAttr(lastPos, initChar, lastAttr, true); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3341 setDirty(lastPos); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3342 advancePos(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3343 int pos = lastPos; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3344 int times = 0; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3345 // sattr = screen[lastPos].getCharAttr(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3346 // System.out.println(" next position after change " + sattr + " last |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3347 // attr " + lastAttr + |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3348 // " at " + (this.getRow(lastPos) + 1) + "," + (this.getCol(lastPos) + |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3349 // 1) + |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3350 // " attr place " + screen[lastPos].isAttributePlace()); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3351 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3352 while (planes.getCharAttr(lastPos) != lastAttr |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3353 && !planes.isAttributePlace(lastPos)) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3354 planes.setScreenAttr(lastPos, lastAttr); |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3355 |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3356 if (guiInterface && !isInField(lastPos, false)) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3357 int g = planes.getWhichGUI(lastPos); |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3358 |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3359 if (g >= FIELD_LEFT && g <= FIELD_ONE) |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3360 planes.setUseGUI(lastPos, NO_GUI); |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3361 } |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3362 |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3363 setDirty(lastPos); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3364 times++; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3365 advancePos(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3366 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3367 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3368 // sanity check for right now |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3369 // if (times > 200) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3370 // System.out.println(" setAttr = " + times + " start = " + (sr + 1) + |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3371 // "," + (sc + 1)); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3372 lastPos = pos; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3373 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3374 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3375 protected void setScreenCharAndAttr(char right, int colorAttr, boolean isAttr) { |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3376 planes.setScreenCharAndAttr(lastPos, right, colorAttr, isAttr); |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3377 setDirty(lastPos); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3378 advancePos(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3379 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3380 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3381 protected void setScreenCharAndAttr(char right, int colorAttr, |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3382 int whichGui, boolean isAttr) { |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3383 planes.setScreenCharAndAttr(lastPos, right, colorAttr, isAttr); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3384 planes.setUseGUI(lastPos, whichGui); |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3385 setDirty(lastPos); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3386 advancePos(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3387 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3388 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3389 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3390 * Draw or redraw the dirty parts of the screen and display them. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3391 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3392 * Rectangle dirty holds the dirty area of the screen to be updated. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3393 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3394 * If you want to change the screen in anyway you need to set the screen |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3395 * attributes before calling this routine. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3396 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3397 protected void updateDirty() { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3398 fireScreenChanged(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3399 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3400 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3401 protected void setDirty(int pos) { |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3402 int minr = Math.min(getRow(pos), getRow(dirtyScreen.x)); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3403 int minc = Math.min(getCol(pos), getCol(dirtyScreen.x)); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3404 int maxr = Math.max(getRow(pos), getRow(dirtyScreen.y)); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3405 int maxc = Math.max(getCol(pos), getCol(dirtyScreen.y)); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3406 int x1 = getPos(minr, minc); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3407 int x2 = getPos(maxr, maxc); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3408 dirtyScreen.setBounds(x1, x2, 0, 0); |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3409 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3410 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3411 private void resetDirty(int pos) { |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3412 dirtyScreen.setBounds(pos, pos, 0, 0); |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3413 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3414 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3415 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3416 * Change the screen position by one column |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3417 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3418 protected void advancePos() { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3419 changePos(1); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3420 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3421 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3422 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3423 * Change position of the screen by the increment of parameter passed. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3424 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3425 * If the position change is under the minimum of the first screen position |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3426 * then the position is moved to the last row and column of the screen. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3427 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3428 * If the position change is over the last row and column of the screen then |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3429 * cursor is moved to first position of the screen. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3430 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3431 * @param i |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3432 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3433 protected void changePos(int i) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3434 lastPos += i; |
307 | 3435 |
187
81f9ba83c0e9
setfield positions the cursor properly as if the characters were typed
Carl Byington <carl@five-ten-sg.com>
parents:
186
diff
changeset
|
3436 while (lastPos < 0) lastPos += lenScreen; |
307 | 3437 |
187
81f9ba83c0e9
setfield positions the cursor properly as if the characters were typed
Carl Byington <carl@five-ten-sg.com>
parents:
186
diff
changeset
|
3438 while (lastPos >= lenScreen) lastPos -= lenScreen; |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3439 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3440 |
187
81f9ba83c0e9
setfield positions the cursor properly as if the characters were typed
Carl Byington <carl@five-ten-sg.com>
parents:
186
diff
changeset
|
3441 |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3442 protected void goHome() { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3443 // now we try to move to first input field according to |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3444 // 14.6 WRITE TO DISPLAY Command |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3445 // ? If the WTD command is valid, after the command is processed, |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3446 // the cursor moves to one of three locations: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3447 // - The location set by an insert cursor order (unless control |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3448 // character byte 1, bit 1 is equal to B'1'.) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3449 // - The start of the first non-bypass input field defined in the |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3450 // format table |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3451 // - A default starting address of row 1 column 1. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3452 if (pendingInsert && homePos > 0) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3453 setCursor(getRow(homePos), getCol(homePos)); |
184
cdaaa53b5eca
setfield positions the cursor properly as if the characters were typed
Carl Byington <carl@five-ten-sg.com>
parents:
183
diff
changeset
|
3454 isInField(); |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3455 } |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3456 else { |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3457 if (!gotoField(1)) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3458 homePos = getPos(1, 1); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3459 setCursor(1, 1); |
184
cdaaa53b5eca
setfield positions the cursor properly as if the characters were typed
Carl Byington <carl@five-ten-sg.com>
parents:
183
diff
changeset
|
3460 isInField(0, 0); |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3461 } |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3462 else { |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3463 homePos = getPos(getCurrentRow(), getCurrentCol()); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3464 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3465 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3466 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3467 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3468 protected void setPendingInsert(boolean flag, int icX, int icY) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3469 pendingInsert = flag; |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3470 |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3471 if (pendingInsert) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3472 homePos = getPos(icX, icY); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3473 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3474 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3475 if (!isStatusErrorCode()) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3476 setCursor(icX, icY); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3477 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3478 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3479 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3480 protected void setPendingInsert(boolean flag) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3481 if (homePos != -1) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3482 pendingInsert = flag; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3483 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3484 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3485 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3486 * Set the error line number to that of number passed. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3487 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3488 * @param line |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3489 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3490 protected void setErrorLine(int line) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3491 planes.setErrorLine(line); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3492 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3493 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3494 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3495 * Returns the current error line number |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3496 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3497 * @return current error line number |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3498 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3499 protected int getErrorLine() { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3500 return planes.getErrorLine(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3501 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3502 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3503 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3504 * Saves off the current error line characters to be used later. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3505 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3506 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3507 protected void saveErrorLine() { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3508 planes.saveErrorLine(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3509 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3510 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3511 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3512 * Restores the error line characters from the save buffer. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3513 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3514 * @see #saveErrorLine() |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3515 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3516 protected void restoreErrorLine() { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3517 if (planes.isErrorLineSaved()) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3518 planes.restoreErrorLine(); |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3519 fireScreenChanged(planes.getErrorLine() - 1, 0, planes.getErrorLine() - 1, numCols - 1); |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3520 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3521 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3522 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3523 protected void setStatus(byte attr, byte value, String s) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3524 // set the status area |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3525 switch (attr) { |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3526 case STATUS_SYSTEM: |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3527 if (value == STATUS_VALUE_ON) { |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3528 oia.setInputInhibited(ScreenOIA.INPUTINHIBITED_SYSTEM_WAIT, ScreenOIA.OIA_LEVEL_INPUT_INHIBITED, s); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3529 } |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3530 else { |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3531 oia.setInputInhibited(ScreenOIA.INPUTINHIBITED_NOTINHIBITED, ScreenOIA.OIA_LEVEL_NOT_INHIBITED, s); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3532 } |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3533 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3534 break; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3535 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3536 case STATUS_ERROR_CODE: |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3537 if (value == STATUS_VALUE_ON) { |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3538 setPrehelpState(true, true, false); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3539 oia.setInputInhibited(ScreenOIA.INPUTINHIBITED_SYSTEM_WAIT, |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3540 ScreenOIA.OIA_LEVEL_INPUT_ERROR, s); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3541 sessionVT.signalBell(); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3542 } |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3543 else { |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3544 oia.setInputInhibited(ScreenOIA.INPUTINHIBITED_NOTINHIBITED, |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3545 ScreenOIA.OIA_LEVEL_NOT_INHIBITED); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3546 setPrehelpState(false, true, true); |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3547 homePos = saveHomePos; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3548 saveHomePos = 0; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3549 pendingInsert = false; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3550 } |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3551 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3552 break; |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3553 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3554 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3555 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3556 protected boolean isStatusErrorCode() { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3557 return oia.getLevel() == ScreenOIA.OIA_LEVEL_INPUT_ERROR; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3558 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3559 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3560 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3561 * This routine clears the screen, resets row and column to 0, resets the |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3562 * last attribute to 32, clears the fields, turns insert mode off, |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3563 * clears/initializes the screen character array. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3564 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3565 protected void clearAll() { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3566 lastAttr = 32; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3567 lastPos = 0; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3568 clearTable(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3569 clearScreen(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3570 planes.setScreenAttr(0, initAttr); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3571 oia.setInsertMode(false); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3572 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3573 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3574 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3575 * Clear the fields table |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3576 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3577 protected void clearTable() { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3578 oia.setKeyBoardLocked(true); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3579 screenFields.clearFFT(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3580 planes.initalizeFieldPlanes(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3581 pendingInsert = false; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3582 homePos = -1; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3583 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3584 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3585 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3586 * Clear the gui constructs |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3587 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3588 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3589 protected void clearGuiStuff() { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3590 for (int x = 0; x < lenScreen; x++) { |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3591 planes.setUseGUI(x, NO_GUI); |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3592 } |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3593 |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3594 dirtyScreen.setBounds(0, lenScreen - 1, 0, 0); |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3595 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3596 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3597 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3598 * Clear the screen by setting the initial character and initial attribute |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3599 * to all the positions on the screen |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3600 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3601 protected void clearScreen() { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3602 planes.initalizePlanes(); |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3603 dirtyScreen.setBounds(0, lenScreen - 1, 0, 0); |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3604 oia.clearScreen(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3605 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3606 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3607 protected void restoreScreen() { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3608 lastAttr = 32; |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3609 dirtyScreen.setBounds(0, lenScreen - 1, 0, 0); |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3610 updateDirty(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3611 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3612 |
140
4fe73e73d4d7
fill vt320 buffer from tn5250 buffer when font size shrinks
Carl Byington <carl@five-ten-sg.com>
parents:
139
diff
changeset
|
3613 public void onFontSizeChanged(float size) { |
307 | 3614 fireScreenChanged(0, 0, numRows - 1, numCols - 1); |
140
4fe73e73d4d7
fill vt320 buffer from tn5250 buffer when font size shrinks
Carl Byington <carl@five-ten-sg.com>
parents:
139
diff
changeset
|
3615 } |
4fe73e73d4d7
fill vt320 buffer from tn5250 buffer when font size shrinks
Carl Byington <carl@five-ten-sg.com>
parents:
139
diff
changeset
|
3616 |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3617 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3618 * repaint part of the screen |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3619 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3620 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3621 private void fireScreenChanged(int startRow, int startCol, int endRow, int endCol) { |
75
bf01d1eec5c6
convert 5250 to vt320 attributes
Carl Byington <carl@five-ten-sg.com>
parents:
70
diff
changeset
|
3622 int [] vt320color = {0x0, // black |
bf01d1eec5c6
convert 5250 to vt320 attributes
Carl Byington <carl@five-ten-sg.com>
parents:
70
diff
changeset
|
3623 0x4, // blue |
bf01d1eec5c6
convert 5250 to vt320 attributes
Carl Byington <carl@five-ten-sg.com>
parents:
70
diff
changeset
|
3624 0x2, // green |
bf01d1eec5c6
convert 5250 to vt320 attributes
Carl Byington <carl@five-ten-sg.com>
parents:
70
diff
changeset
|
3625 0x6, // cyan |
bf01d1eec5c6
convert 5250 to vt320 attributes
Carl Byington <carl@five-ten-sg.com>
parents:
70
diff
changeset
|
3626 0x1, // red |
bf01d1eec5c6
convert 5250 to vt320 attributes
Carl Byington <carl@five-ten-sg.com>
parents:
70
diff
changeset
|
3627 0x5, // magenta/purple |
bf01d1eec5c6
convert 5250 to vt320 attributes
Carl Byington <carl@five-ten-sg.com>
parents:
70
diff
changeset
|
3628 0xb, // yellow |
bf01d1eec5c6
convert 5250 to vt320 attributes
Carl Byington <carl@five-ten-sg.com>
parents:
70
diff
changeset
|
3629 0x7, // light gray/white |
bf01d1eec5c6
convert 5250 to vt320 attributes
Carl Byington <carl@five-ten-sg.com>
parents:
70
diff
changeset
|
3630 0x8, // dark gray |
bf01d1eec5c6
convert 5250 to vt320 attributes
Carl Byington <carl@five-ten-sg.com>
parents:
70
diff
changeset
|
3631 0xc, // light blue |
bf01d1eec5c6
convert 5250 to vt320 attributes
Carl Byington <carl@five-ten-sg.com>
parents:
70
diff
changeset
|
3632 0xa, // light green |
bf01d1eec5c6
convert 5250 to vt320 attributes
Carl Byington <carl@five-ten-sg.com>
parents:
70
diff
changeset
|
3633 0xe, // light cyan |
bf01d1eec5c6
convert 5250 to vt320 attributes
Carl Byington <carl@five-ten-sg.com>
parents:
70
diff
changeset
|
3634 0x9, // light red |
bf01d1eec5c6
convert 5250 to vt320 attributes
Carl Byington <carl@five-ten-sg.com>
parents:
70
diff
changeset
|
3635 0xd, // light magenta/purple |
bf01d1eec5c6
convert 5250 to vt320 attributes
Carl Byington <carl@five-ten-sg.com>
parents:
70
diff
changeset
|
3636 0x3, // brown |
76
00464d9c2f54
convert 5250 to vt320 attributes
Carl Byington <carl@five-ten-sg.com>
parents:
75
diff
changeset
|
3637 0xf // bright white |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3638 }; |
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3639 |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3640 for (int r = startRow; r <= endRow; r++) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3641 for (int c = startCol; c <= endCol; c++) { |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3642 int p = getPos(r, c); |
75
bf01d1eec5c6
convert 5250 to vt320 attributes
Carl Byington <carl@five-ten-sg.com>
parents:
70
diff
changeset
|
3643 char ch = planes.getChar(p); |
bf01d1eec5c6
convert 5250 to vt320 attributes
Carl Byington <carl@five-ten-sg.com>
parents:
70
diff
changeset
|
3644 char co = planes.getCharColor(p); |
bf01d1eec5c6
convert 5250 to vt320 attributes
Carl Byington <carl@five-ten-sg.com>
parents:
70
diff
changeset
|
3645 char at = planes.getCharExtended(p); |
81
49bda8001175
don't display attribute characters
Carl Byington <carl@five-ten-sg.com>
parents:
78
diff
changeset
|
3646 boolean ia = planes.isAttributePlace(p); |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3647 |
60
d9b27288a9d2
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
58
diff
changeset
|
3648 if (ch < ' ') ch = ' '; |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3649 |
108
ae3092cd9cbf
use hash map rather than linear search thru arrays
Carl Byington <carl@five-ten-sg.com>
parents:
107
diff
changeset
|
3650 int bg = vt320color[(co >> 8) & 0x0f] + 1; |
ae3092cd9cbf
use hash map rather than linear search thru arrays
Carl Byington <carl@five-ten-sg.com>
parents:
107
diff
changeset
|
3651 int fg = vt320color[co & 0x0f] + 1; |
ae3092cd9cbf
use hash map rather than linear search thru arrays
Carl Byington <carl@five-ten-sg.com>
parents:
107
diff
changeset
|
3652 int ul = at & EXTENDED_5250_UNDERLINE; |
ae3092cd9cbf
use hash map rather than linear search thru arrays
Carl Byington <carl@five-ten-sg.com>
parents:
107
diff
changeset
|
3653 int nd = at & EXTENDED_5250_NON_DSP; |
78
044b1a951925
convert 5250 to vt320 attributes
Carl Byington <carl@five-ten-sg.com>
parents:
77
diff
changeset
|
3654 int vt_attr = (fg << VDUBuffer.COLOR_FG_SHIFT) + (bg << VDUBuffer.COLOR_BG_SHIFT); |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3655 |
78
044b1a951925
convert 5250 to vt320 attributes
Carl Byington <carl@five-ten-sg.com>
parents:
77
diff
changeset
|
3656 if (ul > 0) vt_attr |= VDUBuffer.UNDERLINE; |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3657 |
81
49bda8001175
don't display attribute characters
Carl Byington <carl@five-ten-sg.com>
parents:
78
diff
changeset
|
3658 if (ia || (nd > 0)) vt_attr |= VDUBuffer.INVISIBLE; |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3659 |
75
bf01d1eec5c6
convert 5250 to vt320 attributes
Carl Byington <carl@five-ten-sg.com>
parents:
70
diff
changeset
|
3660 buffer.putChar(c, r, ch, vt_attr); |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3661 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3662 } |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3663 |
41
9621ac4dd5eb
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
40
diff
changeset
|
3664 buffer.redrawPassthru(); |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3665 dirtyScreen.setBounds(lenScreen, 0, 0, 0); |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3666 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3667 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3668 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3669 * repaint the dirty part of the screen |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3670 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3671 */ |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3672 |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3673 private synchronized void fireScreenChanged() { |
413 | 3674 if (dirtyScreen.x > dirtyScreen.y) return; |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3675 fireScreenChanged(getRow(dirtyScreen.x), getCol(dirtyScreen.x), |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3676 getRow(dirtyScreen.y), getCol(dirtyScreen.y)); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3677 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3678 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3679 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3680 * update the cursor position |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3681 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3682 */ |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3683 |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3684 private synchronized void fireCursorChanged() { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3685 int l = getRow(lastPos); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3686 int c = getCol(lastPos); |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3687 buffer.setCursorPosition(c, l); |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3688 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3689 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3690 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3691 * update the screen size. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3692 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3693 private void fireScreenSizeChanged() { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3694 buffer.setScreenSize(numCols, numRows, true); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3695 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3696 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3697 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3698 * This method does a complete refresh of the screen. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3699 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3700 public final void updateScreen() { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3701 repaintScreen(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3702 setCursorActive(false); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3703 setCursorActive(true); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3704 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3705 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3706 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3707 * Utility method to share the repaint behaviour between setBounds() and |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3708 * updateScreen. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3709 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3710 public void repaintScreen() { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3711 setCursorOff(); |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3712 dirtyScreen.setBounds(0, lenScreen - 1, 0, 0); |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3713 updateDirty(); |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3714 |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3715 // restore statuses that were on the screen before resize |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3716 if (oia.getLevel() == ScreenOIA.OIA_LEVEL_INPUT_ERROR) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3717 oia.setInputInhibited(ScreenOIA.INPUTINHIBITED_SYSTEM_WAIT, |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3718 ScreenOIA.OIA_LEVEL_INPUT_ERROR); |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3719 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3720 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3721 if (oia.getLevel() == ScreenOIA.OIA_LEVEL_INPUT_INHIBITED) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3722 oia.setInputInhibited(ScreenOIA.INPUTINHIBITED_SYSTEM_WAIT, |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3723 ScreenOIA.OIA_LEVEL_INPUT_INHIBITED); |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3724 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3725 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3726 if (oia.isMessageWait()) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3727 oia.setMessageLightOn(); |
112
77ac18bc1b2f
cleanup java formatting
Carl Byington <carl@five-ten-sg.com>
parents:
111
diff
changeset
|
3728 |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3729 setCursorOn(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3730 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3731 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3732 // ADDED BY BARRY - changed by Kenneth to use the character plane |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3733 // This should be replaced with the getPlane methods when they are implemented |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3734 public char[] getCharacters() { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3735 return planes.screen; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3736 } |
3 | 3737 |
3738 } |