From c45ff77fed27bdee9025cca9b16a3c03d8e21674 Mon Sep 17 00:00:00 2001 From: janengelhardt Date: Fri, 1 Jul 2011 16:57:01 +0200 Subject: [PATCH] JAL-842; Give Varna frames name for window organizer; always display the consensus structure and the 'trimmed' structure for a sequence; Change-Id: If4e9b054455de3c0f43967e27fb399df4c23b751 --- src/jalview/gui/AppVarna.java | 46 +++++++++++++++++++------ src/jalview/gui/AppVarnaBinding.java | 63 ++++++++++++++++++++-------------- src/jalview/gui/PopupMenu.java | 2 ++ 3 files changed, 76 insertions(+), 35 deletions(-) diff --git a/src/jalview/gui/AppVarna.java b/src/jalview/gui/AppVarna.java index 7a1e206..012d0d1 100644 --- a/src/jalview/gui/AppVarna.java +++ b/src/jalview/gui/AppVarna.java @@ -48,7 +48,7 @@ public class AppVarna extends JInternalFrame implements InterfaceVARNAListener// VARNAPanel varnaPanel; - String name; + public String name; /*public AppVarna(){ vab = new AppVarnaBinding(); @@ -60,36 +60,62 @@ public class AppVarna extends JInternalFrame implements InterfaceVARNAListener// RNA rna1 = new RNA(name); try { rna1.setRNA(seq,struc); - } catch (ExceptionUnmatchedClosingParentheses e2) { + } catch (ExceptionUnmatchedClosingParentheses e2) { e2.printStackTrace(); } catch (ExceptionFileFormatOrSyntax e3) { e3.printStackTrace(); } rnaList.add(rna1); + rnaList.add(trimRNA(rna1)); vab = new AppVarnaBinding(rnaList); //vab = new AppVarnaBinding(seq,struc); - name=this.name; + //System.out.println("Hallo: "+name); + this.name=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(); setBackground(Color.white); + JSplitPane split = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,true,vab.getListPanel(),varnaPanel); getContentPane().setLayout(new BorderLayout()); - getContentPane().add(varnaPanel, BorderLayout.CENTER); - + getContentPane().add(split, BorderLayout.CENTER); + //getContentPane().add(vab.getTools(), BorderLayout.NORTH); varnaPanel.addVARNAListener(this); - jalview.gui.Desktop.addInternalFrame(this,name,getBounds().width, getBounds().height); + jalview.gui.Desktop.addInternalFrame(this,"VARNA -"+name,getBounds().width, getBounds().height); this.pack(); - this.setVisible(true); - //showPanel(true); + showPanel(true); } + public RNA trimRNA(RNA rna){ + RNA rnaTrim = new RNA(rna.getName()+"_trim"); + String seq=rna.getSeq(); + String struc=rna.getStructDBN(); + String newSeq=""; + String newStruc=""; + for(int i=0;i rnalist){ + public AppVarnaBinding(ArrayList rnaList){ //super("VARNA in Jalview"); - initVarnaEdit(rnalist); + initVarnaEdit(rnaList); } @@ -195,7 +195,7 @@ public class AppVarnaBinding extends jalview.ext.varna.JalviewVarnaBinding imple DefaultListModel dlm = new DefaultListModel(); - int marginTools = 40; + //int marginTools = 40; DefaultListSelectionModel m = new DefaultListSelectionModel(); m.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); @@ -215,13 +215,14 @@ public class AppVarnaBinding extends jalview.ext.varna.JalviewVarnaBinding imple FullBackup sel = (FullBackup) _sideList.getSelectedValue(); Mapping map = Mapping.DefaultOutermostMapping(vp.getRNA().getSize(), sel.rna.getSize()); vp.showRNAInterpolated(sel.rna,sel.config,map); - _seq.setText(sel.rna.getSeq()); - _str.setText(sel.rna.getStructDBN()); + //_seq.setText(sel.rna.getSeq()); + //_str.setText(sel.rna.getStructDBN()); } } }); - + _rnaList = new BackupHolder(dlm,_sideList); + try { vp = new VARNAPanel("0","."); for(int i=0;i