tn5250j/src/org/tn5250j/framework/tn5250 Screen5250.java,1.5,1.6

"Kenneth J. Pouncey" <[email protected]> Sat, 31 Jul 2004 10:30:33 +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-serv31455/src/org/tn5250j/framework/tn5250

Modified Files:
	Screen5250.java 
Log Message:
Code cleanup

Index: Screen5250.java
===================================================================
RCS file: /cvsroot/tn5250j/tn5250j/src/org/tn5250j/framework/tn5250/Screen5250.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** Screen5250.java	31 Jul 2004 10:16:28 -0000	1.5
--- Screen5250.java	31 Jul 2004 10:30:31 -0000	1.6
***************
*** 201,266 ****
     }
  
! //      /**
! //       *
! //       * RubberBanding start code
! //       *
! //       */
! //
! //      /**
! //       * Translate the starting point of mouse movement to encompass a full
! //       * character
! //       *
! //       * @param start
! //       * @return Point
! //       */
! //      public Point translateStart(Point start) {
! //
! //         // because getRowColFromPoint returns position offset as 1,1 we need
! //         // to translate as offset 0,0
! //         int pos = getPosFromView(start.x, start.y);
! //         int x = fmWidth * getCol(pos);
! //         int y = fmHeight * getRow(pos);
! //   //		start.setLocation(screen[pos].x, screen[pos].y);
! //         start.setLocation(x, y);
! //         return start;
! //
! //      }
! //
! //      /**
! //       * Translate the ending point of mouse movement to encompass a full
! //       * character
! //       *
! //       * @param end
! //       * @return Point
! //       */
! //      public Point translateEnd(Point end) {
! //
! //         // because getRowColFromPoint returns position offset as 1,1 we need
! //         // to translate as offset 0,0
! //         int pos = getPosFromView(end.x, end.y);
! //   //		if (pos >= screen.length) {
! //   //			pos = screen.length - 1;
! //   //		}
! //   //		int x = screen[pos].x + fmWidth - 1;
! //   //		int y = screen[pos].y + fmHeight - 1;
! //
! //         if (pos >= lenScreen) {
! //            pos = lenScreen - 1;
! //         }
! //         int x =  ((fmWidth * getCol(pos)) + fmWidth) - 1;
! //         int y = ((fmHeight * getRow(pos)) + fmHeight) - 1;
! //
! //         end.setLocation(x, y);
! //
! //         return end;
! //      }
! 
! 	/**
! 	 *
! 	 * RubberBanding end code
! 	 *
! 	 */
! 
! 	/**
  	 *
  	 * Copy & Paste start code
--- 201,205 ----
     }
  
!    /**
  	 *
  	 * Copy & Paste start code
***************
*** 432,469 ****
  	}
  
- //	/**
- //	 * Fills the passed Rectangle with the starting row and column and width and
- //	 * height of the selected area.
- //	 *
- //	 * 1 BASED so column 1 row one is returned 1,1
- //	 *
- //	 * If there is no area bounded then the full screen area is returned.
- //	 *
- //	 * @param bounds
- //	 */
- //	public void getBoundingArea(Rectangle bounds) {
- //
- //		// check to see if there is an area selected. If not then return all
- //		//    screen area.
- //		if (!gui.rubberband.isAreaSelected()) {
- //
- //			bounds.setBounds(1, 1, getCols(), getRows());
- //		} else {
- //			// lets get the bounding area using a rectangle that we have already
- //			// allocated
- //			gui.rubberband.getBoundingArea(workR);
- //
- //			// get starting row and column
- //			int sPos = getRowColFromPoint(workR.x, workR.y);
- //			// get the width and height
- //			int ePos = getRowColFromPoint(workR.width, workR.height);
- //
- //			int row = getRow(sPos) + 1;
- //			int col = getCol(sPos) + 1;
- //
- //			bounds.setBounds(row, col, getCol(ePos) + 1, getRow(ePos) + 1);
- //		}
- //	}
- 
  	/**
  	 *
--- 371,374 ----
***************
*** 774,794 ****
  	private void updateCursorLoc() {
  
- 		//      System.out.println("cursor loc " + updateCursorLoc + " " +
- 		// cursorActive);
  		if (cursorActive) {
  
- //			int row = getRow(lastPos);
- //			int col = getCol(lastPos);
- 
- //			bi.drawCursor(this, row, col, fmWidth, fmHeight, insertMode,
- //					crossHair, rulerFixed, cursorSize, colorCursor, colorBg,
- //					colorWhite, font, cursorBottOffset);
- //			gui.bi.drawCursor();
           fireCursorChanged(3);
  
  		}
- //      else {
- //         fireCursorChanged(4);
- //      }
  	}
  
--- 679,687 ----
***************
*** 1587,1591 ****
  				int s = screenFields.getCurrentField().getFieldShift();
  				if (s == 3 || s == 5 || s == 7) {
- //					screen[lastPos].setChar('-');
                 planes.setChar(lastPos,'-');
  
--- 1480,1483 ----
***************
*** 1684,1688 ****
  				int s = screenFields.getCurrentField().getFieldShift();
  				if (s == 3 || s == 5 || s == 7) {
- //					screen[lastPos].setChar('-');
                 planes.setChar(lastPos,'-');
  
--- 1576,1579 ----
***************
*** 1743,1747 ****
  				setPrehelpState(false, oia.isKeyBoardLocked(), false);
  			}
- //			gui.repaint();
  			simulated = true;
  			break;
--- 1634,1637 ----
***************
*** 1813,1823 ****
  	protected boolean simulateKeyStroke(char c) {
  
! 		//      if (isStatusErrorCode() && !Character.isISOControl(c) &&
! 		// !keyProcessed) {
! 		//         if (resetRequired)
! 		//            return false;
! 		//         else
! 		//            resetError();
! 		//      }
  
  		boolean updateField = false;
--- 1703,1712 ----
  	protected boolean simulateKeyStroke(char c) {
  
!       if (isStatusErrorCode() && !Character.isISOControl(c) && !keyProcessed) {
!          if (resetRequired)
!             return false;
!          else
!             resetError();
!       }
  
  		boolean updateField = false;
***************
*** 1904,1908 ****
  						screenFields.getCurrentField().changePos(1);
  
- //						screen[lastPos].setChar(c);
                    planes.setChar(lastPos,c);
  
--- 1793,1796 ----
***************
*** 1936,1941 ****
  					}
  
- //					updateImage(dirty);
- //               fireScreenChanged(1,dirty);
                 fireScreenChanged(1);
  
--- 1824,1827 ----
***************
*** 1997,2001 ****
  
  		// first lets get the real ending point without spaces and the such
- //		while (screen[endPos].getChar() <= ' ' && count-- > 0) {
  		while (planes.getChar(endPos) <= ' ' && count-- > 0) {
  
--- 1883,1886 ----
***************
*** 2054,2065 ****
  
  			case 5:
- 				//               System.out.println("Right adjust, zero fill " +
- 				// screenFields.getCurrentField().getAdjustment());
  				rightAdjustField('0');
  				sf.setRightAdjusted();
  				break;
  			case 6:
- 				//               System.out.println("Right adjust, blank fill " +
- 				// screenFields.getCurrentField().getAdjustment());
  				rightAdjustField(' ');
  				sf.setRightAdjusted();
--- 1939,1946 ----
***************
*** 2067,2072 ****
  				break;
  			case 7:
- 				System.out.println("Mandatory fill "
- 						+ screenFields.getCurrentField().getAdjustment());
  				sf.setManditoryEntered();
  				break;
--- 1948,1951 ----
***************
*** 2094,2098 ****
  		// subtract 1 from count for signed numeric - note for later
  		if (screenFields.getCurrentField().isSignedNumeric()) {
- //			if (screen[end - 1].getChar() != '-')
  			if (planes.getChar(end -1) != '-')
  				count--;
--- 1973,1976 ----
***************
*** 2104,2108 ****
  
  			shiftRight(pos);
- //			screen[pos].setChar(fill);
           planes.setChar(pos,fill);
  
--- 1982,1985 ----
***************
*** 2135,2139 ****
  			while (count-- > 0) {
  				pos++;
- //				screen[pPos].setChar(screen[pos].getChar());
              planes.setChar(pPos,planes.getChar(pos));
  				setDirty(pPos);
--- 2012,2015 ----
***************
*** 2148,2152 ****
  
  				pos = screenFields.getCurrentField().startPos();
- //				screen[pPos].setChar(screen[pos].getChar());
              planes.setChar(pPos,planes.getChar(pos));
  				setDirty(pPos);
--- 2024,2027 ----
***************
*** 2167,2171 ****
  
  		screenFields.setCurrentField(sf);
- //		screen[endPos].setChar(initChar);
        planes.setChar(endPos,initChar);
  		setDirty(endPos);
--- 2042,2045 ----
***************
*** 2188,2192 ****
  
  			pos--;
- //			screen[pPos].setChar(screen[pos].getChar());
  			planes.setChar(pPos, planes.getChar(pos));
  			setDirty(pPos);
--- 2062,2065 ----
***************
*** 2323,2327 ****
  		homePos = lastPos + numCols + 1;
  		pendingInsert = true;
- //		gui.sendNegResponse2(ec);
        sessionVT.sendNegResponse2(ec);
  
--- 2196,2199 ----
***************
*** 3273,3288 ****
  	 * Add a field to the field format table.
  	 *
! 	 * @param attr -
! 	 *            Field attribute
! 	 * @param len -
! 	 *            length of field
! 	 * @param ffw1 -
! 	 *            Field format word 1
! 	 * @param ffw2 -
! 	 *            Field format word 2
! 	 * @param fcw1 -
! 	 *            Field control word 1
! 	 * @param fcw2 -
! 	 *            Field control word 2
  	 */
  	protected void addField(int attr, int len, int ffw1, int ffw2, int fcw1,
--- 3145,3154 ----
  	 * Add a field to the field format table.
  	 *
! 	 * @param attr - Field attribute
! 	 * @param len - length of field
! 	 * @param ffw1 - Field format word 1
! 	 * @param ffw2 - Field format word 2
! 	 * @param fcw1 - Field control word 1
! 	 * @param fcw2 - Field control word 2
  	 */
  	protected void addField(int attr, int len, int ffw1, int ffw2, int fcw1,
***************
*** 3988,4006 ****
     }
  
!       /**
!        * Notify all registered listeners of the onScreenSizeChanged event.
!        *
!        */
!       private void fireScreenSizeChanged() {
  
!          if (listeners != null) {
!             int size = listeners.size();
!             for (int i = 0; i < size; i++) {
!                ScreenListener target =
!                      (ScreenListener)listeners.elementAt(i);
!                target.onScreenSizeChanged(numRows,numCols);
!             }
           }
        }
  
  	/**
--- 3854,3872 ----
     }
  
!    /**
!     * Notify all registered listeners of the onScreenSizeChanged event.
!     *
!     */
!    private void fireScreenSizeChanged() {
  
!       if (listeners != null) {
!          int size = listeners.size();
!          for (int i = 0; i < size; i++) {
!             ScreenListener target =
!                   (ScreenListener)listeners.elementAt(i);
!             target.onScreenSizeChanged(numRows,numCols);
           }
        }
+    }
  
  	/**



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