/* * Jalview - A Sequence Alignment Editor and Viewer (Version 2.6) * Copyright (C) 2010 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle * * This file is part of Jalview. * * Jalview is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. * * Jalview is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with Jalview. If not, see . */ package jalview.gui; import java.util.*; import java.awt.*; import javax.swing.*; import javax.swing.event.*; import java.awt.event.*; import java.io.*; import jalview.api.SequenceStructureBinding; import jalview.bin.Cache; import jalview.datamodel.*; import jalview.gui.ViewSelectionMenu.ViewSetProvider; import jalview.structure.*; import jalview.io.*; import jalview.schemes.*; public class AppVarna extends JInternalFrame // implements Runnable,SequenceStructureBinding, ViewSetProvider { AppVarnaBinding vab; JPanel varnaPanel; String name; //JSplitPane splitPane; //RenderPanel renderPanel; //AlignmentPanel ap; //Vector atomsPicked = new Vector(); public AppVarna(){ vab = new AppVarnaBinding(); initVarna(); } public AppVarna(String seq,String struc,String name){ vab = new AppVarnaBinding(seq,struc); name=this.name; initVarna(); } public void initVarna(){ //TODO: Why is it not possible to include varnaPanel in the AppVarna-Jframe? //vab.setFinishedInit(false); varnaPanel=vab.get_varnaPanel(); //varnaPanel.setVisible(true); //getContentPane().setLayout(new BorderLayout()); //getContentPane().add(varnaPanel, BorderLayout.CENTER); //setVisible(true); //jalview.gui.Desktop.addInternalFrame(this,name,getBounds().width, getBounds().height); showPanel(true); } public void showPanel(boolean show){ vab.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); vab.pack(); vab.setVisible(show); //varnaPanel.setVisible(show); } private boolean _started = false; public void run(){ _started = true; try { initVarna(); } catch (OutOfMemoryError oomerror) { new OOMWarning("When trying to open the Varna viewer!", oomerror); } catch (Exception ex) { Cache.log.error("Couldn't open Varna viewer!", ex); } } }