Miguel,
I just committed some modifications to the AtomSetChooser. The sliders are not working yet, and some other stuff isn't right yet either. It is very much a work in progress :-). But I think I am making progress.
In any case, I have two problems that I think you can help me out with:
1) the viewer.setDisplayModelIndex(atomSetIndex); call only seems to be updating the viewer if I have vibration turned on or if I activate the viewer window and click in it a second time. I don't understand it, but you can try it out for yourself: load e.g. Samples:Gaussian:H2O_3.log, show the AtomSetChooser, and select in the tree (opening up branches and cursoring down the tree [the sliders don't work yet]). The molecule in the viewer won't change. If you do a 'vibration on' in the script window, you'll see that the model does indeed change as it should.
I had been using the viewer.evalStringQuiet("frame "+viewer.getModelNumber(atomSetIndex)); before, which worked fine..
2) I keep getting warnings:
The static method getIconX(String) from the type JmolResourceHandler should be accessed in a static way
for the code:
JButton btn = new JButton(
JmolResourceHandler.getInstance().getIconX(
"AtomSetChooser."+action+"Image")
);And I haven't been able how to rearrange that so I don't get the warning.
Ren�
On Nov 8, 2004, at 11:19 AM, Ren� Kanters wrote:
On Nov 8, 2004, at 9:41 AM, Miguel wrote:
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)
Right. Sorry I didn't find these myself (it is such a long list of methods to look through :-).
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.
I completely agree.
------------------------------------------------------- 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_id=5588&alloc_id=12065&op=click _______________________________________________ Jmol-developers mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jmol-developers
------------------------------------------------------- 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
