On May 9, 2006, at 10:01 a, Bob Hanson wrote:
Please check
http://www.stolaf.edu/people/hansonr/jmol/test/proto/nocallback.htm
hi Bob,
Safari 2.0.3 - loads fine, works great, though see my report below
(some NullPointerException errors). looks chez cool.
1) using jmolScriptWait() to wait for applet load completion prior
to continuing.
2) using a new parameter idea with the applet object:
<param name="statusForm" value="myformname">
What this does is provide a new mechanism for applet/JavaScript
communication.
Instead of the applet calling a function for callbacks, instead of
the page
polling the applet, the applet simply deposits its status report in
a document form
textbox (document.myformname.statusText).
I see how one could use an onchange handler to monitor the value of
statusText client-side. even better if statusText could be a hidden
field. this looks like it could completely replace the use of
callbacks to grab Jmol responses.
just curious: this is completely separate from the earlier
discussions about JSON and JavaScript, correct? I am thinking
specifically about this:
On Feb 13, 2006, at 6:25 p, Bob Hanson wrote:
It appears I've underestimated the capabilities of JavaScript.
It turns out JSON is irrelevant in this case. Rack it up
to learning, I guess. I never would have imagined that the
following command would work from a browser:
var atomSet = document.getElementById("jmolAppletX")
.getProperty("atomInfo","atomno<5")
alert(atomSet.get(0).get("info")))
The first of those, .getElementById, is JavaScript. the rest are
java methods. It appears that getProperty is returning an object to
JavaScript essentially just like it would to any other java
component. AND, what's more, the object returned, "atomSet" in this
case really is still a Java object. Heck, it's just a pointer --
there's no conversion!!! The class returned is Java "Object" or
JavaScript "object", which in this case operates as a Vector, for
which .get(0) gets the first member. That Vector entry is a
Hashtable, for which get("info") gets the value.
return:
"[THR]1.N #1"
Useful, eh? Similarly:
document.getElementById('jmolAppletX')
.getProperty('orientationInfo').get('moveTo')
returns "moveto 1 -400 345 332 34 0"
The common "J", of course, is for "Java". I decided just for fun to
see what the methods of that getProperty() return object were --
and to my astonishment discovered all the methods of a Vector.
So, what the heck, the JSON idea allows conversion to actual
JavaScript objects, but even without JSON, all the properties of
the actual Java classes returned by getProperty() can be
investigated. You just have to treat them as Java objects and use
java methods.
We'll have to see if this is a generally robust finding.
This sure blurs the distinction between JavaScript and Java....
Bob Hanson
anyway, my Console output during playtime:
userAction(mousePressed: 16)
userAction(mousePressed: 16)
setStatusAtomPicked(1,P1 #2)
userAction(mousePressed: 16)
userAction(mousePressed: 16)
setStatusAtomPicked(34,H3 #35)
error indicating status java.lang.NullPointerException
userAction(mousePressed: 16)
setStatusAtomPicked(35,H4 #36)
userAction(mousePressed: 16)
measurement[0] = [3, 1, 34, 35, 134.5°]
error indicating status java.lang.NullPointerException
userAction(mousePressed: 16)
userAction(mousePressed: 16)
userAction(mousePressed: 16)
setStatusAtomPicked(0,Ag1 #1)
userAction(mousePressed: 16)
setStatusAtomPicked(0,Ag1 #1)
userAction(mousePressed: 16)
setStatusAtomPicked(0,Ag1 #1)
userAction(mousePressed: 16)
error indicating status java.lang.NullPointerException
error indicating status java.lang.NullPointerException
error indicating status java.lang.NullPointerException
error indicating status java.lang.NullPointerException
userAction(mousePressed: 16)
setStatusAtomPicked(13,F5 #14)
userAction(mousePressed: 16)
measurement[1] = [2, 0, 13, 0.33 nm]
userAction(mousePressed: 16)
need to back up the camera
point3fScreenTemp.z=1188.5796 -> z=1188
need to back up the camera
point3fScreenTemp.z=1165.6125 -> z=1165
need to back up the camera
point3fScreenTemp.z=1185.8661 -> z=1185
userAction(mousePressed: 16)
userAction(mousePressed: 16)
setStatusAtomPicked(17,C11 #18)
userAction(mousePressed: 16)
setStatusAtomPicked(36,H5 #37)
userAction(mousePressed: 16)
setStatusAtomPicked(18,C12 #19)
userAction(mousePressed: 16)
userAction(mousePressed: 16)
setStatusAtomPicked(29,C23 #30)
userAction(mousePressed: 16)
setStatusAtomPicked(45,H14 #46)
userAction(mousePressed: 16)
setStatusAtomPicked(46,H15 #47)
best,
tim
--
Timothy Driscoll em: [EMAIL PROTECTED]
molvisions - see. grasp. learn. ph: 919-368-2667
<http://www.molvisions.com/> im: molvisions
usa:virginia:blacksburg tx: [EMAIL PROTECTED]
"Pain heals. Chicks dig scars. Glory lasts forever."
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0709&bid&3057&dat1642
_______________________________________________
Jmol-developers mailing list
Jmol-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-developers