> I was wondering whether you would mind adding a viewer.setFrame(int
> frameNumber)
The routines to do this are already in there.
viewer.setDisplayModelIndex(modelIndex)
where modelIndex is in the range 0 through (viewer.getModelCount() - 1)
To map from modelNumber to modelIndex you can use:
viewer.getModelNumberIndex(modelNumber)
(you probably don't need to do this)
> so I can directly switch to a frame without using a
> script. The reason is that the only way I could flip through frames
> ('animate') is by using a script and delay (like you suggested) in
> which case I don't get notified about the frame change, nor am I on
> control myself anymore...
Be advised that if you try to handle this yourself then you may encounter
some difficulties that (perhaps) you have not anticipated.
You are going to have to set up a timer so that you know when to change
frames. But you cannot do all this in the swing user-interface thread.
That thread needs to return control so that other user actions can be
handled.
Therefore, you will need to spawn another thread to handle your slide
show. I suspect that is more work than you have anticipated. Programming
correctly with threads is *not* easy, in spite of what the java tutorials
say.
You indicated that you wanted to be notified of frame change. I think it
would be better for us to put that notification in, because then other
pieces of the UI (animation/vibration/?) could benefit from the same
thing.
Miguel
-----
Open Source Molecular Visualization
www.jmol.org
[EMAIL PROTECTED]
-----
-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_idU88&alloc_id065&op=click
_______________________________________________
Jmol-developers mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jmol-developers