Nico, yes, I think we can have it both ways. Within Java, what we can do is pass a true Java class object. It might take some thinking to set that up properly. Basically we can have getProperty() as accessed by JavaScript return a different type of value as getProperty() as accessed by Java. The idea would be:

a) renaming the function in viewer, perhaps to getPropertyJSON()
b) having applet.Jmol expose getProperty() as an alias for viewer.getPropertyJSON.
c) writing a new viewer.getProperty() that delivers equivalent Java objects.
d) copying or moving the getProperty() declarations from the WrappedApplet interface to (where?).


Bob


[EMAIL PROTECTED] wrote:

Hi Bob and others,

I think it's nice to add methods to be able to get more infos from the applet, 
but it would be helpful to have the same kind of infos from the Java code.
Especially, that would be useful to enhance the povray export function which 
has no more access to the internal Jmol data than the applet.

While JSON strings are very interesting from the JavaScript perspective, it's 
not as interesting from the Java perspective because there's the need to decode 
the JSON string.

Would it possible to modify the getProperty() mechanism you are currently 
implementing to satisfy both needs (JavaScript and Java) ?

I was thinking that maybe it could be done by separating the JSON encoding from 
the gathering of properties:
- have a getProperty() method that would return Java objects
- have a getJSONProperty() method that would use getProperty() to get the data 
and then convert the data to the JSON format.

What do you think ?

Nico



-------------------------------------------------------
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_______________________________________________
Jmol-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-developers




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