From: <ha...@us...> - 2012-04-04 00:05:54
|
Revision: 16961 http://jmol.svn.sourceforge.net/jmol/?rev=16961&view=rev Author: hansonr Date: 2012-04-04 00:05:47 +0000 (Wed, 04 Apr 2012) Log Message: ----------- version=12.3.20_dev # new feature: JSpecView JCamp-MOL files can reference model="$xxxx" -- model retrieved from NCI Modified Paths: -------------- trunk/Jmol/src/org/jmol/viewer/Jmol.properties trunk/Jmol/src/org/jmol/viewer/Viewer.java Modified: trunk/Jmol/src/org/jmol/viewer/Jmol.properties =================================================================== --- trunk/Jmol/src/org/jmol/viewer/Jmol.properties 2012-04-03 19:19:49 UTC (rev 16960) +++ trunk/Jmol/src/org/jmol/viewer/Jmol.properties 2012-04-04 00:05:47 UTC (rev 16961) @@ -3,6 +3,7 @@ version=12.3.20_dev +# new feature: JSpecView JCamp-MOL files can reference model="$xxxx" -- model retrieved from NCI # note: Headless operation with image creation works perfectly using JmolData.jar # java -Djava.awt.headless=true -Xmx512m -jar "JmolData.jar" -J "load $tylenol;write image 1000 1000 t.jpg" # see also: http://leshazlewood.com/2009/08/26/linux-javaawtheadless-and-the-display-environment-variable/ Modified: trunk/Jmol/src/org/jmol/viewer/Viewer.java =================================================================== --- trunk/Jmol/src/org/jmol/viewer/Viewer.java 2012-04-03 19:19:49 UTC (rev 16960) +++ trunk/Jmol/src/org/jmol/viewer/Viewer.java 2012-04-04 00:05:47 UTC (rev 16961) @@ -8791,10 +8791,13 @@ String atoms = Parser.getQuotedAttribute(script, "atoms"); String select = Parser.getQuotedAttribute(script, "select"); String script2 = Parser.getQuotedAttribute(script, "script"); - String id = (modelID == null ? null : (filename == null ? "" : filename + "#") + modelID); + boolean isNIH = (modelID != null && modelID.startsWith("$")); + if (isNIH) + filename = (modelID.substring(1).equals(getParameter("_smilesstring")) ? null : modelID); + String id = (isNIH || modelID == null ? null : (filename == null ? "" : filename + "#") + modelID); if ("".equals(baseModel)) id += ".baseModel"; - int modelIndex = (modelID == null ? -3 : getModelIndexFromId(id)); + int modelIndex = (id == null ? -3 : getModelIndexFromId(id)); if (modelIndex == -2) return; // file was found, or no file was indicated, but not this model -- ignore script = (modelIndex == -1 && filename != null ? script = "load " + Escape.escape(filename) @@ -8812,6 +8815,7 @@ statusManager.syncSend(fullName + "JSpecView" + script.substring(9), ">", 0); return; } + System.out.println("Jmol executing script for JSpecView: " + script); evalStringQuiet(script, true, false); return; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |