tn5250j/src/org/tn5250j TN5250jConstants.java,1.51,1.52 GuiGraphicBuffer.java,1.26,1.27 Screen5250.java,1.71,1.72

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

Modified Files:
	TN5250jConstants.java GuiGraphicBuffer.java Screen5250.java 
Log Message:
Fixed error line to work correctly.

Index: TN5250jConstants.java
===================================================================
RCS file: /cvsroot/tn5250j/tn5250j/src/org/tn5250j/TN5250jConstants.java,v
retrieving revision 1.51
retrieving revision 1.52
diff -C2 -d -r1.51 -r1.52
*** TN5250jConstants.java	11 Jul 2004 09:59:18 -0000	1.51
--- TN5250jConstants.java	12 Jul 2004 04:22:02 -0000	1.52
***************
*** 391,394 ****
--- 391,395 ----
     public static final int PLANE_EXTENDED_GRAPHIC   =  16;
     public static final int PLANE_EXTENDED_FIELD   =  32;
+    public static final int PLANE_ATTR   =  64;
  
     // COLOR_BG

Index: GuiGraphicBuffer.java
===================================================================
RCS file: /cvsroot/tn5250j/tn5250j/src/org/tn5250j/GuiGraphicBuffer.java,v
retrieving revision 1.26
retrieving revision 1.27
diff -C2 -d -r1.26 -r1.27
*** GuiGraphicBuffer.java	11 Jul 2004 09:59:18 -0000	1.26
--- GuiGraphicBuffer.java	12 Jul 2004 04:22:02 -0000	1.27
***************
*** 34,37 ****
--- 34,38 ----
  import java.awt.Font;
  import java.awt.font.*;
+ import javax.swing.JPanel;
  
  import org.tn5250j.event.ScreenOIAListener;
***************
*** 211,216 ****
        	int col = screen.getCol(screen.getLastPos());
  
-       	int fmHeight = rowHeight;
-       	int fmWidth = columnWidth;
        	int botOffset = screen.cursorBottOffset;
        	int cursorSize = screen.cursorSize;
--- 212,215 ----
***************
*** 578,581 ****
--- 577,581 ----
                 g2d.setColor(screen.colorYellow);
                 g2d.drawString("KB", (float) kbArea.getX(), Y);
+                
                 screen.updateImage(kbArea.getBounds());
                 g2d.dispose();
***************
*** 717,725 ****
  
  
!       public Data(char[] text, char[] color, char[] extended) {
           this.text = text;
           this.color = color;
           this.extended = extended;
!          this.graphic = null;
           this.field = null;
        }
--- 717,726 ----
  
  
!       public Data(char[] text, char[] attr, char[] color, char[] extended, char[] graphic) {
           this.text = text;
           this.color = color;
           this.extended = extended;
!          this.graphic = graphic;
!          this.attr = attr;
           this.field = null;
        }
***************
*** 732,735 ****
--- 733,737 ----
           int size = ((endCol - startCol) + 1) * ((endRow - startRow) +1);
           text = new char[size];
+          attr = new char[size];
           color = new char[size];
           extended =new char[size];
***************
*** 737,740 ****
--- 739,743 ----
           field = null;
           screen.GetScreenRect(text, size, startRow, startCol, endRow, endCol, PLANE_TEXT);
+          screen.GetScreenRect(attr, size, startRow, startCol, endRow, endCol, PLANE_ATTR);
           screen.GetScreenRect(color, size, startRow, startCol, endRow, endCol, PLANE_COLOR);
           screen.GetScreenRect(extended, size, startRow, startCol, endRow, endCol, PLANE_EXTENDED);
***************
*** 743,746 ****
--- 746,750 ----
  
        public char[] text;
+       public char[] attr;
        public char[] color;
        public char[] extended;
***************
*** 776,780 ****
  
  //      int attr = planes.getCharAttr(pos);
!       int attr = planes.getCharAttr(s.getPos(row,col));
        sChar[0] = updateRect.text[pos];
        setDrawAttr(pos);
--- 780,784 ----
  
  //      int attr = planes.getCharAttr(pos);
!       int attr = updateRect.attr[pos];
        sChar[0] = updateRect.text[pos];
        setDrawAttr(pos);

Index: Screen5250.java
===================================================================
RCS file: /cvsroot/tn5250j/tn5250j/src/org/tn5250j/Screen5250.java,v
retrieving revision 1.71
retrieving revision 1.72
diff -C2 -d -r1.71 -r1.72
*** Screen5250.java	11 Jul 2004 09:17:58 -0000	1.71
--- Screen5250.java	12 Jul 2004 04:22:02 -0000	1.72
***************
*** 48,52 ****
  
  	private ScreenFields screenFields;
- 	private int errorLineNum;
  	public Font font;
  	private int lastAttr;
--- 48,51 ----
***************
*** 106,110 ****
  	private boolean updateFont;
  	public boolean pendingInsert = false;
! 	private Gui5250 gui;
  	protected int cursorSize = 0;
  	private boolean hotSpots = false;
--- 105,109 ----
  	private boolean updateFont;
  	public boolean pendingInsert = false;
! 	protected Gui5250 gui;
  	protected int cursorSize = 0;
  	private boolean hotSpots = false;
***************
*** 230,234 ****
  		restriction = new Rectangle(0, 0);
  
- 		errorLineNum = numRows;
  		updateCursorLoc = false;
  		FontRenderContext frc = new FontRenderContext(font.getTransform(),
--- 229,232 ----
***************
*** 284,288 ****
  //			screen[y].setRowCol(getRow(y), getCol(y));
  //		}
- 		errorLineNum = numRows;
  
        planes.setSize(rows);
--- 282,285 ----
***************
*** 4676,4683 ****
  	public void setErrorLine(int line) {
  
! 		if (line == 0 || line > numRows)
! 			errorLineNum = numRows;
! 		else
! 			errorLineNum = line;
  	}
  
--- 4673,4677 ----
  	public void setErrorLine(int line) {
  
! 		planes.setErrorLine(line);
  	}
  
***************
*** 4688,4692 ****
  	 */
  	public int getErrorLine() {
! 		return errorLineNum;
  	}
  
--- 4682,4686 ----
  	 */
  	public int getErrorLine() {
! 		return planes.getErrorLine();
  	}
  
***************
*** 4695,4712 ****
  	 *
  	 */
! 	public void saveErrorLine() {
! //		// if there is already an error line saved then do not save it again
! //		//  This signifies that there was a previous error and the original error
! //		//  line was not restored yet.
! //		if (errorLine == null) {
! //			errorLine = new ScreenChar[numCols];
! //			int r = getPos(errorLineNum - 1, 0);
! //
! //			for (int x = 0; x < numCols; x++) {
! //				errorLine[x] = new ScreenChar(this);
! //				errorLine[x].setCharAndAttr(screen[r + x].getChar(), screen[r
! //						+ x].getCharAttr(), false);
! //			}
! //		}
        planes.saveErrorLine();
  	}
--- 4689,4693 ----
  	 *
  	 */
! 	protected void saveErrorLine() {
        planes.saveErrorLine();
  	}
***************
*** 4717,4725 ****
  	 * @see #saveErrorLine()
  	 */
! 	public void restoreErrorLine() {
  
  		if (planes.isErrorLineSaved()) {
           planes.restoreErrorLine();
!          int y = fmHeight * planes.getErrorLine();
  			updateImage(0, y, bi.getWidth(), fmHeight);
  		}
--- 4698,4706 ----
  	 * @see #saveErrorLine()
  	 */
! 	protected void restoreErrorLine() {
  
  		if (planes.isErrorLineSaved()) {
           planes.restoreErrorLine();
!          int y = fmHeight * (planes.getErrorLine()-1);
  			updateImage(0, y, bi.getWidth(), fmHeight);
  		}
***************
*** 4860,4864 ****
  	}
  
! 	protected synchronized void updateImage(int x, int y, int width, int height) {
  
  		if (gg2d == null) {
--- 4841,4845 ----
  	}
  
! 	protected void updateImage(int x, int y, int width, int height) {
  
  		if (gg2d == null) {



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