Revision: 20362
          http://sourceforge.net/p/jmol/code/20362
Author:   hansonr
Date:     2015-03-05 14:45:14 +0000 (Thu, 05 Mar 2015)
Log Message:
-----------
Jmol.___JmolVersion="14.2.13_2015.03.06"
synchronized with 14.3.12_2015.03.06
released

adds IMAGE command, Windows BMP image file reading

Modified Paths:
--------------
    branches/v14_2/Jmol/src/org/jmol/adapter/readers/quantum/SpartanArchive.java
    branches/v14_2/Jmol/src/org/jmol/jvxl/calc/MarchingSquares.java
    branches/v14_2/Jmol/src/org/jmol/jvxl/readers/JvxlReader.java
    branches/v14_2/Jmol/src/org/jmol/jvxl/readers/JvxlXmlReader.java
    branches/v14_2/Jmol/src/org/jmol/scriptext/IsoExt.java
    branches/v14_2/Jmol/src/org/jmol/viewer/Jmol.properties
    branches/v14_2/Jmol/src/org/openscience/jmol/app/jmolpanel/JmolPanel.java
    
branches/v14_2/Jmol/src/org/openscience/jmol/app/jmolpanel/StatusListener.java
    branches/v14_2/Jmol/src/org/openscience/jmol/app/nbo/NBOService.java

Added Paths:
-----------
    branches/v14_2/Jmol/src/org/openscience/jmol/app/nbo/NBODialog.java

Removed Paths:
-------------
    branches/v14_2/Jmol/src/org/openscience/jmol/app/jmolpanel/NBODialog.java

Modified: 
branches/v14_2/Jmol/src/org/jmol/adapter/readers/quantum/SpartanArchive.java
===================================================================
--- 
branches/v14_2/Jmol/src/org/jmol/adapter/readers/quantum/SpartanArchive.java    
    2015-03-05 14:40:08 UTC (rev 20361)
+++ 
branches/v14_2/Jmol/src/org/jmol/adapter/readers/quantum/SpartanArchive.java    
    2015-03-05 14:45:14 UTC (rev 20362)
@@ -149,7 +149,7 @@
       r.setAtomCoordScaled(atom, tokens, 1, 
AtomSetCollectionReader.ANGSTROMS_PER_BOHR);
     }
     if (doAddAtoms && Logger.debugging) {
-      Logger.debug(ac + " atoms read");
+      Logger.debug(r.asc.ac + " atoms read");
     }
   }
 
@@ -238,7 +238,7 @@
         iBasis = QS.S;
         break;
       case 1:
-        iBasis = QS.SP;
+        iBasis = (isSpherical ? QS.P : QS.SP);
         break;
       case 2:
         iBasis = (isSpherical ? QS.DS : QS.DC);
@@ -266,6 +266,9 @@
       case QS.S:
         data[1] = parseFloat(tokens[0]);
         break;
+      case QS.P:
+        data[1] = parseFloat(tokens[1]);
+        break;
       case QS.SP:
         data[1] = parseFloat(tokens[0]);
         data[2] = parseFloat(tokens[1]);

Modified: branches/v14_2/Jmol/src/org/jmol/jvxl/calc/MarchingSquares.java
===================================================================
--- branches/v14_2/Jmol/src/org/jmol/jvxl/calc/MarchingSquares.java     
2015-03-05 14:40:08 UTC (rev 20361)
+++ branches/v14_2/Jmol/src/org/jmol/jvxl/calc/MarchingSquares.java     
2015-03-05 14:45:14 UTC (rev 20362)
@@ -113,6 +113,11 @@
     void setValue(float value) {
       this.value = value;
     }
+    
+    @Override
+    public String toString() {
+      return value + " " + x + " " + y + " " + z;
+    }
 
   }
 
@@ -167,7 +172,6 @@
    * @return       0
    */
   public int addTriangle(int iA, int iB, int iC, int check, int iContour) {
-    //System.out.println("addT " + iA + " " + iB + " " + iC);
     if (triangleCount == triangles.length)
       triangles = (Triangle[]) AU.doubleLength(triangles);
     triangles[triangleCount++] = new Triangle(iA, iB, iC, check, iContour);
@@ -253,11 +257,12 @@
         cutoff = (cutoff < 0 ? -zeroOffset : zeroOffset);
       contourValuesUsed[i] = cutoff;
 
-      Logger.info("#contour " + (i + 1)+ " " + cutoff);
+      Logger.info("#contour " + (i + 1)+ " " + cutoff + " " + triangleCount);
       htPts.clear();
-      for (int ii = triangleCount; --ii >= 0;)
+      for (int ii = triangleCount; --ii >= 0;) {
         if (triangles[ii].isValid)
           checkContour(triangles[ii], i, cutoff);
+      }
       if (thisContour > 0) {
         if (i + 1 == thisContour)
           minCutoff = cutoff;
@@ -305,7 +310,6 @@
       return htPts.get(key).intValue();
     float valueA = contourVertexes[iA].value;
     float valueB = contourVertexes[iB].value;
-    //System.out.println(iA + " " + iB + " " + valueA + " " + value + " " + 
valueB);
     int iPt = -1;
     if (valueA != valueB) {
       float f = (value - valueA) / (valueB - valueA);
@@ -331,9 +335,6 @@
   private void checkContour(Triangle t, int i, float value) {
     if (thisContour > 0 && i + 1 != thisContour)
       return;
-   //System.out.println(" ms  i=" + i + " " + contourVertexes[pts[0]].value + 
" " + contourVertexes[pts[1]].value + " " + contourVertexes[pts[2]].value + " " 
+ value);
-   //System.out.println(pts[0] + " " + pts[1] + " " + pts[2]);
-   //System.out.println(contourVertexes[pts[0]] + "\n" + 
contourVertexes[pts[1]] + "\n" + contourVertexes[pts[2]]);
     int ipt0 = intercept(t, 0, value);
     int ipt1 = intercept(t, 1, value);
     int ipt2 = intercept(t, 2, value);
@@ -377,7 +378,6 @@
     for (int i = 0; i < triangleCount; i++)
       if (triangles[i].isValid) {
         Triangle t = triangles[i];
-        //System.out.println(contourVertexes[t.pts[0]].value + " " + 
contourVertexes[t.pts[1]].value + " "  + contourVertexes[t.pts[2]].value + " "  
);
         surfaceReader.addTriangleCheck(t.pts[0], t.pts[1], t.pts[2], t.check,
             t.contourIndex, false, -1);
       }

Modified: branches/v14_2/Jmol/src/org/jmol/jvxl/readers/JvxlReader.java
===================================================================
--- branches/v14_2/Jmol/src/org/jmol/jvxl/readers/JvxlReader.java       
2015-03-05 14:40:08 UTC (rev 20361)
+++ branches/v14_2/Jmol/src/org/jmol/jvxl/readers/JvxlReader.java       
2015-03-05 14:45:14 UTC (rev 20362)
@@ -234,7 +234,7 @@
     params.isBicolorMap = (param1 > 0 && param2 < 0);
     jvxlDataIsColorMapped = (param3 != 0);
     if (jvxlDataIsColorMapped)
-      jvxlData.colorScheme = "RGB"; // legacy
+      jvxlData.colorScheme = "RGB"; // legacy; but can't remap contours
     jvxlDataIs2dContour = (jvxlDataIsColorMapped && params.isContoured);
 
     if (params.isBicolorMap || params.colorBySign)

Modified: branches/v14_2/Jmol/src/org/jmol/jvxl/readers/JvxlXmlReader.java
===================================================================
--- branches/v14_2/Jmol/src/org/jmol/jvxl/readers/JvxlXmlReader.java    
2015-03-05 14:40:08 UTC (rev 20361)
+++ branches/v14_2/Jmol/src/org/jmol/jvxl/readers/JvxlXmlReader.java    
2015-03-05 14:45:14 UTC (rev 20362)
@@ -692,12 +692,13 @@
       params.mappedDataMin = contourPlaneMinimumValue;
       params.mappedDataMax = contourPlaneMaximumValue;
     }
-    if (jvxlData.colorScheme != null)
+    if (jvxlData.colorScheme != null) {
+      boolean setContourValue = (marchingSquares != null && 
params.isContoured);
       for (int i = 0; i < vertexCount; i += vertexIncrement) {
         float value = vertexValues[i];
         //note: these are just default colorings
         //orbital color had a bug through 11.2.6/11.3.6
-        if (marchingSquares != null && params.isContoured) {
+        if (setContourValue) {
           marchingSquares.setContourData(i, value);
           continue;
         }
@@ -707,6 +708,7 @@
         colixes[i] = C.getColixTranslucent3(colix, true,
             jvxlData.translucency);
       }
+    }
     return jvxlColorDataRead + "\n";
   }
 

Modified: branches/v14_2/Jmol/src/org/jmol/scriptext/IsoExt.java
===================================================================
--- branches/v14_2/Jmol/src/org/jmol/scriptext/IsoExt.java      2015-03-05 
14:40:08 UTC (rev 20361)
+++ branches/v14_2/Jmol/src/org/jmol/scriptext/IsoExt.java      2015-03-05 
14:45:14 UTC (rev 20362)
@@ -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: branches/v14_2/Jmol/src/org/jmol/viewer/Jmol.properties
===================================================================
--- branches/v14_2/Jmol/src/org/jmol/viewer/Jmol.properties     2015-03-05 
14:40:08 UTC (rev 20361)
+++ branches/v14_2/Jmol/src/org/jmol/viewer/Jmol.properties     2015-03-05 
14:45:14 UTC (rev 20362)
@@ -4,12 +4,23 @@
 # THIS IS THE RELEASE BRANCH 
 # BUG FIXES ONLY, PLEASE
 
-Jmol.___JmolVersion="14.2.13_2015.03.05"
+Jmol.___JmolVersion="14.2.13_2015.03.06"
+synchronized with 14.3.12_2015.03.06
+released
 
-synchronized with 14.3.12_2015.03.05b
+adds IMAGE command, Windows BMP image file reading
+
+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
+
+JmolVersion="14.3.12_2015.03.05"
+synchronized with 14.2.13_2015.03.05
 released
 
-bug fix: reading legacy mapped plane (2ptn-molecular_slice1.jvxl.txt)  crashes 
Jmol
 bug fix: (14.3 only) write VRML|MAYA|OBJ|POVRAY  broken
 
 JmolVersion="14.3.12_2015.03.01"

Modified: 
branches/v14_2/Jmol/src/org/openscience/jmol/app/jmolpanel/JmolPanel.java
===================================================================
--- branches/v14_2/Jmol/src/org/openscience/jmol/app/jmolpanel/JmolPanel.java   
2015-03-05 14:40:08 UTC (rev 20361)
+++ branches/v14_2/Jmol/src/org/openscience/jmol/app/jmolpanel/JmolPanel.java   
2015-03-05 14:45:14 UTC (rev 20362)
@@ -38,6 +38,7 @@
 import org.openscience.jmol.app.jsonkiosk.JsonNioClient;
 import org.openscience.jmol.app.jsonkiosk.JsonNioServer;
 import org.openscience.jmol.app.jsonkiosk.KioskFrame;
+import org.openscience.jmol.app.nbo.NBODialog;
 import org.openscience.jmol.app.nbo.NBOService;
 import org.openscience.jmol.app.surfacetool.SurfaceTool;
 import org.jmol.script.T;
@@ -1094,11 +1095,7 @@
     
     @Override
     public void actionPerformed(ActionEvent e) {
-      getNBOService();
-      if (nboDialog == null)
-        nboDialog = new NBODialog(frame, vwr, nboService);
-      else
-        nboDialog.setVisible(true);
+      startNBO();
     }
   }
     
@@ -1121,6 +1118,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() {

Deleted: 
branches/v14_2/Jmol/src/org/openscience/jmol/app/jmolpanel/NBODialog.java
===================================================================
--- branches/v14_2/Jmol/src/org/openscience/jmol/app/jmolpanel/NBODialog.java   
2015-03-05 14:40:08 UTC (rev 20361)
+++ branches/v14_2/Jmol/src/org/openscience/jmol/app/jmolpanel/NBODialog.java   
2015-03-05 14:45:14 UTC (rev 20362)
@@ -1,546 +0,0 @@
-/* $RCSfile$
- * $Author: hansonr $
- * $Date: 2014-12-13 22:43:17 -0600 (Sat, 13 Dec 2014) $
- * $Revision: 20162 $
- *
- * Copyright (C) 2002-2005  The Jmol Development Team
- *
- * Contact: jmol-develop...@lists.sf.net
- *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License as published by the Free Software Foundation; either
- *  version 2.1 of the License, or (at your option) any later version.
- *
- *  This library is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-package org.openscience.jmol.app.jmolpanel;
-
-import org.jmol.viewer.Viewer;
-import org.jmol.i18n.GT;
-import org.openscience.jmol.app.nbo.NBOService;
-
-import java.awt.BorderLayout;
-import java.awt.Component;
-import java.awt.Dimension;
-import java.awt.FlowLayout;
-import java.awt.Font;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-
-import javax.swing.BorderFactory;
-import javax.swing.Box;
-import javax.swing.BoxLayout;
-import javax.swing.JButton;
-import javax.swing.JDialog;
-import javax.swing.JFileChooser;
-import javax.swing.JFrame;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JSplitPane;
-import javax.swing.JTabbedPane;
-import javax.swing.JTextField;
-import javax.swing.JTextPane;
-import javax.swing.SwingUtilities;
-import javax.swing.border.TitledBorder;
-import javax.swing.event.ChangeEvent;
-import javax.swing.event.ChangeListener;
-
-import java.io.File;
-import java.util.Hashtable;
-import java.util.Map;
-/**
- * A dialog for interacting with NBO-Server (experimental)
- */
-public class NBODialog extends JDialog implements ChangeListener {
-
-  private transient Viewer vwr;
-  
-  protected JButton nboPathButton;
-  //protected JTextField commandLineField;
-  protected JTextField Field;
-  protected JTextField dataPathLabel;
-  protected JTextField serverPathLabel;
-
-//  private JTextField workingPathLabel;
-
-  private JTextPane nboOutput;
-
-  protected JScrollPane editPane2;
-
-  private JTabbedPane inputTabs;
-
-  private Component modelPanel;
-
-  private Component rawPanel;
-
-  private Component viewPanel;
-
-  private Component runPanel;
-
-  private JTextField modelField, rawField, viewField, runField;
-  
-  private NBOService nboService;
-
-  /**
-   * Creates a dialog for getting info related to output frames in nbo format.
-   * 
-   * @param f
-   *        The frame assosiated with the dialog
-   * @param vwr
-   *        The interacting display we are reproducing (source of view angle
-   *        info etc)
-   * @param nboService
-   */
-  public NBODialog(JFrame f, Viewer vwr, NBOService nboService) {
-
-    super(f, GT._("NBO-Server Interface Setup"), 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();
-    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);
-
-    JPanel filePanel = buildFilePanel();
-    JPanel buttonPanel = buildButtonPanel();
-
-    JPanel gluePanel = new JPanel(new BorderLayout());
-//    gluePanel.add(Box.createGlue(), BorderLayout.NORTH);
-    gluePanel.add(filePanel, BorderLayout.SOUTH);
-    //container.add(gluePanel);
-    container.add(filePanel);
-    container.add(buttonPanel);
-    container.add(Box.createGlue());
-    container.add(splitPanel);
-    getContentPane().add(container);
-
-    pack();
-    centerDialog();
-    getPathHistory();
-    setVisible(true);
-    splitPane.setDividerLocation(0.5);
-  }
-
-  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;
-  }
-
-  private JPanel buildFilePanel() {
-    
-    JPanel filePanel = new JPanel(new BorderLayout());
-
-    
-    //GUI for working path selection
-//    Box workingPathBox = Box.createHorizontalBox();
-//    workingPathBox.setBorder(new TitledBorder("Working Directory"));
-//    workingPathLabel = new JTextField("");
-//    workingPathLabel.setEditable(false);
-//    workingPathLabel.setBorder(null);
-//    workingPathBox.add(workingPathLabel);
-//    JButton pathButton = new JButton("Browse...");
-//    pathButton.addActionListener(new ActionListener() {
-//
-//      @Override
-//      public void actionPerformed(ActionEvent e) {
-//        showWorkingPathDialog();
-//      }
-//    });
-//    workingPathBox.add(pathButton);
-//    filePanel.add(workingPathBox, BorderLayout.NORTH);
-
-    //GUI for NBO path selection
-    Box nboPathBox = Box.createHorizontalBox();
-    nboPathBox.setBorder(new TitledBorder("Location of the NBO-Server 
Executable"));
-    serverPathLabel = new JTextField("");
-    serverPathLabel.setEditable(false);
-    serverPathLabel.setBorder(null);
-    nboPathBox.add(serverPathLabel);
-    nboPathButton = new JButton("Browse...");
-    nboPathButton.addActionListener(new ActionListener() {
-
-      @Override
-      public void actionPerformed(ActionEvent e) {
-        showNBOPathDialog();
-      }
-    });
-    nboPathBox.add(nboPathButton);
-    filePanel.add(nboPathBox, BorderLayout.NORTH);
-    return filePanel;
-  }
-
-  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;
-  }
-
-  private JPanel buildRightPanel() {
-    
-    JPanel editPanel = new JPanel();
-    editPanel.setLayout(new BoxLayout(editPanel, BoxLayout.Y_AXIS));
-    
-    TitledBorder editTitle =
-      BorderFactory.createTitledBorder("NBO Output");
-    editPanel.setBorder(editTitle);  
-    nboOutput = new JTextPane();
-    nboOutput.setContentType("text/plain");
-    nboOutput.setFont(new Font("Monospaced", Font.PLAIN, 10));
-    editPane2 = new JScrollPane();
-    editPane2.getViewport().add(nboOutput);
-    editPanel.add(editPane2);
-
-    editPanel.setPreferredSize(new Dimension(500,100));
-    return editPanel;
-  }
-
-  @Override
-  public void stateChanged(ChangeEvent event) {
-    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 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 getRawPanel() {
-    rawField = new JTextField("");
-    rawField.setPreferredSize(new Dimension(100, 10));
-    rawField.addActionListener(new ActionListener() {
-      @Override
-      public void actionPerformed(ActionEvent e) {
-        rawCmd();        
-      }}
-    );
-    JPanel showPanel = new JPanel(new BorderLayout());
-    Box a = Box.createVerticalBox();
-    Box b = Box.createHorizontalBox();
-    b.add(newLabel("Raw Command"));
-    b.add(rawField);
-    a.add(b);
-    a.add(Box.createVerticalGlue());
-    showPanel.add(a, BorderLayout.NORTH);
-    //showPanel.add(Box.createGlue(), BorderLayout.CENTER);
-    return showPanel;
-  }
-
-  private Component newLabel(String label) {
-    JTextField t = new JTextField(label);
-    t.setEditable(false);
-    t.setBorder(null);
-    return t;
-  }
-
-  /////////////////////////////////////////////////////////
-
-  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 rawCmd() {
-    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("");
-    info.put("value", cmd);
-    if (!nboService.processRequest(info)) {
-      nboReport(null);
-      nboReport("not implemented");
-    }
-  }
-  
-  protected void connectPressed() {
-    nboService.closeProcess();
-    nboReport(null);
-    String err = nboService.startProcess(true); // synchronous? 
-    if (err == null) {
-      nboReport("listening...");
-    } else {
-      nboReport(err);
-    }
-  }
-
-  protected void clearPressed() {
-    nboReport(null);
-  }
-
-  /**
-   * Responds to cancel being press- or equivalent eg window closed.
-   */
-  void closePressed() {
-    nboService.closeProcess();
-    nboService.saveHistory();
-    setVisible(false);
-    dispose();
-  }
-
-  @Override
-  public void setVisible(boolean b) {
-    super.setVisible(b);    
-  }
-//  /**
-//   * Show a file selector when the savePath button is pressed.
-//   */
-//  void showWorkingPathDialog() {
-//
-//    JFileChooser myChooser = new JFileChooser();
-//    myChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
-//    String fname = workingPathLabel.getText();
-//    myChooser.setSelectedFile(new File(fname));
-//
-//    int button = myChooser.showDialog(this, GT._("Select"));
-//    if (button == JFileChooser.APPROVE_OPTION) {
-//      File newFile = myChooser.getSelectedFile();
-//      String path;
-//      if (newFile.isDirectory()) {
-//        path = newFile.toString();
-//      } else {
-//        path = newFile.getParent();
-//      }
-//      workingPathLabel.setText(path);
-//      pack();
-//      nboService.workingPath = path;
-//      nboService.saveHistory();
-//    }
-//  }
-
-  /**
-   * Show a file selector when the savePath button is pressed.
-   */
-  void showNBOPathDialog() {
-
-    JFileChooser myChooser = new JFileChooser();
-    String fname = serverPathLabel.getText();
-    myChooser.setSelectedFile(new File(fname));
-    int button = myChooser.showDialog(this, GT._("Select"));
-    if (button == JFileChooser.APPROVE_OPTION) {
-      File newFile = myChooser.getSelectedFile();
-      String path = newFile.toString();
-      if (path.indexOf("NBO") < 0)
-        return;
-      serverPathLabel.setText(path);
-      nboService.serverPath = path;
-      nboService.saveHistory();      
-      pack();
-    }
-  }
-
-  /**
-   * Centers the dialog on the screen.
-   */
-  protected void centerDialog() {
-
-    Dimension screenSize = this.getToolkit().getScreenSize();
-    Dimension size = this.getSize();
-    screenSize.height = screenSize.height / 2;
-    screenSize.width = screenSize.width / 2;
-    size.height = size.height / 2;
-    size.width = size.width / 2;
-    int y = screenSize.height - size.height;
-    int x = screenSize.width - size.width;
-    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");
-    } catch (Exception e) {
-      System.out.println(e);
-    }
-    try {
-      SwingUtilities.invokeLater(new Runnable(){
-        @Override
-        public void run() {
-          
editPane2.getVerticalScrollBar().setValue(editPane2.getVerticalScrollBar().getMaximum());
-        }});
-    } catch (Exception e) {
-      System.out.println(e);
-    }
-  }
-
-}

Modified: 
branches/v14_2/Jmol/src/org/openscience/jmol/app/jmolpanel/StatusListener.java
===================================================================
--- 
branches/v14_2/Jmol/src/org/openscience/jmol/app/jmolpanel/StatusListener.java  
    2015-03-05 14:40:08 UTC (rev 20361)
+++ 
branches/v14_2/Jmol/src/org/openscience/jmol/app/jmolpanel/StatusListener.java  
    2015-03-05 14:45:14 UTC (rev 20362)
@@ -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;
     }
   }

Added: branches/v14_2/Jmol/src/org/openscience/jmol/app/nbo/NBODialog.java
===================================================================
--- branches/v14_2/Jmol/src/org/openscience/jmol/app/nbo/NBODialog.java         
                (rev 0)
+++ branches/v14_2/Jmol/src/org/openscience/jmol/app/nbo/NBODialog.java 
2015-03-05 14:45:14 UTC (rev 20362)
@@ -0,0 +1,583 @@
+/* $RCSfile$
+ * $Author: hansonr $
+ * $Date: 2014-12-13 22:43:17 -0600 (Sat, 13 Dec 2014) $
+ * $Revision: 20162 $
+ *
+ * Copyright (C) 2002-2005  The Jmol Development Team
+ *
+ * Contact: jmol-develop...@lists.sf.net
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2.1 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+package org.openscience.jmol.app.nbo;
+
+import org.jmol.viewer.Viewer;
+import org.jmol.i18n.GT;
+
+import java.awt.BorderLayout;
+import java.awt.Component;
+import java.awt.Dimension;
+//import java.awt.FlowLayout;
+import java.awt.Font;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+import javax.swing.BorderFactory;
+import javax.swing.Box;
+//import javax.swing.BoxLayout;
+import javax.swing.JButton;
+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.JTextField;
+import javax.swing.JTextPane;
+import javax.swing.SwingUtilities;
+import javax.swing.border.TitledBorder;
+import javax.swing.event.ChangeEvent;
+import javax.swing.event.ChangeListener;
+
+import java.io.File;
+import java.util.Hashtable;
+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 {
+
+  protected Viewer vwr;
+  
+  protected JButton nboPathButton;
+  //protected JTextField commandLineField;
+  protected JTextField Field;
+  protected JTextField dataPathLabel;
+  protected JTextField serverPathLabel;
+
+//  private JTextField workingPathLabel;
+
+  private JTextPane nboOutput;
+
+  protected JScrollPane editPane2;
+
+//  private JTabbedPane inputTabs;
+
+  //private Component modelPanel;
+  //private Component rawPanel;
+  //private Component viewPanel;
+  //private Component runPanel;
+  private JTextField nboInput;
+
+//  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.
+   * 
+   * @param f
+   *        The frame assosiated with the dialog
+   * @param vwr
+   *        The interacting display we are reproducing (source of view angle
+   *        info etc)
+   * @param nboService
+   */
+  public NBODialog(JFrame f, Viewer vwr, NBOService nboService) {
+
+    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, 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);
+
+    JPanel filePanel = buildFilePanel();
+    //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());
+//    gluePanel.add(Box.createGlue(), BorderLayout.NORTH);
+//    gluePanel.add(filePanel, BorderLayout.SOUTH);
+    //container.add(gluePanel);
+    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();
+    setVisible(true);
+    if (haveService)
+      connectPressed();
+    //splitPane.setDividerLocation(0.5);
+  }
+
+//  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;
+//  }
+
+  private JPanel buildFilePanel() {
+    
+    JPanel filePanel = new JPanel(new BorderLayout());
+    filePanel.setBorder(new TitledBorder("Location of the NBO-Server 
Executable"));
+
+    
+    //GUI for working path selection
+//    Box workingPathBox = Box.createHorizontalBox();
+//    workingPathBox.setBorder(new TitledBorder("Working Directory"));
+//    workingPathLabel = new JTextField("");
+//    workingPathLabel.setEditable(false);
+//    workingPathLabel.setBorder(null);
+//    workingPathBox.add(workingPathLabel);
+//    JButton pathButton = new JButton("Browse...");
+//    pathButton.addActionListener(new ActionListener() {
+//
+//      @Override
+//      public void actionPerformed(ActionEvent e) {
+//        showWorkingPathDialog();
+//      }
+//    });
+//    workingPathBox.add(pathButton);
+//    filePanel.add(workingPathBox, BorderLayout.NORTH);
+
+    //GUI for NBO path selection
+    Box box = Box.createHorizontalBox();
+    serverPathLabel = new JTextField("");
+    serverPathLabel.setEditable(false);
+    serverPathLabel.setBorder(null);
+    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();
+      }
+    });
+    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() {
+//
+//    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 p = new JPanel();
+    p.setLayout(new BorderLayout());
+    
+    TitledBorder editTitle =
+      BorderFactory.createTitledBorder("NBO Output");
+    p.setBorder(editTitle);  
+    nboOutput = new JTextPane();
+    nboOutput.setContentType("text/plain");
+    nboOutput.setFont(new Font("Monospaced", Font.PLAIN, 12));
+    editPane2 = new JScrollPane();
+    editPane2.getViewport().add(nboOutput);
+    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();
+//    }
+  }
+
+//  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(new JLabel("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(new JLabel("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(new JLabel("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() {
+    nboInput = new JTextField("");
+    nboInput.setPreferredSize(new Dimension(100, 10));
+    nboInput.addActionListener(new ActionListener() {
+      @Override
+      public void actionPerformed(ActionEvent e) {
+        rawCmd();        
+      }}
+    );
+    JPanel showPanel = new JPanel(new BorderLayout());
+    Box a = Box.createVerticalBox();
+    Box b = Box.createHorizontalBox();
+    b.add(new JLabel("NBO Input:"));
+    b.add(nboInput);
+    a.add(b);
+    a.add(Box.createVerticalGlue());
+    showPanel.add(a, BorderLayout.NORTH);
+    //showPanel.add(Box.createGlue(), BorderLayout.CENTER);
+    return showPanel;
+  }
+
+  /////////////////////////////////////////////////////////
+
+//  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 rawCmd() {
+    //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 = nboInput.getText();
+    nboInput.setText("");
+    info.put("value", cmd);
+    nboReport(">> " + cmd);
+    if (!nboService.processRequest(info)) {
+      nboReport(null);
+      nboReport("not implemented");
+    }
+  }
+  
+  protected void connectPressed() {
+    nboService.closeProcess();
+    nboReport(null);
+    String err = nboService.startProcess(false);  
+    if (err == null) {
+      nboReport("listening...");
+    } else {
+      nboReport(err);
+    }
+  }
+
+  protected void clearPressed() {
+    nboReport(null);
+  }
+
+  /**
+   * Responds to cancel being press- or equivalent eg window closed.
+   */
+  void closePressed() {
+    nboService.closeProcess();
+    nboService.saveHistory();
+    setVisible(false);
+    dispose();
+  }
+
+  @Override
+  public void setVisible(boolean b) {
+    super.setVisible(b);
+    if (haveService)
+      nboInput.requestFocus();
+    else
+      nboPathButton.requestFocus();
+  }
+//  /**
+//   * Show a file selector when the savePath button is pressed.
+//   */
+//  void showWorkingPathDialog() {
+//
+//    JFileChooser myChooser = new JFileChooser();
+//    myChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
+//    String fname = workingPathLabel.getText();
+//    myChooser.setSelectedFile(new File(fname));
+//
+//    int button = myChooser.showDialog(this, GT._("Select"));
+//    if (button == JFileChooser.APPROVE_OPTION) {
+//      File newFile = myChooser.getSelectedFile();
+//      String path;
+//      if (newFile.isDirectory()) {
+//        path = newFile.toString();
+//      } else {
+//        path = newFile.getParent();
+//      }
+//      workingPathLabel.setText(path);
+//      pack();
+//      nboService.workingPath = path;
+//      nboService.saveHistory();
+//    }
+//  }
+
+  /**
+   * Show a file selector when the savePath button is pressed.
+   */
+  void showNBOPathDialog() {
+
+    JFileChooser myChooser = new JFileChooser();
+    String fname = serverPathLabel.getText();
+    myChooser.setSelectedFile(new File(fname));
+    int button = myChooser.showDialog(this, GT._("Select"));
+    if (button == JFileChooser.APPROVE_OPTION) {
+      File newFile = myChooser.getSelectedFile();
+      String path = newFile.toString();
+      if (path.indexOf("NBO") < 0)
+        return;
+      serverPathLabel.setText(path);
+      nboService.serverPath = path;
+      nboService.saveHistory();      
+      pack();
+    }
+  }
+
+  /**
+   * Centers the dialog on the screen.
+   */
+  protected void centerDialog() {
+
+    Dimension screenSize = this.getToolkit().getScreenSize();
+    Dimension size = this.getSize();
+    screenSize.height = screenSize.height / 2;
+    screenSize.width = screenSize.width / 2;
+    size.height = size.height / 2;
+    size.width = size.width / 2;
+    int y = screenSize.height - size.height;
+    int x = screenSize.width - size.width;
+    this.setLocation(x, y);
+  }
+
+  public synchronized void nboReport(String s) {
+    try {
+      nboOutput.setText(s == null ? "" : nboOutput.getText() + s + "\n");
+    } catch (Exception e) {
+      System.out.println(e);
+    }
+    try {
+      SwingUtilities.invokeLater(new Runnable(){
+        @Override
+        public void run() {
+          pack();
+          
editPane2.getVerticalScrollBar().setValue(editPane2.getVerticalScrollBar().getMaximum());
+        }});
+    } catch (Exception e) {
+      System.out.println(e);
+    }
+  }
+
+}


Property changes on: 
branches/v14_2/Jmol/src/org/openscience/jmol/app/nbo/NBODialog.java
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Modified: branches/v14_2/Jmol/src/org/openscience/jmol/app/nbo/NBOService.java
===================================================================
--- branches/v14_2/Jmol/src/org/openscience/jmol/app/nbo/NBOService.java        
2015-03-05 14:40:08 UTC (rev 20361)
+++ branches/v14_2/Jmol/src/org/openscience/jmol/app/nbo/NBOService.java        
2015-03-05 14:45:14 UTC (rev 20362)
@@ -25,7 +25,6 @@
 
 import org.jmol.viewer.Viewer;
 import org.openscience.jmol.app.jmolpanel.JmolPanel;
-import org.openscience.jmol.app.jmolpanel.NBODialog;
 
 import java.io.BufferedReader;
 import java.io.File;

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