tn5250j/src/org/tn5250j SessionGUI.java,1.3,1.4 Session5250.java,1.2,1.3 My5250App.java,1.18,1.19
"Kenneth J. Pouncey" <[email protected]> Fri, 30 Jul 2004 06:02:45 +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-serv6183/src/org/tn5250j
Modified Files:
SessionGUI.java Session5250.java My5250App.java
Log Message:
change to use new framework modules
Index: Session5250.java
===================================================================
RCS file: /cvsroot/tn5250j/tn5250j/src/org/tn5250j/Session5250.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Session5250.java 26 Jul 2004 19:29:14 -0000 1.2
--- Session5250.java 30 Jul 2004 06:02:43 -0000 1.3
***************
*** 30,33 ****
--- 30,34 ----
import org.tn5250j.framework.tn5250.Screen5250;
import org.tn5250j.framework.tn5250.tnvt;
+ import org.tn5250j.framework.common.SessionManager;
/**
***************
*** 97,101 ****
}
! protected boolean isSendKeepAlive() {
return heartBeat;
}
--- 98,102 ----
}
! public boolean isSendKeepAlive() {
return heartBeat;
}
Index: My5250App.java
===================================================================
RCS file: /cvsroot/tn5250j/tn5250j/src/org/tn5250j/My5250App.java,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** My5250App.java 22 Jul 2004 06:09:31 -0000 1.18
--- My5250App.java 30 Jul 2004 06:02:43 -0000 1.19
***************
*** 8,11 ****
--- 8,12 ----
import org.tn5250j.tools.LangTool;
import org.tn5250j.gui.TN5250jSecurityAccessDialog;
+ import org.tn5250j.framework.common.*;
import org.tn5250j.swing.JTerminal;
***************
*** 107,111 ****
loadSystemProperty("SESSION_CONNECT_MENU");
! manager = new SessionManager();
final Session5250 s = manager.openSession(sesProps,"","Test Applet");
final SessionGUI gui = new SessionGUI(s);
--- 108,112 ----
loadSystemProperty("SESSION_CONNECT_MENU");
! manager = SessionManager.instance();
final Session5250 s = manager.openSession(sesProps,"","Test Applet");
final SessionGUI gui = new SessionGUI(s);
Index: SessionGUI.java
===================================================================
RCS file: /cvsroot/tn5250j/tn5250j/src/org/tn5250j/SessionGUI.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** SessionGUI.java 26 Jul 2004 19:59:00 -0000 1.3
--- SessionGUI.java 30 Jul 2004 06:02:43 -0000 1.4
***************
*** 1,185 ****
! /*
! * @(#)SessionGUI.java
! * Copyright: Copyright (c) 2001 - 2004
! * @author Kenneth J. Pouncey
! *
! * This program is free software; you can redistribute it and/or modify
! * it under the terms of the GNU General Public License as published by
! * the Free Software Foundation; either version 2, or (at your option)
! * any later version.
! *
! * This program is distributed in the hope that it will be useful,
! * but WITHOUT ANY WARRANTY; without even the implied warranty of
! * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
! * GNU General Public License for more details.
! *
! * You should have received a copy of the GNU General Public License
! * along with this software; see the file COPYING. If not, write to
! * the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
! * Boston, MA 02111-1307 USA
! *
! */
! package org.tn5250j;
!
! import java.util.*;
! import java.awt.Rectangle;
!
! import org.tn5250j.interfaces.SessionInterface;
! import org.tn5250j.event.SessionListener;
! import org.tn5250j.event.SessionChangeEvent;
! import org.tn5250j.interfaces.ScanListener;
! import org.tn5250j.framework.tn5250.*;
!
! /**
! * A host GUI session
! */
! public class SessionGUI extends Gui5250 implements SessionListener,TN5250jConstants {
!
! private String configurationResource;
! private String sessionName;
! private boolean connected;
! private Vector listeners;
! private boolean firstScreen;
! private char[] signonSave;
!
!
! public SessionGUI (Session5250 session) {
! super(session);
!
! this.configurationResource = session.getConfigurationResource();
! this.sessionName = session.getSessionName();
!
! session.getConfiguration().addSessionConfigListener(this);
! session.addSessionListener(this);
! }
!
! public Session5250 getSession() {
! return super.session;
! }
!
! public void setSession(Session5250 session) {
! this.session = session;
! }
!
!
! public boolean isConnected() {
!
! return session.getVT().isConnected();
!
! }
!
! public boolean isOnSignOnScreen() {
!
! // check to see if we should check.
! if (firstScreen) {
!
! char[] so = screen.getScreenAsChars();
! int size = signonSave.length;
!
! Rectangle region = super.sesConfig.getRectangleProperty("signOnRegion");
!
! int fromRow = region.x;
! int fromCol = region.y;
! int toRow = region.width;
! int toCol = region.height;
!
! // make sure we are within range.
! if (fromRow == 0)
! fromRow = 1;
! if (fromCol == 0)
! fromCol = 1;
! if (toRow == 0)
! toRow = 24;
! if (toCol == 0)
! toCol = 80;
!
! int pos = 0;
!
! for (int r = fromRow; r <= toRow; r++)
! for (int c =fromCol;c <= toCol; c++) {
! pos = screen.getPos(r - 1, c - 1);
! // System.out.println(signonSave[pos]);
! if (signonSave[pos] != so[pos])
! return false;
! }
! }
!
! return true;
! }
!
! public String getSessionName() {
! return sessionName;
! }
!
! public String getAllocDeviceName() {
! if (session.getVT() != null)
! return session.getVT().getAllocatedDeviceName();
! else
! return null;
! }
!
! public String getHostName() {
! return session.getVT().getHostName();
! }
!
! public Screen5250 getScreen() {
!
! return screen;
!
! }
!
!
! public void connect() {
!
! session.connect();
! }
!
! public void disconnect() {
!
! session.disconnect();
! }
!
! public void onSessionChanged(SessionChangeEvent changeEvent) {
!
! switch (changeEvent.getState()) {
! case STATE_CONNECTED:
! // first we check for the signon save or now
! if (!firstScreen) {
! firstScreen = true;
! signonSave = screen.getScreenAsChars();
! // System.out.println("Signon saved");
! }
!
! // check for on connect macro
! String mac = sesConfig.getStringProperty("connectMacro");
! if (mac.length() > 0)
! executeMacro(mac);
! break;
! default:
! firstScreen = false;
! signonSave = null;
! }
! }
!
! /**
! * Add a SessionListener to the listener list.
! *
! * @param listener The SessionListener to be added
! */
! public synchronized void addSessionListener(SessionListener listener) {
!
! session.addSessionListener(listener);
!
! }
!
! /**
! * Remove a SessionListener from the listener list.
! *
! * @param listener The SessionListener to be removed
! */
! public synchronized void removeSessionListener(SessionListener listener) {
! session.removeSessionListener(listener);
!
! }
!
}
\ No newline at end of file
--- 1,185 ----
! /*
! * @(#)SessionGUI.java
! * Copyright: Copyright (c) 2001 - 2004
! * @author Kenneth J. Pouncey
! *
! * This program is free software; you can redistribute it and/or modify
! * it under the terms of the GNU General Public License as published by
! * the Free Software Foundation; either version 2, or (at your option)
! * any later version.
! *
! * This program is distributed in the hope that it will be useful,
! * but WITHOUT ANY WARRANTY; without even the implied warranty of
! * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
! * GNU General Public License for more details.
! *
! * You should have received a copy of the GNU General Public License
! * along with this software; see the file COPYING. If not, write to
! * the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
! * Boston, MA 02111-1307 USA
! *
! */
! package org.tn5250j;
!
! import java.util.*;
! import java.awt.Rectangle;
!
! import org.tn5250j.interfaces.SessionInterface;
! import org.tn5250j.event.SessionListener;
! import org.tn5250j.event.SessionChangeEvent;
! import org.tn5250j.interfaces.ScanListener;
! import org.tn5250j.framework.tn5250.*;
!
! /**
! * A host GUI session
! */
! public class SessionGUI extends Gui5250 implements SessionListener,TN5250jConstants {
!
! private String configurationResource;
! private String sessionName;
! private boolean connected;
! private Vector listeners;
! private boolean firstScreen;
! private char[] signonSave;
!
!
! public SessionGUI (Session5250 session) {
! super(session);
!
! this.configurationResource = session.getConfigurationResource();
! this.sessionName = session.getSessionName();
!
! session.getConfiguration().addSessionConfigListener(this);
! session.addSessionListener(this);
! }
!
! public Session5250 getSession() {
! return super.session;
! }
!
! public void setSession(Session5250 session) {
! this.session = session;
! }
!
!
! public boolean isConnected() {
!
! return session.getVT().isConnected();
!
! }
!
! public boolean isOnSignOnScreen() {
!
! // check to see if we should check.
! if (firstScreen) {
!
! char[] so = screen.getScreenAsChars();
! int size = signonSave.length;
!
! Rectangle region = super.sesConfig.getRectangleProperty("signOnRegion");
!
! int fromRow = region.x;
! int fromCol = region.y;
! int toRow = region.width;
! int toCol = region.height;
!
! // make sure we are within range.
! if (fromRow == 0)
! fromRow = 1;
! if (fromCol == 0)
! fromCol = 1;
! if (toRow == 0)
! toRow = 24;
! if (toCol == 0)
! toCol = 80;
!
! int pos = 0;
!
! for (int r = fromRow; r <= toRow; r++)
! for (int c =fromCol;c <= toCol; c++) {
! pos = screen.getPos(r - 1, c - 1);
! // System.out.println(signonSave[pos]);
! if (signonSave[pos] != so[pos])
! return false;
! }
! }
!
! return true;
! }
!
! public String getSessionName() {
! return sessionName;
! }
!
! public String getAllocDeviceName() {
! if (session.getVT() != null)
! return session.getVT().getAllocatedDeviceName();
! else
! return null;
! }
!
! public String getHostName() {
! return session.getVT().getHostName();
! }
!
! public Screen5250 getScreen() {
!
! return screen;
!
! }
!
!
! public void connect() {
!
! session.connect();
! }
!
! public void disconnect() {
!
! session.disconnect();
! }
!
! public void onSessionChanged(SessionChangeEvent changeEvent) {
!
! switch (changeEvent.getState()) {
! case STATE_CONNECTED:
! // first we check for the signon save or now
! if (!firstScreen) {
! firstScreen = true;
! signonSave = screen.getScreenAsChars();
! // System.out.println("Signon saved");
! }
!
! // check for on connect macro
! String mac = sesConfig.getStringProperty("connectMacro");
! if (mac.length() > 0)
! executeMacro(mac);
! break;
! default:
! firstScreen = false;
! signonSave = null;
! }
! }
!
! /**
! * Add a SessionListener to the listener list.
! *
! * @param listener The SessionListener to be added
! */
! public synchronized void addSessionListener(SessionListener listener) {
!
! session.addSessionListener(listener);
!
! }
!
! /**
! * Remove a SessionListener from the listener list.
! *
! * @param listener The SessionListener to be removed
! */
! public synchronized void removeSessionListener(SessionListener listener) {
! session.removeSessionListener(listener);
!
! }
!
}
\ No newline at end of file
-------------------------------------------------------
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