tn5250j/src/org/tn5250j ScreenPlanes.java,1.3,1.4

"Kenneth J. Pouncey" <[email protected]> Mon, 12 Jul 2004 04:22:25 +0000
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-serv31196/src/org/tn5250j

Modified Files:
	ScreenPlanes.java 
Log Message:
Fixed error line to work correctly.

Index: ScreenPlanes.java
===================================================================
RCS file: /cvsroot/tn5250j/tn5250j/src/org/tn5250j/ScreenPlanes.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** ScreenPlanes.java	11 Jul 2004 09:17:58 -0000	1.3
--- ScreenPlanes.java	12 Jul 2004 04:22:23 -0000	1.4
***************
*** 39,45 ****
  
     protected char[] screen;   // text plane
!    protected int[] screenAttr;   // attribute plane
     protected char[] screenGUI;   // gui plane
!    protected boolean[] screenIsAttr;
     protected char[] fieldExtended;
     protected char[] screenField;
--- 39,45 ----
  
     protected char[] screen;   // text plane
!    protected char[] screenAttr;   // attribute plane
     protected char[] screenGUI;   // gui plane
!    protected char[] screenIsAttr;
     protected char[] fieldExtended;
     protected char[] screenField;
***************
*** 49,54 ****
  
     protected char[] errorLine;
!    protected int[] errorLineAttr;
!    protected boolean[] errorLineIsAttr;
  
     public ScreenPlanes(Screen5250 s5250, int size) {
--- 49,54 ----
  
     protected char[] errorLine;
!    protected char[] errorLineAttr;
!    protected char[] errorLineIsAttr;
  
     public ScreenPlanes(Screen5250 s5250, int size) {
***************
*** 80,85 ****
        screenSize = numRows * numCols;
        screen = new char[screenSize];
!       screenAttr = new int[screenSize];
!       screenIsAttr = new boolean[screenSize];
        screenGUI = new char[screenSize];
        screenColor = new char[screenSize];
--- 80,85 ----
        screenSize = numRows * numCols;
        screen = new char[screenSize];
!       screenAttr = new char[screenSize];
!       screenIsAttr = new char[screenSize];
        screenGUI = new char[screenSize];
        screenColor = new char[screenSize];
***************
*** 120,125 ****
        if (errorLine == null) {
           errorLine = new char[numCols];
!          errorLineAttr = new int[numCols];
!          errorLineIsAttr = new boolean[numCols];
  
           int r = scr.getPos(errorLineNum-1,0);
--- 120,125 ----
        if (errorLine == null) {
           errorLine = new char[numCols];
!          errorLineAttr = new char[numCols];
!          errorLineIsAttr = new char[numCols];
  
           int r = scr.getPos(errorLineNum-1,0);
***************
*** 146,150 ****
  //				screen[r + x].setCharAndAttr(errorLine[x].getChar(),
  //						errorLine[x].getCharAttr(), false);
!             this.setScreenCharAndAttr(r+x,errorLine[x],errorLineAttr[x],errorLineIsAttr[x]);
  			}
  			errorLine = null;
--- 146,151 ----
  //				screen[r + x].setCharAndAttr(errorLine[x].getChar(),
  //						errorLine[x].getCharAttr(), false);
!             setScreenCharAndAttr(r+x,errorLine[x],errorLineAttr[x],
!                   					(errorLineIsAttr[x] == '1' ? true : false));
  			}
  			errorLine = null;
***************
*** 155,159 ****
  
     protected boolean isErrorLineSaved() {
!       return errorLine == null ? true : false;
     }
  
--- 156,160 ----
  
     protected boolean isErrorLineSaved() {
!       return errorLine == null ? false : true;
     }
  
***************
*** 161,167 ****
  
        screen[pos] = c;
!       screenAttr[pos] = attr;
        disperseAttribute(pos,attr);
!       screenIsAttr[pos] = isAttr;
        screenGUI[pos] = initChar;
  
--- 162,168 ----
  
        screen[pos] = c;
!       screenAttr[pos] = (char)attr;
        disperseAttribute(pos,attr);
!       screenIsAttr[pos] = (isAttr ? '1' : '0');
        screenGUI[pos] = initChar;
  
***************
*** 170,175 ****
     protected void setScreenAttr(int pos, int attr, boolean isAttr) {
  
!       screenAttr[pos] = attr;
!       screenIsAttr[pos] = isAttr;
        disperseAttribute(pos,attr);
        screenGUI[pos] = initChar;
--- 171,176 ----
     protected void setScreenAttr(int pos, int attr, boolean isAttr) {
  
!       screenAttr[pos] = (char)attr;
!       screenIsAttr[pos] = isAttr ? '1' : '0';
        disperseAttribute(pos,attr);
        screenGUI[pos] = initChar;
***************
*** 179,183 ****
     protected void setScreenAttr(int pos, int attr) {
  
!       screenAttr[pos] = attr;
        screenGUI[pos] = initChar;
        disperseAttribute(pos,attr);
--- 180,184 ----
     protected void setScreenAttr(int pos, int attr) {
  
!       screenAttr[pos] = (char)attr;
        screenGUI[pos] = initChar;
        disperseAttribute(pos,attr);
***************
*** 190,194 ****
        //         System.out.println(sChar[0] + " - " + c);
        screen[pos] = c;
!       if (screenIsAttr[pos])
           setScreenCharAndAttr(pos,c,32,false);
  
--- 191,195 ----
        //         System.out.println(sChar[0] + " - " + c);
        screen[pos] = c;
!       if (screenIsAttr[pos] == '1')
           setScreenCharAndAttr(pos,c,32,false);
  
***************
*** 204,208 ****
  
     protected final boolean isAttributePlace(int pos) {
!       return screenIsAttr[pos];
     }
  
--- 205,209 ----
  
     protected final boolean isAttributePlace(int pos) {
!       return screenIsAttr[pos] == '1' ? true : false;
     }
  
***************
*** 262,265 ****
--- 263,269 ----
              System.arraycopy(screen, from, planeChars, 0, len);
              break;
+          case PLANE_ATTR:
+             System.arraycopy(screenAttr, from, planeChars, 0, len);
+             break;
           case PLANE_COLOR:
  //            fillColorPlane(planeChars,from,len);
***************
*** 331,504 ****
     }
  
-    private void fillColorPlane(char[] plane,int start,int len) {
- 
-       for (int x = 0; x < len; x++ ) {
-          if (screenIsAttr[start + x])
-             plane[x] = '\u0000';
-          else
-             plane[x] = getColorPlaneCode(screenAttr[start+x]);
- 
-       }
- 
- 
-    }
- 
-    private char getColorPlaneCode(int cpc) {
- 
- 
-       char c = '\u0000';
- 
- //      switch (cpc) {
- //         case 32:  // green/normal
- //            c = (OhioConstants.OS_OHIO_COLOR_BG_BLACK << 8 & 0xff00) |
- //            (OhioConstants.OS_OHIO_COLOR_FG_GREEN & 0xff);
- //            break;
- //
- //         case 33: // green/revers
- //            c = (OhioConstants.OS_OHIO_COLOR_BG_GREEN << 8 & 0xff00) |
- //            (OhioConstants.OS_OHIO_COLOR_FG_BLACK & 0xff);
- //            break;
- //
- //         case 34: // white normal
- //            c = (OhioConstants.OS_OHIO_COLOR_BG_BLACK << 8 & 0xff00) |
- //            (OhioConstants.OS_OHIO_COLOR_FG_WHITE & 0xff);
- //
- //            break;
- //
- //         case 35: // white/reverse
- //            c = (OhioConstants.OS_OHIO_COLOR_BG_WHITE << 8 & 0xff00) |
- //            (OhioConstants.OS_OHIO_COLOR_FG_BLACK & 0xff);
- //
- //            break;
- //
- //         case 36: // green/underline
- //            c = (OhioConstants.OS_OHIO_COLOR_BG_BLACK << 8 & 0xff00) |
- //            (OhioConstants.OS_OHIO_COLOR_FG_GREEN & 0xff);
- //            break;
- //
- //         case 37: // green/reverse/underline
- //            c = (OhioConstants.OS_OHIO_COLOR_BG_GREEN << 8 & 0xff00) |
- //            (OhioConstants.OS_OHIO_COLOR_FG_BLACK & 0xff);
- //            break;
- //
- //         case 38: // white/underline
- //            c = (OhioConstants.OS_OHIO_COLOR_BG_BLACK << 8 & 0xff00) |
- //            (OhioConstants.OS_OHIO_COLOR_FG_WHITE & 0xff);
- //            break;
- //
- //         case 40:
- //         case 42: // red/normal
- //         case 44:
- //         case 46: // red/underline
- //            c = (OhioConstants.OS_OHIO_COLOR_BG_BLACK << 8 & 0xff00) |
- //            (OhioConstants.OS_OHIO_COLOR_FG_RED & 0xff);
- //            break;
- //
- //         case 41:
- //         case 43: // red/reverse
- //         case 45: // red/reverse
- //            c = (OhioConstants.OS_OHIO_COLOR_BG_RED << 8 & 0xff00) |
- //            (OhioConstants.OS_OHIO_COLOR_FG_BLACK & 0xff);
- //
- //            break;
- //
- //         case 48:  // turquoise
- //            c = (OhioConstants.OS_OHIO_COLOR_BG_BLACK << 8 & 0xff00) |
- //            (OhioConstants.OS_OHIO_COLOR_FG_CYAN & 0xff);
- //            break;
- //
- //         case 49:  // turquoise/reverse
- //            c = (OhioConstants.OS_OHIO_COLOR_BG_CYAN << 8 & 0xff00) |
- //            (OhioConstants.OS_OHIO_COLOR_FG_BLACK & 0xff);
- //
- //            break;
- //
- //         case 50:  // yellow
- //            c = (OhioConstants.OS_OHIO_COLOR_BG_BLACK << 8 & 0xff00) |
- //            (OhioConstants.OS_OHIO_COLOR_FG_YELLOW & 0xff);
- //
- //            break;
- //
- //         case 51: // yellow/reverse
- //            c = (OhioConstants.OS_OHIO_COLOR_BG_YELLOW << 8 & 0xff00) |
- //            (OhioConstants.OS_OHIO_COLOR_FG_BLACK & 0xff);
- //
- //            break;
- //
- //         case 52:  // turquoise/underline
- //            c = (OhioConstants.OS_OHIO_COLOR_BG_BLACK << 8 & 0xff00) |
- //            (OhioConstants.OS_OHIO_COLOR_FG_CYAN & 0xff);
- //            break;
- //
- //         case 53:  // turquoise/underline/reverse
- //            c = (OhioConstants.OS_OHIO_COLOR_BG_CYAN << 8 & 0xff00) |
- //            (OhioConstants.OS_OHIO_COLOR_FG_BLACK & 0xff);
- //
- //            break;
- //
- //         case 54:  // yellow
- //            c = (OhioConstants.OS_OHIO_COLOR_BG_BLACK << 8 & 0xff00) |
- //            (OhioConstants.OS_OHIO_COLOR_FG_YELLOW & 0xff);
- //
- //            break;
- //
- //         case 56: // pink
- //            c = (OhioConstants.OS_OHIO_COLOR_BG_BLACK << 8 & 0xff00) |
- //            (OhioConstants.OS_OHIO_COLOR_FG_MAGENTA & 0xff);
- //
- //            break;
- //
- //         case 57: // pink/reverse
- //            c = (OhioConstants.OS_OHIO_COLOR_BG_MAGENTA << 8 & 0xff00) |
- //            (OhioConstants.OS_OHIO_COLOR_FG_BLACK & 0xff);
- //
- //            break;
- //
- //         case 58: // blue
- //            c = (OhioConstants.OS_OHIO_COLOR_BG_BLACK << 8 & 0xff00) |
- //            (OhioConstants.OS_OHIO_COLOR_FG_BLUE & 0xff);
- //
- //            break;
- //
- //         case 59: // blue
- //            c = (OhioConstants.OS_OHIO_COLOR_BG_BLUE << 8 & 0xff00) |
- //            (OhioConstants.OS_OHIO_COLOR_FG_BLACK & 0xff);
- //
- //            break;
- //
- //         case 60: // pink/underline
- //            c = (OhioConstants.OS_OHIO_COLOR_BG_BLACK << 8 & 0xff00) |
- //            (OhioConstants.OS_OHIO_COLOR_FG_MAGENTA & 0xff);
- //
- //            break;
- //
- //         case 61: // pink/reverse/underline
- //            c = (OhioConstants.OS_OHIO_COLOR_BG_MAGENTA << 8 & 0xff00) |
- //            (OhioConstants.OS_OHIO_COLOR_FG_BLACK & 0xff);
- //
- //            break;
- //
- //         case 62: // blue/underline
- //            c = (OhioConstants.OS_OHIO_COLOR_BG_BLACK << 8 & 0xff00) |
- //            (OhioConstants.OS_OHIO_COLOR_FG_BLUE & 0xff);
- //            break;
- //
- //         default:
- //            c = (OhioConstants.OS_OHIO_COLOR_BG_BLACK << 8 & 0xff00) |
- //            (OhioConstants.OS_OHIO_COLOR_FG_BLACK & 0xff);
- //
- //      }
- 
-       return c;
-    }
- 
-    private void fillExtendedGraphicPlane(char[] plane,int start,int len) {
- 
-       for (int x = 0; x < len; x++ ) {
-          plane[x] = (char)screenGUI[start + x];
-       }
- 
- 
-    }
  
     private void fillExtendedFieldPlane(char[] plane,int start,int len) {
--- 335,338 ----



-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com