Revision: 20358
          http://sourceforge.net/p/jmol/code/20358
Author:   hansonr
Date:     2015-03-05 13:33:56 +0000 (Thu, 05 Mar 2015)
Log Message:
-----------
Jmol.___JmolVersion="14.3.12_2015.03.06"

new feature: NBO command with no arguments starts NBO panel (Java application 
only)

Modified Paths:
--------------
    trunk/Jmol/src/org/jmol/scriptext/IsoExt.java
    trunk/Jmol/src/org/jmol/viewer/Jmol.properties
    trunk/Jmol/src/org/openscience/jmol/app/jmolpanel/JmolPanel.java
    trunk/Jmol/src/org/openscience/jmol/app/jmolpanel/NBODialog.java
    trunk/Jmol/src/org/openscience/jmol/app/jmolpanel/StatusListener.java

Modified: trunk/Jmol/src/org/jmol/scriptext/IsoExt.java
===================================================================
--- trunk/Jmol/src/org/jmol/scriptext/IsoExt.java       2015-03-05 04:42:49 UTC 
(rev 20357)
+++ trunk/Jmol/src/org/jmol/scriptext/IsoExt.java       2015-03-05 13:33:56 UTC 
(rev 20358)
@@ -725,6 +725,16 @@
     BS bsModels = vwr.getVisibleFramesBitSet();
     Lst<Object[]> propertyList = new Lst<Object[]>();
     int i0 = 1;
+    if (tokAt(0) == T.nbo && e.slen == 1) {
+      // NBO command by itself starts the NBO Server Interface panel
+      if (!chk) {
+        Map<String, Object> htParams = new Hashtable<String, Object>();
+        htParams.put("service", "nbo");
+        htParams.put("action", "showPanel");
+        vwr.sm.processService(htParams);
+      }
+      return;
+    }
     if (tokAt(1) == T.model || tokAt(1) == T.frame) {
       i0 = eval.modelNumberParameter(2);
       if (i0 < 0)

Modified: trunk/Jmol/src/org/jmol/viewer/Jmol.properties
===================================================================
--- trunk/Jmol/src/org/jmol/viewer/Jmol.properties      2015-03-05 04:42:49 UTC 
(rev 20357)
+++ trunk/Jmol/src/org/jmol/viewer/Jmol.properties      2015-03-05 13:33:56 UTC 
(rev 20358)
@@ -13,8 +13,11 @@
 #  important for the JavaScript version of Jmol.
 
 TODO: remove HTML5 dependency on synchronous file loading (check SCRIPT 
command for problems)
+Jmol.___JmolVersion="14.3.12_2015.03.06"
 
-Jmol.___JmolVersion="14.3.12_2015.03.05b"
+new feature: NBO command with no arguments starts NBO panel (Java application 
only)
+
+JmolVersion="14.3.12_2015.03.05b"
 synchronized with 14.2.13_2015.03.05
 
 bug fix: reading legacy mapped plane (2ptn-molecular_slice1.jvxl.txt)  crashes 
Jmol

Modified: trunk/Jmol/src/org/openscience/jmol/app/jmolpanel/JmolPanel.java
===================================================================
--- trunk/Jmol/src/org/openscience/jmol/app/jmolpanel/JmolPanel.java    
2015-03-05 04:42:49 UTC (rev 20357)
+++ trunk/Jmol/src/org/openscience/jmol/app/jmolpanel/JmolPanel.java    
2015-03-05 13:33:56 UTC (rev 20358)
@@ -1094,11 +1094,7 @@
     
     @Override
     public void actionPerformed(ActionEvent e) {
-      getNBOService();
-      if (nboDialog == null)
-        nboDialog = new NBODialog(frame, vwr, nboService);
-      else
-        nboDialog.setVisible(true);
+      startNBO();
     }
   }
     
@@ -1121,6 +1117,14 @@
     newFrame.setVisible(true);
   }
   
+  void startNBO() {
+    getNBOService();
+    if (nboDialog == null)
+      nboDialog = new NBODialog(frame, vwr, nboService);
+    else
+      nboDialog.setVisible(true);
+  }
+
   class UguideAction extends AbstractAction {
 
     public UguideAction() {

Modified: trunk/Jmol/src/org/openscience/jmol/app/jmolpanel/NBODialog.java
===================================================================
--- trunk/Jmol/src/org/openscience/jmol/app/jmolpanel/NBODialog.java    
2015-03-05 04:42:49 UTC (rev 20357)
+++ trunk/Jmol/src/org/openscience/jmol/app/jmolpanel/NBODialog.java    
2015-03-05 13:33:56 UTC (rev 20358)
@@ -42,10 +42,11 @@
 import javax.swing.JDialog;
 import javax.swing.JFileChooser;
 import javax.swing.JFrame;
+import javax.swing.JLabel;
 import javax.swing.JPanel;
 import javax.swing.JScrollPane;
 import javax.swing.JSplitPane;
-import javax.swing.JTabbedPane;
+//import javax.swing.JTabbedPane;
 import javax.swing.JTextField;
 import javax.swing.JTextPane;
 import javax.swing.SwingUtilities;
@@ -58,6 +59,9 @@
 import java.util.Map;
 /**
  * A dialog for interacting with NBO-Server (experimental)
+ * 
+ * Originally had various tabs, but this is simpler. 
+ * 
  */
 public class NBODialog extends JDialog implements ChangeListener {
 
@@ -75,20 +79,20 @@
 
   protected JScrollPane editPane2;
 
-  private JTabbedPane inputTabs;
+//  private JTabbedPane inputTabs;
 
-  private Component modelPanel;
+  //private Component modelPanel;
+  //private Component rawPanel;
+  //private Component viewPanel;
+  //private Component runPanel;
+  private JTextField nboInput;
 
-  private Component rawPanel;
-
-  private Component viewPanel;
-
-  private Component runPanel;
-
-  private JTextField modelField, rawField, viewField, runField;
+//  private JTextField modelField, rawField, viewField, runField;
   
   private NBOService nboService;
 
+  private boolean haveService;
+
   /**
    * Creates a dialog for getting info related to output frames in nbo format.
    * 
@@ -101,83 +105,90 @@
    */
   public NBODialog(JFrame f, Viewer vwr, NBOService nboService) {
 
-    super(f, GT._("NBO-Server Interface Setup"), false);
+    super(f, GT._("NBO Server Interface"), false);
     this.vwr = vwr;
     this.nboService = nboService;
     nboService.nboDialog = this;
     JPanel container = new JPanel();
-    container.setPreferredSize(new Dimension(700, 300));
-    container.setLayout(new BoxLayout(container, BoxLayout.Y_AXIS));
-    JPanel leftPanel = buildLeftPanel();
+    container.setPreferredSize(new Dimension(700, 500));
+    //container.setLayout(new BoxLayout(container, BoxLayout.Y_AXIS));
+    container.setLayout(new BorderLayout());
+    //JPanel leftPanel = buildLeftPanel();
     JPanel rightPanel = buildRightPanel();
-    JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,
-        leftPanel, rightPanel);
-    splitPane.setOneTouchExpandable(true);
-    JPanel splitPanel = new JPanel(new BorderLayout());
-    splitPanel.add(splitPane, BorderLayout.CENTER);
+    //JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,
+    //    leftPanel, rightPanel);
+    //splitPane.setOneTouchExpandable(true);
+    //JPanel splitPanel = new JPanel(new BorderLayout());
+    //splitPanel.add(splitPane, BorderLayout.CENTER);
 
     JPanel filePanel = buildFilePanel();
-    JPanel buttonPanel = buildButtonPanel();
+    //JPanel buttonPanel = buildButtonPanel();
+    JPanel top = new JPanel();
+    top.setLayout(new BorderLayout());
+    top.add(filePanel, BorderLayout.NORTH);
+    //top.add(buttonPanel, BorderLayout.SOUTH);
 
-    JPanel gluePanel = new JPanel(new BorderLayout());
+//    JPanel gluePanel = new JPanel(new BorderLayout());
 //    gluePanel.add(Box.createGlue(), BorderLayout.NORTH);
-    gluePanel.add(filePanel, BorderLayout.SOUTH);
+//    gluePanel.add(filePanel, BorderLayout.SOUTH);
     //container.add(gluePanel);
-    container.add(filePanel);
-    container.add(buttonPanel);
-    container.add(Box.createGlue());
-    container.add(splitPanel);
+    container.add(top, BorderLayout.NORTH);
+    //container.add(Box.createGlue());
+    //container.add(splitPanel);
+    container.add(rightPanel, BorderLayout.CENTER);
+    //container.add(buttonPanel);
     getContentPane().add(container);
-
     pack();
     centerDialog();
-    getPathHistory();
     setVisible(true);
-    splitPane.setDividerLocation(0.5);
+    if (haveService)
+      connectPressed();
+    //splitPane.setDividerLocation(0.5);
   }
 
-  private JPanel buildButtonPanel() {
-    
-    JPanel buttonPanel = new JPanel();
-    buttonPanel.setLayout(new FlowLayout(FlowLayout.RIGHT));
+//  private JPanel buildButtonPanel() {
+//    
+//    JPanel buttonPanel = new JPanel();
+//    buttonPanel.setLayout(new FlowLayout(FlowLayout.RIGHT));
+//
+//    //GUI for panel with go, cancel and stop (etc) buttons
+//    Box buttonBox = Box.createHorizontalBox();
+//    buttonBox.add(Box.createGlue());
+//    
+//    JButton b = new JButton("Connect");
+//    b.addActionListener(new ActionListener() {
+//      @Override
+//      public void actionPerformed(ActionEvent e) {
+//        connectPressed();
+//      }
+//    });
+//    buttonBox.add(b);
+//
+//    b = new JButton("Clear");
+//    b.addActionListener(new ActionListener() {
+//      @Override
+//      public void actionPerformed(ActionEvent e) {
+//        clearPressed();
+//      }
+//    });
+//    buttonBox.add(b);
+//
+//    b = new JButton("Close");
+//    b.addActionListener(new ActionListener() {
+//      @Override
+//      public void actionPerformed(ActionEvent e) {
+//        closePressed();
+//      }
+//    });
+//    buttonBox.add(b);
+//    buttonPanel.add(buttonBox);
+//    return buttonPanel;
+//  }
 
-    //GUI for panel with go, cancel and stop (etc) buttons
-    Box buttonBox = Box.createHorizontalBox();
-    buttonBox.add(Box.createGlue());
-    
-    JButton b = new JButton("Connect");
-    b.addActionListener(new ActionListener() {
-      @Override
-      public void actionPerformed(ActionEvent e) {
-        connectPressed();
-      }
-    });
-    buttonBox.add(b);
-
-    b = new JButton("Clear");
-    b.addActionListener(new ActionListener() {
-      @Override
-      public void actionPerformed(ActionEvent e) {
-        clearPressed();
-      }
-    });
-    buttonBox.add(b);
-
-    b = new JButton("Close");
-    b.addActionListener(new ActionListener() {
-      @Override
-      public void actionPerformed(ActionEvent e) {
-        closePressed();
-      }
-    });
-    buttonBox.add(b);
-    buttonPanel.add(buttonBox);
-    return buttonPanel;
-  }
-
   private JPanel buildFilePanel() {
     
     JPanel filePanel = new JPanel(new BorderLayout());
+    filePanel.setBorder(new TitledBorder("Location of the NBO-Server 
Executable"));
 
     
     //GUI for working path selection
@@ -199,141 +210,177 @@
 //    filePanel.add(workingPathBox, BorderLayout.NORTH);
 
     //GUI for NBO path selection
-    Box nboPathBox = Box.createHorizontalBox();
-    nboPathBox.setBorder(new TitledBorder("Location of the NBO-Server 
Executable"));
+    Box box = Box.createHorizontalBox();
     serverPathLabel = new JTextField("");
     serverPathLabel.setEditable(false);
     serverPathLabel.setBorder(null);
-    nboPathBox.add(serverPathLabel);
+    serverPathLabel.setText(nboService.serverPath);
+    haveService = (serverPathLabel.getText().length() > 0);
+    box.add(serverPathLabel);
+    box.add(new JLabel("  "));
     nboPathButton = new JButton("Browse...");
     nboPathButton.addActionListener(new ActionListener() {
-
       @Override
       public void actionPerformed(ActionEvent e) {
         showNBOPathDialog();
       }
     });
-    nboPathBox.add(nboPathButton);
-    filePanel.add(nboPathBox, BorderLayout.NORTH);
+    box.add(nboPathButton);
+    
+    filePanel.add(box, BorderLayout.WEST);
+
+    box = Box.createHorizontalBox();
+
+    JButton b = new JButton("Connect");
+    b.addActionListener(new ActionListener() {
+      @Override
+      public void actionPerformed(ActionEvent e) {
+        connectPressed();
+      }
+    });
+    box.add(b);
+
+    b = new JButton("Clear");
+    b.addActionListener(new ActionListener() {
+      @Override
+      public void actionPerformed(ActionEvent e) {
+        clearPressed();
+      }
+    });
+    box.add(b);
+
+    b = new JButton("Close");
+    b.addActionListener(new ActionListener() {
+      @Override
+      public void actionPerformed(ActionEvent e) {
+        closePressed();
+      }
+    });
+    box.add(b);
+
+    filePanel.add(box, BorderLayout.EAST);
+    
+    
+
     return filePanel;
   }
 
-  private JPanel buildLeftPanel() {
+//  private JPanel buildLeftPanel() {
+//
+//    JPanel showPanel = new JPanel(new BorderLayout());
+//    inputTabs = new JTabbedPane();
+//    inputTabs.addTab("Model", null, modelPanel = getModelPanel());
+//    inputTabs.addTab("Run", null, runPanel = getRunPanel());
+//    inputTabs.addTab("View", null, viewPanel = getViewPanel());
+//    inputTabs.addTab("Raw", null, rawPanel = getRawPanel());
+//    inputTabs.setSelectedComponent(modelPanel);
+//    inputTabs.addChangeListener(this);
+//    showPanel.add(inputTabs,  BorderLayout.CENTER);
+//    return showPanel;
+//  }
 
-    JPanel showPanel = new JPanel(new BorderLayout());
-    inputTabs = new JTabbedPane();
-    inputTabs.addTab("Model", null, modelPanel = getModelPanel());
-    inputTabs.addTab("Run", null, runPanel = getRunPanel());
-    inputTabs.addTab("View", null, viewPanel = getViewPanel());
-    inputTabs.addTab("Raw", null, rawPanel = getRawPanel());
-    inputTabs.setSelectedComponent(modelPanel);
-    inputTabs.addChangeListener(this);
-    showPanel.add(inputTabs,  BorderLayout.CENTER);
-    return showPanel;
-  }
-
   private JPanel buildRightPanel() {
     
-    JPanel editPanel = new JPanel();
-    editPanel.setLayout(new BoxLayout(editPanel, BoxLayout.Y_AXIS));
+    JPanel p = new JPanel();
+    p.setLayout(new BorderLayout());
     
     TitledBorder editTitle =
       BorderFactory.createTitledBorder("NBO Output");
-    editPanel.setBorder(editTitle);  
+    p.setBorder(editTitle);  
     nboOutput = new JTextPane();
     nboOutput.setContentType("text/plain");
-    nboOutput.setFont(new Font("Monospaced", Font.PLAIN, 10));
+    nboOutput.setFont(new Font("Monospaced", Font.PLAIN, 12));
     editPane2 = new JScrollPane();
     editPane2.getViewport().add(nboOutput);
-    editPanel.add(editPane2);
-
-    editPanel.setPreferredSize(new Dimension(500,100));
-    return editPanel;
+    p.add(editPane2, BorderLayout.CENTER);
+    p.add(getRawPanel(), BorderLayout.SOUTH);
+    //p.setPreferredSize(new Dimension(500,100));
+    return p;
   }
 
   @Override
   public void stateChanged(ChangeEvent event) {
-    if (event.getSource() == inputTabs) {
-      tabSwitched();
-    }
+//    if (event.getSource() == inputTabs) {
+//      tabSwitched();
+//    }
   }
 
-  private void tabSwitched() {
-    Component c = inputTabs.getSelectedComponent();
-    modelPanel.setVisible(c == modelPanel);
-    viewPanel.setVisible(c == viewPanel);
-    rawPanel.setVisible(c == rawPanel);
-    runPanel.setVisible(c == runPanel);
-    pack();
-  }
+//  private void tabSwitched() {
+//    Component c = inputTabs.getSelectedComponent();
+//    modelPanel.setVisible(c == modelPanel);
+//    viewPanel.setVisible(c == viewPanel);
+//    rawPanel.setVisible(c == rawPanel);
+//    runPanel.setVisible(c == runPanel);
+//    pack();
+//  }
 
-  private Component getModelPanel() {
-    modelField = new JTextField("sh CH4");
-    modelField.setPreferredSize(new Dimension(100, 10));
-    modelField.addActionListener(new ActionListener() {
-      @Override
-      public void actionPerformed(ActionEvent e) {
-        modelCmd();        
-      }}
-    );
-    JPanel showPanel = new JPanel(new BorderLayout());
-    Box a = Box.createVerticalBox();
-    Box b = Box.createHorizontalBox();
-    b.add(newLabel("Model Command"));
-    b.add(modelField);
-    a.add(b);
-    a.add(Box.createVerticalGlue());
-    showPanel.add(a, BorderLayout.NORTH);
-    //showPanel.add(Box.createGlue(), BorderLayout.CENTER);
-    return showPanel;
-  }
+//  private Component getModelPanel() {
+//    modelField = new JTextField("sh CH4");
+//    modelField.setPreferredSize(new Dimension(100, 10));
+//    modelField.addActionListener(new ActionListener() {
+//      @Override
+//      public void actionPerformed(ActionEvent e) {
+//        modelCmd();        
+//      }}
+//    );
+//    JPanel showPanel = new JPanel(new BorderLayout());
+//    Box a = Box.createVerticalBox();
+//    Box b = Box.createHorizontalBox();
+//    b.add(newLabel("Model Command"));
+//    b.add(modelField);
+//    a.add(b);
+//    a.add(Box.createVerticalGlue());
+//    showPanel.add(a, BorderLayout.NORTH);
+//    //showPanel.add(Box.createGlue(), BorderLayout.CENTER);
+//    return showPanel;
+//  }
+//
+//  private Component getViewPanel() {
+//    viewField = new JTextField("");
+//    viewField.setPreferredSize(new Dimension(100, 10));
+//    viewField.addActionListener(new ActionListener() {
+//      @Override
+//      public void actionPerformed(ActionEvent e) {
+//        viewCmd();        
+//      }}
+//    );
+//    JPanel showPanel = new JPanel(new BorderLayout());
+//    Box a = Box.createVerticalBox();
+//    Box b = Box.createHorizontalBox();
+//    b.add(newLabel("View Command"));
+//    b.add(viewField);
+//    a.add(b);
+//    a.add(Box.createVerticalGlue());
+//    showPanel.add(a, BorderLayout.NORTH);
+//    //showPanel.add(Box.createGlue(), BorderLayout.CENTER);
+//    return showPanel;
+//  }
+//
+//  private Component getRunPanel() {
+//    runField = new JTextField("");
+//    runField.setPreferredSize(new Dimension(100, 10));
+//    runField.addActionListener(new ActionListener() {
+//      @Override
+//      public void actionPerformed(ActionEvent e) {
+//        runCmd();        
+//      }}
+//    );
+//    JPanel showPanel = new JPanel(new BorderLayout());
+//    Box a = Box.createVerticalBox();
+//    Box b = Box.createHorizontalBox();
+//    b.add(newLabel("Run Command"));
+//    b.add(runField);
+//    a.add(b);
+//    a.add(Box.createVerticalGlue());
+//    showPanel.add(a, BorderLayout.NORTH);
+//    //showPanel.add(Box.createGlue(), BorderLayout.CENTER);
+//    return showPanel;
+//  }
 
-  private Component getViewPanel() {
-    viewField = new JTextField("");
-    viewField.setPreferredSize(new Dimension(100, 10));
-    viewField.addActionListener(new ActionListener() {
-      @Override
-      public void actionPerformed(ActionEvent e) {
-        viewCmd();        
-      }}
-    );
-    JPanel showPanel = new JPanel(new BorderLayout());
-    Box a = Box.createVerticalBox();
-    Box b = Box.createHorizontalBox();
-    b.add(newLabel("View Command"));
-    b.add(viewField);
-    a.add(b);
-    a.add(Box.createVerticalGlue());
-    showPanel.add(a, BorderLayout.NORTH);
-    //showPanel.add(Box.createGlue(), BorderLayout.CENTER);
-    return showPanel;
-  }
-
-  private Component getRunPanel() {
-    runField = new JTextField("");
-    runField.setPreferredSize(new Dimension(100, 10));
-    runField.addActionListener(new ActionListener() {
-      @Override
-      public void actionPerformed(ActionEvent e) {
-        runCmd();        
-      }}
-    );
-    JPanel showPanel = new JPanel(new BorderLayout());
-    Box a = Box.createVerticalBox();
-    Box b = Box.createHorizontalBox();
-    b.add(newLabel("Run Command"));
-    b.add(runField);
-    a.add(b);
-    a.add(Box.createVerticalGlue());
-    showPanel.add(a, BorderLayout.NORTH);
-    //showPanel.add(Box.createGlue(), BorderLayout.CENTER);
-    return showPanel;
-  }
-
   private Component getRawPanel() {
-    rawField = new JTextField("");
-    rawField.setPreferredSize(new Dimension(100, 10));
-    rawField.addActionListener(new ActionListener() {
+    nboInput = new JTextField("");
+    nboInput.setPreferredSize(new Dimension(100, 10));
+    nboInput.addActionListener(new ActionListener() {
       @Override
       public void actionPerformed(ActionEvent e) {
         rawCmd();        
@@ -342,8 +389,8 @@
     JPanel showPanel = new JPanel(new BorderLayout());
     Box a = Box.createVerticalBox();
     Box b = Box.createHorizontalBox();
-    b.add(newLabel("Raw Command"));
-    b.add(rawField);
+    b.add(newLabel("NBO Input:"));
+    b.add(nboInput);
     a.add(b);
     a.add(Box.createVerticalGlue());
     showPanel.add(a, BorderLayout.NORTH);
@@ -360,66 +407,67 @@
 
   /////////////////////////////////////////////////////////
 
-  protected void modelCmd() {
-    nboReport(null);
-    Map<String, Object> info = new Hashtable<String, Object>();
-    info.put("mode", Integer.valueOf(NBOService.MODEL));
-    info.put("sync", Boolean.FALSE);
-    String cmd = modelField.getText();
-    if (cmd.startsWith("sh ")) {
-      info.put("action", "load");
-      info.put("value", cmd.substring(3));
-    } else {
-      info.put("action", "run");
-      String fname = nboService.workingPath + File.separator + "jmol.orc";
-      String orcData = "%coords\ncoords\n" + vwr.getData("*", "USER:%-2e 
%10.5x %10.5y %10.5z") + "end\nend\n";
-      vwr.writeTextFile(fname, orcData);
-      cmd = "___use.orc " + fname + "\n" + cmd;
-    }
-    info.put("value", cmd.substring(3));
-    if (!nboService.processRequest(info)) {
-      nboReport(null);
-      nboReport("You must connect first.");
-    }
-  }
+//  protected void modelCmd() {
+//    nboReport(null);
+//    Map<String, Object> info = new Hashtable<String, Object>();
+//    info.put("mode", Integer.valueOf(NBOService.MODEL));
+//    info.put("sync", Boolean.FALSE);
+//    String cmd = modelField.getText();
+//    if (cmd.startsWith("sh ")) {
+//      info.put("action", "load");
+//      info.put("value", cmd.substring(3));
+//    } else {
+//      info.put("action", "run");
+//      String fname = nboService.workingPath + File.separator + "jmol.orc";
+//      String orcData = "%coords\ncoords\n" + vwr.getData("*", "USER:%-2e 
%10.5x %10.5y %10.5z") + "end\nend\n";
+//      vwr.writeTextFile(fname, orcData);
+//      cmd = "___use.orc " + fname + "\n" + cmd;
+//    }
+//    info.put("value", cmd.substring(3));
+//    if (!nboService.processRequest(info)) {
+//      nboReport(null);
+//      nboReport("You must connect first.");
+//    }
+//  }
+//  
+//  protected void runCmd() {
+//    nboReport(null);
+//    Map<String, Object> info = new Hashtable<String, Object>();
+//    info.put("mode", Integer.valueOf(NBOService.RUN));
+//    info.put("sync", Boolean.FALSE);
+//    info.put("action", "run");
+//    String cmd = runField.getText();
+//    info.put("value", cmd);
+//    if (!nboService.processRequest(info)) {
+//      nboReport(null);
+//      nboReport("not implemented");
+//    }
+//  }
+//  
+//  protected void viewCmd() {
+//    nboReport(null);
+//    Map<String, Object> info = new Hashtable<String, Object>();
+//    info.put("mode", Integer.valueOf(NBOService.VIEW));
+//    info.put("sync", Boolean.FALSE);
+//    info.put("action", "view");
+//    String cmd = viewField.getText();
+//    info.put("value", cmd);
+//    if (!nboService.processRequest(info)) {
+//      nboReport(null);
+//      nboReport("not implemented");
+//    }
+//  }
   
-  protected void runCmd() {
-    nboReport(null);
-    Map<String, Object> info = new Hashtable<String, Object>();
-    info.put("mode", Integer.valueOf(NBOService.RUN));
-    info.put("sync", Boolean.FALSE);
-    info.put("action", "run");
-    String cmd = runField.getText();
-    info.put("value", cmd);
-    if (!nboService.processRequest(info)) {
-      nboReport(null);
-      nboReport("not implemented");
-    }
-  }
-  
-  protected void viewCmd() {
-    nboReport(null);
-    Map<String, Object> info = new Hashtable<String, Object>();
-    info.put("mode", Integer.valueOf(NBOService.VIEW));
-    info.put("sync", Boolean.FALSE);
-    info.put("action", "view");
-    String cmd = viewField.getText();
-    info.put("value", cmd);
-    if (!nboService.processRequest(info)) {
-      nboReport(null);
-      nboReport("not implemented");
-    }
-  }
-  
   protected void rawCmd() {
-    nboReport(null);
+    //nboReport(null);
     Map<String, Object> info = new Hashtable<String, Object>();
     info.put("mode", Integer.valueOf(NBOService.RAW));
     info.put("sync", Boolean.FALSE);
     info.put("action", "cmd");
-    String cmd = rawField.getText();
-    rawField.setText("");
+    String cmd = nboInput.getText();
+    nboInput.setText("");
     info.put("value", cmd);
+    nboReport(">> " + cmd);
     if (!nboService.processRequest(info)) {
       nboReport(null);
       nboReport("not implemented");
@@ -453,7 +501,11 @@
 
   @Override
   public void setVisible(boolean b) {
-    super.setVisible(b);    
+    super.setVisible(b);
+    if (haveService)
+      nboInput.requestFocus();
+    else
+      nboPathButton.requestFocus();
   }
 //  /**
 //   * Show a file selector when the savePath button is pressed.
@@ -518,14 +570,6 @@
     this.setLocation(x, y);
   }
 
-  /**
-   * Just recovers the path settings from last session.
-   */
-  private void getPathHistory() {
-    serverPathLabel.setText(nboService.serverPath);
-    //workingPathLabel.setText(nboService.workingPath);
-  }
-
   public synchronized void nboReport(String s) {
     try {
       nboOutput.setText(s == null ? "" : nboOutput.getText() + s + "\n");
@@ -536,6 +580,7 @@
       SwingUtilities.invokeLater(new Runnable(){
         @Override
         public void run() {
+          pack();
           
editPane2.getVerticalScrollBar().setValue(editPane2.getVerticalScrollBar().getMaximum());
         }});
     } catch (Exception e) {

Modified: trunk/Jmol/src/org/openscience/jmol/app/jmolpanel/StatusListener.java
===================================================================
--- trunk/Jmol/src/org/openscience/jmol/app/jmolpanel/StatusListener.java       
2015-03-05 04:42:49 UTC (rev 20357)
+++ trunk/Jmol/src/org/openscience/jmol/app/jmolpanel/StatusListener.java       
2015-03-05 13:33:56 UTC (rev 20358)
@@ -175,7 +175,10 @@
       try {
       String service = (String) info.get("service");
       if ("nbo".equals(service)) {
-        display.jmolPanel.getNBOService().processRequest(info);
+        if ("showPanel".equals(info.get("action"))) 
+          jmol.startNBO();
+        else
+          jmol.getNBOService().processRequest(info);
       }
       } catch (Exception e) {
         // ignore
@@ -270,7 +273,7 @@
           "getAppConsole", null);
       if (appConsole != null)
         appConsole.sendConsoleEcho(null);
-      display.jmolPanel.updateLabels();
+      jmol.updateLabels();
       return;
     }
   }

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Jmol-commits mailing list
Jmol-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-commits

Reply via email to