From: <ha...@us...> - 2012-07-17 22:22:58
|
Revision: 17366 http://jmol.svn.sourceforge.net/jmol/?rev=17366&view=rev Author: hansonr Date: 2012-07-17 22:22:52 +0000 (Tue, 17 Jul 2012) Log Message: ----------- version=13.0.RC2_dev # bug fix: SCENE writing with toggle (pause scene 2 ... pause scene 2) in error # bug fix: SCENE min spt script needs wrapping by pathForAllFiles Modified Paths: -------------- trunk/Jmol/appletweb/JSpecViewApplet.jar trunk/Jmol/appletweb/JSpecViewAppletSigned.jar trunk/Jmol/jars/JSpecView.jar trunk/Jmol/src/org/jmol/viewer/FileManager.java trunk/Jmol/src/org/jmol/viewer/Jmol.properties trunk/Jmol/src/org/jmol/viewer/Viewer.java Modified: trunk/Jmol/appletweb/JSpecViewApplet.jar =================================================================== (Binary files differ) Modified: trunk/Jmol/appletweb/JSpecViewAppletSigned.jar =================================================================== (Binary files differ) Modified: trunk/Jmol/jars/JSpecView.jar =================================================================== (Binary files differ) Modified: trunk/Jmol/src/org/jmol/viewer/FileManager.java =================================================================== --- trunk/Jmol/src/org/jmol/viewer/FileManager.java 2012-07-16 19:43:03 UTC (rev 17365) +++ trunk/Jmol/src/org/jmol/viewer/FileManager.java 2012-07-17 22:22:52 UTC (rev 17366) @@ -1239,8 +1239,7 @@ } boolean haveScripts = (!haveSceneScript && scripts != null && scripts.length > 0); if (haveScripts) { - String vname = "v__" + ("" + Math.random()).substring(3); - script = "# Jmol script\n{\n\tVar " + vname + " = pathForAllFiles\n\tpathForAllFiles=\"$SCRIPT_PATH$\"\n\ttry {\n\t\tscript " + Escape.escape(scripts[0]) + "\n\t}\n\tpathForAllFiles = " + vname + "\n}\n"; + script = wrapPathForAllFiles("script " + Escape.escape(scripts[0]), ""); for (int i = 0; i < scripts.length; i++) fileNames.add(scripts[i]); } @@ -1317,6 +1316,11 @@ return writeZipFile(fileName, v, "OK JMOL"); } + static String wrapPathForAllFiles(String cmd, String strCatch) { + String vname = "v__" + ("" + Math.random()).substring(3); + return "# Jmol script\n{\n\tVar " + vname + " = pathForAllFiles\n\tpathForAllFiles=\"$SCRIPT_PATH$\"\n\ttry{\n\t\t" + cmd + "\n\t}catch(e){" + strCatch + "}\n\tpathForAllFiles = " + vname + "\n}\n"; + } + private static String stripPath(String name) { int pt = Math.max(name.lastIndexOf("|"), name.lastIndexOf("/")); return name.substring(pt + 1); Modified: trunk/Jmol/src/org/jmol/viewer/Jmol.properties =================================================================== --- trunk/Jmol/src/org/jmol/viewer/Jmol.properties 2012-07-16 19:43:03 UTC (rev 17365) +++ trunk/Jmol/src/org/jmol/viewer/Jmol.properties 2012-07-17 22:22:52 UTC (rev 17366) @@ -5,6 +5,8 @@ version=13.0.RC2_dev +# bug fix: SCENE writing with toggle (pause scene 2 ... pause scene 2) in error +# bug fix: SCENE min spt script needs wrapping by pathForAllFiles # bug fix: isosurface MINSET or SET not compatible with SLAB # bug fix: show $d1 where d1 is a DRAW object broken # bug fix: calculate hydrogens incorrect for proteins Modified: trunk/Jmol/src/org/jmol/viewer/Viewer.java =================================================================== --- trunk/Jmol/src/org/jmol/viewer/Viewer.java 2012-07-16 19:43:03 UTC (rev 17365) +++ trunk/Jmol/src/org/jmol/viewer/Viewer.java 2012-07-17 22:22:52 UTC (rev 17366) @@ -10539,11 +10539,12 @@ Map<String, String> htScenes = new Hashtable<String, String>(); List<Integer> list = new ArrayList<Integer>(); int iSceneLast = 0; + int iScene = 0; StringBuffer sceneScript = new StringBuffer("###scene.spt###\n{\nsceneScripts={"); for (int i = 1; i < scenes.length; i++) { scenes[i - 1] = TextFormat.trim(scenes[i - 1], "\t\n\r "); int[] pt = new int[1]; - int iScene = Parser.parseInt(scenes[i], pt); + iScene = Parser.parseInt(scenes[i], pt); if (iScene == Integer.MIN_VALUE) return "bad scene ID: " + iScene; scenes[i] = scenes[i].substring(pt[0]); @@ -10585,7 +10586,9 @@ .append(" sscript += ';'+script;\n") .append(" }\n") .append("}\n}catch(e){print e;isOK = false}\n") - .append("if (isOK) {try{script inline @sscript}catch(e){print e;isOK = false}}\n") + .append("if (isOK) {" + + FileManager.wrapPathForAllFiles("script inline @sscript", "print e;isOK = false") + + "}\n") .append("if (!isOK){script @thisSceneState}\n") .append("currentSceneRoot = thisSceneRoot; currentSceneID = thisSceneID;\n}\n"); String script = sceneScript.toString(); @@ -10597,16 +10600,23 @@ int nFiles = 0; if (scenes[0] != "") zap(true, true, false); + iSceneLast = -1; for (int i = 0; i < scenes.length - 1; i++) { try { + iScene = list.get(i).intValue(); + if (iScene > iSceneLast) + showString("Creating Scene " + iScene, false); eval.runScript(scenes[i]); + if (iScene <= iSceneLast) + continue; + iSceneLast = iScene; str[2] = "all"; // full PNGJ - String fileName = fileRoot + "_scene_" + (i + 1) + ".all.png" + fileExt; + String fileName = fileRoot + "_scene_" + iScene + ".all.png" + fileExt; String msg = (String) createImage(fileName, "PNGJ", null, str, -1, width, height, null, false); str[0] = null; // script0 only saved in first file str[2] = "min"; // script only -- for fast loading - fileName = fileRoot + "_scene_" + (i + 1) + ".min.png" + fileExt; + fileName = fileRoot + "_scene_" + iScene + ".min.png" + fileExt; msg += "\n" + (String) createImage(fileName, "PNGJ", null, str, -1, Math.min(width, 200), Math.min(height, 200), null, false); showString(msg, false); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |