From: Jim P. <jpr...@co...> - 2010-09-13 16:23:35
|
Hi Bob - thanks so much for doing this! On 11/09/2010 20:23, Robert Hanson wrote: > This is done. Check SVN. examples/basic/org/jmol/Integration.java now > show how one can easily integrate the console into another > application, using an application JPanel instead of a dialog for > holding the console. You can also pick and choose the buttons you > want, including their order. I tested it out, and after a little bit of headscratching to work out a final wrinkle, got it functioning in Jalview. The wrinkle is that by default, the console is hidden in Jalview, but should the user open it via the Jmol menu, then it appears in a panel below the Jmol render frame (any windows after that appear in their own free-floating windows and it's up to the user to keep track of which affects where). After that, hitting the Hide button should hide the pane, restoring the full size Jmol render panel. In order to implement the optional embedded display, I pass an instance of the JmolAppConsoleInterface that proxies all but the setVisible(boolean) method to the embedded AppJmolConsole instance. This was because I needed to trap the calls to setVisible so I could create/hide the panel containing the console. All works fine, except that when the 'Hide' button is clicked, the panel wasn't being hidden because the event is only handled if the jcd JDialog reference is non-null. I've submitted a three line patch to the sourceforge tracker (here: https://sourceforge.net/tracker/?func=detail&aid=3065392&group_id=23629&atid=379135 <https://sourceforge.net/tracker/?func=detail&aid=3065392&group_id=23629&atid=379135> ) which fixes this. I noticed you've been working on the Jmol applet console package as well. WIll you be able to propagate the console embedding capability to that console implementation too ? If you do, then I'll do the same trick in the JalviewLite/JmolApplet code. Cheers! Jim. -- ------------------------------------------------------------------- J. B. Procter (JALVIEW/ENFIN) Barton Bioinformatics Research Group Phone/Fax:+44(0)1382 388734/345764 http://www.compbio.dundee.ac.uk The University of Dundee is a Scottish Registered Charity, No. SC015096. |