Revision: 21480
          http://sourceforge.net/p/jmol/code/21480
Author:   hansonr
Date:     2017-04-04 15:44:44 +0000 (Tue, 04 Apr 2017)
Log Message:
-----------
Jmol.___JmolVersion="14.11.2" // 2017-04-04 

bug fix: NBO fixes
bug fix: backboneSteps moved to cartoonSteps
    // order of checking for TRUE is:
    // cartoonBlocks, cartoonBaseEdges, cartoonSteps, cartoonLadders, 
cartoonRibose

Modified Paths:
--------------
    trunk/Jmol/src/org/gennbo/NBOConfig.java
    trunk/Jmol/src/org/gennbo/NBODialog.java
    trunk/Jmol/src/org/gennbo/NBOModel.java
    trunk/Jmol/src/org/gennbo/NBOSearch.java
    trunk/Jmol/src/org/gennbo/NBOService.java
    trunk/Jmol/src/org/gennbo/NBOView.java

Modified: trunk/Jmol/src/org/gennbo/NBOConfig.java
===================================================================
--- trunk/Jmol/src/org/gennbo/NBOConfig.java    2017-04-04 13:48:07 UTC (rev 
21479)
+++ trunk/Jmol/src/org/gennbo/NBOConfig.java    2017-04-04 15:44:44 UTC (rev 
21480)
@@ -343,7 +343,7 @@
   }
 
   protected void doSettingShowHalos() {
-    dialog.runScriptNow("select " + jCheckSelHalo.isSelected());
+    dialog.runScriptQueued("select " + jCheckSelHalo.isSelected());
   }
 
   protected void doSettingWireMesh() {
@@ -376,7 +376,7 @@
 
     if (isJmol) {
       if (!dialog.jmolOptionNONBO)
-        dialog.runScriptNow("background gray;set defaultcolors Jmol;refresh;");
+        dialog.runScriptQueued("background gray;set defaultcolors 
Jmol;refresh;");
     } else {
       if (jCheckWireMesh.isSelected())
         jCheckWireMesh.doClick();
@@ -387,7 +387,7 @@
         String atomColors = "";
         atomColors = GuiMap.getResourceString(this,
             "org/gennbo/assets/atomColors.txt");
-        dialog.runScriptNow(atomColors + ";refresh");
+        dialog.runScriptQueued(atomColors + ";refresh");
       } catch (IOException e) {
         dialog.logError("atomColors.txt not found");
       }

Modified: trunk/Jmol/src/org/gennbo/NBODialog.java
===================================================================
--- trunk/Jmol/src/org/gennbo/NBODialog.java    2017-04-04 13:48:07 UTC (rev 
21479)
+++ trunk/Jmol/src/org/gennbo/NBODialog.java    2017-04-04 15:44:44 UTC (rev 
21480)
@@ -777,7 +777,7 @@
   public void close() {
     if (modulePanel != null)
       inputFileHandler.clearInputFile(false);
-    runScriptNow("select off");
+    runScriptQueued("select off");
     dispose();
   }
 
@@ -861,7 +861,7 @@
 
       iAmLoading = false;
       if (NBOConfig.nboView)
-        runScriptNow("select 1.1;color bonds lightgrey;"
+        runScriptQueued("select 1.1;color bonds lightgrey;"
             + "wireframe 0.1;select none");
       isOpenShell = vwr.ms.getModelAuxiliaryInfo(0).containsKey("isOpenShell");
       switch (dialogMode) {
@@ -1141,8 +1141,15 @@
   }
 
   protected String loadModelFileNow(String s) {
-    return runScriptNow("load " + s.replace('\\', '/'));
+    String script = "load " + s.replace('\\', '/');
+    logInfo("!$ " + script, Logger.LEVEL_DEBUG);
+    script = script.replace('"', '\'');    
+    return PT.trim(vwr.runScript(script), "\n");
   }
+  
+  public String getCFIData() {
+    return evaluateJmolString("data({*},'cfi')");
+  }
 
   protected boolean checkEnabled() {
     return (jmolOptionNONBO || nboService.isEnabled()
@@ -1212,11 +1219,6 @@
     return isOpenShell;
   }
 
-  synchronized protected String runScriptNow(String script) {
-    logInfo("!$ " + script, Logger.LEVEL_DEBUG);
-    return PT.trim(vwr.runScript(script.replace('"', '\'')), "\n");
-  }
-
   class HelpBtn extends JButton {
 
     String page;

Modified: trunk/Jmol/src/org/gennbo/NBOModel.java
===================================================================
--- trunk/Jmol/src/org/gennbo/NBOModel.java     2017-04-04 13:48:07 UTC (rev 
21479)
+++ trunk/Jmol/src/org/gennbo/NBOModel.java     2017-04-04 15:44:44 UTC (rev 
21480)
@@ -1016,7 +1016,7 @@
   protected void loadModelToNBO(String s, boolean undoRedo) {
     boolean alsoLoadJmol = true;
     if (s == null) {
-      s = dialog.runScriptNow(";print data({*},'cfi');");
+      s = dialog.getCFIData();
       alsoLoadJmol = false;
     }
 //    if (undoRedo)
@@ -1041,8 +1041,9 @@
   protected void loadModelFromNBO(String path, String fname, String ext) {
     if (PT.isOneOf(ext, NBOConfig.JMOL_EXTENSIONS)) {
       notFromNBO = true;
-      dialog.runScriptNow("set refreshing false"); // a bit risky
+      dialog.runScriptQueued("set refreshing false");
       dialog.loadModelFileQueued(new File(path  + "\\" + fname + "." + ext), 
false);
+      dialog.runScriptQueued("set refreshing true");
       return;
     }
     String ess = getEss(ext, true);
@@ -1127,7 +1128,7 @@
    * 
    */
   protected void notifyPick(int[] picked) {
-    dialog.runScriptNow("measure delete;"
+    dialog.runScriptQueued("measure delete;"
         + (resetOnAtomClick ? "select none" : ""));
     if (resetOnAtomClick) {
       clearSelected(false);
@@ -1184,13 +1185,13 @@
    */
   protected void notifyFileLoaded() {
 
-    String fileContents = dialog.runScriptNow("print data({*},'cfi')");
+    String fileContents = dialog.getCFIData();
     if (notFromNBO) {
       notFromNBO = false;
       loadModelToNBO(fileContents, false);
       return;
     }
-    dialog.runScriptNow(NBOConfig.JMOL_FONT_SCRIPT);
+    dialog.runScriptQueued(NBOConfig.JMOL_FONT_SCRIPT);
 //        + ";select 1.1;"); // NOT rotate best, because these may be symmetry 
designed
     dialog.doSetStructure(null);
     showComponents(true);
@@ -1214,7 +1215,7 @@
       updateSelected(false);
       showSelectedOnFileLoad = false;
     } else {
-      dialog.runScriptNow("select none; select on;refresh");
+      dialog.runScriptQueued("select none; select on;refresh");
     }
   }
   

Modified: trunk/Jmol/src/org/gennbo/NBOSearch.java
===================================================================
--- trunk/Jmol/src/org/gennbo/NBOSearch.java    2017-04-04 13:48:07 UTC (rev 
21479)
+++ trunk/Jmol/src/org/gennbo/NBOSearch.java    2017-04-04 15:44:44 UTC (rev 
21480)
@@ -525,7 +525,7 @@
           .append("measurements off;select add {*}.bonds; color bonds 
lightgrey; select none;");
     }
     script.append("isosurface delete; select off;refresh");
-    dialog.runScriptNow(script.toString());
+    dialog.runScriptQueued(script.toString());
     buildHome();
   }
 
@@ -537,7 +537,7 @@
     keyWdBtn.setText("<html><font color=black>" + getKeyword()
         + "</font></html>");
     keyWdBtn.setVisible(true);
-    dialog.runScriptNow("isosurface delete;refresh");
+    dialog.runScriptQueued("isosurface delete;refresh");
     opList.removeAll();
 
     ButtonGroup btnGroup = new ButtonGroup();
@@ -618,7 +618,7 @@
       changeKey(bend);
       break;
     case KEYWD_NRT:
-      dialog.runScriptNow("set bondpicking true");
+      dialog.runScriptQueued("set bondpicking true");
       if (dialog.isOpenShell())
         setKeyword("s a a' rs".split(" "), new String[] { "Spin: ", "Atom A: ",
             "Atom A': ", "Res Struct: " });
@@ -672,7 +672,7 @@
       changeKey(new String[] {});
       break;
     case KEYWD_BAS1BAS2:
-      dialog.runScriptNow("set bondpicking true");
+      dialog.runScriptQueued("set bondpicking true");
       setKeyword("b1 b2 r c".split(" "), new String[] { "Basis 1:", "Basis 2:",
           "Row:", "Column:" });
       getBasisOperationsB1B2();
@@ -687,8 +687,8 @@
 
   private void load(int nn, boolean withBondPicking) {
     dialog.iAmLoading = true;
-    if (dialog.loadModelFileNow(dialog.inputFileHandler.newNBOFileForExt(""
-        + nn)
+    if (dialog.loadModelFileNow(
+        PT.esc(dialog.inputFileHandler.newNBOFileForExt("" + 
nn).toString().replace('\\', '/'))
         + (withBondPicking ? ";set bondpicking true" : "")) == null)
       dialog.iAmLoading = false;
   }
@@ -1279,7 +1279,7 @@
    * 
    */
   protected void notifyPick_s(int[] picked) {
-    dialog.runScriptNow("isosurface delete");
+    dialog.runScriptQueued("isosurface delete");
     int at1 = picked[0];
     int at2 = picked[1];
     if (at2 == Integer.MIN_VALUE) {
@@ -1467,7 +1467,7 @@
   protected void notifyFileLoaded_s() {
     if (vwr.ms.ac == 0)
       return;
-    dialog.runScriptNow("isosurface delete");
+    dialog.runScriptQueued("isosurface delete");
 
     optionSelected = -1;
     if (dialog.isOpenShell()) {

Modified: trunk/Jmol/src/org/gennbo/NBOService.java
===================================================================
--- trunk/Jmol/src/org/gennbo/NBOService.java   2017-04-04 13:48:07 UTC (rev 
21479)
+++ trunk/Jmol/src/org/gennbo/NBOService.java   2017-04-04 15:44:44 UTC (rev 
21480)
@@ -483,7 +483,7 @@
       }
 
       // standard expectation
-      System.out.println("*start*\n" + s);
+      //System.out.println("*start*\n" + s);
       if (currentRequest == null) {
         if (haveLicense) {
           System.out.println("TRANSMISSION ERROR: UNSOLICITED!");

Modified: trunk/Jmol/src/org/gennbo/NBOView.java
===================================================================
--- trunk/Jmol/src/org/gennbo/NBOView.java      2017-04-04 13:48:07 UTC (rev 
21479)
+++ trunk/Jmol/src/org/gennbo/NBOView.java      2017-04-04 15:44:44 UTC (rev 
21480)
@@ -211,7 +211,7 @@
     JPanel panel = new JPanel(new BorderLayout());
     viewState = VIEW_STATE_MAIN;
     ///panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));
-    dialog.runScriptNow("set bondpicking true");
+    dialog.runScriptQueued("set bondpicking true");
 
     Box b = createViewSearchJobBox(NBOFileHandler.MODE_VIEW);
     if (!dialog.jmolOptionNONBO)
@@ -437,7 +437,7 @@
    */
   protected void doViewPlane() {
     viewPlanePt = 0;
-    dialog.runScriptNow("set bondpicking false");
+    dialog.runScriptQueued("set bondpicking false");
     viewState = VIEW_STATE_PLANE;
     Box box = NBOUtil.createTitleBox(" Definiton of Plane ", null);
     final JPanel plane = new JPanel(new BorderLayout());
@@ -483,8 +483,7 @@
     d.addWindowListener(new WindowAdapter() {
       @Override
       public void windowClosing(WindowEvent e) {
-        dialog.runScriptQueued("select off");
-        dialog.runScriptNow("set bondpicking true");
+        dialog.runScriptQueued("select off;set bondpicking true");
         viewState = VIEW_STATE_MAIN;
       }
     });
@@ -492,8 +491,7 @@
       @Override
       public void actionPerformed(ActionEvent e) {
         d.dispose();
-        dialog.runScriptQueued("select off");
-        dialog.runScriptNow("set bondpicking true");
+        dialog.runScriptQueued("select off;set bondpicking true");
         viewState = VIEW_STATE_MAIN;
       }
     });
@@ -512,7 +510,7 @@
    * Vector dialog
    */
   protected void doViewAxis() {
-    dialog.runScriptNow("set bondpicking false");
+    dialog.runScriptQueued("set bondpicking false");
     viewState = VIEW_STATE_VECTOR;
     viewVectorPt = 0;
     Box box = NBOUtil.createTitleBox(" Vector Definition ", null);
@@ -561,8 +559,7 @@
     d.addWindowListener(new WindowAdapter() {
       @Override
       public void windowClosing(WindowEvent e) {
-        dialog.runScriptQueued("select off");
-        dialog.runScriptNow("set bondpicking true");
+        dialog.runScriptQueued("select off;set bondpicking true");
         viewState = VIEW_STATE_MAIN;
       }
     });
@@ -570,8 +567,7 @@
       @Override
       public void actionPerformed(ActionEvent e) {
         d.dispose();
-        dialog.runScriptQueued("select off");
-        dialog.runScriptNow("set bondpicking true");
+        dialog.runScriptQueued("select off;set bondpicking true");
         viewState = VIEW_STATE_MAIN;
       }
     });
@@ -1209,7 +1205,7 @@
 
   private void initializeImage() {
     //testingView = NBOConfig.debugVerbose;
-    dialog.runScriptNow("image close");
+    dialog.runScriptQueued("image close");
     dialog.nboService.restart();
     setDefaultParameterArrays();
     if (jmolView)
@@ -1227,7 +1223,7 @@
    * 
    */
   protected void notifyPick_v(int[] picked) {
-    dialog.runScriptNow("isosurface delete");
+    dialog.runScriptQueued("isosurface delete");
     int at1 = picked[0];
     int at2 = picked[1];
     switch (viewState) {
@@ -1333,7 +1329,7 @@
       return;
     orbitals.bsOn.clearAll();
     orbitals.bsNeg.clearAll();
-    dialog.runScriptNow("isosurface * off");
+    dialog.runScriptQueued("isosurface * off");
     orbitals.updateIsosurfacesInJmol(i);
   }
 
@@ -1826,7 +1822,7 @@
       String id = "id " + PT.esc(title.toString().trim());
       String script = "image " + id + " close;image id \"\" "
           + PT.esc(f.toString().replace('\\', '/'));
-      dialog.runScriptNow(script);
+      dialog.runScriptQueued(script);
       break;
     case NBOService.MODE_RAW:
       break;

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


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Jmol-commits mailing list
Jmol-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-commits

Reply via email to