tn5250j/src/org/tn5250j SessionPopup.java,1.10,1.11 My5250App.java,1.16,1.17 Gui5250MDIFrame.java,1.18,1.19 Gui5250Frame.java,1.22,1.23 TN5250jConstants.java,1.52,1.53 ScreenPlanes.java,1.4,1.5 GuiGraphicBuffer.java,1.28,1.29 ScreenOIA.java,1.3,1.4 tnvt.java,1.50,1.51 Screen5250.java,1.73,1.74 PrinterThread.java,1.12,1.13 Gui5250.java,1.64,1.65
"Kenneth J. Pouncey" <[email protected]> Sun, 18 Jul 2004 13:38:57 +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-serv25348/src/org/tn5250j
Modified Files:
SessionPopup.java My5250App.java Gui5250MDIFrame.java
Gui5250Frame.java TN5250jConstants.java ScreenPlanes.java
GuiGraphicBuffer.java ScreenOIA.java tnvt.java Screen5250.java
PrinterThread.java Gui5250.java
Log Message:
Updates for headless
Index: PrinterThread.java
===================================================================
RCS file: /cvsroot/tn5250j/tn5250j/src/org/tn5250j/PrinterThread.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** PrinterThread.java 12 Jul 2004 04:45:56 -0000 1.12
--- PrinterThread.java 18 Jul 2004 13:38:54 -0000 1.13
***************
*** 35,39 ****
char[] screen;
! char[] screenAttr;
char[] screenAttrPlace;
Screen5250 scr;
--- 35,39 ----
char[] screen;
! char[] screenExtendedAttr;
char[] screenAttrPlace;
Screen5250 scr;
***************
*** 56,62 ****
int len = scr.getScreenLength();
screen = new char[len];
! screenAttr = new char[len];
int ret = scr.GetScreen(screen, len, PLANE_TEXT);
! ret = scr.GetScreen(screenAttr, len, PLANE_EXTENDED);
toDefault = toDefaultPrinter;
--- 56,64 ----
int len = scr.getScreenLength();
screen = new char[len];
! screenExtendedAttr = new char[len];
! screenAttrPlace = new char[len];
int ret = scr.GetScreen(screen, len, PLANE_TEXT);
! ret = scr.GetScreen(screenExtendedAttr, len, PLANE_EXTENDED);
! ret = scr.GetScreen(screenAttrPlace, len, PLANE_IS_ATTR_PLACE);
toDefault = toDefaultPrinter;
***************
*** 168,172 ****
screen = null;
! screenAttr = null;
}
--- 170,174 ----
screen = null;
! screenExtendedAttr = null;
}
***************
*** 241,244 ****
--- 243,248 ----
int y;
+ // int pos = 0;
+
// loop through all the screen characters and print them out.
for (int m = 0;m < numRows; m++)
***************
*** 248,252 ****
// only draw printable characters (in this case >= ' ')
! if (screen[getPos(m,i)] >= ' ' && ((screen[getPos(m,i)] & EXTENDED_5250_NON_DSP) == 0)) {
g2.drawChars(screen, getPos(m,i), 1,x , (int)(y + h1 - (l.getDescent() + l.getLeading())-2));
--- 252,256 ----
// only draw printable characters (in this case >= ' ')
! if (screen[getPos(m,i)] >= ' ' && ((screenExtendedAttr[getPos(m,i)] & EXTENDED_5250_NON_DSP) == 0)) {
g2.drawChars(screen, getPos(m,i), 1,x , (int)(y + h1 - (l.getDescent() + l.getLeading())-2));
***************
*** 256,260 ****
// if it is underlined then underline the character
// if (screen[getPos(m,i)].underLine && !screen[getPos(m,i)].attributePlace)
! if ((screenAttr[getPos(m,i)] & EXTENDED_5250_UNDERLINE) == 1)
g.drawLine(x, (int)(y + (h1 - l.getLeading()-3)), (int)(x + w1), (int)(y + (h1 - l.getLeading())-3));
--- 260,265 ----
// if it is underlined then underline the character
// if (screen[getPos(m,i)].underLine && !screen[getPos(m,i)].attributePlace)
! if ((screenExtendedAttr[getPos(m,i)] & EXTENDED_5250_UNDERLINE) != 0 &&
! screenAttrPlace[getPos(m,i)] != 1)
g.drawLine(x, (int)(y + (h1 - l.getLeading()-3)), (int)(x + w1), (int)(y + (h1 - l.getLeading())-3));
Index: My5250App.java
===================================================================
RCS file: /cvsroot/tn5250j/tn5250j/src/org/tn5250j/My5250App.java,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** My5250App.java 1 Jul 2004 10:35:29 -0000 1.16
--- My5250App.java 18 Jul 2004 13:38:53 -0000 1.17
***************
*** 9,18 ****
import org.tn5250j.gui.TN5250jSecurityAccessDialog;
public class My5250App extends JApplet implements TN5250jConstants {
boolean isStandalone = true;
private SessionManager manager;
!
private TN5250jLogger log;
!
/**Get a parameter value*/
public String getParameter(String key, String def) {
--- 9,20 ----
import org.tn5250j.gui.TN5250jSecurityAccessDialog;
+ import org.tn5250j.swing.JTerminal;
+
public class My5250App extends JApplet implements TN5250jConstants {
boolean isStandalone = true;
private SessionManager manager;
!
private TN5250jLogger log;
!
/**Get a parameter value*/
public String getParameter(String key, String def) {
***************
*** 42,46 ****
private void jbInit() throws Exception {
this.setSize(new Dimension(400,300));
!
if (isSpecified("-L"))
LangTool.init(parseLocale(getParameter("-L")));
--- 44,48 ----
private void jbInit() throws Exception {
this.setSize(new Dimension(400,300));
!
if (isSpecified("-L"))
LangTool.init(parseLocale(getParameter("-L")));
***************
*** 108,117 ****
final Session s = manager.openSession(sesProps,"","Test Applet");
! this.getContentPane().add(s);
s.connect();
SwingUtilities.invokeLater(new Runnable() {
public void run() {
! s.grabFocus();
}
});
--- 110,121 ----
final Session s = manager.openSession(sesProps,"","Test Applet");
! final JTerminal jt = new JTerminal(s);
!
! this.getContentPane().add(jt);
s.connect();
SwingUtilities.invokeLater(new Runnable() {
public void run() {
! jt.grabFocus();
}
});
Index: Screen5250.java
===================================================================
RCS file: /cvsroot/tn5250j/tn5250j/src/org/tn5250j/Screen5250.java,v
retrieving revision 1.73
retrieving revision 1.74
diff -C2 -d -r1.73 -r1.74
*** Screen5250.java 12 Jul 2004 04:45:56 -0000 1.73
--- Screen5250.java 18 Jul 2004 13:38:54 -0000 1.74
***************
*** 30,49 ****
package org.tn5250j;
- import java.awt.*;
- import java.awt.event.*;
- import java.awt.font.*;
- import java.awt.geom.*;
import java.text.*;
import java.util.*;
import java.awt.datatransfer.*;
! import java.beans.*;
[...2605 lines suppressed...]
! //
! // }
// // ADDED BY BARRY
***************
*** 5266,5271 ****
}
! public Gui5250 getGui() {
! return this.gui;
! }
! }
\ No newline at end of file
--- 4740,4745 ----
}
! // public Gui5250 getGui() {
! // return this.gui;
! // }
! }
Index: SessionPopup.java
===================================================================
RCS file: /cvsroot/tn5250j/tn5250j/src/org/tn5250j/SessionPopup.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** SessionPopup.java 5 Jul 2004 17:00:47 -0000 1.10
--- SessionPopup.java 18 Jul 2004 13:38:53 -0000 1.11
***************
*** 60,64 ****
JMenuItem mi;
! final int pos = screen.getPosFromView(me.getX(),me.getY());
if (!session.rubberband.isAreaSelected() && screen.isInField(pos,false) ) {
--- 60,64 ----
JMenuItem mi;
! final int pos = session.getPosFromView(me.getX(),me.getY());
if (!session.rubberband.isAreaSelected() && screen.isInField(pos,false) ) {
***************
*** 95,99 ****
action = new AbstractAction(LangTool.getString("popup.copy")) {
public void actionPerformed(ActionEvent e) {
! screen.copyMe();
session.getFocusForMe();
}
--- 95,99 ----
action = new AbstractAction(LangTool.getString("popup.copy")) {
public void actionPerformed(ActionEvent e) {
! session.copyMe();
session.getFocusForMe();
}
***************
*** 122,126 ****
// get the bounded area of the selection
! screen.getBoundingArea(workR);
popup.addSeparator();
--- 122,126 ----
// get the bounded area of the selection
! session.getBoundingArea(workR);
popup.addSeparator();
***************
*** 159,163 ****
action = new AbstractAction(LangTool.getString("popup.printScreen")) {
public void actionPerformed(ActionEvent e) {
! screen.printMe();
session.getFocusForMe();
}
--- 159,163 ----
action = new AbstractAction(LangTool.getString("popup.printScreen")) {
public void actionPerformed(ActionEvent e) {
! session.printMe();
session.getFocusForMe();
}
***************
*** 507,511 ****
! Vector sumVector = screen.sumThem(which);
Iterator l = sumVector.iterator();
double sum = 0.0;
--- 507,511 ----
! Vector sumVector = session.sumThem(which);
Iterator l = sumVector.iterator();
double sum = 0.0;
***************
*** 642,646 ****
private void printMe() {
! screen.printMe();
session.getFocusForMe();
}
--- 642,646 ----
private void printMe() {
! session.printMe();
session.getFocusForMe();
}
Index: GuiGraphicBuffer.java
===================================================================
RCS file: /cvsroot/tn5250j/tn5250j/src/org/tn5250j/GuiGraphicBuffer.java,v
retrieving revision 1.28
retrieving revision 1.29
diff -C2 -d -r1.28 -r1.29
*** GuiGraphicBuffer.java 12 Jul 2004 04:45:56 -0000 1.28
--- GuiGraphicBuffer.java 18 Jul 2004 13:38:54 -0000 1.29
***************
*** 35,38 ****
--- 35,41 ----
import java.awt.font.*;
import javax.swing.JPanel;
+ import java.awt.event.*;
+ import java.beans.*;
+ import java.awt.*;
import org.tn5250j.event.ScreenOIAListener;
***************
*** 40,45 ****
[...2653 lines suppressed...]
- // break;
- // default:
- // fg = s.colorYellow;
- // break;
-
-
}
! }
\ No newline at end of file
--- 2251,2257 ----
colSep = (updateRect.extended[pos] & EXTENDED_5250_COL_SEP) != 0;
nonDisplay = (updateRect.extended[pos] & EXTENDED_5250_NON_DSP) != 0;
}
! }
Index: Gui5250MDIFrame.java
===================================================================
RCS file: /cvsroot/tn5250j/tn5250j/src/org/tn5250j/Gui5250MDIFrame.java,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** Gui5250MDIFrame.java 30 Jun 2004 06:18:56 -0000 1.18
--- Gui5250MDIFrame.java 18 Jul 2004 13:38:53 -0000 1.19
***************
*** 58,62 ****
private Vector myFrameList;
private TN5250jLogger log = TN5250jLogFactory.getLogger(this.getClass());
!
//Construct the frame
public Gui5250MDIFrame(My5250 m) {
--- 58,62 ----
private Vector myFrameList;
private TN5250jLogger log = TN5250jLogFactory.getLogger(this.getClass());
!
//Construct the frame
public Gui5250MDIFrame(My5250 m) {
***************
*** 577,581 ****
public void endDraggingFrame(JComponent f) {
JInternalFrame frame = (JInternalFrame)f;
! ((Gui5250)frame.getContentPane()).getScreen().gg2d = null;
f.validate();
}
--- 577,581 ----
public void endDraggingFrame(JComponent f) {
JInternalFrame frame = (JInternalFrame)f;
! // ((Gui5250)frame.getContentPane()).getScreen().controllersG2D = null;
f.validate();
}
Index: TN5250jConstants.java
===================================================================
RCS file: /cvsroot/tn5250j/tn5250j/src/org/tn5250j/TN5250jConstants.java,v
retrieving revision 1.52
retrieving revision 1.53
diff -C2 -d -r1.52 -r1.53
*** TN5250jConstants.java 12 Jul 2004 04:22:02 -0000 1.52
--- TN5250jConstants.java 18 Jul 2004 13:38:54 -0000 1.53
***************
*** 387,395 ****
public static final int PLANE_TEXT = 1;
public static final int PLANE_COLOR = 2;
! public static final int PLANE_FIELD = 4;
! public static final int PLANE_EXTENDED = 8;
! 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
--- 387,396 ----
public static final int PLANE_TEXT = 1;
public static final int PLANE_COLOR = 2;
! public static final int PLANE_FIELD = 3;
! public static final int PLANE_EXTENDED = 4;
! public static final int PLANE_EXTENDED_GRAPHIC = 5;
! public static final int PLANE_EXTENDED_FIELD = 6;
! public static final int PLANE_ATTR = 7;
! public static final int PLANE_IS_ATTR_PLACE = 8;
// COLOR_BG
Index: tnvt.java
===================================================================
RCS file: /cvsroot/tn5250j/tn5250j/src/org/tn5250j/tnvt.java,v
retrieving revision 1.50
retrieving revision 1.51
diff -C2 -d -r1.50 -r1.51
*** tnvt.java 11 Jul 2004 08:17:28 -0000 1.50
--- tnvt.java 18 Jul 2004 13:38:54 -0000 1.51
***************
*** 1,4 ****
/**
! * Title: tnvt.java
* Copyright: Copyright (c) 2001 Company:
*
--- 1,4 ----
/**
! * Title: tnvt.java
* Copyright: Copyright (c) 2001 Company:
*
***************
*** 771,774 ****
--- 771,799 ----
}
+ public final void systemRequest(String sr)
+ {
+ byte[] bytes = null;
+
+ if ( (sr != null) && (sr.length() != 0))
+ {
+ for (int i = 0, l = sr.length(); i < l; i++)
+ {
+ baosp.write(codePage.uni2ebcdic(sr.charAt(i)));
+ }
+ bytes = baosp.toByteArray();
+ // baosp.reset();
+ }
+
+ try
+ {
+ writeGDS(4, 0, bytes);
+ }
+ catch (IOException ioe)
+ {
+ System.out.println(ioe.getMessage());
+ }
+ baosp.reset();
+ }
+
/**
* Cancel Invite - taken from the rfc1205 - 5250 Telnet interface section
***************
*** 1150,1156 ****
// else {
! if (screen52.isHotSpots()) {
! screen52.checkHotSpots();
! }
try {
--- 1175,1181 ----
// else {
! // if (screen52.isHotSpots()) {
! // screen52.checkHotSpots();
! // }
try {
***************
*** 3250,3256 ****
}
! public final Dimension getPreferredSize() {
! return screen52.getPreferredSize();
! }
/**
--- 3275,3281 ----
}
! // public final Dimension getPreferredSize() {
! // return screen52.getPreferredSize();
! // }
/**
***************
*** 3362,3364 ****
// private static final byte CMD_READ_IMMEDIATE_ALT = (byte)0x83; // 131
! }
\ No newline at end of file
--- 3387,3389 ----
// private static final byte CMD_READ_IMMEDIATE_ALT = (byte)0x83; // 131
! }
Index: Gui5250Frame.java
===================================================================
RCS file: /cvsroot/tn5250j/tn5250j/src/org/tn5250j/Gui5250Frame.java,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -d -r1.22 -r1.23
*** Gui5250Frame.java 5 Jul 2004 05:07:38 -0000 1.22
--- Gui5250Frame.java 18 Jul 2004 13:38:54 -0000 1.23
***************
*** 48,52 ****
TN5250jConstants,
SessionListener,
! TabClosedListener,
SessionJumpListener {
--- 48,52 ----
TN5250jConstants,
SessionListener,
! TabClosedListener,
SessionJumpListener {
***************
*** 60,64 ****
private TN5250jLogger log = TN5250jLogFactory.getLogger (this.getClass());
!
//Construct the frame
public Gui5250Frame(My5250 m) {
--- 60,64 ----
private TN5250jLogger log = TN5250jLogFactory.getLogger (this.getClass());
!
//Construct the frame
public Gui5250Frame(My5250 m) {
***************
*** 106,110 ****
else
validate();
!
}
--- 106,110 ----
else
validate();
!
}
***************
*** 184,188 ****
--- 184,190 ----
}
+
((Session)sessionPane.getComponent(sessionPane.getSelectedIndex())).grabFocus();
+
setSessionTitle();
}
***************
*** 352,359 ****
public void tabClosed(int tabToBeClosed){
!
me.closeSession(this.getSessionAt(tabToBeClosed));
}
!
public void removeSessionView(Session targetSession) {
--- 354,361 ----
public void tabClosed(int tabToBeClosed){
!
me.closeSession(this.getSessionAt(tabToBeClosed));
}
!
public void removeSessionView(Session targetSession) {
Index: ScreenPlanes.java
===================================================================
RCS file: /cvsroot/tn5250j/tn5250j/src/org/tn5250j/ScreenPlanes.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** ScreenPlanes.java 12 Jul 2004 04:22:23 -0000 1.4
--- ScreenPlanes.java 18 Jul 2004 13:38:54 -0000 1.5
***************
*** 164,168 ****
screenAttr[pos] = (char)attr;
disperseAttribute(pos,attr);
! screenIsAttr[pos] = (isAttr ? '1' : '0');
screenGUI[pos] = initChar;
--- 164,168 ----
screenAttr[pos] = (char)attr;
disperseAttribute(pos,attr);
! screenIsAttr[pos] = (isAttr ? (char)1 : (char)0);
screenGUI[pos] = initChar;
***************
*** 172,176 ****
screenAttr[pos] = (char)attr;
! screenIsAttr[pos] = isAttr ? '1' : '0';
disperseAttribute(pos,attr);
screenGUI[pos] = initChar;
--- 172,176 ----
screenAttr[pos] = (char)attr;
! screenIsAttr[pos] = isAttr ? (char)1 : (char)0;
disperseAttribute(pos,attr);
screenGUI[pos] = initChar;
***************
*** 191,195 ****
// System.out.println(sChar[0] + " - " + c);
screen[pos] = c;
! if (screenIsAttr[pos] == '1')
setScreenCharAndAttr(pos,c,32,false);
--- 191,195 ----
// System.out.println(sChar[0] + " - " + c);
screen[pos] = c;
! if (screenIsAttr[pos] == 1)
setScreenCharAndAttr(pos,c,32,false);
***************
*** 205,209 ****
protected final boolean isAttributePlace(int pos) {
! return screenIsAttr[pos] == '1' ? true : false;
}
--- 205,209 ----
protected final boolean isAttributePlace(int pos) {
! return screenIsAttr[pos] == 1 ? true : false;
}
***************
*** 222,225 ****
--- 222,226 ----
protected void initalizePlanes () {
+
for (int y = 0;y < screenSize; y++) {
***************
*** 267,284 ****
break;
case PLANE_COLOR:
- // fillColorPlane(planeChars,from,len);
System.arraycopy(screenColor, from, planeChars, 0, len);
break;
case PLANE_EXTENDED:
System.arraycopy(screenExtended, from, planeChars, 0, len);
- // fillExtendedPlane(planeChars,from,len);
break;
case PLANE_EXTENDED_GRAPHIC:
System.arraycopy(screenGUI, from, planeChars, 0, len);
- // fillExtendedGraphicPlane(screenGUI,from,len);
break;
case PLANE_EXTENDED_FIELD:
System.arraycopy(screenField, from, planeChars, 0, len);
! // fillExtendedFieldPlane(screenField,from,len);
break;
default:
--- 268,284 ----
break;
case PLANE_COLOR:
System.arraycopy(screenColor, from, planeChars, 0, len);
break;
case PLANE_EXTENDED:
System.arraycopy(screenExtended, from, planeChars, 0, len);
break;
case PLANE_EXTENDED_GRAPHIC:
System.arraycopy(screenGUI, from, planeChars, 0, len);
break;
case PLANE_EXTENDED_FIELD:
System.arraycopy(screenField, from, planeChars, 0, len);
! break;
! case PLANE_IS_ATTR_PLACE:
! System.arraycopy(screenIsAttr, from, planeChars, 0, len);
break;
default:
***************
*** 853,859 ****
screenExtended[pos] = (char)(ul | cs | nd);
}
!
protected boolean checkHotSpots () {
!
Screen5250 s = scr;
int lenScreen = scr.getScreenLength();
--- 853,859 ----
screenExtended[pos] = (char)(ul | cs | nd);
}
!
protected boolean checkHotSpots () {
!
Screen5250 s = scr;
int lenScreen = scr.getScreenLength();
***************
*** 865,875 ****
// Rectangle2D mwArea = new Rectangle2D.Float(0,0,0,0);
// ArrayList mArray = new ArrayList(10);
!
for (int x = 0; x < lenScreen; x++) {
!
hs =false;
if (s.isInField(x,false))
continue;
!
// First check for PF keys
if (x > 0 && screen[x] == 'F') {
--- 865,875 ----
// Rectangle2D mwArea = new Rectangle2D.Float(0,0,0,0);
// ArrayList mArray = new ArrayList(10);
!
for (int x = 0; x < lenScreen; x++) {
!
hs =false;
if (s.isInField(x,false))
continue;
!
// First check for PF keys
if (x > 0 && screen[x] == 'F') {
***************
*** 878,882 ****
screen[x - 1] <= ' ' &&
(screenExtended[x] & EXTENDED_5250_NON_DSP) == 0) {
!
if (screen[x + 2] >= '0' &&
screen[x + 2] <= '9' &&
--- 878,882 ----
screen[x - 1] <= ' ' &&
(screenExtended[x] & EXTENDED_5250_NON_DSP) == 0) {
!
if (screen[x + 2] >= '0' &&
screen[x + 2] <= '9' &&
***************
*** 890,897 ****
screen[x + 3] == '/')
hs = true;
!
if (hs) {
screenGUI[x] = BUTTON_LEFT;
!
int ns = 0;
int row = x / numCols;
--- 890,897 ----
screen[x + 3] == '/')
hs = true;
!
if (hs) {
screenGUI[x] = BUTTON_LEFT;
!
int ns = 0;
int row = x / numCols;
***************
*** 903,909 ****
if (ns <2)
screenGUI[x] = BUTTON_MIDDLE;
!
}
!
// now lets go back and take out gui's that do not belong
while (screen[--x] <= ' ') {
--- 903,909 ----
if (ns <2)
screenGUI[x] = BUTTON_MIDDLE;
!
}
!
// now lets go back and take out gui's that do not belong
while (screen[--x] <= ' ') {
***************
*** 911,919 ****
}
screenGUI[x] = BUTTON_RIGHT;
!
}
}
}
!
// now lets check for menus
if (!hs && x > 0 && x < lenScreen - 2 &&
--- 911,919 ----
}
screenGUI[x] = BUTTON_RIGHT;
!
}
}
}
!
// now lets check for menus
if (!hs && x > 0 && x < lenScreen - 2 &&
***************
*** 923,939 ****
(screenExtended[x] & EXTENDED_5250_NON_DSP) == 0
) {
!
int os = 0;
if ((os = isOption(screen,x,lenScreen,2,3,'.') )> 0) {
hs = true;
!
int stop = x;
int ns = 0;
int row = stop / numCols;
!
while (++stop / numCols == row &&
(screen[stop] >= ' ' ||
screen[stop] == 0x0) ) {
!
if (screen[stop] <= ' ') {
ns++;
--- 923,939 ----
(screenExtended[x] & EXTENDED_5250_NON_DSP) == 0
) {
!
int os = 0;
if ((os = isOption(screen,x,lenScreen,2,3,'.') )> 0) {
hs = true;
!
int stop = x;
int ns = 0;
int row = stop / numCols;
!
while (++stop / numCols == row &&
(screen[stop] >= ' ' ||
screen[stop] == 0x0) ) {
!
if (screen[stop] <= ' ') {
ns++;
***************
*** 941,966 ****
else
ns = 0;
!
if (screen[stop] == '.') {
int io = 0;
if ((io = isOption(screen,stop,lenScreen,2,3,'.')) > 0) {
!
stop = io;
break;
}
}
!
if (ns > 3)
break;
}
!
screenGUI[++os] = BUTTON_LEFT;
s.setDirty(os);
!
while (++os < stop) {
screenGUI[os] = BUTTON_MIDDLE;
s.setDirty(os);
}
!
// now lets go back and take out gui's that do not belong
while (screen[--stop] <= ' ') {
--- 941,966 ----
else
ns = 0;
!
if (screen[stop] == '.') {
int io = 0;
if ((io = isOption(screen,stop,lenScreen,2,3,'.')) > 0) {
!
stop = io;
break;
}
}
!
if (ns > 3)
break;
}
!
screenGUI[++os] = BUTTON_LEFT;
s.setDirty(os);
!
while (++os < stop) {
screenGUI[os] = BUTTON_MIDDLE;
s.setDirty(os);
}
!
// now lets go back and take out gui's that do not belong
while (screen[--stop] <= ' ') {
***************
*** 970,977 ****
screenGUI[stop] = BUTTON_RIGHT;
s.setDirty(stop);
!
}
}
!
// now lets check for options.
if (!hs && x > 0 && x < lenScreen - 2 &&
--- 970,977 ----
screenGUI[stop] = BUTTON_RIGHT;
s.setDirty(stop);
!
}
}
!
// now lets check for options.
if (!hs && x > 0 && x < lenScreen - 2 &&
***************
*** 981,996 ****
(screenExtended[x] & EXTENDED_5250_NON_DSP) == 0
) {
!
int os = 0;
if ((os = isOption(screen,x,lenScreen,2,2,'=') )> 0) {
hs = true;
!
int stop = x;
int ns = 0;
int row = stop / numCols;
!
while (++stop / numCols == row &&
screen[stop] >= ' ') {
!
if (screen[stop] == ' ') {
ns++;
--- 981,996 ----
(screenExtended[x] & EXTENDED_5250_NON_DSP) == 0
) {
!
int os = 0;
if ((os = isOption(screen,x,lenScreen,2,2,'=') )> 0) {
hs = true;
!
int stop = x;
int ns = 0;
int row = stop / numCols;
!
while (++stop / numCols == row &&
screen[stop] >= ' ') {
!
if (screen[stop] == ' ') {
ns++;
***************
*** 998,1029 ****
else
ns = 0;
!
if (screen[stop] == '=') {
int io = 0;
if ((io = isOption(screen,stop,lenScreen,2,2,'=')) > 0) {
!
stop = io;
break;
}
}
!
if (ns > 2)
break;
}
!
screenGUI[++os] = BUTTON_LEFT;
s.setDirty(os);
!
while (++os < stop) {
screenGUI[os] = BUTTON_MIDDLE;
s.setDirty(os);
!
}
!
// now lets go back and take out gui's that do not belong
while (screen[--stop] <= ' ') {
screenGUI[stop] = NO_GUI;
s.setDirty(stop);
!
}
screenGUI[stop] = BUTTON_RIGHT;
--- 998,1029 ----
else
ns = 0;
!
if (screen[stop] == '=') {
int io = 0;
if ((io = isOption(screen,stop,lenScreen,2,2,'=')) > 0) {
!
stop = io;
break;
}
}
!
if (ns > 2)
break;
}
!
screenGUI[++os] = BUTTON_LEFT;
s.setDirty(os);
!
while (++os < stop) {
screenGUI[os] = BUTTON_MIDDLE;
s.setDirty(os);
!
}
!
// now lets go back and take out gui's that do not belong
while (screen[--stop] <= ' ') {
screenGUI[stop] = NO_GUI;
s.setDirty(stop);
!
}
screenGUI[stop] = BUTTON_RIGHT;
***************
*** 1031,1037 ****
}
}
!
// now lets check for More... .
!
if (!hs && x > 2 && x < lenScreen - hsMore.length() &&
screen[x] == hsMore.charAt(0) &&
--- 1031,1037 ----
}
}
!
// now lets check for More... .
!
if (!hs && x > 2 && x < lenScreen - hsMore.length() &&
screen[x] == hsMore.charAt(0) &&
***************
*** 1041,1045 ****
(screenExtended[x] & EXTENDED_5250_NON_DSP) == 0
) {
!
boolean mFlag = true;
int ms = hsMore.length();
--- 1041,1045 ----
(screenExtended[x] & EXTENDED_5250_NON_DSP) == 0
) {
!
boolean mFlag = true;
int ms = hsMore.length();
***************
*** 1050,1069 ****
break;
}
!
}
!
if (mFlag) {
hs = true;
!
screenGUI[x] = BUTTON_LEFT_DN;
!
while (--ms > 0) {
screenGUI[++x] = BUTTON_MIDDLE_DN;
!
}
screenGUI[x] = BUTTON_RIGHT_DN;
}
}
!
// now lets check for Bottom .
if (!hs && x > 2 && x < lenScreen - hsBottom.length() &&
--- 1050,1069 ----
break;
}
!
}
!
if (mFlag) {
hs = true;
!
screenGUI[x] = BUTTON_LEFT_DN;
!
while (--ms > 0) {
screenGUI[++x] = BUTTON_MIDDLE_DN;
!
}
screenGUI[x] = BUTTON_RIGHT_DN;
}
}
!
// now lets check for Bottom .
if (!hs && x > 2 && x < lenScreen - hsBottom.length() &&
***************
*** 1074,1078 ****
(screenExtended[x] & EXTENDED_5250_NON_DSP) == 0
) {
!
boolean mFlag = true;
int bs = hsBottom.length();
--- 1074,1078 ----
(screenExtended[x] & EXTENDED_5250_NON_DSP) == 0
) {
!
boolean mFlag = true;
int bs = hsBottom.length();
***************
*** 1083,1102 ****
break;
}
!
}
!
if (mFlag) {
hs = true;
!
screenGUI[x] = BUTTON_LEFT_UP;
!
while (--bs > 0) {
screenGUI[++x] = BUTTON_MIDDLE_UP;
!
}
screenGUI[x] = BUTTON_RIGHT_UP;
}
}
!
// now lets check for HTTP:// .
if (!hs && x > 0 && x < lenScreen - 7 &&
--- 1083,1102 ----
break;
}
!
}
!
if (mFlag) {
hs = true;
!
screenGUI[x] = BUTTON_LEFT_UP;
!
while (--bs > 0) {
screenGUI[++x] = BUTTON_MIDDLE_UP;
!
}
screenGUI[x] = BUTTON_RIGHT_UP;
}
}
!
// now lets check for HTTP:// .
if (!hs && x > 0 && x < lenScreen - 7 &&
***************
*** 1106,1110 ****
(screenExtended[x] & EXTENDED_5250_NON_DSP) == 0
) {
!
if (Character.toLowerCase(screen[x+1]) == 't' &&
Character.toLowerCase(screen[x+2]) == 't' &&
--- 1106,1110 ----
(screenExtended[x] & EXTENDED_5250_NON_DSP) == 0
) {
!
if (Character.toLowerCase(screen[x+1]) == 't' &&
Character.toLowerCase(screen[x+2]) == 't' &&
***************
*** 1113,1124 ****
screen[x+5] == '/' &&
screen[x+6] == '/' ) {
!
hs = true;
!
screenGUI[x] = BUTTON_LEFT_EB;
!
while (screen[++x] > ' ') {
screenGUI[x] = BUTTON_MIDDLE_EB;
!
}
screenGUI[--x] = BUTTON_RIGHT_EB;
--- 1113,1124 ----
screen[x+5] == '/' &&
screen[x+6] == '/' ) {
!
hs = true;
!
screenGUI[x] = BUTTON_LEFT_EB;
!
while (screen[++x] > ' ') {
screenGUI[x] = BUTTON_MIDDLE_EB;
!
}
screenGUI[--x] = BUTTON_RIGHT_EB;
***************
*** 1127,1134 ****
if (!retHS && hs)
retHS = true;
!
}
!
!
// int pos = 0;
//
--- 1127,1134 ----
if (!retHS && hs)
retHS = true;
!
}
!
!
// int pos = 0;
//
***************
*** 1174,1178 ****
// (int)mArea.getHeight()) ));
// }
!
return retHS;
--- 1174,1178 ----
// (int)mArea.getHeight()) ));
// }
!
return retHS;
***************
*** 1190,1194 ****
// check to the left for option
while (--sp >=0 && screen[sp] <= ' ' ) {
!
if (x - sp > numPref || screen[sp] == suff||
screen[sp] == '.' ||
--- 1190,1194 ----
// check to the left for option
while (--sp >=0 && screen[sp] <= ' ' ) {
!
if (x - sp > numPref || screen[sp] == suff||
screen[sp] == '.' ||
***************
*** 1199,1208 ****
}
}
!
// now lets check for how long the option is it has to be numPref or less
os = sp;
while (hs && --os > 0 && screen[os] > ' ' ) {
// System.out.println(" hs2 length " + (sp-os) + " " + screen[os].getChar());
!
if (sp - os >= numPref || screen[os] == suff ||
screen[os] == '.' ||
--- 1199,1208 ----
}
}
!
// now lets check for how long the option is it has to be numPref or less
os = sp;
while (hs && --os > 0 && screen[os] > ' ' ) {
// System.out.println(" hs2 length " + (sp-os) + " " + screen[os].getChar());
!
if (sp - os >= numPref || screen[os] == suff ||
screen[os] == '.' ||
***************
*** 1216,1222 ****
hs = false;
}
!
sp = x;
!
if (Character.isDigit(screen[sp+1]))
hs = false;
--- 1216,1222 ----
hs = false;
}
!
sp = x;
!
if (Character.isDigit(screen[sp+1]))
hs = false;
Index: ScreenOIA.java
===================================================================
RCS file: /cvsroot/tn5250j/tn5250j/src/org/tn5250j/ScreenOIA.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** ScreenOIA.java 6 Jul 2004 05:39:28 -0000 1.3
--- ScreenOIA.java 18 Jul 2004 13:38:54 -0000 1.4
***************
*** 36,41 ****
*
*/
! public class ScreenOIA {
!
// OIA_LEVEL
public static final int OIA_LEVEL_INPUT_INHIBITED = 1;
--- 36,41 ----
*
*/
! public class ScreenOIA
! {
// OIA_LEVEL
public static final int OIA_LEVEL_INPUT_INHIBITED = 1;
***************
*** 75,79 ****
level = OIA_LEVEL_INSERT_MODE;
insertMode = mode;
! fireOIAChanged();
}
--- 75,79 ----
level = OIA_LEVEL_INSERT_MODE;
insertMode = mode;
! fireOIAChanged(ScreenOIAListener.OIA_CHANGED_INSERT_MODE);
}
***************
*** 119,123 ****
keysBuffered = kb;
if (keysBuffered != oldKB)
! fireOIAChanged();
}
--- 119,123 ----
keysBuffered = kb;
if (keysBuffered != oldKB)
! fireOIAChanged(ScreenOIAListener.OIA_CHANGED_KEYS_BUFFERED);
}
***************
*** 131,138 ****
source.sendKeys("");
}
! }
!
if (locked != oldLocked)
! fireOIAChanged();
}
--- 131,138 ----
source.sendKeys("");
}
! }
!
if (locked != oldLocked)
! fireOIAChanged(ScreenOIAListener.OIA_CHANGED_KEYBOARD_LOCKED);
}
***************
*** 144,148 ****
level = OIA_LEVEL_MESSAGE_LIGHT_ON;
messageWait = true;
! fireOIAChanged();
}
--- 144,148 ----
level = OIA_LEVEL_MESSAGE_LIGHT_ON;
messageWait = true;
! fireOIAChanged(ScreenOIAListener.OIA_CHANGED_MESSAGELIGHT);
}
***************
*** 150,154 ****
level = OIA_LEVEL_MESSAGE_LIGHT_OFF;
messageWait = false;
! fireOIAChanged();
}
--- 150,154 ----
level = OIA_LEVEL_MESSAGE_LIGHT_OFF;
messageWait = false;
! fireOIAChanged(ScreenOIAListener.OIA_CHANGED_MESSAGELIGHT);
}
***************
*** 156,160 ****
level = OIA_LEVEL_SCRIPT;
scriptRunning = running;
! fireOIAChanged();
}
--- 156,160 ----
level = OIA_LEVEL_SCRIPT;
scriptRunning = running;
! fireOIAChanged(ScreenOIAListener.OIA_CHANGED_SCRIPT);
}
***************
*** 165,174 ****
public void setAudibleBell() {
level = OIA_LEVEL_AUDIBLE_BELL;
! fireOIAChanged();
}
protected void clearScreen() {
level = OIA_LEVEL_CLEAR_SCREEN;
! fireOIAChanged();
}
--- 165,174 ----
public void setAudibleBell() {
level = OIA_LEVEL_AUDIBLE_BELL;
! fireOIAChanged(ScreenOIAListener.OIA_CHANGED_BELL);
}
protected void clearScreen() {
level = OIA_LEVEL_CLEAR_SCREEN;
! fireOIAChanged(ScreenOIAListener.OIA_CHANGED_CLEAR_SCREEN);
}
***************
*** 260,264 ****
saveInhibit = inhibit;
saveInhibitLevel = level;
! fireOIAChanged();
// }
}
--- 260,264 ----
saveInhibit = inhibit;
saveInhibitLevel = level;
! fireOIAChanged(ScreenOIAListener.OIA_CHANGED_INPUTINHIBITED);
// }
}
***************
*** 268,272 ****
*
*/
! private void fireOIAChanged() {
if (listeners != null) {
--- 268,272 ----
*
*/
! private void fireOIAChanged(int change) {
if (listeners != null) {
***************
*** 275,279 ****
ScreenOIAListener target =
(ScreenOIAListener)listeners.elementAt(i);
! target.onOIAChanged((ScreenOIA)this);
}
}
--- 275,279 ----
ScreenOIAListener target =
(ScreenOIAListener)listeners.elementAt(i);
! target.onOIAChanged((ScreenOIA)this, change);
}
}
***************
*** 298,300 ****
private String inhibitedText;
! }
\ No newline at end of file
--- 298,300 ----
private String inhibitedText;
! }
Index: Gui5250.java
===================================================================
RCS file: /cvsroot/tn5250j/tn5250j/src/org/tn5250j/Gui5250.java,v
retrieving revision 1.64
retrieving revision 1.65
diff -C2 -d -r1.64 -r1.65
*** Gui5250.java 5 Jul 2004 19:38:29 -0000 1.64
--- Gui5250.java 18 Jul 2004 13:38:54 -0000 1.65
***************
*** 60,63 ****
--- 60,64 ----
Screen5250 screen = null;
String propFileName = null;
+ GuiGraphicBuffer bi;
tnvt vt = null;
TNRubberBand rubberband;
***************
*** 91,96 ****
sesConfig = config;
- enableEvents(AWTEvent.WINDOW_EVENT_MASK | AWTEvent.KEY_EVENT_MASK);
-
try {
jbInit();
--- 92,95 ----
***************
*** 111,121 ****
s.setDoubleBuffered(false);
screen = new Screen5250(this,sesConfig);
this.addComponentListener(this);
if (!sesConfig.isPropertyExists("width") ||
!sesConfig.isPropertyExists("height"))
// set the initialize size
! this.setSize(screen.getPreferredSize());
else {
--- 110,129 ----
s.setDoubleBuffered(false);
+
screen = new Screen5250(this,sesConfig);
+
this.addComponentListener(this);
+ if (bi == null) {
+ checkOffScreenImage();
+ }
+
+ setRubberBand(new TNRubberBand(this));
+ keyHandler = KeyboardHandler.getKeyboardHandlerInstance((Session)this);
+
if (!sesConfig.isPropertyExists("width") ||
!sesConfig.isPropertyExists("height"))
// set the initialize size
! this.setSize(bi.getPreferredSize());
else {
***************
*** 148,152 ****
}
else {
! screen.moveCursor(e);
repaint();
getFocusForMe();
--- 156,176 ----
}
else {
! int pos = bi.getPosFromView(e.getX(), e.getY());
! if (log.isDebugEnabled()) {
! log.debug((screen.getRow(pos)) + "," + (screen.getCol(pos)));
! log.debug(e.getX() + "," + e.getY() + "," + bi.columnWidth + ","
! + bi.rowHeight);
! }
!
! screen.moveCursor(e, pos);
! // this is a note to not execute this code here when we
! // implement
! // the remain after edit function option.
! if (rubberband.isAreaSelected()) {
! rubberband.reset();
! repaint();
! }
! // gui.requestFocus();
!
repaint();
getFocusForMe();
***************
*** 160,164 ****
scroller.removeMouseWheelListener((Session)this);
- keyHandler = KeyboardHandler.getKeyboardHandlerInstance((Session)this);
log.debug("Initializing macros");
macros = new Macronizer();
--- 184,187 ----
***************
*** 179,183 ****
this.add(s,BorderLayout.CENTER);
- setRubberBand(new TNRubberBand(this));
this.requestFocus();
jumpEvent = new SessionJumpEvent(this);
--- 202,205 ----
***************
*** 190,234 ****
doubleClick = false;
! DropTargetAdapter dta = new DropTargetAdapter() {
! public void drop(DropTargetDropEvent dtde) {
! Transferable tr = dtde.getTransferable();
! dtde.acceptDrop(DnDConstants.ACTION_COPY_OR_MOVE);
! DataFlavor[] dfs = dtde.getCurrentDataFlavors();
! if(tr.isDataFlavorSupported(DataFlavor.javaFileListFlavor)) {
! try {
! log.debug("dtde drop it2 ");
! java.util.List fileList =
! (java.util.List)tr.getTransferData(DataFlavor.javaFileListFlavor);
! // implementation for when we are able to process a list
! // of files.
! // Iterator iterator = fileList.iterator();
! // if (iterator.hasNext()) {
! // File file = (File)iterator.next();
! // }
! java.io.File file = (java.io.File)fileList.get(0);
! System.out.println(file.toString());
! dtde.dropComplete(true);
! doTransfer(file);
! return;
! }
! 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 {
! dtde.dropComplete(false);
! }
! }
! }
! };
! DropTarget dt = new DropTarget((JPanel)this,dta);
! setDropTarget(dt);
}
--- 212,269 ----
doubleClick = false;
! // DropTargetAdapter dta = new DropTargetAdapter() {
! // public void drop(DropTargetDropEvent dtde) {
! // Transferable tr = dtde.getTransferable();
! // dtde.acceptDrop(DnDConstants.ACTION_COPY_OR_MOVE);
! // DataFlavor[] dfs = dtde.getCurrentDataFlavors();
! // if(tr.isDataFlavorSupported(DataFlavor.javaFileListFlavor)) {
! // try {
! // log.debug("dtde drop it2 ");
! //
! // java.util.List fileList =
! // (java.util.List)tr.getTransferData(DataFlavor.javaFileListFlavor);
! // // implementation for when we are able to process a list
! // // of files.
! // // Iterator iterator = fileList.iterator();
! // // if (iterator.hasNext()) {
! // // File file = (File)iterator.next();
! // // }
! // java.io.File file = (java.io.File)fileList.get(0);
! // System.out.println(file.toString());
! // dtde.dropComplete(true);
! // doTransfer(file);
! // return;
! // }
! // 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 {
! // dtde.dropComplete(false);
! // }
! // }
! // }
! // };
! // DropTarget dt = new DropTarget((JPanel)this,dta);
! //
! // setDropTarget(dt);
! }
! public void setRunningHeadless(boolean headless) {
! if (headless) {
! screen.getOIA().removeOIAListener(bi);
! screen.removeScreenListener(bi);
! }
! else {
! screen.getOIA().addOIAListener(bi);
! screen.addScreenListener(bi);
!
! }
}
***************
*** 301,305 ****
// is now.
if (last.equals("[markleft]"))
! screen.getPointFromRowCol(screen.getCurrentRow() - 1,
screen.getCurrentCol() + 1,
p);
--- 336,340 ----
// is now.
if (last.equals("[markleft]"))
! bi.getPointFromRowCol(screen.getCurrentRow() - 1,
screen.getCurrentCol() + 1,
p);
***************
*** 307,311 ****
// current cursor position
if (last.equals("[markright]"))
! screen.getPointFromRowCol(screen.getCurrentRow() - 1,
screen.getCurrentCol()-2,
p);
--- 342,346 ----
// current cursor position
if (last.equals("[markright]"))
! bi.getPointFromRowCol(screen.getCurrentRow() - 1,
screen.getCurrentCol()-2,
p);
***************
*** 313,317 ****
if (last.equals("[markup]"))
! screen.getPointFromRowCol(screen.getCurrentRow() + 1,
screen.getCurrentCol() - 1,
p);
--- 348,352 ----
if (last.equals("[markup]"))
! bi.getPointFromRowCol(screen.getCurrentRow() + 1,
screen.getCurrentCol() - 1,
p);
***************
*** 319,323 ****
// row.
if (last.equals("[markdown]"))
! screen.getPointFromRowCol(screen.getCurrentRow() - 2,
screen.getCurrentCol() - 1,
p);
--- 354,358 ----
// row.
if (last.equals("[markdown]"))
! bi.getPointFromRowCol(screen.getCurrentRow() - 2,
screen.getCurrentCol() - 1,
p);
***************
*** 332,336 ****
}
! screen.getPointFromRowCol(screen.getCurrentRow() - 1,
screen.getCurrentCol() - 1,
p);
--- 367,371 ----
}
! bi.getPointFromRowCol(screen.getCurrentRow() - 1,
screen.getCurrentCol() - 1,
p);
***************
*** 490,494 ****
}
! screen.propertyChange(pce);
resizeMe();
--- 525,529 ----
}
! // screen.propertyChange(pce);
resizeMe();
***************
*** 650,658 ****
}
! public void sendNegResponse2(int ec) {
!
! vt.sendNegResponse2(ec);
!
! }
public void closeDown() {
--- 685,693 ----
}
! // public void sendNegResponse2(int ec) {
! //
! // vt.sendNegResponse2(ec);
! //
! // }
public void closeDown() {
***************
*** 661,667 ****
// Let's stop the cursor blinking as well as it seems to be causing problems
! if (screen.isBlinkCursor()) {
! screen.setBlinkCursorStop();
! }
vt.disconnect();
--- 696,702 ----
// Let's stop the cursor blinking as well as it seems to be causing problems
! // if (screen.isBlinkCursor()) {
! // screen.setBlinkCursorStop();
! // }
vt.disconnect();
***************
*** 758,762 ****
! screen.setBounds(getDrawingBounds());
}
--- 793,806 ----
! // screen.setBounds(getDrawingBounds());
!
! //this is from screen5250
! screen.setCursorActive(false);
! Rectangle r = getDrawingBounds();
! if (bi != null)
! bi.resizeScreenArea(r.width, r.height);
! repaint();
! // screen.repaintScreen();
! screen.setCursorActive(true);
}
***************
*** 792,797 ****
protected void paintComponent(Graphics g) {
! // log.debug("paint from screen");
// screen.paintComponent3(g);
--- 836,844 ----
protected void paintComponent(Graphics g) {
! log.debug("paint from screen");
+ if (bi == null) {
+ checkOffScreenImage();
+ }
// screen.paintComponent3(g);
***************
*** 800,813 ****
// Rectangle r = g.getClipBounds();
! g2.setColor(screen.colorBg);
g2.fillRect(0, 0, getWidth(), getHeight());
! screen.bi.drawImageBuffer(g2);
!
if (rubberband.isAreaSelected() && !rubberband.isDragging()) {
rubberband.erase();
rubberband.draw();
}
!
keyPad.repaint();
--- 847,860 ----
// Rectangle r = g.getClipBounds();
! g2.setColor(bi.colorBg);
g2.fillRect(0, 0, getWidth(), getHeight());
! bi.drawImageBuffer(g2);
!
if (rubberband.isAreaSelected() && !rubberband.isDragging()) {
rubberband.erase();
rubberband.draw();
}
!
keyPad.repaint();
***************
*** 815,823 ****
public void update(Graphics g) {
! log.debug("paint from gui");
paint(g);
}
/**
* Add a SessionJumpListener to the listener list.
--- 862,982 ----
public void update(Graphics g) {
! log.info("paint from gui");
paint(g);
}
+ public boolean isHotSpots() {
+ return bi.hotSpots;
+ }
+
+ public void toggleHotSpots() {
+ bi.hotSpots = !bi.hotSpots;
+ }
+
+ /**
+ * @todo: Change to be mnemonic key.
+ *
+ * This toggles the ruler line.
+ *
+ *
+ */
+ public void crossHair() {
+ screen.setCursorActive(false);
+ bi.crossHair++;
+ if (bi.crossHair > 3)
+ bi.crossHair = 0;
+ screen.setCursorActive(true);
+ }
+
+ /**
+ *
+ * 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(screen,this,sesConfig);
+
+ // if (antialiased) {
+ // bi.setUseAntialias(true);
+ // }
+
+ // allocate a buffer Image with appropriate size
+ bi.getImageBuffer(0, 0);
+
+ // 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();
+ }
+
+ }
+
+
+ /**
+ *
+ * Copy & Paste start code
+ *
+ */
+ public final void copyMe() {
+
+ Rectangle workR = new Rectangle();
+ // lets get the bounding area using a rectangle that we have already
+ // allocated
+ getBoundingArea(workR);
+
+ rubberband.reset();
+ repaint();
+
+ log.debug("Copying" + workR);
+
+ screen.copyMe(workR);
+
+ }
+
+ /**
+ * Sum them
+ *
+ * @param which
+ * formatting option to use
+ * @return vector string of numberic values
+ */
+ protected final Vector sumThem(boolean which) {
+
+ StringBuffer s = new StringBuffer();
+
+ Rectangle workR = new Rectangle();
+ getBoundingArea(workR);
+
+ // gui.rubberband.reset();
+ // gui.repaint();
+
+ log.debug("Summing");
+ return screen.sumThem(which,workR);
+ }
+
+ /**
+ *
+ * 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(screen, bi.font, screen.getCols(),
+ screen.getRows(), Color.black, true, (Session) this);
+
+ printerThread.start();
+
+ }
+
/**
* Add a SessionJumpListener to the listener list.
***************
*** 886,890 ****
public Graphics getDrawingGraphics(){
! return screen.getDrawingArea();
}
--- 1045,1049 ----
public Graphics getDrawingGraphics(){
! return bi.getDrawingArea();
}
***************
*** 896,905 ****
public Point translateStart(Point start) {
! return screen.translateStart(start);
}
public Point translateEnd(Point end) {
! return screen.translateEnd(end);
}
public void areaBounded(RubberBand band, int x1, int y1, int x2, int y2) {
--- 1055,1071 ----
public Point translateStart(Point start) {
! return bi.translateStart(start);
}
public Point translateEnd(Point end) {
! return bi.translateEnd(end);
}
+ public int getPosFromView(int x, int y) {
+ return bi.getPosFromView(x,y);
+ }
+
+ public void getBoundingArea(Rectangle bounds) {
+ bi.getBoundingArea(bounds);
+ }
public void areaBounded(RubberBand band, int x1, int y1, int x2, int y2) {
***************
*** 917,921 ****
// point to the 5250 screen coordinates
// return !screen.isKeyboardLocked() && (screen.isWithinScreenArea(b.getStartPoint().x,b.getStartPoint().y));
! return screen.isWithinScreenArea(b.getStartPoint().x,b.getStartPoint().y);
}
--- 1083,1087 ----
// point to the 5250 screen coordinates
// return !screen.isKeyboardLocked() && (screen.isWithinScreenArea(b.getStartPoint().x,b.getStartPoint().y));
! return bi.isWithinScreenArea(b.getStartPoint().x,b.getStartPoint().y);
}
***************
*** 969,973 ****
if(this.endPoint == null) {
Point p = new Point(0,0);
! screen.getPointFromRowCol(0,0,p);
setEndPoint(p);
}
--- 1135,1139 ----
if(this.endPoint == null) {
Point p = new Point(0,0);
! bi.getPointFromRowCol(0,0,p);
setEndPoint(p);
}
***************
*** 979,983 ****
if(this.startPoint == null) {
Point p = new Point(0,0);
! screen.getPointFromRowCol(0,0,p);
setStartPoint(p);
}
--- 1145,1149 ----
if(this.startPoint == null) {
Point p = new Point(0,0);
! bi.getPointFromRowCol(0,0,p);
setStartPoint(p);
}
-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click