The return from scriptWait() depends upon what you have asked for in a previous "getProperty()" call. The idea is that we are not going to bog down the applet with keeping track of all the possible feedback unless you ask for it -- sort of like (but better than) the old callback idea that you REQUEST a callback, and only then it is delivered. Specifically, if you want a LOT of feedback, try:

applet.getProperty("jmolStatus","all")

then do

returnInfo = applet.scriptWait()


Something like:

applet = document.getElementById("jmolApplet0")
applet.getProperty("jmolStatus","all")
then:
alert(applet.scriptWait("whateverScriptYouHave"))

and you will see plenty. Options are shown at

http://www.stolaf.edu/people/hansonr/jmol/test/json/spin.htm

after the checkboxes. You can either send them all in one:


applet.getProperty("jmolStatus","scriptStatus|scriptTerminated|scriptEcho")

or you can do

applet.getProperty("jmolStatus","scriptStatus")
applet.getProperty("jmolStatus","+scriptTerminated")
applet.getProperty("jmolStatus","+scriptEcho")

I think you can also do

applet.getProperty("jmolStatus","-scriptEcho")

to remove a stop "listening" to that one.


I'm glad you are trying this; you are getting ahead of me...

Bob







Egon Willighagen wrote:
Hi all,

I'm trying to get secundary structure rendering working in Bioclipse's JmolView...

This is the code I use to run the script String:

BufferedReader reader = new BufferedReader(new StringReader(script));
try {
  String line = reader.readLine();
  while (line != null) {                                        
    System.out.println("To jmol: " + line);
    BioclipseConsole.writeToConsole(
      "Running Jmol script: " + jmolRes.getName());
    String feedback = viewer.script(line);
    BioclipseConsole.writeToConsole("Feedback: " + feedback);
    line = reader.readLine();
 }
} catch (Exception io) {
// should not happen
}

I use a BufferedReader to parse the script line by line... with in mind the option to say on which line a script error is.

The 'script' string reaches Jmol and most works. The Jmol view uses Jmol IO so it should have read the secundary structure info from the PDB file passed from the byte[] from the file.

This is the script that I run:
select *
spacefill OFF
wireframe ON
cartoon ON
rocket ON
ribbons ON

The first three commands work, but the last not :(

I've been trying to debug this, but the script() does not return any feedback... null in all cases, even if I make the script invalid. Also tried evalScript()... all nulls...

What am I doing wrong?

Egon


--

Robert M. Hanson, [EMAIL PROTECTED], 507-646-3107
Professor of Chemistry, St. Olaf College
1520 St. Olaf Ave., Northfield, MN 55057
mailto:[EMAIL PROTECTED]
http://www.stolaf.edu/people/hansonr

"Imagination is more important than knowledge."  - Albert Einstein


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to