Mercurial > 510Connectbot
annotate src/org/tn5250j/framework/tn5250/Screen5250.java @ 107:afe6962769b9
use hash map rather than linear search thru arrays
author | Carl Byington <carl@five-ten-sg.com> |
---|---|
date | Wed, 18 Jun 2014 11:43:08 -0700 |
parents | 12425771714d |
children | ae3092cd9cbf |
rev | line source |
---|---|
3 | 1 /** |
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; | |
25
5949eb469a79
adding tn5250 files, native android logging
Carl Byington <carl@five-ten-sg.com>
parents:
10
diff
changeset
|
37 import android.util.Log; |
33
2a8b52dbc104
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
32
diff
changeset
|
38 import de.mud.terminal.vt320; |
75
bf01d1eec5c6
convert 5250 to vt320 attributes
Carl Byington <carl@five-ten-sg.com>
parents:
70
diff
changeset
|
39 import de.mud.terminal.VDUBuffer; |
25
5949eb469a79
adding tn5250 files, native android logging
Carl Byington <carl@five-ten-sg.com>
parents:
10
diff
changeset
|
40 |
3 | 41 |
42 public class Screen5250 { | |
26
9ae1c889a64c
adding tn5250 files, native android logging
Carl Byington <carl@five-ten-sg.com>
parents:
25
diff
changeset
|
43 private static final String TAG = "Screen5250"; |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
44 private ScreenFields screenFields; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
45 private int lastAttr; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
46 private int lastPos; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
47 private int lenScreen; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
48 private KeyStrokenizer strokenizer; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
49 private tnvt sessionVT; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
50 private vt320 buffer; // used to draw the screen |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
51 private int numRows = 0; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
52 private int numCols = 0; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
53 protected static final int initAttr = 32; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
54 protected static final char initChar = 0; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
55 public boolean cursorActive = false; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
56 public boolean cursorShown = false; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
57 protected boolean insertMode = false; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
58 private boolean keyProcessed = false; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
59 private Rect dirtyScreen = new Rect(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
60 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
61 public int homePos = 0; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
62 public int saveHomePos = 0; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
63 private String bufferedKeys; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
64 public boolean pendingInsert = false; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
65 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
66 public final static byte STATUS_SYSTEM = 1; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
67 public final static byte STATUS_ERROR_CODE = 2; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
68 public final static byte STATUS_VALUE_ON = 1; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
69 public final static byte STATUS_VALUE_OFF = 2; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
70 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
71 private StringBuffer hsMore = new StringBuffer("More..."); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
72 private StringBuffer hsBottom = new StringBuffer("Bottom"); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
73 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
74 // 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
|
75 private final static int ERR_CURSOR_PROTECTED = 0x05; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
76 private final static int ERR_INVALID_SIGN = 0x11; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
77 private final static int ERR_NO_ROOM_INSERT = 0x12; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
78 private final static int ERR_NUMERIC_ONLY = 0x09; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
79 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
|
80 private final static int ERR_NUMERIC_09 = 0x10; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
81 private final static int ERR_FIELD_MINUS = 0x16; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
82 private final static int ERR_FIELD_EXIT_INVALID = 0x18; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
83 private final static int ERR_ENTER_NO_ALLOWED = 0x20; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
84 private final static int ERR_MANDITORY_ENTER = 0x21; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
85 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
86 private boolean guiInterface = false; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
87 private boolean resetRequired = true; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
88 private boolean backspaceError = true; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
89 private boolean feError; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
90 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
91 // Operator Information Area |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
92 private ScreenOIA oia; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
93 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
94 // screen planes |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
95 protected ScreenPlanes planes; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
96 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
97 //Added by Barry |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
98 private StringBuffer keybuf; |
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 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
102 public Screen5250() { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
103 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
104 //Added by Barry |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
105 this.keybuf = new StringBuffer(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
106 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
107 try { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
108 jbInit(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
109 } catch (Exception ex) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
110 Log.w(TAG,"In constructor: ", ex); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
111 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
112 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
113 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
114 void jbInit() throws Exception { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
115 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
116 lastAttr = 32; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
117 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
118 // default number of rows and columns |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
119 numRows = 24; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
120 numCols = 80; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
121 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
122 setCursor(1, 1); // set initial cursor position |
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 oia = new ScreenOIA(this); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
125 oia.setKeyBoardLocked(true); |
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 lenScreen = numRows * numCols; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
128 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
129 planes = new ScreenPlanes(this,numRows); |
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 screenFields = new ScreenFields(this); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
132 strokenizer = new KeyStrokenizer(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
133 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
134 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
135 protected ScreenPlanes getPlanes() { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
136 return planes; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
137 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
138 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
139 public final ScreenOIA getOIA() { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
140 return oia; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
141 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
142 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
143 protected final void setRowsCols(int rows, int cols) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
144 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
145 int oldRows = numRows; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
146 int oldCols = numCols; |
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 // default number of rows and columns |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
149 numRows = rows; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
150 numCols = cols; |
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 lenScreen = numRows * numCols; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
153 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
154 planes.setSize(rows); |
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 // 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
|
157 // the size changed. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
158 if (oldRows != numRows || oldCols != numCols) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
159 fireScreenSizeChanged(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
160 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
161 } |
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 boolean isCursorActive() { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
165 return cursorActive; |
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 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
169 public boolean isCursorShown() { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
170 return cursorShown; |
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 public void setUseGUIInterface(boolean gui) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
174 guiInterface = gui; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
175 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
176 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
177 public void toggleGUIInterface() { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
178 guiInterface = !guiInterface; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
179 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
180 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
181 public void setResetRequired(boolean reset) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
182 resetRequired = reset; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
183 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
184 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
185 public void setBackspaceError(boolean onError) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
186 backspaceError = onError; |
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 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
189 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
190 * Copy & Paste support |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
191 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
192 * @see {@link #pasteText(String, boolean)} |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
193 * @see {@link #copyTextField(int)} |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
194 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
195 public final String copyText(Rect area) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
196 StringBuilder sb = new StringBuilder(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
197 Rect workR = new Rect(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
198 workR.setBounds(area); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
199 Log.d(TAG,"Copying " + workR); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
200 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
201 // 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
|
202 int m = workR.x; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
203 int i = 0; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
204 int t = 0; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
205 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
206 while (workR.height-- > 0) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
207 t = workR.width; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
208 i = workR.y; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
209 while (t-- > 0) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
210 // only copy printable characters (in this case >= ' ') |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
211 char c = planes.getChar(getPos(m - 1, i - 1)); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
212 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
|
213 == 0) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
214 sb.append(c); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
215 else |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
216 sb.append(' '); |
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 i++; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
219 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
220 sb.append('\n'); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
221 m++; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
222 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
223 return sb.toString(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
224 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
225 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
226 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
227 * Copy & Paste support |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
228 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
229 * @param content |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
230 * @see {@link #copyText(Rectangle)} |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
231 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
232 public final void pasteText(String content, boolean special) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
233 Log.d(TAG,"Pasting, special:"+special); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
234 setCursorActive(false); |
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 StringBuilder sb = new StringBuilder(content); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
237 StringBuilder pd = new StringBuilder(); |
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 // character counters within the string to be pasted. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
240 int nextChar = 0; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
241 int nChars = sb.length(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
242 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
243 int lr = getRow(lastPos); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
244 int lc = getCol(lastPos); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
245 resetDirty(lastPos); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
246 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
247 int cpos = lastPos; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
248 int length = getScreenLength(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
249 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
250 char c = 0; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
251 boolean setIt; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
252 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
253 // save our current place within the FFT. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
254 screenFields.saveCurrentField(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
255 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
256 for (int x = nextChar; x < nChars; x++) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
257 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
258 c = sb.charAt(x); |
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 if ((c == '\n') || (c == '\r')) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
261 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
262 Log.i(TAG,"pasted cr-lf>" + pd + "<"); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
263 pd.setLength(0); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
264 // 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
|
265 // to the starting column of the next row and start from there |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
266 cpos = getPos(getRow(cpos)+1,lc); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
267 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
268 // 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
|
269 // the beginning of the screen space. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
270 if (cpos > length) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
271 cpos = 0; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
272 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
273 else { |
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 // we will default to set the character always. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
276 setIt = true; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
277 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
278 // 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
|
279 // characters to paste. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
280 if (special && (!Character.isLetter(c) && !Character.isDigit(c))) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
281 setIt = false; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
282 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
283 // 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
|
284 // a field |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
285 if (isInField(cpos) && setIt) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
286 planes.setChar(cpos, c); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
287 setDirty(cpos); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
288 screenFields.setCurrentFieldMDT(); |
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 // 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
|
291 if (setIt) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
292 cpos++; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
293 // we will append the information to our debug buffer. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
294 pd.append(c); |
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 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
297 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
298 // 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
|
299 if (pd.length() > 0) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
300 Log.i(TAG,"pasted >" + pd + "<"); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
301 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
302 // restore out position within the FFT. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
303 screenFields.restoreCurrentField(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
304 updateDirty(); |
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 // restore our cursor position. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
307 setCursor(lr + 1, lc + 1); |
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 setCursorActive(true); |
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 } |
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 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
314 * Copy & Paste support |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
315 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
316 * @param position |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
317 * @return |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
318 * @see {@link #copyText(int)} |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
319 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
320 public final String copyTextField(int position) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
321 screenFields.saveCurrentField(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
322 isInField(position); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
323 String result = screenFields.getCurrentFieldText(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
324 screenFields.restoreCurrentField(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
325 return result; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
326 } |
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 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
329 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
330 * Copy & Paste end code |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
331 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
332 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
333 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
334 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
335 * Sum them |
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 * @param which |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
338 * formatting option to use |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
339 * @return vector string of numberic values |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
340 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
341 public final Vector<Double> sumThem(boolean which, Rect area) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
342 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
343 StringBuilder sb = new StringBuilder(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
344 Rect workR = new Rect(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
345 workR.setBounds(area); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
346 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
347 // gui.rubberband.reset(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
348 // gui.repaint(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
349 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
350 Log.d(TAG,"Summing"); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
351 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
352 // obtain the decimal format for parsing |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
353 DecimalFormat df = (DecimalFormat) NumberFormat.getInstance(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
354 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
355 DecimalFormatSymbols dfs = df.getDecimalFormatSymbols(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
356 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
357 if (which) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
358 dfs.setDecimalSeparator('.'); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
359 dfs.setGroupingSeparator(','); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
360 } else { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
361 dfs.setDecimalSeparator(','); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
362 dfs.setGroupingSeparator('.'); |
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 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
365 df.setDecimalFormatSymbols(dfs); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
366 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
367 Vector<Double> sumVector = new Vector<Double>(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
368 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
369 // 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
|
370 int m = workR.x; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
371 int i = 0; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
372 int t = 0; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
373 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
374 double sum = 0.0; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
375 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
376 while (workR.height-- > 0) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
377 t = workR.width; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
378 i = workR.y; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
379 while (t-- > 0) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
380 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
381 // only copy printable numeric characters (in this case >= ' ') |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
382 // char c = screen[getPos(m - 1, i - 1)].getChar(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
383 char c = planes.getChar(getPos(m - 1, i - 1)); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
384 // if (((c >= '0' && c <= '9') || c == '.' || c == ',' || c == '-') |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
385 // && !screen[getPos(m - 1, i - 1)].nonDisplay) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
386 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
387 // 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
|
388 if (((c >= '0' && c <= '9') || c == '.' || c == ',' || c == '-')) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
389 sb.append(c); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
390 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
391 i++; |
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 if (sb.length() > 0) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
395 if (sb.charAt(sb.length() - 1) == '-') { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
396 sb.insert(0, '-'); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
397 sb.deleteCharAt(sb.length() - 1); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
398 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
399 try { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
400 Number n = df.parse(sb.toString()); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
401 // System.out.println(s + " " + n.doubleValue()); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
402 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
403 sumVector.add(new Double(n.doubleValue())); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
404 sum += n.doubleValue(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
405 } catch (ParseException pe) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
406 Log.w(TAG,pe.getMessage() + " at " |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
407 + pe.getErrorOffset()); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
408 } |
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 sb.setLength(0); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
411 m++; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
412 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
413 Log.d(TAG,"" + sum); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
414 return sumVector; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
415 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
416 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
417 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
418 * This will move the screen cursor based on the mouse event. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
419 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
420 * I do not think the checks here for the gui characters should be here but |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
421 * will leave them here for now until we work out the interaction. This |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
422 * should be up to the gui frontend in my opinion. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
423 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
424 * @param pos |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
425 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
426 public boolean moveCursor(int pos) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
427 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
428 if (!oia.isKeyBoardLocked()) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
429 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
430 if (pos < 0) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
431 return false; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
432 // because getRowColFromPoint returns offset of 1,1 we need to |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
433 // translate to offset 0,0 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
434 // pos -= (numCols + 1); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
435 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
436 int g = planes.getWhichGUI(pos); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
437 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
438 // lets check for hot spots |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
439 if (g >= BUTTON_LEFT && g <= BUTTON_LAST) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
440 StringBuffer aid = new StringBuffer(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
441 boolean aidFlag = true; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
442 switch (g) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
443 case BUTTON_RIGHT: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
444 case BUTTON_MIDDLE: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
445 while (planes.getWhichGUI(--pos) != BUTTON_LEFT) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
446 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
447 case BUTTON_LEFT: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
448 if (planes.getChar(pos) == 'F') { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
449 pos++; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
450 } else |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
451 aidFlag = false; |
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 if (planes.getChar(pos + 1) != '=' |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
454 && planes.getChar(pos + 1) != '.' |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
455 && planes.getChar(pos + 1) != '/') { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
456 Log.d(TAG," Hotspot clicked!!! we will send characters " |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
457 + planes.getChar(pos) + " " + planes.getChar(pos+1)); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
458 aid.append(planes.getChar(pos)); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
459 aid.append(planes.getChar(pos + 1)); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
460 } else { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
461 Log.d(TAG," Hotspot clicked!!! we will send character " |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
462 + planes.getChar(pos)); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
463 aid.append(planes.getChar(pos)); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
464 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
465 break; |
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 if (aidFlag) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
469 switch (g) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
470 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
471 case BUTTON_LEFT_UP: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
472 case BUTTON_MIDDLE_UP: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
473 case BUTTON_RIGHT_UP: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
474 case BUTTON_ONE_UP: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
475 case BUTTON_SB_UP: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
476 case BUTTON_SB_GUIDE: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
477 sessionVT.sendAidKey(AID_ROLL_UP); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
478 break; |
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 case BUTTON_LEFT_DN: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
481 case BUTTON_MIDDLE_DN: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
482 case BUTTON_RIGHT_DN: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
483 case BUTTON_ONE_DN: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
484 case BUTTON_SB_DN: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
485 case BUTTON_SB_THUMB: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
486 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
487 sessionVT.sendAidKey(AID_ROLL_DOWN); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
488 break; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
489 case BUTTON_LEFT_EB: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
490 case BUTTON_MIDDLE_EB: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
491 case BUTTON_RIGHT_EB: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
492 StringBuffer eb = new StringBuffer(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
493 while (planes.getWhichGUI(pos--) != BUTTON_LEFT_EB) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
494 ; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
495 while (planes.getWhichGUI(pos++) != BUTTON_RIGHT_EB) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
496 eb.append(planes.getChar(pos)); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
497 } |
10 | 498 sessionVT.showURL(eb.toString()); |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
499 // take out the log statement when we are sure it is |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
500 // working |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
501 Log.i(TAG,"Send to external Browser: " + eb.toString()); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
502 break; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
503 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
504 default: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
505 int aidKey = Integer.parseInt(aid.toString()); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
506 if (aidKey >= 1 && aidKey <= 12) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
507 sessionVT.sendAidKey(0x30 + aidKey); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
508 if (aidKey >= 13 && aidKey <= 24) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
509 sessionVT.sendAidKey(0xB0 + (aidKey - 12)); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
510 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
511 } else { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
512 if (screenFields.getCurrentField() != null) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
513 int xPos = screenFields.getCurrentField().startPos(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
514 for (int x = 0; x < aid.length(); x++) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
515 // System.out.println(sr + "," + (sc + x) + " " + |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
516 // aid.charAt(x)); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
517 planes.setChar(xPos + x , aid.charAt(x)); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
518 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
519 // System.out.println(aid); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
520 screenFields.setCurrentFieldMDT(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
521 sessionVT.sendAidKey(AID_ENTER); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
522 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
523 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
524 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
525 // return back to the calling routine that the cursor was not moved |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
526 // but something else here was done like aid keys or the such |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
527 return false; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
528 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
529 // this is a note to not execute this code here when we |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
530 // implement |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
531 // the remain after edit function option. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
532 // if (gui.rubberband.isAreaSelected()) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
533 // gui.rubberband.reset(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
534 // gui.repaint(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
535 // } else { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
536 goto_XY(pos); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
537 isInField(lastPos); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
538 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
539 // return back to the calling object that the cursor was indeed |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
540 // moved with in the screen object |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
541 return true; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
542 // } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
543 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
544 return false; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
545 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
546 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
547 public void setVT(tnvt v) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
548 sessionVT = v; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
549 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
550 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
551 public void setBuffer(vt320 buffer) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
552 this.buffer = buffer; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
553 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
554 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
555 /** |
107
afe6962769b9
use hash map rather than linear search thru arrays
Carl Byington <carl@five-ten-sg.com>
parents:
106
diff
changeset
|
556 * converts mnemonic string values into aid integers |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
557 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
558 * @see #sendKeys |
107
afe6962769b9
use hash map rather than linear search thru arrays
Carl Byington <carl@five-ten-sg.com>
parents:
106
diff
changeset
|
559 * @param mnem string mnemonic value |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
560 * @return key value of Mnemonic |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
561 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
562 private int getMnemonicValue(String mnem) { |
107
afe6962769b9
use hash map rather than linear search thru arrays
Carl Byington <carl@five-ten-sg.com>
parents:
106
diff
changeset
|
563 if (mnemonicMap.containsKey(mnem)) return mnemonicsMap.get(mnem); |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
564 return 0; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
565 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
566 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
567 protected void setPrehelpState(boolean setErrorCode, boolean lockKeyboard, |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
568 boolean unlockIfLocked) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
569 if (oia.isKeyBoardLocked() && unlockIfLocked) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
570 oia.setKeyBoardLocked(false); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
571 else |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
572 oia.setKeyBoardLocked(lockKeyboard); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
573 bufferedKeys = null; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
574 oia.setKeysBuffered(false); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
575 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
576 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
577 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
578 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
579 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
580 * Activate the cursor on screen |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
581 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
582 * @param activate |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
583 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
584 public void setCursorActive(boolean activate) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
585 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
586 // System.out.println("cursor active " + updateCursorLoc + " " + |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
587 // cursorActive + " " + activate); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
588 if (cursorActive && !activate) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
589 setCursorOff(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
590 cursorActive = activate; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
591 } else { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
592 if (!cursorActive && activate) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
593 cursorActive = activate; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
594 setCursorOn(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
595 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
596 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
597 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
598 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
599 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
600 * Set the cursor on |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
601 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
602 public void setCursorOn() { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
603 cursorShown = true; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
604 updateCursorLoc(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
605 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
606 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
607 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
608 * Set the cursor off |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
609 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
610 public void setCursorOff() { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
611 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
612 cursorShown = false; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
613 updateCursorLoc(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
614 // System.out.println("cursor off " + updateCursorLoc + " " + |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
615 // cursorActive); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
616 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
617 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
618 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
619 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
620 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
621 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
622 private void updateCursorLoc() { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
623 if (cursorActive) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
624 fireCursorChanged(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
625 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
626 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
627 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
628 //Added by Barry |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
629 public String getKeys() { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
630 String result = this.keybuf.toString(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
631 this.keybuf = new StringBuffer(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
632 return result; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
633 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
634 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
635 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
636 * 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
|
637 * 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
|
638 * 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
|
639 * 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
|
640 * [pf1] pf1 etc... |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
641 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
642 * 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
|
643 * 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
|
644 * enumeration: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
645 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
646 * <table BORDER COLS=2 WIDTH="50%" > |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
647 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
648 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
649 * <td>MNEMONIC_CLEAR</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
650 * <td>[clear]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
651 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
652 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
653 * <td>MNEMONIC_ENTER</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
654 * <td>[enter]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
655 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
656 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
657 * <td>MNEMONIC_HELP</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
658 * <td>[help]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
659 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
660 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
661 * <td>MNEMONIC_PAGE_DOWN</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
662 * <td>[pgdown]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
663 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
664 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
665 * <td>MNEMONIC_PAGE_UP</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
666 * <td>[pgup]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
667 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
668 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
669 * <td>MNEMONIC_PRINT</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
670 * <td>[print]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
671 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
672 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
673 * <td>MNEMONIC_PF1</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
674 * <td>[pf1]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
675 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
676 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
677 * <td>MNEMONIC_PF2</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
678 * <td>[pf2]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
679 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
680 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
681 * <td>MNEMONIC_PF3</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
682 * <td>[pf3]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
683 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
684 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
685 * <td>MNEMONIC_PF4</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
686 * <td>[pf4]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
687 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
688 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
689 * <td>MNEMONIC_PF5</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
690 * <td>[pf5]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
691 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
692 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
693 * <td>MNEMONIC_PF6</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
694 * <td>[pf6]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
695 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
696 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
697 * <td>MNEMONIC_PF7</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
698 * <td>[pf7]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
699 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
700 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
701 * <td>MNEMONIC_PF8</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
702 * <td>[pf8]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
703 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
704 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
705 * <td>MNEMONIC_PF9</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
706 * <td>[pf9]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
707 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
708 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
709 * <td>MNEMONIC_PF10</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
710 * <td>[pf10]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
711 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
712 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
713 * <td>MNEMONIC_PF11</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
714 * <td>[pf11]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
715 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
716 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
717 * <td>MNEMONIC_PF12</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
718 * <td>[pf12]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
719 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
720 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
721 * <td>MNEMONIC_PF13</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
722 * <td>[pf13]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
723 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
724 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
725 * <td>MNEMONIC_PF14</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
726 * <td>[pf14]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
727 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
728 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
729 * <td>MNEMONIC_PF15</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
730 * <td>[pf15]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
731 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
732 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
733 * <td>MNEMONIC_PF16</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
734 * <td>[pf16]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
735 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
736 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
737 * <td>MNEMONIC_PF17</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
738 * <td>[pf17]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
739 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
740 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
741 * <td>MNEMONIC_PF18</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
742 * <td>[pf18]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
743 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
744 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
745 * <td>MNEMONIC_PF19</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
746 * <td>[pf19]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
747 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
748 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
749 * <td>MNEMONIC_PF20</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
750 * <td>[pf20]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
751 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
752 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
753 * <td>MNEMONIC_PF21</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
754 * <td>[pf21]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
755 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
756 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
757 * <td>MNEMONIC_PF22</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
758 * <td>[pf22]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
759 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
760 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
761 * <td>MNEMONIC_PF23</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
762 * <td>[pf23]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
763 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
764 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
765 * <td>MNEMONIC_PF24</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
766 * <td>[pf24]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
767 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
768 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
769 * <td>MNEMONIC_BACK_SPACE</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
770 * <td>[backspace]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
771 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
772 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
773 * <td>MNEMONIC_BACK_TAB</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
774 * <td>[backtab]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
775 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
776 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
777 * <td>MNEMONIC_UP</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
778 * <td>[up]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
779 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
780 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
781 * <td>MNEMONIC_DOWN</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
782 * <td>[down]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
783 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
784 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
785 * <td>MNEMONIC_LEFT</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
786 * <td>[left]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
787 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
788 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
789 * <td>MNEMONIC_RIGHT</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
790 * <td>[right]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
791 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
792 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
793 * <td>MNEMONIC_DELETE</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
794 * <td>[delete]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
795 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
796 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
797 * <td>MNEMONIC_TAB</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
798 * <td>"[tab]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
799 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
800 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
801 * <td>MNEMONIC_END_OF_FIELD</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
802 * <td>[eof]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
803 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
804 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
805 * <td>MNEMONIC_ERASE_EOF</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
806 * <td>[eraseeof]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
807 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
808 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
809 * <td>MNEMONIC_ERASE_FIELD</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
810 * <td>[erasefld]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
811 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
812 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
813 * <td>MNEMONIC_INSERT</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
814 * <td>[insert]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
815 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
816 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
817 * <td>MNEMONIC_HOME</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
818 * <td>[home]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
819 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
820 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
821 * <td>MNEMONIC_KEYPAD0</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
822 * <td>[keypad0]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
823 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
824 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
825 * <td>MNEMONIC_KEYPAD1</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
826 * <td>[keypad1]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
827 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
828 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
829 * <td>MNEMONIC_KEYPAD2</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
830 * <td>[keypad2]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
831 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
832 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
833 * <td>MNEMONIC_KEYPAD3</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
834 * <td>[keypad3]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
835 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
836 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
837 * <td>MNEMONIC_KEYPAD4</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
838 * <td>[keypad4]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
839 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
840 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
841 * <td>MNEMONIC_KEYPAD5</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
842 * <td>[keypad5]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
843 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
844 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
845 * <td>MNEMONIC_KEYPAD6</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
846 * <td>[keypad6]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
847 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
848 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
849 * <td>MNEMONIC_KEYPAD7</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
850 * <td>[keypad7]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
851 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
852 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
853 * <td>MNEMONIC_KEYPAD8</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
854 * <td>[keypad8]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
855 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
856 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
857 * <td>MNEMONIC_KEYPAD9</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
858 * <td>[keypad9]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
859 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
860 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
861 * <td>MNEMONIC_KEYPAD_PERIOD</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
862 * <td>[keypad.]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
863 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
864 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
865 * <td>MNEMONIC_KEYPAD_COMMA</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
866 * <td>[keypad,]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
867 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
868 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
869 * <td>MNEMONIC_KEYPAD_MINUS</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
870 * <td>[keypad-]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
871 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
872 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
873 * <td>MNEMONIC_FIELD_EXIT</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
874 * <td>[fldext]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
875 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
876 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
877 * <td>MNEMONIC_FIELD_PLUS</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
878 * <td>[field+]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
879 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
880 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
881 * <td>MNEMONIC_FIELD_MINUS</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
882 * <td>[field-]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
883 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
884 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
885 * <td>MNEMONIC_BEGIN_OF_FIELD</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
886 * <td>[bof]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
887 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
888 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
889 * <td>MNEMONIC_PA1</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
890 * <td>[pa1]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
891 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
892 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
893 * <td>MNEMONIC_PA2</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
894 * <td>[pa2]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
895 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
896 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
897 * <td>MNEMONIC_PA3</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
898 * <td>[pa3]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
899 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
900 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
901 * <td>MNEMONIC_SYSREQ</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
902 * <td>[sysreq]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
903 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
904 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
905 * <td>MNEMONIC_RESET</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
906 * <td>[reset]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
907 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
908 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
909 * <td>MNEMONIC_ATTN</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
910 * <td>[attn]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
911 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
912 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
913 * <td>MNEMONIC_MARK_LEFT</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
914 * <td>[markleft]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
915 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
916 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
917 * <td>MNEMONIC_MARK_RIGHT</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
918 * <td>[markright]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
919 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
920 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
921 * <td>MNEMONIC_MARK_UP</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
922 * <td>[markup]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
923 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
924 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
925 * <td>MNEMONIC_MARK_DOWN</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
926 * <td>[markdown]</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
927 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
928 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
929 * </table> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
930 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
931 * @param text |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
932 * The string of characters to be sent |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
933 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
934 * @see #sendAid |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
935 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
936 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
937 public synchronized void sendKeys(String text) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
938 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
939 this.keybuf.append(text); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
940 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
941 if (isStatusErrorCode() && !resetRequired) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
942 setCursorActive(false); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
943 simulateMnemonic(getMnemonicValue("[reset]")); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
944 setCursorActive(true); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
945 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
946 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
947 if (oia.isKeyBoardLocked()) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
948 if (text.equals("[reset]") || text.equals("[sysreq]") |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
949 || text.equals("[attn]")) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
950 setCursorActive(false); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
951 simulateMnemonic(getMnemonicValue(text)); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
952 setCursorActive(true); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
953 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
954 } else { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
955 if (isStatusErrorCode()) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
956 sessionVT.signalBell(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
957 return; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
958 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
959 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
960 oia.setKeysBuffered(true); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
961 |
42
7ac846a07ed4
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
41
diff
changeset
|
962 if (bufferedKeys == null) bufferedKeys = text; |
7ac846a07ed4
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
41
diff
changeset
|
963 else bufferedKeys += text; |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
964 return; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
965 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
966 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
967 } else { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
968 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
969 if (oia.isKeysBuffered()) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
970 if (bufferedKeys != null) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
971 text = bufferedKeys + text; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
972 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
973 // if (text.length() == 0) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
974 oia.setKeysBuffered(false); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
975 // } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
976 bufferedKeys = null; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
977 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
978 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
979 // check to see if position is in a field and if it is then change |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
980 // current field to that field |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
981 isInField(lastPos, true); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
982 if (text.length() == 1 && !text.equals("[") && !text.equals("]")) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
983 // setCursorOff2(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
984 setCursorActive(false); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
985 simulateKeyStroke(text.charAt(0)); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
986 setCursorActive(true); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
987 // setCursorOn2(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
988 // System.out.println(" text one"); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
989 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
990 } else { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
991 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
992 strokenizer.setKeyStrokes(text); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
993 String s; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
994 boolean done = false; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
995 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
996 // setCursorOff2(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
997 setCursorActive(false); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
998 while (!done) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
999 // while (strokenizer.hasMoreKeyStrokes() && !keyboardLocked |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1000 // && |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1001 // !isStatusErrorCode() && !done) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1002 if (strokenizer.hasMoreKeyStrokes()) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1003 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1004 // check to see if position is in a field and if it is |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1005 // then change |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1006 // current field to that field |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1007 isInField(lastPos, true); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1008 s = strokenizer.nextKeyStroke(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1009 if (s.length() == 1) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1010 // setCursorOn(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1011 // if (!keysBuffered) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1012 // System.out.println(" s two" + s); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1013 // setCursorOn(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1014 // } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1015 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1016 // try { new Thread().sleep(400);} catch |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1017 // (InterruptedException ie) {} |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1018 simulateKeyStroke(s.charAt(0)); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1019 // System.out.println(" s two " + s + " " + |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1020 // cursorActive); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1021 // if (cursorActive && !keysBuffered) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1022 // System.out.println(" s two" + s); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1023 // setCursorOn(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1024 // } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1025 } else { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1026 simulateMnemonic(getMnemonicValue(s)); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1027 // if (!cursorActive && !keysBuffered) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1028 // System.out.println(" m one"); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1029 // setCursorOn(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1030 // } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1031 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1032 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1033 if (oia.isKeyBoardLocked()) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1034 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1035 bufferedKeys = strokenizer |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1036 .getUnprocessedKeyStroked(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1037 if (bufferedKeys != null) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1038 oia.setKeysBuffered(true); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1039 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1040 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1041 done = true; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1042 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1043 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1044 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1045 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1046 else { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1047 // setCursorActive(true); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1048 // setCursorOn(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1049 done = true; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1050 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1051 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1052 setCursorActive(true); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1053 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1054 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1055 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1056 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1057 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1058 * 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
|
1059 * 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
|
1060 * 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
|
1061 * contained in the AID_ enumeration: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1062 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1063 * @param aidKey |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1064 * The aid key to be sent to the host |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1065 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1066 * @see #sendKeys |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1067 * @see TN5250jConstants#AID_CLEAR |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1068 * @see #AID_ENTER |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1069 * @see #AID_HELP |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1070 * @see #AID_ROLL_UP |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1071 * @see #AID_ROLL_DOWN |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1072 * @see #AID_ROLL_LEFT |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1073 * @see #AID_ROLL_RIGHT |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1074 * @see #AID_PRINT |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1075 * @see #AID_PF1 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1076 * @see #AID_PF2 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1077 * @see #AID_PF3 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1078 * @see #AID_PF4 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1079 * @see #AID_PF5 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1080 * @see #AID_PF6 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1081 * @see #AID_PF7 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1082 * @see #AID_PF8 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1083 * @see #AID_PF9 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1084 * @see #AID_PF10 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1085 * @see #AID_PF11 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1086 * @see #AID_PF12 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1087 * @see #AID_PF13 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1088 * @see #AID_PF14 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1089 * @see #AID_PF15 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1090 * @see #AID_PF16 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1091 * @see #AID_PF17 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1092 * @see #AID_PF18 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1093 * @see #AID_PF19 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1094 * @see #AID_PF20 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1095 * @see #AID_PF21 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1096 * @see #AID_PF22 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1097 * @see #AID_PF23 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1098 * @see #AID_PF24 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1099 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1100 public void sendAid(int aidKey) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1101 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1102 sessionVT.sendAidKey(aidKey); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1103 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1104 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1105 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1106 * 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
|
1107 * |
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 protected void resetError() { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1110 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1111 restoreErrorLine(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1112 setStatus(STATUS_ERROR_CODE, STATUS_VALUE_OFF, ""); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1113 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1114 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1115 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1116 protected boolean simulateMnemonic(int mnem) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1117 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1118 boolean simulated = false; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1119 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1120 switch (mnem) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1121 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1122 case AID_CLEAR: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1123 case AID_ENTER: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1124 case AID_PF1: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1125 case AID_PF2: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1126 case AID_PF3: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1127 case AID_PF4: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1128 case AID_PF5: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1129 case AID_PF6: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1130 case AID_PF7: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1131 case AID_PF8: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1132 case AID_PF9: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1133 case AID_PF10: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1134 case AID_PF11: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1135 case AID_PF12: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1136 case AID_PF13: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1137 case AID_PF14: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1138 case AID_PF15: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1139 case AID_PF16: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1140 case AID_PF17: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1141 case AID_PF18: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1142 case AID_PF19: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1143 case AID_PF20: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1144 case AID_PF21: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1145 case AID_PF22: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1146 case AID_PF23: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1147 case AID_PF24: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1148 case AID_ROLL_DOWN: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1149 case AID_ROLL_UP: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1150 case AID_ROLL_LEFT: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1151 case AID_ROLL_RIGHT: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1152 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1153 if (!screenFields.isCanSendAid()) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1154 displayError(ERR_ENTER_NO_ALLOWED); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1155 } else |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1156 sendAid(mnem); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1157 simulated = true; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1158 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1159 break; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1160 case AID_HELP: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1161 sessionVT.sendHelpRequest(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1162 simulated = true; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1163 break; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1164 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1165 case AID_PRINT: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1166 sessionVT.hostPrint(1); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1167 simulated = true; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1168 break; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1169 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1170 case BACK_SPACE: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1171 if (screenFields.getCurrentField() != null |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1172 && screenFields.withinCurrentField(lastPos) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1173 && !screenFields.isCurrentFieldBypassField()) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1174 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1175 if (screenFields.getCurrentField().startPos() == lastPos) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1176 if (backspaceError) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1177 displayError(ERR_CURSOR_PROTECTED); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1178 else { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1179 gotoFieldPrev(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1180 goto_XY(screenFields.getCurrentField().endPos()); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1181 updateDirty(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1182 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1183 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1184 else { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1185 screenFields.getCurrentField().getKeyPos(lastPos); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1186 screenFields.getCurrentField().changePos(-1); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1187 resetDirty(screenFields.getCurrentField().getCurrentPos()); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1188 shiftLeft(screenFields.getCurrentField().getCurrentPos()); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1189 updateDirty(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1190 screenFields.setCurrentFieldMDT(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1191 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1192 simulated = true; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1193 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1194 } else { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1195 displayError(ERR_CURSOR_PROTECTED); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1196 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1197 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1198 break; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1199 case BACK_TAB: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1200 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1201 if (screenFields.getCurrentField() != null |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1202 && screenFields.isCurrentFieldHighlightedEntry()) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1203 resetDirty(screenFields.getCurrentField().startPos); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1204 gotoFieldPrev(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1205 updateDirty(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1206 } else |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1207 gotoFieldPrev(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1208 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1209 if (screenFields.isCurrentFieldContinued()) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1210 do { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1211 gotoFieldPrev(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1212 } while (screenFields.isCurrentFieldContinuedMiddle() |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1213 || screenFields.isCurrentFieldContinuedLast()); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1214 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1215 isInField(lastPos); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1216 simulated = true; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1217 break; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1218 case UP: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1219 case MARK_UP: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1220 process_XY(lastPos - numCols); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1221 simulated = true; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1222 break; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1223 case DOWN: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1224 case MARK_DOWN: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1225 process_XY(lastPos + numCols); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1226 simulated = true; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1227 break; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1228 case LEFT: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1229 case MARK_LEFT: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1230 process_XY(lastPos - 1); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1231 simulated = true; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1232 break; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1233 case RIGHT: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1234 case MARK_RIGHT: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1235 process_XY(lastPos + 1); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1236 simulated = true; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1237 break; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1238 case NEXTWORD: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1239 gotoNextWord(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1240 simulated = true; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1241 break; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1242 case PREVWORD: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1243 gotoPrevWord(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1244 simulated = true; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1245 break; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1246 case DELETE: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1247 if (screenFields.getCurrentField() != null |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1248 && screenFields.withinCurrentField(lastPos) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1249 && !screenFields.isCurrentFieldBypassField()) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1250 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1251 resetDirty(lastPos); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1252 screenFields.getCurrentField().getKeyPos(lastPos); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1253 shiftLeft(screenFields.getCurrentFieldPos()); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1254 screenFields.setCurrentFieldMDT(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1255 updateDirty(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1256 simulated = true; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1257 } else { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1258 displayError(ERR_CURSOR_PROTECTED); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1259 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1260 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1261 break; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1262 case TAB: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1263 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1264 if (screenFields.getCurrentField() != null |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1265 && !screenFields.isCurrentFieldContinued()) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1266 if (screenFields.isCurrentFieldHighlightedEntry()) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1267 resetDirty(screenFields.getCurrentField().startPos); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1268 gotoFieldNext(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1269 updateDirty(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1270 } else |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1271 gotoFieldNext(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1272 } else { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1273 do { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1274 gotoFieldNext(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1275 } while (screenFields.getCurrentField() != null |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1276 && (screenFields.isCurrentFieldContinuedMiddle() || screenFields |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1277 .isCurrentFieldContinuedLast())); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1278 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1279 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1280 isInField(lastPos); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1281 simulated = true; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1282 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1283 break; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1284 case EOF: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1285 if (screenFields.getCurrentField() != null |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1286 && screenFields.withinCurrentField(lastPos) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1287 && !screenFields.isCurrentFieldBypassField()) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1288 int where = endOfField(screenFields.getCurrentField() |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1289 .startPos(), true); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1290 if (where > 0) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1291 setCursor((where / numCols) + 1, (where % numCols) + 1); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1292 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1293 simulated = true; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1294 } else { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1295 displayError(ERR_CURSOR_PROTECTED); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1296 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1297 resetDirty(lastPos); |
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 break; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1300 case ERASE_EOF: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1301 if (screenFields.getCurrentField() != null |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1302 && screenFields.withinCurrentField(lastPos) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1303 && !screenFields.isCurrentFieldBypassField()) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1304 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1305 int where = lastPos; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1306 resetDirty(lastPos); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1307 if (fieldExit()) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1308 screenFields.setCurrentFieldMDT(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1309 if (!screenFields.isCurrentFieldContinued()) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1310 gotoFieldNext(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1311 } else { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1312 do { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1313 gotoFieldNext(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1314 if (screenFields.isCurrentFieldContinued()) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1315 fieldExit(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1316 } while (screenFields.isCurrentFieldContinuedMiddle() |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1317 || screenFields.isCurrentFieldContinuedLast()); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1318 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1319 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1320 updateDirty(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1321 goto_XY(where); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1322 simulated = true; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1323 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1324 } else { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1325 displayError(ERR_CURSOR_PROTECTED); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1326 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1327 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1328 break; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1329 case ERASE_FIELD: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1330 if (screenFields.getCurrentField() != null |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1331 && screenFields.withinCurrentField(lastPos) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1332 && !screenFields.isCurrentFieldBypassField()) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1333 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1334 int where = lastPos; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1335 lastPos = screenFields.getCurrentField().startPos(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1336 resetDirty(lastPos); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1337 if (fieldExit()) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1338 screenFields.setCurrentFieldMDT(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1339 if (!screenFields.isCurrentFieldContinued()) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1340 gotoFieldNext(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1341 } else { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1342 do { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1343 gotoFieldNext(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1344 if (screenFields.isCurrentFieldContinued()) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1345 fieldExit(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1346 } while (screenFields.isCurrentFieldContinuedMiddle() |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1347 || screenFields.isCurrentFieldContinuedLast()); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1348 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1349 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1350 updateDirty(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1351 goto_XY(where); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1352 simulated = true; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1353 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1354 } else { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1355 displayError(ERR_CURSOR_PROTECTED); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1356 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1357 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1358 break; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1359 case INSERT: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1360 // we toggle it |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1361 oia.setInsertMode(oia.isInsertMode() ? false : true); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1362 break; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1363 case HOME: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1364 // position to the home position set |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1365 if (lastPos + numCols + 1 != homePos) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1366 goto_XY(homePos - numCols - 1); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1367 // now check if we are in a field |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1368 isInField(lastPos); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1369 } else |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1370 gotoField(1); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1371 break; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1372 case KEYPAD_0: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1373 simulated = simulateKeyStroke('0'); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1374 break; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1375 case KEYPAD_1: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1376 simulated = simulateKeyStroke('1'); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1377 break; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1378 case KEYPAD_2: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1379 simulated = simulateKeyStroke('2'); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1380 break; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1381 case KEYPAD_3: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1382 simulated = simulateKeyStroke('3'); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1383 break; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1384 case KEYPAD_4: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1385 simulated = simulateKeyStroke('4'); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1386 break; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1387 case KEYPAD_5: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1388 simulated = simulateKeyStroke('5'); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1389 break; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1390 case KEYPAD_6: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1391 simulated = simulateKeyStroke('6'); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1392 break; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1393 case KEYPAD_7: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1394 simulated = simulateKeyStroke('7'); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1395 break; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1396 case KEYPAD_8: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1397 simulated = simulateKeyStroke('8'); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1398 break; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1399 case KEYPAD_9: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1400 simulated = simulateKeyStroke('9'); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1401 break; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1402 case KEYPAD_PERIOD: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1403 simulated = simulateKeyStroke('.'); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1404 break; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1405 case KEYPAD_COMMA: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1406 simulated = simulateKeyStroke(','); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1407 break; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1408 case KEYPAD_MINUS: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1409 if (screenFields.getCurrentField() != null |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1410 && screenFields.withinCurrentField(lastPos) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1411 && !screenFields.isCurrentFieldBypassField()) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1412 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1413 int s = screenFields.getCurrentField().getFieldShift(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1414 if (s == 3 || s == 5 || s == 7) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1415 planes.setChar(lastPos,'-'); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1416 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1417 resetDirty(lastPos); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1418 advancePos(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1419 if (fieldExit()) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1420 screenFields.setCurrentFieldMDT(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1421 if (!screenFields.isCurrentFieldContinued()) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1422 gotoFieldNext(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1423 } else { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1424 do { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1425 gotoFieldNext(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1426 } while (screenFields |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1427 .isCurrentFieldContinuedMiddle() |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1428 || screenFields |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1429 .isCurrentFieldContinuedLast()); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1430 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1431 simulated = true; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1432 updateDirty(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1433 if (screenFields.isCurrentFieldAutoEnter()) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1434 sendAid(AID_ENTER); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1435 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1436 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1437 } else { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1438 displayError(ERR_FIELD_MINUS); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1439 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1440 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1441 } else { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1442 displayError(ERR_CURSOR_PROTECTED); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1443 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1444 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1445 break; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1446 case FIELD_EXIT: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1447 if (screenFields.getCurrentField() != null |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1448 && screenFields.withinCurrentField(lastPos) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1449 && !screenFields.isCurrentFieldBypassField()) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1450 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1451 resetDirty(lastPos); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1452 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1453 boolean autoFE = screenFields.isCurrentFieldAutoEnter(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1454 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1455 if (fieldExit()) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1456 screenFields.setCurrentFieldMDT(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1457 if (!screenFields.isCurrentFieldContinued() && |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1458 !screenFields.isCurrentFieldAutoEnter()) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1459 gotoFieldNext(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1460 } else { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1461 do { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1462 gotoFieldNext(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1463 if (screenFields.isCurrentFieldContinued()) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1464 fieldExit(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1465 } while (screenFields.isCurrentFieldContinuedMiddle() |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1466 || screenFields.isCurrentFieldContinuedLast()); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1467 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1468 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1469 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1470 updateDirty(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1471 simulated = true; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1472 if (autoFE) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1473 sendAid(AID_ENTER); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1474 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1475 } else { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1476 displayError(ERR_CURSOR_PROTECTED); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1477 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1478 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1479 break; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1480 case FIELD_PLUS: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1481 if (screenFields.getCurrentField() != null |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1482 && screenFields.withinCurrentField(lastPos) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1483 && !screenFields.isCurrentFieldBypassField()) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1484 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1485 resetDirty(lastPos); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1486 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1487 boolean autoFE = screenFields.isCurrentFieldAutoEnter(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1488 if (fieldExit()) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1489 screenFields.setCurrentFieldMDT(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1490 if (!screenFields.isCurrentFieldContinued() && |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1491 !screenFields.isCurrentFieldAutoEnter()) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1492 gotoFieldNext(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1493 } else { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1494 do { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1495 gotoFieldNext(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1496 } while (screenFields.isCurrentFieldContinuedMiddle() |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1497 || screenFields.isCurrentFieldContinuedLast()); |
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 updateDirty(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1501 simulated = true; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1502 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1503 if (autoFE) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1504 sendAid(AID_ENTER); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1505 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1506 } else { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1507 displayError(ERR_CURSOR_PROTECTED); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1508 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1509 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1510 break; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1511 case FIELD_MINUS: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1512 if (screenFields.getCurrentField() != null |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1513 && screenFields.withinCurrentField(lastPos) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1514 && !screenFields.isCurrentFieldBypassField()) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1515 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1516 int s = screenFields.getCurrentField().getFieldShift(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1517 if (s == 3 || s == 5 || s == 7) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1518 planes.setChar(lastPos, '-'); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1519 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1520 resetDirty(lastPos); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1521 advancePos(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1522 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1523 boolean autoFE = screenFields.isCurrentFieldAutoEnter(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1524 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1525 if (fieldExit()) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1526 screenFields.setCurrentFieldMDT(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1527 if (!screenFields.isCurrentFieldContinued() |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1528 && !screenFields.isCurrentFieldAutoEnter()) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1529 gotoFieldNext(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1530 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1531 else { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1532 do { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1533 gotoFieldNext(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1534 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1535 while (screenFields.isCurrentFieldContinuedMiddle() |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1536 || screenFields.isCurrentFieldContinuedLast()); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1537 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1538 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1539 updateDirty(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1540 simulated = true; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1541 if (autoFE) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1542 sendAid(AID_ENTER); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1543 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1544 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1545 else { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1546 displayError(ERR_FIELD_MINUS); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1547 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1548 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1549 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1550 else { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1551 displayError(ERR_CURSOR_PROTECTED); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1552 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1553 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1554 break; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1555 case BOF: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1556 if (screenFields.getCurrentField() != null |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1557 && screenFields.withinCurrentField(lastPos) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1558 && !screenFields.isCurrentFieldBypassField()) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1559 int where = screenFields.getCurrentField().startPos(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1560 if (where > 0) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1561 goto_XY(where); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1562 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1563 simulated = true; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1564 } else { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1565 displayError(ERR_CURSOR_PROTECTED); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1566 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1567 resetDirty(lastPos); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1568 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1569 break; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1570 case SYSREQ: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1571 sessionVT.systemRequest(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1572 simulated = true; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1573 break; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1574 case RESET: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1575 if (isStatusErrorCode()) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1576 resetError(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1577 isInField(lastPos); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1578 updateDirty(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1579 } else { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1580 setPrehelpState(false, oia.isKeyBoardLocked(), false); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1581 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1582 simulated = true; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1583 break; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1584 case ATTN: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1585 sessionVT.sendAttentionKey(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1586 simulated = true; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1587 break; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1588 case DUP_FIELD: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1589 if (screenFields.getCurrentField() != null |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1590 && screenFields.withinCurrentField(lastPos) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1591 && !screenFields.isCurrentFieldBypassField()) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1592 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1593 if (screenFields.isCurrentFieldDupEnabled()) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1594 resetDirty(lastPos); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1595 screenFields.getCurrentField().setFieldChar(lastPos, |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1596 (char) 0x1C); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1597 screenFields.setCurrentFieldMDT(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1598 gotoFieldNext(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1599 updateDirty(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1600 simulated = true; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1601 } else { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1602 displayError(ERR_DUP_KEY_NOT_ALLOWED); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1603 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1604 } else { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1605 displayError(ERR_CURSOR_PROTECTED); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1606 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1607 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1608 break; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1609 case NEW_LINE: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1610 if (screenFields.getSize() > 0) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1611 int startRow = getRow(lastPos) + 1; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1612 int startPos = lastPos; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1613 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1614 if (startRow == getRows()) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1615 startRow = 0; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1616 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1617 setCursor(++startRow, 1); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1618 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1619 if (!isInField() && screenFields.getCurrentField() != null |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1620 && !screenFields.isCurrentFieldBypassField()) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1621 while (!isInField() |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1622 && screenFields.getCurrentField() != null |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1623 && !screenFields.isCurrentFieldBypassField()) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1624 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1625 // lets keep going |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1626 advancePos(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1627 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1628 // Have we looped the screen? |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1629 if (lastPos == startPos) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1630 // if so then go back to starting point |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1631 goto_XY(startPos); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1632 break; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1633 } |
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 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1637 simulated = true; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1638 break; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1639 case FAST_CURSOR_DOWN: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1640 int rowNow = (getCurrentRow()-1) + 3; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1641 if (rowNow > getRows()-1) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1642 rowNow = rowNow - getRows(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1643 this.goto_XY(getPos(rowNow,getCurrentCol()-1)); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1644 simulated = true; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1645 break; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1646 case FAST_CURSOR_UP: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1647 rowNow = (getCurrentRow()-1) - 3; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1648 if (rowNow < 0) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1649 rowNow = (getRows()) + rowNow; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1650 this.goto_XY(getPos(rowNow,getCurrentCol()-1)); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1651 simulated = true; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1652 break; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1653 case FAST_CURSOR_LEFT: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1654 int colNow = (getCurrentCol()-1) - 3; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1655 rowNow = getCurrentRow()-1; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1656 if (colNow <= 0) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1657 colNow = getColumns() + colNow; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1658 rowNow--; |
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 (rowNow < 0) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1661 rowNow = getRows() - 1; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1662 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1663 process_XY(getPos(rowNow,colNow)); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1664 simulated = true; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1665 break; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1666 case FAST_CURSOR_RIGHT: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1667 colNow = (getCurrentCol()-1) + 3; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1668 rowNow = getCurrentRow()-1; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1669 if (colNow >= getColumns()) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1670 colNow = colNow - getColumns(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1671 rowNow++; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1672 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1673 if (rowNow > getRows() - 1) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1674 rowNow = getRows() - rowNow; |
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 process_XY(getPos(rowNow,colNow)); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1677 simulated = true; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1678 break; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1679 default: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1680 Log.i(TAG," Mnemonic not supported " + mnem); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1681 break; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1682 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1683 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1684 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1685 return simulated; |
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 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1688 protected boolean simulateKeyStroke(char c) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1689 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1690 if (isStatusErrorCode() && !Character.isISOControl(c) && !keyProcessed) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1691 if (resetRequired) return false; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1692 resetError(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1693 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1694 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1695 boolean updateField = false; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1696 boolean numericError = false; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1697 boolean updatePos = false; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1698 boolean autoEnter = false; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1699 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1700 if (!Character.isISOControl(c)) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1701 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1702 if (screenFields.getCurrentField() != null |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1703 && screenFields.withinCurrentField(lastPos) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1704 && !screenFields.isCurrentFieldBypassField()) { |
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 if (screenFields.isCurrentFieldFER() |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1707 && !screenFields.withinCurrentField(screenFields |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1708 .getCurrentFieldPos()) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1709 && lastPos == screenFields.getCurrentField().endPos() |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1710 && screenFields.getCurrentFieldPos() > screenFields |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1711 .getCurrentField().endPos()) { |
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 displayError(ERR_FIELD_EXIT_INVALID); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1714 feError = true; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1715 return false; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1716 } |
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 switch (screenFields.getCurrentFieldShift()) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1719 case 0: // Alpha shift |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1720 case 2: // Numeric Shift |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1721 case 4: // Kakana Shift |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1722 updateField = true; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1723 break; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1724 case 1: // Alpha Only |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1725 if (Character.isLetter(c) || c == ',' || c == '-' |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1726 || c == '.' || c == ' ') |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1727 updateField = true; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1728 break; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1729 case 3: // Numeric only |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1730 if (Character.isDigit(c) || c == '+' || c == ',' |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1731 || c == '-' || c == '.' || c == ' ') |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1732 updateField = true; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1733 else |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1734 numericError = true; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1735 break; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1736 case 5: // Digits only |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1737 if (Character.isDigit(c)) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1738 updateField = true; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1739 else |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1740 displayError(ERR_NUMERIC_09); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1741 break; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1742 case 7: // Signed numeric |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1743 if (Character.isDigit(c) || c == '+' || c == '-') |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1744 if (lastPos == screenFields.getCurrentField().endPos() |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1745 && (c != '+' && c != '-')) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1746 displayError(ERR_INVALID_SIGN); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1747 else |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1748 updateField = true; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1749 else |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1750 displayError(ERR_NUMERIC_09); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1751 break; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1752 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1753 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1754 if (updateField) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1755 if (screenFields.isCurrentFieldToUpper()) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1756 c = Character.toUpperCase(c); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1757 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1758 updatePos = true; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1759 resetDirty(lastPos); |
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 if (oia.isInsertMode()) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1762 if (endOfField(false) != screenFields.getCurrentField() |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1763 .endPos()) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1764 shiftRight(lastPos); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1765 else { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1766 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1767 displayError(ERR_NO_ROOM_INSERT); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1768 updatePos = false; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1769 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1770 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1771 } |
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 if (updatePos) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1774 screenFields.getCurrentField().getKeyPos( |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1775 getRow(lastPos), getCol(lastPos)); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1776 screenFields.getCurrentField().changePos(1); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1777 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1778 planes.setChar(lastPos,c); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1779 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1780 screenFields.setCurrentFieldMDT(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1781 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1782 // 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
|
1783 // the next field |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1784 if (!screenFields.withinCurrentField(screenFields |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1785 .getCurrentFieldPos())) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1786 if (screenFields.isCurrentFieldAutoEnter()) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1787 autoEnter = true; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1788 } else if (!screenFields.isCurrentFieldFER()) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1789 gotoFieldNext(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1790 else { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1791 // screenFields.getCurrentField().changePos(1); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1792 // |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1793 // if (screenFields. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1794 // cursorPos == endPos) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1795 // System.out.println("end of field"); |
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 // feError != feError; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1798 // if (feError) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1799 // displayError(ERR_FIELD_EXIT_INVALID); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1800 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1801 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1802 } else |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1803 setCursor(screenFields.getCurrentField() |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1804 .getCursorRow() + 1, screenFields |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1805 .getCurrentField().getCursorCol() + 1); |
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 fireScreenChanged(); |
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 (autoEnter) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1812 sendAid(AID_ENTER); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1813 } else { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1814 if (numericError) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1815 displayError(ERR_NUMERIC_ONLY); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1816 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1817 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1818 } else { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1819 displayError(ERR_CURSOR_PROTECTED); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1820 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1821 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1822 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1823 return updatePos; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1824 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1825 |
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 * Method: endOfField |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1828 * <p> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1829 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1830 * 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
|
1831 * the posSpace to that method |
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 * @param posSpace |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1834 * 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
|
1835 * the the last space or not |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1836 * @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
|
1837 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1838 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1839 private int endOfField(boolean posSpace) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1840 return endOfField(lastPos, posSpace); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1841 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1842 |
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 * Method: endOfField |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1845 * <p> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1846 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1847 * 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
|
1848 * 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
|
1849 * 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
|
1850 * char <= ' ' posSpace == false last occurrence of char > ' ' |
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 * @param pos |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1853 * value of type int - position to start from |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1854 * @param posSpace |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1855 * 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
|
1856 * the the last space or not |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1857 * @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
|
1858 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1859 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1860 private int endOfField(int pos, boolean posSpace) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1861 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1862 int endPos = screenFields.getCurrentField().endPos(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1863 int fePos = endPos; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1864 // get the number of characters to the right |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1865 int count = endPos - pos; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1866 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1867 // 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
|
1868 while (planes.getChar(endPos) <= ' ' && count-- > 0) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1869 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1870 endPos--; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1871 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1872 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1873 if (endPos == fePos) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1874 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1875 return endPos; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1876 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1877 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1878 screenFields.getCurrentField().getKeyPos(endPos); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1879 if (posSpace) screenFields.getCurrentField().changePos(+1); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1880 return screenFields.getCurrentFieldPos(); |
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 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1884 private boolean fieldExit() { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1885 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1886 int pos = lastPos; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1887 boolean mdt = false; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1888 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
|
1889 // non blank character in field |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1890 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1891 ScreenField sf = screenFields.getCurrentField(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1892 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1893 if (sf.isMandatoryEnter() && end == sf.startPos()) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1894 displayError(ERR_MANDITORY_ENTER); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1895 return false; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1896 } |
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 // 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
|
1899 // 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
|
1900 // 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
|
1901 // 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
|
1902 // of the field. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1903 int currentPos = sf.getCurrentPos(); |
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 // get the number of characters to the right |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1906 int count = (end - sf.startPos()) - sf.getKeyPos(pos); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1907 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1908 if (count == 0 && sf.isFER()) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1909 if (currentPos > sf.endPos()) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1910 mdt = true; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1911 return mdt; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1912 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1913 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1914 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1915 for (; count >= 0; count--) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1916 planes.setChar(pos, initChar); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1917 setDirty(pos); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1918 pos++; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1919 mdt = true; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1920 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1921 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1922 // 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
|
1923 // 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
|
1924 // 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
|
1925 // place the count as -1. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1926 if (count == -1) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1927 int s = sf.getFieldShift(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1928 if (s == 3 || s == 5 || s == 7) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1929 mdt = true; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1930 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1931 } |
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 int adj = sf.getAdjustment(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1934 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1935 if (adj != 0) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1936 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1937 switch (adj) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1938 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1939 case 5: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1940 rightAdjustField('0'); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1941 sf.setRightAdjusted(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1942 break; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1943 case 6: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1944 rightAdjustField(' '); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1945 sf.setRightAdjusted(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1946 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1947 break; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1948 case 7: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1949 sf.setManditoryEntered(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1950 break; |
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 } |
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 else { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1955 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1956 // 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
|
1957 if (sf.isSignedNumeric()) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1958 rightAdjustField(' '); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1959 } |
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 return mdt; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1963 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1964 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1965 private void rightAdjustField(char fill) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1966 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1967 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
|
1968 // non blank character in field |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1969 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1970 // get the number of characters to the right |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1971 int count = screenFields.getCurrentField().endPos() - end; |
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 // 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
|
1974 if (screenFields.getCurrentField().isSignedNumeric()) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1975 if (planes.getChar(end -1) != '-') |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1976 count--; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1977 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1978 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1979 int pos = screenFields.getCurrentField().startPos(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1980 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1981 while (count-- >= 0) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1982 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1983 shiftRight(pos); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1984 planes.setChar(pos,fill); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1985 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1986 setDirty(pos); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1987 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1988 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1989 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1990 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1991 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1992 private void shiftLeft(int sPos) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1993 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1994 int endPos = 0; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1995 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1996 int pos = sPos; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1997 int pPos = sPos; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1998 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
1999 ScreenField sf = screenFields.getCurrentField(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2000 int end; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2001 int count; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2002 do { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2003 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
|
2004 // first |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2005 // non blank character in field |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2006 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2007 count = (end - screenFields.getCurrentField().startPos()) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2008 - screenFields.getCurrentField().getKeyPos(pPos); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2009 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2010 // 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
|
2011 // left |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2012 while (count-- > 0) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2013 pos++; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2014 planes.setChar(pPos,planes.getChar(pos)); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2015 setDirty(pPos); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2016 pPos = pos; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2017 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2018 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2019 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2020 if (screenFields.isCurrentFieldContinued()) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2021 gotoFieldNext(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2022 if (screenFields.getCurrentField().isContinuedFirst()) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2023 break; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2024 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2025 pos = screenFields.getCurrentField().startPos(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2026 planes.setChar(pPos,planes.getChar(pos)); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2027 setDirty(pPos); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2028 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2029 pPos = pos; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2030 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2031 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2032 } while (screenFields.isCurrentFieldContinued() |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2033 && !screenFields.getCurrentField().isContinuedFirst()); |
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 if (end >= 0 && count >= -1) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2036 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2037 endPos = end; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2038 } else { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2039 endPos = sPos; |
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 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2043 screenFields.setCurrentField(sf); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2044 planes.setChar(endPos,initChar); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2045 setDirty(endPos); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2046 goto_XY(screenFields.getCurrentFieldPos()); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2047 sf = null; |
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 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2050 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2051 private void shiftRight(int sPos) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2052 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2053 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
|
2054 // non blank character in field |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2055 int pos = end; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2056 int pPos = end; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2057 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2058 int count = end - sPos; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2059 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2060 // 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
|
2061 while (count-- > 0) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2062 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2063 pos--; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2064 planes.setChar(pPos, planes.getChar(pos)); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2065 setDirty(pPos); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2066 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2067 pPos = pos; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2068 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2069 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2070 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2071 public int getRow(int pos) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2072 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2073 // if (pos == 0) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2074 // return 1; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2075 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2076 int row = pos / numCols; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2077 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2078 if (row < 0) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2079 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2080 row = lastPos / numCols; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2081 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2082 if (row > (lenScreen / numCols) - 1) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2083 row = (lenScreen / numCols) - 1; |
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 return row; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2086 |
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 public int getCol(int pos) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2090 int col = pos % (getColumns()); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2091 if (col > 0) return col; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2092 return 0; |
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 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2096 * 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
|
2097 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2098 * @param row |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2099 * @param col |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2100 * @return |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2101 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2102 public int getPos(int row, int col) { |
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 return (row * numCols) + col; |
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 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2107 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2108 * 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
|
2109 * position of the screen |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2110 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2111 * @return int |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2112 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2113 public int getCurrentPos() { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2114 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2115 // return lastPos + numCols + 1; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2116 return lastPos + 1; |
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 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2121 * 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
|
2122 * 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
|
2123 * 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
|
2124 * note that I did not look that hard either. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2125 * <p> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2126 * 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
|
2127 * </p> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2128 * <p> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2129 * 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
|
2130 * </p> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2131 * <p> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2132 * 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
|
2133 * </p> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2134 * <p> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2135 * 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
|
2136 * </p> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2137 * <p> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2138 * 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
|
2139 * found the following <table BORDER COLS=2 WIDTH="50%" > |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2140 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2141 * <td>ERR_CURSOR_PROTECTED</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2142 * <td>0x05</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2143 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2144 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2145 * <td>ERR_INVALID_SIGN</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2146 * <td>0x11</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2147 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2148 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2149 * <td>ERR_NO_ROOM_INSERT</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2150 * <td>0x12</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2151 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2152 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2153 * <td>ERR_NUMERIC_ONLY</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2154 * <td>0x09</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2155 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2156 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2157 * <td>ERR_NUMERIC_09</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2158 * <td>0x10</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2159 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2160 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2161 * <td>ERR_FIELD_MINUS</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2162 * <td>0x16</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2163 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2164 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2165 * <td>ERR_ENTER_NOT_ALLOWED</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2166 * <td>0x20</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2167 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2168 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2169 * <td>ERR_MANDITORY_ENTER</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2170 * <td>0x21</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2171 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2172 * <tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2173 * <td>ERR_ENTER_NOT_ALLOWED</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2174 * <td>0x20</td> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2175 * </tr> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2176 * </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
|
2177 * them in the first place was the pain. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2178 * </p> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2179 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2180 * @param ec error code |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2181 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2182 private void displayError(int ec) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2183 saveHomePos = homePos; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2184 homePos = lastPos + numCols + 1; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2185 pendingInsert = true; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2186 sessionVT.sendNegResponse2(ec); |
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 } |
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 private void process_XY(int pos) { |
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 if (pos < 0) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2193 pos = lenScreen + pos; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2194 if (pos > lenScreen - 1) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2195 pos = pos - lenScreen; |
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 // 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
|
2198 // 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
|
2199 // 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
|
2200 // 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
|
2201 // 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
|
2202 // 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
|
2203 // |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2204 // 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
|
2205 // 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
|
2206 // 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
|
2207 // 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
|
2208 // last character. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2209 // |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2210 // 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
|
2211 // 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
|
2212 // 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
|
2213 // 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
|
2214 // 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
|
2215 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2216 ScreenField sf = screenFields.getCurrentField(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2217 if (feError) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2218 feError = false; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2219 sf.changePos(-1); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2220 } else { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2221 if (sf != null&& sf.isFER()){ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2222 if ((sf.getCurrentPos() |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2223 > sf.endPos())) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2224 if (sf.withinField(pos)) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2225 sf.getKeyPos(pos); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2226 return; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2227 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2228 sf.getKeyPos(sf.endPos()); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2229 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2230 } |
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 goto_XY(pos); |
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 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2236 public boolean isUsingGuiInterface() { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2237 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2238 return guiInterface; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2239 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2240 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2241 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2242 * 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
|
2243 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2244 * @return true or false |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2245 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2246 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2247 protected boolean isInField() { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2248 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2249 return isInField(lastPos, true); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2250 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2251 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2252 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2253 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2254 * 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
|
2255 * 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
|
2256 * field to this field where the position indicates |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2257 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2258 * @param pos |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2259 * @param chgToField |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2260 * @return true or false |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2261 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2262 public boolean isInField(int pos, boolean chgToField) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2263 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2264 return screenFields.isInField(pos, chgToField); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2265 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2266 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2267 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2268 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2269 * 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
|
2270 * 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
|
2271 * working field |
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 * @param pos |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2274 * @return true or false |
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 public boolean isInField(int pos) { |
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 return screenFields.isInField(pos, true); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2279 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2280 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2281 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2282 * 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
|
2283 * 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
|
2284 * becomes the current working field. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2285 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2286 * @param row |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2287 * @param col |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2288 * @return true or false |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2289 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2290 public boolean isInField(int row, int col) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2291 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2292 return isInField(row, col, true); |
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 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2295 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2296 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2297 * 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
|
2298 * 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
|
2299 * 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
|
2300 * indicates. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2301 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2302 * @param row |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2303 * @param col |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2304 * @param chgToField |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2305 * @return true or false |
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 public boolean isInField(int row, int col, boolean chgToField) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2308 return screenFields.isInField((row * numCols) + col, chgToField); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2309 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2310 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2311 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2312 * 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
|
2313 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2314 * @return int value of screen length |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2315 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2316 public int getScreenLength() { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2317 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2318 return lenScreen; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2319 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2320 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2321 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2322 * Get the number or rows available. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2323 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2324 * @return number of rows |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2325 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2326 public int getRows() { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2327 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2328 return numRows; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2329 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2330 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2331 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2332 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2333 * Get the number of columns available. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2334 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2335 * @return number of columns |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2336 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2337 public int getColumns() { |
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 return numCols; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2340 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2341 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2342 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2343 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2344 * Get the current row where the cursor is |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2345 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2346 * @return the cursor current row position 1,1 based |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2347 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2348 public int getCurrentRow() { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2349 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2350 return (lastPos / numCols) + 1; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2351 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2352 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2353 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2354 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2355 * Get the current column where the cursor is |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2356 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2357 * @return the cursor current column position 1,1 based |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2358 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2359 public int getCurrentCol() { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2360 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2361 return (lastPos % numCols) + 1; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2362 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2363 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2364 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2365 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2366 * 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
|
2367 * 0,0 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2368 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2369 * @return last position |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2370 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2371 protected int getLastPos() { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2372 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2373 return lastPos; |
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 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2377 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2378 * Hotspot More... string |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2379 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2380 * @return string literal of More... |
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 public StringBuffer getHSMore() { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2383 return hsMore; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2384 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2385 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2386 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2387 * Hotspot Bottom string |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2388 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2389 * @return string literal of Bottom |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2390 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2391 public StringBuffer getHSBottom() { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2392 return hsBottom; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2393 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2394 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2395 /** |
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 * Return the screen represented as a character array |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2398 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2399 * @return character array containing the text |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2400 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2401 public char[] getScreenAsChars() { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2402 char[] sac = new char[lenScreen]; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2403 char c; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2404 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2405 for (int x = 0; x < lenScreen; x++) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2406 c = planes.getChar(x); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2407 // only draw printable characters (in this case >= ' ') |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2408 if ((c >= ' ') && (!planes.isAttributePlace(x))) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2409 sac[x] = c; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2410 // TODO: implement the underline check here |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2411 // if (screen[x].underLine && c <= ' ') |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2412 // sac[x] = '_'; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2413 } else |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2414 sac[x] = ' '; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2415 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2416 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2417 return sac; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2418 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2419 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2420 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
|
2421 try { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2422 int from = getPos(startRow,startCol); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2423 int to = getPos(endRow,endCol); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2424 if (from > to) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2425 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2426 int f = from; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2427 to = f; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2428 from = f; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2429 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2430 return planes.getPlaneData(from,to,plane); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2431 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2432 catch (Exception oe) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2433 return null; |
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 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2436 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2437 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2438 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2439 * <p> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2440 * GetScreen retrieves the various planes associated with the presentation |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2441 * 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
|
2442 * 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
|
2443 * 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
|
2444 * character is appended. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2445 * </p> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2446 * <p> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2447 * 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
|
2448 * 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
|
2449 * 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
|
2450 * 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
|
2451 * extra position for the terminating null character. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2452 * <p> |
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 * @param buffer |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2455 * @param bufferLength |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2456 * @param plane |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2457 * @return The number of characters copied to the buffer |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2458 * @throws OhioException |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2459 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2460 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
|
2461 // throws OhioException { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2462 { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2463 return GetScreen(buffer,bufferLength,0,lenScreen,plane); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2464 |
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 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2468 * <p> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2469 * GetScreen retrieves the various planes associated with the presentation |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2470 * 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
|
2471 * 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
|
2472 * 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
|
2473 * character is appended. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2474 * </p> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2475 * <p> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2476 * 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
|
2477 * 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
|
2478 * 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
|
2479 * 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
|
2480 * 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
|
2481 * </p> |
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 * @param buffer |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2484 * @param bufferLength |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2485 * @param from |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2486 * @param length |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2487 * @param plane |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2488 * @return The number of characters copied to the buffer |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2489 * @throws OhioException |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2490 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2491 public synchronized int GetScreen(char buffer[], int bufferLength, int from, |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2492 int length, int plane) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2493 // throws OhioException { |
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 return planes.GetScreen(buffer,bufferLength, from, length, plane); |
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 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2499 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2500 * <p> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2501 * GetScreen retrieves the various planes associated with the presentation |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2502 * 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
|
2503 * 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
|
2504 * 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
|
2505 * character is appended. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2506 * </p> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2507 * <p> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2508 * 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
|
2509 * 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
|
2510 * 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
|
2511 * 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
|
2512 * 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
|
2513 * character. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2514 * </p> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2515 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2516 * @param buffer |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2517 * @param bufferLength |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2518 * @param row |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2519 * @param col |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2520 * @param length |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2521 * @param plane |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2522 * @return The number of characters copied to the buffer. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2523 * @throws OhioException |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2524 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2525 public synchronized int GetScreen(char buffer[], int bufferLength, int row, |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2526 int col, int length, int plane) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2527 // throws OhioException { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2528 { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2529 // Call GetScreen function after converting row and column to |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2530 // a position. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2531 return planes.GetScreen(buffer,bufferLength, row, col, length, plane); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2532 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2533 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2534 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2535 * <p> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2536 * 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
|
2537 * 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
|
2538 * values in the buffer provided. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2539 * </p> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2540 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2541 * <p> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2542 * 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
|
2543 * 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
|
2544 * 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
|
2545 * 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
|
2546 * 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
|
2547 * right-most column. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2548 * </p> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2549 * <p> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2550 * 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
|
2551 * 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
|
2552 * 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
|
2553 * the number of characters copied. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2554 * </p> |
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 buffer |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2557 * @param bufferLength |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2558 * @param startPos |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2559 * @param endPos |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2560 * @param plane |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2561 * @return The number of characters copied to the buffer |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2562 * @throws OhioException |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2563 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2564 public synchronized int GetScreenRect(char buffer[], int bufferLength, |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2565 int startPos, int endPos, int plane) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2566 // throws OhioException { |
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 return planes.GetScreenRect(buffer, bufferLength, startPos, endPos, plane); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2569 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2570 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2571 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2572 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2573 * <p> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2574 * 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
|
2575 * 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
|
2576 * 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
|
2577 * character. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2578 * </p> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2579 * <p> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2580 * The application supplies two coordinates that represent opposing corners |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2581 * 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
|
2582 * 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
|
2583 * 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
|
2584 * 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
|
2585 * right-most column. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2586 * </p> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2587 * <p> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2588 * 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
|
2589 * 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
|
2590 * 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
|
2591 * the number of characters copied. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2592 * </p> |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2593 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2594 * @param buffer |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2595 * @param bufferLength |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2596 * @param startRow |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2597 * @param startCol |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2598 * @param endRow |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2599 * @param endCol |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2600 * @param plane |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2601 * @return The number characters copied to the buffer |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2602 * @throws OhioException |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2603 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2604 public synchronized int GetScreenRect(char buffer[], int bufferLength, |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2605 int startRow, int startCol, |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2606 int endRow, int endCol, int plane) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2607 // throws OhioException { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2608 { |
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 return planes.GetScreenRect(buffer, bufferLength, startRow, startCol, endRow, |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2611 endCol, plane); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2612 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2613 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2614 public synchronized boolean[] getActiveAidKeys() { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2615 return sessionVT.getActiveAidKeys(); |
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 protected synchronized void setScreenData(String text, int location) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2619 // throws OhioException { |
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 if (location < 0 || location > lenScreen) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2622 return; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2623 // throw new OhioException(sessionVT.getSessionConfiguration(), |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2624 // OhioScreen5250.class.getName(), "osohio.screen.ohio00300", 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 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2627 int pos = location; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2628 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2629 int l = text.length(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2630 boolean updated = false; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2631 boolean flag = false; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2632 int x =0; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2633 for (; x < l; x++) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2634 if (isInField(pos + x,true)) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2635 if (!screenFields.getCurrentField().isBypassField()) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2636 if (!flag) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2637 screenFields.getCurrentField().setMDT(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2638 updated = true; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2639 resetDirty(pos + x); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2640 screenFields.setMasterMDT(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2641 flag = true; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2642 } |
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 planes.screen[pos + x] = text.charAt(x); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2645 setDirty(pos + x); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2646 } |
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 |
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 lastPos = pos + x; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2651 if (updated) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2652 fireScreenChanged(); |
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 |
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 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2657 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2658 * 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
|
2659 * 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
|
2660 * that use the 1,1 offset |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2661 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2662 * @param row |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2663 * @param col |
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 public void setCursor(int row, int col) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2666 goto_XY(((row - 1) * numCols) + (col - 1)); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2667 } |
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 // 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
|
2670 protected void goto_XY(int pos) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2671 // setCursorOff(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2672 updateCursorLoc(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2673 lastPos = pos; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2674 // setCursorOn(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2675 updateCursorLoc(); |
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 |
69
294435151b0c
use 5250 encryption config entry
Carl Byington <carl@five-ten-sg.com>
parents:
60
diff
changeset
|
2678 /* |
105
1b5887a3bb1c
setField() needs to dirty the modified screen positions
Carl Byington <carl@five-ten-sg.com>
parents:
82
diff
changeset
|
2679 * 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
|
2680 * 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
|
2681 */ |
105
1b5887a3bb1c
setField() needs to dirty the modified screen positions
Carl Byington <carl@five-ten-sg.com>
parents:
82
diff
changeset
|
2682 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
|
2683 ScreenField cf; |
294435151b0c
use 5250 encryption config entry
Carl Byington <carl@five-ten-sg.com>
parents:
60
diff
changeset
|
2684 if (l >= 0) { |
294435151b0c
use 5250 encryption config entry
Carl Byington <carl@five-ten-sg.com>
parents:
60
diff
changeset
|
2685 int position = l * numCols + c; |
294435151b0c
use 5250 encryption config entry
Carl Byington <carl@five-ten-sg.com>
parents:
60
diff
changeset
|
2686 isInField(position, true); |
294435151b0c
use 5250 encryption config entry
Carl Byington <carl@five-ten-sg.com>
parents:
60
diff
changeset
|
2687 } |
105
1b5887a3bb1c
setField() needs to dirty the modified screen positions
Carl Byington <carl@five-ten-sg.com>
parents:
82
diff
changeset
|
2688 if ((data != null) && (data.length > 0)) { |
69
294435151b0c
use 5250 encryption config entry
Carl Byington <carl@five-ten-sg.com>
parents:
60
diff
changeset
|
2689 cf = screenFields.getCurrentField(); |
105
1b5887a3bb1c
setField() needs to dirty the modified screen positions
Carl Byington <carl@five-ten-sg.com>
parents:
82
diff
changeset
|
2690 cf.setString(new String(data)); |
69
294435151b0c
use 5250 encryption config entry
Carl Byington <carl@five-ten-sg.com>
parents:
60
diff
changeset
|
2691 lastPos = cf.getStartPos(); |
105
1b5887a3bb1c
setField() needs to dirty the modified screen positions
Carl Byington <carl@five-ten-sg.com>
parents:
82
diff
changeset
|
2692 setDirty(lastPos); |
106
12425771714d
setField() needs to dirty the modified screen positions
Carl Byington <carl@five-ten-sg.com>
parents:
105
diff
changeset
|
2693 setDirty(lastPos + cf.getLength()); |
69
294435151b0c
use 5250 encryption config entry
Carl Byington <carl@five-ten-sg.com>
parents:
60
diff
changeset
|
2694 } |
294435151b0c
use 5250 encryption config entry
Carl Byington <carl@five-ten-sg.com>
parents:
60
diff
changeset
|
2695 updateDirty(); |
294435151b0c
use 5250 encryption config entry
Carl Byington <carl@five-ten-sg.com>
parents:
60
diff
changeset
|
2696 } |
294435151b0c
use 5250 encryption config entry
Carl Byington <carl@five-ten-sg.com>
parents:
60
diff
changeset
|
2697 |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2698 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2699 * 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
|
2700 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2701 * @param f - |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2702 * numeric field number on the screen |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2703 * @return true or false whether it was sucessful |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2704 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2705 public boolean gotoField(int f) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2706 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2707 int sizeFields = screenFields.getSize(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2708 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2709 if (f > sizeFields || f <= 0) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2710 return false; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2711 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2712 screenFields.setCurrentField(screenFields.getField(f - 1)); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2713 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2714 while (screenFields.isCurrentFieldBypassField() && f < sizeFields) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2715 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2716 screenFields.setCurrentField(screenFields.getField(f++)); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2717 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2718 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2719 return gotoField(screenFields.getCurrentField()); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2720 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2721 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2722 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2723 * 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
|
2724 * screen field |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2725 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2726 * @param f |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2727 * @return true or false whether it was sucessful |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2728 * @see org.tn5250j.ScreenField |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2729 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2730 protected boolean gotoField(ScreenField f) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2731 if (f != null) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2732 goto_XY(f.startPos()); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2733 return true; |
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 return false; |
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 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2738 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2739 * 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
|
2740 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2741 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2742 private void gotoNextWord() { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2743 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2744 int pos = lastPos; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2745 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2746 if (planes.getChar(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 // get the next space character |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2749 while (planes.getChar(lastPos) > ' ' && pos != lastPos) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2750 advancePos(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2751 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2752 } else |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2753 advancePos(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2754 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2755 // 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
|
2756 // next none space character |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2757 while (planes.getChar(lastPos) <= ' ' && pos != lastPos) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2758 advancePos(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2759 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2760 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2761 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2762 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2763 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2764 * 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
|
2765 * screen |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2766 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2767 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2768 private void gotoPrevWord() { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2769 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2770 int pos = lastPos; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2771 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2772 changePos(-1); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2773 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2774 // position previous white space character |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2775 while (planes.getChar(lastPos) <= ' ') { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2776 changePos(-1); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2777 if (pos == lastPos) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2778 break; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2779 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2780 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2781 changePos(-1); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2782 // get the previous space character |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2783 while (planes.getChar(lastPos) > ' ' && pos != lastPos) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2784 changePos(-1); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2785 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2786 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2787 // 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
|
2788 advancePos(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2789 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2790 } |
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 * 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
|
2794 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2795 * @see org.tn5250j.ScreenFields |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2796 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2797 private void gotoFieldNext() { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2798 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2799 if (screenFields.isCurrentFieldHighlightedEntry()) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2800 unsetFieldHighlighted(screenFields.getCurrentField()); |
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 screenFields.gotoFieldNext(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2803 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2804 if (screenFields.isCurrentFieldHighlightedEntry()) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2805 setFieldHighlighted(screenFields.getCurrentField()); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2806 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2807 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2808 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2809 * 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
|
2810 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2811 * @see org.tn5250j.ScreenFields |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2812 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2813 private void gotoFieldPrev() { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2814 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2815 if (screenFields.isCurrentFieldHighlightedEntry()) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2816 unsetFieldHighlighted(screenFields.getCurrentField()); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2817 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2818 screenFields.gotoFieldPrev(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2819 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2820 if (screenFields.isCurrentFieldHighlightedEntry()) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2821 setFieldHighlighted(screenFields.getCurrentField()); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2822 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2823 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2824 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2825 /* *** NEVER USED LOCALLY ************************************************** */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2826 // /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2827 // * 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
|
2828 // * 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
|
2829 // * show on the screen. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2830 // * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2831 // * Not supported yet. Please implement me :-( |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2832 // * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2833 // * @param depth |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2834 // * @param width |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2835 // */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2836 // protected void setRestrictCursor(int depth, int width) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2837 // |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2838 // restrictCursor = true; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2839 // // restriction |
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 // } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2842 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2843 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2844 * Creates a window on the screen |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2845 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2846 * @param depth |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2847 * @param width |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2848 * @param type |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2849 * @param gui |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2850 * @param monoAttr |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2851 * @param colorAttr |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2852 * @param ul |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2853 * @param upper |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2854 * @param ur |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2855 * @param left |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2856 * @param right |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2857 * @param ll |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2858 * @param bottom |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2859 * @param lr |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2860 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2861 protected void createWindow(int depth, int width, int type, boolean gui, |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2862 int monoAttr, int colorAttr, int ul, int upper, int ur, int left, |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2863 int right, int ll, int bottom, int lr) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2864 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2865 int c = getCol(lastPos); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2866 int w = 0; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2867 width++; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2868 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2869 w = width; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2870 // set leading attribute byte |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2871 // screen[lastPos].setCharAndAttr(initChar, initAttr, true); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2872 planes.setScreenCharAndAttr(lastPos, initChar, initAttr, true); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2873 setDirty(lastPos); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2874 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2875 advancePos(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2876 // set upper left |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2877 // screen[lastPos].setCharAndAttr((char) ul, colorAttr, false); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2878 planes.setScreenCharAndAttr(lastPos, (char) ul, colorAttr, false); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2879 if (gui) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2880 // screen[lastPos].setUseGUI(UPPER_LEFT); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2881 planes.setUseGUI(lastPos, UPPER_LEFT); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2882 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2883 setDirty(lastPos); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2884 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2885 advancePos(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2886 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2887 // draw top row |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2888 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2889 while (w-- >= 0) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2890 // screen[lastPos].setCharAndAttr((char) upper, colorAttr, false); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2891 planes.setScreenCharAndAttr(lastPos, (char) upper, colorAttr, false); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2892 if (gui) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2893 // screen[lastPos].setUseGUI(UPPER); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2894 planes.setUseGUI(lastPos,UPPER); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2895 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2896 setDirty(lastPos); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2897 advancePos(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2898 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2899 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2900 // set upper right |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2901 // screen[lastPos].setCharAndAttr((char) ur, colorAttr, false); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2902 planes.setScreenCharAndAttr(lastPos,(char) ur, colorAttr, false); |
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 if (gui) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2905 // screen[lastPos].setUseGUI(UPPER_RIGHT); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2906 planes.setUseGUI(lastPos, UPPER_RIGHT); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2907 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2908 setDirty(lastPos); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2909 advancePos(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2910 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2911 // set ending attribute byte |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2912 planes.setScreenCharAndAttr(lastPos,initChar, initAttr, true); |
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 setDirty(lastPos); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2915 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2916 lastPos = ((getRow(lastPos) + 1) * numCols) + c; |
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 // now handle body of window |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2919 while (depth-- > 0) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2920 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2921 // set leading attribute byte |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2922 planes.setScreenCharAndAttr(lastPos,initChar, initAttr, true); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2923 setDirty(lastPos); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2924 advancePos(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2925 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2926 // set left |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2927 planes.setScreenCharAndAttr(lastPos, (char) left, colorAttr, false); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2928 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2929 if (gui) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2930 planes.setUseGUI(lastPos,GUI_LEFT); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2931 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2932 setDirty(lastPos); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2933 advancePos(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2934 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2935 w = width; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2936 // fill it in |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2937 while (w-- >= 0) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2938 // screen[lastPos].setCharAndAttr(initChar, initAttr, true); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2939 planes.setScreenCharAndAttr(lastPos,initChar, initAttr, true); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2940 // screen[lastPos].setUseGUI(NO_GUI); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2941 planes.setUseGUI(lastPos,NO_GUI); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2942 setDirty(lastPos); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2943 advancePos(); |
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 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2946 // set right |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2947 // screen[lastPos].setCharAndAttr((char) right, colorAttr, false); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2948 planes.setScreenCharAndAttr(lastPos,(char) right, colorAttr, false); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2949 if (gui) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2950 // screen[lastPos].setUseGUI(RIGHT); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2951 planes.setUseGUI(lastPos,GUI_RIGHT); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2952 } |
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 setDirty(lastPos); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2955 advancePos(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2956 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2957 // set ending attribute byte |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2958 // screen[lastPos].setCharAndAttr(initChar, initAttr, true); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2959 planes.setScreenCharAndAttr(lastPos,initChar, initAttr, true); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2960 setDirty(lastPos); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2961 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2962 lastPos = ((getRow(lastPos) + 1) * numCols) + c; |
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 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2965 // set leading attribute byte |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2966 // screen[lastPos].setCharAndAttr(initChar, initAttr, true); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2967 planes.setScreenCharAndAttr(lastPos,initChar, initAttr, true); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2968 setDirty(lastPos); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2969 advancePos(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2970 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2971 // set lower left |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2972 // screen[lastPos].setCharAndAttr((char) ll, colorAttr, false); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2973 planes.setScreenCharAndAttr(lastPos,(char) ll, colorAttr, false); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2974 if (gui) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2975 // screen[lastPos].setUseGUI(LOWER_LEFT); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2976 planes.setUseGUI(lastPos,LOWER_LEFT); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2977 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2978 setDirty(lastPos); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2979 advancePos(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2980 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2981 w = width; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2982 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2983 // draw bottom row |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2984 while (w-- >= 0) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2985 planes.setScreenCharAndAttr(lastPos,(char) bottom, colorAttr, false); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2986 if (gui) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2987 planes.setUseGUI(lastPos,BOTTOM); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2988 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2989 setDirty(lastPos); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2990 advancePos(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2991 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2992 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2993 // set lower right |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2994 planes.setScreenCharAndAttr(lastPos, (char) lr, colorAttr, false); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2995 if (gui) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2996 planes.setUseGUI(lastPos,LOWER_RIGHT); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2997 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2998 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
2999 setDirty(lastPos); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3000 advancePos(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3001 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3002 // set ending attribute byte |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3003 planes.setScreenCharAndAttr(lastPos,initChar, initAttr, true); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3004 setDirty(lastPos); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3005 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3006 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3007 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3008 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3009 * 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
|
3010 * ** we only support vertical scroll bars at the time. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3011 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3012 * @param flag - |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3013 * type to draw - vertical or horizontal |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3014 * @param totalRowScrollable |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3015 * @param totalColScrollable |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3016 * @param sliderRowPos |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3017 * @param sliderColPos |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3018 * @param sbSize |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3019 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3020 protected void createScrollBar(int flag, int totalRowScrollable, |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3021 int totalColScrollable, int sliderRowPos, int sliderColPos, |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3022 int sbSize) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3023 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3024 // System.out.println("Scrollbar flag: " + flag + |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3025 // " scrollable Rows: " + totalRowScrollable + |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3026 // " scrollable Cols: " + totalColScrollable + |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3027 // " thumb Row: " + sliderRowPos + |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3028 // " thumb Col: " + sliderColPos + |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3029 // " size: " + sbSize + |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3030 // " row: " + getRow(lastPos) + |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3031 // " col: " + getCol(lastPos)); |
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 int sp = lastPos; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3034 int size = sbSize - 2; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3035 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3036 int thumbPos = (int) (size * ((float) sliderColPos / (float) totalColScrollable)); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3037 // System.out.println(thumbPos); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3038 planes.setScreenCharAndAttr(sp,' ', 32, false); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3039 planes.setUseGUI(sp,BUTTON_SB_UP); |
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 int ctr = 0; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3042 while (ctr < size) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3043 sp += numCols; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3044 planes.setScreenCharAndAttr(sp,' ', 32, false); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3045 if (ctr == thumbPos) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3046 planes.setUseGUI(sp,BUTTON_SB_THUMB); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3047 else |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3048 planes.setUseGUI(sp, BUTTON_SB_GUIDE); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3049 ctr++; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3050 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3051 sp += numCols; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3052 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3053 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3054 planes.setScreenCharAndAttr(sp, ' ', 32, false); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3055 planes.setUseGUI(sp, BUTTON_SB_DN); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3056 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3057 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3058 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3059 * 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
|
3060 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3061 * @param pos |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3062 * @param depth |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3063 * @param width |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3064 * @param orientation |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3065 * @param monoAttr |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3066 * @param colorAttr |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3067 * @param title |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3068 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3069 protected void writeWindowTitle(int pos, int depth, int width, |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3070 byte orientation, int monoAttr, int colorAttr, StringBuffer title) { |
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 int len = title.length(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3073 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3074 // get bit 0 and 1 for interrogation |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3075 switch (orientation & 0xc0) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3076 case 0x40: // right |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3077 pos += (4 + width - len); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3078 break; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3079 case 0x80: // left |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3080 pos += 2; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3081 break; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3082 default: // center |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3083 // this is to place the position to the first text position of the |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3084 // window |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3085 // the position passed in is the first attribute position, the next |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3086 // is the border character and then there is another attribute after |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3087 // that. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3088 pos += (3 + ((width / 2) - (len / 2))); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3089 break; |
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 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3092 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3093 // 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
|
3094 if ((orientation & 0x20) == 0x20) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3095 pos += ((depth + 1) * numCols); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3096 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3097 // System.out.println(pos + "," + width + "," + len+ "," + getRow(pos) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3098 // + "," + getCol(pos) + "," + ((orientation >> 6) & 0xf0)); |
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 for (int x = 0; x < len; x++) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3101 planes.setChar(pos, title.charAt(x)); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3102 planes.setUseGUI(pos++, NO_GUI); |
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 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3106 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3107 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3108 * Roll the screen up or down. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3109 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3110 * 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
|
3111 * 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
|
3112 * 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
|
3113 * 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
|
3114 * that will participate in the roll. |
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 * @param direction |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3117 * @param topLine |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3118 * @param bottomLine |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3119 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3120 protected void rollScreen(int direction, int topLine, int bottomLine) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3121 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3122 // 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
|
3123 /* int lines = direction & 0x7F; */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3124 // 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
|
3125 // 0 - up |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3126 // 1 - down |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3127 int updown = direction & 0x80; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3128 final int lines = direction & 0x7F; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3129 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3130 // calculate the reference points for the move. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3131 int start = this.getPos(topLine - 1, 0); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3132 int end = this.getPos(bottomLine - 1, numCols - 1); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3133 int len = end - start; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3134 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3135 // System.out.println(" starting roll"); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3136 // dumpScreen(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3137 switch (updown) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3138 case 0: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3139 // Now round em up and head em UP. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3140 for (int x = start; x < end + numCols; x++) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3141 if (x + lines * numCols >= lenScreen) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3142 //Clear at the end |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3143 planes.setChar(x, ' '); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3144 } else { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3145 planes.setChar(x, planes.getChar(x + lines * numCols )); |
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 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3148 break; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3149 case 1: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3150 // Now round em up and head em DOWN. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3151 for (int x = end + numCols; x > 0; x--) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3152 if ((x - lines * numCols ) < 0 ) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3153 //Do nothing ... tooo small!!! |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3154 } else { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3155 planes.setChar(x - lines * numCols, planes.getChar(x)); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3156 //and clear |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3157 planes.setChar(x, ' '); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3158 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3159 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3160 break; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3161 default: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3162 Log.w(TAG," Invalid roll parameter - please report this"); |
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 // System.out.println(" end roll"); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3165 // dumpScreen(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3166 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3167 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3168 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3169 public void dumpScreen() { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3170 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3171 StringBuffer sb = new StringBuffer(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3172 char[] s = getScreenAsChars(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3173 int c = getColumns(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3174 int l = getRows() * c; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3175 int col = 0; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3176 for (int x = 0; x < l; x++, col++) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3177 sb.append(s[x]); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3178 if (col == c) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3179 sb.append('\n'); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3180 col = 0; |
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 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3183 Log.i(TAG,sb.toString()); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3184 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3185 } |
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 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3188 * Add a field to the field format table. |
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 * @param attr - Field attribute |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3191 * @param len - length of field |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3192 * @param ffw1 - Field format word 1 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3193 * @param ffw2 - Field format word 2 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3194 * @param fcw1 - Field control word 1 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3195 * @param fcw2 - Field control word 2 |
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 protected void addField(int attr, int len, int ffw1, int ffw2, int fcw1, |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3198 int fcw2) { |
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 lastAttr = attr; |
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 planes.setScreenCharAndAttr(lastPos, initChar, lastAttr, true); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3203 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3204 setDirty(lastPos); |
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 advancePos(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3207 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3208 ScreenField sf = null; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3209 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3210 // 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
|
3211 // 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
|
3212 // starting address plus 1. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3213 if (screenFields.existsAtPos(lastPos)) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3214 screenFields.setCurrentFieldFFWs(ffw1, ffw2); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3215 } else { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3216 sf = screenFields.setField(attr, getRow(lastPos), getCol(lastPos), |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3217 len, ffw1, ffw2, fcw1, fcw2); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3218 lastPos = sf.startPos(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3219 int x = len; |
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 boolean gui = guiInterface; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3222 if (sf.isBypassField()) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3223 gui = false; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3224 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3225 while (x-- > 0) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3226 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3227 if (planes.getChar(lastPos) == 0) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3228 planes.setScreenCharAndAttr(lastPos, ' ', lastAttr, false); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3229 else |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3230 planes.setScreenAttr(lastPos,lastAttr); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3231 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3232 if (gui) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3233 planes.setUseGUI(lastPos,FIELD_MIDDLE); |
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 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3236 // now we set the field plane attributes |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3237 planes.setScreenFieldAttr(lastPos,ffw1); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3238 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3239 advancePos(); |
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 if (gui) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3244 if (len > 1) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3245 planes.setUseGUI(sf.startPos(), FIELD_LEFT); |
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 if (lastPos > 0) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3248 planes.setUseGUI(lastPos - 1, FIELD_RIGHT); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3249 else |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3250 planes.setUseGUI(lastPos,FIELD_RIGHT); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3251 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3252 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3253 else { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3254 planes.setUseGUI(lastPos - 1,FIELD_ONE); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3255 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3256 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3257 // screen[lastPos].setCharAndAttr(initChar,initAttr,true); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3258 setEndingAttr(initAttr); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3259 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3260 lastPos = sf.startPos(); |
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 // if (fcw1 != 0 || fcw2 != 0) { |
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 // System.out.println("lr = " + lastRow + " lc = " + lastCol + " " + |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3266 // sf.toString()); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3267 // } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3268 sf = null; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3269 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3270 } |
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 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3273 // 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
|
3274 // fcw1, int fcw2) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3275 // |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3276 // lastAttr = attr; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3277 // |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3278 // screen[lastPos].setCharAndAttr(initChar,lastAttr,true); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3279 // setDirty(lastPos); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3280 // |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3281 // advancePos(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3282 // |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3283 // boolean found = false; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3284 // ScreenField sf = null; |
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 // // 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
|
3287 // // 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
|
3288 // // starting address plus 1. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3289 // for (int x = 0;x < sizeFields; x++) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3290 // sf = screenFields[x]; |
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 // if (lastPos == sf.startPos()) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3293 // screenFields.getCurrentField() = sf; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3294 // screenFields.getCurrentField().setFFWs(ffw1,ffw2); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3295 // found = true; |
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 // |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3298 // } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3299 // |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3300 // if (!found) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3301 // sf = |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3302 // 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
|
3303 // |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3304 // lastPos = sf.startPos(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3305 // int x = len; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3306 // |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3307 // boolean gui = guiInterface; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3308 // if (sf.isBypassField()) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3309 // gui = false; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3310 // |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3311 // while (x-- > 0) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3312 // |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3313 // if (screen[lastPos].getChar() == 0) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3314 // screen[lastPos].setCharAndAttr(' ',lastAttr,false); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3315 // else |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3316 // screen[lastPos].setAttribute(lastAttr); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3317 // |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3318 // if (gui) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3319 // screen[lastPos].setUseGUI(FIELD_MIDDLE); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3320 // |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3321 // advancePos(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3322 // |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3323 // } |
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 // if (gui) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3326 // if (len > 1) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3327 // screen[sf.startPos()].setUseGUI(FIELD_LEFT); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3328 // if (lastPos > 0) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3329 // screen[lastPos-1].setUseGUI(FIELD_RIGHT); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3330 // else |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3331 // screen[lastPos].setUseGUI(FIELD_RIGHT); |
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 // } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3334 // else |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3335 // screen[lastPos-1].setUseGUI(FIELD_ONE); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3336 // |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3337 // setEndingAttr(initAttr); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3338 // |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3339 // lastPos = sf.startPos(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3340 // } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3341 // |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3342 // // if (fcw1 != 0 || fcw2 != 0) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3343 // // |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3344 // // System.out.println("lr = " + lastRow + " lc = " + lastCol + " " + |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3345 // sf.toString()); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3346 // // } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3347 // sf = null; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3348 // |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3349 // } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3350 |
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 * 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
|
3353 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3354 * @return ScreenFields object |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3355 * @see org.tn5250j.ScreenFields |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3356 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3357 public ScreenFields getScreenFields() { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3358 return screenFields; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3359 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3360 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3361 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3362 * 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
|
3363 * fields when toggling |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3364 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3365 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3366 protected void drawFields() { |
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 ScreenField sf; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3369 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3370 int sizeFields = screenFields.getSize(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3371 for (int x = 0; x < sizeFields; x++) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3372 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3373 sf = screenFields.getField(x); |
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 if (!sf.isBypassField()) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3376 int pos = sf.startPos(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3377 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3378 int l = sf.length; |
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 boolean f = true; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3381 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3382 if (l >= lenScreen) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3383 l = lenScreen - 1; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3384 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3385 if (l > 1) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3386 while (l-- > 0) { |
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 if (guiInterface && f) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3389 planes.setUseGUI(pos,FIELD_LEFT); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3390 f = false; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3391 } else { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3392 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3393 planes.setUseGUI(pos,FIELD_MIDDLE); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3394 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3395 } |
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 if (guiInterface && l == 0) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3398 planes.setUseGUI(pos,FIELD_RIGHT); |
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 setDirty(pos++); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3402 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3403 } else { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3404 planes.setUseGUI(pos,FIELD_ONE); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3405 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3406 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3407 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3408 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3409 //updateDirty(); |
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 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3412 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3413 * 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
|
3414 * the field. |
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 * @param sf - |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3417 * Field to be redrawn |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3418 * @see org.tn5250j.ScreenField.java |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3419 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3420 protected void drawField(ScreenField sf) { |
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 int pos = sf.startPos(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3423 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3424 int x = sf.length; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3425 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3426 while (x-- > 0) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3427 setDirty(pos++); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3428 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3429 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3430 updateDirty(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3431 |
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 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3434 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3435 * Set the field to be displayed as highlighted. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3436 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3437 * @param sf - |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3438 * Field to be highlighted |
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 protected void setFieldHighlighted(ScreenField sf) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3441 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3442 int pos = sf.startPos(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3443 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3444 int x = sf.length; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3445 int na = sf.getHighlightedAttr(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3446 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3447 while (x-- > 0) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3448 planes.setScreenAttr(pos,na); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3449 setDirty(pos++); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3450 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3451 fireScreenChanged(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3452 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3453 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3454 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3455 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3456 * 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
|
3457 * presentation on the screen after the field is exited. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3458 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3459 * @param sf - |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3460 * Field to be unhighlighted |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3461 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3462 protected void unsetFieldHighlighted(ScreenField sf) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3463 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3464 int pos = sf.startPos(); |
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 int x = sf.length; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3467 int na = sf.getAttr(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3468 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3469 while (x-- > 0) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3470 planes.setScreenAttr(pos,na); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3471 setDirty(pos++); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3472 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3473 fireScreenChanged(); |
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 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3476 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3477 protected void setChar(int cByte) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3478 if (lastPos > 0) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3479 lastAttr = planes.getCharAttr(lastPos - 1); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3480 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3481 if (cByte > 0 && (char)cByte < ' ') { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3482 planes.setScreenCharAndAttr(lastPos, (char) 0x00, 33, false); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3483 setDirty(lastPos); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3484 advancePos(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3485 } else { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3486 planes.setScreenCharAndAttr(lastPos, (char) cByte, lastAttr, false); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3487 setDirty(lastPos); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3488 if (guiInterface && !isInField(lastPos, false)) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3489 planes.setUseGUI(lastPos, NO_GUI); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3490 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3491 advancePos(); |
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 protected void setEndingAttr(int cByte) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3496 int attr = lastAttr; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3497 setAttr(cByte); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3498 lastAttr = attr; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3499 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3500 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3501 protected void setAttr(int cByte) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3502 lastAttr = cByte; |
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 // int sattr = screen[lastPos].getCharAttr(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3505 // System.out.println("changing from " + sattr + " to attr " + lastAttr |
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 // " at " + (this.getRow(lastPos) + 1) + "," + (this.getCol(lastPos) + |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3508 // 1)); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3509 planes.setScreenCharAndAttr(lastPos, initChar, lastAttr, true); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3510 setDirty(lastPos); |
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 advancePos(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3513 int pos = lastPos; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3514 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3515 int times = 0; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3516 // sattr = screen[lastPos].getCharAttr(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3517 // System.out.println(" next position after change " + sattr + " last |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3518 // attr " + lastAttr + |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3519 // " at " + (this.getRow(lastPos) + 1) + "," + (this.getCol(lastPos) + |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3520 // 1) + |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3521 // " attr place " + screen[lastPos].isAttributePlace()); |
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 while (planes.getCharAttr(lastPos) != lastAttr |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3524 && !planes.isAttributePlace(lastPos)) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3525 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3526 planes.setScreenAttr(lastPos, lastAttr); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3527 if (guiInterface && !isInField(lastPos, false)) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3528 int g = planes.getWhichGUI(lastPos); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3529 if (g >= FIELD_LEFT && g <= FIELD_ONE) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3530 planes.setUseGUI(lastPos,NO_GUI); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3531 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3532 setDirty(lastPos); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3533 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3534 times++; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3535 advancePos(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3536 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3537 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3538 // sanity check for right now |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3539 // if (times > 200) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3540 // System.out.println(" setAttr = " + times + " start = " + (sr + 1) + |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3541 // "," + (sc + 1)); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3542 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3543 lastPos = pos; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3544 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3545 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3546 protected void setScreenCharAndAttr(char right, int colorAttr, boolean isAttr) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3547 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3548 planes.setScreenCharAndAttr(lastPos,right, colorAttr, isAttr); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3549 setDirty(lastPos); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3550 advancePos(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3551 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3552 } |
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 protected void setScreenCharAndAttr(char right, int colorAttr, |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3555 int whichGui, boolean isAttr) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3556 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3557 planes.setScreenCharAndAttr(lastPos,right, colorAttr, isAttr); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3558 planes.setUseGUI(lastPos,whichGui); |
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 setDirty(lastPos); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3561 advancePos(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3562 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3563 } |
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 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3566 * 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
|
3567 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3568 * 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
|
3569 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3570 * 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
|
3571 * attributes before calling this routine. |
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 protected void updateDirty() { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3574 fireScreenChanged(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3575 } |
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 setDirty(int pos) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3578 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3579 int minr = Math.min(getRow(pos),getRow(dirtyScreen.x)); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3580 int minc = Math.min(getCol(pos),getCol(dirtyScreen.x)); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3581 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3582 int maxr = Math.max(getRow(pos),getRow(dirtyScreen.y)); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3583 int maxc = Math.max(getCol(pos),getCol(dirtyScreen.y)); |
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 int x1 = getPos(minr,minc); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3586 int x2 = getPos(maxr,maxc); |
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 dirtyScreen.setBounds(x1,x2,0,0); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3589 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3590 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3591 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3592 private void resetDirty(int pos) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3593 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3594 dirtyScreen.setBounds(pos,pos,0,0); |
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 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3599 * Change the screen position by one column |
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 advancePos() { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3602 changePos(1); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3603 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3604 |
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 * 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
|
3607 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3608 * 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
|
3609 * 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
|
3610 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3611 * 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
|
3612 * cursor is moved to first position of the screen. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3613 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3614 * @param i |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3615 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3616 protected void changePos(int i) { |
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 lastPos += i; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3619 if (lastPos < 0) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3620 lastPos = lenScreen + lastPos; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3621 if (lastPos > lenScreen - 1) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3622 lastPos = lastPos - lenScreen; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3623 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3624 // System.out.println(lastRow + "," + ((lastPos) / numCols) + "," + |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3625 // lastCol + "," + ((lastPos) % numCols) + "," + |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3626 // ((lastRow * numCols) + lastCol) + "," + |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3627 // (lastPos)); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3628 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3629 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3630 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3631 protected void goHome() { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3632 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3633 // 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
|
3634 // 14.6 WRITE TO DISPLAY Command |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3635 // ? 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
|
3636 // the cursor moves to one of three locations: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3637 // - 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
|
3638 // 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
|
3639 // - 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
|
3640 // format table |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3641 // - A default starting address of row 1 column 1. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3642 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3643 if (pendingInsert && homePos > 0) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3644 setCursor(getRow(homePos), getCol(homePos)); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3645 isInField(); // we now check if we are in a field |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3646 } else { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3647 if (!gotoField(1)) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3648 homePos = getPos(1, 1); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3649 setCursor(1, 1); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3650 isInField(0, 0); // we now check if we are in a field |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3651 } else { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3652 homePos = getPos(getCurrentRow(), getCurrentCol()); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3653 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3654 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3655 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3656 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3657 protected void setPendingInsert(boolean flag, int icX, int icY) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3658 pendingInsert = flag; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3659 if (pendingInsert) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3660 homePos = getPos(icX, icY); |
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 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3663 if (!isStatusErrorCode()) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3664 setCursor(icX, icY); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3665 } |
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 protected void setPendingInsert(boolean flag) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3669 if (homePos != -1) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3670 pendingInsert = flag; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3671 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3672 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3673 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3674 * 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
|
3675 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3676 * @param line |
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 protected void setErrorLine(int line) { |
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 planes.setErrorLine(line); |
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 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3683 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3684 * Returns the current error line number |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3685 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3686 * @return current error line number |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3687 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3688 protected int getErrorLine() { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3689 return planes.getErrorLine(); |
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 |
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 * 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
|
3694 * |
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 protected void saveErrorLine() { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3697 planes.saveErrorLine(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3698 } |
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 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3701 * Restores the error line characters from the save buffer. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3702 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3703 * @see #saveErrorLine() |
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 protected void restoreErrorLine() { |
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 if (planes.isErrorLineSaved()) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3708 planes.restoreErrorLine(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3709 fireScreenChanged(planes.getErrorLine()-1,0,planes.getErrorLine()-1,numCols - 1); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3710 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3711 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3712 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3713 protected void setStatus(byte attr, byte value, String s) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3714 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3715 // set the status area |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3716 switch (attr) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3717 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3718 case STATUS_SYSTEM: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3719 if (value == STATUS_VALUE_ON) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3720 oia.setInputInhibited(ScreenOIA.INPUTINHIBITED_SYSTEM_WAIT,ScreenOIA.OIA_LEVEL_INPUT_INHIBITED, s); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3721 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3722 else { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3723 oia.setInputInhibited(ScreenOIA.INPUTINHIBITED_NOTINHIBITED,ScreenOIA.OIA_LEVEL_NOT_INHIBITED,s); |
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 break; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3726 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3727 case STATUS_ERROR_CODE: |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3728 if (value == STATUS_VALUE_ON) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3729 setPrehelpState(true, true, false); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3730 oia.setInputInhibited(ScreenOIA.INPUTINHIBITED_SYSTEM_WAIT, |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3731 ScreenOIA.OIA_LEVEL_INPUT_ERROR,s); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3732 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3733 sessionVT.signalBell(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3734 } else { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3735 oia.setInputInhibited(ScreenOIA.INPUTINHIBITED_NOTINHIBITED, |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3736 ScreenOIA.OIA_LEVEL_NOT_INHIBITED); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3737 setPrehelpState(false, true, true); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3738 homePos = saveHomePos; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3739 saveHomePos = 0; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3740 pendingInsert = false; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3741 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3742 break; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3743 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3744 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3745 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3746 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3747 protected boolean isStatusErrorCode() { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3748 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3749 return oia.getLevel() == ScreenOIA.OIA_LEVEL_INPUT_ERROR; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3750 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3751 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3752 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3753 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3754 * 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
|
3755 * 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
|
3756 * clears/initializes the screen character array. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3757 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3758 protected void clearAll() { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3759 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3760 lastAttr = 32; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3761 lastPos = 0; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3762 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3763 clearTable(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3764 clearScreen(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3765 planes.setScreenAttr(0, initAttr); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3766 oia.setInsertMode(false); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3767 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3768 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3769 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3770 * Clear the fields table |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3771 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3772 protected void clearTable() { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3773 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3774 oia.setKeyBoardLocked(true); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3775 screenFields.clearFFT(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3776 planes.initalizeFieldPlanes(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3777 pendingInsert = false; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3778 homePos = -1; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3779 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3780 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3781 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3782 * Clear the gui constructs |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3783 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3784 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3785 protected void clearGuiStuff() { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3786 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3787 for (int x = 0; x < lenScreen; x++) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3788 planes.setUseGUI(x,NO_GUI); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3789 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3790 dirtyScreen.setBounds(0,lenScreen - 1,0,0); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3791 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3792 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3793 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3794 * 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
|
3795 * to all the positions on the screen |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3796 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3797 protected void clearScreen() { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3798 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3799 planes.initalizePlanes(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3800 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3801 dirtyScreen.setBounds(0,lenScreen - 1,0,0); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3802 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3803 oia.clearScreen(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3804 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3805 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3806 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3807 protected void restoreScreen() { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3808 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3809 lastAttr = 32; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3810 dirtyScreen.setBounds(0,lenScreen - 1,0,0); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3811 updateDirty(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3812 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3813 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3814 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3815 * repaint part of the screen |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3816 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3817 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3818 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
|
3819 int [] vt320color = {0x0, // black |
bf01d1eec5c6
convert 5250 to vt320 attributes
Carl Byington <carl@five-ten-sg.com>
parents:
70
diff
changeset
|
3820 0x4, // blue |
bf01d1eec5c6
convert 5250 to vt320 attributes
Carl Byington <carl@five-ten-sg.com>
parents:
70
diff
changeset
|
3821 0x2, // green |
bf01d1eec5c6
convert 5250 to vt320 attributes
Carl Byington <carl@five-ten-sg.com>
parents:
70
diff
changeset
|
3822 0x6, // cyan |
bf01d1eec5c6
convert 5250 to vt320 attributes
Carl Byington <carl@five-ten-sg.com>
parents:
70
diff
changeset
|
3823 0x1, // red |
bf01d1eec5c6
convert 5250 to vt320 attributes
Carl Byington <carl@five-ten-sg.com>
parents:
70
diff
changeset
|
3824 0x5, // magenta/purple |
bf01d1eec5c6
convert 5250 to vt320 attributes
Carl Byington <carl@five-ten-sg.com>
parents:
70
diff
changeset
|
3825 0xb, // yellow |
bf01d1eec5c6
convert 5250 to vt320 attributes
Carl Byington <carl@five-ten-sg.com>
parents:
70
diff
changeset
|
3826 0x7, // light gray/white |
bf01d1eec5c6
convert 5250 to vt320 attributes
Carl Byington <carl@five-ten-sg.com>
parents:
70
diff
changeset
|
3827 0x8, // dark gray |
bf01d1eec5c6
convert 5250 to vt320 attributes
Carl Byington <carl@five-ten-sg.com>
parents:
70
diff
changeset
|
3828 0xc, // light blue |
bf01d1eec5c6
convert 5250 to vt320 attributes
Carl Byington <carl@five-ten-sg.com>
parents:
70
diff
changeset
|
3829 0xa, // light green |
bf01d1eec5c6
convert 5250 to vt320 attributes
Carl Byington <carl@five-ten-sg.com>
parents:
70
diff
changeset
|
3830 0xe, // light cyan |
bf01d1eec5c6
convert 5250 to vt320 attributes
Carl Byington <carl@five-ten-sg.com>
parents:
70
diff
changeset
|
3831 0x9, // light red |
bf01d1eec5c6
convert 5250 to vt320 attributes
Carl Byington <carl@five-ten-sg.com>
parents:
70
diff
changeset
|
3832 0xd, // light magenta/purple |
bf01d1eec5c6
convert 5250 to vt320 attributes
Carl Byington <carl@five-ten-sg.com>
parents:
70
diff
changeset
|
3833 0x3, // brown |
76
00464d9c2f54
convert 5250 to vt320 attributes
Carl Byington <carl@five-ten-sg.com>
parents:
75
diff
changeset
|
3834 0xf // bright white |
00464d9c2f54
convert 5250 to vt320 attributes
Carl Byington <carl@five-ten-sg.com>
parents:
75
diff
changeset
|
3835 }; |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3836 for (int r = startRow; r <= endRow; r++) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3837 for (int c = startCol; c <= endCol; c++) { |
75
bf01d1eec5c6
convert 5250 to vt320 attributes
Carl Byington <carl@five-ten-sg.com>
parents:
70
diff
changeset
|
3838 int p = getPos(r,c); |
bf01d1eec5c6
convert 5250 to vt320 attributes
Carl Byington <carl@five-ten-sg.com>
parents:
70
diff
changeset
|
3839 char ch = planes.getChar(p); |
bf01d1eec5c6
convert 5250 to vt320 attributes
Carl Byington <carl@five-ten-sg.com>
parents:
70
diff
changeset
|
3840 char co = planes.getCharColor(p); |
bf01d1eec5c6
convert 5250 to vt320 attributes
Carl Byington <carl@five-ten-sg.com>
parents:
70
diff
changeset
|
3841 char at = planes.getCharExtended(p); |
81
49bda8001175
don't display attribute characters
Carl Byington <carl@five-ten-sg.com>
parents:
78
diff
changeset
|
3842 boolean ia = planes.isAttributePlace(p); |
60
d9b27288a9d2
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
58
diff
changeset
|
3843 if (ch < ' ') ch = ' '; |
82
d8da9f32074c
vt320 colors add one to indicate color is set rather than default
Carl Byington <carl@five-ten-sg.com>
parents:
81
diff
changeset
|
3844 int bg = vt320color[(int)((co >> 8) & 0x0f)] + 1; |
d8da9f32074c
vt320 colors add one to indicate color is set rather than default
Carl Byington <carl@five-ten-sg.com>
parents:
81
diff
changeset
|
3845 int fg = vt320color[(int)(co & 0x0f)] + 1; |
78
044b1a951925
convert 5250 to vt320 attributes
Carl Byington <carl@five-ten-sg.com>
parents:
77
diff
changeset
|
3846 int ul = (int)(at & EXTENDED_5250_UNDERLINE); |
044b1a951925
convert 5250 to vt320 attributes
Carl Byington <carl@five-ten-sg.com>
parents:
77
diff
changeset
|
3847 int nd = (int)(at & EXTENDED_5250_NON_DSP); |
044b1a951925
convert 5250 to vt320 attributes
Carl Byington <carl@five-ten-sg.com>
parents:
77
diff
changeset
|
3848 int vt_attr = (fg << VDUBuffer.COLOR_FG_SHIFT) + (bg << VDUBuffer.COLOR_BG_SHIFT); |
044b1a951925
convert 5250 to vt320 attributes
Carl Byington <carl@five-ten-sg.com>
parents:
77
diff
changeset
|
3849 if (ul > 0) vt_attr |= VDUBuffer.UNDERLINE; |
81
49bda8001175
don't display attribute characters
Carl Byington <carl@five-ten-sg.com>
parents:
78
diff
changeset
|
3850 if (ia || (nd > 0)) vt_attr |= VDUBuffer.INVISIBLE; |
75
bf01d1eec5c6
convert 5250 to vt320 attributes
Carl Byington <carl@five-ten-sg.com>
parents:
70
diff
changeset
|
3851 buffer.putChar(c, r, ch, vt_attr); |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3852 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3853 } |
41
9621ac4dd5eb
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
40
diff
changeset
|
3854 buffer.redrawPassthru(); |
32
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3855 dirtyScreen.setBounds(lenScreen,0,0,0); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3856 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3857 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3858 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3859 * repaint the dirty part of the screen |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3860 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3861 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3862 private synchronized void fireScreenChanged() { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3863 if (dirtyScreen.x > dirtyScreen.y) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3864 Log.i(TAG," x < y " + dirtyScreen); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3865 return; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3866 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3867 fireScreenChanged(getRow(dirtyScreen.x), getCol(dirtyScreen.x), |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3868 getRow(dirtyScreen.y), getCol(dirtyScreen.y)); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3869 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3870 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3871 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3872 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3873 * update the cursor position |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3874 * |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3875 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3876 private synchronized void fireCursorChanged() { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3877 int l = getRow(lastPos); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3878 int c = getCol(lastPos); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3879 buffer.setCursorPosition(c,l); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3880 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3881 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3882 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3883 * update the screen size. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3884 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3885 private void fireScreenSizeChanged() { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3886 buffer.setScreenSize(numCols, numRows, true); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3887 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3888 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3889 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3890 * This method does a complete refresh of the screen. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3891 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3892 public final void updateScreen() { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3893 repaintScreen(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3894 setCursorActive(false); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3895 setCursorActive(true); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3896 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3897 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3898 /** |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3899 * 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
|
3900 * updateScreen. |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3901 */ |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3902 public void repaintScreen() { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3903 setCursorOff(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3904 dirtyScreen.setBounds(0,lenScreen - 1,0,0); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3905 updateDirty(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3906 // restore statuses that were on the screen before resize |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3907 if (oia.getLevel() == ScreenOIA.OIA_LEVEL_INPUT_ERROR) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3908 oia.setInputInhibited(ScreenOIA.INPUTINHIBITED_SYSTEM_WAIT, |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3909 ScreenOIA.OIA_LEVEL_INPUT_ERROR); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3910 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3911 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3912 if (oia.getLevel() == ScreenOIA.OIA_LEVEL_INPUT_INHIBITED) { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3913 oia.setInputInhibited(ScreenOIA.INPUTINHIBITED_SYSTEM_WAIT, |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3914 ScreenOIA.OIA_LEVEL_INPUT_INHIBITED); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3915 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3916 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3917 if (oia.isMessageWait()) |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3918 oia.setMessageLightOn(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3919 setCursorOn(); |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3920 } |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3921 |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3922 // 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
|
3923 // 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
|
3924 public char[] getCharacters() { |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3925 return planes.screen; |
b086dd794dba
start tn5250 integration
Carl Byington <carl@five-ten-sg.com>
parents:
26
diff
changeset
|
3926 } |
3 | 3927 |
3928 } |