From: Bob H. <ha...@st...> - 2006-02-07 21:41:19
|
Jmol developers and users -- applet: I'm developing a simple JavaScript interface that could in principle replace many or all requirements for applet callbacks. The development page is at http://www.stolaf.edu/people/hansonr/jmol/test/json/json.htm This uses a so-far-unreleased version of the Jmol applet. I'm interested in whether this page works for you, especially if you have a Mac. It uses a communication method we haven't used before with the applet -- direct synchronous JavaScript, using JSON (JavaScript Object Notation). That is, you call the function info=jmolApplet0.getProperty("atomInfo","(selected and not water)") for example, and the "info" variable is directly filled with the requested information. This is in contrast to jmolApplet0.script() for example, which does not directly return a value -- operates "asynchronously". Two nice examples of what this can do are there: 1. Click on "monitor orientation on/off" and then drag the model around. Fun, eh? 2. Drag the model with zoom and then click on "load THIS orientation". You won't see much more than a flutter, yet the model has been completely reloaded. That's because it uses info=jmolAppletX.getProperty("orientationInfo") to first get the current orientation and info=jmolAppletX.getProperty("fileName") to get the currently loaded file name, then puts them together into a single script to reload the file with a set of rotations to reorient it as before. Please do give this a try and let me know what you think. I have some ideas of how we could use this to completely replace callbacks (replacing them with setTimeout() polling of Jmol properties instead). Bob Hanson -- Robert M. Hanson, ha...@st..., 507-646-3107 Professor of Chemistry, St. Olaf College 1520 St. Olaf Ave., Northfield, MN 55057 mailto:ha...@st... http://www.stolaf.edu/people/hansonr "Imagination is more important than knowledge." - Albert Einstein |