[EMAIL PROTECTED] wrote:
>ah, one more thought!
>
>
>Try
>
>var infoString = jmolScriptWait("shapeInfo")
>
>or
>
>var V = jmolGetPropertyAsArray("shapeInfo").Draw.obj[0].vertices
>
>array V will now be a full list of the vertices for all models.
>
>
>
The command works. But since it doesn't provide for which object the
coordinates are, I guess I will have to use 'jmolGetPropertyAsJSON' to
get all necessary information. I have to take a deeper look into that
before I am able to use it, but I like the possibility to get all
necessary information for all draw objects at once.
>
>
>>[EMAIL PROTECTED] wrote:
>>
>>
>>>>The next issue (if 'show draw' works correctly) is to read the
>>>>information from Jmol and to generate the corresponding 'echo' command.
>>>>To avoid parsing the message callback stream, I tried the
>>>>'jmolScriptWait' command for the first time. But it totally freezes
>>>>Firefox 1.5.0.7 with Java 1.4.2_11 on SuSE linux 9.3. The browser
>>>>freezes independant of the script command I used.
>>>>
>>>>
>>>Interesting -- this means that those browsers are using the event queue.
>>>David Evans at Eli Lilly had this problem with the application (as
>>>opposed
>>>to the applet). The solution for applications was to make sure you call
>>>scriptWait() from a new thread rather than the one associated with a user
>>>action, like clicking a button.
>>>
>>>Something to try: If the jmolScriptWait function is being run because the
>>>user has clicked on a link or button, try making sure that the button
>>>method looks like this:
>>>
>>>
>>> onClick="setTimeout('clickAction()', 100)"
>>>
>>>
>>>the 100-ms delay won't be noticed by the user, but a new thread is
>>>started
>>>that isn't the event queue thread. So it shouldn't hang the program. Then
>>>
>>>function clickAction() {
>>> var info = jmolScriptWait("draw $border1;show draw")
>>>}
>>>
>>>If anything will work, that stands the best chance.
>>>
>>>I seem to remember having this sort of problem with Opera browsers some
>>>eons ago, even with regular scripting, and the only solution was to use
>>>setTimeout() this way with every user-derived action.
>>>
>>>
>>>
>>>
>>Unfortunately it doesn't work. Without 'jmolScriptWait' in 'clickAction'
>>the method works, but with it the browser freezes.
>>
>>
The freezing problem seems to depend additionally on other things. Today
Firefox didn't freeze either with or without the timeout. I restarted
the browser several times and never got a freeze. Yesterday I always got
a freeze, but I am not aware of any change (not even a reboot or a new X
server session). So 'jmolScriptWait' unfortunately still remains on my
"don't use it" list.
I noticed a strange behaviour of the 'show draw' command. If the
definition command and the show command are provided within a single
'jmolScript' command, no coordinates are shown. Only if they are
provided within different 'jmolScript' commands the coordinates are shown:
jmolScript("draw line1 (atomno=1) (atomno=2); draw line1; show draw;");
-> WITHOUT COORDINATES
jmolScript("draw line1 (atomno=1) (atomno=2);");
jmolScript("draw line1; show draw;");
-> WITH COORDINATES
Sometimes the 'show draw' command freezes Jmol with the following error
message (I couldn't figure out any specific condition, version 10.9.86):
java.lang.NullPointerException
at org.jmol.viewer.Draw.getDrawCommand(Draw.java:658)
at org.jmol.viewer.Draw.getProperty(Draw.java:217)
at org.jmol.viewer.Frame.getShapeProperty(Frame.java:1096)
at org.jmol.viewer.ModelManager.getShapeProperty(ModelManager.java:393)
at org.jmol.viewer.Viewer.getShapeProperty(Viewer.java:2475)
at org.jmol.viewer.Eval.show(Eval.java:4720)
at org.jmol.viewer.Eval.instructionDispatchLoop(Eval.java:610)
at org.jmol.viewer.Eval.runEval(Eval.java:104)
at org.jmol.viewer.Viewer.evalStringWaitStatus(Viewer.java:2289)
at org.jmol.viewer.ScriptManager.runScript(ScriptManager.java:130)
at org.jmol.viewer.ScriptManager.runNextScript(ScriptManager.java:119)
at
org.jmol.viewer.ScriptManager$ScriptQueueRunnable.run(ScriptManager.java:147)
at java.lang.Thread.run(Thread.java:534)
Besides the Java console shows sometimes the following error message (no
freezing of Jmol):
java.lang.IllegalArgumentException: null source
at java.util.EventObject.<init>(EventObject.java:34)
at java.awt.AWTEvent.<init>(AWTEvent.java:252)
at java.awt.event.ComponentEvent.<init>(ComponentEvent.java:94)
at java.awt.event.WindowEvent.<init>(WindowEvent.java:174)
at java.awt.event.WindowEvent.<init>(WindowEvent.java:211)
at
java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:576)
at java.awt.Component.dispatchEventImpl(Component.java:3506)
at java.awt.Container.dispatchEventImpl(Container.java:1627)
at java.awt.Window.dispatchEventImpl(Window.java:1606)
at java.awt.Component.dispatchEvent(Component.java:3477)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:480)
at java.awt.SequencedEvent.dispatch(SequencedEvent.java:93)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:478)
at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)
Regards,
Rolf
-------------------------------------------------------------------------
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&kid=120709&bid=263057&dat=121642
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users