rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
while (iter.getIndex() >= iter.getBeginIndex()) {
int start = iter.getBeginIndex(); while (iter.getIndex() >= iter.getBeginIndex()) {
public int previous() { if (iter.getIndex() == iter.getBeginIndex()) return DONE; //int start = iter.getBeginIndex(); while (iter.getIndex() >= iter.getBeginIndex()) { char c = iter.previous(); if (c == CharacterIterator.DONE) break; int type = Character.getType(c); if (type != Character.NON_SPACING_MARK && !isLowSurrogate(c) && !isLVT(c)) break; // Now we need some lookahead. char ahead = iter.previous(); if (ahead == CharacterIterator.DONE) { iter.next(); break; } char ahead2 = iter.previous(); iter.next(); iter.next(); if (ahead2 == CharacterIterator.DONE) break; int aheadType = Character.getType(ahead); if (aheadType == Character.PARAGRAPH_SEPARATOR) break; if (isLVT(c) && !isLVT(ahead)) break; if (!isLVT(c) && type != Character.NON_SPACING_MARK && isL(ahead)) break; if (!isV(c) && !isT(c) && type != Character.NON_SPACING_MARK && isV(ahead)) break; if (!isT(c) && type != Character.NON_SPACING_MARK && isT(ahead)) break; if (isLowSurrogate(c) && !isHighSurrogate(ahead)) break; if (!isLowSurrogate(c) && isHighSurrogate(ahead)) break; if (isLowSurrogate(ahead) && !isHighSurrogate(ahead2)) break; } return iter.getIndex(); }
else { Component comp = comboBox.getEditor().getEditorComponent(); Dimension prefSize = comp.getPreferredSize(); int width = prefSize.width; int height = prefSize.height + 2; Object prototype = comboBox.getPrototypeDisplayValue(); if (prototype != null) { FontMetrics fm = comboBox.getFontMetrics(comboBox.getFont()); width = Math.max(width, fm.stringWidth(prototype.toString()) + 2); } displaySize = new Dimension(width, height); return displaySize; } }
protected Dimension getDisplaySize() { Object prototype = comboBox.getPrototypeDisplayValue(); if (prototype != null) { // calculate result based on prototype ListCellRenderer renderer = comboBox.getRenderer(); Component comp = renderer.getListCellRendererComponent(listBox, prototype, -1, false, false); Dimension compSize = comp.getPreferredSize(); compSize.width += 2; // add 1 pixel margin around area compSize.height += 2; return compSize; } else { ComboBoxModel model = comboBox.getModel(); int numItems = model.getSize(); // if combo box doesn't have any items then simply // return its default size if (numItems == 0) { displaySize = getDefaultSize(); return displaySize; } Dimension size = new Dimension(0, 0); // ComboBox's display size should be equal to the // size of the largest item in the combo box. ListCellRenderer renderer = comboBox.getRenderer(); for (int i = 0; i < numItems; i++) { Object item = model.getElementAt(i); Component comp = renderer.getListCellRendererComponent(listBox, item, -1, false, false); Dimension compSize = comp.getPreferredSize(); if (compSize.width + 2 > size.width) size.width = compSize.width + 2; if (compSize.height + 2 > size.height) size.height = compSize.height + 2; } displaySize = size; return displaySize; } }
comboBox.setEditor(createEditor()); editor = comboBox.getEditor().getEditorComponent();
currentEditor = createEditor(); comboBox.setEditor(currentEditor);
protected void installComponents() { // create drop down list of items popup = createPopup(); listBox = popup.getList(); // set editor and renderer for the combo box. Editor is used // only if combo box becomes editable, otherwise renderer is used // to paint the selected item; combobox is not editable by default. comboBox.setRenderer(createRenderer()); // create and install arrow button arrowButton = createArrowButton(); configureArrowButton(); comboBox.add(arrowButton); ComboBoxEditor currentEditor = comboBox.getEditor(); if (currentEditor == null || currentEditor instanceof UIResource) { comboBox.setEditor(createEditor()); editor = comboBox.getEditor().getEditorComponent(); } comboBox.revalidate(); }
editor = currentEditor.getEditorComponent();
protected void installComponents() { // create drop down list of items popup = createPopup(); listBox = popup.getList(); // set editor and renderer for the combo box. Editor is used // only if combo box becomes editable, otherwise renderer is used // to paint the selected item; combobox is not editable by default. comboBox.setRenderer(createRenderer()); // create and install arrow button arrowButton = createArrowButton(); configureArrowButton(); comboBox.add(arrowButton); ComboBoxEditor currentEditor = comboBox.getEditor(); if (currentEditor == null || currentEditor instanceof UIResource) { comboBox.setEditor(createEditor()); editor = comboBox.getEditor().getEditorComponent(); } comboBox.revalidate(); }
JPanel semp = new JPanel(); semp.setLayout(new AlignLayout(2,5,5)); JLabel tol = new JLabel(LangTool.getString("em.to")); JTextField tot = new JTextField(30); JLabel subl = new JLabel(LangTool.getString("em.subject")); JTextField subt = new JTextField(30); JLabel fnl = new JLabel(LangTool.getString("em.fileName")); JTextField fnt = new JTextField("tn5250j.txt",30); semp.add(tol); semp.add(tot); semp.add(subl); semp.add(subt); semp.add(fnl); semp.add(fnt);
if (!isEMailAvailable()) {
public SendEMailDialog(Frame parent, Screen5250 screen ) { JPanel semp = new JPanel(); semp.setLayout(new AlignLayout(2,5,5)); JLabel tol = new JLabel(LangTool.getString("em.to")); JTextField tot = new JTextField(30); JLabel subl = new JLabel(LangTool.getString("em.subject")); JTextField subt = new JTextField(30); JLabel fnl = new JLabel(LangTool.getString("em.fileName")); JTextField fnt = new JTextField("tn5250j.txt",30); semp.add(tol); semp.add(tot); semp.add(subl); semp.add(subt); semp.add(fnl); semp.add(fnt); Object[] message = new Object[1]; message[0] = semp; String[] options = {LangTool.getString("em.optSendLabel"), LangTool.getString("em.optCancelLabel"), LangTool.getString("em.optConfigureLabel")}; int result = 0; while (result == 0 || result == 2) { result = JOptionPane.showOptionDialog( parent, // the parent that the dialog blocks message, // the dialog message array LangTool.getString("em.title"), // the title of the dialog window JOptionPane.DEFAULT_OPTION, // option type JOptionPane.QUESTION_MESSAGE, // message type null, // optional icon, use null to use the default icon options, // options string array, will be made into buttons// options[0] // option that should be made into a default button ); switch(result) { case 0: // Send it SendEMail sem = new SendEMail(); sem.setConfigFile("SMTPProperties.cfg"); sem.setTo(tot.getText()); sem.setSubject(subt.getText()); if (fnt.getText().length() > 0) sem.setFileName(fnt.getText()); StringBuffer sb = new StringBuffer(); char[] s = screen.getScreenAsChars(); int c = screen.getCols(); int l = screen.getRows() * c; int col = 0; for (int x = 0; x < l; x++,col++) { sb.append(s[x]); if (col == c) { sb.append('\n'); col = 0; } } sem.setMessage(sb.toString()); try { sem.send(); } catch (IOException ioe) { System.out.println(ioe.getMessage()); } sem.release(); sem = null; System.out.println("Message sent"); break; case 1: // Cancel // System.out.println("Cancel"); break; case 2: // Configure SMTP SMTPConfig smtp = new SMTPConfig(parent,"",true); smtp.setVisible(true); smtp.dispose(); // System.out.println("Cancel"); break; default: break; } } }
Object[] message = new Object[1]; message[0] = semp; String[] options = {LangTool.getString("em.optSendLabel"), LangTool.getString("em.optCancelLabel"), LangTool.getString("em.optConfigureLabel")};
JOptionPane.showMessageDialog(parent, "The Java E-Mail API can not be found or is not installed\n" + "Please read e-mail.txt file for installation instructions." ,"Error", JOptionPane.ERROR_MESSAGE,null);
public SendEMailDialog(Frame parent, Screen5250 screen ) { JPanel semp = new JPanel(); semp.setLayout(new AlignLayout(2,5,5)); JLabel tol = new JLabel(LangTool.getString("em.to")); JTextField tot = new JTextField(30); JLabel subl = new JLabel(LangTool.getString("em.subject")); JTextField subt = new JTextField(30); JLabel fnl = new JLabel(LangTool.getString("em.fileName")); JTextField fnt = new JTextField("tn5250j.txt",30); semp.add(tol); semp.add(tot); semp.add(subl); semp.add(subt); semp.add(fnl); semp.add(fnt); Object[] message = new Object[1]; message[0] = semp; String[] options = {LangTool.getString("em.optSendLabel"), LangTool.getString("em.optCancelLabel"), LangTool.getString("em.optConfigureLabel")}; int result = 0; while (result == 0 || result == 2) { result = JOptionPane.showOptionDialog( parent, // the parent that the dialog blocks message, // the dialog message array LangTool.getString("em.title"), // the title of the dialog window JOptionPane.DEFAULT_OPTION, // option type JOptionPane.QUESTION_MESSAGE, // message type null, // optional icon, use null to use the default icon options, // options string array, will be made into buttons// options[0] // option that should be made into a default button ); switch(result) { case 0: // Send it SendEMail sem = new SendEMail(); sem.setConfigFile("SMTPProperties.cfg"); sem.setTo(tot.getText()); sem.setSubject(subt.getText()); if (fnt.getText().length() > 0) sem.setFileName(fnt.getText()); StringBuffer sb = new StringBuffer(); char[] s = screen.getScreenAsChars(); int c = screen.getCols(); int l = screen.getRows() * c; int col = 0; for (int x = 0; x < l; x++,col++) { sb.append(s[x]); if (col == c) { sb.append('\n'); col = 0; } } sem.setMessage(sb.toString()); try { sem.send(); } catch (IOException ioe) { System.out.println(ioe.getMessage()); } sem.release(); sem = null; System.out.println("Message sent"); break; case 1: // Cancel // System.out.println("Cancel"); break; case 2: // Configure SMTP SMTPConfig smtp = new SMTPConfig(parent,"",true); smtp.setVisible(true); smtp.dispose(); // System.out.println("Cancel"); break; default: break; } } }
int result = 0; while (result == 0 || result == 2) { result = JOptionPane.showOptionDialog( parent, message, LangTool.getString("em.title"), JOptionPane.DEFAULT_OPTION, JOptionPane.QUESTION_MESSAGE, null, options, options[0] );
} else { JPanel semp = new JPanel(); semp.setLayout(new AlignLayout(2,5,5)); JLabel tol = new JLabel(LangTool.getString("em.to")); JTextField tot = new JTextField(30); JLabel subl = new JLabel(LangTool.getString("em.subject")); JTextField subt = new JTextField(30); JLabel fnl = new JLabel(LangTool.getString("em.fileName")); JTextField fnt = new JTextField("tn5250j.txt",30); semp.add(tol); semp.add(tot); semp.add(subl); semp.add(subt); semp.add(fnl); semp.add(fnt);
public SendEMailDialog(Frame parent, Screen5250 screen ) { JPanel semp = new JPanel(); semp.setLayout(new AlignLayout(2,5,5)); JLabel tol = new JLabel(LangTool.getString("em.to")); JTextField tot = new JTextField(30); JLabel subl = new JLabel(LangTool.getString("em.subject")); JTextField subt = new JTextField(30); JLabel fnl = new JLabel(LangTool.getString("em.fileName")); JTextField fnt = new JTextField("tn5250j.txt",30); semp.add(tol); semp.add(tot); semp.add(subl); semp.add(subt); semp.add(fnl); semp.add(fnt); Object[] message = new Object[1]; message[0] = semp; String[] options = {LangTool.getString("em.optSendLabel"), LangTool.getString("em.optCancelLabel"), LangTool.getString("em.optConfigureLabel")}; int result = 0; while (result == 0 || result == 2) { result = JOptionPane.showOptionDialog( parent, // the parent that the dialog blocks message, // the dialog message array LangTool.getString("em.title"), // the title of the dialog window JOptionPane.DEFAULT_OPTION, // option type JOptionPane.QUESTION_MESSAGE, // message type null, // optional icon, use null to use the default icon options, // options string array, will be made into buttons// options[0] // option that should be made into a default button ); switch(result) { case 0: // Send it SendEMail sem = new SendEMail(); sem.setConfigFile("SMTPProperties.cfg"); sem.setTo(tot.getText()); sem.setSubject(subt.getText()); if (fnt.getText().length() > 0) sem.setFileName(fnt.getText()); StringBuffer sb = new StringBuffer(); char[] s = screen.getScreenAsChars(); int c = screen.getCols(); int l = screen.getRows() * c; int col = 0; for (int x = 0; x < l; x++,col++) { sb.append(s[x]); if (col == c) { sb.append('\n'); col = 0; } } sem.setMessage(sb.toString()); try { sem.send(); } catch (IOException ioe) { System.out.println(ioe.getMessage()); } sem.release(); sem = null; System.out.println("Message sent"); break; case 1: // Cancel // System.out.println("Cancel"); break; case 2: // Configure SMTP SMTPConfig smtp = new SMTPConfig(parent,"",true); smtp.setVisible(true); smtp.dispose(); // System.out.println("Cancel"); break; default: break; } } }
switch(result) { case 0: SendEMail sem = new SendEMail(); sem.setConfigFile("SMTPProperties.cfg"); sem.setTo(tot.getText()); sem.setSubject(subt.getText()); if (fnt.getText().length() > 0) sem.setFileName(fnt.getText());
Object[] message = new Object[1]; message[0] = semp; String[] options = {LangTool.getString("em.optSendLabel"), LangTool.getString("em.optCancelLabel"), LangTool.getString("em.optConfigureLabel")};
public SendEMailDialog(Frame parent, Screen5250 screen ) { JPanel semp = new JPanel(); semp.setLayout(new AlignLayout(2,5,5)); JLabel tol = new JLabel(LangTool.getString("em.to")); JTextField tot = new JTextField(30); JLabel subl = new JLabel(LangTool.getString("em.subject")); JTextField subt = new JTextField(30); JLabel fnl = new JLabel(LangTool.getString("em.fileName")); JTextField fnt = new JTextField("tn5250j.txt",30); semp.add(tol); semp.add(tot); semp.add(subl); semp.add(subt); semp.add(fnl); semp.add(fnt); Object[] message = new Object[1]; message[0] = semp; String[] options = {LangTool.getString("em.optSendLabel"), LangTool.getString("em.optCancelLabel"), LangTool.getString("em.optConfigureLabel")}; int result = 0; while (result == 0 || result == 2) { result = JOptionPane.showOptionDialog( parent, // the parent that the dialog blocks message, // the dialog message array LangTool.getString("em.title"), // the title of the dialog window JOptionPane.DEFAULT_OPTION, // option type JOptionPane.QUESTION_MESSAGE, // message type null, // optional icon, use null to use the default icon options, // options string array, will be made into buttons// options[0] // option that should be made into a default button ); switch(result) { case 0: // Send it SendEMail sem = new SendEMail(); sem.setConfigFile("SMTPProperties.cfg"); sem.setTo(tot.getText()); sem.setSubject(subt.getText()); if (fnt.getText().length() > 0) sem.setFileName(fnt.getText()); StringBuffer sb = new StringBuffer(); char[] s = screen.getScreenAsChars(); int c = screen.getCols(); int l = screen.getRows() * c; int col = 0; for (int x = 0; x < l; x++,col++) { sb.append(s[x]); if (col == c) { sb.append('\n'); col = 0; } } sem.setMessage(sb.toString()); try { sem.send(); } catch (IOException ioe) { System.out.println(ioe.getMessage()); } sem.release(); sem = null; System.out.println("Message sent"); break; case 1: // Cancel // System.out.println("Cancel"); break; case 2: // Configure SMTP SMTPConfig smtp = new SMTPConfig(parent,"",true); smtp.setVisible(true); smtp.dispose(); // System.out.println("Cancel"); break; default: break; } } }
StringBuffer sb = new StringBuffer(); char[] s = screen.getScreenAsChars(); int c = screen.getCols(); int l = screen.getRows() * c; int col = 0; for (int x = 0; x < l; x++,col++) { sb.append(s[x]); if (col == c) { sb.append('\n'); col = 0;
int result = 0; while (result == 0 || result == 2) { result = JOptionPane.showOptionDialog( parent, message, LangTool.getString("em.title"), JOptionPane.DEFAULT_OPTION, JOptionPane.QUESTION_MESSAGE, null, options, options[0] ); switch(result) { case 0: SendEMail sem = new SendEMail(); sem.setConfigFile("SMTPProperties.cfg"); sem.setTo(tot.getText()); sem.setSubject(subt.getText()); if (fnt.getText().length() > 0) sem.setFileName(fnt.getText()); StringBuffer sb = new StringBuffer(); char[] s = screen.getScreenAsChars(); int c = screen.getCols(); int l = screen.getRows() * c; int col = 0; for (int x = 0; x < l; x++,col++) { sb.append(s[x]); if (col == c) { sb.append('\n'); col = 0; }
public SendEMailDialog(Frame parent, Screen5250 screen ) { JPanel semp = new JPanel(); semp.setLayout(new AlignLayout(2,5,5)); JLabel tol = new JLabel(LangTool.getString("em.to")); JTextField tot = new JTextField(30); JLabel subl = new JLabel(LangTool.getString("em.subject")); JTextField subt = new JTextField(30); JLabel fnl = new JLabel(LangTool.getString("em.fileName")); JTextField fnt = new JTextField("tn5250j.txt",30); semp.add(tol); semp.add(tot); semp.add(subl); semp.add(subt); semp.add(fnl); semp.add(fnt); Object[] message = new Object[1]; message[0] = semp; String[] options = {LangTool.getString("em.optSendLabel"), LangTool.getString("em.optCancelLabel"), LangTool.getString("em.optConfigureLabel")}; int result = 0; while (result == 0 || result == 2) { result = JOptionPane.showOptionDialog( parent, // the parent that the dialog blocks message, // the dialog message array LangTool.getString("em.title"), // the title of the dialog window JOptionPane.DEFAULT_OPTION, // option type JOptionPane.QUESTION_MESSAGE, // message type null, // optional icon, use null to use the default icon options, // options string array, will be made into buttons// options[0] // option that should be made into a default button ); switch(result) { case 0: // Send it SendEMail sem = new SendEMail(); sem.setConfigFile("SMTPProperties.cfg"); sem.setTo(tot.getText()); sem.setSubject(subt.getText()); if (fnt.getText().length() > 0) sem.setFileName(fnt.getText()); StringBuffer sb = new StringBuffer(); char[] s = screen.getScreenAsChars(); int c = screen.getCols(); int l = screen.getRows() * c; int col = 0; for (int x = 0; x < l; x++,col++) { sb.append(s[x]); if (col == c) { sb.append('\n'); col = 0; } } sem.setMessage(sb.toString()); try { sem.send(); } catch (IOException ioe) { System.out.println(ioe.getMessage()); } sem.release(); sem = null; System.out.println("Message sent"); break; case 1: // Cancel // System.out.println("Cancel"); break; case 2: // Configure SMTP SMTPConfig smtp = new SMTPConfig(parent,"",true); smtp.setVisible(true); smtp.dispose(); // System.out.println("Cancel"); break; default: break; } } }
}
public SendEMailDialog(Frame parent, Screen5250 screen ) { JPanel semp = new JPanel(); semp.setLayout(new AlignLayout(2,5,5)); JLabel tol = new JLabel(LangTool.getString("em.to")); JTextField tot = new JTextField(30); JLabel subl = new JLabel(LangTool.getString("em.subject")); JTextField subt = new JTextField(30); JLabel fnl = new JLabel(LangTool.getString("em.fileName")); JTextField fnt = new JTextField("tn5250j.txt",30); semp.add(tol); semp.add(tot); semp.add(subl); semp.add(subt); semp.add(fnl); semp.add(fnt); Object[] message = new Object[1]; message[0] = semp; String[] options = {LangTool.getString("em.optSendLabel"), LangTool.getString("em.optCancelLabel"), LangTool.getString("em.optConfigureLabel")}; int result = 0; while (result == 0 || result == 2) { result = JOptionPane.showOptionDialog( parent, // the parent that the dialog blocks message, // the dialog message array LangTool.getString("em.title"), // the title of the dialog window JOptionPane.DEFAULT_OPTION, // option type JOptionPane.QUESTION_MESSAGE, // message type null, // optional icon, use null to use the default icon options, // options string array, will be made into buttons// options[0] // option that should be made into a default button ); switch(result) { case 0: // Send it SendEMail sem = new SendEMail(); sem.setConfigFile("SMTPProperties.cfg"); sem.setTo(tot.getText()); sem.setSubject(subt.getText()); if (fnt.getText().length() > 0) sem.setFileName(fnt.getText()); StringBuffer sb = new StringBuffer(); char[] s = screen.getScreenAsChars(); int c = screen.getCols(); int l = screen.getRows() * c; int col = 0; for (int x = 0; x < l; x++,col++) { sb.append(s[x]); if (col == c) { sb.append('\n'); col = 0; } } sem.setMessage(sb.toString()); try { sem.send(); } catch (IOException ioe) { System.out.println(ioe.getMessage()); } sem.release(); sem = null; System.out.println("Message sent"); break; case 1: // Cancel // System.out.println("Cancel"); break; case 2: // Configure SMTP SMTPConfig smtp = new SMTPConfig(parent,"",true); smtp.setVisible(true); smtp.dispose(); // System.out.println("Cancel"); break; default: break; } } }
break; case 1: break; case 2: SMTPConfig smtp = new SMTPConfig(parent,"",true); smtp.setVisible(true); smtp.dispose(); break; default: break;
break; case 1: break; case 2: SMTPConfig smtp = new SMTPConfig(parent,"",true); smtp.setVisible(true); smtp.dispose(); break; default: break; }
public SendEMailDialog(Frame parent, Screen5250 screen ) { JPanel semp = new JPanel(); semp.setLayout(new AlignLayout(2,5,5)); JLabel tol = new JLabel(LangTool.getString("em.to")); JTextField tot = new JTextField(30); JLabel subl = new JLabel(LangTool.getString("em.subject")); JTextField subt = new JTextField(30); JLabel fnl = new JLabel(LangTool.getString("em.fileName")); JTextField fnt = new JTextField("tn5250j.txt",30); semp.add(tol); semp.add(tot); semp.add(subl); semp.add(subt); semp.add(fnl); semp.add(fnt); Object[] message = new Object[1]; message[0] = semp; String[] options = {LangTool.getString("em.optSendLabel"), LangTool.getString("em.optCancelLabel"), LangTool.getString("em.optConfigureLabel")}; int result = 0; while (result == 0 || result == 2) { result = JOptionPane.showOptionDialog( parent, // the parent that the dialog blocks message, // the dialog message array LangTool.getString("em.title"), // the title of the dialog window JOptionPane.DEFAULT_OPTION, // option type JOptionPane.QUESTION_MESSAGE, // message type null, // optional icon, use null to use the default icon options, // options string array, will be made into buttons// options[0] // option that should be made into a default button ); switch(result) { case 0: // Send it SendEMail sem = new SendEMail(); sem.setConfigFile("SMTPProperties.cfg"); sem.setTo(tot.getText()); sem.setSubject(subt.getText()); if (fnt.getText().length() > 0) sem.setFileName(fnt.getText()); StringBuffer sb = new StringBuffer(); char[] s = screen.getScreenAsChars(); int c = screen.getCols(); int l = screen.getRows() * c; int col = 0; for (int x = 0; x < l; x++,col++) { sb.append(s[x]); if (col == c) { sb.append('\n'); col = 0; } } sem.setMessage(sb.toString()); try { sem.send(); } catch (IOException ioe) { System.out.println(ioe.getMessage()); } sem.release(); sem = null; System.out.println("Message sent"); break; case 1: // Cancel // System.out.println("Cancel"); break; case 2: // Configure SMTP SMTPConfig smtp = new SMTPConfig(parent,"",true); smtp.setVisible(true); smtp.dispose(); // System.out.println("Cancel"); break; default: break; } } }
if (index >= 0)
public void mouseReleased(MouseEvent anEvent) { int index = list.locationToIndex(anEvent.getPoint()); comboBox.setSelectedIndex(index); hide(); }
int index = list.locationToIndex(anEvent.getPoint()); list.setSelectedIndex(index); list.repaint();
updateListBoxSelectionForEvent(anEvent, false);
public void mouseMoved(MouseEvent anEvent) { // Highlight list cells over which the mouse is located. // This changes list model, but has no effect on combo box's data model int index = list.locationToIndex(anEvent.getPoint()); list.setSelectedIndex(index); list.repaint(); }
int index = list.locationToIndex(anEvent.getPoint()); if (index >= 0) list.setSelectedIndex(index);
protected void updateListBoxSelectionForEvent(MouseEvent anEvent, boolean shouldScroll) { // FIXME: Need to implement }
System.out.println(ioe.getMessage());
log.warn(ioe.getMessage());
public final void cancelInvite() { screen52.setStatus(Screen5250.STATUS_SYSTEM, Screen5250.STATUS_VALUE_ON,null); // from rfc1205 section 4.3 // Server: Sends header with the 000A12A0 00000400 000AFFEF // Opcode = Cancel Invite. // Client: sends header with the 000A12A0 00000400 000AFFEF // Opcode = Cancel Invite to // indicate that the work station is // no longer invited. try { writeGDS(0, 10, null); } catch (IOException ioe) { System.out.println(ioe.getMessage()); } }
System.out.println("Closing socket");
log.info("Closing socket");
public final boolean disconnect() { if (me != null && me.isAlive()) { me.interrupt(); keepTrucking = false; pthread.interrupt(); } screen52.setStatus(Screen5250.STATUS_SYSTEM, Screen5250.STATUS_VALUE_ON,"X - Disconnected"); screen52.setKeyboardLocked(false); pendingUnlock =false; try { if (sock != null) { System.out.println("Closing socket"); sock.close(); } if (bin != null) bin.close(); if (bout != null) bout.close(); connected = false; firstScreen = false; controller.fireSessionChanged(TN5250jConstants.STATE_DISCONNECTED); } catch(Exception exception) { System.out.println(exception.getMessage()); connected = false; devSeq = -1; return false; } devSeq = -1; return true; }
System.out.println(exception.getMessage());
log.warn(exception.getMessage());
public final boolean disconnect() { if (me != null && me.isAlive()) { me.interrupt(); keepTrucking = false; pthread.interrupt(); } screen52.setStatus(Screen5250.STATUS_SYSTEM, Screen5250.STATUS_VALUE_ON,"X - Disconnected"); screen52.setKeyboardLocked(false); pendingUnlock =false; try { if (sock != null) { System.out.println("Closing socket"); sock.close(); } if (bin != null) bin.close(); if (bout != null) bout.close(); connected = false; firstScreen = false; controller.fireSessionChanged(TN5250jConstants.STATE_DISCONNECTED); } catch(Exception exception) { System.out.println(exception.getMessage()); connected = false; devSeq = -1; return false; } devSeq = -1; return true; }
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);
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); }
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); }
System.out.println(ioe.getMessage());
log.warn(ioe.getMessage());
public final void hostPrint(int aid) { if (screen52.isStatusErrorCode()) { screen52.restoreErrorLine(); screen52.setStatus(Screen5250.STATUS_ERROR_CODE, Screen5250.STATUS_VALUE_OFF,null); } screen52.setCursorActive(false); screen52.setStatus(Screen5250.STATUS_SYSTEM, Screen5250.STATUS_VALUE_ON,null); // From client access ip capture // it seems to use an operation code of 3 and 4 // also note that the flag field that says reserved is being sent as well // with a value of 0x80 // // I have tried with not setting these flags and sending with 3 or 1 // there is no effect and I still get a host print screen. Go figure //0000: 000D 12A0 0000 0400 8003 1407 F6FFEF //0000: 000D 12A0 0000 0400 8001 110E F6FFEF // // Client sends header 000D12A0000004000003####F6FFEF // operation code 3 // row - first ## // column - second ## // F6 - Print Aid Key baosp.write(screen52.getCurrentRow()); baosp.write(screen52.getCurrentCol()); baosp.write(AID_PRINT); // aid key try { writeGDS(0, 3, baosp.toByteArray()); } catch (IOException ioe) { System.out.println(ioe.getMessage()); } baosp.reset(); }
log.debug("save screen partial");
private void parseIncoming() { boolean controlChars = false; byte control0; byte control1; boolean done = false; boolean error = false; try { while (bk.hasNext() && !done) { byte b = bk.getNextByte(); switch (b) { case 0: case 1: break; case CMD_SAVE_SCREEN: // 0x02 2 Save Screen case 3: // 0x03 3 Save Partial Screen// System.out.println("save screen partial"); saveScreen(); break; case ESC: // ESCAPE break; case 7: // audible bell Toolkit.getDefaultToolkit().beep(); bk.getNextByte(); bk.getNextByte(); break; case CMD_WRITE_TO_DISPLAY: // 0x11 17 write to display error = writeToDisplay(true); break; case CMD_RESTORE_SCREEN: // 0x12 18 Restore Screen case 13: // 0x13 19 Restore Partial Screen// System.out.println("restore screen partial"); restoreScreen(); break; case CMD_CLEAR_UNIT_ALTERNATE: // 0x20 32 clear unit alternate 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"); done = true; } else { if (screen52.getRows() != 27) screen52.setRowsCols(27,132); screen52.clearAll(); } break; case CMD_WRITE_ERROR_CODE: // 0x21 33 Write Error Code writeErrorCode(); error = writeToDisplay(false); break; case CMD_WRITE_ERROR_CODE_TO_WINDOW: // 0x22 34 // Write Error Code to window writeErrorCodeToWindow(); error = writeToDisplay(false); break; case CMD_READ_SCREEN_IMMEDIATE: // 0x62 98 case CMD_READ_SCREEN_TO_PRINT: // 0x66 102 read screen to print readScreen(); break; case CMD_CLEAR_UNIT: // 64 0x40 clear unit if (screen52.getRows() != 24) screen52.setRowsCols(24,80); screen52.clearAll(); break; case CMD_CLEAR_FORMAT_TABLE: // 80 0x50 Clear format table screen52.clearTable(); break; case CMD_READ_INPUT_FIELDS: //0x42 66 read input fields case CMD_READ_MDT_FIELDS: // 0x52 82 read MDT Fields bk.getNextByte(); bk.getNextByte(); readType = b; screen52.goHome(); // do nothing with the cursor here it is taken care of // in the main loop.//////////////// screen52.setCursorOn(); waitingForInput = true; pendingUnlock = true;// screen52.setKeyboardLocked(false); break; case CMD_READ_MDT_IMMEDIATE_ALT: // 0x53 83 readType = b;// screen52.goHome();// waitingForInput = true;// screen52.setKeyboardLocked(false); readImmediate(readType); break; case CMD_WRITE_STRUCTURED_FIELD: // 243 0xF3 -13 Write structured field writeStructuredField(); break; case CMD_ROLL: // 0x23 35 Roll Not sure what it does right now int updown = bk.getNextByte(); int topline = bk.getNextByte(); int bottomline = bk.getNextByte(); screen52.rollScreen(updown,topline,bottomline); break; default: done = true; sendNegResponse(NR_REQUEST_ERROR,03,01,01,"parseIncoming"); break; } if (error) done = true; } } catch (Exception exc) {System.out.println("incoming " + exc.getMessage());}; }
log.debug("restore screen partial");
private void parseIncoming() { boolean controlChars = false; byte control0; byte control1; boolean done = false; boolean error = false; try { while (bk.hasNext() && !done) { byte b = bk.getNextByte(); switch (b) { case 0: case 1: break; case CMD_SAVE_SCREEN: // 0x02 2 Save Screen case 3: // 0x03 3 Save Partial Screen// System.out.println("save screen partial"); saveScreen(); break; case ESC: // ESCAPE break; case 7: // audible bell Toolkit.getDefaultToolkit().beep(); bk.getNextByte(); bk.getNextByte(); break; case CMD_WRITE_TO_DISPLAY: // 0x11 17 write to display error = writeToDisplay(true); break; case CMD_RESTORE_SCREEN: // 0x12 18 Restore Screen case 13: // 0x13 19 Restore Partial Screen// System.out.println("restore screen partial"); restoreScreen(); break; case CMD_CLEAR_UNIT_ALTERNATE: // 0x20 32 clear unit alternate 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"); done = true; } else { if (screen52.getRows() != 27) screen52.setRowsCols(27,132); screen52.clearAll(); } break; case CMD_WRITE_ERROR_CODE: // 0x21 33 Write Error Code writeErrorCode(); error = writeToDisplay(false); break; case CMD_WRITE_ERROR_CODE_TO_WINDOW: // 0x22 34 // Write Error Code to window writeErrorCodeToWindow(); error = writeToDisplay(false); break; case CMD_READ_SCREEN_IMMEDIATE: // 0x62 98 case CMD_READ_SCREEN_TO_PRINT: // 0x66 102 read screen to print readScreen(); break; case CMD_CLEAR_UNIT: // 64 0x40 clear unit if (screen52.getRows() != 24) screen52.setRowsCols(24,80); screen52.clearAll(); break; case CMD_CLEAR_FORMAT_TABLE: // 80 0x50 Clear format table screen52.clearTable(); break; case CMD_READ_INPUT_FIELDS: //0x42 66 read input fields case CMD_READ_MDT_FIELDS: // 0x52 82 read MDT Fields bk.getNextByte(); bk.getNextByte(); readType = b; screen52.goHome(); // do nothing with the cursor here it is taken care of // in the main loop.//////////////// screen52.setCursorOn(); waitingForInput = true; pendingUnlock = true;// screen52.setKeyboardLocked(false); break; case CMD_READ_MDT_IMMEDIATE_ALT: // 0x53 83 readType = b;// screen52.goHome();// waitingForInput = true;// screen52.setKeyboardLocked(false); readImmediate(readType); break; case CMD_WRITE_STRUCTURED_FIELD: // 243 0xF3 -13 Write structured field writeStructuredField(); break; case CMD_ROLL: // 0x23 35 Roll Not sure what it does right now int updown = bk.getNextByte(); int topline = bk.getNextByte(); int bottomline = bk.getNextByte(); screen52.rollScreen(updown,topline,bottomline); break; default: done = true; sendNegResponse(NR_REQUEST_ERROR,03,01,01,"parseIncoming"); break; } if (error) done = true; } } catch (Exception exc) {System.out.println("incoming " + exc.getMessage());}; }
log.debug(" clear unit alternate error " + Integer.toHexString(param));
private void parseIncoming() { boolean controlChars = false; byte control0; byte control1; boolean done = false; boolean error = false; try { while (bk.hasNext() && !done) { byte b = bk.getNextByte(); switch (b) { case 0: case 1: break; case CMD_SAVE_SCREEN: // 0x02 2 Save Screen case 3: // 0x03 3 Save Partial Screen// System.out.println("save screen partial"); saveScreen(); break; case ESC: // ESCAPE break; case 7: // audible bell Toolkit.getDefaultToolkit().beep(); bk.getNextByte(); bk.getNextByte(); break; case CMD_WRITE_TO_DISPLAY: // 0x11 17 write to display error = writeToDisplay(true); break; case CMD_RESTORE_SCREEN: // 0x12 18 Restore Screen case 13: // 0x13 19 Restore Partial Screen// System.out.println("restore screen partial"); restoreScreen(); break; case CMD_CLEAR_UNIT_ALTERNATE: // 0x20 32 clear unit alternate 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"); done = true; } else { if (screen52.getRows() != 27) screen52.setRowsCols(27,132); screen52.clearAll(); } break; case CMD_WRITE_ERROR_CODE: // 0x21 33 Write Error Code writeErrorCode(); error = writeToDisplay(false); break; case CMD_WRITE_ERROR_CODE_TO_WINDOW: // 0x22 34 // Write Error Code to window writeErrorCodeToWindow(); error = writeToDisplay(false); break; case CMD_READ_SCREEN_IMMEDIATE: // 0x62 98 case CMD_READ_SCREEN_TO_PRINT: // 0x66 102 read screen to print readScreen(); break; case CMD_CLEAR_UNIT: // 64 0x40 clear unit if (screen52.getRows() != 24) screen52.setRowsCols(24,80); screen52.clearAll(); break; case CMD_CLEAR_FORMAT_TABLE: // 80 0x50 Clear format table screen52.clearTable(); break; case CMD_READ_INPUT_FIELDS: //0x42 66 read input fields case CMD_READ_MDT_FIELDS: // 0x52 82 read MDT Fields bk.getNextByte(); bk.getNextByte(); readType = b; screen52.goHome(); // do nothing with the cursor here it is taken care of // in the main loop.//////////////// screen52.setCursorOn(); waitingForInput = true; pendingUnlock = true;// screen52.setKeyboardLocked(false); break; case CMD_READ_MDT_IMMEDIATE_ALT: // 0x53 83 readType = b;// screen52.goHome();// waitingForInput = true;// screen52.setKeyboardLocked(false); readImmediate(readType); break; case CMD_WRITE_STRUCTURED_FIELD: // 243 0xF3 -13 Write structured field writeStructuredField(); break; case CMD_ROLL: // 0x23 35 Roll Not sure what it does right now int updown = bk.getNextByte(); int topline = bk.getNextByte(); int bottomline = bk.getNextByte(); screen52.rollScreen(updown,topline,bottomline); break; default: done = true; sendNegResponse(NR_REQUEST_ERROR,03,01,01,"parseIncoming"); break; } if (error) done = true; } } catch (Exception exc) {System.out.println("incoming " + exc.getMessage());}; }
catch (Exception exc) {System.out.println("incoming " + exc.getMessage());};
catch (Exception exc) {log.warn("incoming " + exc.getMessage());};
private void parseIncoming() { boolean controlChars = false; byte control0; byte control1; boolean done = false; boolean error = false; try { while (bk.hasNext() && !done) { byte b = bk.getNextByte(); switch (b) { case 0: case 1: break; case CMD_SAVE_SCREEN: // 0x02 2 Save Screen case 3: // 0x03 3 Save Partial Screen// System.out.println("save screen partial"); saveScreen(); break; case ESC: // ESCAPE break; case 7: // audible bell Toolkit.getDefaultToolkit().beep(); bk.getNextByte(); bk.getNextByte(); break; case CMD_WRITE_TO_DISPLAY: // 0x11 17 write to display error = writeToDisplay(true); break; case CMD_RESTORE_SCREEN: // 0x12 18 Restore Screen case 13: // 0x13 19 Restore Partial Screen// System.out.println("restore screen partial"); restoreScreen(); break; case CMD_CLEAR_UNIT_ALTERNATE: // 0x20 32 clear unit alternate 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"); done = true; } else { if (screen52.getRows() != 27) screen52.setRowsCols(27,132); screen52.clearAll(); } break; case CMD_WRITE_ERROR_CODE: // 0x21 33 Write Error Code writeErrorCode(); error = writeToDisplay(false); break; case CMD_WRITE_ERROR_CODE_TO_WINDOW: // 0x22 34 // Write Error Code to window writeErrorCodeToWindow(); error = writeToDisplay(false); break; case CMD_READ_SCREEN_IMMEDIATE: // 0x62 98 case CMD_READ_SCREEN_TO_PRINT: // 0x66 102 read screen to print readScreen(); break; case CMD_CLEAR_UNIT: // 64 0x40 clear unit if (screen52.getRows() != 24) screen52.setRowsCols(24,80); screen52.clearAll(); break; case CMD_CLEAR_FORMAT_TABLE: // 80 0x50 Clear format table screen52.clearTable(); break; case CMD_READ_INPUT_FIELDS: //0x42 66 read input fields case CMD_READ_MDT_FIELDS: // 0x52 82 read MDT Fields bk.getNextByte(); bk.getNextByte(); readType = b; screen52.goHome(); // do nothing with the cursor here it is taken care of // in the main loop.//////////////// screen52.setCursorOn(); waitingForInput = true; pendingUnlock = true;// screen52.setKeyboardLocked(false); break; case CMD_READ_MDT_IMMEDIATE_ALT: // 0x53 83 readType = b;// screen52.goHome();// waitingForInput = true;// screen52.setKeyboardLocked(false); readImmediate(readType); break; case CMD_WRITE_STRUCTURED_FIELD: // 243 0xF3 -13 Write structured field writeStructuredField(); break; case CMD_ROLL: // 0x23 35 Roll Not sure what it does right now int updown = bk.getNextByte(); int topline = bk.getNextByte(); int bottomline = bk.getNextByte(); screen52.rollScreen(updown,topline,bottomline); break; default: done = true; sendNegResponse(NR_REQUEST_ERROR,03,01,01,"parseIncoming"); break; } if (error) done = true; } } catch (Exception exc) {System.out.println("incoming " + exc.getMessage());}; }
log.debug(" Control byte0 " + Integer.toBinaryString(byte0 & 0xff));
private void processCC0 (byte byte0) {// System.out.println(" Control byte0 " + Integer.toBinaryString(byte0 & 0xff)); boolean lockKeyboard = true; boolean resetMDT=false; boolean resetMDTAll = false; boolean nullMDT = false; boolean nullAll = false; // Bits 3 to 6 are reserved and should be set to '0000' // 0xE0 = '11100000' - only the first 3 bits are tested if ((byte0 & 0xE0) == 0x00) { lockKeyboard = false; } // '00100000' = 0x20 /32 -- just lock keyboard // '01000000' = 0x40 /64 // '01100000' = 0x60 /96 // '10000000' = 0x80 /128 // '10100000' = 0xA0 /160 // '11000000' = 0xC0 /192 // '11100000' = 0xE0 /224 switch (byte0 & 0xE0) { case 0x40: resetMDT = true; break; case 0x60: resetMDTAll = true; break; case 0x80: nullMDT = true; break; case 0xA0: resetMDT = true; nullAll = true; break; case 0xC0: resetMDT = true; nullMDT = true; break; case 0xE0: resetMDTAll = true; nullAll = true; break; } if (lockKeyboard) { screen52.setKeyboardLocked(true); pendingUnlock = false; } else pendingUnlock =false; if (resetMDT || resetMDTAll || nullMDT || nullAll) { ScreenField sf; int f = screen52.getScreenFields().getSize(); for (int x = 0; x < f; x++) { sf = screen52.getScreenFields().getField(x); if (!sf.isBypassField()) { if ((nullMDT && sf.mdt) || nullAll ) { sf.setFieldChar((char)0x0); screen52.drawField(sf); } } if (resetMDTAll || (resetMDT && !sf.isBypassField())) sf.resetMDT(); } sf = null; } }
log.debug(" Control byte1 " + Integer.toBinaryString(byte1 & 0xff));
private void processCC1 (byte byte1) {// System.out.println(" Control byte1 " + Integer.toBinaryString(byte1 & 0xff)); if ((byte1 & 0x04) == 0x04) { Toolkit.getDefaultToolkit().beep(); } if ((byte1 & 0x02) == 0x02) { screen52.setMessageLightOff(); } if ((byte1 & 0x01) == 0x01) { screen52.setMessageLightOn(); } if ((byte1 & 0x01) == 0x01 && (byte1 & 0x02) == 0x02) { screen52.setMessageLightOn(); } // reset blinking cursor seems to control whether to set or not set the // the cursor position. No documentation for this just testing and // looking at the bit settings of this field. This was a pain in the ass! // // if it is off '0' then keep existing cursor positioning information // if it is on '1' then reset the cursor positioning information // *** Note *** unless we receive bit 4 on at the same time // this seems to work so far 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) ); } // in enhanced mode we sometimes only receive bit 6 turned on which // is reset blinking cursor if ((byte1 & 0x20) == 0x20 && enhanced) { cursorOn = true; } if (!screen52.isStatusErrorCode() && (byte1 & 0x08) == 0x08) {// screen52.setStatus(screen52.STATUS_SYSTEM,screen52.STATUS_VALUE_OFF,null); cursorOn = true; } if ((byte1 & 0x20) == 0x20 && (byte1 & 0x08) == 0x00) { screen52.setPendingInsert(false,1,1); } }
log.debug(" WTD position no move");
private void processCC1 (byte byte1) {// System.out.println(" Control byte1 " + Integer.toBinaryString(byte1 & 0xff)); if ((byte1 & 0x04) == 0x04) { Toolkit.getDefaultToolkit().beep(); } if ((byte1 & 0x02) == 0x02) { screen52.setMessageLightOff(); } if ((byte1 & 0x01) == 0x01) { screen52.setMessageLightOn(); } if ((byte1 & 0x01) == 0x01 && (byte1 & 0x02) == 0x02) { screen52.setMessageLightOn(); } // reset blinking cursor seems to control whether to set or not set the // the cursor position. No documentation for this just testing and // looking at the bit settings of this field. This was a pain in the ass! // // if it is off '0' then keep existing cursor positioning information // if it is on '1' then reset the cursor positioning information // *** Note *** unless we receive bit 4 on at the same time // this seems to work so far 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) ); } // in enhanced mode we sometimes only receive bit 6 turned on which // is reset blinking cursor if ((byte1 & 0x20) == 0x20 && enhanced) { cursorOn = true; } if (!screen52.isStatusErrorCode() && (byte1 & 0x08) == 0x08) {// screen52.setStatus(screen52.STATUS_SYSTEM,screen52.STATUS_VALUE_OFF,null); cursorOn = true; } if ((byte1 & 0x20) == 0x20 && (byte1 & 0x08) == 0x00) { screen52.setPendingInsert(false,1,1); } }
log.debug(" WTD position move to home" + screen52.homePos + " row " + screen52.getRow(screen52.homePos) + " col " + screen52.getCol(screen52.homePos) );
private void processCC1 (byte byte1) {// System.out.println(" Control byte1 " + Integer.toBinaryString(byte1 & 0xff)); if ((byte1 & 0x04) == 0x04) { Toolkit.getDefaultToolkit().beep(); } if ((byte1 & 0x02) == 0x02) { screen52.setMessageLightOff(); } if ((byte1 & 0x01) == 0x01) { screen52.setMessageLightOn(); } if ((byte1 & 0x01) == 0x01 && (byte1 & 0x02) == 0x02) { screen52.setMessageLightOn(); } // reset blinking cursor seems to control whether to set or not set the // the cursor position. No documentation for this just testing and // looking at the bit settings of this field. This was a pain in the ass! // // if it is off '0' then keep existing cursor positioning information // if it is on '1' then reset the cursor positioning information // *** Note *** unless we receive bit 4 on at the same time // this seems to work so far 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) ); } // in enhanced mode we sometimes only receive bit 6 turned on which // is reset blinking cursor if ((byte1 & 0x20) == 0x20 && enhanced) { cursorOn = true; } if (!screen52.isStatusErrorCode() && (byte1 & 0x08) == 0x08) {// screen52.setStatus(screen52.STATUS_SYSTEM,screen52.STATUS_VALUE_OFF,null); cursorOn = true; } if ((byte1 & 0x20) == 0x20 && (byte1 & 0x08) == 0x00) { screen52.setPendingInsert(false,1,1); } }
log.debug(" byte 0 " + l);
private boolean processSOH() throws Exception { int l = bk.getNextByte(); // length// System.out.println(" byte 0 " + l); if (l > 0 && l <= 7) { bk.getNextByte(); // flag byte 2 bk.getNextByte(); // reserved bk.getNextByte(); // resequence fields screen52.clearTable(); // well that is the first time I have seen this. This fixes a problem // with S/36 command line. Finally got it. if (l <=3) return false; screen52.setErrorLine(bk.getNextByte()); // error row int byte1 = 0; if (l >= 5) { byte1 = bk.getNextByte(); dataIncluded[23] = (byte1 & 0x80) == 0x80; dataIncluded[22] = (byte1 & 0x40) == 0x40; dataIncluded[21] = (byte1 & 0x20) == 0x20; dataIncluded[20] = (byte1 & 0x10) == 0x10; dataIncluded[19] = (byte1 & 0x8) == 0x8; dataIncluded[18] = (byte1 & 0x4) == 0x4; dataIncluded[17] = (byte1 & 0x2) == 0x2; dataIncluded[16] = (byte1 & 0x1) == 0x1; } if (l >= 6) { byte1 = bk.getNextByte(); dataIncluded[15] = (byte1 & 0x80) == 0x80; dataIncluded[14] = (byte1 & 0x40) == 0x40; dataIncluded[13] = (byte1 & 0x20) == 0x20; dataIncluded[12] = (byte1 & 0x10) == 0x10; dataIncluded[11] = (byte1 & 0x8) == 0x8; dataIncluded[10] = (byte1 & 0x4) == 0x4; dataIncluded[9] = (byte1 & 0x2) == 0x2; dataIncluded[8] = (byte1 & 0x1) == 0x1; } if (l >= 7) { byte1 = bk.getNextByte(); dataIncluded[7] = (byte1 & 0x80) == 0x80; dataIncluded[6] = (byte1 & 0x40) == 0x40; dataIncluded[5] = (byte1 & 0x20) == 0x20; dataIncluded[4] = (byte1 & 0x10) == 0x10; dataIncluded[3] = (byte1 & 0x8) == 0x8; dataIncluded[2] = (byte1 & 0x4) == 0x4; dataIncluded[1] = (byte1 & 0x2) == 0x2; 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; } else { sendNegResponse(NR_REQUEST_ERROR,0x05,0x01,0x2B,"invalid SOH length"); return true; } }
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())); }
private boolean processSOH() throws Exception { int l = bk.getNextByte(); // length// System.out.println(" byte 0 " + l); if (l > 0 && l <= 7) { bk.getNextByte(); // flag byte 2 bk.getNextByte(); // reserved bk.getNextByte(); // resequence fields screen52.clearTable(); // well that is the first time I have seen this. This fixes a problem // with S/36 command line. Finally got it. if (l <=3) return false; screen52.setErrorLine(bk.getNextByte()); // error row int byte1 = 0; if (l >= 5) { byte1 = bk.getNextByte(); dataIncluded[23] = (byte1 & 0x80) == 0x80; dataIncluded[22] = (byte1 & 0x40) == 0x40; dataIncluded[21] = (byte1 & 0x20) == 0x20; dataIncluded[20] = (byte1 & 0x10) == 0x10; dataIncluded[19] = (byte1 & 0x8) == 0x8; dataIncluded[18] = (byte1 & 0x4) == 0x4; dataIncluded[17] = (byte1 & 0x2) == 0x2; dataIncluded[16] = (byte1 & 0x1) == 0x1; } if (l >= 6) { byte1 = bk.getNextByte(); dataIncluded[15] = (byte1 & 0x80) == 0x80; dataIncluded[14] = (byte1 & 0x40) == 0x40; dataIncluded[13] = (byte1 & 0x20) == 0x20; dataIncluded[12] = (byte1 & 0x10) == 0x10; dataIncluded[11] = (byte1 & 0x8) == 0x8; dataIncluded[10] = (byte1 & 0x4) == 0x4; dataIncluded[9] = (byte1 & 0x2) == 0x2; dataIncluded[8] = (byte1 & 0x1) == 0x1; } if (l >= 7) { byte1 = bk.getNextByte(); dataIncluded[7] = (byte1 & 0x80) == 0x80; dataIncluded[6] = (byte1 & 0x40) == 0x40; dataIncluded[5] = (byte1 & 0x20) == 0x20; dataIncluded[4] = (byte1 & 0x10) == 0x10; dataIncluded[3] = (byte1 & 0x8) == 0x8; dataIncluded[2] = (byte1 & 0x4) == 0x4; dataIncluded[1] = (byte1 & 0x2) == 0x2; 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; } else { sendNegResponse(NR_REQUEST_ERROR,0x05,0x01,0x2B,"invalid SOH length"); return true; } }
System.out.println(ioe.getMessage());
log.warn(ioe.getMessage());
private final void readImmediate(int readType) { if (screen52.isStatusErrorCode()) { screen52.restoreErrorLine(); screen52.setStatus(Screen5250.STATUS_ERROR_CODE, Screen5250.STATUS_VALUE_OFF,null); } if (!enhanced) { screen52.setCursorActive(false); } screen52.setStatus(Screen5250.STATUS_SYSTEM, Screen5250.STATUS_VALUE_ON,null); screen52.setKeyboardLocked(true); pendingUnlock = false; invited = false; screen52.getScreenFields().readFormatTable(baosp,readType,codePage); try { writeGDS(0, 3, baosp.toByteArray()); } catch (IOException ioe) { System.out.println(ioe.getMessage()); baosp.reset(); } baosp.reset(); }
log.debug("Restore ");
public final void restoreScreen() throws IOException { int which = 0; try {// System.out.println("Restore "); bk.getNextByte(); bk.getNextByte(); int rows = bk.getNextByte() & 0xff; int cols = bk.getNextByte() & 0xff; int pos = bk.getNextByte() << 8 & 0xff00; pos |= bk.getNextByte() & 0xff; int hPos = bk.getNextByte() << 8 & 0xff00; hPos |= bk.getNextByte() & 0xff; if (rows != screen52.getRows()) screen52.setRowsCols(rows,cols); screen52.clearAll(); // initialize what we currenty have int b = 32; int la = 32; int len = rows * cols; for (int y = 0;y < len; y++) { b = bk.getNextByte(); if (isAttribute(b)) { screen52.screen[y].setCharAndAttr( screen52.screen[y].getChar(), b, true); la = b; } else { //LDC - 12/02/2003 - Check to see if it is an displayable character. If not, // do not convert the character. // The characters on screen are in unicode char ch = (char) b; if (isDataEBCDIC(b)) ch = ebcdic2uni(b); screen52.screen[y].setCharAndAttr( //getASCIIChar(b), ch, la, false); } } int numFields = bk.getNextByte() << 8 & 0xff00; numFields |= bk.getNextByte() & 0xff;// System.out.println("number of fields " + numFields); if (numFields > 0) { int x = 0; int attr = 0; int fPos = 0; int fLen = 0; int ffw1 = 0; int ffw2 = 0; int fcw1 = 0; int fcw2 = 0; boolean mdt = false; ScreenField sf = null; while (x < numFields) { attr = bk.getNextByte(); fPos = bk.getNextByte() << 8 & 0xff00; fPos |= bk.getNextByte() & 0xff; if (bk.getNextByte() == 1) mdt = true; else mdt = false; fLen = bk.getNextByte() << 8 & 0xff00; fLen |= bk.getNextByte() & 0xff; ffw1 = bk.getNextByte(); ffw2 = bk.getNextByte(); fcw1 = bk.getNextByte(); fcw2 = bk.getNextByte(); sf = screen52.getScreenFields().setField(attr, screen52.getRow(fPos), screen52.getCol(fPos), fLen, ffw1, ffw2, fcw1, fcw2); if (mdt){ sf.setMDT(); screen52.getScreenFields().setMasterMDT(); }// System.out.println("/nRestored ");// System.out.println(sf.toString());// x++; } } screen52.restoreScreen(); // display the screen screen52.setPendingInsert(true,screen52.getRow(pos), screen52.getCol(pos)); screen52.goto_XY(pos); screen52.isInField(); if (screen52.isUsingGuiInterface()) screen52.drawFields(); } catch (Exception e) { System.out.println("error restoring screen " + which + " with " + e.getMessage()); } }
log.debug("number of fields " + numFields);
public final void restoreScreen() throws IOException { int which = 0; try {// System.out.println("Restore "); bk.getNextByte(); bk.getNextByte(); int rows = bk.getNextByte() & 0xff; int cols = bk.getNextByte() & 0xff; int pos = bk.getNextByte() << 8 & 0xff00; pos |= bk.getNextByte() & 0xff; int hPos = bk.getNextByte() << 8 & 0xff00; hPos |= bk.getNextByte() & 0xff; if (rows != screen52.getRows()) screen52.setRowsCols(rows,cols); screen52.clearAll(); // initialize what we currenty have int b = 32; int la = 32; int len = rows * cols; for (int y = 0;y < len; y++) { b = bk.getNextByte(); if (isAttribute(b)) { screen52.screen[y].setCharAndAttr( screen52.screen[y].getChar(), b, true); la = b; } else { //LDC - 12/02/2003 - Check to see if it is an displayable character. If not, // do not convert the character. // The characters on screen are in unicode char ch = (char) b; if (isDataEBCDIC(b)) ch = ebcdic2uni(b); screen52.screen[y].setCharAndAttr( //getASCIIChar(b), ch, la, false); } } int numFields = bk.getNextByte() << 8 & 0xff00; numFields |= bk.getNextByte() & 0xff;// System.out.println("number of fields " + numFields); if (numFields > 0) { int x = 0; int attr = 0; int fPos = 0; int fLen = 0; int ffw1 = 0; int ffw2 = 0; int fcw1 = 0; int fcw2 = 0; boolean mdt = false; ScreenField sf = null; while (x < numFields) { attr = bk.getNextByte(); fPos = bk.getNextByte() << 8 & 0xff00; fPos |= bk.getNextByte() & 0xff; if (bk.getNextByte() == 1) mdt = true; else mdt = false; fLen = bk.getNextByte() << 8 & 0xff00; fLen |= bk.getNextByte() & 0xff; ffw1 = bk.getNextByte(); ffw2 = bk.getNextByte(); fcw1 = bk.getNextByte(); fcw2 = bk.getNextByte(); sf = screen52.getScreenFields().setField(attr, screen52.getRow(fPos), screen52.getCol(fPos), fLen, ffw1, ffw2, fcw1, fcw2); if (mdt){ sf.setMDT(); screen52.getScreenFields().setMasterMDT(); }// System.out.println("/nRestored ");// System.out.println(sf.toString());// x++; } } screen52.restoreScreen(); // display the screen screen52.setPendingInsert(true,screen52.getRow(pos), screen52.getCol(pos)); screen52.goto_XY(pos); screen52.isInField(); if (screen52.isUsingGuiInterface()) screen52.drawFields(); } catch (Exception e) { System.out.println("error restoring screen " + which + " with " + e.getMessage()); } }
x++;
if(log.isDebugEnabled()) { log.debug("/nRestored "); log.debug(sf.toString()); } x++;
public final void restoreScreen() throws IOException { int which = 0; try {// System.out.println("Restore "); bk.getNextByte(); bk.getNextByte(); int rows = bk.getNextByte() & 0xff; int cols = bk.getNextByte() & 0xff; int pos = bk.getNextByte() << 8 & 0xff00; pos |= bk.getNextByte() & 0xff; int hPos = bk.getNextByte() << 8 & 0xff00; hPos |= bk.getNextByte() & 0xff; if (rows != screen52.getRows()) screen52.setRowsCols(rows,cols); screen52.clearAll(); // initialize what we currenty have int b = 32; int la = 32; int len = rows * cols; for (int y = 0;y < len; y++) { b = bk.getNextByte(); if (isAttribute(b)) { screen52.screen[y].setCharAndAttr( screen52.screen[y].getChar(), b, true); la = b; } else { //LDC - 12/02/2003 - Check to see if it is an displayable character. If not, // do not convert the character. // The characters on screen are in unicode char ch = (char) b; if (isDataEBCDIC(b)) ch = ebcdic2uni(b); screen52.screen[y].setCharAndAttr( //getASCIIChar(b), ch, la, false); } } int numFields = bk.getNextByte() << 8 & 0xff00; numFields |= bk.getNextByte() & 0xff;// System.out.println("number of fields " + numFields); if (numFields > 0) { int x = 0; int attr = 0; int fPos = 0; int fLen = 0; int ffw1 = 0; int ffw2 = 0; int fcw1 = 0; int fcw2 = 0; boolean mdt = false; ScreenField sf = null; while (x < numFields) { attr = bk.getNextByte(); fPos = bk.getNextByte() << 8 & 0xff00; fPos |= bk.getNextByte() & 0xff; if (bk.getNextByte() == 1) mdt = true; else mdt = false; fLen = bk.getNextByte() << 8 & 0xff00; fLen |= bk.getNextByte() & 0xff; ffw1 = bk.getNextByte(); ffw2 = bk.getNextByte(); fcw1 = bk.getNextByte(); fcw2 = bk.getNextByte(); sf = screen52.getScreenFields().setField(attr, screen52.getRow(fPos), screen52.getCol(fPos), fLen, ffw1, ffw2, fcw1, fcw2); if (mdt){ sf.setMDT(); screen52.getScreenFields().setMasterMDT(); }// System.out.println("/nRestored ");// System.out.println(sf.toString());// x++; } } screen52.restoreScreen(); // display the screen screen52.setPendingInsert(true,screen52.getRow(pos), screen52.getCol(pos)); screen52.goto_XY(pos); screen52.isInField(); if (screen52.isUsingGuiInterface()) screen52.drawFields(); } catch (Exception e) { System.out.println("error restoring screen " + which + " with " + e.getMessage()); } }
System.out.println("error restoring screen " + which + " with " + e.getMessage());
log.warn("error restoring screen " + which + " with " + e.getMessage());
public final void restoreScreen() throws IOException { int which = 0; try {// System.out.println("Restore "); bk.getNextByte(); bk.getNextByte(); int rows = bk.getNextByte() & 0xff; int cols = bk.getNextByte() & 0xff; int pos = bk.getNextByte() << 8 & 0xff00; pos |= bk.getNextByte() & 0xff; int hPos = bk.getNextByte() << 8 & 0xff00; hPos |= bk.getNextByte() & 0xff; if (rows != screen52.getRows()) screen52.setRowsCols(rows,cols); screen52.clearAll(); // initialize what we currenty have int b = 32; int la = 32; int len = rows * cols; for (int y = 0;y < len; y++) { b = bk.getNextByte(); if (isAttribute(b)) { screen52.screen[y].setCharAndAttr( screen52.screen[y].getChar(), b, true); la = b; } else { //LDC - 12/02/2003 - Check to see if it is an displayable character. If not, // do not convert the character. // The characters on screen are in unicode char ch = (char) b; if (isDataEBCDIC(b)) ch = ebcdic2uni(b); screen52.screen[y].setCharAndAttr( //getASCIIChar(b), ch, la, false); } } int numFields = bk.getNextByte() << 8 & 0xff00; numFields |= bk.getNextByte() & 0xff;// System.out.println("number of fields " + numFields); if (numFields > 0) { int x = 0; int attr = 0; int fPos = 0; int fLen = 0; int ffw1 = 0; int ffw2 = 0; int fcw1 = 0; int fcw2 = 0; boolean mdt = false; ScreenField sf = null; while (x < numFields) { attr = bk.getNextByte(); fPos = bk.getNextByte() << 8 & 0xff00; fPos |= bk.getNextByte() & 0xff; if (bk.getNextByte() == 1) mdt = true; else mdt = false; fLen = bk.getNextByte() << 8 & 0xff00; fLen |= bk.getNextByte() & 0xff; ffw1 = bk.getNextByte(); ffw2 = bk.getNextByte(); fcw1 = bk.getNextByte(); fcw2 = bk.getNextByte(); sf = screen52.getScreenFields().setField(attr, screen52.getRow(fPos), screen52.getCol(fPos), fLen, ffw1, ffw2, fcw1, fcw2); if (mdt){ sf.setMDT(); screen52.getScreenFields().setMasterMDT(); }// System.out.println("/nRestored ");// System.out.println(sf.toString());// x++; } } screen52.restoreScreen(); // display the screen screen52.setPendingInsert(true,screen52.getRow(pos), screen52.getCol(pos)); screen52.goto_XY(pos); screen52.isInField(); if (screen52.isUsingGuiInterface()) screen52.drawFields(); } catch (Exception e) { System.out.println("error restoring screen " + which + " with " + e.getMessage()); } }
System.out.println(" vt thread interrupted and stopping ");
log.warn(" vt thread interrupted and stopping ");
public void run () { if (enhanced) sfParser = new WTDSFParser(this); while (keepTrucking) { try { bk = (Stream5250)dsq.get(); } catch (InterruptedException ie) { System.out.println(" vt thread interrupted and stopping "); keepTrucking = false; continue; } // lets play nicely with the others on the playground// me.yield(); Thread.yield(); invited = false; screen52.setCursorActive(false);// System.out.println("operation code: " + bk.getOpCode()); if (bk == null) continue; switch (bk.getOpCode()) { case 00:// System.out.println("No operation"); break; case 1:// System.out.println("Invite Operation"); parseIncoming();// screen52.setKeyboardLocked(false); pendingUnlock = true; cursorOn = true; setInvited(); break; case 2:// System.out.println("Output Only"); parseIncoming();// System.out.println(screen52.dirty); screen52.updateDirty(); // invited = true; break; case 3:// System.out.println("Put/Get Operation"); parseIncoming();// inviteIt =true; setInvited(); if (!firstScreen) { firstScreen = true; controller.fireSessionChanged(TN5250jConstants.STATE_CONNECTED); } 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); break; case 12:// System.out.println("Turn off Message light"); screen52.setMessageLightOff(); screen52.setCursorActive(true); break; default: break; } if (screen52.isUsingGuiInterface()) screen52.drawFields();// if (screen52.screen[0][1].getChar() == '#' &&// screen52.screen[0][2].getChar() == '!')// execCmd();// else { if (screen52.isHotSpots()) { screen52.checkHotSpots(); } try {// SwingUtilities.invokeAndWait(// new Runnable () {// public void run() {// screen52.updateDirty();// }// }// ); screen52.updateDirty(); controller.validate();// System.out.println("update dirty"); } catch (Exception exd ) { System.out.println(" tnvt.run: " + exd.getMessage()); exd.printStackTrace(); } if (pendingUnlock && !screen52.isStatusErrorCode()) { screen52.setKeyboardLocked(false); pendingUnlock = false; } if (cursorOn && !screen52.isKeyboardLocked()) { screen52.setCursorActive(true); cursorOn = false; } // lets play nicely with the others on the playground //me.yield(); Thread.yield(); } }
log.debug("No operation");
public void run () { if (enhanced) sfParser = new WTDSFParser(this); while (keepTrucking) { try { bk = (Stream5250)dsq.get(); } catch (InterruptedException ie) { System.out.println(" vt thread interrupted and stopping "); keepTrucking = false; continue; } // lets play nicely with the others on the playground// me.yield(); Thread.yield(); invited = false; screen52.setCursorActive(false);// System.out.println("operation code: " + bk.getOpCode()); if (bk == null) continue; switch (bk.getOpCode()) { case 00:// System.out.println("No operation"); break; case 1:// System.out.println("Invite Operation"); parseIncoming();// screen52.setKeyboardLocked(false); pendingUnlock = true; cursorOn = true; setInvited(); break; case 2:// System.out.println("Output Only"); parseIncoming();// System.out.println(screen52.dirty); screen52.updateDirty(); // invited = true; break; case 3:// System.out.println("Put/Get Operation"); parseIncoming();// inviteIt =true; setInvited(); if (!firstScreen) { firstScreen = true; controller.fireSessionChanged(TN5250jConstants.STATE_CONNECTED); } 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); break; case 12:// System.out.println("Turn off Message light"); screen52.setMessageLightOff(); screen52.setCursorActive(true); break; default: break; } if (screen52.isUsingGuiInterface()) screen52.drawFields();// if (screen52.screen[0][1].getChar() == '#' &&// screen52.screen[0][2].getChar() == '!')// execCmd();// else { if (screen52.isHotSpots()) { screen52.checkHotSpots(); } try {// SwingUtilities.invokeAndWait(// new Runnable () {// public void run() {// screen52.updateDirty();// }// }// ); screen52.updateDirty(); controller.validate();// System.out.println("update dirty"); } catch (Exception exd ) { System.out.println(" tnvt.run: " + exd.getMessage()); exd.printStackTrace(); } if (pendingUnlock && !screen52.isStatusErrorCode()) { screen52.setKeyboardLocked(false); pendingUnlock = false; } if (cursorOn && !screen52.isKeyboardLocked()) { screen52.setCursorActive(true); cursorOn = false; } // lets play nicely with the others on the playground //me.yield(); Thread.yield(); } }
log.debug("Invite Operation");
public void run () { if (enhanced) sfParser = new WTDSFParser(this); while (keepTrucking) { try { bk = (Stream5250)dsq.get(); } catch (InterruptedException ie) { System.out.println(" vt thread interrupted and stopping "); keepTrucking = false; continue; } // lets play nicely with the others on the playground// me.yield(); Thread.yield(); invited = false; screen52.setCursorActive(false);// System.out.println("operation code: " + bk.getOpCode()); if (bk == null) continue; switch (bk.getOpCode()) { case 00:// System.out.println("No operation"); break; case 1:// System.out.println("Invite Operation"); parseIncoming();// screen52.setKeyboardLocked(false); pendingUnlock = true; cursorOn = true; setInvited(); break; case 2:// System.out.println("Output Only"); parseIncoming();// System.out.println(screen52.dirty); screen52.updateDirty(); // invited = true; break; case 3:// System.out.println("Put/Get Operation"); parseIncoming();// inviteIt =true; setInvited(); if (!firstScreen) { firstScreen = true; controller.fireSessionChanged(TN5250jConstants.STATE_CONNECTED); } 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); break; case 12:// System.out.println("Turn off Message light"); screen52.setMessageLightOff(); screen52.setCursorActive(true); break; default: break; } if (screen52.isUsingGuiInterface()) screen52.drawFields();// if (screen52.screen[0][1].getChar() == '#' &&// screen52.screen[0][2].getChar() == '!')// execCmd();// else { if (screen52.isHotSpots()) { screen52.checkHotSpots(); } try {// SwingUtilities.invokeAndWait(// new Runnable () {// public void run() {// screen52.updateDirty();// }// }// ); screen52.updateDirty(); controller.validate();// System.out.println("update dirty"); } catch (Exception exd ) { System.out.println(" tnvt.run: " + exd.getMessage()); exd.printStackTrace(); } if (pendingUnlock && !screen52.isStatusErrorCode()) { screen52.setKeyboardLocked(false); pendingUnlock = false; } if (cursorOn && !screen52.isKeyboardLocked()) { screen52.setCursorActive(true); cursorOn = false; } // lets play nicely with the others on the playground //me.yield(); Thread.yield(); } }
log.debug("Output Only");
public void run () { if (enhanced) sfParser = new WTDSFParser(this); while (keepTrucking) { try { bk = (Stream5250)dsq.get(); } catch (InterruptedException ie) { System.out.println(" vt thread interrupted and stopping "); keepTrucking = false; continue; } // lets play nicely with the others on the playground// me.yield(); Thread.yield(); invited = false; screen52.setCursorActive(false);// System.out.println("operation code: " + bk.getOpCode()); if (bk == null) continue; switch (bk.getOpCode()) { case 00:// System.out.println("No operation"); break; case 1:// System.out.println("Invite Operation"); parseIncoming();// screen52.setKeyboardLocked(false); pendingUnlock = true; cursorOn = true; setInvited(); break; case 2:// System.out.println("Output Only"); parseIncoming();// System.out.println(screen52.dirty); screen52.updateDirty(); // invited = true; break; case 3:// System.out.println("Put/Get Operation"); parseIncoming();// inviteIt =true; setInvited(); if (!firstScreen) { firstScreen = true; controller.fireSessionChanged(TN5250jConstants.STATE_CONNECTED); } 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); break; case 12:// System.out.println("Turn off Message light"); screen52.setMessageLightOff(); screen52.setCursorActive(true); break; default: break; } if (screen52.isUsingGuiInterface()) screen52.drawFields();// if (screen52.screen[0][1].getChar() == '#' &&// screen52.screen[0][2].getChar() == '!')// execCmd();// else { if (screen52.isHotSpots()) { screen52.checkHotSpots(); } try {// SwingUtilities.invokeAndWait(// new Runnable () {// public void run() {// screen52.updateDirty();// }// }// ); screen52.updateDirty(); controller.validate();// System.out.println("update dirty"); } catch (Exception exd ) { System.out.println(" tnvt.run: " + exd.getMessage()); exd.printStackTrace(); } if (pendingUnlock && !screen52.isStatusErrorCode()) { screen52.setKeyboardLocked(false); pendingUnlock = false; } if (cursorOn && !screen52.isKeyboardLocked()) { screen52.setCursorActive(true); cursorOn = false; } // lets play nicely with the others on the playground //me.yield(); Thread.yield(); } }
log.debug("Put/Get Operation");
public void run () { if (enhanced) sfParser = new WTDSFParser(this); while (keepTrucking) { try { bk = (Stream5250)dsq.get(); } catch (InterruptedException ie) { System.out.println(" vt thread interrupted and stopping "); keepTrucking = false; continue; } // lets play nicely with the others on the playground// me.yield(); Thread.yield(); invited = false; screen52.setCursorActive(false);// System.out.println("operation code: " + bk.getOpCode()); if (bk == null) continue; switch (bk.getOpCode()) { case 00:// System.out.println("No operation"); break; case 1:// System.out.println("Invite Operation"); parseIncoming();// screen52.setKeyboardLocked(false); pendingUnlock = true; cursorOn = true; setInvited(); break; case 2:// System.out.println("Output Only"); parseIncoming();// System.out.println(screen52.dirty); screen52.updateDirty(); // invited = true; break; case 3:// System.out.println("Put/Get Operation"); parseIncoming();// inviteIt =true; setInvited(); if (!firstScreen) { firstScreen = true; controller.fireSessionChanged(TN5250jConstants.STATE_CONNECTED); } 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); break; case 12:// System.out.println("Turn off Message light"); screen52.setMessageLightOff(); screen52.setCursorActive(true); break; default: break; } if (screen52.isUsingGuiInterface()) screen52.drawFields();// if (screen52.screen[0][1].getChar() == '#' &&// screen52.screen[0][2].getChar() == '!')// execCmd();// else { if (screen52.isHotSpots()) { screen52.checkHotSpots(); } try {// SwingUtilities.invokeAndWait(// new Runnable () {// public void run() {// screen52.updateDirty();// }// }// ); screen52.updateDirty(); controller.validate();// System.out.println("update dirty"); } catch (Exception exd ) { System.out.println(" tnvt.run: " + exd.getMessage()); exd.printStackTrace(); } if (pendingUnlock && !screen52.isStatusErrorCode()) { screen52.setKeyboardLocked(false); pendingUnlock = false; } if (cursorOn && !screen52.isKeyboardLocked()) { screen52.setCursorActive(true); cursorOn = false; } // lets play nicely with the others on the playground //me.yield(); Thread.yield(); } }
log.debug("Save Screen Operation");
public void run () { if (enhanced) sfParser = new WTDSFParser(this); while (keepTrucking) { try { bk = (Stream5250)dsq.get(); } catch (InterruptedException ie) { System.out.println(" vt thread interrupted and stopping "); keepTrucking = false; continue; } // lets play nicely with the others on the playground// me.yield(); Thread.yield(); invited = false; screen52.setCursorActive(false);// System.out.println("operation code: " + bk.getOpCode()); if (bk == null) continue; switch (bk.getOpCode()) { case 00:// System.out.println("No operation"); break; case 1:// System.out.println("Invite Operation"); parseIncoming();// screen52.setKeyboardLocked(false); pendingUnlock = true; cursorOn = true; setInvited(); break; case 2:// System.out.println("Output Only"); parseIncoming();// System.out.println(screen52.dirty); screen52.updateDirty(); // invited = true; break; case 3:// System.out.println("Put/Get Operation"); parseIncoming();// inviteIt =true; setInvited(); if (!firstScreen) { firstScreen = true; controller.fireSessionChanged(TN5250jConstants.STATE_CONNECTED); } 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); break; case 12:// System.out.println("Turn off Message light"); screen52.setMessageLightOff(); screen52.setCursorActive(true); break; default: break; } if (screen52.isUsingGuiInterface()) screen52.drawFields();// if (screen52.screen[0][1].getChar() == '#' &&// screen52.screen[0][2].getChar() == '!')// execCmd();// else { if (screen52.isHotSpots()) { screen52.checkHotSpots(); } try {// SwingUtilities.invokeAndWait(// new Runnable () {// public void run() {// screen52.updateDirty();// }// }// ); screen52.updateDirty(); controller.validate();// System.out.println("update dirty"); } catch (Exception exd ) { System.out.println(" tnvt.run: " + exd.getMessage()); exd.printStackTrace(); } if (pendingUnlock && !screen52.isStatusErrorCode()) { screen52.setKeyboardLocked(false); pendingUnlock = false; } if (cursorOn && !screen52.isKeyboardLocked()) { screen52.setCursorActive(true); cursorOn = false; } // lets play nicely with the others on the playground //me.yield(); Thread.yield(); } }
log.debug("Restore Screen Operation");
public void run () { if (enhanced) sfParser = new WTDSFParser(this); while (keepTrucking) { try { bk = (Stream5250)dsq.get(); } catch (InterruptedException ie) { System.out.println(" vt thread interrupted and stopping "); keepTrucking = false; continue; } // lets play nicely with the others on the playground// me.yield(); Thread.yield(); invited = false; screen52.setCursorActive(false);// System.out.println("operation code: " + bk.getOpCode()); if (bk == null) continue; switch (bk.getOpCode()) { case 00:// System.out.println("No operation"); break; case 1:// System.out.println("Invite Operation"); parseIncoming();// screen52.setKeyboardLocked(false); pendingUnlock = true; cursorOn = true; setInvited(); break; case 2:// System.out.println("Output Only"); parseIncoming();// System.out.println(screen52.dirty); screen52.updateDirty(); // invited = true; break; case 3:// System.out.println("Put/Get Operation"); parseIncoming();// inviteIt =true; setInvited(); if (!firstScreen) { firstScreen = true; controller.fireSessionChanged(TN5250jConstants.STATE_CONNECTED); } 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); break; case 12:// System.out.println("Turn off Message light"); screen52.setMessageLightOff(); screen52.setCursorActive(true); break; default: break; } if (screen52.isUsingGuiInterface()) screen52.drawFields();// if (screen52.screen[0][1].getChar() == '#' &&// screen52.screen[0][2].getChar() == '!')// execCmd();// else { if (screen52.isHotSpots()) { screen52.checkHotSpots(); } try {// SwingUtilities.invokeAndWait(// new Runnable () {// public void run() {// screen52.updateDirty();// }// }// ); screen52.updateDirty(); controller.validate();// System.out.println("update dirty"); } catch (Exception exd ) { System.out.println(" tnvt.run: " + exd.getMessage()); exd.printStackTrace(); } if (pendingUnlock && !screen52.isStatusErrorCode()) { screen52.setKeyboardLocked(false); pendingUnlock = false; } if (cursorOn && !screen52.isKeyboardLocked()) { screen52.setCursorActive(true); cursorOn = false; } // lets play nicely with the others on the playground //me.yield(); Thread.yield(); } }
log.debug("Read Immediate");
public void run () { if (enhanced) sfParser = new WTDSFParser(this); while (keepTrucking) { try { bk = (Stream5250)dsq.get(); } catch (InterruptedException ie) { System.out.println(" vt thread interrupted and stopping "); keepTrucking = false; continue; } // lets play nicely with the others on the playground// me.yield(); Thread.yield(); invited = false; screen52.setCursorActive(false);// System.out.println("operation code: " + bk.getOpCode()); if (bk == null) continue; switch (bk.getOpCode()) { case 00:// System.out.println("No operation"); break; case 1:// System.out.println("Invite Operation"); parseIncoming();// screen52.setKeyboardLocked(false); pendingUnlock = true; cursorOn = true; setInvited(); break; case 2:// System.out.println("Output Only"); parseIncoming();// System.out.println(screen52.dirty); screen52.updateDirty(); // invited = true; break; case 3:// System.out.println("Put/Get Operation"); parseIncoming();// inviteIt =true; setInvited(); if (!firstScreen) { firstScreen = true; controller.fireSessionChanged(TN5250jConstants.STATE_CONNECTED); } 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); break; case 12:// System.out.println("Turn off Message light"); screen52.setMessageLightOff(); screen52.setCursorActive(true); break; default: break; } if (screen52.isUsingGuiInterface()) screen52.drawFields();// if (screen52.screen[0][1].getChar() == '#' &&// screen52.screen[0][2].getChar() == '!')// execCmd();// else { if (screen52.isHotSpots()) { screen52.checkHotSpots(); } try {// SwingUtilities.invokeAndWait(// new Runnable () {// public void run() {// screen52.updateDirty();// }// }// ); screen52.updateDirty(); controller.validate();// System.out.println("update dirty"); } catch (Exception exd ) { System.out.println(" tnvt.run: " + exd.getMessage()); exd.printStackTrace(); } if (pendingUnlock && !screen52.isStatusErrorCode()) { screen52.setKeyboardLocked(false); pendingUnlock = false; } if (cursorOn && !screen52.isKeyboardLocked()) { screen52.setCursorActive(true); cursorOn = false; } // lets play nicely with the others on the playground //me.yield(); Thread.yield(); } }
log.debug("Reserved");
public void run () { if (enhanced) sfParser = new WTDSFParser(this); while (keepTrucking) { try { bk = (Stream5250)dsq.get(); } catch (InterruptedException ie) { System.out.println(" vt thread interrupted and stopping "); keepTrucking = false; continue; } // lets play nicely with the others on the playground// me.yield(); Thread.yield(); invited = false; screen52.setCursorActive(false);// System.out.println("operation code: " + bk.getOpCode()); if (bk == null) continue; switch (bk.getOpCode()) { case 00:// System.out.println("No operation"); break; case 1:// System.out.println("Invite Operation"); parseIncoming();// screen52.setKeyboardLocked(false); pendingUnlock = true; cursorOn = true; setInvited(); break; case 2:// System.out.println("Output Only"); parseIncoming();// System.out.println(screen52.dirty); screen52.updateDirty(); // invited = true; break; case 3:// System.out.println("Put/Get Operation"); parseIncoming();// inviteIt =true; setInvited(); if (!firstScreen) { firstScreen = true; controller.fireSessionChanged(TN5250jConstants.STATE_CONNECTED); } 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); break; case 12:// System.out.println("Turn off Message light"); screen52.setMessageLightOff(); screen52.setCursorActive(true); break; default: break; } if (screen52.isUsingGuiInterface()) screen52.drawFields();// if (screen52.screen[0][1].getChar() == '#' &&// screen52.screen[0][2].getChar() == '!')// execCmd();// else { if (screen52.isHotSpots()) { screen52.checkHotSpots(); } try {// SwingUtilities.invokeAndWait(// new Runnable () {// public void run() {// screen52.updateDirty();// }// }// ); screen52.updateDirty(); controller.validate();// System.out.println("update dirty"); } catch (Exception exd ) { System.out.println(" tnvt.run: " + exd.getMessage()); exd.printStackTrace(); } if (pendingUnlock && !screen52.isStatusErrorCode()) { screen52.setKeyboardLocked(false); pendingUnlock = false; } if (cursorOn && !screen52.isKeyboardLocked()) { screen52.setCursorActive(true); cursorOn = false; } // lets play nicely with the others on the playground //me.yield(); Thread.yield(); } }
log.debug("Read Screen Operation");
public void run () { if (enhanced) sfParser = new WTDSFParser(this); while (keepTrucking) { try { bk = (Stream5250)dsq.get(); } catch (InterruptedException ie) { System.out.println(" vt thread interrupted and stopping "); keepTrucking = false; continue; } // lets play nicely with the others on the playground// me.yield(); Thread.yield(); invited = false; screen52.setCursorActive(false);// System.out.println("operation code: " + bk.getOpCode()); if (bk == null) continue; switch (bk.getOpCode()) { case 00:// System.out.println("No operation"); break; case 1:// System.out.println("Invite Operation"); parseIncoming();// screen52.setKeyboardLocked(false); pendingUnlock = true; cursorOn = true; setInvited(); break; case 2:// System.out.println("Output Only"); parseIncoming();// System.out.println(screen52.dirty); screen52.updateDirty(); // invited = true; break; case 3:// System.out.println("Put/Get Operation"); parseIncoming();// inviteIt =true; setInvited(); if (!firstScreen) { firstScreen = true; controller.fireSessionChanged(TN5250jConstants.STATE_CONNECTED); } 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); break; case 12:// System.out.println("Turn off Message light"); screen52.setMessageLightOff(); screen52.setCursorActive(true); break; default: break; } if (screen52.isUsingGuiInterface()) screen52.drawFields();// if (screen52.screen[0][1].getChar() == '#' &&// screen52.screen[0][2].getChar() == '!')// execCmd();// else { if (screen52.isHotSpots()) { screen52.checkHotSpots(); } try {// SwingUtilities.invokeAndWait(// new Runnable () {// public void run() {// screen52.updateDirty();// }// }// ); screen52.updateDirty(); controller.validate();// System.out.println("update dirty"); } catch (Exception exd ) { System.out.println(" tnvt.run: " + exd.getMessage()); exd.printStackTrace(); } if (pendingUnlock && !screen52.isStatusErrorCode()) { screen52.setKeyboardLocked(false); pendingUnlock = false; } if (cursorOn && !screen52.isKeyboardLocked()) { screen52.setCursorActive(true); cursorOn = false; } // lets play nicely with the others on the playground //me.yield(); Thread.yield(); } }
log.warn(ex.getMessage());
public void run () { if (enhanced) sfParser = new WTDSFParser(this); while (keepTrucking) { try { bk = (Stream5250)dsq.get(); } catch (InterruptedException ie) { System.out.println(" vt thread interrupted and stopping "); keepTrucking = false; continue; } // lets play nicely with the others on the playground// me.yield(); Thread.yield(); invited = false; screen52.setCursorActive(false);// System.out.println("operation code: " + bk.getOpCode()); if (bk == null) continue; switch (bk.getOpCode()) { case 00:// System.out.println("No operation"); break; case 1:// System.out.println("Invite Operation"); parseIncoming();// screen52.setKeyboardLocked(false); pendingUnlock = true; cursorOn = true; setInvited(); break; case 2:// System.out.println("Output Only"); parseIncoming();// System.out.println(screen52.dirty); screen52.updateDirty(); // invited = true; break; case 3:// System.out.println("Put/Get Operation"); parseIncoming();// inviteIt =true; setInvited(); if (!firstScreen) { firstScreen = true; controller.fireSessionChanged(TN5250jConstants.STATE_CONNECTED); } 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); break; case 12:// System.out.println("Turn off Message light"); screen52.setMessageLightOff(); screen52.setCursorActive(true); break; default: break; } if (screen52.isUsingGuiInterface()) screen52.drawFields();// if (screen52.screen[0][1].getChar() == '#' &&// screen52.screen[0][2].getChar() == '!')// execCmd();// else { if (screen52.isHotSpots()) { screen52.checkHotSpots(); } try {// SwingUtilities.invokeAndWait(// new Runnable () {// public void run() {// screen52.updateDirty();// }// }// ); screen52.updateDirty(); controller.validate();// System.out.println("update dirty"); } catch (Exception exd ) { System.out.println(" tnvt.run: " + exd.getMessage()); exd.printStackTrace(); } if (pendingUnlock && !screen52.isStatusErrorCode()) { screen52.setKeyboardLocked(false); pendingUnlock = false; } if (cursorOn && !screen52.isKeyboardLocked()) { screen52.setCursorActive(true); cursorOn = false; } // lets play nicely with the others on the playground //me.yield(); Thread.yield(); } }
log.debug("Cancel Invite Operation");
public void run () { if (enhanced) sfParser = new WTDSFParser(this); while (keepTrucking) { try { bk = (Stream5250)dsq.get(); } catch (InterruptedException ie) { System.out.println(" vt thread interrupted and stopping "); keepTrucking = false; continue; } // lets play nicely with the others on the playground// me.yield(); Thread.yield(); invited = false; screen52.setCursorActive(false);// System.out.println("operation code: " + bk.getOpCode()); if (bk == null) continue; switch (bk.getOpCode()) { case 00:// System.out.println("No operation"); break; case 1:// System.out.println("Invite Operation"); parseIncoming();// screen52.setKeyboardLocked(false); pendingUnlock = true; cursorOn = true; setInvited(); break; case 2:// System.out.println("Output Only"); parseIncoming();// System.out.println(screen52.dirty); screen52.updateDirty(); // invited = true; break; case 3:// System.out.println("Put/Get Operation"); parseIncoming();// inviteIt =true; setInvited(); if (!firstScreen) { firstScreen = true; controller.fireSessionChanged(TN5250jConstants.STATE_CONNECTED); } 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); break; case 12:// System.out.println("Turn off Message light"); screen52.setMessageLightOff(); screen52.setCursorActive(true); break; default: break; } if (screen52.isUsingGuiInterface()) screen52.drawFields();// if (screen52.screen[0][1].getChar() == '#' &&// screen52.screen[0][2].getChar() == '!')// execCmd();// else { if (screen52.isHotSpots()) { screen52.checkHotSpots(); } try {// SwingUtilities.invokeAndWait(// new Runnable () {// public void run() {// screen52.updateDirty();// }// }// ); screen52.updateDirty(); controller.validate();// System.out.println("update dirty"); } catch (Exception exd ) { System.out.println(" tnvt.run: " + exd.getMessage()); exd.printStackTrace(); } if (pendingUnlock && !screen52.isStatusErrorCode()) { screen52.setKeyboardLocked(false); pendingUnlock = false; } if (cursorOn && !screen52.isKeyboardLocked()) { screen52.setCursorActive(true); cursorOn = false; } // lets play nicely with the others on the playground //me.yield(); Thread.yield(); } }
log.debug("Turn on message light");
public void run () { if (enhanced) sfParser = new WTDSFParser(this); while (keepTrucking) { try { bk = (Stream5250)dsq.get(); } catch (InterruptedException ie) { System.out.println(" vt thread interrupted and stopping "); keepTrucking = false; continue; } // lets play nicely with the others on the playground// me.yield(); Thread.yield(); invited = false; screen52.setCursorActive(false);// System.out.println("operation code: " + bk.getOpCode()); if (bk == null) continue; switch (bk.getOpCode()) { case 00:// System.out.println("No operation"); break; case 1:// System.out.println("Invite Operation"); parseIncoming();// screen52.setKeyboardLocked(false); pendingUnlock = true; cursorOn = true; setInvited(); break; case 2:// System.out.println("Output Only"); parseIncoming();// System.out.println(screen52.dirty); screen52.updateDirty(); // invited = true; break; case 3:// System.out.println("Put/Get Operation"); parseIncoming();// inviteIt =true; setInvited(); if (!firstScreen) { firstScreen = true; controller.fireSessionChanged(TN5250jConstants.STATE_CONNECTED); } 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); break; case 12:// System.out.println("Turn off Message light"); screen52.setMessageLightOff(); screen52.setCursorActive(true); break; default: break; } if (screen52.isUsingGuiInterface()) screen52.drawFields();// if (screen52.screen[0][1].getChar() == '#' &&// screen52.screen[0][2].getChar() == '!')// execCmd();// else { if (screen52.isHotSpots()) { screen52.checkHotSpots(); } try {// SwingUtilities.invokeAndWait(// new Runnable () {// public void run() {// screen52.updateDirty();// }// }// ); screen52.updateDirty(); controller.validate();// System.out.println("update dirty"); } catch (Exception exd ) { System.out.println(" tnvt.run: " + exd.getMessage()); exd.printStackTrace(); } if (pendingUnlock && !screen52.isStatusErrorCode()) { screen52.setKeyboardLocked(false); pendingUnlock = false; } if (cursorOn && !screen52.isKeyboardLocked()) { screen52.setCursorActive(true); cursorOn = false; } // lets play nicely with the others on the playground //me.yield(); Thread.yield(); } }
log.debug("Turn off Message light");
public void run () { if (enhanced) sfParser = new WTDSFParser(this); while (keepTrucking) { try { bk = (Stream5250)dsq.get(); } catch (InterruptedException ie) { System.out.println(" vt thread interrupted and stopping "); keepTrucking = false; continue; } // lets play nicely with the others on the playground// me.yield(); Thread.yield(); invited = false; screen52.setCursorActive(false);// System.out.println("operation code: " + bk.getOpCode()); if (bk == null) continue; switch (bk.getOpCode()) { case 00:// System.out.println("No operation"); break; case 1:// System.out.println("Invite Operation"); parseIncoming();// screen52.setKeyboardLocked(false); pendingUnlock = true; cursorOn = true; setInvited(); break; case 2:// System.out.println("Output Only"); parseIncoming();// System.out.println(screen52.dirty); screen52.updateDirty(); // invited = true; break; case 3:// System.out.println("Put/Get Operation"); parseIncoming();// inviteIt =true; setInvited(); if (!firstScreen) { firstScreen = true; controller.fireSessionChanged(TN5250jConstants.STATE_CONNECTED); } 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); break; case 12:// System.out.println("Turn off Message light"); screen52.setMessageLightOff(); screen52.setCursorActive(true); break; default: break; } if (screen52.isUsingGuiInterface()) screen52.drawFields();// if (screen52.screen[0][1].getChar() == '#' &&// screen52.screen[0][2].getChar() == '!')// execCmd();// else { if (screen52.isHotSpots()) { screen52.checkHotSpots(); } try {// SwingUtilities.invokeAndWait(// new Runnable () {// public void run() {// screen52.updateDirty();// }// }// ); screen52.updateDirty(); controller.validate();// System.out.println("update dirty"); } catch (Exception exd ) { System.out.println(" tnvt.run: " + exd.getMessage()); exd.printStackTrace(); } if (pendingUnlock && !screen52.isStatusErrorCode()) { screen52.setKeyboardLocked(false); pendingUnlock = false; } if (cursorOn && !screen52.isKeyboardLocked()) { screen52.setCursorActive(true); cursorOn = false; } // lets play nicely with the others on the playground //me.yield(); Thread.yield(); } }
log.debug("update dirty");
public void run () { if (enhanced) sfParser = new WTDSFParser(this); while (keepTrucking) { try { bk = (Stream5250)dsq.get(); } catch (InterruptedException ie) { System.out.println(" vt thread interrupted and stopping "); keepTrucking = false; continue; } // lets play nicely with the others on the playground// me.yield(); Thread.yield(); invited = false; screen52.setCursorActive(false);// System.out.println("operation code: " + bk.getOpCode()); if (bk == null) continue; switch (bk.getOpCode()) { case 00:// System.out.println("No operation"); break; case 1:// System.out.println("Invite Operation"); parseIncoming();// screen52.setKeyboardLocked(false); pendingUnlock = true; cursorOn = true; setInvited(); break; case 2:// System.out.println("Output Only"); parseIncoming();// System.out.println(screen52.dirty); screen52.updateDirty(); // invited = true; break; case 3:// System.out.println("Put/Get Operation"); parseIncoming();// inviteIt =true; setInvited(); if (!firstScreen) { firstScreen = true; controller.fireSessionChanged(TN5250jConstants.STATE_CONNECTED); } 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); break; case 12:// System.out.println("Turn off Message light"); screen52.setMessageLightOff(); screen52.setCursorActive(true); break; default: break; } if (screen52.isUsingGuiInterface()) screen52.drawFields();// if (screen52.screen[0][1].getChar() == '#' &&// screen52.screen[0][2].getChar() == '!')// execCmd();// else { if (screen52.isHotSpots()) { screen52.checkHotSpots(); } try {// SwingUtilities.invokeAndWait(// new Runnable () {// public void run() {// screen52.updateDirty();// }// }// ); screen52.updateDirty(); controller.validate();// System.out.println("update dirty"); } catch (Exception exd ) { System.out.println(" tnvt.run: " + exd.getMessage()); exd.printStackTrace(); } if (pendingUnlock && !screen52.isStatusErrorCode()) { screen52.setKeyboardLocked(false); pendingUnlock = false; } if (cursorOn && !screen52.isKeyboardLocked()) { screen52.setCursorActive(true); cursorOn = false; } // lets play nicely with the others on the playground //me.yield(); Thread.yield(); } }
System.out.println(" tnvt.run: " + exd.getMessage());
log.warn(" tnvt.run: " + exd.getMessage());
public void run () { if (enhanced) sfParser = new WTDSFParser(this); while (keepTrucking) { try { bk = (Stream5250)dsq.get(); } catch (InterruptedException ie) { System.out.println(" vt thread interrupted and stopping "); keepTrucking = false; continue; } // lets play nicely with the others on the playground// me.yield(); Thread.yield(); invited = false; screen52.setCursorActive(false);// System.out.println("operation code: " + bk.getOpCode()); if (bk == null) continue; switch (bk.getOpCode()) { case 00:// System.out.println("No operation"); break; case 1:// System.out.println("Invite Operation"); parseIncoming();// screen52.setKeyboardLocked(false); pendingUnlock = true; cursorOn = true; setInvited(); break; case 2:// System.out.println("Output Only"); parseIncoming();// System.out.println(screen52.dirty); screen52.updateDirty(); // invited = true; break; case 3:// System.out.println("Put/Get Operation"); parseIncoming();// inviteIt =true; setInvited(); if (!firstScreen) { firstScreen = true; controller.fireSessionChanged(TN5250jConstants.STATE_CONNECTED); } 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); break; case 12:// System.out.println("Turn off Message light"); screen52.setMessageLightOff(); screen52.setCursorActive(true); break; default: break; } if (screen52.isUsingGuiInterface()) screen52.drawFields();// if (screen52.screen[0][1].getChar() == '#' &&// screen52.screen[0][2].getChar() == '!')// execCmd();// else { if (screen52.isHotSpots()) { screen52.checkHotSpots(); } try {// SwingUtilities.invokeAndWait(// new Runnable () {// public void run() {// screen52.updateDirty();// }// }// ); screen52.updateDirty(); controller.validate();// System.out.println("update dirty"); } catch (Exception exd ) { System.out.println(" tnvt.run: " + exd.getMessage()); exd.printStackTrace(); } if (pendingUnlock && !screen52.isStatusErrorCode()) { screen52.setKeyboardLocked(false); pendingUnlock = false; } if (cursorOn && !screen52.isKeyboardLocked()) { screen52.setCursorActive(true); cursorOn = false; } // lets play nicely with the others on the playground //me.yield(); Thread.yield(); } }
log.debug("Saved "); log.debug(sf.toString());
public final void saveScreen() throws IOException { ByteArrayOutputStream sc = new ByteArrayOutputStream(); sc.write(4); sc.write(0x12); // 18 sc.write(0); // 18 sc.write(0); // 18 sc.write((byte)screen52.getRows()); // store the current size sc.write((byte)screen52.getCols()); // "" int cp = screen52.getCurrentPos(); // save off current position sc.write((byte)(cp >> 8 & 0xff)); // "" sc.write((byte)(cp & 0xff)); // "" sc.write((byte)(screen52.homePos >> 8 & 0xff)); // save home pos sc.write((byte)(screen52.homePos & 0xff)); // "" int rows = screen52.getRows(); // store the current size int cols = screen52.getCols(); // "" byte[] sa = new byte[rows * cols]; fillScreenArray(sa, rows, cols); sc.write(sa); sa = null; int sizeFields = screen52.getScreenFields().getSize(); sc.write((byte)(sizeFields >> 8 & 0xff)); // "" sc.write((byte)(sizeFields & 0xff)); // "" if (sizeFields > 0) { int x = 0; int s = screen52.getScreenFields().getSize(); ScreenField sf = null; while (x < s) { sf = screen52.getScreenFields().getField(x); sc.write((byte)sf.getAttr()); // attribute int sp = sf.startPos(); sc.write((byte)(sp >> 8 & 0xff)); // "" sc.write((byte)(sp & 0xff)); // "" if (sf.mdt) sc.write((byte)1); else sc.write((byte)0); sc.write((byte)(sf.getLength() >> 8 & 0xff)); // "" sc.write((byte)(sf.getLength() & 0xff)); // "" sc.write((byte)sf.getFFW1() & 0xff); sc.write((byte)sf.getFFW2() & 0xff); sc.write((byte)sf.getFCW1() & 0xff); sc.write((byte)sf.getFCW2() & 0xff);// System.out.println("Saved ");// System.out.println(sf.toString()); x++; } sf = null; } // The following two lines of code looks to have caused all sorts of // problems so for now we have commented them out.// screen52.getScreenFields().setCurrentField(null); // set it to null for GC ?// screen52.clearTable(); try { writeGDS(0, 3, sc.toByteArray()); } catch (IOException ioe) { System.out.println(ioe.getMessage()); } sc = null;// System.out.println("Save Screen end "); }
System.out.println(ioe.getMessage());
log.warn(ioe.getMessage());
public final void saveScreen() throws IOException { ByteArrayOutputStream sc = new ByteArrayOutputStream(); sc.write(4); sc.write(0x12); // 18 sc.write(0); // 18 sc.write(0); // 18 sc.write((byte)screen52.getRows()); // store the current size sc.write((byte)screen52.getCols()); // "" int cp = screen52.getCurrentPos(); // save off current position sc.write((byte)(cp >> 8 & 0xff)); // "" sc.write((byte)(cp & 0xff)); // "" sc.write((byte)(screen52.homePos >> 8 & 0xff)); // save home pos sc.write((byte)(screen52.homePos & 0xff)); // "" int rows = screen52.getRows(); // store the current size int cols = screen52.getCols(); // "" byte[] sa = new byte[rows * cols]; fillScreenArray(sa, rows, cols); sc.write(sa); sa = null; int sizeFields = screen52.getScreenFields().getSize(); sc.write((byte)(sizeFields >> 8 & 0xff)); // "" sc.write((byte)(sizeFields & 0xff)); // "" if (sizeFields > 0) { int x = 0; int s = screen52.getScreenFields().getSize(); ScreenField sf = null; while (x < s) { sf = screen52.getScreenFields().getField(x); sc.write((byte)sf.getAttr()); // attribute int sp = sf.startPos(); sc.write((byte)(sp >> 8 & 0xff)); // "" sc.write((byte)(sp & 0xff)); // "" if (sf.mdt) sc.write((byte)1); else sc.write((byte)0); sc.write((byte)(sf.getLength() >> 8 & 0xff)); // "" sc.write((byte)(sf.getLength() & 0xff)); // "" sc.write((byte)sf.getFFW1() & 0xff); sc.write((byte)sf.getFFW2() & 0xff); sc.write((byte)sf.getFCW1() & 0xff); sc.write((byte)sf.getFCW2() & 0xff);// System.out.println("Saved ");// System.out.println(sf.toString()); x++; } sf = null; } // The following two lines of code looks to have caused all sorts of // problems so for now we have commented them out.// screen52.getScreenFields().setCurrentField(null); // set it to null for GC ?// screen52.clearTable(); try { writeGDS(0, 3, sc.toByteArray()); } catch (IOException ioe) { System.out.println(ioe.getMessage()); } sc = null;// System.out.println("Save Screen end "); }
log.debug("Save Screen end ");
public final void saveScreen() throws IOException { ByteArrayOutputStream sc = new ByteArrayOutputStream(); sc.write(4); sc.write(0x12); // 18 sc.write(0); // 18 sc.write(0); // 18 sc.write((byte)screen52.getRows()); // store the current size sc.write((byte)screen52.getCols()); // "" int cp = screen52.getCurrentPos(); // save off current position sc.write((byte)(cp >> 8 & 0xff)); // "" sc.write((byte)(cp & 0xff)); // "" sc.write((byte)(screen52.homePos >> 8 & 0xff)); // save home pos sc.write((byte)(screen52.homePos & 0xff)); // "" int rows = screen52.getRows(); // store the current size int cols = screen52.getCols(); // "" byte[] sa = new byte[rows * cols]; fillScreenArray(sa, rows, cols); sc.write(sa); sa = null; int sizeFields = screen52.getScreenFields().getSize(); sc.write((byte)(sizeFields >> 8 & 0xff)); // "" sc.write((byte)(sizeFields & 0xff)); // "" if (sizeFields > 0) { int x = 0; int s = screen52.getScreenFields().getSize(); ScreenField sf = null; while (x < s) { sf = screen52.getScreenFields().getField(x); sc.write((byte)sf.getAttr()); // attribute int sp = sf.startPos(); sc.write((byte)(sp >> 8 & 0xff)); // "" sc.write((byte)(sp & 0xff)); // "" if (sf.mdt) sc.write((byte)1); else sc.write((byte)0); sc.write((byte)(sf.getLength() >> 8 & 0xff)); // "" sc.write((byte)(sf.getLength() & 0xff)); // "" sc.write((byte)sf.getFFW1() & 0xff); sc.write((byte)sf.getFFW2() & 0xff); sc.write((byte)sf.getFCW1() & 0xff); sc.write((byte)sf.getFCW2() & 0xff);// System.out.println("Saved ");// System.out.println(sf.toString()); x++; } sf = null; } // The following two lines of code looks to have caused all sorts of // problems so for now we have commented them out.// screen52.getScreenFields().setCurrentField(null); // set it to null for GC ?// screen52.clearTable(); try { writeGDS(0, 3, sc.toByteArray()); } catch (IOException ioe) { System.out.println(ioe.getMessage()); } sc = null;// System.out.println("Save Screen end "); }
System.out.println(ioe.getMessage());
log.warn(ioe.getMessage());
public final boolean sendAidKey(int aid) { if (screen52.isStatusErrorCode()) { screen52.restoreErrorLine(); screen52.setStatus(Screen5250.STATUS_ERROR_CODE, Screen5250.STATUS_VALUE_OFF,null); } if (!enhanced) { screen52.setCursorActive(false); } screen52.setStatus(Screen5250.STATUS_SYSTEM, Screen5250.STATUS_VALUE_ON,null); screen52.setKeyboardLocked(true); pendingUnlock = false; invited = false; baosp.write(screen52.getCurrentRow()); baosp.write(screen52.getCurrentCol()); baosp.write(aid); if (dataIncluded(aid)) screen52.getScreenFields().readFormatTable(baosp,readType,codePage); try { writeGDS(0, 3, baosp.toByteArray()); } catch (IOException ioe) { System.out.println(ioe.getMessage()); baosp.reset(); return false; } baosp.reset(); return true; }
System.out.println(ioe.getMessage());
log.warn(ioe.getMessage());
public final void sendAttentionKey() { // Client sends header 000A12A000004400000FFEF // 0x40 -> 01000000 // // flags // bit 0 - ERR // bit 1 - ATN Attention // bits 2-4 - reserved // bit 5 - SRQ system request // bit 6 - TRQ Test request key // bit 7 - HLP// System.out.println("Attention key sent"); try { writeGDS(0x40, 0, null); } catch (IOException ioe) { System.out.println(ioe.getMessage()); } }
System.out.println(ioe.getMessage());
log.warn(ioe.getMessage());
public final void sendHelpRequest() { // Client sends header 000D12A0000004000003####F3FFEF // operation code 3 // row - first ## // column - second ## // F3 - Help Aid Key// System.out.println("Help request sent"); baosp.write(screen52.getCurrentRow()); baosp.write(screen52.getCurrentCol()); baosp.write(AID_HELP); try { writeGDS(0, 3, baosp.toByteArray()); } catch (IOException ioe) { System.out.println(ioe.getMessage()); } baosp.reset(); }
System.out.println("Send Negative Response error " + e.getMessage());
log.warn("Send Negative Response error " + e.getMessage());
protected void sendNegResponse(int cat, int modifier , int uByte1, int uByte2, String from) { try { int os = bk.getByteOffset(-1) & 0xf0; int cp = (bk.getCurrentPos()-1); System.out.println("invalid " + from + " command " + os + " at pos " + cp); } catch (Exception e) { System.out.println("Send Negative Response error " + e.getMessage()); } baosp.write(cat); baosp.write(modifier); baosp.write(uByte1); baosp.write(uByte2); try { writeGDS(128, 0, baosp.toByteArray()); } catch (IOException ioe) { System.out.println(ioe.getMessage()); } baosp.reset(); }
System.out.println(ioe.getMessage());
log.warn(ioe.getMessage());
protected void sendNegResponse(int cat, int modifier , int uByte1, int uByte2, String from) { try { int os = bk.getByteOffset(-1) & 0xf0; int cp = (bk.getCurrentPos()-1); System.out.println("invalid " + from + " command " + os + " at pos " + cp); } catch (Exception e) { System.out.println("Send Negative Response error " + e.getMessage()); } baosp.write(cat); baosp.write(modifier); baosp.write(uByte1); baosp.write(uByte2); try { writeGDS(128, 0, baosp.toByteArray()); } catch (IOException ioe) { System.out.println(ioe.getMessage()); } baosp.reset(); }
System.out.println(ioe.getMessage());
log.warn(ioe.getMessage());
public void sendNegResponse2(int ec) { screen52.setPrehelpState(true,true,false); baosp.write(0x00); baosp.write(ec); try { writeGDS(1, 0, baosp.toByteArray()); } catch (IOException ioe) { System.out.println(ioe.getMessage()); } baosp.reset(); }
System.out.println("sending query response");
log.info("sending query response");
public final void sendQueryResponse() throws IOException { System.out.println("sending query response"); byte abyte0[] = new byte[64]; abyte0[0] = 0; // Cursor Row/column (set to zero) abyte0[1] = 0; // "" abyte0[2] = -120; // X'88' inbound write structure Field aid if (enhanced == true) { abyte0[3] = 0; // 0x003D (61) length of query response abyte0[4] = 64; // "" see note below ????????? } else { abyte0[3] = 0; // 0x003A (58) length of query response abyte0[4] = 58; // "" // the length between 58 and 64 seems to cause // different formatting codes to be sent from // the host ???????????????? why ??????? // Well the why can be found in the manual if // read a little more ;-) } abyte0[5] = -39; // command class 0xD9 abyte0[6] = 112; // Command type query 0x70 abyte0[7] = -128; // 0x80 Flag byte abyte0[8] = 6; // Controller Hardware Class abyte0[9] = 0; // 0x0600 - Other WSF or another 5250 Emulator abyte0[10] = 1; // Controller Code Level abyte0[11] = 1; // Version 1 Rel 1.0 abyte0[12] = 0; // "" abyte0[13] = 0; // 13 - 28 are reserved so set to 0x00 abyte0[14] = 0; // "" abyte0[15] = 0; // "" abyte0[16] = 0; // "" abyte0[17] = 0; // "" abyte0[18] = 0; // "" abyte0[19] = 0; // "" abyte0[20] = 0; // "" abyte0[21] = 0; // "" abyte0[22] = 0; // "" abyte0[23] = 0; // "" abyte0[24] = 0; // "" abyte0[25] = 0; // "" abyte0[26] = 0; // "" abyte0[27] = 0; // "" abyte0[28] = 0; // "" abyte0[29] = 1; // Device type - 0x01 5250 Emulator abyte0[30] = codePage.uni2ebcdic('5'); // Device type character abyte0[31] = codePage.uni2ebcdic('2'); // "" abyte0[32] = codePage.uni2ebcdic('5'); // "" abyte0[33] = codePage.uni2ebcdic('1'); // "" abyte0[34] = codePage.uni2ebcdic('0'); // "" abyte0[35] = codePage.uni2ebcdic('1'); // "" abyte0[36] = codePage.uni2ebcdic('1'); // "" abyte0[37] = 2; // Keyboard Id - 0x02 Standard Keyboard abyte0[38] = 0; // extended keyboard id abyte0[39] = 0; // reserved abyte0[40] = 0; // 40 - 43 Display Serial Number abyte0[41] = 36; // abyte0[42] = 36; // abyte0[43] = 0; // abyte0[44] = 1; // Maximum number of display fields - 256 abyte0[45] = 0; // 0x0100 abyte0[46] = 0; // 46 -48 Reserved set to 0x00 abyte0[47] = 0; abyte0[48] = 0; abyte0[49] = 1; // 49 - 53 Controller Display Capability abyte0[50] = 16; // see rfc - tired of typing :-) abyte0[51] = 0; // "" abyte0[52] = 0; // "" // 53 // Bit 0-2: B'000' - no graphics capability // B'001' - 5292-2 style graphics // Bit 3-7: B '00000' = reserved (it seems for Client access) if (enhanced == true) {// abyte0[53] = 0x5E; // 0x5E turns on ehnhanced mode// abyte0[53] = 0x27; // 0x5E turns on ehnhanced mode abyte0[53] = 0x7; // 0x5E turns on ehnhanced mode System.out.println("enhanced options"); } else abyte0[53] = 0x0; // 0x0 is normal emulation abyte0[54] = 24; // 54 - 60 Reserved set to 0x00 // 54 - I found out is used for enhanced user // interface level 3. Bit 4 allows headers // and footers for windows abyte0[54] = 8; // 54 - 60 Reserved set to 0x00 // 54 - I found out is used for enhanced user // interface level 3. Bit 4 allows headers // and footers for windows abyte0[55] = 0; abyte0[56] = 0; abyte0[57] = 0; abyte0[58] = 0; abyte0[59] = 0; abyte0[60] = 0; abyte0[61] = 0; // gridlines are not supported abyte0[62] = 0; // gridlines are not supported abyte0[63] = 0; writeGDS(0, 0, abyte0); // now tell them about us abyte0 = null; }
System.out.println("enhanced options");
log.info("enhanced options");
public final void sendQueryResponse() throws IOException { System.out.println("sending query response"); byte abyte0[] = new byte[64]; abyte0[0] = 0; // Cursor Row/column (set to zero) abyte0[1] = 0; // "" abyte0[2] = -120; // X'88' inbound write structure Field aid if (enhanced == true) { abyte0[3] = 0; // 0x003D (61) length of query response abyte0[4] = 64; // "" see note below ????????? } else { abyte0[3] = 0; // 0x003A (58) length of query response abyte0[4] = 58; // "" // the length between 58 and 64 seems to cause // different formatting codes to be sent from // the host ???????????????? why ??????? // Well the why can be found in the manual if // read a little more ;-) } abyte0[5] = -39; // command class 0xD9 abyte0[6] = 112; // Command type query 0x70 abyte0[7] = -128; // 0x80 Flag byte abyte0[8] = 6; // Controller Hardware Class abyte0[9] = 0; // 0x0600 - Other WSF or another 5250 Emulator abyte0[10] = 1; // Controller Code Level abyte0[11] = 1; // Version 1 Rel 1.0 abyte0[12] = 0; // "" abyte0[13] = 0; // 13 - 28 are reserved so set to 0x00 abyte0[14] = 0; // "" abyte0[15] = 0; // "" abyte0[16] = 0; // "" abyte0[17] = 0; // "" abyte0[18] = 0; // "" abyte0[19] = 0; // "" abyte0[20] = 0; // "" abyte0[21] = 0; // "" abyte0[22] = 0; // "" abyte0[23] = 0; // "" abyte0[24] = 0; // "" abyte0[25] = 0; // "" abyte0[26] = 0; // "" abyte0[27] = 0; // "" abyte0[28] = 0; // "" abyte0[29] = 1; // Device type - 0x01 5250 Emulator abyte0[30] = codePage.uni2ebcdic('5'); // Device type character abyte0[31] = codePage.uni2ebcdic('2'); // "" abyte0[32] = codePage.uni2ebcdic('5'); // "" abyte0[33] = codePage.uni2ebcdic('1'); // "" abyte0[34] = codePage.uni2ebcdic('0'); // "" abyte0[35] = codePage.uni2ebcdic('1'); // "" abyte0[36] = codePage.uni2ebcdic('1'); // "" abyte0[37] = 2; // Keyboard Id - 0x02 Standard Keyboard abyte0[38] = 0; // extended keyboard id abyte0[39] = 0; // reserved abyte0[40] = 0; // 40 - 43 Display Serial Number abyte0[41] = 36; // abyte0[42] = 36; // abyte0[43] = 0; // abyte0[44] = 1; // Maximum number of display fields - 256 abyte0[45] = 0; // 0x0100 abyte0[46] = 0; // 46 -48 Reserved set to 0x00 abyte0[47] = 0; abyte0[48] = 0; abyte0[49] = 1; // 49 - 53 Controller Display Capability abyte0[50] = 16; // see rfc - tired of typing :-) abyte0[51] = 0; // "" abyte0[52] = 0; // "" // 53 // Bit 0-2: B'000' - no graphics capability // B'001' - 5292-2 style graphics // Bit 3-7: B '00000' = reserved (it seems for Client access) if (enhanced == true) {// abyte0[53] = 0x5E; // 0x5E turns on ehnhanced mode// abyte0[53] = 0x27; // 0x5E turns on ehnhanced mode abyte0[53] = 0x7; // 0x5E turns on ehnhanced mode System.out.println("enhanced options"); } else abyte0[53] = 0x0; // 0x0 is normal emulation abyte0[54] = 24; // 54 - 60 Reserved set to 0x00 // 54 - I found out is used for enhanced user // interface level 3. Bit 4 allows headers // and footers for windows abyte0[54] = 8; // 54 - 60 Reserved set to 0x00 // 54 - I found out is used for enhanced user // interface level 3. Bit 4 allows headers // and footers for windows abyte0[55] = 0; abyte0[56] = 0; abyte0[57] = 0; abyte0[58] = 0; abyte0[59] = 0; abyte0[60] = 0; abyte0[61] = 0; // gridlines are not supported abyte0[62] = 0; // gridlines are not supported abyte0[63] = 0; writeGDS(0, 0, abyte0); // now tell them about us abyte0 = null; }
log.debug("invited");
private final void setInvited() {// System.out.println("invited"); if (!screen52.isStatusErrorCode()) screen52.setStatus(Screen5250.STATUS_SYSTEM, Screen5250.STATUS_VALUE_OFF,null); invited = true; }
System.out.println(" socks set ");
log.info(" socks set ");
public final void setProxy(String proxyHost, String proxyPort) { this.proxyHost=proxyHost; this.proxyPort = proxyPort; proxySet = true; Properties systemProperties = System.getProperties(); systemProperties.put("socksProxySet","true"); systemProperties.put("socksProxyHost",proxyHost); systemProperties.put("socksProxyPort",proxyPort); System.setProperties(systemProperties); System.out.println(" socks set "); }
System.out.println("invalid structured field sub command " + bk.getByteOffset(-1));
log.debug("invalid structured field sub command " + bk.getByteOffset(-1));
private void writeStructuredField() { boolean done = false; int nextone; try { int length = (( bk.getNextByte() & 0xff )<< 8 | (bk.getNextByte() & 0xff)); while (bk.hasNext() && !done) { switch (bk.getNextByte()) { case -39: // SOH - Start of Header Order switch (bk.getNextByte()) { case 112: // 5250 Query bk.getNextByte(); // get null required field sendQueryResponse(); 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; } } } catch (Exception e) {}; }
System.out.println("invalid structured field command " + bk.getByteOffset(-1));
log.debug("invalid structured field command " + bk.getByteOffset(-1));
private void writeStructuredField() { boolean done = false; int nextone; try { int length = (( bk.getNextByte() & 0xff )<< 8 | (bk.getNextByte() & 0xff)); while (bk.hasNext() && !done) { switch (bk.getNextByte()) { case -39: // SOH - Start of Header Order switch (bk.getNextByte()) { case 112: // 5250 Query bk.getNextByte(); // get null required field sendQueryResponse(); 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; } } } catch (Exception e) {}; }
log.debug("SOH - Start of Header Order");
private boolean writeToDisplay(boolean controlsExist) { int pos = 0; boolean error=false; boolean done=false; int attr; byte nextOne; byte control0 = 0; byte control1 = 0; int saRows = screen52.getRows(); int saCols = screen52.getCols(); try { if (controlsExist) { control0 = bk.getNextByte(); control1 = bk.getNextByte(); processCC0(control0); } while (bk.hasNext() && !done) {// pos = bk.getCurrentPos();// int rowc = screen52.getCurrentRow();// int colc = screen52.getCurrentCol(); switch (bk.getNextByte()) { case 1: // SOH - Start of Header Order error = processSOH(); break; case 02: // RA - Repeat to address int row = screen52.getCurrentRow(); int col = screen52.getCurrentCol(); int toRow = bk.getNextByte(); int toCol = bk.getNextByte() & 0xff; if (toRow >= row) { int repeat = bk.getNextByte(); // a little intelligence here I hope if (row == 1 && col == 2 && toRow == screen52.getRows() && toCol == screen52.getCols()) screen52.clearScreen(); else { if (repeat != 0) { //LDC - 13/02/2003 - convert it to unicode repeat = this.ebcdic2uni(repeat); //repeat = getASCIIChar(repeat); } int times = ((toRow * screen52.getCols()) + toCol) - ((row * screen52.getCols()) + col); while (times-- >= 0) { screen52.setChar(repeat); } } } else { sendNegResponse(NR_REQUEST_ERROR,0x05,0x01,0x23," RA invalid"); error =true; } break; case 03: // EA - Erase to address int EArow = screen52.getCurrentRow(); int EAcol = screen52.getCurrentCol(); int toEARow = bk.getNextByte(); int toEACol = bk.getNextByte() & 0xff; int EALength = bk.getNextByte() & 0xff; while (--EALength > 0) { bk.getNextByte(); } char EAAttr = (char)0; // a little intelligence here I hope if (EArow == 1 && EAcol == 2 && toEARow == screen52.getRows() && toEACol == screen52.getCols()) screen52.clearScreen(); else { int times = ((toEARow * screen52.getCols()) + toEACol) - ((EArow * screen52.getCols()) + EAcol); while (times-- >= 0) { screen52.setChar(EAAttr); } } break; case 04: // Command - Escape done = true; break; case 16: // TD - Transparent Data int j = (bk.getNextByte() & 0xff) << 8 | bk.getNextByte() & 0xff; // length break; case 17: // SBA - set buffer address order (row column) int saRow = bk.getNextByte(); int saCol = bk.getNextByte() & 0xff; // make sure it is in bounds if (saRow >= 0 && saRow <= screen52.getRows() && saCol >= 0 && saCol <= screen52.getCols()) { screen52.goto_XY(saRow,saCol); // now set screen position for output } else { sendNegResponse(NR_REQUEST_ERROR,0x05,0x01,0x22,"invalid row/col order" + " saRow = " + saRow + " saRows = " + screen52.getRows() + " saCol = " + saCol); error = true; } break; case 18: // WEA - Extended Attribute bk.getNextByte(); bk.getNextByte(); break; case 19: // IC - Insert Cursor int icX = bk.getNextByte(); int icY = bk.getNextByte() & 0xff; if (icX >= 0 && icX <= saRows && icY >= 0 && icY <= saCols) {// System.out.println(" IC " + icX + " " + icY); screen52.setPendingInsert(true,icX,icY); } else { sendNegResponse(NR_REQUEST_ERROR,0x05,0x01,0x22," IC/IM position invalid "); error = true; } break; case 20: // MC - Move Cursor int imcX = bk.getNextByte(); int imcY = bk.getNextByte() & 0xff; if (imcX >= 0 && imcX <= saRows && imcY >= 0 && imcY <= saCols) {// System.out.println(" MC " + imcX + " " + imcY); screen52.setPendingInsert(false,imcX,imcY); } else { sendNegResponse(NR_REQUEST_ERROR,0x05,0x01,0x22," IC/IM position invalid "); error = true; } break; case 21: // WTDSF - Write To Display Structured Field order byte[] seg = bk.getSegment(); error = sfParser.parseWriteToDisplayStructuredField(seg);// error = writeToDisplayStructuredField(); break; case 29: // SF - Start of Field int fcw1 = 0; int fcw2 = 0; int ffw1 = 0; int ffw0 = bk.getNextByte() & 0xff; // FFW if ((ffw0 & 0x40) == 0x40) { ffw1 = bk.getNextByte() & 0xff; // FFW 1 fcw1 = bk.getNextByte() & 0xff; // check for field control word // check if the first fcw1 is an 0x81 if it is then get the // next pair for checking if (fcw1 == 0x81) { bk.getNextByte(); fcw1 = bk.getNextByte() & 0xff; // check for field control word } if (!isAttribute(fcw1)) { fcw2 = bk.getNextByte() & 0xff; // FCW 2 attr = bk.getNextByte() & 0xff; // attribute field while(!isAttribute(attr)) { System.out.print(Integer.toHexString(fcw1) + " " + Integer.toHexString(fcw2) + " "); System.out.println(Integer.toHexString(attr) + " " + Integer.toHexString(bk.getNextByte() & 0xff));// bk.getNextByte(); attr = bk.getNextByte() & 0xff; // attribute field } } else { attr = fcw1; // attribute of field fcw1 = 0; } } else { attr = ffw0; } int fLength = (bk.getNextByte() & 0xff) << 8 | bk.getNextByte() & 0xff; screen52.addField(attr,fLength, ffw0,ffw1,fcw1,fcw2); break; default: // all others must be output to screen byte byte0 = bk.getByteOffset(-1); if (isAttribute(byte0)) { screen52.setAttr(byte0); } else { if (!screen52.isStatusErrorCode()) { if (!isDataEBCDIC(byte0)) {// if (byte0 == 255) {// sendNegResponse(NR_REQUEST_ERROR,0x05,0x01,0x42,// " Attempt to send FF to screen");// }// else screen52.setChar(byte0); } else //LDC - 13/02/2003 - Convert it to unicode //screen52.setChar(getASCIIChar(byte0)); screen52.setChar(codePage.ebcdic2uni(byte0)); } else { if (byte0 == 0) screen52.setChar(byte0); else //LDC - 13/02/2003 - Convert it to unicode //screen52.setChar(getASCIIChar(byte0)); screen52.setChar(codePage.ebcdic2uni(byte0)); } } break; } if (error) done = true; } } catch (Exception e) { System.out.println("write to display " + e.getMessage()); e.printStackTrace(); }; processCC1(control1); return error; }
log.debug("RA - Repeat to address");
private boolean writeToDisplay(boolean controlsExist) { int pos = 0; boolean error=false; boolean done=false; int attr; byte nextOne; byte control0 = 0; byte control1 = 0; int saRows = screen52.getRows(); int saCols = screen52.getCols(); try { if (controlsExist) { control0 = bk.getNextByte(); control1 = bk.getNextByte(); processCC0(control0); } while (bk.hasNext() && !done) {// pos = bk.getCurrentPos();// int rowc = screen52.getCurrentRow();// int colc = screen52.getCurrentCol(); switch (bk.getNextByte()) { case 1: // SOH - Start of Header Order error = processSOH(); break; case 02: // RA - Repeat to address int row = screen52.getCurrentRow(); int col = screen52.getCurrentCol(); int toRow = bk.getNextByte(); int toCol = bk.getNextByte() & 0xff; if (toRow >= row) { int repeat = bk.getNextByte(); // a little intelligence here I hope if (row == 1 && col == 2 && toRow == screen52.getRows() && toCol == screen52.getCols()) screen52.clearScreen(); else { if (repeat != 0) { //LDC - 13/02/2003 - convert it to unicode repeat = this.ebcdic2uni(repeat); //repeat = getASCIIChar(repeat); } int times = ((toRow * screen52.getCols()) + toCol) - ((row * screen52.getCols()) + col); while (times-- >= 0) { screen52.setChar(repeat); } } } else { sendNegResponse(NR_REQUEST_ERROR,0x05,0x01,0x23," RA invalid"); error =true; } break; case 03: // EA - Erase to address int EArow = screen52.getCurrentRow(); int EAcol = screen52.getCurrentCol(); int toEARow = bk.getNextByte(); int toEACol = bk.getNextByte() & 0xff; int EALength = bk.getNextByte() & 0xff; while (--EALength > 0) { bk.getNextByte(); } char EAAttr = (char)0; // a little intelligence here I hope if (EArow == 1 && EAcol == 2 && toEARow == screen52.getRows() && toEACol == screen52.getCols()) screen52.clearScreen(); else { int times = ((toEARow * screen52.getCols()) + toEACol) - ((EArow * screen52.getCols()) + EAcol); while (times-- >= 0) { screen52.setChar(EAAttr); } } break; case 04: // Command - Escape done = true; break; case 16: // TD - Transparent Data int j = (bk.getNextByte() & 0xff) << 8 | bk.getNextByte() & 0xff; // length break; case 17: // SBA - set buffer address order (row column) int saRow = bk.getNextByte(); int saCol = bk.getNextByte() & 0xff; // make sure it is in bounds if (saRow >= 0 && saRow <= screen52.getRows() && saCol >= 0 && saCol <= screen52.getCols()) { screen52.goto_XY(saRow,saCol); // now set screen position for output } else { sendNegResponse(NR_REQUEST_ERROR,0x05,0x01,0x22,"invalid row/col order" + " saRow = " + saRow + " saRows = " + screen52.getRows() + " saCol = " + saCol); error = true; } break; case 18: // WEA - Extended Attribute bk.getNextByte(); bk.getNextByte(); break; case 19: // IC - Insert Cursor int icX = bk.getNextByte(); int icY = bk.getNextByte() & 0xff; if (icX >= 0 && icX <= saRows && icY >= 0 && icY <= saCols) {// System.out.println(" IC " + icX + " " + icY); screen52.setPendingInsert(true,icX,icY); } else { sendNegResponse(NR_REQUEST_ERROR,0x05,0x01,0x22," IC/IM position invalid "); error = true; } break; case 20: // MC - Move Cursor int imcX = bk.getNextByte(); int imcY = bk.getNextByte() & 0xff; if (imcX >= 0 && imcX <= saRows && imcY >= 0 && imcY <= saCols) {// System.out.println(" MC " + imcX + " " + imcY); screen52.setPendingInsert(false,imcX,imcY); } else { sendNegResponse(NR_REQUEST_ERROR,0x05,0x01,0x22," IC/IM position invalid "); error = true; } break; case 21: // WTDSF - Write To Display Structured Field order byte[] seg = bk.getSegment(); error = sfParser.parseWriteToDisplayStructuredField(seg);// error = writeToDisplayStructuredField(); break; case 29: // SF - Start of Field int fcw1 = 0; int fcw2 = 0; int ffw1 = 0; int ffw0 = bk.getNextByte() & 0xff; // FFW if ((ffw0 & 0x40) == 0x40) { ffw1 = bk.getNextByte() & 0xff; // FFW 1 fcw1 = bk.getNextByte() & 0xff; // check for field control word // check if the first fcw1 is an 0x81 if it is then get the // next pair for checking if (fcw1 == 0x81) { bk.getNextByte(); fcw1 = bk.getNextByte() & 0xff; // check for field control word } if (!isAttribute(fcw1)) { fcw2 = bk.getNextByte() & 0xff; // FCW 2 attr = bk.getNextByte() & 0xff; // attribute field while(!isAttribute(attr)) { System.out.print(Integer.toHexString(fcw1) + " " + Integer.toHexString(fcw2) + " "); System.out.println(Integer.toHexString(attr) + " " + Integer.toHexString(bk.getNextByte() & 0xff));// bk.getNextByte(); attr = bk.getNextByte() & 0xff; // attribute field } } else { attr = fcw1; // attribute of field fcw1 = 0; } } else { attr = ffw0; } int fLength = (bk.getNextByte() & 0xff) << 8 | bk.getNextByte() & 0xff; screen52.addField(attr,fLength, ffw0,ffw1,fcw1,fcw2); break; default: // all others must be output to screen byte byte0 = bk.getByteOffset(-1); if (isAttribute(byte0)) { screen52.setAttr(byte0); } else { if (!screen52.isStatusErrorCode()) { if (!isDataEBCDIC(byte0)) {// if (byte0 == 255) {// sendNegResponse(NR_REQUEST_ERROR,0x05,0x01,0x42,// " Attempt to send FF to screen");// }// else screen52.setChar(byte0); } else //LDC - 13/02/2003 - Convert it to unicode //screen52.setChar(getASCIIChar(byte0)); screen52.setChar(codePage.ebcdic2uni(byte0)); } else { if (byte0 == 0) screen52.setChar(byte0); else //LDC - 13/02/2003 - Convert it to unicode //screen52.setChar(getASCIIChar(byte0)); screen52.setChar(codePage.ebcdic2uni(byte0)); } } break; } if (error) done = true; } } catch (Exception e) { System.out.println("write to display " + e.getMessage()); e.printStackTrace(); }; processCC1(control1); return error; }
log.debug(" IC " + icX + " " + icY);
private boolean writeToDisplay(boolean controlsExist) { int pos = 0; boolean error=false; boolean done=false; int attr; byte nextOne; byte control0 = 0; byte control1 = 0; int saRows = screen52.getRows(); int saCols = screen52.getCols(); try { if (controlsExist) { control0 = bk.getNextByte(); control1 = bk.getNextByte(); processCC0(control0); } while (bk.hasNext() && !done) {// pos = bk.getCurrentPos();// int rowc = screen52.getCurrentRow();// int colc = screen52.getCurrentCol(); switch (bk.getNextByte()) { case 1: // SOH - Start of Header Order error = processSOH(); break; case 02: // RA - Repeat to address int row = screen52.getCurrentRow(); int col = screen52.getCurrentCol(); int toRow = bk.getNextByte(); int toCol = bk.getNextByte() & 0xff; if (toRow >= row) { int repeat = bk.getNextByte(); // a little intelligence here I hope if (row == 1 && col == 2 && toRow == screen52.getRows() && toCol == screen52.getCols()) screen52.clearScreen(); else { if (repeat != 0) { //LDC - 13/02/2003 - convert it to unicode repeat = this.ebcdic2uni(repeat); //repeat = getASCIIChar(repeat); } int times = ((toRow * screen52.getCols()) + toCol) - ((row * screen52.getCols()) + col); while (times-- >= 0) { screen52.setChar(repeat); } } } else { sendNegResponse(NR_REQUEST_ERROR,0x05,0x01,0x23," RA invalid"); error =true; } break; case 03: // EA - Erase to address int EArow = screen52.getCurrentRow(); int EAcol = screen52.getCurrentCol(); int toEARow = bk.getNextByte(); int toEACol = bk.getNextByte() & 0xff; int EALength = bk.getNextByte() & 0xff; while (--EALength > 0) { bk.getNextByte(); } char EAAttr = (char)0; // a little intelligence here I hope if (EArow == 1 && EAcol == 2 && toEARow == screen52.getRows() && toEACol == screen52.getCols()) screen52.clearScreen(); else { int times = ((toEARow * screen52.getCols()) + toEACol) - ((EArow * screen52.getCols()) + EAcol); while (times-- >= 0) { screen52.setChar(EAAttr); } } break; case 04: // Command - Escape done = true; break; case 16: // TD - Transparent Data int j = (bk.getNextByte() & 0xff) << 8 | bk.getNextByte() & 0xff; // length break; case 17: // SBA - set buffer address order (row column) int saRow = bk.getNextByte(); int saCol = bk.getNextByte() & 0xff; // make sure it is in bounds if (saRow >= 0 && saRow <= screen52.getRows() && saCol >= 0 && saCol <= screen52.getCols()) { screen52.goto_XY(saRow,saCol); // now set screen position for output } else { sendNegResponse(NR_REQUEST_ERROR,0x05,0x01,0x22,"invalid row/col order" + " saRow = " + saRow + " saRows = " + screen52.getRows() + " saCol = " + saCol); error = true; } break; case 18: // WEA - Extended Attribute bk.getNextByte(); bk.getNextByte(); break; case 19: // IC - Insert Cursor int icX = bk.getNextByte(); int icY = bk.getNextByte() & 0xff; if (icX >= 0 && icX <= saRows && icY >= 0 && icY <= saCols) {// System.out.println(" IC " + icX + " " + icY); screen52.setPendingInsert(true,icX,icY); } else { sendNegResponse(NR_REQUEST_ERROR,0x05,0x01,0x22," IC/IM position invalid "); error = true; } break; case 20: // MC - Move Cursor int imcX = bk.getNextByte(); int imcY = bk.getNextByte() & 0xff; if (imcX >= 0 && imcX <= saRows && imcY >= 0 && imcY <= saCols) {// System.out.println(" MC " + imcX + " " + imcY); screen52.setPendingInsert(false,imcX,imcY); } else { sendNegResponse(NR_REQUEST_ERROR,0x05,0x01,0x22," IC/IM position invalid "); error = true; } break; case 21: // WTDSF - Write To Display Structured Field order byte[] seg = bk.getSegment(); error = sfParser.parseWriteToDisplayStructuredField(seg);// error = writeToDisplayStructuredField(); break; case 29: // SF - Start of Field int fcw1 = 0; int fcw2 = 0; int ffw1 = 0; int ffw0 = bk.getNextByte() & 0xff; // FFW if ((ffw0 & 0x40) == 0x40) { ffw1 = bk.getNextByte() & 0xff; // FFW 1 fcw1 = bk.getNextByte() & 0xff; // check for field control word // check if the first fcw1 is an 0x81 if it is then get the // next pair for checking if (fcw1 == 0x81) { bk.getNextByte(); fcw1 = bk.getNextByte() & 0xff; // check for field control word } if (!isAttribute(fcw1)) { fcw2 = bk.getNextByte() & 0xff; // FCW 2 attr = bk.getNextByte() & 0xff; // attribute field while(!isAttribute(attr)) { System.out.print(Integer.toHexString(fcw1) + " " + Integer.toHexString(fcw2) + " "); System.out.println(Integer.toHexString(attr) + " " + Integer.toHexString(bk.getNextByte() & 0xff));// bk.getNextByte(); attr = bk.getNextByte() & 0xff; // attribute field } } else { attr = fcw1; // attribute of field fcw1 = 0; } } else { attr = ffw0; } int fLength = (bk.getNextByte() & 0xff) << 8 | bk.getNextByte() & 0xff; screen52.addField(attr,fLength, ffw0,ffw1,fcw1,fcw2); break; default: // all others must be output to screen byte byte0 = bk.getByteOffset(-1); if (isAttribute(byte0)) { screen52.setAttr(byte0); } else { if (!screen52.isStatusErrorCode()) { if (!isDataEBCDIC(byte0)) {// if (byte0 == 255) {// sendNegResponse(NR_REQUEST_ERROR,0x05,0x01,0x42,// " Attempt to send FF to screen");// }// else screen52.setChar(byte0); } else //LDC - 13/02/2003 - Convert it to unicode //screen52.setChar(getASCIIChar(byte0)); screen52.setChar(codePage.ebcdic2uni(byte0)); } else { if (byte0 == 0) screen52.setChar(byte0); else //LDC - 13/02/2003 - Convert it to unicode //screen52.setChar(getASCIIChar(byte0)); screen52.setChar(codePage.ebcdic2uni(byte0)); } } break; } if (error) done = true; } } catch (Exception e) { System.out.println("write to display " + e.getMessage()); e.printStackTrace(); }; processCC1(control1); return error; }
log.debug(" MC " + imcX + " " + imcY);
private boolean writeToDisplay(boolean controlsExist) { int pos = 0; boolean error=false; boolean done=false; int attr; byte nextOne; byte control0 = 0; byte control1 = 0; int saRows = screen52.getRows(); int saCols = screen52.getCols(); try { if (controlsExist) { control0 = bk.getNextByte(); control1 = bk.getNextByte(); processCC0(control0); } while (bk.hasNext() && !done) {// pos = bk.getCurrentPos();// int rowc = screen52.getCurrentRow();// int colc = screen52.getCurrentCol(); switch (bk.getNextByte()) { case 1: // SOH - Start of Header Order error = processSOH(); break; case 02: // RA - Repeat to address int row = screen52.getCurrentRow(); int col = screen52.getCurrentCol(); int toRow = bk.getNextByte(); int toCol = bk.getNextByte() & 0xff; if (toRow >= row) { int repeat = bk.getNextByte(); // a little intelligence here I hope if (row == 1 && col == 2 && toRow == screen52.getRows() && toCol == screen52.getCols()) screen52.clearScreen(); else { if (repeat != 0) { //LDC - 13/02/2003 - convert it to unicode repeat = this.ebcdic2uni(repeat); //repeat = getASCIIChar(repeat); } int times = ((toRow * screen52.getCols()) + toCol) - ((row * screen52.getCols()) + col); while (times-- >= 0) { screen52.setChar(repeat); } } } else { sendNegResponse(NR_REQUEST_ERROR,0x05,0x01,0x23," RA invalid"); error =true; } break; case 03: // EA - Erase to address int EArow = screen52.getCurrentRow(); int EAcol = screen52.getCurrentCol(); int toEARow = bk.getNextByte(); int toEACol = bk.getNextByte() & 0xff; int EALength = bk.getNextByte() & 0xff; while (--EALength > 0) { bk.getNextByte(); } char EAAttr = (char)0; // a little intelligence here I hope if (EArow == 1 && EAcol == 2 && toEARow == screen52.getRows() && toEACol == screen52.getCols()) screen52.clearScreen(); else { int times = ((toEARow * screen52.getCols()) + toEACol) - ((EArow * screen52.getCols()) + EAcol); while (times-- >= 0) { screen52.setChar(EAAttr); } } break; case 04: // Command - Escape done = true; break; case 16: // TD - Transparent Data int j = (bk.getNextByte() & 0xff) << 8 | bk.getNextByte() & 0xff; // length break; case 17: // SBA - set buffer address order (row column) int saRow = bk.getNextByte(); int saCol = bk.getNextByte() & 0xff; // make sure it is in bounds if (saRow >= 0 && saRow <= screen52.getRows() && saCol >= 0 && saCol <= screen52.getCols()) { screen52.goto_XY(saRow,saCol); // now set screen position for output } else { sendNegResponse(NR_REQUEST_ERROR,0x05,0x01,0x22,"invalid row/col order" + " saRow = " + saRow + " saRows = " + screen52.getRows() + " saCol = " + saCol); error = true; } break; case 18: // WEA - Extended Attribute bk.getNextByte(); bk.getNextByte(); break; case 19: // IC - Insert Cursor int icX = bk.getNextByte(); int icY = bk.getNextByte() & 0xff; if (icX >= 0 && icX <= saRows && icY >= 0 && icY <= saCols) {// System.out.println(" IC " + icX + " " + icY); screen52.setPendingInsert(true,icX,icY); } else { sendNegResponse(NR_REQUEST_ERROR,0x05,0x01,0x22," IC/IM position invalid "); error = true; } break; case 20: // MC - Move Cursor int imcX = bk.getNextByte(); int imcY = bk.getNextByte() & 0xff; if (imcX >= 0 && imcX <= saRows && imcY >= 0 && imcY <= saCols) {// System.out.println(" MC " + imcX + " " + imcY); screen52.setPendingInsert(false,imcX,imcY); } else { sendNegResponse(NR_REQUEST_ERROR,0x05,0x01,0x22," IC/IM position invalid "); error = true; } break; case 21: // WTDSF - Write To Display Structured Field order byte[] seg = bk.getSegment(); error = sfParser.parseWriteToDisplayStructuredField(seg);// error = writeToDisplayStructuredField(); break; case 29: // SF - Start of Field int fcw1 = 0; int fcw2 = 0; int ffw1 = 0; int ffw0 = bk.getNextByte() & 0xff; // FFW if ((ffw0 & 0x40) == 0x40) { ffw1 = bk.getNextByte() & 0xff; // FFW 1 fcw1 = bk.getNextByte() & 0xff; // check for field control word // check if the first fcw1 is an 0x81 if it is then get the // next pair for checking if (fcw1 == 0x81) { bk.getNextByte(); fcw1 = bk.getNextByte() & 0xff; // check for field control word } if (!isAttribute(fcw1)) { fcw2 = bk.getNextByte() & 0xff; // FCW 2 attr = bk.getNextByte() & 0xff; // attribute field while(!isAttribute(attr)) { System.out.print(Integer.toHexString(fcw1) + " " + Integer.toHexString(fcw2) + " "); System.out.println(Integer.toHexString(attr) + " " + Integer.toHexString(bk.getNextByte() & 0xff));// bk.getNextByte(); attr = bk.getNextByte() & 0xff; // attribute field } } else { attr = fcw1; // attribute of field fcw1 = 0; } } else { attr = ffw0; } int fLength = (bk.getNextByte() & 0xff) << 8 | bk.getNextByte() & 0xff; screen52.addField(attr,fLength, ffw0,ffw1,fcw1,fcw2); break; default: // all others must be output to screen byte byte0 = bk.getByteOffset(-1); if (isAttribute(byte0)) { screen52.setAttr(byte0); } else { if (!screen52.isStatusErrorCode()) { if (!isDataEBCDIC(byte0)) {// if (byte0 == 255) {// sendNegResponse(NR_REQUEST_ERROR,0x05,0x01,0x42,// " Attempt to send FF to screen");// }// else screen52.setChar(byte0); } else //LDC - 13/02/2003 - Convert it to unicode //screen52.setChar(getASCIIChar(byte0)); screen52.setChar(codePage.ebcdic2uni(byte0)); } else { if (byte0 == 0) screen52.setChar(byte0); else //LDC - 13/02/2003 - Convert it to unicode //screen52.setChar(getASCIIChar(byte0)); screen52.setChar(codePage.ebcdic2uni(byte0)); } } break; } if (error) done = true; } } catch (Exception e) { System.out.println("write to display " + e.getMessage()); e.printStackTrace(); }; processCC1(control1); return error; }
System.out.println("write to display " + e.getMessage());
log.warn("write to display " + e.getMessage());
private boolean writeToDisplay(boolean controlsExist) { int pos = 0; boolean error=false; boolean done=false; int attr; byte nextOne; byte control0 = 0; byte control1 = 0; int saRows = screen52.getRows(); int saCols = screen52.getCols(); try { if (controlsExist) { control0 = bk.getNextByte(); control1 = bk.getNextByte(); processCC0(control0); } while (bk.hasNext() && !done) {// pos = bk.getCurrentPos();// int rowc = screen52.getCurrentRow();// int colc = screen52.getCurrentCol(); switch (bk.getNextByte()) { case 1: // SOH - Start of Header Order error = processSOH(); break; case 02: // RA - Repeat to address int row = screen52.getCurrentRow(); int col = screen52.getCurrentCol(); int toRow = bk.getNextByte(); int toCol = bk.getNextByte() & 0xff; if (toRow >= row) { int repeat = bk.getNextByte(); // a little intelligence here I hope if (row == 1 && col == 2 && toRow == screen52.getRows() && toCol == screen52.getCols()) screen52.clearScreen(); else { if (repeat != 0) { //LDC - 13/02/2003 - convert it to unicode repeat = this.ebcdic2uni(repeat); //repeat = getASCIIChar(repeat); } int times = ((toRow * screen52.getCols()) + toCol) - ((row * screen52.getCols()) + col); while (times-- >= 0) { screen52.setChar(repeat); } } } else { sendNegResponse(NR_REQUEST_ERROR,0x05,0x01,0x23," RA invalid"); error =true; } break; case 03: // EA - Erase to address int EArow = screen52.getCurrentRow(); int EAcol = screen52.getCurrentCol(); int toEARow = bk.getNextByte(); int toEACol = bk.getNextByte() & 0xff; int EALength = bk.getNextByte() & 0xff; while (--EALength > 0) { bk.getNextByte(); } char EAAttr = (char)0; // a little intelligence here I hope if (EArow == 1 && EAcol == 2 && toEARow == screen52.getRows() && toEACol == screen52.getCols()) screen52.clearScreen(); else { int times = ((toEARow * screen52.getCols()) + toEACol) - ((EArow * screen52.getCols()) + EAcol); while (times-- >= 0) { screen52.setChar(EAAttr); } } break; case 04: // Command - Escape done = true; break; case 16: // TD - Transparent Data int j = (bk.getNextByte() & 0xff) << 8 | bk.getNextByte() & 0xff; // length break; case 17: // SBA - set buffer address order (row column) int saRow = bk.getNextByte(); int saCol = bk.getNextByte() & 0xff; // make sure it is in bounds if (saRow >= 0 && saRow <= screen52.getRows() && saCol >= 0 && saCol <= screen52.getCols()) { screen52.goto_XY(saRow,saCol); // now set screen position for output } else { sendNegResponse(NR_REQUEST_ERROR,0x05,0x01,0x22,"invalid row/col order" + " saRow = " + saRow + " saRows = " + screen52.getRows() + " saCol = " + saCol); error = true; } break; case 18: // WEA - Extended Attribute bk.getNextByte(); bk.getNextByte(); break; case 19: // IC - Insert Cursor int icX = bk.getNextByte(); int icY = bk.getNextByte() & 0xff; if (icX >= 0 && icX <= saRows && icY >= 0 && icY <= saCols) {// System.out.println(" IC " + icX + " " + icY); screen52.setPendingInsert(true,icX,icY); } else { sendNegResponse(NR_REQUEST_ERROR,0x05,0x01,0x22," IC/IM position invalid "); error = true; } break; case 20: // MC - Move Cursor int imcX = bk.getNextByte(); int imcY = bk.getNextByte() & 0xff; if (imcX >= 0 && imcX <= saRows && imcY >= 0 && imcY <= saCols) {// System.out.println(" MC " + imcX + " " + imcY); screen52.setPendingInsert(false,imcX,imcY); } else { sendNegResponse(NR_REQUEST_ERROR,0x05,0x01,0x22," IC/IM position invalid "); error = true; } break; case 21: // WTDSF - Write To Display Structured Field order byte[] seg = bk.getSegment(); error = sfParser.parseWriteToDisplayStructuredField(seg);// error = writeToDisplayStructuredField(); break; case 29: // SF - Start of Field int fcw1 = 0; int fcw2 = 0; int ffw1 = 0; int ffw0 = bk.getNextByte() & 0xff; // FFW if ((ffw0 & 0x40) == 0x40) { ffw1 = bk.getNextByte() & 0xff; // FFW 1 fcw1 = bk.getNextByte() & 0xff; // check for field control word // check if the first fcw1 is an 0x81 if it is then get the // next pair for checking if (fcw1 == 0x81) { bk.getNextByte(); fcw1 = bk.getNextByte() & 0xff; // check for field control word } if (!isAttribute(fcw1)) { fcw2 = bk.getNextByte() & 0xff; // FCW 2 attr = bk.getNextByte() & 0xff; // attribute field while(!isAttribute(attr)) { System.out.print(Integer.toHexString(fcw1) + " " + Integer.toHexString(fcw2) + " "); System.out.println(Integer.toHexString(attr) + " " + Integer.toHexString(bk.getNextByte() & 0xff));// bk.getNextByte(); attr = bk.getNextByte() & 0xff; // attribute field } } else { attr = fcw1; // attribute of field fcw1 = 0; } } else { attr = ffw0; } int fLength = (bk.getNextByte() & 0xff) << 8 | bk.getNextByte() & 0xff; screen52.addField(attr,fLength, ffw0,ffw1,fcw1,fcw2); break; default: // all others must be output to screen byte byte0 = bk.getByteOffset(-1); if (isAttribute(byte0)) { screen52.setAttr(byte0); } else { if (!screen52.isStatusErrorCode()) { if (!isDataEBCDIC(byte0)) {// if (byte0 == 255) {// sendNegResponse(NR_REQUEST_ERROR,0x05,0x01,0x42,// " Attempt to send FF to screen");// }// else screen52.setChar(byte0); } else //LDC - 13/02/2003 - Convert it to unicode //screen52.setChar(getASCIIChar(byte0)); screen52.setChar(codePage.ebcdic2uni(byte0)); } else { if (byte0 == 0) screen52.setChar(byte0); else //LDC - 13/02/2003 - Convert it to unicode //screen52.setChar(getASCIIChar(byte0)); screen52.setChar(codePage.ebcdic2uni(byte0)); } } break; } if (error) done = true; } } catch (Exception e) { System.out.println("write to display " + e.getMessage()); e.printStackTrace(); }; processCC1(control1); return error; }
Thread.currentThread().sleep(100);
Thread.sleep(100);
public void connect() { failIfConnected(); if (!isSignificant(this.user)) { connectSimple(); } else { if (this.embeddedSignon) connectEmbedded(); else connectSimulated(); Runnable runnable = new Runnable() { int tryConnection; public void run() { if ((tryConnection++ < 30) && //If it is still not connected after 3 seconds, //stop with trying (isConnected() == false)) { try { Thread.currentThread().sleep(100); } catch (InterruptedException ex) { ; } SwingUtilities.invokeLater(this); } else { doAfterSignon(); doInitialCommand(); doVisibility(); } } }; runnable.run(); } }
Thread.currentThread().sleep(100);
Thread.sleep(100);
public void run() { if ((tryConnection++ < 30) && //If it is still not connected after 3 seconds, //stop with trying (isConnected() == false)) { try { Thread.currentThread().sleep(100); } catch (InterruptedException ex) { ; } SwingUtilities.invokeLater(this); } else { doAfterSignon(); doInitialCommand(); doVisibility(); } }
this.setPreferredSize(this.deriveOptimalSize(this, this.getFont(), 80, 24));
this.setPreferredSize(SessionBean.deriveOptimalSize(this, this.getFont(), 80, 24));
public Dimension getPreferredSize() { if (preferredSize == null) this.setPreferredSize(this.deriveOptimalSize(this, this.getFont(), 80, 24)); return super.getPreferredSize(); }
public void readFromLBN(int startLBN,long offset, byte[] buffer, int bufferOffset , int length) throws IOException { api.read((startLBN * ISO9660FileSystem.DefaultLBNSize) + offset,buffer,bufferOffset,length); }
public void readFromLBN(long startLBN, long offset, byte[] buffer, int bufferOffset, int length) throws IOException { api.read((startLBN * ISO9660FileSystem.DefaultLBNSize) + offset, buffer, bufferOffset, length); }
public void readFromLBN(int startLBN,long offset, byte[] buffer, int bufferOffset , int length) throws IOException { api.read((startLBN * ISO9660FileSystem.DefaultLBNSize) + offset,buffer,bufferOffset,length); }
public AccessibleJFrame()
protected AccessibleJFrame()
public AccessibleJFrame() { super(); // Nothing to do here. }
if (isDefaultLookAndFeelDecorated() && UIManager.getLookAndFeel().getSupportsWindowDecorations()) { setUndecorated(true); getRootPane().setWindowDecorationStyle(JRootPane.FRAME); }
protected void frameInit() { super.setLayout(new BorderLayout(1, 1)); enableEvents(AWTEvent.WINDOW_EVENT_MASK); getRootPane(); // will do set/create // We're now done the init stage. setRootPaneCheckingEnabled(true); }
{ Dimension menuBarSize; Dimension containerSize = c.getSize(null); Dimension contentPaneSize = contentPane.getPreferredSize(); /* if size of top-level window wasn't set then just set contentPane and menuBar to its preferred sizes. Otherwise, if the size of top-level window was specified then set menuBar to its preferred size and make content pane to fit into the remaining space
{ Dimension menuBarSize; int containerWidth = c.getBounds().width - getInsets().left - getInsets().right; int containerHeight = c.getBounds().height - getInsets().top - getInsets().bottom; Dimension contentPaneSize = contentPane.getPreferredSize();
public void layoutContainer(Container c) { Dimension menuBarSize; Dimension containerSize = c.getSize(null); Dimension contentPaneSize = contentPane.getPreferredSize(); /* if size of top-level window wasn't set then just set contentPane and menuBar to its preferred sizes. Otherwise, if the size of top-level window was specified then set menuBar to its preferred size and make content pane to fit into the remaining space +-------------------------------+ | JLayeredPane | | +--------------------------+ | | | menuBar | | | +--------------------------+ | | +--------------------------+ | | |contentPane | | | | | | | | | | | | | | | +--------------------------+ | +-------------------------------+ */ if (containerSize.width == 0 && containerSize.height == 0) { if (menuBar != null) { int maxWidth; menuBarSize = menuBar.getPreferredSize(); maxWidth = Math.max(menuBarSize.width, contentPaneSize.width); menuBar.setBounds(0, 0, maxWidth, menuBarSize.height); glassPane.setBounds(0, menuBarSize.height, maxWidth, contentPaneSize.height); contentPane.setBounds(0, menuBarSize.height, maxWidth, contentPaneSize.height); layeredPane.setSize(maxWidth, menuBarSize.height + contentPaneSize.height); } else { glassPane.setBounds(0, 0, contentPaneSize.width, contentPaneSize.height); contentPane.setBounds(0, 0, contentPaneSize.width, contentPaneSize.height); layeredPane.setSize(contentPaneSize.width, contentPaneSize.height); } } else { if (menuBar != null) { menuBarSize = menuBar.getPreferredSize(); if (menuBarSize.height > containerSize.height) menuBarSize.height = containerSize.height; menuBar.setBounds(0, 0, containerSize.width, menuBarSize.height); int remainingHeight = containerSize.height - menuBarSize.height; glassPane.setBounds(0, menuBarSize.height, containerSize.width, containerSize.height - menuBarSize.height); contentPane.setBounds(0, menuBarSize.height, containerSize.width, (containerSize.height - menuBarSize.height)); } else { glassPane.setBounds(0, 0, containerSize.width, containerSize.height); contentPane.setBounds(0, 0, containerSize.width, containerSize.height); } layeredPane.setSize(containerSize.width, containerSize.height); } }
+-------------------------------+ | JLayeredPane | | +--------------------------+ | | | menuBar | | | +--------------------------+ | | +--------------------------+ | | |contentPane | | | | | | | | | | | | | | | +--------------------------+ | +-------------------------------+
/* if size of top-level window wasn't set then just set contentPane and menuBar to its preferred sizes. Otherwise, if the size of top-level window was specified then set menuBar to its preferred size and make content pane to fit into the remaining space
public void layoutContainer(Container c) { Dimension menuBarSize; Dimension containerSize = c.getSize(null); Dimension contentPaneSize = contentPane.getPreferredSize(); /* if size of top-level window wasn't set then just set contentPane and menuBar to its preferred sizes. Otherwise, if the size of top-level window was specified then set menuBar to its preferred size and make content pane to fit into the remaining space +-------------------------------+ | JLayeredPane | | +--------------------------+ | | | menuBar | | | +--------------------------+ | | +--------------------------+ | | |contentPane | | | | | | | | | | | | | | | +--------------------------+ | +-------------------------------+ */ if (containerSize.width == 0 && containerSize.height == 0) { if (menuBar != null) { int maxWidth; menuBarSize = menuBar.getPreferredSize(); maxWidth = Math.max(menuBarSize.width, contentPaneSize.width); menuBar.setBounds(0, 0, maxWidth, menuBarSize.height); glassPane.setBounds(0, menuBarSize.height, maxWidth, contentPaneSize.height); contentPane.setBounds(0, menuBarSize.height, maxWidth, contentPaneSize.height); layeredPane.setSize(maxWidth, menuBarSize.height + contentPaneSize.height); } else { glassPane.setBounds(0, 0, contentPaneSize.width, contentPaneSize.height); contentPane.setBounds(0, 0, contentPaneSize.width, contentPaneSize.height); layeredPane.setSize(contentPaneSize.width, contentPaneSize.height); } } else { if (menuBar != null) { menuBarSize = menuBar.getPreferredSize(); if (menuBarSize.height > containerSize.height) menuBarSize.height = containerSize.height; menuBar.setBounds(0, 0, containerSize.width, menuBarSize.height); int remainingHeight = containerSize.height - menuBarSize.height; glassPane.setBounds(0, menuBarSize.height, containerSize.width, containerSize.height - menuBarSize.height); contentPane.setBounds(0, menuBarSize.height, containerSize.width, (containerSize.height - menuBarSize.height)); } else { glassPane.setBounds(0, 0, containerSize.width, containerSize.height); contentPane.setBounds(0, 0, containerSize.width, containerSize.height); } layeredPane.setSize(containerSize.width, containerSize.height); } }
*/ if (containerSize.width == 0 && containerSize.height == 0) { if (menuBar != null) { int maxWidth; menuBarSize = menuBar.getPreferredSize(); maxWidth = Math.max(menuBarSize.width, contentPaneSize.width); menuBar.setBounds(0, 0, maxWidth, menuBarSize.height); glassPane.setBounds(0, menuBarSize.height, maxWidth, contentPaneSize.height); contentPane.setBounds(0, menuBarSize.height, maxWidth, contentPaneSize.height); layeredPane.setSize(maxWidth, menuBarSize.height + contentPaneSize.height); } else { glassPane.setBounds(0, 0, contentPaneSize.width, contentPaneSize.height); contentPane.setBounds(0, 0, contentPaneSize.width, contentPaneSize.height); layeredPane.setSize(contentPaneSize.width, contentPaneSize.height); } } else { if (menuBar != null) { menuBarSize = menuBar.getPreferredSize(); if (menuBarSize.height > containerSize.height) menuBarSize.height = containerSize.height; menuBar.setBounds(0, 0, containerSize.width, menuBarSize.height); int remainingHeight = containerSize.height - menuBarSize.height; glassPane.setBounds(0, menuBarSize.height, containerSize.width, containerSize.height - menuBarSize.height); contentPane.setBounds(0, menuBarSize.height, containerSize.width, (containerSize.height - menuBarSize.height)); } else { glassPane.setBounds(0, 0, containerSize.width, containerSize.height); contentPane.setBounds(0, 0, containerSize.width, containerSize.height); }
public void layoutContainer(Container c) { Dimension menuBarSize; Dimension containerSize = c.getSize(null); Dimension contentPaneSize = contentPane.getPreferredSize(); /* if size of top-level window wasn't set then just set contentPane and menuBar to its preferred sizes. Otherwise, if the size of top-level window was specified then set menuBar to its preferred size and make content pane to fit into the remaining space +-------------------------------+ | JLayeredPane | | +--------------------------+ | | | menuBar | | | +--------------------------+ | | +--------------------------+ | | |contentPane | | | | | | | | | | | | | | | +--------------------------+ | +-------------------------------+ */ if (containerSize.width == 0 && containerSize.height == 0) { if (menuBar != null) { int maxWidth; menuBarSize = menuBar.getPreferredSize(); maxWidth = Math.max(menuBarSize.width, contentPaneSize.width); menuBar.setBounds(0, 0, maxWidth, menuBarSize.height); glassPane.setBounds(0, menuBarSize.height, maxWidth, contentPaneSize.height); contentPane.setBounds(0, menuBarSize.height, maxWidth, contentPaneSize.height); layeredPane.setSize(maxWidth, menuBarSize.height + contentPaneSize.height); } else { glassPane.setBounds(0, 0, contentPaneSize.width, contentPaneSize.height); contentPane.setBounds(0, 0, contentPaneSize.width, contentPaneSize.height); layeredPane.setSize(contentPaneSize.width, contentPaneSize.height); } } else { if (menuBar != null) { menuBarSize = menuBar.getPreferredSize(); if (menuBarSize.height > containerSize.height) menuBarSize.height = containerSize.height; menuBar.setBounds(0, 0, containerSize.width, menuBarSize.height); int remainingHeight = containerSize.height - menuBarSize.height; glassPane.setBounds(0, menuBarSize.height, containerSize.width, containerSize.height - menuBarSize.height); contentPane.setBounds(0, menuBarSize.height, containerSize.width, (containerSize.height - menuBarSize.height)); } else { glassPane.setBounds(0, 0, containerSize.width, containerSize.height); contentPane.setBounds(0, 0, containerSize.width, containerSize.height); } layeredPane.setSize(containerSize.width, containerSize.height); } }
layeredPane.setSize(containerSize.width, containerSize.height); } }
+-------------------------------+ | JLayeredPane | | +--------------------------+ | | | menuBar | | | +--------------------------+ | | +--------------------------+ | | |contentPane | | | | | | | | | | | | | | | +--------------------------+ | +-------------------------------+ */ if (containerWidth == 0 && containerHeight == 0) { if (menuBar != null) { int maxWidth; menuBarSize = menuBar.getPreferredSize(); maxWidth = Math.max(menuBarSize.width, contentPaneSize.width); menuBar.setBounds(0, 0, maxWidth, menuBarSize.height); glassPane.setBounds(0, 0, maxWidth, menuBarSize.height + contentPaneSize.height); contentPane.setBounds(0, menuBarSize.height, maxWidth, contentPaneSize.height); layeredPane.setBounds(0, 0, maxWidth, menuBarSize.height + contentPaneSize.height); } else { glassPane.setBounds(0, 0, contentPaneSize.width, contentPaneSize.height); contentPane.setBounds(0, 0, contentPaneSize.width, contentPaneSize.height); layeredPane.setBounds(0, 0, contentPaneSize.width, contentPaneSize.height); } } else { if (menuBar != null) { menuBarSize = menuBar.getPreferredSize(); if (menuBarSize.height > containerHeight) menuBarSize.height = containerHeight; menuBar.setBounds(0, 0, containerWidth, menuBarSize.height); glassPane.setBounds(0, 0, containerWidth, containerHeight); contentPane.setBounds(0, menuBarSize.height, containerWidth, (containerHeight - menuBarSize.height)); } else { glassPane.setBounds(0, 0, containerWidth, containerHeight); contentPane.setBounds(0, 0, containerWidth, containerHeight); } layeredPane.setBounds(0, 0, containerWidth, containerHeight); } }
public void layoutContainer(Container c) { Dimension menuBarSize; Dimension containerSize = c.getSize(null); Dimension contentPaneSize = contentPane.getPreferredSize(); /* if size of top-level window wasn't set then just set contentPane and menuBar to its preferred sizes. Otherwise, if the size of top-level window was specified then set menuBar to its preferred size and make content pane to fit into the remaining space +-------------------------------+ | JLayeredPane | | +--------------------------+ | | | menuBar | | | +--------------------------+ | | +--------------------------+ | | |contentPane | | | | | | | | | | | | | | | +--------------------------+ | +-------------------------------+ */ if (containerSize.width == 0 && containerSize.height == 0) { if (menuBar != null) { int maxWidth; menuBarSize = menuBar.getPreferredSize(); maxWidth = Math.max(menuBarSize.width, contentPaneSize.width); menuBar.setBounds(0, 0, maxWidth, menuBarSize.height); glassPane.setBounds(0, menuBarSize.height, maxWidth, contentPaneSize.height); contentPane.setBounds(0, menuBarSize.height, maxWidth, contentPaneSize.height); layeredPane.setSize(maxWidth, menuBarSize.height + contentPaneSize.height); } else { glassPane.setBounds(0, 0, contentPaneSize.width, contentPaneSize.height); contentPane.setBounds(0, 0, contentPaneSize.width, contentPaneSize.height); layeredPane.setSize(contentPaneSize.width, contentPaneSize.height); } } else { if (menuBar != null) { menuBarSize = menuBar.getPreferredSize(); if (menuBarSize.height > containerSize.height) menuBarSize.height = containerSize.height; menuBar.setBounds(0, 0, containerSize.width, menuBarSize.height); int remainingHeight = containerSize.height - menuBarSize.height; glassPane.setBounds(0, menuBarSize.height, containerSize.width, containerSize.height - menuBarSize.height); contentPane.setBounds(0, menuBarSize.height, containerSize.width, (containerSize.height - menuBarSize.height)); } else { glassPane.setBounds(0, 0, containerSize.width, containerSize.height); contentPane.setBounds(0, 0, containerSize.width, containerSize.height); } layeredPane.setSize(containerSize.width, containerSize.height); } }
{ setLayout(createRootLayout()); getGlassPane(); getLayeredPane(); getContentPane(); setDoubleBuffered(true); updateUI(); }
{ setLayout(createRootLayout()); getGlassPane(); getLayeredPane(); getContentPane(); updateUI(); }
public JRootPane() { setLayout(createRootLayout()); getGlassPane(); getLayeredPane(); getContentPane(); setDoubleBuffered(true); updateUI(); }
p.setLayout(new BorderLayout()); p.setVisible(false);
p.setVisible(false);
protected Component createGlassPane() { JPanel p = new JPanel(); p.setName(this.getName() + ".glassPane"); p.setLayout(new BorderLayout()); p.setVisible(false); p.setOpaque(false); return p; }
{ contentPane = p; getLayeredPane().add(contentPane, JLayeredPane.FRAME_CONTENT_LAYER); }
{ if (p == null) throw new IllegalComponentStateException ("cannot " + "have a null content pane"); else { if (contentPane != null && contentPane.getParent() == layeredPane) layeredPane.remove(contentPane); contentPane = p; getLayeredPane().add(contentPane, JLayeredPane.FRAME_CONTENT_LAYER); } }
public void setContentPane(Container p) { contentPane = p; getLayeredPane().add(contentPane, JLayeredPane.FRAME_CONTENT_LAYER); }
public VmCompiledCode( NativeCodeCompiler compiler, VmByteCode bytecode, Address nativeCode, Object compiledCode, int size, VmCompiledExceptionHandler[] eTable, Address defaultExceptionHandler, VmAddressMap addressTable) { this.compiler = compiler; this.magic = compiler.getMagic(); this.bytecode = bytecode; this.nativeCode = nativeCode; this.compiledCode1 = compiledCode; this.eTable = eTable; this.nativeCodeSize1 = size; this.defaultExceptionHandler = defaultExceptionHandler; this.addressTable = addressTable; if (bytecode != null) { bytecode.lock(); } if (addressTable != null) { addressTable.lock(); } }
public VmCompiledCode(NativeCodeCompiler compiler, VmByteCode bytecode, Address nativeCode, Object compiledCode, int size, VmCompiledExceptionHandler[] eTable, Address defaultExceptionHandler, VmAddressMap addressTable) { this.compiler = compiler; this.magic = compiler.getMagic(); this.bytecode = bytecode; this.nativeCode = nativeCode; this.compiledCode1 = compiledCode; this.eTable = eTable; this.nativeCodeSize1 = size; this.defaultExceptionHandler = defaultExceptionHandler; this.addressTable = addressTable; if (bytecode != null) { bytecode.lock(); } if (addressTable != null) { addressTable.lock(); if (bytecode != null) { if (bytecode.getMethod().getDeclaringClass().getName().equals( "org.jnode.vm.TryCatchNPETest")) { addressTable.writeTo(System.out); } } } }
public VmCompiledCode( NativeCodeCompiler compiler, VmByteCode bytecode, Address nativeCode, Object compiledCode, int size, VmCompiledExceptionHandler[] eTable, Address defaultExceptionHandler, VmAddressMap addressTable) { this.compiler = compiler; this.magic = compiler.getMagic(); this.bytecode = bytecode; this.nativeCode = nativeCode; this.compiledCode1 = compiledCode; this.eTable = eTable; this.nativeCodeSize1 = size; this.defaultExceptionHandler = defaultExceptionHandler; this.addressTable = addressTable; if (bytecode != null) { bytecode.lock(); } if (addressTable != null) { addressTable.lock(); } }
bad.minor = Minor.Any;
public static ServantNotActive extract(Any any) { try { EmptyExceptionHolder h = (EmptyExceptionHolder) any.extract_Streamable(); return (ServantNotActive) h.value; } catch (ClassCastException cex) { BAD_OPERATION bad = new BAD_OPERATION("ServantNotActive expected"); bad.initCause(cex); throw bad; } }
throw new BAD_OPERATION();
BAD_OPERATION bad = new BAD_OPERATION(); bad.initCause(ex); bad.minor = Minor.Any; throw bad;
public static CannotProceed extract(Any a) { try { return ((CannotProceedHolder) a.extract_Streamable()).value; } catch (ClassCastException ex) { throw new BAD_OPERATION(); } }
String note, int minimum, int maximum) { this.component = component; this.message = message; this.note = note; this.minimum = minimum; this.maximum = maximum;
String note, int minimum, int maximum) {
public ProgressMonitor(Component component, Object message, String note, int minimum, int maximum) { // Set Data this.component = component; this.message = message; this.note = note; this.minimum = minimum; this.maximum = maximum; // TODO } // ProgressMonitor()
}
this.component = component; this.message = message; this.note = note; min = minimum; max = maximum; }
public ProgressMonitor(Component component, Object message, String note, int minimum, int maximum) { // Set Data this.component = component; this.message = message; this.note = note; this.minimum = minimum; this.maximum = maximum; // TODO } // ProgressMonitor()
public void close() { }
public void close() { if ( progressDialog != null ) { progressDialog.setVisible(false); } if ( timer != null ) { timer.stop(); timer = null; } }
public void close() { // TODO } // close()
public int getMaximum() { return maximum; }
public int getMaximum() { return max; }
public int getMaximum() { return maximum; // TODO } // getMaximum()
public int getMinimum() { return minimum; }
public int getMinimum() { return min; }
public int getMinimum() { return minimum; // TODO } // getMinimum()
public boolean isCanceled() { return false; }
public boolean isCanceled() { return canceled; }
public boolean isCanceled() { return false; // TODO } // isCanceled()
public void setMaximum(int maximum) { this.maximum = maximum; }
public void setMaximum(int maximum) { max = maximum; }
public void setMaximum(int maximum) { this.maximum = maximum; // TODO } // setMaximum()
public void setMinimum(int minimum) { this.minimum = minimum; }
public void setMinimum(int minimum) { min = minimum; }
public void setMinimum(int minimum) { this.minimum = minimum; // TODO } // setMinimum()
public void setNote(String note) { this.note = note; }
public void setNote(String note) { if ( noteLabel != null ) { noteLabel.setText(note); } else { this.note = note; } }
public void setNote(String note) { this.note = note; // TODO } // setNote()
public void setProgress(int progress) { }
public void setProgress(int progress) { this.progress = progress; if ( timer == null && progressDialog == null ) { timer = new Timer(25, null); timer.addActionListener(new TimerListener()); timer.start(); } if ( progressBar != null && this.progress >= progressBar.getMaximum() ) { close(); } }
public void setProgress(int progress) { // TODO } // setProgress()
public CharHolder(char initial_value)
public CharHolder()
public CharHolder(char initial_value) { value = initial_value; }
value = initial_value;
public CharHolder(char initial_value) { value = initial_value; }
public void loadPlugins(PluginRegistry piRegistry) {
public List loadPlugins(PluginRegistry piRegistry) {
public void loadPlugins(PluginRegistry piRegistry) { if (jarFile == null) { return; } final InitJarPluginLoader loader = new InitJarPluginLoader(); for (Enumeration e = jarFile.entries(); e.hasMoreElements();) { final JarEntry entry = (JarEntry) e.nextElement(); if (entry.getName().endsWith(".jar")) { try { // Load it loader.setIs(jarFile.getInputStream(entry)); piRegistry.loadPlugin(loader, "", "", false); } catch (IOException ex) { BootLog.error("Cannot load " + entry.getName(), ex); } catch (PluginException ex) { BootLog.error("Cannot load " + entry.getName(), ex); } } } }
return;
return null;
public void loadPlugins(PluginRegistry piRegistry) { if (jarFile == null) { return; } final InitJarPluginLoader loader = new InitJarPluginLoader(); for (Enumeration e = jarFile.entries(); e.hasMoreElements();) { final JarEntry entry = (JarEntry) e.nextElement(); if (entry.getName().endsWith(".jar")) { try { // Load it loader.setIs(jarFile.getInputStream(entry)); piRegistry.loadPlugin(loader, "", "", false); } catch (IOException ex) { BootLog.error("Cannot load " + entry.getName(), ex); } catch (PluginException ex) { BootLog.error("Cannot load " + entry.getName(), ex); } } } }