tn5250j/src/org/tn5250j ScreenField.java,1.12,1.13 ScreenFields.java,1.14,1.15

[email protected] Tue, 17 Feb 2004 21:06:22 -0800
Newsgroups gmane.comp.java.tn5250j.cvs
Message-ID <[email protected]>
Update of /cvsroot/tn5250j/tn5250j/src/org/tn5250j
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16335

Modified Files:
	ScreenField.java ScreenFields.java 
Log Message:

Fix for Field Exit and Signed numeric fields


Index: ScreenField.java
===================================================================
RCS file: /cvsroot/tn5250j/tn5250j/src/org/tn5250j/ScreenField.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** ScreenField.java	15 Feb 2004 12:55:49 -0000	1.12
--- ScreenField.java	18 Feb 2004 05:06:20 -0000	1.13
***************
*** 223,226 ****
--- 223,227 ----
           changePos(1);
        }
+ 
     }
  
***************
*** 364,367 ****
--- 365,381 ----
        int adj = getAdjustment();
  
+       // here we need to check the Field Exit Required value first before checking
+       //   the adjustments.  If the last character has been entered and we are
+       //   now setting past the last position then we are allowed to process the
+       //   the field without continuing.
+       if (isFER() && cursorPos > endPos) {
+          return true;
+       }
+ 
+       // signed numeric fields need to be checked as well.
+       if (isSignedNumeric() && cursorPos < endPos - 1) {
+          return false;
+       }
+ 
        if (adj  > 0) {
  

Index: ScreenFields.java
===================================================================
RCS file: /cvsroot/tn5250j/tn5250j/src/org/tn5250j/ScreenFields.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** ScreenFields.java	17 Jun 2003 06:31:47 -0000	1.14
--- ScreenFields.java	18 Feb 2004 05:06:20 -0000	1.15
***************
*** 158,166 ****
      */
     public boolean isCanSendAid() {
-       if (currentField != null &&
  
!             currentField.getAdjustment() > 0 &&
!             currentModified &&
!             !currentField.isCanSend())
  
           return false;
--- 158,167 ----
      */
     public boolean isCanSendAid() {
  
!       // We also have to check if we are still in the field.
!       if (currentField != null &&
!             (currentField.getAdjustment() > 0 || currentField.isSignedNumeric())
!              && currentModified && isInField()
!             && !currentField.isCanSend())
  
           return false;



-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click