I've just committed some changes to the Jmol applet JavaScript interface:
JavaScript asynchronous interface augmented:
animFrameCallback, loadStructCallback, messageCallback, pickCallback
parameter values are values sent to System.out on startup (for easier
debugging)
loadStructcallback output improved to include file path (was null)
unimplemented pauseCallback commented out
JavaScript synchronous interface augmented:
(String)getAppletInfo() moved and improved to include version and date;
(String)getAppletInfo("fileContents") added
(String)getAppletInfo("fileContents","<filepath>") added
With this update we no longer need to use applet.script("show file")
along with callbacks to get file information. Instead, just use
applet.getAppletInfo("fileContents")
for getting the current file data, and
applet.getAppletInfo("fileContents","<path name>")
to get the contents of any file on the system or any file in the .jar
path for a local installation.
I have plans to expand this capability to include other sorts of
valuable information -- selected atom and bond info, for example.
Suggestions welcome.
I'd appreciate someone trying this on a Mac and making sure I didn't
mess up.
Also, I'm toying with the idea of supplying a JSON interface for output
from the applet. This could be very cutting-edge. So far to my knowledge
JSON has only been used for cross-server communication, but the same
could be excellent for applet/javascript communication as well, because
there's no need for parsing. A simple application would be to show a
measurement synchronously (without a callback).
Bob Hanson
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Jmol-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-developers