I took a look at your code and think I know what the problem is regarding the VARNA frame appearing outside the Jalview desktop.
Basically, you have jalview.gui.AppVarnaBinding extending from JFrame, rather than the jalview.ext.VarnaBinding class. When your jalview.gui.AppVarna class creates a new varna binding, the JFrame appears outside of the Desktop window, regardless of anything you do to it.
Taking the Jmol viewer as an example, then the classes for embedding Varna should operate in the following way:
jalview.ext.varna.VarnaBinding : Abstract base class that holds references to a Varna display and any associated Jalview objects that the display is viewing. This class contains all the control logic for interfacing between Varna and Jalview's datamodel and events. It implements Jalview and Varna interfaces that enables it to pass events between the two systems, and holds any GUI independent functions useful for doing this.
jalview.gui.VarnaBinding : extends from jalview.ext.varna.VarnaBinding. This is a concrete (non-abstract) class that contains additional control logic and references needed for interfacing between a Varna panel shown in the Jalview Desktop. In particular, it will probably implement abstract methods from jalview.ext.varna.VarnaBinding which contain code that interacts with a jalview.gui.AppVarna panel.
jalview.gui.AppVarna: the parent window for a VARNA frame in the Jalview desktop - should inherit from JInternalFrame (or a GUI skeleton class in jalview.jbgui). Constructors for this class are called by Jalview's Swing GUI code, and should handle any data-retrieval necessary prior to actually creating a VARNA view.
The reason for this complexity is because the ultimate aim is to minimise code duplication between jalview.appletgui and jalview.gui - so all non-gui related stuff sits in jalview.ext.varna. In practice, I suggest you just make sure the class hierarchy is correct, and then worry about refactoring the methods and data to the right place once you have actually got a fully working VARNA instance inside the desktop
Hope this clears any confusion up. If it hasn't, then we can talk about it later today..
On 27/06/2011 10:38, Jan Engelhardt wrote:
I fixed and committed it.
Maybe you can try if it works now.