On Feb 9, 2006, at 2:07 p, Bob Hanson wrote:

I'm looking at the Jmol callback issue.

<snip>
I propose that there be a fundamentally different mechanism that does not rely upon callback functions (but could be backward- compatible with these if desired).

I think this is an excellent idea. Miguel has been hinting at something like this for a while, but the need for it never reached 'critical mass' in the user community (or so I infer from the responses over the months).


The details of the implementation aren't particularly important right now (on this list). But, basically, it would involve one JavaScript timer per applet and the idea of "polling" -- the web page periodically polls the applet -- say, 10 times per second, -- looking for changes of interest to particular properties of the model.

It's relatively simple to implement -- that's not the issue. The issue is this:

AS A USER, WHAT DO YOU WANT?

as a resource developer, I want a way to ask the applet for the status of something, have the applet respond in some logical syntax, and then do with that info whatever I please. for example:

what atom was last picked?
what is the orientation of the molecule?
which atoms are colored red?
what color is this atom?
what is the format of this atom?
is this atom visible?
how many Fe atoms are present in the structure?
what is the currently selected atomset?
which protein residues are in alpha helices?
...


a) Do you implement callbacks? If so, which ones?

yes, pickCallback and messageCallback. in some applications, I use these extensively. it is painful, does not work consistently, and severely hampers platform and browser compatibility. this is no reflection at all on Miguel's implementation of them; as he has said many times before, callbacks are not the ideal solution.


b) What WOULD you use if you had it available?

callbacks?  none, if I didn't have to. :-)


c) What sort of information (exactly) are you looking for?

see examples above. mainly, state of atoms. but given some time, I could probably think up a few new ideas.


d) Is there a particular format that you would like to see,
   other than just the current text-stream of messages?

that will depend on the data, I think. ask for a number, get a number. ask for a set, get an array. ask for a color, get a string. perhaps some kind of javascript Object could handle all cases?


e) Is it important to you that this mechanism be backward
   compatible?

since this is a brand new mechanism, I don't think that backwards- compatibility is even an issue.


MORE SPECIFC QUESTION:

1. There are currently four callbacks:

animFrameCallback
loadStructCallback
pickCallback
messageCallback

Each of these fulfills an obvious need.
Should there be more "callback-like" options?
My primary use of callbacks revolves around polling the applet for information about the structure, or for capturing commands sent to the applet by the user. and really, the former is simply a modification of the latter - with my javascript code in place of the user, since I have to send a command to the applet in order to find out something useful. to me, this functionality should not be in the realm of the callbacks, but handled by something else - exactly what you are proposing, Bob.

as far as querying the applet for its own state - I suppose callbacks could have a purpose here, though I don't use them as such (I generally just watch the applets[] array, for example).


regards,

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]


"Let each and every cell rejoice! For today we celebrate the first, glorious anniversary of the Information Purification Directive! We have created, for the first time in all history, a garden of pure ideology, where each worker may bloom secure from the pests of contradictory and confusing truths."




-------------------------------------------------------
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-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to