bugged
stringlengths
6
599k
fixed
stringlengths
10
599k
__index_level_0__
int64
0
1.13M
public void generateCode(CodeGenerator cg) { Variable lhs = getLHS(); Location lhsLoc = lhs.getLocation(); if (lhsLoc instanceof RegisterLocation) { RegisterLocation regLoc = (RegisterLocation) lhsLoc; Object lhsReg = regLoc.getRegister(); if (operand instanceof Variable) { Variable var = (Variable) operand; Location varLoc = var.getLocation(); if (varLoc instanceof RegisterLocation) { RegisterLocation vregLoc = (RegisterLocation) varLoc; cg.generateCodeFor(this, lhsReg, operation, vregLoc.getRegister()); } else if (varLoc instanceof StackLocation) { StackLocation stackLoc = (StackLocation) varLoc; cg.generateCodeFor(this, lhsReg, operation, stackLoc.getDisplacement()); } else { throw new IllegalArgumentException("Unknown location: " + varLoc); } } else if (operand instanceof Constant) { // this probably won't happen, is should be folded earlier Constant con = (Constant) operand; cg.generateCodeFor(this, lhsReg, operation, con); } else { throw new IllegalArgumentException("Unknown operand: " + operand); } } else if (lhsLoc instanceof StackLocation) { StackLocation lhsStackLoc = (StackLocation) lhsLoc; int lhsDisp = lhsStackLoc.getDisplacement(); if (operand instanceof Variable) { Variable var = (Variable) operand; Location varLoc = var.getLocation(); if (varLoc instanceof RegisterLocation) { RegisterLocation vregLoc = (RegisterLocation) varLoc; cg.generateCodeFor(this, lhsDisp, operation, vregLoc.getRegister()); } else if (varLoc instanceof StackLocation) { StackLocation stackLoc = (StackLocation) varLoc; cg.generateCodeFor(this, lhsDisp, operation, stackLoc.getDisplacement()); } else { throw new IllegalArgumentException("Unknown location: " + varLoc); } } else if (operand instanceof Constant) { Constant con = (Constant) operand; cg.generateCodeFor(this, lhsDisp, operation, con); } else { throw new IllegalArgumentException("Unknown operand: " + operand); } } else { throw new IllegalArgumentException("Unknown location: " + lhsLoc); } }
public void generateCode(CodeGenerator cg) { Variable lhs = getLHS(); Location lhsLoc = lhs.getLocation(); if (lhsLoc instanceof RegisterLocation) { RegisterLocation regLoc = (RegisterLocation) lhsLoc; Object lhsReg = regLoc.getRegister(); if (operand instanceof Variable) { Variable var = (Variable) operand; Location varLoc = var.getLocation(); if (varLoc instanceof RegisterLocation) { RegisterLocation vregLoc = (RegisterLocation) varLoc; cg.generateCodeFor(this, lhsReg, operation, vregLoc.getRegister()); } else if (varLoc instanceof StackLocation) { StackLocation stackLoc = (StackLocation) varLoc; cg.generateCodeFor(this, lhsReg, operation, stackLoc.getDisplacement()); } else { throw new IllegalArgumentException("Unknown location: " + varLoc); } } else if (operand instanceof Constant) { // this probably won't happen, is should be folded earlier Constant con = (Constant) operand; cg.generateCodeFor(this, lhsReg, operation, con); } else { throw new IllegalArgumentException("Unknown operand: " + refs[0]); } } else if (lhsLoc instanceof StackLocation) { StackLocation lhsStackLoc = (StackLocation) lhsLoc; int lhsDisp = lhsStackLoc.getDisplacement(); if (operand instanceof Variable) { Variable var = (Variable) operand; Location varLoc = var.getLocation(); if (varLoc instanceof RegisterLocation) { RegisterLocation vregLoc = (RegisterLocation) varLoc; cg.generateCodeFor(this, lhsDisp, operation, vregLoc.getRegister()); } else if (varLoc instanceof StackLocation) { StackLocation stackLoc = (StackLocation) varLoc; cg.generateCodeFor(this, lhsDisp, operation, stackLoc.getDisplacement()); } else { throw new IllegalArgumentException("Unknown location: " + varLoc); } } else if (operand instanceof Constant) { Constant con = (Constant) operand; cg.generateCodeFor(this, lhsDisp, operation, con); } else { throw new IllegalArgumentException("Unknown operand: " + refs[0]); } } else { throw new IllegalArgumentException("Unknown location: " + lhsLoc); } }
2,383
public void generateCode(CodeGenerator cg) { Variable lhs = getLHS(); Location lhsLoc = lhs.getLocation(); if (lhsLoc instanceof RegisterLocation) { RegisterLocation regLoc = (RegisterLocation) lhsLoc; Object lhsReg = regLoc.getRegister(); if (operand instanceof Variable) { Variable var = (Variable) operand; Location varLoc = var.getLocation(); if (varLoc instanceof RegisterLocation) { RegisterLocation vregLoc = (RegisterLocation) varLoc; cg.generateCodeFor(this, lhsReg, operation, vregLoc.getRegister()); } else if (varLoc instanceof StackLocation) { StackLocation stackLoc = (StackLocation) varLoc; cg.generateCodeFor(this, lhsReg, operation, stackLoc.getDisplacement()); } else { throw new IllegalArgumentException("Unknown location: " + varLoc); } } else if (operand instanceof Constant) { // this probably won't happen, is should be folded earlier Constant con = (Constant) operand; cg.generateCodeFor(this, lhsReg, operation, con); } else { throw new IllegalArgumentException("Unknown operand: " + operand); } } else if (lhsLoc instanceof StackLocation) { StackLocation lhsStackLoc = (StackLocation) lhsLoc; int lhsDisp = lhsStackLoc.getDisplacement(); if (operand instanceof Variable) { Variable var = (Variable) operand; Location varLoc = var.getLocation(); if (varLoc instanceof RegisterLocation) { RegisterLocation vregLoc = (RegisterLocation) varLoc; cg.generateCodeFor(this, lhsDisp, operation, vregLoc.getRegister()); } else if (varLoc instanceof StackLocation) { StackLocation stackLoc = (StackLocation) varLoc; cg.generateCodeFor(this, lhsDisp, operation, stackLoc.getDisplacement()); } else { throw new IllegalArgumentException("Unknown location: " + varLoc); } } else if (operand instanceof Constant) { Constant con = (Constant) operand; cg.generateCodeFor(this, lhsDisp, operation, con); } else { throw new IllegalArgumentException("Unknown operand: " + operand); } } else { throw new IllegalArgumentException("Unknown location: " + lhsLoc); } }
public void generateCode(CodeGenerator cg) { Variable lhs = getLHS(); Location lhsLoc = lhs.getLocation(); if (lhsLoc instanceof RegisterLocation) { RegisterLocation regLoc = (RegisterLocation) lhsLoc; Object lhsReg = regLoc.getRegister(); if (operand instanceof Variable) { Variable var = (Variable) operand; Location varLoc = var.getLocation(); if (varLoc instanceof RegisterLocation) { RegisterLocation vregLoc = (RegisterLocation) varLoc; cg.generateCodeFor(this, lhsReg, operation, vregLoc.getRegister()); } else if (varLoc instanceof StackLocation) { StackLocation stackLoc = (StackLocation) varLoc; cg.generateCodeFor(this, lhsReg, operation, stackLoc.getDisplacement()); } else { throw new IllegalArgumentException("Unknown location: " + varLoc); } } else if (operand instanceof Constant) { // this probably won't happen, is should be folded earlier Constant con = (Constant) operand; cg.generateCodeFor(this, lhsReg, operation, con); } else { throw new IllegalArgumentException("Unknown operand: " + operand); } } else if (lhsLoc instanceof StackLocation) { StackLocation lhsStackLoc = (StackLocation) lhsLoc; int lhsDisp = lhsStackLoc.getDisplacement(); if (operand instanceof Variable) { Variable var = (Variable) operand; Location varLoc = var.getLocation(); if (varLoc instanceof RegisterLocation) { RegisterLocation vregLoc = (RegisterLocation) varLoc; cg.generateCodeFor(this, lhsDisp, operation, vregLoc.getRegister()); } else if (varLoc instanceof StackLocation) { StackLocation stackLoc = (StackLocation) varLoc; cg.generateCodeFor(this, lhsDisp, operation, stackLoc.getDisplacement()); } else { throw new IllegalArgumentException("Unknown location: " + varLoc); } } else if (operand instanceof Constant) { Constant con = (Constant) operand; cg.generateCodeFor(this, lhsDisp, operation, con); } else { throw new IllegalArgumentException("Unknown operand: " + operand); } } else { throw new IllegalArgumentException("Unknown location: " + lhsLoc); } }
2,384
public Operand getOperand() { return operand; }
public Operand getOperand() { return refs[0]; }
2,385
public String toString() { return getAddress() + ": " + getLHS().toString() + " = " + OP_MAP[operation - I2L] + " " + operand.toString(); }
public String toString() { return getAddress() + ": " + getLHS().toString() + " = " + OP_MAP[operation - I2L] + " " + refs[0].toString(); }
2,386
public AssignQuad(int address, IRBasicBlock block, int lhsIndex) { this(address, block, block.getVariables()[lhsIndex]); }
public AssignQuad(int address, IRBasicBlock block, int lhsIndex) { this(address, block, block.getVariables()[lhsIndex]); }
2,387
public int getNativeFD() { NIOSocket socket = (NIOSocket) ((SocketChannelImpl) ch).socket(); return socket.getPlainSocketImpl().getNativeFD(); }
public int getNativeFD() { NIOSocket socket = (NIOSocket) ((SocketChannelImpl) ch).socket(); return socket.getPlainSocketImpl().getNativeFD(); }
2,390
public void insertString(int offset, String text, AttributeSet attributes) throws BadLocationException { // Just return when no text to insert was given. if (text == null || text.length() == 0) return; DefaultDocumentEvent event = new DefaultDocumentEvent(offset, text.length(), DocumentEvent.EventType.INSERT); writeLock(); UndoableEdit undo = content.insertString(offset, text); insertUpdate(event, attributes); writeUnlock(); if (event.modified) fireInsertUpdate(event); if (undo != null) fireUndoableEditUpdate(new UndoableEditEvent(this, undo)); }
public void insertString(int offset, String text, AttributeSet attributes) throws BadLocationException { // Just return when no text to insert was given. if (text == null || text.length() == 0) return; DefaultDocumentEvent event = new DefaultDocumentEvent(offset, text.length(), DocumentEvent.EventType.INSERT); writeLock(); UndoableEdit undo = content.insertString(offset, text); insertUpdate(event, attributes); writeUnlock(); fireInsertUpdate(event); if (undo != null) fireUndoableEditUpdate(new UndoableEditEvent(this, undo)); }
2,391
void jbInit() throws Exception { // make it non resizable setResizable(true); this.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); // create some reusable borders and layouts Border etchedBorder = BorderFactory.createEtchedBorder(); BorderLayout borderLayout = new BorderLayout(); // get an instance of our table model ctm = new ConfigureTableModel(); // create a table using our custom table model sessions = new JSortTable(ctm); // Add enter as default key for connect with this session Action connect = new AbstractAction("connect") { public void actionPerformed(ActionEvent e) { doActionConnect(); } }; KeyStroke enter = KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,0,false); sessions.getInputMap().put(enter,"connect"); sessions.getActionMap().put("connect",connect ); sessions.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); sessions.setPreferredScrollableViewportSize(new Dimension(500,200)); sessions.setShowGrid(false); //Create the scroll pane and add the table to it. scrollPane = new JScrollPane(sessions); scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); //Setup our selection model listener rowSM = sessions.getSelectionModel(); rowSM.addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent e) { //Ignore extra messages. if (e.getValueIsAdjusting()) return; ListSelectionModel lsm = (ListSelectionModel)e.getSource(); if (lsm.isSelectionEmpty()) { //no rows are selected editButton.setEnabled(false); removeButton.setEnabled(false); connectButton.setEnabled(false); } else { int selectedRow = lsm.getMinSelectionIndex(); //selectedRow is selected editButton.setEnabled(true); removeButton.setEnabled(true); connectButton.setEnabled(true); } } }); // setup the frame interface panel interfacePanel = new JPanel(); TitledBorder tb = BorderFactory.createTitledBorder( LangTool.getString("conf.labelPresentation")); interfacePanel.setBorder(tb); ButtonGroup intGroup = new ButtonGroup(); intTABS = new JRadioButton(LangTool.getString("conf.labelTABS")); intTABS.setSelected(true); intTABS.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(ItemEvent e) { intTABS_itemStateChanged(e); } }); intMDI = new JRadioButton(LangTool.getString("conf.labelMDI")); // add the interface options to the group control intGroup.add(intTABS); intGroup.add(intMDI); if (props.containsKey("emul.interface")) { if (props.getProperty("emul.interface").equalsIgnoreCase("MDI")) intMDI.setSelected(true); } interfacePanel.add(intTABS); interfacePanel.add(intMDI); //Setup panels configOptions.setLayout(borderLayout); sessionPanel.setLayout(borderLayout); configOptions.add(sessionPanel, BorderLayout.CENTER); sessionOpts.add(scrollPane, BorderLayout.CENTER); sessionPanel.add(sessionOpts, BorderLayout.NORTH); sessionPanel.add(sessionOptPanel, BorderLayout.SOUTH); sessionPanel.setBorder(BorderFactory.createRaisedBevelBorder()); // add the option buttons addOptButton(LangTool.getString("ss.optAdd"),"ADD",sessionOptPanel); removeButton = addOptButton(LangTool.getString("ss.optDelete"), "REMOVE", sessionOptPanel, false); editButton = addOptButton(LangTool.getString("ss.optEdit"), "EDIT", sessionOptPanel, false); showMe = new JCheckBox(LangTool.getString("ss.labelShowMe")); if(props.containsKey("emul.showConnectDialog")) showMe.setSelected(true); showMe.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(ItemEvent e) { showMe_itemStateChanged(e); } }); options.add(showMe); connectButton = addOptButton(LangTool.getString("ss.optConnect"), "CONNECT",options,false); applyButton = addOptButton(LangTool.getString("ss.optApply"), "APPLY",options,true); addOptButton(LangTool.getString("ss.optCancel"),"DONE",options); // add the panels to our dialog getContentPane().add(sessionPanel,BorderLayout.CENTER); getContentPane().add(options, BorderLayout.SOUTH); getContentPane().add(interfacePanel,BorderLayout.NORTH); // pack it and center it on the screen pack(); Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); Dimension frameSize = getSize(); if (frameSize.height > screenSize.height) frameSize.height = screenSize.height; if (frameSize.width > screenSize.width) frameSize.width = screenSize.width; setLocation((screenSize.width - frameSize.width) / 2, (screenSize.height - frameSize.height) / 2); // set default selection value as the first row or default session if (sessions.getRowCount() > 0) { int selInterval = 0; for (int x = 0; x < sessions.getRowCount(); x++) { if (((Boolean)ctm.getValueAt(x,2)).booleanValue()) selInterval = x; } sessions.getSelectionModel().setSelectionInterval(selInterval,selInterval); } sessions.requestFocus(); // now show the world what we and they can do this.setVisible(true); }
void jbInit() throws Exception { // make it non resizable setResizable(true); this.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); // create some reusable borders and layouts Border etchedBorder = BorderFactory.createEtchedBorder(); BorderLayout borderLayout = new BorderLayout(); // get an instance of our table model ctm = new ConfigureTableModel(); // create a table using our custom table model sessions = new JSortTable(ctm); // Add enter as default key for connect with this session Action connect = new AbstractAction("connect") { public void actionPerformed(ActionEvent e) { doActionConnect(); } }; KeyStroke enter = KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,0,false); sessions.getInputMap().put(enter,"connect"); sessions.getActionMap().put("connect",connect ); sessions.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); sessions.setPreferredScrollableViewportSize(new Dimension(500,200)); sessions.setShowGrid(false); //Create the scroll pane and add the table to it. scrollPane = new JScrollPane(sessions); scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); //Setup our selection model listener rowSM = sessions.getSelectionModel(); rowSM.addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent e) { //Ignore extra messages. if (e.getValueIsAdjusting()) return; ListSelectionModel lsm = (ListSelectionModel)e.getSource(); if (lsm.isSelectionEmpty()) { //no rows are selected editButton.setEnabled(false); removeButton.setEnabled(false); connectButton.setEnabled(false); } else { int selectedRow = lsm.getMinSelectionIndex(); //selectedRow is selected editButton.setEnabled(true); removeButton.setEnabled(true); connectButton.setEnabled(true); } } }); // setup the frame interface panel interfacePanel = new JPanel(); TitledBorder tb = BorderFactory.createTitledBorder( LangTool.getString("conf.labelPresentation")); interfacePanel.setBorder(tb); ButtonGroup intGroup = new ButtonGroup(); intTABS = new JRadioButton(LangTool.getString("conf.labelTABS")); intTABS.setSelected(true); intTABS.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(ItemEvent e) { intTABS_itemStateChanged(e); } }); intMDI = new JRadioButton(LangTool.getString("conf.labelMDI")); // add the interface options to the group control intGroup.add(intTABS); intGroup.add(intMDI); if (props.containsKey("emul.interface")) { if (props.getProperty("emul.interface").equalsIgnoreCase("MDI")) intMDI.setSelected(true); } interfacePanel.add(intTABS); interfacePanel.add(intMDI); //Setup panels configOptions.setLayout(borderLayout); sessionPanel.setLayout(borderLayout); configOptions.add(sessionPanel, BorderLayout.CENTER); sessionOpts.add(scrollPane, BorderLayout.CENTER); sessionPanel.add(sessionOpts, BorderLayout.NORTH); sessionPanel.add(sessionOptPanel, BorderLayout.SOUTH); sessionPanel.setBorder(BorderFactory.createRaisedBevelBorder()); // add the option buttons addOptButton(LangTool.getString("ss.optAdd"),"ADD",sessionOptPanel); removeButton = addOptButton(LangTool.getString("ss.optDelete"), "REMOVE", sessionOptPanel, false); editButton = addOptButton(LangTool.getString("ss.optEdit"), "EDIT", sessionOptPanel, false); showMe = new JCheckBox(LangTool.getString("ss.labelShowMe")); if(props.containsKey("emul.showConnectDialog")) showMe.setSelected(true); showMe.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(ItemEvent e) { showMe_itemStateChanged(e); } }); options.add(showMe); connectButton = addOptButton(LangTool.getString("ss.optConnect"), "CONNECT",options,false); applyButton = addOptButton(LangTool.getString("ss.optApply"), "APPLY",options,true); addOptButton(LangTool.getString("ss.optCancel"),"DONE",options); // add the panels to our dialog getContentPane().add(sessionPanel,BorderLayout.CENTER); getContentPane().add(options, BorderLayout.SOUTH); getContentPane().add(interfacePanel,BorderLayout.NORTH); // pack it and center it on the screen pack(); Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); Dimension frameSize = getSize(); if (frameSize.height > screenSize.height) frameSize.height = screenSize.height; if (frameSize.width > screenSize.width) frameSize.width = screenSize.width; setLocation((screenSize.width - frameSize.width) / 2, (screenSize.height - frameSize.height) / 2); // set default selection value as the first row or default session if (sessions.getRowCount() > 0) { int selInterval = 0; for (int x = 0; x < sessions.getRowCount(); x++) { if (((Boolean)ctm.getValueAt(x,2)).booleanValue()) selInterval = x; } sessions.getSelectionModel().setSelectionInterval(selInterval,selInterval); } sessions.requestFocus(); // now show the world what we and they can do this.setVisible(true); }
2,394
void jbInit() throws Exception { // make it non resizable setResizable(true); this.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); // create some reusable borders and layouts Border etchedBorder = BorderFactory.createEtchedBorder(); BorderLayout borderLayout = new BorderLayout(); // get an instance of our table model ctm = new ConfigureTableModel(); // create a table using our custom table model sessions = new JSortTable(ctm); // Add enter as default key for connect with this session Action connect = new AbstractAction("connect") { public void actionPerformed(ActionEvent e) { doActionConnect(); } }; KeyStroke enter = KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,0,false); sessions.getInputMap().put(enter,"connect"); sessions.getActionMap().put("connect",connect ); sessions.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); sessions.setPreferredScrollableViewportSize(new Dimension(500,200)); sessions.setShowGrid(false); //Create the scroll pane and add the table to it. scrollPane = new JScrollPane(sessions); scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); //Setup our selection model listener rowSM = sessions.getSelectionModel(); rowSM.addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent e) { //Ignore extra messages. if (e.getValueIsAdjusting()) return; ListSelectionModel lsm = (ListSelectionModel)e.getSource(); if (lsm.isSelectionEmpty()) { //no rows are selected editButton.setEnabled(false); removeButton.setEnabled(false); connectButton.setEnabled(false); } else { int selectedRow = lsm.getMinSelectionIndex(); //selectedRow is selected editButton.setEnabled(true); removeButton.setEnabled(true); connectButton.setEnabled(true); } } }); // setup the frame interface panel interfacePanel = new JPanel(); TitledBorder tb = BorderFactory.createTitledBorder( LangTool.getString("conf.labelPresentation")); interfacePanel.setBorder(tb); ButtonGroup intGroup = new ButtonGroup(); intTABS = new JRadioButton(LangTool.getString("conf.labelTABS")); intTABS.setSelected(true); intTABS.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(ItemEvent e) { intTABS_itemStateChanged(e); } }); intMDI = new JRadioButton(LangTool.getString("conf.labelMDI")); // add the interface options to the group control intGroup.add(intTABS); intGroup.add(intMDI); if (props.containsKey("emul.interface")) { if (props.getProperty("emul.interface").equalsIgnoreCase("MDI")) intMDI.setSelected(true); } interfacePanel.add(intTABS); interfacePanel.add(intMDI); //Setup panels configOptions.setLayout(borderLayout); sessionPanel.setLayout(borderLayout); configOptions.add(sessionPanel, BorderLayout.CENTER); sessionOpts.add(scrollPane, BorderLayout.CENTER); sessionPanel.add(sessionOpts, BorderLayout.NORTH); sessionPanel.add(sessionOptPanel, BorderLayout.SOUTH); sessionPanel.setBorder(BorderFactory.createRaisedBevelBorder()); // add the option buttons addOptButton(LangTool.getString("ss.optAdd"),"ADD",sessionOptPanel); removeButton = addOptButton(LangTool.getString("ss.optDelete"), "REMOVE", sessionOptPanel, false); editButton = addOptButton(LangTool.getString("ss.optEdit"), "EDIT", sessionOptPanel, false); showMe = new JCheckBox(LangTool.getString("ss.labelShowMe")); if(props.containsKey("emul.showConnectDialog")) showMe.setSelected(true); showMe.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(ItemEvent e) { showMe_itemStateChanged(e); } }); options.add(showMe); connectButton = addOptButton(LangTool.getString("ss.optConnect"), "CONNECT",options,false); applyButton = addOptButton(LangTool.getString("ss.optApply"), "APPLY",options,true); addOptButton(LangTool.getString("ss.optCancel"),"DONE",options); // add the panels to our dialog getContentPane().add(sessionPanel,BorderLayout.CENTER); getContentPane().add(options, BorderLayout.SOUTH); getContentPane().add(interfacePanel,BorderLayout.NORTH); // pack it and center it on the screen pack(); Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); Dimension frameSize = getSize(); if (frameSize.height > screenSize.height) frameSize.height = screenSize.height; if (frameSize.width > screenSize.width) frameSize.width = screenSize.width; setLocation((screenSize.width - frameSize.width) / 2, (screenSize.height - frameSize.height) / 2); // set default selection value as the first row or default session if (sessions.getRowCount() > 0) { int selInterval = 0; for (int x = 0; x < sessions.getRowCount(); x++) { if (((Boolean)ctm.getValueAt(x,2)).booleanValue()) selInterval = x; } sessions.getSelectionModel().setSelectionInterval(selInterval,selInterval); } sessions.requestFocus(); // now show the world what we and they can do this.setVisible(true); }
void jbInit() throws Exception { // make it non resizable setResizable(true); this.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); // create some reusable borders and layouts Border etchedBorder = BorderFactory.createEtchedBorder(); BorderLayout borderLayout = new BorderLayout(); // get an instance of our table model ctm = new ConfigureTableModel(); // create a table using our custom table model sessions = new JSortTable(ctm); // Add enter as default key for connect with this session Action connect = new AbstractAction("connect") { public void actionPerformed(ActionEvent e) { doActionConnect(); } }; KeyStroke enter = KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,0,false); sessions.getInputMap().put(enter,"connect"); sessions.getActionMap().put("connect",connect ); sessions.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); sessions.setPreferredScrollableViewportSize(new Dimension(500,200)); sessions.setShowGrid(false); //Create the scroll pane and add the table to it. scrollPane = new JScrollPane(sessions); scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); //Setup our selection model listener rowSM = sessions.getSelectionModel(); rowSM.addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent e) { //Ignore extra messages. if (e.getValueIsAdjusting()) return; ListSelectionModel lsm = (ListSelectionModel)e.getSource(); if (lsm.isSelectionEmpty()) { //no rows are selected editButton.setEnabled(false); removeButton.setEnabled(false); connectButton.setEnabled(false); } else { int selectedRow = lsm.getMinSelectionIndex(); //selectedRow is selected editButton.setEnabled(true); removeButton.setEnabled(true); connectButton.setEnabled(true); } } }); // setup the frame interface panel interfacePanel = new JPanel(); TitledBorder tb = BorderFactory.createTitledBorder( LangTool.getString("conf.labelPresentation")); interfacePanel.setBorder(tb); ButtonGroup intGroup = new ButtonGroup(); intTABS = new JRadioButton(LangTool.getString("conf.labelTABS")); intTABS.setSelected(true); intTABS.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(ItemEvent e) { intTABS_itemStateChanged(e); } }); intMDI = new JRadioButton(LangTool.getString("conf.labelMDI")); // add the interface options to the group control intGroup.add(intTABS); intGroup.add(intMDI); if (props.containsKey("emul.interface")) { if (props.getProperty("emul.interface").equalsIgnoreCase("MDI")) intMDI.setSelected(true); } interfacePanel.add(intTABS); interfacePanel.add(intMDI); //Setup panels configOptions.setLayout(borderLayout); sessionPanel.setLayout(borderLayout); configOptions.add(sessionPanel, BorderLayout.CENTER); sessionOpts.add(scrollPane, BorderLayout.CENTER); sessionPanel.add(sessionOpts, BorderLayout.NORTH); sessionPanel.add(sessionOptPanel, BorderLayout.SOUTH); sessionPanel.setBorder(BorderFactory.createRaisedBevelBorder()); // add the option buttons addOptButton(LangTool.getString("ss.optAdd"),"ADD",sessionOptPanel); removeButton = addOptButton(LangTool.getString("ss.optDelete"), "REMOVE", sessionOptPanel, false); editButton = addOptButton(LangTool.getString("ss.optEdit"), "EDIT", sessionOptPanel, false); showMe = new JCheckBox(LangTool.getString("ss.labelShowMe")); if(props.containsKey("emul.showConnectDialog")) showMe.setSelected(true); showMe.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(ItemEvent e) { showMe_itemStateChanged(e); } }); options.add(showMe); connectButton = addOptButton(LangTool.getString("ss.optConnect"), "CONNECT",options,false); applyButton = addOptButton(LangTool.getString("ss.optApply"), "APPLY",options,true); addOptButton(LangTool.getString("ss.optCancel"),"DONE",options); // add the panels to our dialog getContentPane().add(sessionPanel,BorderLayout.CENTER); getContentPane().add(options, BorderLayout.SOUTH); getContentPane().add(emulOptPanel,BorderLayout.NORTH); // pack it and center it on the screen pack(); Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); Dimension frameSize = getSize(); if (frameSize.height > screenSize.height) frameSize.height = screenSize.height; if (frameSize.width > screenSize.width) frameSize.width = screenSize.width; setLocation((screenSize.width - frameSize.width) / 2, (screenSize.height - frameSize.height) / 2); // set default selection value as the first row or default session if (sessions.getRowCount() > 0) { int selInterval = 0; for (int x = 0; x < sessions.getRowCount(); x++) { if (((Boolean)ctm.getValueAt(x,2)).booleanValue()) selInterval = x; } sessions.getSelectionModel().setSelectionInterval(selInterval,selInterval); } sessions.requestFocus(); // now show the world what we and they can do this.setVisible(true); }
2,395
public DebugGraphics(Graphics graphics) { this.graphics = graphics; }
public DebugGraphics() { this.graphics = graphics; }
2,396
public DebugGraphics(Graphics graphics) { this.graphics = graphics; }
public DebugGraphics(Graphics graphics) { }
2,397
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(); }
public int previous() { if (iter.getIndex() == iter.getBeginIndex()) return DONE; //int start = iter.getBeginIndex(); 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(); }
2,400
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(); }
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(); }
2,402
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; } } }
2,404
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; } } }
2,405
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; } } }
2,406
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; } } }
2,407
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; } } }
2,408
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;
2,409
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; } } }
2,410
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(); }
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(); }
2,412
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()); } }
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) { log.warn(ioe.getMessage()); } }
2,414
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; }
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) { log.info("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; }
2,415
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; }
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) { log.warn(exception.getMessage()); connected = false; devSeq = -1; return false; } devSeq = -1; return true; }
2,416
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); }
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); }
2,417
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(); }
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) { log.warn(ioe.getMessage()); } baosp.reset(); }
2,418
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());}; }
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) {log.warn("incoming " + exc.getMessage());}; }
2,422
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(); }
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) { log.warn(ioe.getMessage()); baosp.reset(); } baosp.reset(); }
2,429
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()); } }
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());// if(log.isDebugEnabled()) { log.debug("/nRestored "); log.debug(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()); } }
2,432
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()); } }
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) { log.warn("error restoring screen " + which + " with " + e.getMessage()); } }
2,433
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(); } }
public void run () { if (enhanced) sfParser = new WTDSFParser(this); while (keepTrucking) { try { bk = (Stream5250)dsq.get(); } catch (InterruptedException ie) { log.warn(" 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(); } }
2,434
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(); } }
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 ) { log.warn(" 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(); } }
2,449
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 "); }
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) { log.warn(ioe.getMessage()); } sc = null;// System.out.println("Save Screen end "); }
2,451
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; }
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) { log.warn(ioe.getMessage()); baosp.reset(); return false; } baosp.reset(); return true; }
2,453
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()); } }
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) { log.warn(ioe.getMessage()); } }
2,454
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(); }
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) { log.warn(ioe.getMessage()); } baosp.reset(); }
2,455
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(); }
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) { log.warn("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(); }
2,456
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(); }
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) { log.warn(ioe.getMessage()); } baosp.reset(); }
2,457
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(); }
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) { log.warn(ioe.getMessage()); } baosp.reset(); }
2,458
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; }
public final void sendQueryResponse() throws IOException { log.info("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; }
2,459
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; }
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 log.info("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; }
2,460
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 "); }
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); log.info(" socks set "); }
2,462
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) {}; }
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: log.debug("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) {}; }
2,463
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) {}; }
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: log.debug("invalid structured field command " + bk.getByteOffset(-1)); break; } } } catch (Exception e) {}; }
2,464
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; }
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) { log.warn("write to display " + e.getMessage()); e.printStackTrace(); }; processCC1(control1); return error; }
2,469
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(); } }
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.sleep(100); } catch (InterruptedException ex) { ; } SwingUtilities.invokeLater(this); } else { doAfterSignon(); doInitialCommand(); doVisibility(); } } }; runnable.run(); } }
2,470
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(); } }
public void run() { if ((tryConnection++ < 30) && //If it is still not connected after 3 seconds, //stop with trying (isConnected() == false)) { try { Thread.sleep(100); } catch (InterruptedException ex) { ; } SwingUtilities.invokeLater(this); } else { doAfterSignon(); doInitialCommand(); doVisibility(); } }
2,471
public Dimension getPreferredSize() { if (preferredSize == null) this.setPreferredSize(this.deriveOptimalSize(this, this.getFont(), 80, 24)); return super.getPreferredSize(); }
public Dimension getPreferredSize() { if (preferredSize == null) this.setPreferredSize(SessionBean.deriveOptimalSize(this, this.getFont(), 80, 24)); return super.getPreferredSize(); }
2,472
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(int startLBN,long offset, byte[] buffer, int bufferOffset , int length) throws IOException { api.read((startLBN * ISO9660FileSystem.DefaultLBNSize) + offset,buffer,bufferOffset,length); }
2,473
public AccessibleJFrame() { super(); // Nothing to do here. }
protected AccessibleJFrame() { super(); // Nothing to do here. }
2,474
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); } }
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); } }
2,476
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); } }
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); } }
2,477
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); } }
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); } }
2,478
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); } }
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); } }
2,479
public JRootPane() { setLayout(createRootLayout()); getGlassPane(); getLayeredPane(); getContentPane(); setDoubleBuffered(true); updateUI(); }
public JRootPane() { setLayout(createRootLayout()); getGlassPane(); getLayeredPane(); getContentPane(); setDoubleBuffered(true); updateUI(); }
2,480
protected Component createGlassPane() { JPanel p = new JPanel(); p.setName(this.getName() + ".glassPane"); p.setLayout(new BorderLayout()); p.setVisible(false); p.setOpaque(false); return p; }
protected Component createGlassPane() { JPanel p = new JPanel(); p.setName(this.getName() + ".glassPane"); p.setLayout(new BorderLayout()); p.setVisible(false); p.setOpaque(false); return p; }
2,481
public void setContentPane(Container p) { contentPane = p; getLayeredPane().add(contentPane, JLayeredPane.FRAME_CONTENT_LAYER); }
public void setContentPane(Container p) { contentPane = p; getLayeredPane().add(contentPane, JLayeredPane.FRAME_CONTENT_LAYER); }
2,482
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(); } }
2,483
public static CannotProceed extract(Any a) { try { return ((CannotProceedHolder) a.extract_Streamable()).value; } catch (ClassCastException ex) { throw new BAD_OPERATION(); } }
public static CannotProceed extract(Any a) { try { return ((CannotProceedHolder) a.extract_Streamable()).value; } catch (ClassCastException ex) { BAD_OPERATION bad = new BAD_OPERATION(); bad.initCause(ex); bad.minor = Minor.Any; throw bad; } }
2,485
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 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()
2,486
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 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 this.component = component; this.message = message; this.note = note; min = minimum; max = maximum; } // ProgressMonitor()
2,487
public void close() { // TODO } // close()
public void close() { // TODO } // close()
2,488
public int getMaximum() { return maximum; // TODO } // getMaximum()
public int getMaximum() { return maximum; // TODO } // getMaximum()
2,489
public int getMinimum() { return minimum; // TODO } // getMinimum()
public int getMinimum() { return minimum; // TODO } // getMinimum()
2,490
public boolean isCanceled() { return false; // TODO } // isCanceled()
public boolean isCanceled() { return false; // TODO } // isCanceled()
2,491
public void setMaximum(int maximum) { this.maximum = maximum; // TODO } // setMaximum()
public void setMaximum(int maximum) { this.maximum = maximum; // TODO } // setMaximum()
2,492
public void setMinimum(int minimum) { this.minimum = minimum; // TODO } // setMinimum()
public void setMinimum(int minimum) { this.minimum = minimum; // TODO } // setMinimum()
2,493
public void setNote(String note) { this.note = note; // TODO } // setNote()
public void setNote(String note) { this.note = note; // TODO } // setNote()
2,494
public void setProgress(int progress) { // TODO } // setProgress()
public void setProgress(int progress) { // TODO } // setProgress()
2,495
public CharHolder(char initial_value) { value = initial_value; }
public CharHolder() { value = initial_value; }
2,496
public CharHolder(char initial_value) { value = initial_value; }
public CharHolder(char initial_value) { }
2,497
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); } } } }
public List 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); } } } }
2,498
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); } } } }
public void loadPlugins(PluginRegistry piRegistry) { if (jarFile == null) { return null; } 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); } } } }
2,499
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); } } } }
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)); final PluginDescriptor descr = piRegistry.loadPlugin(loader, "", "", false); descriptors.add(descr); } catch (IOException ex) { BootLog.error("Cannot load " + entry.getName(), ex); } catch (PluginException ex) { BootLog.error("Cannot load " + entry.getName(), ex); } } } }
2,500
protected final boolean isAttributePlace(int pos) { return screenIsAttr[pos]; }
protected final boolean isAttributePlace(int pos) { return screenIsAttr[pos] == '1' ? true : false; }
2,502
private final void registerBlockIndex(long i, long blockNr) throws FileSystemException, IOException{ final long blockCount = getSizeInBlocks(); final int indirectCount = getIndirectCount(); long allocatedBlocks = i; if(i != blockCount) throw new FileSystemException( "Trying to register block "+i+" (counts from 0), when"+ " INode contains only "+blockCount+" blocks"); log.debug("registering block #"+blockNr); setDirty(true); //the direct blocks (0; 11) if(i<12) { Ext2Utils.set32(data, 40+(int)i*4, blockNr); return; } //see the indirect blocks (12; indirectCount-1) i-=12; if(i<indirectCount) { long indirectBlockNr; //the 12th index points to the indirect block if(i==0) { //need to reserve the indirect block itself, as this is the //first time it is used indirectBlockNr = findFreeBlock(allocatedBlocks++); Ext2Utils.set32(data, 40+12*4, indirectBlockNr); //log.debug("reserved indirect block: "+indirectBlockNr); //need to blank the block so that e2fsck does not complain byte[] zeroes=new byte[fs.getBlockSize()]; //blank the block Arrays.fill(zeroes, 0, fs.getBlockSize(), (byte)0); fs.writeBlock(indirectBlockNr, zeroes, false); } else //the indirect block has already been used indirectBlockNr = Ext2Utils.get32(data,40+12*4); indirectWrite( indirectBlockNr, i, allocatedBlocks, blockNr, 1 ); return; } //see the double indirect blocks (indirectCount; doubleIndirectCount-1) i-=indirectCount; final int doubleIndirectCount = indirectCount * indirectCount; if(i<doubleIndirectCount) { long doubleIndirectBlockNr; //the 13th index points to the double indirect block if(i==0) { //need to reserve the double indirect block itself doubleIndirectBlockNr = findFreeBlock(allocatedBlocks++); Ext2Utils.set32(data, 40+13*4, doubleIndirectBlockNr); //log.debug("reserved double indirect block: "+doubleIndirectBlockNr); //need to blank the block so that e2fsck does not complain byte[] zeroes=new byte[fs.getBlockSize()]; //blank the block Arrays.fill(zeroes, 0, fs.getBlockSize(), (byte)0); fs.writeBlock(doubleIndirectBlockNr, zeroes, false); } else doubleIndirectBlockNr = Ext2Utils.get32(data, 40+13*4); indirectWrite( doubleIndirectBlockNr, i, allocatedBlocks, blockNr, 2 ); return; } //see the triple indirect blocks (doubleIndirectCount; tripleIndirectCount-1) final int tripleIndirectCount = indirectCount * indirectCount * indirectCount; i-=doubleIndirectCount; if(i<tripleIndirectCount) { long tripleIndirectBlockNr; //the 14th index points to the triple indirect block if(i==0) { //need to reserve the triple indirect block itself tripleIndirectBlockNr = findFreeBlock(allocatedBlocks++); Ext2Utils.set32(data, 40+13*4, tripleIndirectBlockNr);log.info("reserved triple indirect block: "+tripleIndirectBlockNr); //need to blank the block so that e2fsck does not complain byte[] zeroes=new byte[fs.getBlockSize()]; //blank the block Arrays.fill(zeroes, 0, fs.getBlockSize(), (byte)0); fs.writeBlock(tripleIndirectBlockNr, zeroes, false); } else tripleIndirectBlockNr = Ext2Utils.get32(data, 40+14*4); indirectWrite( tripleIndirectBlockNr, i, allocatedBlocks, blockNr, 3 ); return; } //shouldn't get here throw new FileSystemException("Internal FS exception: getDataBlockIndex(i="+i+")"); }
private final void registerBlockIndex(long i, long blockNr) throws FileSystemException, IOException{ final long blockCount = getSizeInBlocks(); final int indirectCount = getIndirectCount(); long allocatedBlocks = i; if(i != blockCount) throw new FileSystemException( "Trying to register block "+i+" (counts from 0), when"+ " INode contains only "+blockCount+" blocks"); log.debug("registering block #"+blockNr); setDirty(true); //the direct blocks (0; 11) if(i<12) { Ext2Utils.set32(data, 40+(int)i*4, blockNr); return; } //see the indirect blocks (12; indirectCount-1) i-=12; if(i<indirectCount) { long indirectBlockNr; //the 12th index points to the indirect block if(i==0) { //need to reserve the indirect block itself, as this is the //first time it is used indirectBlockNr = findFreeBlock(allocatedBlocks++); Ext2Utils.set32(data, 40+12*4, indirectBlockNr); //log.debug("reserved indirect block: "+indirectBlockNr); //need to blank the block so that e2fsck does not complain byte[] zeroes=new byte[fs.getBlockSize()]; //blank the block Arrays.fill(zeroes, 0, fs.getBlockSize(), (byte)0); fs.writeBlock(indirectBlockNr, zeroes, false); } else //the indirect block has already been used indirectBlockNr = Ext2Utils.get32(data,40+12*4); indirectWrite( indirectBlockNr, i, allocatedBlocks, blockNr, 1 ); return; } //see the double indirect blocks (indirectCount; doubleIndirectCount-1) i-=indirectCount; final int doubleIndirectCount = indirectCount * indirectCount; if(i<doubleIndirectCount) { long doubleIndirectBlockNr; //the 13th index points to the double indirect block if(i==0) { //need to reserve the double indirect block itself doubleIndirectBlockNr = findFreeBlock(allocatedBlocks++); Ext2Utils.set32(data, 40+13*4, doubleIndirectBlockNr); //log.debug("reserved double indirect block: "+doubleIndirectBlockNr); //need to blank the block so that e2fsck does not complain byte[] zeroes=new byte[fs.getBlockSize()]; //blank the block Arrays.fill(zeroes, 0, fs.getBlockSize(), (byte)0); fs.writeBlock(doubleIndirectBlockNr, zeroes, false); } else doubleIndirectBlockNr = Ext2Utils.get32(data, 40+13*4); indirectWrite( doubleIndirectBlockNr, i, allocatedBlocks, blockNr, 2 ); return; } //see the triple indirect blocks (doubleIndirectCount; tripleIndirectCount-1) final int tripleIndirectCount = indirectCount * indirectCount * indirectCount; i-=doubleIndirectCount; if(i<tripleIndirectCount) { long tripleIndirectBlockNr; //the 14th index points to the triple indirect block if(i==0) { //need to reserve the triple indirect block itself tripleIndirectBlockNr = findFreeBlock(allocatedBlocks++); Ext2Utils.set32(data, 40+13*4, tripleIndirectBlockNr); //need to blank the block so that e2fsck does not complain byte[] zeroes=new byte[fs.getBlockSize()]; //blank the block Arrays.fill(zeroes, 0, fs.getBlockSize(), (byte)0); fs.writeBlock(tripleIndirectBlockNr, zeroes, false); } else tripleIndirectBlockNr = Ext2Utils.get32(data, 40+14*4); indirectWrite( tripleIndirectBlockNr, i, allocatedBlocks, blockNr, 3 ); return; } //shouldn't get here throw new FileSystemException("Internal FS exception: getDataBlockIndex(i="+i+")"); }
2,505
Certificate[] getCertificates() { return entry.getCertificates(); }
Certificate[] getCertificates() { return ((JarEntry) ((JarURLLoader) loader).jarfile.getEntry(name)) .getCertificates(); }
2,506
protected Class findClass(final String className) throws ClassNotFoundException { // Just try to find the resource by the (almost) same name String resourceName = className.replace('.', '/') + ".class"; Resource resource = findURLResource(resourceName); if (resource == null) throw new ClassNotFoundException(className + " not found in " + urls); // Try to read the class data, create the CodeSource, Package and // construct the class (and watch out for those nasty IOExceptions) try { byte[] data; InputStream in = resource.getInputStream(); try { int length = resource.getLength(); if (length != -1) { // We know the length of the data. // Just try to read it in all at once data = new byte[length]; int pos = 0; while (length - pos > 0) { int len = in.read(data, pos, length - pos); if (len == -1) throw new EOFException("Not enough data reading from: " + in); pos += len; } } else { // We don't know the data length. // Have to read it in chunks. ByteArrayOutputStream out = new ByteArrayOutputStream(4096); byte[] b = new byte[4096]; int l = 0; while (l != -1) { l = in.read(b); if (l != -1) out.write(b, 0, l); } data = out.toByteArray(); } } finally { in.close(); } final byte[] classData = data; // Now get the CodeSource final CodeSource source = resource.getCodeSource(); // Find out package name String packageName = null; int lastDot = className.lastIndexOf('.'); if (lastDot != -1) packageName = className.substring(0, lastDot); if (packageName != null && getPackage(packageName) == null) { // define the package Manifest manifest = resource.loader.getManifest(); if (manifest == null) definePackage(packageName, null, null, null, null, null, null, null); else definePackage(packageName, manifest, resource.loader.baseURL); } // And finally construct the class! SecurityManager sm = System.getSecurityManager(); if (sm != null && securityContext != null) { return (Class)AccessController.doPrivileged (new PrivilegedAction() { public Object run() { return defineClass(className, classData, 0, classData.length, source); } }, securityContext); } else return defineClass(className, classData, 0, classData.length, source); } catch (IOException ioe) { throw new ClassNotFoundException(className, ioe); } }
protected Class findClass(final String className) throws ClassNotFoundException { // Just try to find the resource by the (almost) same name String resourceName = className.replace('.', '/') + ".class"; Resource resource = findURLResource(resourceName); if (resource == null) throw new ClassNotFoundException(className + " not found in " + urls); // Try to read the class data, create the CodeSource, Package and // construct the class (and watch out for those nasty IOExceptions) try { byte[] data; InputStream in = resource.getInputStream(); try { int length = resource.getLength(); if (length != -1) { // We know the length of the data. // Just try to read it in all at once data = new byte[length]; int pos = 0; while (length - pos > 0) { int len = in.read(data, pos, length - pos); if (len == -1) throw new EOFException("Not enough data reading from: " + in); pos += len; } } else { // We don't know the data length. // Have to read it in chunks. ByteArrayOutputStream out = new ByteArrayOutputStream(4096); byte[] b = new byte[4096]; int l = 0; while (l != -1) { l = in.read(b); if (l != -1) out.write(b, 0, l); } data = out.toByteArray(); } } finally { in.close(); } final byte[] classData = data; // Now get the CodeSource final CodeSource source = resource.getCodeSource(); // Find out package name String packageName = null; int lastDot = className.lastIndexOf('.'); if (lastDot != -1) packageName = className.substring(0, lastDot); if (packageName != null && getPackage(packageName) == null) { // define the package Manifest manifest = resource.loader.getManifest(); if (manifest == null) definePackage(packageName, null, null, null, null, null, null, null); else definePackage(packageName, manifest, resource.loader.baseURL); } // And finally construct the class! SecurityManager sm = System.getSecurityManager(); if (sm != null && securityContext != null) { result = (Class)AccessController.doPrivileged (new PrivilegedAction() { public Object run() { return defineClass(className, classData, 0, classData.length, source); } }, securityContext); } else return defineClass(className, classData, 0, classData.length, source); } catch (IOException ioe) { throw new ClassNotFoundException(className, ioe); } }
2,507
protected Class findClass(final String className) throws ClassNotFoundException { // Just try to find the resource by the (almost) same name String resourceName = className.replace('.', '/') + ".class"; Resource resource = findURLResource(resourceName); if (resource == null) throw new ClassNotFoundException(className + " not found in " + urls); // Try to read the class data, create the CodeSource, Package and // construct the class (and watch out for those nasty IOExceptions) try { byte[] data; InputStream in = resource.getInputStream(); try { int length = resource.getLength(); if (length != -1) { // We know the length of the data. // Just try to read it in all at once data = new byte[length]; int pos = 0; while (length - pos > 0) { int len = in.read(data, pos, length - pos); if (len == -1) throw new EOFException("Not enough data reading from: " + in); pos += len; } } else { // We don't know the data length. // Have to read it in chunks. ByteArrayOutputStream out = new ByteArrayOutputStream(4096); byte[] b = new byte[4096]; int l = 0; while (l != -1) { l = in.read(b); if (l != -1) out.write(b, 0, l); } data = out.toByteArray(); } } finally { in.close(); } final byte[] classData = data; // Now get the CodeSource final CodeSource source = resource.getCodeSource(); // Find out package name String packageName = null; int lastDot = className.lastIndexOf('.'); if (lastDot != -1) packageName = className.substring(0, lastDot); if (packageName != null && getPackage(packageName) == null) { // define the package Manifest manifest = resource.loader.getManifest(); if (manifest == null) definePackage(packageName, null, null, null, null, null, null, null); else definePackage(packageName, manifest, resource.loader.baseURL); } // And finally construct the class! SecurityManager sm = System.getSecurityManager(); if (sm != null && securityContext != null) { return (Class)AccessController.doPrivileged (new PrivilegedAction() { public Object run() { return defineClass(className, classData, 0, classData.length, source); } }, securityContext); } else return defineClass(className, classData, 0, classData.length, source); } catch (IOException ioe) { throw new ClassNotFoundException(className, ioe); } }
protected Class findClass(final String className) throws ClassNotFoundException { // Just try to find the resource by the (almost) same name String resourceName = className.replace('.', '/') + ".class"; Resource resource = findURLResource(resourceName); if (resource == null) throw new ClassNotFoundException(className + " not found in " + urls); // Try to read the class data, create the CodeSource, Package and // construct the class (and watch out for those nasty IOExceptions) try { byte[] data; InputStream in = resource.getInputStream(); try { int length = resource.getLength(); if (length != -1) { // We know the length of the data. // Just try to read it in all at once data = new byte[length]; int pos = 0; while (length - pos > 0) { int len = in.read(data, pos, length - pos); if (len == -1) throw new EOFException("Not enough data reading from: " + in); pos += len; } } else { // We don't know the data length. // Have to read it in chunks. ByteArrayOutputStream out = new ByteArrayOutputStream(4096); byte[] b = new byte[4096]; int l = 0; while (l != -1) { l = in.read(b); if (l != -1) out.write(b, 0, l); } data = out.toByteArray(); } } finally { in.close(); } final byte[] classData = data; // Now get the CodeSource final CodeSource source = resource.getCodeSource(); // Find out package name String packageName = null; int lastDot = className.lastIndexOf('.'); if (lastDot != -1) packageName = className.substring(0, lastDot); if (packageName != null && getPackage(packageName) == null) { // define the package Manifest manifest = resource.loader.getManifest(); if (manifest == null) definePackage(packageName, null, null, null, null, null, null, null); else definePackage(packageName, manifest, resource.loader.baseURL); } // And finally construct the class! SecurityManager sm = System.getSecurityManager(); if (sm != null && securityContext != null) { return (Class)AccessController.doPrivileged (new PrivilegedAction() { public Object run() { return defineClass(className, classData, 0, classData.length, source); } }, securityContext); } else result = defineClass(className, classData, 0, classData.length, source); super.setSigners(result, resource.getCertificates()); return result; } catch (IOException ioe) { throw new ClassNotFoundException(className, ioe); } }
2,508
public static Icon getMenuItemCheckIcon() { return new DummyIcon(); }
public static Icon getMenuItemCheckIcon() { return new Icon() { public int getIconHeight() { return 13; } public int getIconWidth() { return 13; } public void paintIcon(Component c, Graphics g, int x, int y) { Color saved = g.getColor(); g.setColor(Color.BLACK); g.drawLine(3 + x, 5 + y, 3 + x, 9 + y); g.drawLine(4 + x, 5 + y, 4 + x, 9 + y); g.drawLine(5 + x, 7 + y, 9 + x, 3 + y); g.drawLine(5 + x, 8 + y, 9 + x, 4 + y); g.setColor(saved); } }; }
2,510
public static org.omg.CORBA.Object extract(Any a) { try { return ((ObjectHolder) a.extract_Streamable()).value; } catch (ClassCastException ex) { throw new BAD_OPERATION("CORBA object expected"); } }
public static org.omg.CORBA.Object extract(Any a) { try { return ((ObjectHolder) a.extract_Streamable()).value; } catch (ClassCastException ex) { BAD_OPERATION bad = new BAD_OPERATION("CORBA object expected"); bad.minor = Minor.Any; throw bad; } }
2,511
private void checkLegacy() { // we check if the sessions file already exists in the directory // if it does exist we are working with an old install so we // need to set the settings directory to the users directory File ses = new File("sessions"); if(ses.exists()) { settings.setProperty("emulator.settingsDirectory", System.getProperty("user.dir") + File.separator); } else { settings.setProperty("emulator.settingsDirectory", System.getProperty("user.home") + File.separator + ".tn5250j" + File.separator); } }
private void checkLegacy() { // we check if the sessions file already exists in the directory // if it does exist we are working with an old install so we // need to set the settings directory to the users directory File ses = new File("sessions"); if(ses.exists()) { settings.setProperty("emulator.settingsDirectory", System.getProperty("user.dir") + File.separator); } else { settings.setProperty("emulator.settingsDirectory", System.getProperty("user.home") + File.separator + ".tn5250j" + File.separator); } }
2,512
private void checkLegacy() { // we check if the sessions file already exists in the directory // if it does exist we are working with an old install so we // need to set the settings directory to the users directory File ses = new File("sessions"); if(ses.exists()) { settings.setProperty("emulator.settingsDirectory", System.getProperty("user.dir") + File.separator); } else { settings.setProperty("emulator.settingsDirectory", System.getProperty("user.home") + File.separator + ".tn5250j" + File.separator); } }
private void checkLegacy() { // we check if the sessions file already exists in the directory // if it does exist we are working with an old install so we // need to set the settings directory to the users directory File ses = new File("sessions"); if(ses.exists()) { settings.setProperty("emulator.settingsDirectory", System.getProperty("user.dir") + File.separator); } else { settings.setProperty("emulator.settingsDirectory", System.getProperty("user.home") + File.separator + ".tn5250j" + File.separator); } }
2,513
private void checkLegacy() { // we check if the sessions file already exists in the directory // if it does exist we are working with an old install so we // need to set the settings directory to the users directory File ses = new File("sessions"); if(ses.exists()) { settings.setProperty("emulator.settingsDirectory", System.getProperty("user.dir") + File.separator); } else { settings.setProperty("emulator.settingsDirectory", System.getProperty("user.home") + File.separator + ".tn5250j" + File.separator); } }
private void checkLegacy() { // we check if the sessions file already exists in the directory // if it does exist we are working with an old install so we // need to set the settings directory to the users directory File ses = new File("sessions"); if(ses.exists()) { settings.setProperty("emulator.settingsDirectory", System.getProperty("user.dir") + File.separator); } else { settings.setProperty("emulator.settingsDirectory", System.getProperty("user.home") + File.separator + ".tn5250j" + File.separator); } }
2,514
private void loadKeyStrokes() {// FileInputStream in = null;// Properties keystrokes = new Properties();//// try {// in = new FileInputStream(settingssDirectory()// + KEYMAP);// keystrokes.load(in);// }// catch (FileNotFoundException fnfe) {System.out.println(fnfe.getMessage());}// catch (IOException ioe) {System.out.println(ioe.getMessage());}// catch (SecurityException se) {// System.out.println(se.getMessage());// }//// if (keystrokes != null) {// registry.put(KEYMAP,keystrokes);// } getProperties(KEYMAP,KEYMAP,true,"",true); }
private void loadKeyStrokes() {// FileInputStream in = null;// Properties keystrokes = new Properties();//// try {// in = new FileInputStream(settingssDirectory()// + KEYMAP);// keystrokes.load(in);// }// catch (FileNotFoundException fnfe) {System.out.println(fnfe.getMessage());}// catch (IOException ioe) {System.out.println(ioe.getMessage());}// catch (SecurityException se) {// System.out.println(se.getMessage());// }//// if (keystrokes != null) {// registry.put(KEYMAP,keystrokes);// } setProperties(KEYMAP,KEYMAP, "------ Key Map key=keycode,isShiftDown,isControlDown,isAltDown,isAltGrDown --------", true); }
2,515
private void loadMacros() {// FileInputStream in = null;// Properties macs = new Properties();//// try {// in = new FileInputStream(settingssDirectory()// + MACROS);// macs.load(in);// }// catch (FileNotFoundException fnfe) {System.out.println(fnfe.getMessage());}// catch (IOException ioe) {System.out.println(ioe.getMessage());}// catch (SecurityException se) {// System.out.println(se.getMessage());// }//// if (macs != null) {// registry.put(MACROS,macs);// } getProperties(MACROS,MACROS,true,"",true); }
private void loadMacros() {// FileInputStream in = null;// Properties macs = new Properties();//// try {// in = new FileInputStream(settingssDirectory()// + MACROS);// macs.load(in);// }// catch (FileNotFoundException fnfe) {System.out.println(fnfe.getMessage());}// catch (IOException ioe) {System.out.println(ioe.getMessage());}// catch (SecurityException se) {// System.out.println(se.getMessage());// }//// if (macs != null) {// registry.put(MACROS,macs);// } setProperties(MACROS,MACROS,"------ Macros --------",true); }
2,516
private void loadSessions() {// FileInputStream in = null;// Properties sessions = new Properties();//// try {// in = new FileInputStream(settingssDirectory() + SESSIONS);// sessions.load(in);//// }// catch (FileNotFoundException fnfe) {// System.out.println(" Information Message: " + fnfe.getMessage()// + ". Default sessions file will"// + " be created for first time use.");// }// catch (IOException ioe) {System.out.println(ioe.getMessage());}//// if (sessions != null) {//// registry.put(SESSIONS,sessions);// } getProperties(SESSIONS,SESSIONS,true,"",true); }
private void loadSessions() {// FileInputStream in = null;// Properties sessions = new Properties();//// try {// in = new FileInputStream(settingssDirectory() + SESSIONS);// sessions.load(in);//// }// catch (FileNotFoundException fnfe) {// System.out.println(" Information Message: " + fnfe.getMessage()// + ". Default sessions file will"// + " be created for first time use.");// }// catch (IOException ioe) {System.out.println(ioe.getMessage());}//// if (sessions != null) {//// registry.put(SESSIONS,sessions);// } setProperties(SESSIONS,SESSIONS,"------ Sessions --------",true); }
2,517
private void loadSettings() { FileInputStream in = null; settings = new Properties(); try { in = new FileInputStream("tn5250jsettings.cfg"); settings.load(in); } catch (FileNotFoundException fnfe) { System.out.println(" Information Message: " + fnfe.getMessage() + ". The file tn5250jsettings.cfg will" + " be created for first time use."); checkLegacy(); saveSettings(); } catch (IOException ioe) { System.out.println("IO Exception accessing File tn5250jsettings.cfg for the following reason : " + ioe.getMessage()); } catch (SecurityException se) { System.out.println("Security Exception for file tn5250jsettings.cfg. This file can not be " + "accessed because : " + se.getMessage()); } // we now check to see if the settings directory is a directory. If not then we create it File sd = new File(settings.getProperty("emulator.settingsDirectory")); if (!sd.isDirectory()) sd.mkdirs(); }
private void loadSettings() { FileInputStream in = null; settings = new Properties(); try { in = new FileInputStream(settingsFile); settings.load(in); } catch (FileNotFoundException fnfe) { System.out.println(" Information Message: " + fnfe.getMessage() + ". The file tn5250jsettings.cfg will" + " be created for first time use."); checkLegacy(); saveSettings(); } catch (IOException ioe) { System.out.println("IO Exception accessing File tn5250jsettings.cfg for the following reason : " + ioe.getMessage()); } catch (SecurityException se) { System.out.println("Security Exception for file tn5250jsettings.cfg. This file can not be " + "accessed because : " + se.getMessage()); } // we now check to see if the settings directory is a directory. If not then we create it File sd = new File(settings.getProperty("emulator.settingsDirectory")); if (!sd.isDirectory()) sd.mkdirs(); }
2,518
private void loadSettings() { FileInputStream in = null; settings = new Properties(); try { in = new FileInputStream("tn5250jsettings.cfg"); settings.load(in); } catch (FileNotFoundException fnfe) { System.out.println(" Information Message: " + fnfe.getMessage() + ". The file tn5250jsettings.cfg will" + " be created for first time use."); checkLegacy(); saveSettings(); } catch (IOException ioe) { System.out.println("IO Exception accessing File tn5250jsettings.cfg for the following reason : " + ioe.getMessage()); } catch (SecurityException se) { System.out.println("Security Exception for file tn5250jsettings.cfg. This file can not be " + "accessed because : " + se.getMessage()); } // we now check to see if the settings directory is a directory. If not then we create it File sd = new File(settings.getProperty("emulator.settingsDirectory")); if (!sd.isDirectory()) sd.mkdirs(); }
private void loadSettings() { FileInputStream in = null; settings = new Properties(); try { in = new FileInputStream("tn5250jsettings.cfg"); settings.load(in); } catch (FileNotFoundException fnfe) { System.out.println(" Information Message: " + fnfe.getMessage() + ". The file tn5250jsettings.cfg will" + " be created for first time use."); checkLegacy(); saveSettings(); } catch (IOException ioe) { System.out.println("IO Exception accessing File tn5250jsettings.cfg for the following reason : " + ioe.getMessage()); } catch (SecurityException se) { System.out.println("Security Exception for file tn5250jsettings.cfg. This file can not be " + "accessed because : " + se.getMessage()); } // we now check to see if the settings directory is a directory. If not then we create it File sd = new File(settings.getProperty("emulator.settingsDirectory")); if (!sd.isDirectory()) sd.mkdirs(); }
2,519
private void loadSettings() { FileInputStream in = null; settings = new Properties(); try { in = new FileInputStream("tn5250jsettings.cfg"); settings.load(in); } catch (FileNotFoundException fnfe) { System.out.println(" Information Message: " + fnfe.getMessage() + ". The file tn5250jsettings.cfg will" + " be created for first time use."); checkLegacy(); saveSettings(); } catch (IOException ioe) { System.out.println("IO Exception accessing File tn5250jsettings.cfg for the following reason : " + ioe.getMessage()); } catch (SecurityException se) { System.out.println("Security Exception for file tn5250jsettings.cfg. This file can not be " + "accessed because : " + se.getMessage()); } // we now check to see if the settings directory is a directory. If not then we create it File sd = new File(settings.getProperty("emulator.settingsDirectory")); if (!sd.isDirectory()) sd.mkdirs(); }
private void loadSettings() { FileInputStream in = null; settings = new Properties(); try { in = new FileInputStream("tn5250jsettings.cfg"); settings.load(in); } catch (FileNotFoundException fnfe) { System.out.println(" Information Message: " + fnfe.getMessage() + ". The file tn5250jsettings.cfg will" + " be created for first time use."); checkLegacy(); saveSettings(); } catch (IOException ioe) { System.out.println("IO Exception accessing File " + settingsFile + " for the following reason : " + ioe.getMessage()); } catch (SecurityException se) { System.out.println("Security Exception for file tn5250jsettings.cfg. This file can not be " + "accessed because : " + se.getMessage()); } // we now check to see if the settings directory is a directory. If not then we create it File sd = new File(settings.getProperty("emulator.settingsDirectory")); if (!sd.isDirectory()) sd.mkdirs(); }
2,520
private void loadSettings() { FileInputStream in = null; settings = new Properties(); try { in = new FileInputStream("tn5250jsettings.cfg"); settings.load(in); } catch (FileNotFoundException fnfe) { System.out.println(" Information Message: " + fnfe.getMessage() + ". The file tn5250jsettings.cfg will" + " be created for first time use."); checkLegacy(); saveSettings(); } catch (IOException ioe) { System.out.println("IO Exception accessing File tn5250jsettings.cfg for the following reason : " + ioe.getMessage()); } catch (SecurityException se) { System.out.println("Security Exception for file tn5250jsettings.cfg. This file can not be " + "accessed because : " + se.getMessage()); } // we now check to see if the settings directory is a directory. If not then we create it File sd = new File(settings.getProperty("emulator.settingsDirectory")); if (!sd.isDirectory()) sd.mkdirs(); }
private void loadSettings() { FileInputStream in = null; settings = new Properties(); try { in = new FileInputStream("tn5250jsettings.cfg"); settings.load(in); } catch (FileNotFoundException fnfe) { System.out.println(" Information Message: " + fnfe.getMessage() + ". The file tn5250jsettings.cfg will" + " be created for first time use."); checkLegacy(); saveSettings(); } catch (IOException ioe) { System.out.println("IO Exception accessing File tn5250jsettings.cfg for the following reason : " + ioe.getMessage()); } catch (SecurityException se) { System.out.println("Security Exception for file tn5250jsettings.cfg. This file can not be " + "accessed because : " + se.getMessage()); } // we now check to see if the settings directory is a directory. If not then we create it File sd = new File(settings.getProperty("emulator.settingsDirectory")); if (!sd.isDirectory()) sd.mkdirs(); }
2,521
public void saveSettings() { try { FileOutputStream out = new FileOutputStream("tn5250jsettings.cfg"); settings.store(out,"----------------- tn5250j Global Settings --------------"); } catch (FileNotFoundException fnfe) {} catch (IOException ioe) {} }
public void saveSettings() { try { FileOutputStream out = new FileOutputStream("tn5250jsettings.cfg"); settings.store(out,"----------------- tn5250j Global Settings --------------"); } catch (FileNotFoundException fnfe) {} catch (IOException ioe) {} }
2,522
public void drawString(String text, int x, int y) { System.out.println("drawText():" + text); if(this.font != null) ((JNodeToolkit)Toolkit.getDefaultToolkit()).getFontManager().drawText(this,text,font,x,y); }
public void drawString(String text, int x, int y) { System.out.println("drawText():" + text); if(this.font != null) ((JNodeToolkit)Toolkit.getDefaultToolkit()).getFontManager().drawText(this,text,font,x,y); }
2,523
public cObject get(byte[] key) { synchronized (objects) { return (cObject) objects.get(key); } }
public cObject get(byte[] key) { synchronized (objects) { return (cObject) objects.get(key); } } }
2,524
public cObject get(byte[] key) { synchronized (objects) { return (cObject) objects.get(key); } }
public cObject get(byte[] key) { synchronized (objects) { return (cObject) objects.get(key);
2,525
public void remove(org.omg.CORBA.Object object) { synchronized (objects) { cObject ref = getKey(object); if (ref != null) objects.remove(ref.key); } }
public void remove(org.omg.CORBA.Object object) { synchronized (objects) { cObject ref = getKey(object); if (ref != null) objects.remove(ref.key); } }
2,526
public void remove(org.omg.CORBA.Object object) { synchronized (objects) { cObject ref = getKey(object); if (ref != null) objects.remove(ref.key); } }
public void remove(org.omg.CORBA.Object object) { synchronized (objects) { cObject ref = getKey(object); if (ref != null) objects.remove(ref.key);
2,527
public static Constant getInstance(Object value) { return new ReferenceConstant(value); }
public static Constant getInstance(Object value) { return new ReferenceConstant(value); }
2,528
public boolean containsKey(Integer key) { boolean result = super.containsKey(key); if(result) Ext2Debugger.debug("CACHE HIT, size:"+size(),4); else Ext2Debugger.debug("CACHE MISS",4); return result; }
public boolean containsKey(Integer key) { boolean result = super.containsKey(key); if(result) log.debug("CACHE HIT, size:"+size()); else Ext2Debugger.debug("CACHE MISS",4); return result; }
2,529
public boolean containsKey(Integer key) { boolean result = super.containsKey(key); if(result) Ext2Debugger.debug("CACHE HIT, size:"+size(),4); else Ext2Debugger.debug("CACHE MISS",4); return result; }
public boolean containsKey(Integer key) { boolean result = super.containsKey(key); if(result) Ext2Debugger.debug("CACHE HIT, size:"+size(),4); else log.debug("CACHE MISS"); return result; }
2,530