tn5250j/src/org/tn5250j ScreenField.java,1.13,1.14 GuiGraphicBuffer.java,1.22,1.23 tnvt.java,1.48,1.49 Screen5250.java,1.68,1.69 PrinterThread.java,1.10,1.11

"Kenneth J. Pouncey" <[email protected]> Fri, 09 Jul 2004 04:34:01 +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-serv22838/src/org/tn5250j

Modified Files:
	ScreenField.java GuiGraphicBuffer.java tnvt.java 
	Screen5250.java PrinterThread.java 
Log Message:
first part Phase III of headless changes.  Change to use screen planes

Index: PrinterThread.java
===================================================================
RCS file: /cvsroot/tn5250j/tn5250j/src/org/tn5250j/PrinterThread.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** PrinterThread.java	26 Jan 2004 10:46:37 -0000	1.10
--- PrinterThread.java	9 Jul 2004 04:33:59 -0000	1.11
***************
*** 33,37 ****
  public class PrinterThread extends Thread implements Printable {
  
!    ScreenChar[] screen;
     int numCols;
     int numRows;
--- 33,37 ----
  public class PrinterThread extends Thread implements Printable {
  
!    char[] screen;
     int numCols;
     int numRows;
***************
*** 42,46 ****
     SessionConfig config;
  
!    public PrinterThread (ScreenChar[] sc, Font font, int cols, int rows,
                             Color colorBg, boolean toDefaultPrinter, Session ses) {
  
--- 42,46 ----
     SessionConfig config;
  
!    public PrinterThread (char[] sc, Font font, int cols, int rows,
                             Color colorBg, boolean toDefaultPrinter, Session ses) {
  
***************
*** 51,63 ****
        config = ses.getConfiguration();
  
!       screen = new ScreenChar[sc.length];
        toDefault = toDefaultPrinter;
  
        int len = sc.length;
  
!       for (int x = 0; x < len; x++) {
!          screen[x] = new ScreenChar(sc[x].s);
!          screen[x].setCharAndAttr(sc[x].getChar(),sc[x].getCharAttr(),sc[x].isAttributePlace());
!       }
  
        numCols = cols;
--- 51,65 ----
        config = ses.getConfiguration();
  
!       screen = new char[sc.length];
! 		System.arraycopy(sc, 0, screen, 0, sc.length);
        toDefault = toDefaultPrinter;
  
        int len = sc.length;
  
!       // we need to fix this to use the access methods to planes
! //      for (int x = 0; x < len; x++) {
! //         screen[x] = new ScreenChar(sc[x].s);
! //         screen[x].setCharAndAttr(sc[x].getChar(),sc[x].getCharAttr(),sc[x].isAttributePlace());
! //      }
  
        numCols = cols;
***************
*** 167,177 ****
        session = null;
  
!       int len = screen.length;
! 
!       for (int x = 0; x < len; x++) {
!          screen[x] = null;
!       }
! 
!       screen = null;
  
     }
--- 169,179 ----
        session = null;
  
! //      int len = screen.length;
! //
! //      for (int x = 0; x < len; x++) {
! //         screen[x] = null;
! //      }
! //
! //      screen = null;
  
     }
***************
*** 253,264 ****
  
                 // only draw printable characters (in this case >= ' ')
!                if (screen[getPos(m,i)].getChar() >= ' ' && !screen[getPos(m,i)].nonDisplay) {
  
!                   g2.drawChars(screen[getPos(m,i)].sChar, 0, 1,x , (int)(y + h1 - (l.getDescent() + l.getLeading())-2));
  
                 }
                 // if it is underlined then underline the character
!                if (screen[getPos(m,i)].underLine && !screen[getPos(m,i)].attributePlace)
!                   g.drawLine(x, (int)(y + (h1 - l.getLeading()-3)), (int)(x + w1), (int)(y + (h1 - l.getLeading())-3));
  
              }
--- 255,271 ----
  
                 // only draw printable characters (in this case >= ' ')
! //               if (screen[getPos(m,i)].getChar() >= ' ' && !screen[getPos(m,i)].nonDisplay) {
!                //  TODO:  Fix me for detecting non display
!                if (screen[getPos(m,i)] >= ' ') {  // && !screen[getPos(m,i)].nonDisplay) {
  
! //                  g2.drawChars(screen[getPos(m,i)], 0, 1,x , (int)(y + h1 - (l.getDescent() + l.getLeading())-2));
!                   g2.drawChars(screen, getPos(m,i), 1,x , (int)(y + h1 - (l.getDescent() + l.getLeading())-2));
  
                 }
+ 
+                //  TODO:  Fix me for detecting non display
                 // if it is underlined then underline the character
! //               if (screen[getPos(m,i)].underLine && !screen[getPos(m,i)].attributePlace)
! //                  g.drawLine(x, (int)(y + (h1 - l.getLeading()-3)), (int)(x + w1), (int)(y + (h1 - l.getLeading())-3));
  
              }

Index: tnvt.java
===================================================================
RCS file: /cvsroot/tn5250j/tn5250j/src/org/tn5250j/tnvt.java,v
retrieving revision 1.48
retrieving revision 1.49
diff -C2 -d -r1.48 -r1.49
*** tnvt.java	6 Jul 2004 05:57:36 -0000	1.48
--- tnvt.java	9 Jul 2004 04:33:58 -0000	1.49
***************
*** 813,817 ****
  	   screen52.getOIA().setInputInhibited(ScreenOIA.INPUTINHIBITED_SYSTEM_WAIT,
  	         ScreenOIA.OIA_LEVEL_INPUT_INHIBITED);
! 		
  		// From client access ip capture
  		// it seems to use an operation code of 3 and 4
--- 813,817 ----
  	   screen52.getOIA().setInputInhibited(ScreenOIA.INPUTINHIBITED_SYSTEM_WAIT,
  	         ScreenOIA.OIA_LEVEL_INPUT_INHIBITED);
! 
  		// From client access ip capture
  		// it seems to use an operation code of 3 and 4
***************
*** 972,979 ****
  		//     System.out.println("Checking command : " +
  		// screen52.screen[1].getChar() + screen52.screen[2].getChar());
! 		ScreenChar[] screen = screen52.screen;
! 		if ((screen[STRSCAN].getChar() == '#')
! 				&& (screen[STRSCAN + 1].getChar() == '!')
! 				&& (screen[STRSCAN + 2].getChar() != ' ')) {
  			try {
  				parseCommand();
--- 972,982 ----
  		//     System.out.println("Checking command : " +
  		// screen52.screen[1].getChar() + screen52.screen[2].getChar());
! 
! //		ScreenChar[] screen = screen52.screen;
!       ScreenPlanes planes = screen52.getPlanes();
! 
! 		if ((planes.getChar(STRSCAN) == '#')
! 				&& (planes.getChar(STRSCAN + 1) == '!')
! 				&& (planes.getChar(STRSCAN + 2) != ' ')) {
  			try {
  				parseCommand();
***************
*** 1299,1310 ****
  		int sac = 0;
  		int len = rows * cols;
  		for (int y = 0; y < len; y++) { // save the screen data
  
! 			if (screen52.screen[y].isAttributePlace()) {
! 				la = screen52.screen[y].getCharAttr();
  				sa[sac++] = (byte) la;
  			} else {
! 				if (screen52.screen[y].getCharAttr() != la) {
! 					la = screen52.screen[y].getCharAttr();
  					sac--;
  					sa[sac++] = (byte) la;
--- 1302,1336 ----
  		int sac = 0;
  		int len = rows * cols;
+ 
+       ScreenPlanes planes = screen52.planes;
+ 
  		for (int y = 0; y < len; y++) { // save the screen data
  
! //			if (screen52.screen[y].isAttributePlace()) {
! //				la = screen52.screen[y].getCharAttr();
! //				sa[sac++] = (byte) la;
! //			} else {
! //				if (screen52.screen[y].getCharAttr() != la) {
! //					la = screen52.screen[y].getCharAttr();
! //					sac--;
! //					sa[sac++] = (byte) la;
! //				}
! //				//LDC: Check to see if it is an displayable character. If not,
! //				//  do not convert the character.
! //				//  The characters on screen are in unicode
! //				//sa[sac++] =
! //				// (byte)codePage.uni2ebcdic(screen52.screen[y].getChar());
! //				char ch = screen52.screen[y].getChar();
! //				byte byteCh = (byte) ch;
! //				if (isDataUnicode(ch))
! //					byteCh = this.uni2ebcdic(ch);
! //				sa[sac++] = byteCh;
! //			}
! 			if (planes.isAttributePlace(y)) {
! 				la = planes.getCharAttr(y);
  				sa[sac++] = (byte) la;
  			} else {
! 				if (planes.getCharAttr(y) != la) {
! 					la = planes.getCharAttr(y);
  					sac--;
  					sa[sac++] = (byte) la;
***************
*** 1315,1319 ****
  				//sa[sac++] =
  				// (byte)codePage.uni2ebcdic(screen52.screen[y].getChar());
! 				char ch = screen52.screen[y].getChar();
  				byte byteCh = (byte) ch;
  				if (isDataUnicode(ch))
--- 1341,1345 ----
  				//sa[sac++] =
  				// (byte)codePage.uni2ebcdic(screen52.screen[y].getChar());
! 				char ch = planes.getChar(y);
  				byte byteCh = (byte) ch;
  				if (isDataUnicode(ch))
***************
*** 1404,1407 ****
--- 1430,1436 ----
  	public final void restoreScreen() throws IOException {
  		int which = 0;
+ 
+       ScreenPlanes planes = screen52.planes;
+ 
  		try {
  			log.debug("Restore ");
***************
*** 1426,1431 ****
  				b = bk.getNextByte();
  				if (isAttribute(b)) {
! 					screen52.screen[y].setCharAndAttr(screen52.screen[y]
! 							.getChar(), b, true);
  					la = b;
  
--- 1455,1461 ----
  				b = bk.getNextByte();
  				if (isAttribute(b)) {
! //					screen52.screen[y].setCharAndAttr(screen52.screen[y]
! //							.getChar(), b, true);
! 					planes.setScreenCharAndAttr(y, planes.getChar(y), b, true);
  					la = b;
  
***************
*** 1439,1445 ****
  						ch = ebcdic2uni(b);
  
! 					screen52.screen[y].setCharAndAttr(
! 					//getASCIIChar(b),
! 							ch, la, false);
  				}
  			}
--- 1469,1476 ----
  						ch = ebcdic2uni(b);
  
! //					screen52.screen[y].setCharAndAttr(
! //					//getASCIIChar(b),
! //							ch, la, false);
! 					planes.setScreenCharAndAttr(y, ch, la, false);
  				}
  			}
***************
*** 3263,3278 ****
  	}
  
! 	public void dumpScreen() {
! 
! 		for (int y = 0; y < screen52.getRows(); y++) {
! 			System.out.print("row :" + (y + 1) + " ");
! 
! 			for (int x = 0; x < screen52.getCols(); x++) {
! 				System.out.println("row " + (y + 1) + " col " + (x + 1) + " "
! 						+ screen52.screen[y * x].toString());
! 
! 			}
! 		}
! 	}
  
  	// negotiating commands
--- 3294,3313 ----
  	}
  
! //      public void dumpScreen() {
! //
! //         for (int y = 0; y < screen52.getRows(); y++) {
! //            System.out.print("row :" + (y + 1) + " ");
! //
! //   //			for (int x = 0; x < screen52.getCols(); x++) {
! //   //				System.out.println("row " + (y + 1) + " col " + (x + 1) + " "
! //   //						+ screen52.screen[y * x].toString());
! //         // implement this part to create a string from a character.
! //   //			for (int x = 0; x < screen52.getCols(); x++) {
! //   //				System.out.println("row " + (y + 1) + " col " + (x + 1) + " "
! //   //						+ screen52.planes.getChar(y * x).toString());
! //
! //            }
! //         }
! //      }
  
  	// negotiating commands

Index: GuiGraphicBuffer.java
===================================================================
RCS file: /cvsroot/tn5250j/tn5250j/src/org/tn5250j/GuiGraphicBuffer.java,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -d -r1.22 -r1.23
*** GuiGraphicBuffer.java	7 Jul 2004 04:15:07 -0000	1.22
--- GuiGraphicBuffer.java	9 Jul 2004 04:33:58 -0000	1.23
***************
*** 1,5 ****
- package org.tn5250j;
  /**
!  * Title: tn5250J
   * Copyright:   Copyright (c) 2001
   * Company:
--- 1,4 ----
  /**
!  * Title: GuiGraphicBuffer.java
   * Copyright:   Copyright (c) 2001
   * Company:
***************
*** 25,28 ****
--- 24,28 ----
   *
   */
+ package org.tn5250j;
  
  import java.awt.image.*;
***************
*** 543,547 ****
  			while (cols-- >= 0) {
  				if (lc >= 0 && lc < lenScreen) {
! 					drawChar(gg2d,screen.screen[lc],screen.getRow(lc),screen.getCol(lc));
                 lc++;
  				}
--- 543,548 ----
  			while (cols-- >= 0) {
  				if (lc >= 0 && lc < lenScreen) {
! //					drawChar(gg2d,screen.screen[lc],screen.getRow(lc),screen.getCol(lc));
! 					drawChar(gg2d,lc,screen.getRow(lc),screen.getCol(lc));
                 lc++;
  				}
***************
*** 549,553 ****
  			lr += numCols;
  		}
! 
     }
  
--- 550,554 ----
  			lr += numCols;
  		}
! //      screen.dumpScreen();
     }
  
***************
*** 1105,1107 ****
--- 1106,1683 ----
     }
  
+    Rectangle csArea = new Rectangle();
+    char sChar[] = new char[1];
+    // Dup Character array for display output
+    public static final transient char[] dupChar = {'*'};
+    public final void drawChar(Graphics2D g, int pos, int row, int col) {
+ 
+       Screen5250 s = screen;
+       ScreenPlanes planes = s.planes;
+ 
+       int attr = planes.getCharAttr(pos);
+       sChar[0] = planes.getChar(pos);
+       setCharAttr(attr);
+       boolean attributePlace = planes.isAttributePlace(pos);
+       boolean useGui = planes.isUseGui(pos);
+       int whichGui = planes.getWhichGUI(pos);
+ 
+       csArea.setRect((s.fmWidth*col),s.fmHeight * row,s.fmWidth,s.fmHeight);
+ 
+       int x = s.fmWidth * col;
+       int y = s.fmHeight * row;
+       int cy = (int)(y + s.fmHeight - (s.lm.getDescent() + s.lm.getLeading()));
+ 
+ //      int x = sc.x;
+ //      int y = sc.y;
+ //      int cy = sc.cy;
+ 
+       if (attributePlace && s.isShowHex()) {
+ //      if ((sc.sChar[0] == 0x20 || sc.sChar[0] == 0x0 || nonDisplay) && s.isShowHex()) {
+          Font f = g.getFont();
+ 
+          Font k = f.deriveFont(f.getSize2D()/2);
+          g.setFont(k);
+          g.setColor(s.colorHexAttr);
+          char[] a = Integer.toHexString(attr).toCharArray();
+          g.drawChars(a, 0, 1, x, y + (int)(s.fmHeight /2));
+          g.drawChars(a, 1, 1, x+(int)(s.fmWidth/2),
+             (int)(y + s.fmHeight - (s.lm.getDescent() + s.lm.getLeading())-2));
+          g.setFont(f);
+ //return;
+       }
+ 
+       if(!nonDisplay && !attributePlace) {
+ 
+          if (!useGui) {
+             g.setColor(bg);
+             g.fill(csArea);
+          }
+          else {
+ 
+             if (bg == s.colorBg && whichGui >= FIELD_LEFT && whichGui <= FIELD_ONE)
+                g.setColor(s.colorGUIField);
+             else
+                g.setColor(bg);
+ 
+             g.fill(csArea);
+ 
+          }
+ 
+          if (useGui && (whichGui < FIELD_LEFT)) {
+             int w = 0;
+ 
+             g.setColor(fg);
+ 
+             switch (whichGui) {
+ 
+                case UPPER_LEFT:
+                   if (sChar[0] == '.') {
+                      if (s.isUsingGuiInterface()) {
+                         GUIGraphicsUtils.drawWinUpperLeft(g,
+                                              GUIGraphicsUtils.WINDOW_GRAPHIC,
+                                              s.colorBlue,
+                                              x,y,s.fmWidth,s.fmHeight);
+ 
+                      }
+                      else {
+ 
+                         GUIGraphicsUtils.drawWinUpperLeft(g,
+                                              GUIGraphicsUtils.WINDOW_NORMAL,
+                                              fg,
+                                              x,y,s.fmWidth,s.fmHeight);
+ 
+                      }
+                   }
+                break;
+                case UPPER:
+                   if (sChar[0] == '.') {
+ 
+                      if (s.isUsingGuiInterface()) {
+                         GUIGraphicsUtils.drawWinUpper(g,
+                                              GUIGraphicsUtils.WINDOW_GRAPHIC,
+                                              s.colorBlue,
+                                              x,y,s.fmWidth,s.fmHeight);
+ 
+ 
+                      }
+                      else {
+ 
+                         GUIGraphicsUtils.drawWinUpper(g,
+                                              GUIGraphicsUtils.WINDOW_NORMAL,
+                                              fg,
+                                              x,y,s.fmWidth,s.fmHeight);
+                      }
+                   }
+                break;
+                case UPPER_RIGHT:
+                   if (sChar[0] == '.') {
+                      if (s.isUsingGuiInterface()) {
+ 
+                         GUIGraphicsUtils.drawWinUpperRight(g,
+                                              GUIGraphicsUtils.WINDOW_GRAPHIC,
+                                              s.colorBlue,
+                                              x,y,s.fmWidth,s.fmHeight);
+ 
+ 
+                      }
+                      else {
+ 
+                         GUIGraphicsUtils.drawWinUpperRight(g,
+                                              GUIGraphicsUtils.WINDOW_NORMAL,
+                                              fg,
+                                              x,y,s.fmWidth,s.fmHeight);
+ 
+                      }
+                   }
+                break;
+                case LEFT:
+                   if (sChar[0] == ':') {
+                      if (s.isUsingGuiInterface()) {
+                         GUIGraphicsUtils.drawWinLeft(g,
+                                              GUIGraphicsUtils.WINDOW_GRAPHIC,
+                                              bg,
+                                              x,y,s.fmWidth,s.fmHeight);
+ 
+ 
+                      }
+                      else {
+ 
+                         GUIGraphicsUtils.drawWinLeft(g,
+                                              GUIGraphicsUtils.WINDOW_NORMAL,
+                                              fg,
+                                              x,y,s.fmWidth,s.fmHeight);
+ 
+                         g.drawLine(x + s.fmWidth / 2,
+                                     y,
+                                     x + s.fmWidth / 2,
+                                     y + s.fmHeight);
+                      }
+                   }
+                break;
+                case RIGHT:
+                   if (sChar[0] == ':') {
+                      if (s.isUsingGuiInterface()) {
+                         GUIGraphicsUtils.drawWinRight(g,
+                                              GUIGraphicsUtils.WINDOW_GRAPHIC,
+                                              bg,
+                                              x,y,s.fmWidth,s.fmHeight);
+ 
+ 
+                      }
+                      else {
+                         GUIGraphicsUtils.drawWinRight(g,
+                                              GUIGraphicsUtils.WINDOW_NORMAL,
+                                              fg,
+                                              x,y,s.fmWidth,s.fmHeight);
+ 
+                      }
+                   }
+                break;
+                case LOWER_LEFT:
+                   if (sChar[0] == ':') {
+ 
+                      if (s.isUsingGuiInterface()) {
+ 
+                         GUIGraphicsUtils.drawWinLowerLeft(g,
+                                              GUIGraphicsUtils.WINDOW_GRAPHIC,
+                                              bg,
+                                              x,y,s.fmWidth,s.fmHeight);
+ 
+ 
+                      }
+                      else {
+ 
+                         GUIGraphicsUtils.drawWinLowerLeft(g,
+                                              GUIGraphicsUtils.WINDOW_NORMAL,
+                                              fg,
+                                              x,y,s.fmWidth,s.fmHeight);
+                      }
+                   }
+                break;
+                case BOTTOM:
+                   if (sChar[0] == '.') {
+ 
+                      if (s.isUsingGuiInterface()) {
+ 
+ 
+                         GUIGraphicsUtils.drawWinBottom(g,
+                                              GUIGraphicsUtils.WINDOW_GRAPHIC,
+                                              bg,
+                                              x,y,s.fmWidth,s.fmHeight);
+ 
+ 
+                      }
+                      else {
+ 
+                         GUIGraphicsUtils.drawWinBottom(g,
+                                              GUIGraphicsUtils.WINDOW_NORMAL,
+                                              fg,
+                                              x,y,s.fmWidth,s.fmHeight);
+                      }
+                   }
+                break;
+ 
+                case LOWER_RIGHT:
+                   if (sChar[0] == ':') {
+                      if (s.isUsingGuiInterface()) {
+ 
+                         GUIGraphicsUtils.drawWinLowerRight(g,
+                                              GUIGraphicsUtils.WINDOW_GRAPHIC,
+                                              bg,
+                                              x,y,s.fmWidth,s.fmHeight);
+ 
+                      }
+                      else {
+ 
+                         GUIGraphicsUtils.drawWinLowerRight(g,
+                                              GUIGraphicsUtils.WINDOW_NORMAL,
+                                              fg,
+                                              x,y,s.fmWidth,s.fmHeight);
+ 
+                      }
+                   }
+                break;
+ 
+             }
+          }
+ 
+          else {
+             if (sChar[0] != 0x0) {
+             // use this until we define colors for gui stuff
+                if ((useGui && whichGui < BUTTON_LEFT) && (fg == s.colorGUIField))
+ 
+                   g.setColor(Color.black);
+                else
+                   g.setColor(fg);
+ 
+                   try {
+                      if (useGui)
+ 
+                         if (sChar[0] == 0x1C)
+                            g.drawChars(dupChar, 0, 1, x+1, cy -2);
+                         else
+                            g.drawChars(sChar, 0, 1, x+1, cy -2);
+                      else
+                         if (sChar[0] == 0x1C)
+                            g.drawChars(dupChar, 0, 1, x, cy -2);
+                         else
+                            g.drawChars(sChar, 0, 1, x, cy -2);
+                   }
+                   catch (IllegalArgumentException iae) {
+                      System.out.println(" ScreenChar iae " + iae.getMessage());
+ 
+                   }
+             }
+             if(underLine ) {
+ 
+                if (!useGui || s.guiShowUnderline) {
+                   g.setColor(fg);
+ //                  g.drawLine(x, cy -2, (int)(x + s.fmWidth), cy -2);
+ //                  g.drawLine(x, (int)(y + (s.fmHeight - s.lm.getLeading()-5)), (int)(x + s.fmWidth), (int)(y + (s.fmHeight - s.lm.getLeading())-5));
+                   g.drawLine(x, (int)(y + (s.fmHeight - (s.lm.getLeading() + s.lm.getDescent()))), (int)(x + s.fmWidth), (int)(y + (s.fmHeight -(s.lm.getLeading() + s.lm.getDescent()))));
+ 
+                }
+             }
+ 
+             if(colSep) {
+                g.setColor(s.colorSep);
+                switch (s.getColSepLine()) {
+                   case 0:  // line
+                      g.drawLine(x, y, x, y + s.fmHeight - 1);
+                      g.drawLine(x + s.fmWidth - 1, y, x + s.fmWidth - 1, y + s.fmHeight);
+                      break;
+                   case 1:  // short line
+                      g.drawLine(x,  y + s.fmHeight - (int)s.lm.getLeading()-4, x, y + s.fmHeight);
+                      g.drawLine(x + s.fmWidth - 1, y + s.fmHeight - (int)s.lm.getLeading()-4, x + s.fmWidth - 1, y + s.fmHeight);
+                      break;
+                   case 2:  // dot
+                      g.drawLine(x,  y + s.fmHeight - (int)s.lm.getLeading()-3, x, y + s.fmHeight - (int)s.lm.getLeading()-4);
+                      g.drawLine(x + s.fmWidth - 1, y + s.fmHeight - (int)s.lm.getLeading()-3, x + s.fmWidth - 1, y + s.fmHeight - (int)s.lm.getLeading()-4);
+                      break;
+                   case 3:  // hide
+                      break;
+                }
+             }
+          }
+       }
+ 
+       if (useGui & (whichGui >= FIELD_LEFT)) {
+             int w = 0;
+ 
+             switch (whichGui) {
+ 
+                case FIELD_LEFT:
+                   GUIGraphicsUtils.draw3DLeft(g, GUIGraphicsUtils.INSET, x,y,
+                                              s.fmWidth,s.fmHeight);
+ 
+                break;
+                case FIELD_MIDDLE:
+                   GUIGraphicsUtils.draw3DMiddle(g, GUIGraphicsUtils.INSET, x,y,
+                                              s.fmWidth,s.fmHeight);
+                break;
+                case FIELD_RIGHT:
+                   GUIGraphicsUtils.draw3DRight(g, GUIGraphicsUtils.INSET, x,y,
+                                              s.fmWidth,s.fmHeight);
+                break;
+ 
+                case FIELD_ONE:
+                   GUIGraphicsUtils.draw3DOne(g, GUIGraphicsUtils.INSET, x,y,
+                                              s.fmWidth,s.fmHeight);
+ 
+                break;
+ 
+                case BUTTON_LEFT:
+                case BUTTON_LEFT_UP:
+                case BUTTON_LEFT_DN:
+                case BUTTON_LEFT_EB:
+ 
+                   GUIGraphicsUtils.draw3DLeft(g, GUIGraphicsUtils.RAISED, x,y,
+                                              s.fmWidth,s.fmHeight);
+ 
+                   break;
+ 
+                case BUTTON_MIDDLE:
+                case BUTTON_MIDDLE_UP:
+                case BUTTON_MIDDLE_DN:
+                case BUTTON_MIDDLE_EB:
+ 
+                   GUIGraphicsUtils.draw3DMiddle(g, GUIGraphicsUtils.RAISED, x,y,
+                                              s.fmWidth,s.fmHeight);
+                   break;
+ 
+                case BUTTON_RIGHT:
+                case BUTTON_RIGHT_UP:
+                case BUTTON_RIGHT_DN:
+                case BUTTON_RIGHT_EB:
+ 
+                   GUIGraphicsUtils.draw3DRight(g, GUIGraphicsUtils.RAISED, x,y,
+                                              s.fmWidth,s.fmHeight);
+ 
+                break;
+ 
+                // scroll bar
+                case BUTTON_SB_UP:
+                   GUIGraphicsUtils.drawScrollBar(g, GUIGraphicsUtils.RAISED, 1, x,y,
+                                              s.fmWidth,s.fmHeight,
+                                              s.colorWhite,s.colorBg);
+                   break;
+ 
+                // scroll bar
+                case BUTTON_SB_DN:
+ 
+                   GUIGraphicsUtils.drawScrollBar(g, GUIGraphicsUtils.RAISED, 2, x,y,
+                                              s.fmWidth,s.fmHeight,
+                                              s.colorWhite,s.colorBg);
+ 
+ 
+                   break;
+                // scroll bar
+                case BUTTON_SB_GUIDE:
+ 
+                   GUIGraphicsUtils.drawScrollBar(g, GUIGraphicsUtils.INSET, 0,x,y,
+                                              s.fmWidth,s.fmHeight,
+                                              s.colorWhite,s.colorBg);
+ 
+ 
+                   break;
+ 
+                // scroll bar
+                case BUTTON_SB_THUMB:
+ 
+                   GUIGraphicsUtils.drawScrollBar(g, GUIGraphicsUtils.INSET, 3,x,y,
+                                              s.fmWidth,s.fmHeight,
+                                              s.colorWhite,s.colorBg);
+ 
+ 
+                   break;
+ 
+             }
+          }
+ 
+    }
+ 
+    boolean      colSep = false;
+    boolean   underLine = false;
+    boolean   nonDisplay = false;
+    Color fg;
+    Color bg;
+ 
+    private void setCharAttr(int attr) {
+ 
+       Screen5250 s = screen;
+       colSep = false;
+       underLine = false;
+       nonDisplay = false;
+ 
+       switch(attr) {
+          case 32: // green normal
+             fg = s.colorGreen;
+             bg = s.colorBg;
+             break;
+ 
+          case 33: // green/revers
+             fg = s.colorBg;
+             bg = s.colorGreen;
+             break;
+ 
+          case 34: // white normal
+             fg = s.colorWhite;
+             bg = s.colorBg;
+             break;
+ 
+          case 35: // white/reverse
+             fg = s.colorBg;
+             bg = s.colorWhite;
+             break;
+ 
+          case 36: // green/underline
+             fg = s.colorGreen;
+             bg = s.colorBg;
+             underLine = true;
+             break;
+ 
+          case 37: // green/reverse/underline
+             fg = s.colorBg;
+             bg = s.colorGreen;
+             underLine = true;
+             break;
+ 
+          case 38: // white/underline
+             fg = s.colorWhite;
+             bg = s.colorBg;
+             underLine = true;
+             break;
+ 
+          case 39:
+             nonDisplay = true;
+             break;
+ 
+          case 40:
+          case 42: // red/normal
+             fg = s.colorRed;
+             bg = s.colorBg;
+             break;
+ 
+          case 41:
+          case 43: // red/reverse
+             fg = s.colorBg;
+             bg = s.colorRed;
+             break;
+ 
+          case 44:
+          case 46: // red/underline
+             fg = s.colorRed;
+             bg = s.colorBg;
+             underLine = true;
+             break;
+ 
+          case 45: // red/reverse/underline
+             fg = s.colorBg;
+             bg = s.colorRed;
+             underLine = true;
+             break;
+ 
+          case 47:
+             nonDisplay = true;
+             break;
+ 
+          case 48:
+             fg = s.colorTurq;
+             bg = s.colorBg;
+             colSep = true;
+             break;
+ 
+          case 49:
+             fg = s.colorBg;
+             bg = s.colorTurq;
+             colSep = true;
+             break;
+ 
+          case 50:
+             fg = s.colorYellow;
+             bg = s.colorBg;
+             colSep = true;
+             break;
+ 
+          case 51:
+             fg = s.colorBg;
+             bg = s.colorYellow;
+             colSep = true;
+             break;
+ 
+          case 52:
+             fg = s.colorTurq;
+             bg = s.colorBg;
+ //            colSep = true;
+             underLine = true;
+             break;
+ 
+          case 53:
+             fg = s.colorBg;
+             bg = s.colorTurq;
+ //            colSep = true;
+             underLine = true;
+             break;
+ 
+          case 54:
+             fg = s.colorYellow;
+             bg = s.colorBg;
+ //            colSep = true;
+             underLine = true;
+             break;
+ 
+          case 55:
+             nonDisplay = true;
+             break;
+ 
+          case 56: // pink
+             fg = s.colorPink;
+             bg = s.colorBg;
+             break;
+ 
+          case 57: // pink/reverse
+             fg = s.colorBg;
+             bg = s.colorPink;
+             break;
+ 
+          case 58: // blue/reverse
+             fg = s.colorBlue;
+             bg = s.colorBg;
+             break;
+ 
+          case 59: // blue
+             fg = s.colorBg;
+             bg = s.colorBlue;
+             break;
+ 
+          case 60: // pink/underline
+             fg = s.colorPink;
+             bg = s.colorBg;
+             underLine = true;
+             break;
+ 
+          case 61: // pink/reverse/underline
+             fg = s.colorBg;
+             bg = s.colorPink;
+             underLine = true;
+             break;
+ 
+          case 62: // blue/underline
+             fg = s.colorBlue;
+             bg = s.colorBg;
+             underLine = true;
+             break;
+ 
+          case 63:  // nondisplay
+             nonDisplay = true;
+             break;
+          default:
+             fg = s.colorYellow;
+             break;
+ 
+       }
+ 
+    }
+ 
+ 
  }
\ No newline at end of file

Index: ScreenField.java
===================================================================
RCS file: /cvsroot/tn5250j/tn5250j/src/org/tn5250j/ScreenField.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** ScreenField.java	18 Feb 2004 05:06:20 -0000	1.13
--- ScreenField.java	9 Jul 2004 04:33:58 -0000	1.14
***************
*** 187,195 ****
           //       character for this is \u0020 and the unicode character for
           //       a space is also \u0020 thus the offset.
!          if (s.screen[cursorPos].attributePlace) {
!             text.setCharAt(x,(char)('\uff00' + s.screen[cursorPos].attr));
           }
-          else
-             text.setCharAt(x,s.screen[cursorPos].getChar());
           changePos(-1);
  
--- 187,199 ----
           //       character for this is \u0020 and the unicode character for
           //       a space is also \u0020 thus the offset.
! //         if (s.screen[cursorPos].attributePlace) {
!          if (s.planes.isAttributePlace(cursorPos)) {
! //            text.setCharAt(x,(char)('\uff00' + s.screen[cursorPos].attr));
!             text.setCharAt(x,(char)('\uff00' + s.planes.getCharAttr(cursorPos)));
!          }
!          else {
! //            text.setCharAt(x,s.screen[cursorPos].getChar());
!             text.setCharAt(x,s.planes.getChar(cursorPos));
           }
           changePos(-1);
  
***************
*** 220,224 ****
        cursorPos = startPos;
        while (x-- > 0) {
!          s.screen[cursorPos].setChar(c);
           changePos(1);
        }
--- 224,229 ----
        cursorPos = startPos;
        while (x-- > 0) {
! //         s.screen[cursorPos].setChar(c);
!          s.planes.setChar(cursorPos,c);
           changePos(1);
        }
***************
*** 231,235 ****
        cursorPos = lastPos;
        while (x-- > 0) {
!          s.screen[cursorPos].setChar(c);
           s.setDirty(cursorPos);
           changePos(1);
--- 236,241 ----
        cursorPos = lastPos;
        while (x-- > 0) {
! //         s.screen[cursorPos].setChar(c);
!          s.planes.setChar(cursorPos,c);
           s.setDirty(cursorPos);
           changePos(1);

Index: Screen5250.java
===================================================================
RCS file: /cvsroot/tn5250j/tn5250j/src/org/tn5250j/Screen5250.java,v
retrieving revision 1.68
retrieving revision 1.69
diff -C2 -d -r1.68 -r1.69
*** Screen5250.java	7 Jul 2004 04:15:07 -0000	1.68
--- Screen5250.java	9 Jul 2004 04:33:58 -0000	1.69
***************
*** 47,51 ****
  		ActionListener {
  
! 	ScreenChar[] screen;
  	private ScreenChar[] errorLine;
  	private ScreenFields screenFields;
--- 47,51 ----
  		ActionListener {
  
! //	ScreenChar[] screen;
  	private ScreenChar[] errorLine;
[...1421 lines suppressed...]
  	}
  
! 	// ADDED BY BARRY
! 	public ScreenChar[] getCharacters() {
! 		return this.screen;
  	}
  
--- 5099,5110 ----
  	}
  
! //	// ADDED BY BARRY
! //	public ScreenChar[] getCharacters() {
! //		return this.screen;
! //	}
! 	// ADDED BY BARRY - changed by Kenneth to use the character plane
!    //  This should be replaced with the getPlane methods when they are implemented
! 	public char[] getCharacters() {
! 		return planes.screen;
  	}
  



-------------------------------------------------------
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