tn5250j/src/org/tn5250j DataStreamProducer.java,1.8,1.9 GlobalConfigure.java,1.14,1.15 Gui5250.java,1.57,1.58 Gui5250Frame.java,1.17,1.18 Gui5250MDIFrame.java,1.16,1.17 Gui5250SplitFrame.java,1.2,1.3 GuiGraphicBuffer.java,1.15,1.16 KeyStrokenizer.java,1.4,1.5 My5250.java,1.31,1.32 My5250App.java,1.13,1.14 Screen5250.java,1.50,1.51 SessionManager.java,1.6,1.7 Sessions.java,1.7,1.8 tnvt.java,1.39,1.40
Barry van Someren <[email protected]> Wed, 14 Apr 2004 12:15:55 +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-serv19814/src/org/tn5250j
Modified Files:
DataStreamProducer.java GlobalConfigure.java Gui5250.java
Gui5250Frame.java Gui5250MDIFrame.java Gui5250SplitFrame.java
GuiGraphicBuffer.java KeyStrokenizer.java My5250.java
My5250App.java Screen5250.java SessionManager.java
Sessions.java tnvt.java
Log Message:
+Minor fix to bounds checking on a rubberband
+Logging code added (WIP)
+log4j.properties is the logging config for now
Note, code will be mass converted to commons logging when all statements are done
Index: DataStreamProducer.java
===================================================================
RCS file: /cvsroot/tn5250j/tn5250j/src/org/tn5250j/DataStreamProducer.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** DataStreamProducer.java 15 Feb 2004 12:55:49 -0000 1.8
--- DataStreamProducer.java 14 Apr 2004 12:15:52 -0000 1.9
***************
*** 3,6 ****
--- 3,8 ----
import java.io.*;
import java.net.*;
+
+ import org.apache.log4j.Logger;
import org.tn5250j.encoding.CodePage;
***************
*** 18,22 ****
private boolean dumpBytes = false;
private CodePage codePage;
!
public DataStreamProducer(tnvt vt, BufferedInputStream in, DataStreamQueue queue, byte[] init) {
bin = in;
--- 20,26 ----
private boolean dumpBytes = false;
private CodePage codePage;
!
! private Logger log = Logger.getLogger(this.getClass());
!
public DataStreamProducer(tnvt vt, BufferedInputStream in, DataStreamQueue queue, byte[] init) {
bin = in;
***************
*** 50,54 ****
}
catch (IOException ioef) {
! System.out.println(" run() " + ioef.getMessage());
}
while (!done) {
--- 54,58 ----
}
catch (IOException ioef) {
! log.warn(" run() " + ioef.getMessage());
}
while (!done) {
***************
*** 77,81 ****
catch (SocketException se) {
// System.out.println(" DataStreamProducer thread interrupted and stopping " + se.getMessage());
! System.out.println(" DataStreamProducer thread interrupted and stopping ");
done = true;
}
--- 81,85 ----
catch (SocketException se) {
// System.out.println(" DataStreamProducer thread interrupted and stopping " + se.getMessage());
! log.warn(" DataStreamProducer thread interrupted and stopping ");
done = true;
}
***************
*** 83,87 ****
catch (IOException ioe) {
! // System.out.println(ioe.getMessage());
if (me.isInterrupted())
done = true;
--- 87,91 ----
catch (IOException ioe) {
! log.warn(ioe.getMessage());
if (me.isInterrupted())
done = true;
***************
*** 90,94 ****
catch (Exception ex) {
! System.out.println(ex.getMessage());
if (me.isInterrupted())
done = true;
--- 94,98 ----
catch (Exception ex) {
! log.warn(ex.getMessage());
if (me.isInterrupted())
done = true;
***************
*** 117,121 ****
inter = null;
j = (abyte0[i] & 0xff) << 8 | abyte0[i + 1] & 0xff;
! // System.out.println("partial stream found");
}
--- 121,125 ----
inter = null;
j = (abyte0[i] & 0xff) << 8 | abyte0[i + 1] & 0xff;
! log.debug("partial stream found");
}
***************
*** 123,127 ****
saveStream = new byte[abyte0.length];
System.arraycopy(abyte0, 0, saveStream, 0, abyte0.length);
! // System.out.println("partial stream saved");
}
else {
--- 127,131 ----
saveStream = new byte[abyte0.length];
System.arraycopy(abyte0, 0, saveStream, 0, abyte0.length);
! log.debug("partial stream saved");
}
else {
***************
*** 137,141 ****
catch (Exception ex) {
! System.out.println("load stream error " + ex.getMessage());
// ex.printStackTrace();
// dump(abyte0);
--- 141,145 ----
catch (Exception ex) {
! log.warn("load stream error " + ex.getMessage());
// ex.printStackTrace();
// dump(abyte0);
***************
*** 241,245 ****
}
catch (FileNotFoundException fnfe) {
! System.out.println(fnfe.getMessage());
}
--- 245,249 ----
}
catch (FileNotFoundException fnfe) {
! log.warn(fnfe.getMessage());
}
***************
*** 259,267 ****
catch(IOException ioe) {
! System.out.println(ioe.getMessage());
}
}
! System.out.println("Data Stream output is now " + dumpBytes);
}
--- 263,271 ----
catch(IOException ioe) {
! log.warn(ioe.getMessage());
}
}
! log.info("Data Stream output is now " + dumpBytes);
}
***************
*** 269,273 ****
try {
! System.out.print("\n Buffer Dump of data from AS400: ");
dw.write("\r\n Buffer Dump of data from AS400: ".getBytes());
--- 273,277 ----
try {
! log.info("\n Buffer Dump of data from AS400: ");
dw.write("\r\n Buffer Dump of data from AS400: ".getBytes());
***************
*** 317,321 ****
catch(EOFException _ex) { }
catch(Exception _ex) {
! System.out.println("Cannot dump from host\n\r");
}
--- 321,325 ----
catch(EOFException _ex) { }
catch(Exception _ex) {
! log.warn("Cannot dump from host\n\r");
}
Index: My5250App.java
===================================================================
RCS file: /cvsroot/tn5250j/tn5250j/src/org/tn5250j/My5250App.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** My5250App.java 31 Mar 2004 12:25:07 -0000 1.13
--- My5250App.java 14 Apr 2004 12:15:53 -0000 1.14
***************
*** 4,7 ****
--- 4,9 ----
import javax.swing.*;
import java.util.*;
+
+ import org.apache.log4j.Logger;
import org.tn5250j.tools.LangTool;
***************
*** 9,13 ****
boolean isStandalone = true;
private SessionManager manager;
!
/**Get a parameter value*/
public String getParameter(String key, String def) {
--- 11,17 ----
boolean isStandalone = true;
private SessionManager manager;
!
! private Logger log = Logger.getLogger(this.getClass());
!
/**Get a parameter value*/
public String getParameter(String key, String def) {
***************
*** 27,31 ****
}
catch(Exception e) {
! e.printStackTrace();
}
}
--- 31,35 ----
}
catch(Exception e) {
! log.warn("In constructor: ", e);
}
}
***************
*** 36,40 ****
Properties sesProps = new Properties();
! System.out.println(" We have loaded a new one");
// Start loading properties - Host must exist
--- 40,44 ----
Properties sesProps = new Properties();
! log.info(" We have loaded a new one");
// Start loading properties - Host must exist
***************
*** 123,127 ****
if (getParameter(parm) != null) {
! System.out.println("Parameter " + parm + " is specified as: " + getParameter(parm));
return true;
}
--- 127,131 ----
if (getParameter(parm) != null) {
! log.info("Parameter " + parm + " is specified as: " + getParameter(parm));
return true;
}
Index: Sessions.java
===================================================================
RCS file: /cvsroot/tn5250j/tn5250j/src/org/tn5250j/Sessions.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** Sessions.java 31 Mar 2004 12:25:07 -0000 1.7
--- Sessions.java 14 Apr 2004 12:15:53 -0000 1.8
***************
*** 21,24 ****
--- 21,25 ----
*
*/
+ import org.apache.log4j.Logger;
import org.tn5250j.interfaces.SessionsInterface;
***************
*** 36,40 ****
private int count = 0;
private Timer heartBeater;
!
public Sessions() {
--- 37,43 ----
private int count = 0;
private Timer heartBeater;
!
! private Logger log = Logger.getLogger(this.getClass());
!
public Sessions() {
***************
*** 50,58 ****
if (ses.isConnected() && ses.isSendKeepAlive()) {
ses.getVT().sendHeartBeat();
! System.out.println(" sent heartbeat to " + ses.getSessionName());
}
}
catch (Exception ex) {
! System.out.println(ex.getMessage());
}
}
--- 53,61 ----
if (ses.isConnected() && ses.isSendKeepAlive()) {
ses.getVT().sendHeartBeat();
! log.info(" sent heartbeat to " + ses.getSessionName());
}
}
catch (Exception ex) {
! log.warn(ex.getMessage());
}
}
***************
*** 62,65 ****
--- 65,69 ----
protected void addSession(Session newSession) {
sessions.add(newSession);
+ log.debug("adding Session: "+newSession.getSessionName());
if (newSession.isSendKeepAlive() && heartBeater == null) {
heartBeater = new Timer(15000,this);
***************
*** 72,75 ****
--- 76,80 ----
protected void removeSession(Session session) {
+ log.debug("Removing session: "+session.getSessionName());
if (session != null) {
if (session.isConnected())
***************
*** 81,85 ****
protected void removeSession(String sessionName) {
!
removeSession((Session)item(sessionName));
--- 86,90 ----
protected void removeSession(String sessionName) {
! log.debug("Remove session by name: "+sessionName);
removeSession((Session)item(sessionName));
***************
*** 87,90 ****
--- 92,96 ----
protected void removeSession(int index) {
+ log.debug("Remove session by index: "+index);
removeSession((Session)item(index));
}
Index: KeyStrokenizer.java
===================================================================
RCS file: /cvsroot/tn5250j/tn5250j/src/org/tn5250j/KeyStrokenizer.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** KeyStrokenizer.java 22 Jul 2002 17:52:11 -0000 1.4
--- KeyStrokenizer.java 14 Apr 2004 12:15:53 -0000 1.5
***************
*** 1,4 ****
--- 1,6 ----
package org.tn5250j;
+ import org.apache.log4j.Logger;
+
/*
* @(#)KeyStrokenizer.java
***************
*** 23,27 ****
public class KeyStrokenizer {
!
public KeyStrokenizer() {
--- 25,31 ----
public class KeyStrokenizer {
!
! private Logger log = Logger.getLogger(this.getClass());
!
public KeyStrokenizer() {
***************
*** 34,38 ****
if (strokes != null) {
keyStrokes.setLength(0);
! // System.out.println("set "+ keyStrokes);
length = strokes.length();
}
--- 38,42 ----
if (strokes != null) {
keyStrokes.setLength(0);
! log.debug("set "+ keyStrokes);
length = strokes.length();
}
***************
*** 68,72 ****
// we need to throw an error here
if(index >= length) {
! System.out.println(" mnemonic key was incomplete :1 " +
"at position " + index + " len " + length );
}
--- 72,76 ----
// we need to throw an error here
if(index >= length) {
! log.warn(" mnemonic key was incomplete :1 " +
"at position " + index + " len " + length );
}
***************
*** 90,94 ****
// find an ending for the potential mnemonic
if(index >= length) {
! System.out.println(
" mnemonic key was incomplete ending not found :2 " +
"at position " + index);
--- 94,98 ----
// find an ending for the potential mnemonic
if(index >= length) {
! log.warn(
" mnemonic key was incomplete ending not found :2 " +
"at position " + index);
***************
*** 104,108 ****
index++;
if(index >= length) {
! System.out.println(
" mnemonic key was incomplete ending not found :3 " +
"at position " + index);
--- 108,112 ----
index++;
if(index >= length) {
! log.warn(
" mnemonic key was incomplete ending not found :3 " +
"at position " + index);
***************
*** 118,122 ****
}
else {
! System.out.println(
" mnemonic key was incomplete beginning not found :4 " +
"at position " + index);
--- 122,126 ----
}
else {
! log.warn(
" mnemonic key was incomplete beginning not found :4 " +
"at position " + index);
***************
*** 134,138 ****
}
! // System.out.println("next "+ keyStrokes);
return s;
--- 138,142 ----
}
! log.debug("next "+ keyStrokes);
return s;
Index: Screen5250.java
===================================================================
RCS file: /cvsroot/tn5250j/tn5250j/src/org/tn5250j/Screen5250.java,v
retrieving revision 1.50
retrieving revision 1.51
diff -C2 -d -r1.50 -r1.51
*** Screen5250.java 31 Mar 2004 12:25:07 -0000 1.50
--- Screen5250.java 14 Apr 2004 12:15:53 -0000 1.51
***************
*** 34,37 ****
--- 34,38 ----
import java.beans.*;
+ import org.apache.log4j.Logger;
import org.tn5250j.tools.*;
import org.tn5250j.tools.system.OperatingSystem;
***************
*** 166,169 ****
--- 167,172 ----
private javax.swing.Timer blinker;
+ private Logger log = Logger.getLogger(this.getClass());
+
public Screen5250(Gui5250 gui, SessionConfig config) {
***************
*** 182,186 ****
}
catch(Exception ex) {
! ex.printStackTrace();
}
}
--- 185,189 ----
}
catch(Exception ex) {
! log.warn("In constructor: ", ex);
}
}
***************
*** 741,745 ****
if (pn.equals("cursorBlink")) {
! System.out.println(getStringProperty("cursorBlink"));
if (pce.getNewValue().equals("Yes")) {
--- 744,749 ----
if (pn.equals("cursorBlink")) {
!
! log.debug(getStringProperty("cursorBlink"));
if (pce.getNewValue().equals("Yes")) {
***************
*** 835,839 ****
// to translate as offset 0,0
int pos = getPosFromView(end.x,end.y);
!
int x = screen[pos].x + fmWidth - 1;
int y = screen[pos].y + fmHeight - 1;
--- 839,845 ----
// 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;
***************
*** 872,876 ****
gui.repaint();
! System.out.println("Copying" + workR);
// loop through all the screen characters to send them to the clip board
--- 878,882 ----
gui.repaint();
! log.debug("Copying" + workR);
// loop through all the screen characters to send them to the clip board
***************
*** 960,964 ****
}
}
! System.out.println("pasted >" + pd + "<");
int col = getCol(lastPos);
--- 966,970 ----
}
}
! log.debug("pasted >" + pd + "<");
int col = getCol(lastPos);
***************
*** 998,1002 ****
}
catch (Throwable exc) {
! System.err.println(exc);
}
}
--- 1004,1008 ----
}
catch (Throwable exc) {
! log.warn(""+exc.getMessage());
}
}
***************
*** 1008,1012 ****
screenFields.saveCurrentField();
isInField(pos);
! System.out.println("Copying");
StringSelection contents = new StringSelection(screenFields.getCurrentFieldText());
cb.setContents(contents, null);
--- 1014,1018 ----
screenFields.saveCurrentField();
isInField(pos);
! log.debug("Copying");
StringSelection contents = new StringSelection(screenFields.getCurrentFieldText());
cb.setContents(contents, null);
***************
*** 1072,1076 ****
// gui.repaint();
! // System.out.println("Summing");
// obtain the decimal format for parsing
--- 1078,1082 ----
// gui.repaint();
! log.debug("Summing");
// obtain the decimal format for parsing
***************
*** 1133,1137 ****
m++;
}
! // System.out.println(sum);
return sumVector;
}
--- 1139,1143 ----
m++;
}
! log.debug(""+sum);
return sumVector;
}
***************
*** 1141,1146 ****
int pos = getPosFromView(e.getX(),e.getY());
! // System.out.println((getRow(pos)) + "," + (getCol(pos)));
! // System.out.println(e.getX() + "," + e.getY()+ "," + fmWidth+ "," + fmHeight);
if (pos < 0)
return ;
--- 1147,1154 ----
int pos = getPosFromView(e.getX(),e.getY());
! if(log.isDebugEnabled()) {
! log.debug((getRow(pos)) + "," + (getCol(pos)));
! log.debug(e.getX() + "," + e.getY()+ "," + fmWidth+ "," + fmHeight);
! }
if (pos < 0)
return ;
***************
*** 1178,1183 ****
}
else {
! // System.out.println(" Hotspot clicked!!! we will send character " +
! // screen[pos].getChar());
//
aid.append(screen[pos].getChar());
--- 1186,1191 ----
}
else {
! log.debug(" Hotspot clicked!!! we will send character " +
! screen[pos].getChar());
//
aid.append(screen[pos].getChar());
***************
*** 1210,1214 ****
case ScreenChar.BUTTON_MIDDLE_EB:
case ScreenChar.BUTTON_RIGHT_EB:
! System.out.println("Send to external Browser");
break;
--- 1218,1222 ----
case ScreenChar.BUTTON_MIDDLE_EB:
case ScreenChar.BUTTON_RIGHT_EB:
! log.info("Send to external Browser");
break;
***************
*** 1649,1653 ****
}
else
! System.out.println(" send keys mnemonic " + s);
}
if (keyboardLocked) {
--- 1657,1661 ----
}
else
! log.info(" send keys mnemonic " + s);
}
if (keyboardLocked) {
***************
*** 2281,2285 ****
break;
default :
! System.out.println(" Mnemonic not supported " + mnem);
break;
--- 2289,2293 ----
break;
default :
! log.info(" Mnemonic not supported " + mnem);
break;
Index: Gui5250Frame.java
===================================================================
RCS file: /cvsroot/tn5250j/tn5250j/src/org/tn5250j/Gui5250Frame.java,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** Gui5250Frame.java 28 Nov 2003 13:21:03 -0000 1.17
--- Gui5250Frame.java 14 Apr 2004 12:15:52 -0000 1.18
***************
*** 33,36 ****
--- 33,37 ----
import javax.swing.event.ChangeEvent;
+ import org.apache.log4j.Logger;
import org.tn5250j.event.SessionJumpListener;
import org.tn5250j.event.SessionJumpEvent;
***************
*** 51,55 ****
private boolean hideTabBar = false;
public static int count = 0;
!
//Construct the frame
public Gui5250Frame(My5250 m) {
--- 52,57 ----
private boolean hideTabBar = false;
public static int count = 0;
! private Logger log = Logger.getLogger(this.getClass());
!
//Construct the frame
public Gui5250Frame(My5250 m) {
***************
*** 353,357 ****
int index = sessionPane.indexOfComponent(targetSession);
! System.out.println("session found and closing down " + index);
targetSession.removeSessionListener(this);
targetSession.removeSessionJumpListener(this);
--- 355,359 ----
int index = sessionPane.indexOfComponent(targetSession);
! log.info("session found and closing down " + index);
targetSession.removeSessionListener(this);
targetSession.removeSessionJumpListener(this);
Index: GuiGraphicBuffer.java
===================================================================
RCS file: /cvsroot/tn5250j/tn5250j/src/org/tn5250j/GuiGraphicBuffer.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** GuiGraphicBuffer.java 15 Feb 2004 12:55:49 -0000 1.15
--- GuiGraphicBuffer.java 14 Apr 2004 12:15:53 -0000 1.16
***************
*** 35,38 ****
--- 35,40 ----
import java.awt.font.*;
+ import org.apache.log4j.Logger;
+
public class GuiGraphicBuffer {
***************
*** 65,69 ****
private boolean resized = false;
private boolean antialiased;
!
public GuiGraphicBuffer () {
--- 67,73 ----
private boolean resized = false;
private boolean antialiased;
!
! private Logger log = Logger.getLogger("GFX");
!
public GuiGraphicBuffer () {
***************
*** 341,345 ****
// wait until there is something to read
while (bi == null) {
! System.out.println(" bi = null ");
lock.wait();
}
--- 345,349 ----
// wait until there is something to read
while (bi == null) {
! log.debug(" bi = null ");
lock.wait();
}
***************
*** 354,358 ****
}
catch (InterruptedException ie) {
! System.out.println("getDrawingarea : " + ie.getMessage());
return null;
}
--- 358,362 ----
}
catch (InterruptedException ie) {
! log.warn("getDrawingarea : " + ie.getMessage());
return null;
}
***************
*** 365,369 ****
*/
if (gg2d == null) {
! System.out.println(" we got a null graphic object ");
return;
}
--- 369,373 ----
*/
if (gg2d == null) {
! log.debug(" we got a null graphic object ");
return;
}
***************
*** 383,387 ****
*/
if (gg2d == null) {
! // System.out.println(" we got a null graphic object ");
return;
}
--- 387,391 ----
*/
if (gg2d == null) {
! log.debug(" we got a null graphic object ");
return;
}
***************
*** 420,424 ****
// wait until there is something to read
while (bi == null) {
! System.out.println( " bi = null wa ");
lock.wait();
}
--- 424,428 ----
// wait until there is something to read
while (bi == null) {
! log.debug( " bi = null wa ");
lock.wait();
}
***************
*** 445,449 ****
}
catch (InterruptedException ie) {
! System.out.println("getWritingarea : " + ie.getMessage());
return null;
}
--- 449,453 ----
}
catch (InterruptedException ie) {
! log.warn("getWritingarea : " + ie.getMessage());
return null;
}
***************
*** 502,506 ****
catch (Exception e) {
! System.out.println(" gui graphics setStatus " + e.getMessage());
}
--- 506,510 ----
catch (Exception e) {
! log.warn(" gui graphics setStatus " + e.getMessage());
}
Index: Gui5250MDIFrame.java
===================================================================
RCS file: /cvsroot/tn5250j/tn5250j/src/org/tn5250j/Gui5250MDIFrame.java,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** Gui5250MDIFrame.java 9 Jul 2003 18:55:40 -0000 1.16
--- Gui5250MDIFrame.java 14 Apr 2004 12:15:53 -0000 1.17
***************
*** 30,33 ****
--- 30,35 ----
import javax.swing.*;
import java.util.*;
+
+ import org.apache.log4j.Logger;
import org.tn5250j.event.SessionJumpListener;
import org.tn5250j.event.SessionJumpEvent;
***************
*** 55,59 ****
static int openFrameCount = 0;
private Vector myFrameList;
!
//Construct the frame
public Gui5250MDIFrame(My5250 m) {
--- 57,62 ----
static int openFrameCount = 0;
private Vector myFrameList;
! private Logger log = Logger.getLogger(this.getClass());
!
//Construct the frame
public Gui5250MDIFrame(My5250 m) {
***************
*** 64,68 ****
}
catch(Exception e) {
! e.printStackTrace();
}
}
--- 67,71 ----
}
catch(Exception e) {
! log.warn("In constructor: "+e);
}
}
***************
*** 153,159 ****
MyInternalFrame mif = (MyInternalFrame)myFrameList.get(x);
! // System.out.println(" current index " + x + " count " + frames.length + " has focus " +
! // mif.isActive() + " title " + mif.getTitle() + " seq " + seq +
! // " id " + mif.getInternalId());
if (mix.equals(mif)) {
--- 156,162 ----
MyInternalFrame mif = (MyInternalFrame)myFrameList.get(x);
! log.debug(" current index " + x + " count " + frames.length + " has focus " +
! mif.isActive() + " title " + mif.getTitle() + " seq " + seq +
! " id " + mif.getInternalId());
if (mix.equals(mif)) {
***************
*** 188,192 ****
}
catch (java.beans.PropertyVetoException e) {
! System.out.println(e.getMessage());
}
}
--- 191,195 ----
}
catch (java.beans.PropertyVetoException e) {
! log.warn(e.getMessage());
}
}
***************
*** 216,222 ****
MyInternalFrame mif = (MyInternalFrame)myFrameList.get(x);
! // System.out.println(" current index " + x + " count " + frames.length + " has focus " +
! // mif.isActive() + " title " + mif.getTitle() + " seq " + seq +
! // " id " + mif.getInternalId());
if (mix.equals(mif)) {
--- 219,225 ----
MyInternalFrame mif = (MyInternalFrame)myFrameList.get(x);
! log.debug(" current index " + x + " count " + frames.length + " has focus " +
! mif.isActive() + " title " + mif.getTitle() + " seq " + seq +
! " id " + mif.getInternalId());
if (mix.equals(mif)) {
***************
*** 239,243 ****
}
catch (java.beans.PropertyVetoException e) {
! System.out.println(e.getMessage());
}
// System.out.println(" current index " + index + " count " + desktop.getComponentCount());
--- 242,246 ----
}
catch (java.beans.PropertyVetoException e) {
! log.warn(e.getMessage());
}
// System.out.println(" current index " + index + " count " + desktop.getComponentCount());
***************
*** 272,276 ****
}
catch (java.beans.PropertyVetoException pve) {
! System.out.println("Can not set maximum " + pve.getMessage());
}
--- 275,279 ----
}
catch (java.beans.PropertyVetoException pve) {
! log.warn("Can not set maximum " + pve.getMessage());
}
***************
*** 281,285 ****
int index = getIndexOfSession(targetSession);
MyInternalFrame nextMIF = getNextInternalFrame();
! System.out.println("session found and closing down " + index);
targetSession.removeSessionListener(this);
targetSession.removeSessionJumpListener(this);
--- 284,288 ----
int index = getIndexOfSession(targetSession);
MyInternalFrame nextMIF = getNextInternalFrame();
! log.info("session found and closing down " + index);
targetSession.removeSessionListener(this);
targetSession.removeSessionJumpListener(this);
***************
*** 287,293 ****
MyInternalFrame mif = (MyInternalFrame)frames[index];
int count = getSessionViewCount();
! // System.out.println(" num of frames before removal " + myFrameList.size());
myFrameList.remove(mif);
! // System.out.println(" num of frames left " + myFrameList.size());
desktop.remove(index);
--- 290,296 ----
MyInternalFrame mif = (MyInternalFrame)frames[index];
int count = getSessionViewCount();
! log.debug(" num of frames before removal " + myFrameList.size());
myFrameList.remove(mif);
! log.debug(" num of frames left " + myFrameList.size());
desktop.remove(index);
***************
*** 300,304 ****
}
catch (java.beans.PropertyVetoException e) {
! System.out.println(e.getMessage());
}
}
--- 303,307 ----
}
catch (java.beans.PropertyVetoException e) {
! log.warn(e.getMessage());
}
}
***************
*** 330,337 ****
final String d = ses.getAllocDeviceName();
if (d != null) {
! System.out.println(changeEvent.getState() + " " + d);
final int index = getIndexOfSession(ses);
! // System.out.println(" index of session " + index + " num frames " + desktop.getAllFrames().length);
if (index == -1)
return;
--- 333,340 ----
final String d = ses.getAllocDeviceName();
if (d != null) {
! log.info(changeEvent.getState() + " " + d);
final int index = getIndexOfSession(ses);
! log.debug(" index of session " + index + " num frames " + desktop.getAllFrames().length);
if (index == -1)
return;
***************
*** 588,592 ****
public void setBoundsForFrame(JComponent f, int x, int y, int w, int h) {
! System.out.println(" we are adjusting ");
if (f instanceof MyInternalFrame == false) {
super.setBoundsForFrame(f, x, y, w, h); // only deal w/internal frames
--- 591,595 ----
public void setBoundsForFrame(JComponent f, int x, int y, int w, int h) {
! log.info(" we are adjusting ");
if (f instanceof MyInternalFrame == false) {
super.setBoundsForFrame(f, x, y, w, h); // only deal w/internal frames
Index: Gui5250SplitFrame.java
===================================================================
RCS file: /cvsroot/tn5250j/tn5250j/src/org/tn5250j/Gui5250SplitFrame.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Gui5250SplitFrame.java 9 Jul 2003 18:55:39 -0000 1.2
--- Gui5250SplitFrame.java 14 Apr 2004 12:15:53 -0000 1.3
***************
*** 33,36 ****
--- 33,37 ----
import javax.swing.event.ListSelectionListener;
+ import org.apache.log4j.Logger;
import org.tn5250j.interfaces.GUIViewInterface;
import org.tn5250j.event.SessionJumpListener;
***************
*** 55,59 ****
private JScrollPane scroller;
private JPanel toolsPanel;
!
//Construct the frame
public Gui5250SplitFrame(My5250 m) {
--- 56,62 ----
private JScrollPane scroller;
private JPanel toolsPanel;
!
! private Logger log = Logger.getLogger(this.getClass());
!
//Construct the frame
public Gui5250SplitFrame(My5250 m) {
***************
*** 66,70 ****
}
catch(Exception e) {
! e.printStackTrace();
}
}
--- 69,73 ----
}
catch(Exception e) {
! log.warn("In constructor: "+e);
}
}
Index: tnvt.java
===================================================================
RCS file: /cvsroot/tn5250j/tn5250j/src/org/tn5250j/tnvt.java,v
retrieving revision 1.39
retrieving revision 1.40
diff -C2 -d -r1.39 -r1.40
*** tnvt.java 31 Mar 2004 12:25:07 -0000 1.39
--- tnvt.java 14 Apr 2004 12:15:53 -0000 1.40
***************
*** 32,35 ****
--- 32,36 ----
import java.awt.event.*;
+ import org.apache.log4j.Logger;
import org.tn5250j.encoding.CodePage;
import org.tn5250j.encoding.CharMappings;
***************
*** 87,91 ****
private String sslType;
WTDSFParser sfParser;
!
tnvt (Screen5250 screen52) {
--- 88,94 ----
private String sslType;
WTDSFParser sfParser;
!
! private Logger log = Logger.getLogger(this.getClass());
!
tnvt (Screen5250 screen52) {
***************
*** 186,190 ****
System.setProperties(systemProperties);
! System.out.println(" socks set ");
}
--- 189,193 ----
System.setProperties(systemProperties);
! log.info(" socks set ");
}
***************
*** 210,214 ****
}
catch (Exception exc) {
! System.out.println("setStatus(ON) " + exc.getMessage());
}
--- 213,217 ----
}
catch (Exception exc) {
! log.warn("setStatus(ON) " + exc.getMessage());
}
***************
*** 222,226 ****
if (sock == null) {
! System.out.println("I did not get a socket");
disconnect();
return false;
--- 225,229 ----
if (sock == null) {
! log.warn("I did not get a socket");
disconnect();
return false;
***************
*** 245,249 ****
}
catch (Exception excc) {
! System.out.println("setCursorOff " + excc.getMessage());
};
--- 248,252 ----
}
catch (Exception excc) {
! log.warn("setCursorOff " + excc.getMessage());
};
***************
*** 269,273 ****
}
catch (Exception exc) {
! System.out.println("setStatus(OFF) " + exc.getMessage());
}
--- 272,276 ----
}
catch (Exception exc) {
! log.warn("setStatus(OFF) " + exc.getMessage());
}
***************
*** 281,288 ****
if (exception.getMessage() == null)
exception.printStackTrace();
! System.out.println("connect() " + exception.getMessage());
if (sock == null)
! System.out.println("I did not get a socket");
disconnect();
--- 284,291 ----
if (exception.getMessage() == null)
exception.printStackTrace();
! log.warn("connect() " + exception.getMessage());
if (sock == null)
! log.warn("I did not get a socket");
disconnect();
***************
*** 307,311 ****
try {
if (sock != null) {
! System.out.println("Closing socket");
sock.close();
}
--- 310,314 ----
try {
if (sock != null) {
! log.info("Closing socket");
sock.close();
}
***************
*** 320,324 ****
}
catch(Exception exception) {
! System.out.println(exception.getMessage());
connected = false;
devSeq = -1;
--- 323,327 ----
}
catch(Exception exception) {
! log.warn(exception.getMessage());
connected = false;
devSeq = -1;
***************
*** 403,407 ****
catch (IOException ioe) {
! System.out.println(ioe.getMessage());
baosp.reset();
}
--- 406,410 ----
catch (IOException ioe) {
! log.warn(ioe.getMessage());
baosp.reset();
}
***************
*** 439,443 ****
catch (IOException ioe) {
! System.out.println(ioe.getMessage());
baosp.reset();
return false;
--- 442,446 ----
catch (IOException ioe) {
! log.warn(ioe.getMessage());
baosp.reset();
return false;
***************
*** 531,535 ****
catch (IOException ioe) {
! System.out.println(ioe.getMessage());
}
baosp.reset();
--- 534,538 ----
catch (IOException ioe) {
! log.warn(ioe.getMessage());
}
baosp.reset();
***************
*** 562,566 ****
catch (IOException ioe) {
! System.out.println(ioe.getMessage());
}
}
--- 565,569 ----
catch (IOException ioe) {
! log.warn(ioe.getMessage());
}
}
***************
*** 661,665 ****
catch (IOException ioe) {
! System.out.println(ioe.getMessage());
}
baosp.reset();
--- 664,668 ----
catch (IOException ioe) {
! log.warn(ioe.getMessage());
}
baosp.reset();
***************
*** 672,676 ****
catch (IOException ioe) {
! System.out.println(ioe.getMessage());
}
}
--- 675,679 ----
catch (IOException ioe) {
! log.warn(ioe.getMessage());
}
}
***************
*** 688,692 ****
catch (IOException ioe) {
baosp.reset();
! System.out.println(ioe.getMessage());
}
baosp.reset();
--- 691,695 ----
catch (IOException ioe) {
baosp.reset();
! log.warn(ioe.getMessage());
}
baosp.reset();
***************
*** 719,723 ****
catch (IOException ioe) {
! System.out.println(ioe.getMessage());
}
--- 722,726 ----
catch (IOException ioe) {
! log.warn(ioe.getMessage());
}
***************
*** 758,762 ****
catch (IOException ioe) {
! System.out.println(ioe.getMessage());
}
baosp.reset();
--- 761,765 ----
catch (IOException ioe) {
! log.warn(ioe.getMessage());
}
baosp.reset();
***************
*** 846,850 ****
private final void setInvited() {
! // System.out.println("invited");
if (!screen52.isStatusErrorCode())
screen52.setStatus(Screen5250.STATUS_SYSTEM, Screen5250.STATUS_VALUE_OFF,null);
--- 849,853 ----
private final void setInvited() {
! log.debug("invited");
if (!screen52.isStatusErrorCode())
screen52.setStatus(Screen5250.STATUS_SYSTEM, Screen5250.STATUS_VALUE_OFF,null);
***************
*** 864,868 ****
}
catch (InterruptedException ie) {
! System.out.println(" vt thread interrupted and stopping ");
keepTrucking = false;
continue;
--- 867,871 ----
}
catch (InterruptedException ie) {
! log.warn(" vt thread interrupted and stopping ");
keepTrucking = false;
continue;
***************
*** 884,891 ****
switch (bk.getOpCode()) {
case 00:
! // System.out.println("No operation");
break;
case 1:
! // System.out.println("Invite Operation");
parseIncoming();
// screen52.setKeyboardLocked(false);
--- 887,894 ----
switch (bk.getOpCode()) {
case 00:
! log.debug("No operation");
break;
case 1:
! log.debug("Invite Operation");
parseIncoming();
// screen52.setKeyboardLocked(false);
***************
*** 895,899 ****
break;
case 2:
! // System.out.println("Output Only");
parseIncoming();
// System.out.println(screen52.dirty);
--- 898,902 ----
break;
case 2:
! log.debug("Output Only");
parseIncoming();
// System.out.println(screen52.dirty);
***************
*** 904,908 ****
break;
case 3:
! // System.out.println("Put/Get Operation");
parseIncoming();
// inviteIt =true;
--- 907,911 ----
break;
case 3:
! log.debug("Put/Get Operation");
parseIncoming();
// inviteIt =true;
***************
*** 914,953 ****
break;
case 4:
! // System.out.println("Save Screen Operation");
parseIncoming();
break;
case 5:
! // System.out.println("Restore Screen Operation");
parseIncoming();
break;
case 6:
! // System.out.println("Read Immediate");
sendAidKey(0);
break;
case 7:
! // System.out.println("Reserved");
break;
case 8:
! // System.out.println("Read Screen Operation");
try {
readScreen();
}
catch (IOException ex) {
!
}
break;
case 9:
! // System.out.println("Reserved");
break;
case 10:
! // System.out.println("Cancel Invite Operation");
cancelInvite();
break;
case 11:
! // System.out.println("Turn on message light");
screen52.setMessageLightOn();
screen52.setCursorActive(true);
--- 917,956 ----
break;
case 4:
! log.debug("Save Screen Operation");
parseIncoming();
break;
case 5:
! log.debug("Restore Screen Operation");
parseIncoming();
break;
case 6:
! log.debug("Read Immediate");
sendAidKey(0);
break;
case 7:
! log.debug("Reserved");
break;
case 8:
! log.debug("Read Screen Operation");
try {
readScreen();
}
catch (IOException ex) {
! log.warn(ex.getMessage());
}
break;
case 9:
! log.debug("Reserved");
break;
case 10:
! log.debug("Cancel Invite Operation");
cancelInvite();
break;
case 11:
! log.debug("Turn on message light");
screen52.setMessageLightOn();
screen52.setCursorActive(true);
***************
*** 955,959 ****
break;
case 12:
! // System.out.println("Turn off Message light");
screen52.setMessageLightOff();
screen52.setCursorActive(true);
--- 958,962 ----
break;
case 12:
! log.debug("Turn off Message light");
screen52.setMessageLightOff();
screen52.setCursorActive(true);
***************
*** 986,993 ****
screen52.updateDirty();
controller.validate();
! // System.out.println("update dirty");
}
catch (Exception exd ) {
! System.out.println(" tnvt.run: " + exd.getMessage());
exd.printStackTrace();
}
--- 989,996 ----
screen52.updateDirty();
controller.validate();
! log.debug("update dirty");
}
catch (Exception exd ) {
! log.warn(" tnvt.run: " + exd.getMessage());
exd.printStackTrace();
}
***************
*** 1012,1022 ****
public void dumpStuff() {
!
! System.out.println(" Pending unlock " + pendingUnlock);
! System.out.println(" Status Error " + screen52.isStatusErrorCode());
! System.out.println(" Keyboard Locked " + screen52.isKeyboardLocked());
! System.out.println(" Cursor On " + cursorOn);
! System.out.println(" Cursor Active " + screen52.cursorActive);
!
--- 1015,1026 ----
public void dumpStuff() {
!
! if(log.isDebugEnabled()) {
! log.debug(" Pending unlock " + pendingUnlock);
! log.debug(" Status Error " + screen52.isStatusErrorCode());
! log.debug(" Keyboard Locked " + screen52.isKeyboardLocked());
! log.debug(" Cursor On " + cursorOn);
! log.debug(" Cursor Active " + screen52.cursorActive);
! }
***************
*** 1203,1208 ****
sc.write((byte)sf.getFCW1() & 0xff);
sc.write((byte)sf.getFCW2() & 0xff);
! // System.out.println("Saved ");
! // System.out.println(sf.toString());
x++;
--- 1207,1212 ----
sc.write((byte)sf.getFCW1() & 0xff);
sc.write((byte)sf.getFCW2() & 0xff);
! log.debug("Saved ");
! log.debug(sf.toString());
x++;
***************
*** 1221,1229 ****
catch (IOException ioe) {
! System.out.println(ioe.getMessage());
}
sc = null;
! // System.out.println("Save Screen end ");
}
--- 1225,1233 ----
catch (IOException ioe) {
! log.warn(ioe.getMessage());
}
sc = null;
! log.debug("Save Screen end ");
}
***************
*** 1236,1240 ****
int which = 0;
try {
! // System.out.println("Restore ");
bk.getNextByte();
--- 1240,1244 ----
int which = 0;
try {
! log.debug("Restore ");
bk.getNextByte();
***************
*** 1282,1286 ****
int numFields = bk.getNextByte() << 8 & 0xff00;
numFields |= bk.getNextByte() & 0xff;
! // System.out.println("number of fields " + numFields);
if (numFields > 0) {
--- 1286,1290 ----
int numFields = bk.getNextByte() << 8 & 0xff00;
numFields |= bk.getNextByte() & 0xff;
! log.debug("number of fields " + numFields);
if (numFields > 0) {
***************
*** 1325,1333 ****
screen52.getScreenFields().setMasterMDT();
}
!
! // System.out.println("/nRestored ");
! // System.out.println(sf.toString());
! //
! x++;
}
}
--- 1329,1337 ----
screen52.getScreenFields().setMasterMDT();
}
! if(log.isDebugEnabled()) {
! log.debug("/nRestored ");
! log.debug(sf.toString());
! }
! x++;
}
}
***************
*** 1342,1346 ****
}
catch (Exception e) {
! System.out.println("error restoring screen " + which + " with " + e.getMessage());
}
}
--- 1346,1350 ----
}
catch (Exception e) {
! log.warn("error restoring screen " + which + " with " + e.getMessage());
}
}
***************
*** 1369,1373 ****
case CMD_SAVE_SCREEN: // 0x02 2 Save Screen
case 3: // 0x03 3 Save Partial Screen
! // System.out.println("save screen partial");
saveScreen();
break;
--- 1373,1377 ----
case CMD_SAVE_SCREEN: // 0x02 2 Save Screen
case 3: // 0x03 3 Save Partial Screen
! log.debug("save screen partial");
saveScreen();
break;
***************
*** 1385,1389 ****
case CMD_RESTORE_SCREEN: // 0x12 18 Restore Screen
case 13: // 0x13 19 Restore Partial Screen
! // System.out.println("restore screen partial");
restoreScreen();
break;
--- 1389,1393 ----
case CMD_RESTORE_SCREEN: // 0x12 18 Restore Screen
case 13: // 0x13 19 Restore Partial Screen
! log.debug("restore screen partial");
restoreScreen();
break;
***************
*** 1392,1396 ****
int param = bk.getNextByte();
if (param != 0) {
! // System.out.println(" clear unit alternate error " + Integer.toHexString(param));
sendNegResponse(NR_REQUEST_ERROR,03,01,05,
" clear unit alternate not supported");
--- 1396,1400 ----
int param = bk.getNextByte();
if (param != 0) {
! log.debug(" clear unit alternate error " + Integer.toHexString(param));
sendNegResponse(NR_REQUEST_ERROR,03,01,05,
" clear unit alternate not supported");
***************
*** 1471,1475 ****
}
}
! catch (Exception exc) {System.out.println("incoming " + exc.getMessage());};
}
--- 1475,1479 ----
}
}
! catch (Exception exc) {log.warn("incoming " + exc.getMessage());};
}
***************
*** 1501,1505 ****
catch (Exception e) {
! System.out.println("Send Negative Response error " + e.getMessage());
}
--- 1505,1509 ----
catch (Exception e) {
! log.warn("Send Negative Response error " + e.getMessage());
}
***************
*** 1515,1519 ****
catch (IOException ioe) {
! System.out.println(ioe.getMessage());
}
baosp.reset();
--- 1519,1523 ----
catch (IOException ioe) {
! log.warn(ioe.getMessage());
}
baosp.reset();
***************
*** 1532,1536 ****
catch (IOException ioe) {
! System.out.println(ioe.getMessage());
}
--- 1536,1540 ----
catch (IOException ioe) {
! log.warn(ioe.getMessage());
}
***************
*** 1565,1574 ****
case 1: // SOH - Start of Header Order
!
error = processSOH();
break;
case 02: // RA - Repeat to address
!
int row = screen52.getCurrentRow();
int col = screen52.getCurrentCol();
--- 1569,1578 ----
case 1: // SOH - Start of Header Order
! log.debug("SOH - Start of Header Order");
error = processSOH();
break;
case 02: // RA - Repeat to address
! log.debug("RA - Repeat to address");
int row = screen52.getCurrentRow();
int col = screen52.getCurrentCol();
***************
*** 1609,1612 ****
--- 1613,1617 ----
case 03: // EA - Erase to address
+ log.debug("EA - Erase to address");
int EArow = screen52.getCurrentRow();
int EAcol = screen52.getCurrentCol();
***************
*** 1639,1650 ****
--- 1644,1658 ----
break;
case 04: // Command - Escape
+ log.debug("Command - Escape");
done = true;
break;
case 16: // TD - Transparent Data
+ log.debug("TD - Transparent Data");
int j = (bk.getNextByte() & 0xff) << 8 | bk.getNextByte() & 0xff; // length
break;
case 17: // SBA - set buffer address order (row column)
+ log.debug("SBA - set buffer address order (row column)");
int saRow = bk.getNextByte();
int saCol = bk.getNextByte() & 0xff;
***************
*** 1672,1675 ****
--- 1680,1684 ----
case 18: // WEA - Extended Attribute
+ log.debug("WEA - Extended Attribute");
bk.getNextByte();
bk.getNextByte();
***************
*** 1677,1680 ****
--- 1686,1690 ----
case 19: // IC - Insert Cursor
+ log.debug("IC - Insert Cursor");
int icX = bk.getNextByte();
int icY = bk.getNextByte() & 0xff;
***************
*** 1684,1688 ****
icY <= saCols) {
! // System.out.println(" IC " + icX + " " + icY);
screen52.setPendingInsert(true,icX,icY);
}
--- 1694,1698 ----
icY <= saCols) {
! log.debug(" IC " + icX + " " + icY);
screen52.setPendingInsert(true,icX,icY);
}
***************
*** 1695,1698 ****
--- 1705,1709 ----
case 20: // MC - Move Cursor
+ log.debug("MC - Move Cursor");
int imcX = bk.getNextByte();
int imcY = bk.getNextByte() & 0xff;
***************
*** 1702,1706 ****
imcY <= saCols) {
! // System.out.println(" MC " + imcX + " " + imcY);
screen52.setPendingInsert(false,imcX,imcY);
}
--- 1713,1717 ----
imcY <= saCols) {
! log.debug(" MC " + imcX + " " + imcY);
screen52.setPendingInsert(false,imcX,imcY);
}
***************
*** 1713,1716 ****
--- 1724,1728 ----
case 21: // WTDSF - Write To Display Structured Field order
+ log.debug("WTDSF - Write To Display Structured Field order");
byte[] seg = bk.getSegment();
error = sfParser.parseWriteToDisplayStructuredField(seg);
***************
*** 1720,1723 ****
--- 1732,1736 ----
case 29: // SF - Start of Field
+ log.debug("SF - Start of Field");
int fcw1 = 0;
int fcw2 = 0;
***************
*** 1766,1769 ****
--- 1779,1783 ----
default: // all others must be output to screen
+ log.debug("all others must be output to screen");
byte byte0 = bk.getByteOffset(-1);
if (isAttribute(byte0)) {
***************
*** 1805,1809 ****
catch (Exception e) {
! System.out.println("write to display " + e.getMessage());
e.printStackTrace();
};
--- 1819,1823 ----
catch (Exception e) {
! log.warn("write to display " + e.getMessage());
e.printStackTrace();
};
***************
*** 1818,1822 ****
int l = bk.getNextByte(); // length
! // System.out.println(" byte 0 " + l);
if (l > 0 && l <= 7) {
--- 1832,1836 ----
int l = bk.getNextByte(); // length
! log.debug(" byte 0 " + l);
if (l > 0 && l <= 7) {
***************
*** 1870,1880 ****
dataIncluded[0] = (byte1 & 0x1) == 0x1;
}
!
! // if (l >= 5)
! // System.out.println(" byte 5 " + Integer.toBinaryString(bk.getNextByte()));
! // if (l >= 6)
! // System.out.println(" byte 6 " + Integer.toBinaryString(bk.getNextByte()));
! // if (l == 7)
! // System.out.println(" byte 7 " + Integer.toBinaryString(bk.getNextByte()));
return false;
--- 1884,1895 ----
dataIncluded[0] = (byte1 & 0x1) == 0x1;
}
! if(log.isDebugEnabled()) {
! if (l >= 5)
! log.debug(" byte 5 " + Integer.toBinaryString(bk.getNextByte()));
! if (l >= 6)
! log.debug(" byte 6 " + Integer.toBinaryString(bk.getNextByte()));
! if (l == 7)
! log.debug(" byte 7 " + Integer.toBinaryString(bk.getNextByte()));
! }
return false;
***************
*** 1888,1892 ****
private void processCC0 (byte byte0) {
! // System.out.println(" Control byte0 " + Integer.toBinaryString(byte0 & 0xff));
boolean lockKeyboard = true;
boolean resetMDT=false;
--- 1903,1907 ----
private void processCC0 (byte byte0) {
! log.debug(" Control byte0 " + Integer.toBinaryString(byte0 & 0xff));
boolean lockKeyboard = true;
boolean resetMDT=false;
***************
*** 1970,1974 ****
private void processCC1 (byte byte1) {
! // System.out.println(" Control byte1 " + Integer.toBinaryString(byte1 & 0xff));
if ((byte1 & 0x04) == 0x04) {
--- 1985,1989 ----
private void processCC1 (byte byte1) {
! log.debug(" Control byte1 " + Integer.toBinaryString(byte1 & 0xff));
if ((byte1 & 0x04) == 0x04) {
***************
*** 1996,2007 ****
if ((byte1 & 0x20) == 0x20 && (byte1 & 0x08) == 0x00) {
screen52.setPendingInsert(false);
! // System.out.println(" WTD position no move");
}
else {
screen52.setPendingInsert(true);
! // System.out.println(" WTD position move to home" + screen52.homePos +
! // " row " + screen52.getRow(screen52.homePos) +
! // " col " + screen52.getCol(screen52.homePos) );
}
--- 2011,2022 ----
if ((byte1 & 0x20) == 0x20 && (byte1 & 0x08) == 0x00) {
screen52.setPendingInsert(false);
! log.debug(" WTD position no move");
}
else {
screen52.setPendingInsert(true);
! log.debug(" WTD position move to home" + screen52.homePos +
! " row " + screen52.getRow(screen52.homePos) +
! " col " + screen52.getCol(screen52.homePos) );
}
***************
*** 2598,2607 ****
break;
default:
! System.out.println("invalid structured field sub command " + bk.getByteOffset(-1));
break;
}
break;
default:
! System.out.println("invalid structured field command " + bk.getByteOffset(-1));
break;
}
--- 2613,2622 ----
break;
default:
! log.debug("invalid structured field sub command " + bk.getByteOffset(-1));
break;
}
break;
default:
! log.debug("invalid structured field command " + bk.getByteOffset(-1));
break;
}
***************
*** 2647,2651 ****
throws IOException {
! System.out.println("sending query response");
byte abyte0[] = new byte[64];
abyte0[0] = 0; // Cursor Row/column (set to zero)
--- 2662,2666 ----
throws IOException {
! log.info("sending query response");
byte abyte0[] = new byte[64];
abyte0[0] = 0; // Cursor Row/column (set to zero)
***************
*** 2727,2731 ****
// abyte0[53] = 0x27; // 0x5E turns on ehnhanced mode
abyte0[53] = 0x7; // 0x5E turns on ehnhanced mode
! System.out.println("enhanced options");
}
else
--- 2742,2746 ----
// abyte0[53] = 0x27; // 0x5E turns on ehnhanced mode
abyte0[53] = 0x7; // 0x5E turns on ehnhanced mode
! log.info("enhanced options");
}
else
Index: GlobalConfigure.java
===================================================================
RCS file: /cvsroot/tn5250j/tn5250j/src/org/tn5250j/GlobalConfigure.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** GlobalConfigure.java 20 Aug 2003 07:38:17 -0000 1.14
--- GlobalConfigure.java 14 Apr 2004 12:15:52 -0000 1.15
***************
*** 31,34 ****
--- 31,35 ----
import javax.swing.*;
+ import org.apache.log4j.Logger;
import org.tn5250j.interfaces.ConfigureFactory;
***************
*** 60,64 ****
static final private String settingsFile = "tn5250jstartup.cfg";
!
/**
* The constructor is made protected to allow overriding.
--- 61,66 ----
static final private String settingsFile = "tn5250jstartup.cfg";
! private Logger log = Logger.getLogger(this.getClass());
!
/**
* The constructor is made protected to allow overriding.
***************
*** 160,164 ****
}
catch (FileNotFoundException fnfea) {
! System.out.println(" Information Message: "
+ fnfea.getMessage() + ". The file " + settingsFile
+ " will be created for first time use.");
--- 162,166 ----
}
catch (FileNotFoundException fnfea) {
! log.info(" Information Message: "
+ fnfea.getMessage() + ". The file " + settingsFile
+ " will be created for first time use.");
***************
*** 167,176 ****
}
catch (IOException ioea) {
! System.out.println("IO Exception accessing File "
+ settingsFile + " for the following reason : "
+ ioea.getMessage());
}
catch (SecurityException sea) {
! System.out.println("Security Exception for file "
+ settingsFile + " This file can not be "
+ "accessed because : " + sea.getMessage());
--- 169,178 ----
}
catch (IOException ioea) {
! log.warn("IO Exception accessing File "
+ settingsFile + " for the following reason : "
+ ioea.getMessage());
}
catch (SecurityException sea) {
! log.warn("Security Exception for file "
+ settingsFile + " This file can not be "
+ "accessed because : " + sea.getMessage());
***************
*** 178,187 ****
}
catch (IOException ioe) {
! System.out.println("IO Exception accessing File "
+ settingsFile + " for the following reason : "
+ ioe.getMessage());
}
catch (SecurityException se) {
! System.out.println("Security Exception for file "
+ settingsFile + " This file can not be "
+ "accessed because : " + se.getMessage());
--- 180,189 ----
}
catch (IOException ioe) {
! log.warn("IO Exception accessing File "
+ settingsFile + " for the following reason : "
+ ioe.getMessage());
}
catch (SecurityException se) {
! log.warn("Security Exception for file "
+ settingsFile + " This file can not be "
+ "accessed because : " + se.getMessage());
***************
*** 259,266 ****
}
catch (FileNotFoundException e) {
! System.out.println(srcFile + " not found !");
}
catch (IOException e) {
! System.out.println("Global io-error !");
}
catch (ArrayIndexOutOfBoundsException e) {
--- 261,268 ----
}
catch (FileNotFoundException e) {
! log.warn(srcFile + " not found !");
}
catch (IOException e) {
! log.warn("Global io-error !");
}
catch (ArrayIndexOutOfBoundsException e) {
***************
*** 323,337 ****
}
catch (FileNotFoundException fnfe) {
! System.out.println("File not found : writing file "
+ fileName + ". Description of error is "
+ fnfe.getMessage());
}
catch (IOException ioe) {
! System.out.println("IO Exception : writing file "
+ fileName + ". Description of error is "
+ ioe.getMessage());
}
catch (SecurityException se) {
! System.out.println("Security Exception : writing file "
+ fileName + ". Description of error is "
+ se.getMessage());
--- 325,339 ----
}
catch (FileNotFoundException fnfe) {
! log.warn("File not found : writing file "
+ fileName + ". Description of error is "
+ fnfe.getMessage());
}
catch (IOException ioe) {
! log.warn("IO Exception : writing file "
+ fileName + ". Description of error is "
+ ioe.getMessage());
}
catch (SecurityException se) {
! log.warn("Security Exception : writing file "
+ fileName + ". Description of error is "
+ se.getMessage());
***************
*** 389,393 ****
if (createFile) {
! System.out.println(" Information Message: " + fnfe.getMessage()
+ ". The file " + fileName + " will"
+ " be created for first time use.");
--- 391,395 ----
if (createFile) {
! log.info(" Information Message: " + fnfe.getMessage()
+ ". The file " + fileName + " will"
+ " be created for first time use.");
***************
*** 398,402 ****
else {
! System.out.println(" Information Message: " + fnfe.getMessage()
+ ".");
--- 400,404 ----
else {
! log.info(" Information Message: " + fnfe.getMessage()
+ ".");
***************
*** 404,413 ****
}
catch (IOException ioe) {
! System.out.println("IO Exception accessing File "+ fileName +
" for the following reason : "
+ ioe.getMessage());
}
catch (SecurityException se) {
! System.out.println("Security Exception for file "+ fileName
+ ". This file can not be accessed because : "
+ se.getMessage());
--- 406,415 ----
}
catch (IOException ioe) {
! log.warn("IO Exception accessing File "+ fileName +
" for the following reason : "
+ ioe.getMessage());
}
catch (SecurityException se) {
! log.warn("Security Exception for file "+ fileName
+ ". This file can not be accessed because : "
+ se.getMessage());
***************
*** 464,468 ****
if (createFile) {
! System.out.println(" Information Message: " + fnfe.getMessage()
+ ". The file " + fileName + " will"
+ " be created for first time use.");
--- 466,470 ----
if (createFile) {
! log.info(" Information Message: " + fnfe.getMessage()
+ ". The file " + fileName + " will"
+ " be created for first time use.");
***************
*** 477,481 ****
else {
! System.out.println(" Information Message: " + fnfe.getMessage()
+ ".");
--- 479,483 ----
else {
! log.info(" Information Message: " + fnfe.getMessage()
+ ".");
***************
*** 483,492 ****
}
catch (IOException ioe) {
! System.out.println("IO Exception accessing File "+ fileName +
" for the following reason : "
+ ioe.getMessage());
}
catch (SecurityException se) {
! System.out.println("Security Exception for file "+ fileName
+ ". This file can not be accessed because : "
+ se.getMessage());
--- 485,494 ----
}
catch (IOException ioe) {
! log.warn("IO Exception accessing File "+ fileName +
" for the following reason : "
+ ioe.getMessage());
}
catch (SecurityException se) {
! log.warn("Security Exception for file "+ fileName
+ ". This file can not be accessed because : "
+ se.getMessage());
Index: My5250.java
===================================================================
RCS file: /cvsroot/tn5250j/tn5250j/src/org/tn5250j/My5250.java,v
retrieving revision 1.31
retrieving revision 1.32
diff -C2 -d -r1.31 -r1.32
*** My5250.java 23 Jan 2004 12:42:19 -0000 1.31
--- My5250.java 14 Apr 2004 12:15:53 -0000 1.32
***************
*** 34,37 ****
--- 34,38 ----
import java.net.*;
+ import org.apache.log4j.Logger;
import org.tn5250j.tools.*;
import org.tn5250j.tools.system.OperatingSystem;
***************
*** 53,58 ****
private TN5250jSplashScreen splash;
private int step;
! private static String jarClassPaths;
!
My5250 () {
--- 54,60 ----
private TN5250jSplashScreen splash;
private int step;
! private static String jarClassPaths;
! private Logger log = Logger.getLogger(this.getClass());
!
My5250 () {
***************
*** 153,158 ****
public void bootOptionsReceived(BootEvent bootEvent) {
!
! System.out.println(" boot options received " + bootEvent.getNewSessionOptions());
// If the options are not equal to the string 'null' then we have
--- 155,160 ----
public void bootOptionsReceived(BootEvent bootEvent) {
! log.info(" boot options received " + bootEvent.getNewSessionOptions());
! //System.out.println(" boot options received " + bootEvent.getNewSessionOptions());
// If the options are not equal to the string 'null' then we have
***************
*** 652,656 ****
Sessions sess = manager.getSessions();
! System.out.println("number of active sessions we have " + sess.getCount());
int x = 0;
--- 654,658 ----
Sessions sess = manager.getSessions();
! log.info("number of active sessions we have " + sess.getCount());
int x = 0;
***************
*** 659,667 ****
jf = view.getSessionAt(0);
! System.out.println("session found and closing down");
view.removeSessionView(jf);
manager.closeSession(jf);
! System.out.println("disconnecting socket");
! System.out.println("socket closed");
jf = null;
--- 661,669 ----
jf = view.getSessionAt(0);
! log.info("session found and closing down");
view.removeSessionView(jf);
manager.closeSession(jf);
! log.info("disconnecting socket");
! log.info("socket closed");
jf = null;
***************
*** 677,681 ****
view.dispose();
! System.out.println("number of active sessions we have after shutting down " + sess.getCount());
if (sess.getCount() == 0) {
--- 679,683 ----
view.dispose();
! log.info("number of active sessions we have after shutting down " + sess.getCount());
if (sess.getCount() == 0) {
***************
*** 800,809 ****
}
catch (java.lang.NoClassDefFoundError ncdfe) {
! System.out.println("Information Message: Can not find scripting support"
+ " files, scripting will not be available: "
+ "Failed to load interpreter drivers " + ncdfe);
}
catch (Exception ex) {
! System.out.println("Information Message: Can not find scripting support"
+ " files, scripting will not be available: "
+ "Failed to load interpreter drivers " + ex);
--- 802,811 ----
}
catch (java.lang.NoClassDefFoundError ncdfe) {
! log.warn("Information Message: Can not find scripting support"
+ " files, scripting will not be available: "
+ "Failed to load interpreter drivers " + ncdfe);
}
catch (Exception ex) {
! log.warn("Information Message: Can not find scripting support"
+ " files, scripting will not be available: "
+ "Failed to load interpreter drivers " + ex);
Index: SessionManager.java
===================================================================
RCS file: /cvsroot/tn5250j/tn5250j/src/org/tn5250j/SessionManager.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** SessionManager.java 9 Jul 2003 18:55:39 -0000 1.6
--- SessionManager.java 14 Apr 2004 12:15:53 -0000 1.7
***************
*** 21,24 ****
--- 21,25 ----
*
*/
+ import org.apache.log4j.Logger;
import org.tn5250j.interfaces.SessionManagerInterface;
***************
*** 33,37 ****
static private Sessions sessions;
static private Vector configs;
!
/**
* A handle to the unique SessionManager class
--- 34,39 ----
static private Sessions sessions;
static private Vector configs;
!
! private Logger log = Logger.getLogger(this.getClass());
/**
* A handle to the unique SessionManager class
***************
*** 43,47 ****
*/
protected SessionManager() {
-
if (_instance == null) {
// initialize the settings information
--- 45,48 ----
***************
*** 66,70 ****
private void initialize() {
!
sessions = new Sessions();
configs = new Vector(3);
--- 67,71 ----
private void initialize() {
! log.info("New session Manager initialized");
sessions = new Sessions();
configs = new Vector(3);
Index: Gui5250.java
===================================================================
RCS file: /cvsroot/tn5250j/tn5250j/src/org/tn5250j/Gui5250.java,v
retrieving revision 1.57
retrieving revision 1.58
diff -C2 -d -r1.57 -r1.58
*** Gui5250.java 31 Mar 2004 12:25:07 -0000 1.57
--- Gui5250.java 14 Apr 2004 12:15:52 -0000 1.58
***************
*** 35,38 ****
--- 35,39 ----
+ import org.apache.log4j.Logger;
import org.tn5250j.tools.*;
import org.tn5250j.mailtools.*;
***************
*** 75,79 ****
protected KeyboardHandler keyHandler;
protected SessionScrollerInterface scroller;
!
public Gui5250 () {
--- 76,82 ----
protected KeyboardHandler keyHandler;
protected SessionScrollerInterface scroller;
!
! private Logger log = Logger.getLogger(this.getClass());
! private Logger graphics = Logger.getLogger("GFX");
public Gui5250 () {
***************
*** 93,97 ****
}
catch(Exception e) {
! e.printStackTrace();
}
--- 96,100 ----
}
catch(Exception e) {
! log.warn("Error in constructor: "+e.getMessage());
}
***************
*** 157,161 ****
keyHandler = KeyboardHandler.getKeyboardHandlerInstance((Session)this);
!
macros = new Macronizer();
Macronizer.init();
--- 160,164 ----
keyHandler = KeyboardHandler.getKeyboardHandlerInstance((Session)this);
! log.debug("Initializing macros");
macros = new Macronizer();
Macronizer.init();
***************
*** 193,197 ****
if(tr.isDataFlavorSupported(DataFlavor.javaFileListFlavor)) {
try {
! System.out.println("dtde drop it2 ");
java.util.List fileList =
--- 196,200 ----
if(tr.isDataFlavorSupported(DataFlavor.javaFileListFlavor)) {
try {
! log.debug("dtde drop it2 ");
java.util.List fileList =
***************
*** 210,220 ****
}
catch (UnsupportedFlavorException ufe) {
! System.out.println("importData: unsupported data flavor");
}
catch (java.io.IOException ieo) {
! System.out.println("importData: I/O exception");
}
catch (Exception ex) {
! System.out.println(ex.getMessage());
}
finally {
--- 213,223 ----
}
catch (UnsupportedFlavorException ufe) {
! log.info("importData: unsupported data flavor");
}
catch (java.io.IOException ieo) {
! log.warn("importData: I/O exception");
}
catch (Exception ex) {
! log.warn(""+ex.getMessage());
}
finally {
***************
*** 238,242 ****
vt, (Session)this,props);
}
! catch (Exception exc) {}
}
--- 241,247 ----
vt, (Session)this,props);
}
! catch (Exception exc) {
! log.warn(""+exc.getMessage());
! }
}
***************
*** 520,524 ****
}
catch (Exception exc) {
! System.out.println(exc.getMessage());
}
}
--- 525,529 ----
}
catch (Exception exc) {
! log.warn(exc.getMessage());
}
}
***************
*** 720,724 ****
if (keyHandler.getRecordBuffer().length() > 0) {
Macronizer.setMacro(newMacName,keyHandler.getRecordBuffer());
! System.out.println(keyHandler.getRecordBuffer());
}
--- 725,729 ----
if (keyHandler.getRecordBuffer().length() > 0) {
Macronizer.setMacro(newMacName,keyHandler.getRecordBuffer());
! log.debug(keyHandler.getRecordBuffer());
}
***************
*** 735,739 ****
macName = macName.trim();
if (macName.length() > 0) {
! System.out.println(macName);
newMacName = macName;
keyHandler.startRecording();
--- 740,744 ----
macName = macName.trim();
if (macName.length() > 0) {
! log.info(macName);
newMacName = macName;
keyHandler.startRecording();
***************
*** 780,784 ****
protected void paintComponent(Graphics g) {
! // System.out.println("paint from screen");
screen.paintComponent3(g);
--- 785,789 ----
protected void paintComponent(Graphics g) {
! log.debug("paint from screen");
screen.paintComponent3(g);
***************
*** 792,796 ****
public void update(Graphics g) {
! // System.out.println("paint from gui");
paint(g);
--- 797,801 ----
public void update(Graphics g) {
! log.debug("paint from gui");
paint(g);
***************
*** 885,889 ****
// repaint(x1,y1,x2-1,y2-1);
repaint();
! // System.out.println(" bound " + band.getEndPoint());
}
--- 890,894 ----
// repaint(x1,y1,x2-1,y2-1);
repaint();
! log.debug(" bound " + band.getEndPoint());
}
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click