Revision: 20775
          http://sourceforge.net/p/jmol/code/20775
Author:   hansonr
Date:     2015-09-14 22:41:00 +0000 (Mon, 14 Sep 2015)
Log Message:
-----------
fix for 2D mol file H atom addition and minimization failing; releasing 14.3.16

Modified Paths:
--------------
    trunk/Jmol/src/org/jmol/script/ScriptEval.java
    trunk/Jmol/src/org/jmol/viewer/FileManager.java
    trunk/Jmol/src/org/jmol/viewer/Viewer.java

Modified: trunk/Jmol/src/org/jmol/script/ScriptEval.java
===================================================================
--- trunk/Jmol/src/org/jmol/script/ScriptEval.java      2015-09-14 18:19:24 UTC 
(rev 20774)
+++ trunk/Jmol/src/org/jmol/script/ScriptEval.java      2015-09-14 22:41:00 UTC 
(rev 20775)
@@ -4621,6 +4621,7 @@
       vwr.setBooleanProperty("legacyJavaFloat", false);
     if (isMutate)
       htParams.put("isMutate", Boolean.TRUE);
+    htParams.put("eval", this);
     errMsg = vwr.loadModelFromFile(null, filename, filenames, null, isAppend,
         htParams, loadScript, sOptions, tokType, isConcat);
     if (timeMsg)

Modified: trunk/Jmol/src/org/jmol/viewer/FileManager.java
===================================================================
--- trunk/Jmol/src/org/jmol/viewer/FileManager.java     2015-09-14 18:19:24 UTC 
(rev 20774)
+++ trunk/Jmol/src/org/jmol/viewer/FileManager.java     2015-09-14 22:41:00 UTC 
(rev 20775)
@@ -1207,9 +1207,9 @@
   void cacheClear() {
     Logger.info("cache cleared");
     cache.clear();
-    String fileName = null;
-    fileName = fileName == null ? null : 
getCanonicalName(Rdr.getZipRoot(fileName));
-    if (pngjCache == null || fileName != null && 
!pngjCache.containsKey(fileName))
+    //String fileName = null;
+    //fileName = fileName == null ? null : 
getCanonicalName(Rdr.getZipRoot(fileName));
+    if (pngjCache == null)// || fileName != null && 
!pngjCache.containsKey(fileName))
       return;
     pngjCache = null;
     Logger.info("PNGJ cache cleared");
@@ -1296,6 +1296,7 @@
         ? vwr.vwrOptions.get("codePath") + classPath + resourceName
             : url.getFile());
     if (vwr.async) {
+      // if we are running asynchronously, this will be a problem. 
       Object bytes = vwr.fm.cacheGet(resourceName, false);
       if (bytes == null)
         throw new JmolAsyncException(resourceName);

Modified: trunk/Jmol/src/org/jmol/viewer/Viewer.java
===================================================================
--- trunk/Jmol/src/org/jmol/viewer/Viewer.java  2015-09-14 18:19:24 UTC (rev 
20774)
+++ trunk/Jmol/src/org/jmol/viewer/Viewer.java  2015-09-14 22:41:00 UTC (rev 
20775)
@@ -1971,7 +1971,7 @@
     // loadInline
     if (arrayModels == null || arrayModels.length == 0)
       return null;
-    String ret = openStringsInlineParamsAppend(arrayModels, null, isAppend);
+    String ret = openStringsInlineParamsAppend(arrayModels, new 
Hashtable<String, Object>(), isAppend);
     refresh(1, "loadInline String[]");
     return ret;
   }
@@ -1999,7 +1999,7 @@
     Object atomSetCollection = fm.createAtomSeCollectionFromArrayData(list,
         setLoadParameters(null, isAppend), isAppend);
     String ret = createModelSetAndReturnError(atomSetCollection, isAppend,
-        null, null);
+        null, new Hashtable<String, Object>());
     refresh(1, "loadInline");
     return ret;
   }
@@ -2109,7 +2109,7 @@
     Object atomSetCollection = fm.createAtomSetCollectionFromString(strModel,
         htParams, isAppend);
     return createModelSetAndReturnError(atomSetCollection, isAppend,
-        loadScript, null);
+        loadScript, htParams);
   }
 
   /**
@@ -2131,7 +2131,7 @@
         arrayModels, loadScript, setLoadParameters(htParams, isAppend),
         isAppend);
     return createModelSetAndReturnError(atomSetCollection, isAppend,
-        loadScript, null);
+        loadScript, htParams);
   }
 
   public char getInlineChar() {
@@ -2194,7 +2194,8 @@
         String jmolScript = (String) ms.getInfoM("jmolscript");
         if (ms.getMSInfoB("doMinimize"))
           try {
-            minimize((JmolScriptEvaluator) htParams.get("eval"),
+            JmolScriptEvaluator eval = (JmolScriptEvaluator) 
htParams.get("eval");
+            minimize(eval,
                 Integer.MAX_VALUE, 0, bsNew, null, 0, true, true, true, true);
           } catch (Exception e) {
             // TODO
@@ -2222,7 +2223,7 @@
     errMsg = getErrorMessage();
 
     setFileLoadStatus(FIL.CREATED, fullPathName, fileName, ms.modelSetName,
-        errMsg, htParams == null ? null : (Boolean) htParams.get("async"));
+        errMsg, (Boolean) htParams.get("async"));
     if (isAppend) {
       selectAll();
       setTainted(true);
@@ -8427,7 +8428,8 @@
       getMinimizer(true).minimize(steps, crit, bsSelected, bsMotionFixed,
           haveFixed, isSilent, ff);
     } catch (JmolAsyncException e) {
-      eval.loadFileResourceAsync(e.getFileName());
+      if (eval != null)
+        eval.loadFileResourceAsync(e.getFileName());
     } catch (Exception e) {
       Logger.error("Minimization error: " + e.toString());
       if (!isJS)

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


------------------------------------------------------------------------------
_______________________________________________
Jmol-commits mailing list
Jmol-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-commits

Reply via email to