comparison src/org/tn5250j/framework/tn5250/Screen5250.java @ 7:3248b46f3973 tn5250

adding tn5250 files
author Carl Byington <carl@five-ten-sg.com>
date Thu, 22 May 2014 13:41:05 -0700
parents e8d2a24e85c6
children e773d0952613
comparison
equal deleted inserted replaced
6:1b9e27659ef7 7:3248b46f3973
187 backspaceError = onError; 187 backspaceError = onError;
188 } 188 }
189 189
190 /** 190 /**
191 * Copy & Paste support 191 * Copy & Paste support
192 * 192 *
193 * @see {@link #pasteText(String, boolean)} 193 * @see {@link #pasteText(String, boolean)}
194 * @see {@link #copyTextField(int)} 194 * @see {@link #copyTextField(int)}
195 */ 195 */
196 public final String copyText(Rect area) { 196 public final String copyText(Rect area) {
197 StringBuilder sb = new StringBuilder(); 197 StringBuilder sb = new StringBuilder();
224 return sb.toString(); 224 return sb.toString();
225 } 225 }
226 226
227 /** 227 /**
228 * Copy & Paste support 228 * Copy & Paste support
229 * 229 *
230 * @param content 230 * @param content
231 * @see {@link #copyText(Rectangle)} 231 * @see {@link #copyText(Rectangle)}
232 */ 232 */
233 public final void pasteText(String content, boolean special) { 233 public final void pasteText(String content, boolean special) {
234 if (log.isDebugEnabled()) { 234 if (log.isDebugEnabled()) {
313 313
314 } 314 }
315 315
316 /** 316 /**
317 * Copy & Paste support 317 * Copy & Paste support
318 * 318 *
319 * @param position 319 * @param position
320 * @return 320 * @return
321 * @see {@link #copyText(int)} 321 * @see {@link #copyText(int)}
322 */ 322 */
323 public final String copyTextField(int position) { 323 public final String copyTextField(int position) {
454 aidFlag = false; 454 aidFlag = false;
455 455
456 if (planes.getChar(pos + 1) != '=' 456 if (planes.getChar(pos + 1) != '='
457 && planes.getChar(pos + 1) != '.' 457 && planes.getChar(pos + 1) != '.'
458 && planes.getChar(pos + 1) != '/') { 458 && planes.getChar(pos + 1) != '/') {
459 // System.out.println(" Hotspot clicked!!! we will send 459 log.debug(" Hotspot clicked!!! we will send characters "
460 // characters " + 460 + planes.getChar(pos) + " " + planes.getChar(pos+1));
461 // screen[pos].getChar() +
462 // screen[pos+1].getChar());
463 aid.append(planes.getChar(pos)); 461 aid.append(planes.getChar(pos));
464 aid.append(planes.getChar(pos + 1)); 462 aid.append(planes.getChar(pos + 1));
465 } else { 463 } else {
466 log.debug(" Hotspot clicked!!! we will send character " 464 log.debug(" Hotspot clicked!!! we will send character "
467 + planes.getChar(pos)); 465 + planes.getChar(pos));
1893 1891
1894 if (endPos == fePos) { 1892 if (endPos == fePos) {
1895 1893
1896 return endPos; 1894 return endPos;
1897 1895
1898 } 1896 }
1899 screenFields.getCurrentField().getKeyPos(endPos); 1897 screenFields.getCurrentField().getKeyPos(endPos);
1900 if (posSpace) screenFields.getCurrentField().changePos(+1); 1898 if (posSpace) screenFields.getCurrentField().changePos(+1);
1901 return screenFields.getCurrentFieldPos(); 1899 return screenFields.getCurrentFieldPos();
1902 1900
1903 } 1901 }
3153 /* int lines = direction & 0x7F; */ 3151 /* int lines = direction & 0x7F; */
3154 // get the direction of the roll which is the first bit 3152 // get the direction of the roll which is the first bit
3155 // 0 - up 3153 // 0 - up
3156 // 1 - down 3154 // 1 - down
3157 int updown = direction & 0x80; 3155 int updown = direction & 0x80;
3158 final int lines = direction & 0x7F; 3156 final int lines = direction & 0x7F;
3159 3157
3160 // calculate the reference points for the move. 3158 // calculate the reference points for the move.
3161 int start = this.getPos(topLine - 1, 0); 3159 int start = this.getPos(topLine - 1, 0);
3162 int end = this.getPos(bottomLine - 1, numCols - 1); 3160 int end = this.getPos(bottomLine - 1, numCols - 1);
3163 int len = end - start; 3161 int len = end - start;
3181 for (int x = end + numCols; x > 0; x--) { 3179 for (int x = end + numCols; x > 0; x--) {
3182 if ((x - lines * numCols ) < 0 ) { 3180 if ((x - lines * numCols ) < 0 ) {
3183 //Do nothing ... tooo small!!! 3181 //Do nothing ... tooo small!!!
3184 } else { 3182 } else {
3185 planes.setChar(x - lines * numCols, planes.getChar(x)); 3183 planes.setChar(x - lines * numCols, planes.getChar(x));
3186 //and clear 3184 //and clear
3187 planes.setChar(x, ' '); 3185 planes.setChar(x, ' ');
3188 } 3186 }
3189 } 3187 }
3190 break; 3188 break;
3191 default: 3189 default:
3502 } 3500 }
3503 fireScreenChanged(1); 3501 fireScreenChanged(1);
3504 3502
3505 } 3503 }
3506 3504
3507 public boolean checkHotSpots() {
3508
3509 return planes.checkHotSpots();
3510 }
3511
3512 protected void setChar(int cByte) { 3505 protected void setChar(int cByte) {
3513 if (lastPos > 0) { 3506 if (lastPos > 0) {
3514 lastAttr = planes.getCharAttr(lastPos - 1); 3507 lastAttr = planes.getCharAttr(lastPos - 1);
3515 } 3508 }
3516 if (cByte > 0 && (char)cByte < ' ') { 3509 if (cByte > 0 && (char)cByte < ' ') {