Thanks, Miguel. I'm about to check in changes to that:

model number:

1) No change for PDB files (I added the fileManager.isPDB flag for future reference)
2) Other file types just return (modelIndex+1)

exposing Viewer:

Let's talk about the possibility of exposing Viewer. I've made it public in my prototype. This would allow some powerful inter-applet and JavaScript-applet communication, for example:

document.getElementById("jmolAppletX").getProperty("jmolViewer").getCurrentFileAsString()
document.getElementById("jmolAppletX").getProperty("jmolViewer").getFullPathName()
document.getElementById("jmolAppletX").getProperty("jmolViewer").openStringInline("...model data...")
etc.

It seems to me that between this and .scriptWait() we have a very flexible interface. Alternatively, we could create a class specifically for external control that "aliases" the specific viewer methods we really want to expose. What do you think?

Do we know for a fact that this sort of calling is NOT possible with certain Java implementations?

To me, Viewer is the "right" object to make public in this way. By doing that we can simply enable
or disable features as desired just be making the methods public.

I think I see what is going on in the JavaScript now. Class instances and methods are fine; you just can't point to a java data structure for too long (i.e. at all).


Miguel wrote:


I have seen multi-model .xyz files that have some type of
model-identification information on the second line.

This information is now returned as an object by

applet.getProperty("modelInfo").get("models").get(i).get("name"))

or, after converting to JavaScript via JSON:

Info.modelInfo.models[i].name



Bob



-------------------------------------------------------
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

Reply via email to