tn5250j/src/org/tn5250j/framework/tn5250 Screen5250.java,1.3,1.4 tnvt.java,1.2,1.3 WTDSFParser.java,1.2,1.3

"Kenneth J. Pouncey" <[email protected]> Sat, 31 Jul 2004 10:10:30 +0000
Newsgroups gmane.comp.java.tn5250j.cvs
Message-ID <[email protected]>
Update of /cvsroot/tn5250j/tn5250j/src/org/tn5250j/framework/tn5250
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29096/src/org/tn5250j/framework/tn5250

Modified Files:
	Screen5250.java tnvt.java WTDSFParser.java 
Log Message:
Code cleanup and rename of public method goto_XY to gotoRowCol

Index: tnvt.java
===================================================================
RCS file: /cvsroot/tn5250j/tn5250j/src/org/tn5250j/framework/tn5250/tnvt.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** tnvt.java	30 Jul 2004 05:03:57 -0000	1.2
--- tnvt.java	31 Jul 2004 10:10:28 -0000	1.3
***************
*** 1,3300 ****
! /**
!  * Title: tnvt.java
!  * Copyright: Copyright (c) 2001 Company:
!  *
!  * @author Kenneth J. Pouncey
!  * @version 0.5
!  *
!  * Description:
!  *
!  * This program is free software; you can redistribute it and/or modify it under
[...6571 lines suppressed...]
! 	private static final byte TRANSMIT_BINARY = (byte) 0; // 0
! 	private static final byte QUAL_IS = (byte) 0; // 0
! 	private static final byte TIMING_MARK = (byte) 6; // 6
! 	private static final byte NEW_ENVIRONMENT = (byte) 39; // 27
! 	private static final byte IS = (byte) 0; // 0
! 	private static final byte SEND = (byte) 1; // 1
! 	private static final byte INFO = (byte) 2; // 2
! 	private static final byte VAR = (byte) 0; // 0
! 	private static final byte VALUE = (byte) 1; // 1
! 	private static final byte NEGOTIATE_ESC = (byte) 2; // 2
! 	private static final byte USERVAR = (byte) 3; // 3
! 
! 	// miscellaneous
! 	private static final byte ESC = 0x04; // 04
! 
! 	private static final char char0 = 0;
! 
! 	//   private static final byte CMD_READ_IMMEDIATE_ALT = (byte)0x83; // 131
! 
! }

Index: WTDSFParser.java
===================================================================
RCS file: /cvsroot/tn5250j/tn5250j/src/org/tn5250j/framework/tn5250/WTDSFParser.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** WTDSFParser.java	30 Jul 2004 05:03:57 -0000	1.2
--- WTDSFParser.java	31 Jul 2004 10:10:28 -0000	1.3
***************
*** 1,627 ****
! /**
!  * Title: tn5250J
!  * Copyright:   Copyright (c) 2001
!  * Company:
!  * @author  Kenneth J. Pouncey
!  * @version 0.5
!  *
!  * Description:
!  *
!  * This program is free software; you can redistribute it and/or modify
[...1227 lines suppressed...]
! //   private static final byte QUAL_IS = (byte)0;             // 0
! //   private static final byte TIMING_MARK = (byte)6;         // 6
! //   private static final byte NEW_ENVIRONMENT = (byte)39;         // 27
! //   private static final byte IS = (byte)0;         // 0
! //   private static final byte SEND = (byte)1;         // 1
! //   private static final byte INFO = (byte)2;         // 2
! //   private static final byte VAR = (byte)0;         // 0
! //   private static final byte VALUE = (byte)1;         // 1
! //   private static final byte NEGOTIATE_ESC = (byte)2;         // 2
! //   private static final byte USERVAR = (byte)3;         // 3
! 
!    // miscellaneous
! //   private static final byte ESC = 0x04; // 04
! //   private static final char char0 = 0;
! 
! //   private static final byte CMD_READ_IMMEDIATE_ALT = (byte)0x83; // 131
! 
! 
  }
\ No newline at end of file

Index: Screen5250.java
===================================================================
RCS file: /cvsroot/tn5250j/tn5250j/src/org/tn5250j/framework/tn5250/Screen5250.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** Screen5250.java	31 Jul 2004 09:48:22 -0000	1.3
--- Screen5250.java	31 Jul 2004 10:10:28 -0000	1.4
***************
*** 132,136 ****
  		numCols = 80;
  
! 		goto_XY(1, 1); // set initial cursor position
  
  		restriction = new Rectangle(0, 0);
--- 132,136 ----
  		numCols = 80;
  
! 		gotoRowCol(1, 1); // set initial cursor position
  
  		restriction = new Rectangle(0, 0);
***************
*** 411,415 ****
  			updateDirty();
  
! 			goto_XY(lr + 1, lc + 1);
  
  			setCursorActive(true);
--- 411,415 ----
  			updateDirty();
  
! 			gotoRowCol(lr + 1, lc + 1);
  
  			setCursorActive(true);
***************
*** 1463,1467 ****
  						.startPos(), true);
  				if (where > 0) {
! 					goto_XY((where / numCols) + 1, (where % numCols) + 1);
  				}
  				simulated = true;
--- 1463,1467 ----
  						.startPos(), true);
  				if (where > 0) {
! 					gotoRowCol((where / numCols) + 1, (where % numCols) + 1);
  				}
  				simulated = true;
***************
*** 1780,1784 ****
  					startRow = 0;
  
! 				goto_XY(++startRow, 1);
  
  				if (!isInField() && screenFields.getCurrentField() != null
--- 1780,1784 ----
  					startRow = 0;
  
! 				gotoRowCol(++startRow, 1);
  
  				if (!isInField() && screenFields.getCurrentField() != null
***************
*** 1930,1934 ****
  
  						} else
! 							goto_XY(screenFields.getCurrentField()
  									.getCursorRow() + 1, screenFields
  									.getCurrentField().getCursorCol() + 1);
--- 1930,1934 ----
  
  						} else
! 							gotoRowCol(screenFields.getCurrentField()
  									.getCursorRow() + 1, screenFields
  									.getCurrentField().getCursorCol() + 1);
***************
*** 2782,2786 ****
  	 * @param col
  	 */
! 	public void goto_XY(int row, int col) {
  		goto_XY(((row - 1) * numCols) + (col - 1));
  	}
--- 2782,2786 ----
  	 * @param col
  	 */
! 	public void gotoRowCol(int row, int col) {
  		goto_XY(((row - 1) * numCols) + (col - 1));
  	}
***************
*** 2796,2814 ****
  
  	/**
- 	 * This returns whether or not any of the fields currently on the screen
- 	 * have been changed in any way.
- 	 *
- 	 * Convinience class to ScreenFields
- 	 *
- 	 * @return true or false
- 	 * @see org#tn5250j#ScreenFields
- 	 */
- 	protected boolean isMasterMDT() {
- 
- 		return screenFields.isMasterMDT();
- 
- 	}
- 
- 	/**
  	 * Set the current working field to the field number specified.
  	 *
--- 2796,2799 ----
***************
*** 2856,2872 ****
  	 *
  	 */
- 	/**
- 	 * Convenience class to position the cursor to the next word on the screen
- 	 *
- 	 */
  	private void gotoNextWord() {
  
  		int pos = lastPos;
  
- //		if (screen[lastPos].getChar() > ' ') {
  		if (planes.getChar(lastPos) > ' ') {
  			advancePos();
  			// get the next space character
- //			while (screen[lastPos].getChar() > ' ' && pos != lastPos) {
  			while (planes.getChar(lastPos) > ' ' && pos != lastPos) {
  				advancePos();
--- 2841,2851 ----
***************
*** 2877,2881 ****
  		// now that we are positioned on the next space character get the
  		// next none space character
- //		while (screen[lastPos].getChar() <= ' ' && pos != lastPos) {
  		while (planes.getChar(lastPos) <= ' ' && pos != lastPos) {
  			advancePos();
--- 2856,2859 ----
***************
*** 2896,2900 ****
  
  		// position previous white space character
- //		while (screen[lastPos].getChar() <= ' ') {
  		while (planes.getChar(lastPos) <= ' ') {
  			changePos(-1);
--- 2874,2877 ----
***************
*** 2905,2909 ****
  		changePos(-1);
  		// get the previous space character
- //		while (screen[lastPos].getChar() > ' ' && pos != lastPos) {
  		while (planes.getChar(lastPos) > ' ' && pos != lastPos) {
  			changePos(-1);
--- 2882,2885 ----
***************
*** 3034,3038 ****
  
  		// set ending attribute byte
- //		screen[lastPos].setCharAndAttr(initChar, initAttr, true);
  		planes.setScreenCharAndAttr(lastPos,initChar, initAttr, true);
  
--- 3010,3013 ----
***************
*** 3044,3048 ****
  
  			// set leading attribute byte
- //			screen[lastPos].setCharAndAttr(initChar, initAttr, true);
  			planes.setScreenCharAndAttr(lastPos,initChar, initAttr, true);
  			setDirty(lastPos);
--- 3019,3022 ----
***************
*** 3050,3058 ****
  
  			// set left
- //			screen[lastPos].setCharAndAttr((char) left, colorAttr, false);
  			planes.setScreenCharAndAttr(lastPos, (char) left, colorAttr, false);
  
  			if (gui) {
- //				screen[lastPos].setUseGUI(LEFT);
  				planes.setUseGUI(lastPos,GUI_LEFT);
  			}
--- 3024,3030 ----
***************
*** 3108,3115 ****
  		// draw bottom row
  		while (w-- >= 0) {
- //			screen[lastPos].setCharAndAttr((char) bottom, colorAttr, false);
  			planes.setScreenCharAndAttr(lastPos,(char) bottom, colorAttr, false);
  			if (gui) {
- //				screen[lastPos].setUseGUI(BOTTOM);
  				planes.setUseGUI(lastPos,BOTTOM);
  			}
--- 3080,3085 ----
***************
*** 3119,3126 ****
  
  		// set lower right
- //		screen[lastPos].setCharAndAttr((char) lr, colorAttr, false);
  		planes.setScreenCharAndAttr(lastPos, (char) lr, colorAttr, false);
  		if (gui) {
- //			screen[lastPos].setUseGUI(LOWER_RIGHT);
  			planes.setUseGUI(lastPos,LOWER_RIGHT);
  		}
--- 3089,3094 ----
***************
*** 3129,3133 ****
  
  		// set ending attribute byte
- //		screen[lastPos].setCharAndAttr(initChar, initAttr, true);
  		planes.setScreenCharAndAttr(lastPos,initChar, initAttr, true);
  		setDirty(lastPos);
--- 3097,3100 ----
***************
*** 3165,3170 ****
  		int thumbPos = (int) (size * (float) ((float) sliderColPos / (float) totalColScrollable));
  		//      System.out.println(thumbPos);
- //		screen[sp].setCharAndAttr(' ', 32, false);
- //		screen[sp].setUseGUI(BUTTON_SB_UP);
  		planes.setScreenCharAndAttr(sp,' ', 32, false);
  		planes.setUseGUI(sp,BUTTON_SB_UP);
--- 3132,3135 ----
***************
*** 3173,3183 ****
  		while (ctr < size) {
  			sp += numCols;
- //			screen[sp].setCharAndAttr(' ', 32, false);
  			planes.setScreenCharAndAttr(sp,' ', 32, false);
  			if (ctr == thumbPos)
- //				screen[sp].setUseGUI(BUTTON_SB_THUMB);
  				planes.setUseGUI(sp,BUTTON_SB_THUMB);
  			else
- //				screen[sp].setUseGUI(BUTTON_SB_GUIDE);
  				planes.setUseGUI(sp, BUTTON_SB_GUIDE);
  			ctr++;
--- 3138,3145 ----
***************
*** 3185,3190 ****
  		sp += numCols;
  
- //		screen[sp].setCharAndAttr(' ', 32, false);
- //		screen[sp].setUseGUI(BUTTON_SB_DN);
  
  		planes.setScreenCharAndAttr(sp, ' ', 32, false);
--- 3147,3150 ----
***************
*** 3236,3241 ****
  
  		for (int x = 0; x < len; x++) {
- //			screen[pos].setChar(title.charAt(x));
- //			screen[pos++].setUseGUI(NO_GUI);
  			planes.setChar(pos, title.charAt(x));
  			planes.setUseGUI(pos++, NO_GUI);
--- 3196,3199 ----
***************
*** 3277,3281 ****
  			//  Now round em up and head em UP.
  			for (int x = start; x < len + numCols; x++) {
- //				screen[x].setChar(screen[x + numCols].getChar());
  				planes.setChar(x, planes.getChar(x + numCols));
  			}
--- 3235,3238 ----
***************
*** 3284,3288 ****
  			//  Now round em up and head em DOWN.
  			for (int x = end + numCols; x > 0; x--) {
- //				screen[x + numCols].setChar(screen[x].getChar());
  				planes.setChar(x + numCols, planes.getChar(x));
  			}
--- 3241,3244 ----
***************
*** 3335,3339 ****
  		lastAttr = attr;
  
- //		screen[lastPos].setCharAndAttr(initChar, lastAttr, true);
  		planes.setScreenCharAndAttr(lastPos, initChar, lastAttr, true);
  
--- 3291,3294 ----
***************
*** 3361,3369 ****
  			while (x-- > 0) {
  
- //				if (screen[lastPos].getChar() == 0)
- //					screen[lastPos].setCharAndAttr(' ', lastAttr, false);
- //				else
- //					screen[lastPos].setAttribute(lastAttr);
- 
  				if (planes.getChar(lastPos) == 0)
  					planes.setScreenCharAndAttr(lastPos, ' ', lastAttr, false);
--- 3316,3319 ----
***************
*** 3372,3376 ****
  
  				if (gui) {
- //					screen[lastPos].setUseGUI(FIELD_MIDDLE);
  					planes.setUseGUI(lastPos,FIELD_MIDDLE);
  				}
--- 3322,3325 ----
***************
*** 3382,3391 ****
  			if (gui)
  				if (len > 1) {
- //					screen[sf.startPos()].setUseGUI(FIELD_LEFT);
  					planes.setUseGUI(sf.startPos(), FIELD_LEFT);
- //					if (lastPos > 0)
- //						screen[lastPos - 1].setUseGUI(FIELD_RIGHT);
- //					else
- //						screen[lastPos].setUseGUI(FIELD_RIGHT);
  
  					if (lastPos > 0)
--- 3331,3335 ----
***************
*** 3396,3400 ****
  				}
              else {
- //					screen[lastPos - 1].setUseGUI(FIELD_ONE);
  					planes.setUseGUI(lastPos - 1,FIELD_ONE);
              }
--- 3340,3343 ----
***************
*** 3561,3570 ****
  
  						if (guiInterface && f) {
- //							screen[pos].setUseGUI(FIELD_LEFT);
  							planes.setUseGUI(pos,FIELD_LEFT);
  							f = false;
  						} else {
  
- //							screen[pos].setUseGUI(FIELD_MIDDLE);
  							planes.setUseGUI(pos,FIELD_MIDDLE);
  
--- 3504,3511 ----
***************
*** 3572,3576 ****
  
  						if (guiInterface && l == 0) {
- //							screen[pos].setUseGUI(FIELD_RIGHT);
  							planes.setUseGUI(pos,FIELD_RIGHT);
  						}
--- 3513,3516 ----
***************
*** 3579,3583 ****
  					}
  				} else {
- //					screen[pos].setUseGUI(FIELD_ONE);
  					planes.setUseGUI(pos,FIELD_ONE);
  				}
--- 3519,3522 ----
***************
*** 3604,3608 ****
  			setDirty(pos++);
  		}
! 		//      updateImage(dirty);
  
  	}
--- 3543,3548 ----
  			setDirty(pos++);
  		}
! 		
! 		updateDirty();
  
  	}
***************
*** 3622,3631 ****
  
  		while (x-- > 0) {
- //			screen[pos].setAttribute(na);
  			planes.setScreenAttr(pos,na);
  			setDirty(pos++);
  		}
- //		updateImage(dirty);
- //      fireScreenChanged(1,dirty);
        fireScreenChanged(1);
  
--- 3562,3568 ----
***************
*** 3647,3651 ****
  
  		while (x-- > 0) {
- //			screen[pos].setAttribute(na);
  			planes.setScreenAttr(pos,na);
  			setDirty(pos++);
--- 3584,3587 ----
***************
*** 3829,3838 ****
  
  		if (pendingInsert && homePos > 0) {
! 			goto_XY(getRow(homePos), getCol(homePos));
  			isInField(); // we now check if we are in a field
  		} else {
  			if (!gotoField(1)) {
  				homePos = getPos(1, 1);
! 				goto_XY(1, 1);
  				isInField(0, 0); // we now check if we are in a field
  			} else {
--- 3765,3774 ----
  
  		if (pendingInsert && homePos > 0) {
! 			gotoRowCol(getRow(homePos), getCol(homePos));
  			isInField(); // we now check if we are in a field
  		} else {
  			if (!gotoField(1)) {
  				homePos = getPos(1, 1);
! 				gotoRowCol(1, 1);
  				isInField(0, 0); // we now check if we are in a field
  			} else {
***************
*** 3849,3853 ****
  
  		if (!isStatusErrorCode()) {
! 			goto_XY(icX, icY);
  		}
  	}
--- 3785,3789 ----
  
  		if (!isStatusErrorCode()) {
! 			gotoRowCol(icX, icY);
  		}
  	}
***************
*** 4001,4116 ****
  	}
  
- 	/**
- 	 * Returns a pointer to the graphics area that we can draw on
- 	 *
- 	 * @return Graphics2D pointer of graphics buffer
- 	 */
- //	public Graphics2D getDrawingArea() {
- //
- //		return bi.getDrawingArea();
- //	}
- 
- //      protected void updateImage(int x, int y, int width, int height) {
- //
- //   //		if (controllersG2D == null) {
- //   //			//System.out.println("was null");
- //   //			controllersG2D = (Graphics2D) gui.getGraphics();
- //   //		}
- //
- //         // check for selected area and erase it before updating screen
- //         if (gui.rubberband != null && gui.rubberband.isAreaSelected()) {
- //            gui.rubberband.erase();
- //         }
- //
- //   //		if (bi == null || controllersG2D == null) {
- //   //			if (bi == null)
- //   //				System.out.println("bi was null in update image");
- //   //			if (controllersG2D == null)
- //   //				System.out.println("gg2d was null in update image");
- //   //			return;
- //   //		}
- //
- //         biGraphics2d.setClip(x, y, width, height);
- //         if (!cursorActive && x + width <= bi.getWidth(null)
- //               && y + height <= (bi.getHeight(null) - fmWidth)) {
- //            paintComponent2(biGraphics2d);
- //         }
- //
- //         //      if (tileimage != null) {
- //         //
- //         //         AlphaComposite ac =
- //         // AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.5f);
- //         //         g2d.setComposite(ac);
- //         //         g2d.drawImage(tileimage, null, null);
- //         //      }
- //
- //         // LDC - WVL : 08/09/2003 : TR.000358
- //         // TN5250j overpaints superimposed components
- //         // as swing doesn't support overlay detection when painting a component
- //         // we have to adhere to swing's paint request and use dirty rectangle
- //         // marking
- //         // instead of off-thread painting
- //         // So we replaced the complete block underneath by 1 repaint request
- //
- //         // fix for jdk1.4 - found this while testing under jdk1.4
- //         //   if the height and or the width are equal to zero we skip the
- //         //   the updating of the image.
- //         //      if (gui.isVisible() && height > 0 && width > 0) {
- //         //         bi.drawImageBuffer(gg2d,x,y,width,height);
- //         //      }
- //         //         if (gui.isVisible()) {
- //         //            if (height > 0 && width > 0) {
- //
- //         // We now redraw the selected area rectangle.
- //         if (gui.rubberband != null && gui.rubberband.isAreaSelected()) {
- //            gui.rubberband.draw();
- //         }
- //
- //         //         if (!fullRepaint) {
- //         //            bi.drawImageBuffer(gg2d,x,y,width,height);
- //         //         }
- //         //         else
- //         //            gui.repaint();
- //
- //         //            System.out.println(" something went right finally " + gui.isVisible()
- //         // +
- //         //                           " height " + height + " width " + width);
- //         //         }
- //         //            else {
- //         //            bi.drawImageBuffer(gg2d);
- //         //            System.out.println(" something is wrong here " + gui.isVisible() +
- //         //                           " height " + height + " width " + width);
- //
- //         //            }
- //         //      }
- //         if (x == 0)
- //            width += bi.offLeft;
- //         else
- //            x += bi.offLeft;
- //         if (y == 0)
- //            height += bi.offTop;
- //         else
- //            y += bi.offTop;
- //
- //         gui.repaint(x, y, width, height);
- //
- //      }
- //
- //      protected void updateImage(Rectangle r) {
- //         updateImage(r.x, r.y, r.width, r.height);
- //      }
- 
- //	protected void paintComponent3(Graphics g) {
- //		//      System.out.println("paint from screen");
- //		Graphics2D g2 = (Graphics2D) g;
- //
- //		//      Rectangle r = g.getClipBounds();
- //
- //		g2.setColor(bi.colorBg);
- //		g2.fillRect(0, 0, gui.getWidth(), gui.getHeight());
- //
- //		bi.drawImageBuffer(g2);
- //	}
- 
     /**
      * Notify all registered listeners of the onScreenChanged event.
--- 3937,3940 ----
***************
*** 4141,4147 ****
        }
  
- //      iOhioPosition inStart = new iOhioPosition(getRow(dirty.x) + 1,getColumn(dirty.x)+1);
- //      iOhioPosition inEnd = new iOhioPosition(getRow(dirty.y)+1,getColumn(dirty.y) +1);
- 
        fireScreenChanged(update, getRow(dirtyScreen.x), getCol(dirtyScreen.x),
                                   getRow(dirtyScreen.y), getCol(dirtyScreen.y));
--- 3965,3968 ----
***************
*** 4153,4165 ****
      *
      */
- //   private synchronized void fireCursorChanged(int update, int row, int col) {
     private synchronized void fireCursorChanged(int update) {
- //         if (dirtyScreen.x > dirtyScreen.y) {
- //   //         log.info(" x < y " + dirtyScreen);
- //            return;
- //         }
- 
- //      iOhioPosition inStart = new iOhioPosition(getRow(dirty.x) + 1,getColumn(dirty.x)+1);
- //      iOhioPosition inEnd = new iOhioPosition(getRow(dirty.y)+1,getColumn(dirty.y) +1);
        int startRow = getRow(lastPos);
        int startCol = getCol(lastPos);
--- 3974,3978 ----
***************
*** 4191,4408 ****
        }
  
- //      /**
- //       * Notify all registered listeners of the onScreenChanged event.
- //       *
- //       */
- //      private void fireScreenChanged(int which, Rectangle r) {
- //
- //         int sPos = getRowColFromPoint(r.x, r.y);
- //
- //         int ePos = getRowColFromPoint(r.width, r.height) - numCols;
- //         // fix me here
- //         int er = (numRows - ((((fmHeight * (numRows + 1)) - ((r.y + r.height) + fmHeight)) / fmHeight)));
- //         int ec = (numCols - ((((fmWidth * (numCols + 1)) - ((r.x + r.width) + fmWidth)) / fmWidth)));
- //
- //         //      int er1 = getRow(ePos);
- //         //      int ec2 = getCol(ePos);
- //         int sr = getRow(sPos);
- //         int c = getCol(sPos);
- //         er--;
- //         ec--;
- //
- //         fireScreenChanged(1,sr,c,er,ec);
- //
- //      }
- 
- //      protected void paintComponent2(Graphics2D g2) {
- //
- //         if (bi == null) {
- //            paintComponent3(g2);
- //         }
- //
- //         Rectangle r = g2.getClipBounds();
- //
- //   //		if (r == null) {
- //   //         log.info(" clipping rect is null ");
- //   //			paintComponent3((Graphics) g2);
- //   //			return;
- //   //		}
- //
- //         g2.setColor(colorBg);
- //         //      System.out.println("PaintComponent " + r);
- //
- //         g2.fillRect(r.x, r.y, r.width, r.height);
- //
- //         int sPos = getRowColFromPoint(r.x, r.y);
- //
- //         int ePos = getRowColFromPoint(r.width, r.height) - numCols;
- //         // fix me here
- //         int er = (numRows - ((((fmHeight * (numRows + 1)) - ((r.y + r.height) + fmHeight)) / fmHeight)));
- //         int ec = (numCols - ((((fmWidth * (numCols + 1)) - ((r.x + r.width) + fmWidth)) / fmWidth)));
- //
- //         //      int er1 = getRow(ePos);
- //         //      int ec2 = getCol(ePos);
- //         int sr = getRow(sPos);
- //         int c = getCol(sPos);
- //         er--;
- //         ec--;
- //
- //         fireScreenChanged(1,sr,c,er,ec);
- //   //      fireScreenChanged(1,dirtyScreen.y,dirtyScreen.x,dirtyScreen.height,dirtyScreen.width);
- //
- //   //         //      System.out.println(sr + "," + c + "," + er + "," + ec);
- //   //      workR.setBounds(sr, c, er, ec);
- //
- //   //      printRect(" paint workR ",workR);
- //   //         int rows = er - sr;
- //   //         int cols = 0;
- //   //         int lr = workR.x;
- //   //         int lc = 0;
- //   //
- //   //         lr = sPos;
- //   //
- //   //         while (rows-- >= 0) {
- //   //            cols = ec - c;
- //   //            lc = lr;
- //   //            while (cols-- >= 0) {
- //   //               if (lc >= 0 && lc < lenScreen) {
- //   //   //					screen[lc++].drawChar(g2);
- //   //                  bi.drawChar(g2,screen[lc],getRow(lc),getCol(lc));
- //   //                  lc++;
- //   //               }
- //   //            }
- //   //            lr += numCols;
- //   //         }
- //
- //      }
- 
-       /**
-        *
-        * This routine will make sure we have something to draw on
-        *
-        */
- //         private void checkOffScreenImage() {
- //
- //            // do we have something already?
- //            if (bi == null) {
- //
- //               bi = new GuiGraphicBuffer(this,config);
- //
- //      //			if (antialiased) {
- //      //				bi.setUseAntialias(true);
- //      //			}
- //
- //               // allocate a buffer Image with appropriate size
- //               bi.getImageBuffer(fmWidth * numCols, fmHeight * (numRows + 2));
- //
- //               // fill in the areas
- //      //            tArea = new Rectangle2D.Float(0, 0, 0, 0);
- //      //            cArea = new Rectangle2D.Float(0, 0, 0, 0);
- //      //            aArea = new Rectangle2D.Float(0, 0, 0, 0);
- //      //            sArea = new Rectangle2D.Float(0, 0, 0, 0);
- //      //
- //      //            // Draw Operator Information Area
- //      //            drawOIA();
- //            }
- //
- //         }
- 
- 	/**
- 	 * Convinience method to resize the screen area such as when the parent
- 	 * frame is resized.
- 	 *
- 	 * @param width
- 	 * @param height
- 	 */
- //	private final void resizeScreenArea(int width, int height) {
- 
- //         Font k = null;
- //         LineMetrics l;
- //         FontRenderContext f = null;
- //         k = GUIGraphicsUtils.getDerivedFont(font, width, height, numRows,
- //               numCols, sfh, sfw, ps132);
- //         f = new FontRenderContext(k.getTransform(), true, true);
- //
- //         l = k.getLineMetrics("Wy", f);
- //
- //         if (font.getSize() != k.getSize() || updateFont
- //               || (bi.offLeft != (width - bi.getWidth()) / 2)
- //               || (bi.offTop != (height - bi.getHeight()) / 2)) {
- //
- //            // set up all the variables that are used in calculating the new
- //            // size
- //            font = k;
- //            FontRenderContext frc = new FontRenderContext(font.getTransform(),
- //                  true, true);
- //            lm = font.getLineMetrics("Wy", frc);
- //            fmWidth = (int) font.getStringBounds("W", frc).getWidth() + 2;
- //            fmHeight = (int) (font.getStringBounds("g", frc).getHeight()
- //                  + lm.getDescent() + lm.getLeading());
- //
- //            bi.resize(fmWidth * numCols, fmHeight * (numRows + 2));
- //
- //            // set the offsets for the screen centering.
- //            bi.offLeft = (width - bi.getWidth()) / 2;
- //            bi.offTop = (height - bi.getHeight()) / 2;
- //            if (bi.offLeft < 0)
- //               bi.offLeft = 0;
- //            if (bi.offTop < 0)
- //               bi.offTop = 0;
- //
- //            drawOIA();
- //
- //            // and loop through the screen buffer to draw the new image with
- //            // the correct attributes
- //   //			for (int m = 0; m < lenScreen; m++) {
- //   //				screen[m].setRowCol(getRow(m), getCol(m));
- //   //
- //   //			}
- //            updateFont = false;
- //		}
- //      bi.resizeScreenArea(width,height);
- //	}
- 
- 	/**
- 	 * Draw the Operator Information Area for feedback
- 	 */
- //	private void drawOIA() {
- //
- //		// get ourselves a global pointer to the graphics
- //		biGraphics2d = bi.drawOIA();
- //
- //		tArea.setRect(bi.getTextArea());
- //		cArea.setRect(bi.getCommandLineArea());
- //		aArea.setRect(bi.getScreenArea());
- //		sArea.setRect(bi.getStatusArea());
- //
- //	}
- 
- 	/**
- 	 *
- 	 * This routine will calculate the new image size that will be displayed
- 	 * when the frame that holds it is resized.
- 	 *
- 	 * The font characteristics are changed to fit the new size as will as the
- 	 * screen buffer row column offsets so that the characters that make of the
- 	 * screen are displayed correctly
- 	 *
- 	 * Changes made by Luc - LDC This routine was split into two separate
- 	 * functions. setBounds and repaintScreen. This allowed a public function
- 	 * called updateScreen to be introduced.
- 	 *
- 	 * @param width
- 	 * @param height
- 	 *
- 	 *
- 	 */
- 
- //	public final void setBounds(int width, int height) {
- //
- //		setCursorActive(false);
- //		bi.resizeScreenArea(width, height);
- //		repaintScreen();
- //		setCursorActive(true);
- //	}
- 
  	/**
  	 * This method does a complete refresh of the screen.
--- 4004,4007 ----
***************
*** 4446,4460 ****
  	 */
  	public void repaintScreen() {
! 		//drawing = true;
! //         dirty.setBounds(tArea.getBounds());
!          dirtyScreen.setBounds(0,lenScreen - 1,0,0);
! //         if (gui.getGraphics() != null) {
!             // do not forget to null out gg2d before update or else there will
!             //    be a very hard to trace screen resize problem
!    //			controllersG2D = null;
! //            updateDirty();
! //         }
! //      fireScreenChanged(1);
!       setCursorOff();
        updateDirty();
  		// restore statuses that were on the screen before resize
--- 4045,4051 ----
  	 */
  	public void repaintScreen() {
! 
! 	   setCursorOff();
!       dirtyScreen.setBounds(0,lenScreen - 1,0,0);
        updateDirty();
  		// restore statuses that were on the screen before resize
***************
*** 4474,4526 ****
  	}
  
- 	/**
- 	 *
- 	 * This routine will calculate the new image size that will be displayed
- 	 * when the frame that holds it is resized.
- 	 *
- 	 * The font characteristics are changed to fit the new size as will as the
- 	 * screen buffer row column offsets so that the characters that make of the
- 	 * screen are displayed correctly
- 	 *
- 	 * @param r
- 	 */
- //	public final void setBounds(Rectangle r) {
- //
- //		setBounds(r.width, r.height);
- //	}
- 
- 	/**
- 	 *
- 	 * This routine returns the preferred size of the component that wants to be
- 	 * displayed
- 	 *
- 	 * @return the value of the preferredSize property
- 	 *
- 	 */
- //	public final Dimension getPreferredSize() {
- //
- //		return new Dimension(fmWidth * numCols, fmHeight * (numRows + 2));
- //
- //	}
- 
- //	/**
- //	 *
- //	 * This routine is responsible for setting up a PrinterJob on this component
- //	 * and initiating the print session.
- //	 *
- //	 */
- //	public final void printMe() {
- //
- //		Thread printerThread = new PrinterThread(this, font, numCols,
- //				numRows, Color.black, defaultPrinter, (Session) gui);
- //
- //		printerThread.start();
- //
- //	}
- 
- //	// 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
--- 4065,4068 ----
***************
*** 4529,4534 ****
  	}
  
- //	public Gui5250 getGui() {
- //		return this.gui;
- //	}
  }
--- 4071,4073 ----



-------------------------------------------------------
This SF.Net email is sponsored by OSTG. Have you noticed the changes on
Linux.com, ITManagersJournal and NewsForge in the past few weeks? Now,
one more big change to announce. We are now OSTG- Open Source Technology
Group. Come see the changes on the new OSTG site. www.ostg.com