tn5250j/src/org/tn5250j Gui5250.java,1.51,1.52
[email protected] Sun, 30 Nov 2003 03:21:59 -0800
Newsgroups
gmane.comp.java.tn5250j.cvs
Message-ID
<[email protected] >
Update of /cvsroot/tn5250j/tn5250j/src/org/tn5250j
In directory sc8-pr-cvs1:/tmp/cvs-serv24925
Modified Files:
Gui5250.java
Log Message:
Take out unused method code and added right click on macro option for delete
Index: Gui5250.java
===================================================================
RCS file: /cvsroot/tn5250j/tn5250j/src/org/tn5250j/Gui5250.java,v
retrieving revision 1.51
retrieving revision 1.52
diff -C2 -d -r1.51 -r1.52
*** Gui5250.java 30 Nov 2003 11:11:07 -0000 1.51
--- Gui5250.java 30 Nov 2003 11:21:57 -0000 1.52
***************
*** 373,377 ****
Object obj = actionevent.getSource();
String ac = ((JButton)obj).getActionCommand();
- // System.out.println("We got a key pad " + ac);
if (ac.equals("NXTPAD"))
--- 373,376 ----
***************
*** 594,1073 ****
new SessionPopup((Session)this,me);
- // JMenuItem menuItem;
- // Action action;
- // popup = new JPopupMenu();
- // final Gui5250 g = this;
- // JMenuItem mi;
- //
- // final int pos = screen.getPosFromView(me.getX(),me.getY());
- //
- // if (!rubberband.isAreaSelected() && screen.isInField(pos,false) ) {
- // action = new AbstractAction(LangTool.getString("popup.copy")) {
- // public void actionPerformed(ActionEvent e) {
- // screen.copyField(pos);
- // getFocusForMe();
- // }
- // };
- //
- // popup.add(createMenuItem(action,MNEMONIC_COPY));
- //
- //
- // action = new AbstractAction(LangTool.getString("popup.paste")) {
- // public void actionPerformed(ActionEvent e) {
- // screen.pasteMe(false);
- // getFocusForMe();
- // }
- // };
- // popup.add(createMenuItem(action,MNEMONIC_PASTE));
- //
- // action = new AbstractAction(LangTool.getString("popup.pasteSpecial")) {
- // public void actionPerformed(ActionEvent e) {
- // screen.pasteMe(true);
- // getFocusForMe();
- // }
- // };
- // popup.add(action);
- //
- // popup.addSeparator();
- // }
- // else {
- //
- // action = new AbstractAction(LangTool.getString("popup.copy")) {
- // public void actionPerformed(ActionEvent e) {
- // screen.copyMe();
- // getFocusForMe();
- // }
- // };
- //
- // popup.add(createMenuItem(action,MNEMONIC_COPY));
- //
- // action = new AbstractAction(LangTool.getString("popup.paste")) {
- // public void actionPerformed(ActionEvent e) {
- // screen.sendKeys(MNEMONIC_PASTE);
- // getFocusForMe();
- // }
- // };
- // popup.add(createMenuItem(action,MNEMONIC_PASTE));
- //
- // action = new AbstractAction(LangTool.getString("popup.pasteSpecial")) {
- // public void actionPerformed(ActionEvent e) {
- // screen.pasteMe(true);
- // getFocusForMe();
- // }
- // };
- // popup.add(action);
- //
- // Rectangle workR = new Rectangle();
- // if (rubberband.isAreaSelected()) {
- //
- // // get the bounded area of the selection
- // screen.getBoundingArea(workR);
- //
- // popup.addSeparator();
- //
- // menuItem = new JMenuItem(LangTool.getString("popup.selectedColumns")
- // + " " + workR.width);
- // menuItem.setArmed(false);
- // popup.add(menuItem);
- //
- // menuItem = new JMenuItem(LangTool.getString("popup.selectedRows")
- // + " " + workR.height);
- // menuItem.setArmed(false);
- // popup.add(menuItem);
- //
- // JMenu sumMenu = new JMenu(LangTool.getString("popup.calc"));
- // popup.add(sumMenu);
- //
- // action = new AbstractAction(LangTool.getString("popup.calcGroupCD")) {
- // public void actionPerformed(ActionEvent e) {
- // sumArea(true);
- // }
- // };
- // sumMenu.add(action);
- //
- // action = new AbstractAction(LangTool.getString("popup.calcGroupDC")) {
- // public void actionPerformed(ActionEvent e) {
- // sumArea(false);
- // }
- // };
- // sumMenu.add(action);
- //
- // }
- //
- // popup.addSeparator();
- //
- // action = new AbstractAction(LangTool.getString("popup.printScreen")) {
- // public void actionPerformed(ActionEvent e) {
- // screen.printMe();
- // getFocusForMe();
- // }
- // };
- // popup.add(createMenuItem(action,MNEMONIC_PRINT_SCREEN));
- //
- // popup.addSeparator();
- //
- // JMenu kbMenu = new JMenu(LangTool.getString("popup.keyboard"));
- //
- // popup.add(kbMenu);
- //
- // action = new AbstractAction(LangTool.getString("popup.mapKeys")) {
- // public void actionPerformed(ActionEvent e) {
- //
- // mapMeKeys();
- // }
- // };
- // kbMenu.add(action);
- //
- // kbMenu.addSeparator();
- //
- // action = new AbstractAction(LangTool.getString("key.[attn]")) {
- // public void actionPerformed(ActionEvent e) {
- // screen.sendKeys("[attn]");
- // }
- // };
- // kbMenu.add(createMenuItem(action,MNEMONIC_ATTN));
- //
- // action = new AbstractAction(LangTool.getString("key.[reset]")) {
- // public void actionPerformed(ActionEvent e) {
- // screen.sendKeys("[reset]");
- // }
- // };
- // kbMenu.add(createMenuItem(action,MNEMONIC_RESET));
- //
- // action = new AbstractAction(LangTool.getString("key.[sysreq]")) {
- // public void actionPerformed(ActionEvent e) {
- // screen.sendKeys("[sysreq]");
- // }
- // };
- // kbMenu.add(createMenuItem(action,MNEMONIC_SYSREQ));
- //
- // if (screen.isMessageWait()) {
- // action = new AbstractAction(LangTool.getString("popup.displayMessages")) {
- // public void actionPerformed(ActionEvent e) {
- // vt.systemRequest('4');
- // }
- // };
- //
- // kbMenu.add(createMenuItem(action,MNEMONIC_DISP_MESSAGES));
- // }
- //
- // kbMenu.addSeparator();
- //
- // action = new AbstractAction(LangTool.getString("key.[dupfield]")) {
- // public void actionPerformed(ActionEvent e) {
- // screen.sendKeys("[dupfield]");
- // }
- // };
- // kbMenu.add(createMenuItem(action,MNEMONIC_DUP_FIELD));
- //
- // action = new AbstractAction(LangTool.getString("key.[help]")) {
- // public void actionPerformed(ActionEvent e) {
- // screen.sendKeys("[help]");
- // }
- // };
- // kbMenu.add(createMenuItem(action,MNEMONIC_HELP));
- //
- // action = new AbstractAction(LangTool.getString("key.[eraseeof]")) {
- // public void actionPerformed(ActionEvent e) {
- // screen.sendKeys("[eraseeof]");
- // }
- // };
- // kbMenu.add(createMenuItem(action,MNEMONIC_ERASE_EOF));
- //
- // action = new AbstractAction(LangTool.getString("key.[field+]")) {
- // public void actionPerformed(ActionEvent e) {
- // screen.sendKeys("[field+]");
- // }
- // };
- // kbMenu.add(createMenuItem(action,MNEMONIC_FIELD_PLUS));
- //
- //
- // action = new AbstractAction(LangTool.getString("key.[field-]")) {
- // public void actionPerformed(ActionEvent e) {
- // screen.sendKeys("[field-]");
- // }
- // };
- // kbMenu.add(createMenuItem(action,MNEMONIC_FIELD_MINUS));
- //
- //
- // action = new AbstractAction(LangTool.getString("key.[newline]")) {
- // public void actionPerformed(ActionEvent e) {
- // screen.sendKeys("[newline]");
- // }
- // };
- // kbMenu.add(createMenuItem(action,MNEMONIC_NEW_LINE));
- //
- //
- // action = new AbstractAction(LangTool.getString("popup.hostPrint")) {
- // public void actionPerformed(ActionEvent e) {
- // vt.hostPrint(1);
- // }
- // };
- // kbMenu.add(createMenuItem(action,MNEMONIC_PRINT));
- //
- // createShortCutItems(kbMenu);
- //
- // if (screen.isMessageWait()) {
- // action = new AbstractAction(LangTool.getString("popup.displayMessages")) {
- // public void actionPerformed(ActionEvent e) {
- // vt.systemRequest('4');
- // }
- // };
- // popup.add(createMenuItem(action,MNEMONIC_DISP_MESSAGES));
- // }
- //
- // popup.addSeparator();
- //
- // action = new AbstractAction(LangTool.getString("popup.hexMap")) {
- // public void actionPerformed(ActionEvent e) {
- // showHexMap();
- // getFocusForMe();
- // }
- // };
- // popup.add(createMenuItem(action,""));
- //
- // action = new AbstractAction(LangTool.getString("popup.mapKeys")) {
- // public void actionPerformed(ActionEvent e) {
- //
- // mapMeKeys();
- // getFocusForMe();
- // }
- // };
- // popup.add(createMenuItem(action,""));
- //
- // action = new AbstractAction(LangTool.getString("popup.settings")) {
- // public void actionPerformed(ActionEvent e) {
- // doAttributes();
- // getFocusForMe();
- // }
- // };
- // popup.add(createMenuItem(action,MNEMONIC_DISP_ATTRIBUTES));
- //
- //
- // popup.addSeparator();
- //
- // if (isMacroRunning()) {
- // action = new AbstractAction(LangTool.getString("popup.stopScript")) {
- // public void actionPerformed(ActionEvent e) {
- // setStopMacroRequested();
- // }
- // };
- // popup.add(action);
- // }
- // else {
- //
- // JMenu macMenu = new JMenu(LangTool.getString("popup.macros"));
- //
- // if (keyHandler.isRecording()) {
- // action = new AbstractAction(LangTool.getString("popup.stop")) {
- // public void actionPerformed(ActionEvent e) {
- // stopRecordingMe();
- // getFocusForMe();
- // }
- // };
- //
- // }
- // else {
- // action = new AbstractAction(LangTool.getString("popup.record")) {
- // public void actionPerformed(ActionEvent e) {
- // startRecordingMe();
- // getFocusForMe();
- //
- // }
- // };
- // }
- // macMenu.add(action);
- // if (Macronizer.isMacrosExist()) {
- // // this will add a sorted list of the macros to the macro menu
- // addMacros(macMenu);
- // }
- // popup.add(macMenu);
- // }
- //
- // popup.addSeparator();
- //
- // JMenu xtfrMenu = new JMenu(LangTool.getString("popup.export"));
- //
- // action = new AbstractAction(LangTool.getString("popup.xtfrFile")) {
- // public void actionPerformed(ActionEvent e) {
- // doMeTransfer();
- // getFocusForMe();
- // }
- // };
- //
- // xtfrMenu.add(createMenuItem(action,MNEMONIC_FILE_TRANSFER));
- //
- // action = new AbstractAction(LangTool.getString("popup.xtfrSpool")) {
- // public void actionPerformed(ActionEvent e) {
- // doMeSpool();
- // getFocusForMe();
- // }
- // };
- //
- // xtfrMenu.add(action);
- //
- // popup.add(xtfrMenu);
- //
- // JMenu sendMenu = new JMenu(LangTool.getString("popup.send"));
- // popup.add(sendMenu);
- //
- //
- // action = new AbstractAction(LangTool.getString("popup.email")) {
- // public void actionPerformed(ActionEvent e) {
- // sendScreenEMail();
- // getFocusForMe();
- // }
- // };
- //
- // sendMenu.add(createMenuItem(action,MNEMONIC_E_MAIL));
- //
- // action = new AbstractAction(LangTool.getString("popup.file")) {
- // public void actionPerformed(ActionEvent e) {
- // sendMeToFile();
- // }
- // };
- //
- // sendMenu.add(action);
- //
- // action = new AbstractAction(LangTool.getString("popup.toImage")) {
- // public void actionPerformed(ActionEvent e) {
- // sendMeToImageFile();
- // }
- // };
- //
- // sendMenu.add(action);
- //
- // popup.addSeparator();
- //
- // }
- //
- // action = new AbstractAction(LangTool.getString("popup.connections")) {
- // public void actionPerformed(ActionEvent e) {
- // doConnections();
- // }
- // };
- //
- // popup.add(createMenuItem(action,MNEMONIC_OPEN_NEW));
- //
- // popup.addSeparator();
- //
- // if (vt.isConnected()) {
- // action = new AbstractAction(LangTool.getString("popup.disconnect")) {
- // public void actionPerformed(ActionEvent e) {
- // changeConnection();
- // getFocusForMe();
- // }
- // };
- // }
- // else {
- //
- // action = new AbstractAction(LangTool.getString("popup.connect")) {
- // public void actionPerformed(ActionEvent e) {
- // changeConnection();
- // getFocusForMe();
- // }
- // };
- //
- //
- // }
- // popup.add(createMenuItem(action,MNEMONIC_TOGGLE_CONNECTION));
- //
- // action = new AbstractAction(LangTool.getString("popup.close")) {
- // public void actionPerformed(ActionEvent e) {
- // closeSession();
- // }
- // };
- //
- // popup.add(createMenuItem(action,MNEMONIC_CLOSE));
- //
- // GUIGraphicsUtils.positionPopup(me.getComponent(),popup,
- // me.getX(),me.getY());
}
- // private void addMacros(JMenu menu) {
- //
- // LoadMacroMenu.loadMacros((Session)this,macros,menu);
- // }
- //
- // private JMenuItem createMenuItem(Action action, String accelKey) {
- // JMenuItem mi;
- //
- // mi =new JMenuItem();
- // mi.setAction(action);
- // if (keyHandler.isKeyStrokeDefined(accelKey))
- // mi.setAccelerator(keyHandler.getKeyStroke(accelKey));
- // else {
- //
- // InputMap map = getInputMap();
- // KeyStroke[] allKeys = map.allKeys();
- // for (int x = 0; x < allKeys.length; x++) {
- //
- // if (((String)map.get(allKeys[x])).equals(accelKey)) {
- // mi.setAccelerator(allKeys[x]);
- // break;
- // }
- // }
- //
- // }
- //
- // final Gui5250 ji = this;
- // mi.addMouseListener(new MouseAdapter() {
- // public void mouseReleased(MouseEvent e) {
- // if (SwingUtilities.isRightMouseButton(e)) {
- // JPopupMenu j = new JPopupMenu("test");
- // j.add(new JMenuItem("Delete"));
- //
- // MouseEvent et = SwingUtilities.convertMouseEvent((JMenuItem)e.getSource(),e,ji);
- // GUIGraphicsUtils.positionPopup(ji,j,
- // et.getX(),et.getY());
- //
- // }
- // }
- //
- // public void mousePressed(MouseEvent e) {
- // if (SwingUtilities.isRightMouseButton(e)) {
- // JPopupMenu j = new JPopupMenu("test");
- // j.add(new JMenuItem("Delete"));
- // MouseEvent et = SwingUtilities.convertMouseEvent((JMenuItem)e.getSource(),e,ji);
- // GUIGraphicsUtils.positionPopup(ji,j,
- // et.getX(),et.getY());
- // }
- // }
- // public void mouseClicked(MouseEvent e) {
- // if (SwingUtilities.isRightMouseButton(e)) {
- // JPopupMenu j = new JPopupMenu("test");
- // j.add(new JMenuItem("Delete"));
- // MouseEvent et = SwingUtilities.convertMouseEvent((JMenuItem)e.getSource(),e,ji);
- // GUIGraphicsUtils.positionPopup(ji,j,
- // et.getX(),et.getY());
- // }
- // }
- // });
- //
- // return mi;
- // }
- //
- // private void createShortCutItems(JMenu menu) {
- //
- // JMenuItem mi;
- // JMenu sm = new JMenu(LangTool.getString("popup.shortCuts"));
- // menu.addSeparator();
- // menu.add(sm);
- //
- // InputMap map = getInputMap();
- // KeyStroke[] allKeys = map.allKeys();
- // ActionMap aMap = getActionMap();
- //
- // for (int x = 0; x < allKeys.length; x++) {
- //
- // mi =new JMenuItem();
- // Action a = aMap.get((String)map.get(allKeys[x]));
- // mi.setAction(a);
- // mi.setText(LangTool.getString("key." + (String)map.get(allKeys[x])));
- // mi.setAccelerator(allKeys[x]);
- // sm.add(mi);
- // }
- // }
protected void doConnections() {
--- 593,599 ----
***************
*** 1076,1086 ****
}
- // public void doMeTransfer() {
- //
- // XTFRFile xtrf = new XTFRFile((JFrame)SwingUtilities.getRoot(this),
- // vt,(Session)this);
- //
- // }
- //
public void doMeSpool() {
--- 602,605 ----
***************
*** 1098,1151 ****
}
- //
- // private void sumArea(boolean which) {
- //
- //
- // Vector sumVector = screen.sumThem(which);
- // Iterator l = sumVector.iterator();
- // double sum = 0.0;
- // double inter = 0.0;
- // while (l.hasNext()) {
- //
- // inter = 0.0;
- // try {
- // inter = ((Double)l.next()).doubleValue();
- // }
- // catch (Exception e) {
- // System.out.println(e.getMessage());
- // }
- // System.out.println(inter);
- //
- // sum += inter;
- //
- // }
- // System.out.println("Vector sum " + sum);
- // sumVector = null;
- // l = null;
- //
- // // obtain the decimal format for parsing
- // DecimalFormat df =
- // (DecimalFormat)NumberFormat.getInstance() ;
- //
- // DecimalFormatSymbols dfs = df.getDecimalFormatSymbols();
- //
- // if (which) {
- // dfs.setDecimalSeparator('.');
- // dfs.setGroupingSeparator(',');
- // }
- // else {
- // dfs.setDecimalSeparator(',');
- // dfs.setGroupingSeparator('.');
- // }
- //
- // df.setDecimalFormatSymbols(dfs);
- // df.setMinimumFractionDigits(6);
- //
- // JOptionPane.showMessageDialog(null,
- // df.format(sum),
- // LangTool.getString("popup.calc"),
- // JOptionPane.INFORMATION_MESSAGE);
- //
- // }
protected void closeMe() {
--- 617,620 ----
***************
*** 1167,1184 ****
}
- // private void mapMeKeys() {
- // KeyConfigure kc;
- //
- // Frame parent = (JFrame)SwingUtilities.getRoot(this);
- //
- // if (Macronizer.isMacrosExist()) {
- // String[] macrosList = Macronizer.getMacroList();
- // kc = new KeyConfigure(parent,macrosList,vt.getCodePage());
- // }
- // else
- // kc = new KeyConfigure(parent,null,vt.getCodePage());
- //
- // }
-
protected void stopRecordingMe() {
if (keyHandler.getRecordBuffer().length() > 0) {
--- 636,639 ----
***************
*** 1206,1307 ****
}
- // public void runScript () {
- //
- // Macronizer.showRunScriptDialog((Session)this);
- // getFocusForMe();
- //
- // }
- //
- // private void showHexMap() {
- //
- // JPanel srp = new JPanel();
- // srp.setLayout(new BorderLayout());
- // DefaultListModel listModel = new DefaultListModel();
- // StringBuffer sb = new StringBuffer();
- //
- // // we will use a collator here so that we can take advantage of the locales
- // Collator collator = Collator.getInstance();
- // CollationKey key = null;
- //
- // Set set = new TreeSet();
- // for (int x =0;x < 256; x++) {
- // char c = vt.ebcdic2uni(x);
- //// char ac = vt.getASCIIChar(x);
- // char ac = vt.ebcdic2uni(x);
- // if (!Character.isISOControl(ac)) {
- // sb.setLength(0);
- // if (Integer.toHexString(ac).length() == 1){
- // sb.append("0x0" + Integer.toHexString(ac).toUpperCase());
- // }
- // else {
- // sb.append("0x" + Integer.toHexString(ac).toUpperCase());
- // }
- //
- // sb.append(" - " + c);
- // key = collator.getCollationKey(sb.toString());
- //
- // set.add(key);
- // }
- // }
- //
- // Iterator iterator = set.iterator();
- // while (iterator.hasNext()) {
- // CollationKey keyc = (CollationKey)iterator.next();
- // listModel.addElement(keyc.getSourceString());
- // }
- //
- // //Create the list and put it in a scroll pane
- // JList hm = new JList(listModel);
- //
- // hm.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
- // hm.setSelectedIndex(0);
- // JScrollPane listScrollPane = new JScrollPane(hm);
- // listScrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
- // listScrollPane.setSize(40,100);
- // srp.add(listScrollPane,BorderLayout.CENTER);
- // Object[] message = new Object[1];
- // message[0] = srp;
- // String[] options = {LangTool.getString("hm.optInsert"),
- // LangTool.getString("hm.optCancel")};
- //
- // int result = 0;
- //
- // JFrame parent = (JFrame)SwingUtilities.getRoot(this);
- //
- // result = JOptionPane.showOptionDialog(
- // parent, // the parent that the dialog blocks
- // message, // the dialog message array
- // LangTool.getString("hm.title"), // the title of the dialog window
- // JOptionPane.DEFAULT_OPTION, // option type
- // JOptionPane.INFORMATION_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: // Insert character
- // String k = "";
- // if (((String)hm.getSelectedValue()).length() > 8)
- // k += ((String)hm.getSelectedValue()).charAt(9);
- // else
- // k += ((String)hm.getSelectedValue()).charAt(7);
- // screen.sendKeys(k);
- // break;
- // case 1: // Cancel
- //// System.out.println("Cancel");
- // break;
- // default:
- // break;
- // }
- //
- //
- // }
- //
- // public void printMe() {
- //
- // screen.printMe();
- // getFocusForMe();
- // }
public void resizeMe() {
--- 661,664 ----
-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive? Does it
help you create better code? SHARE THE LOVE, and help us help
YOU! Click Here: http://sourceforge.net/donate/