X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FAppVarna.java;h=014e6eb7612a7707c88d08f3d3bf7e0a7620f791;hb=ab43013b7e357b84b4abade0dba949668dfb2a0e;hp=efa9a8a1ceb744ad9fc7c8bff70414c8336f8e3f;hpb=4cea7a0328724b90a6a7c16ae8c926e0cc12cedd;p=jalview.git diff --git a/src/jalview/gui/AppVarna.java b/src/jalview/gui/AppVarna.java index efa9a8a..014e6eb 100644 --- a/src/jalview/gui/AppVarna.java +++ b/src/jalview/gui/AppVarna.java @@ -1,34 +1,51 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8) - * Copyright (C) 2012 J Procter, AM Waterhouse, LM Lui, J Engelhardt, G Barton, M Clamp, S Searle + * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2b1) + * Copyright (C) 2014 The Jalview Authors * * 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. + * 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 . + * You should have received a copy of the GNU General Public License + * along with Jalview. If not, see . + * The Jalview Authors are detailed in the 'AUTHORS' file. */ package jalview.gui; -import java.util.*; +import jalview.bin.Cache; +import jalview.datamodel.ColumnSelection; +import jalview.datamodel.SequenceGroup; +import jalview.datamodel.SequenceI; +import jalview.structure.SecondaryStructureListener; +import jalview.structure.SelectionListener; +import jalview.structure.SelectionSource; +import jalview.structure.StructureSelectionManager; +import jalview.structure.VamsasSource; +import jalview.util.ShiftList; + +import java.awt.BorderLayout; +import java.awt.Color; +import java.util.ArrayList; +import java.util.Hashtable; +import java.util.Map; import java.util.regex.Matcher; import java.util.regex.Pattern; -import java.awt.*; -import javax.swing.*; +import javax.swing.JInternalFrame; +import javax.swing.JSplitPane; import jalview.bin.Cache; -import jalview.datamodel.*; -import jalview.structure.*; import jalview.util.MessageManager; import jalview.util.ShiftList; + import fr.orsay.lri.varna.VARNAPanel; import fr.orsay.lri.varna.exceptions.ExceptionFileFormatOrSyntax; import fr.orsay.lri.varna.exceptions.ExceptionUnmatchedClosingParentheses; @@ -65,12 +82,23 @@ public class AppVarna extends JInternalFrame implements public AppVarna(String sname, SequenceI seq, String strucseq, String struc, String name, AlignmentPanel ap) { + + // System.out.println("1:"+sname); + // System.out.println("2:"+seq); + // System.out.println("3:"+strucseq); + // System.out.println("4:"+struc); + // System.out.println("5:"+name); + // System.out.println("6:"+ap); this.ap = ap; ArrayList rnaList = new ArrayList(); RNA rna1 = new RNA(name); try { + rna1.setRNA(strucseq, replaceOddGaps(struc)); + // System.out.println("The sequence is :"+rna1.getSeq()); + // System.out.println("The sequence is:"+struc); + // System.out.println("The sequence is:"+replaceOddGaps(struc).toString()); } catch (ExceptionUnmatchedClosingParentheses e2) { e2.printStackTrace(); @@ -81,6 +109,7 @@ public class AppVarna extends JInternalFrame implements RNA trim = trimRNA(rna1, "trimmed " + sname); rnaList.add(trim); rnaList.add(rna1); + rnas.put(seq, rna1); rnas.put(seq, trim); rna1.setName(sname + " (with gaps)"); @@ -98,16 +127,18 @@ public class AppVarna extends JInternalFrame implements } vab = new AppVarnaBinding(rnaList); // vab = new AppVarnaBinding(seq,struc); - // System.out.println("Hallo: "+name); this.name = sname + " trimmed to " + name; initVarna(); + ssm = ap.getStructureSelectionManager(); + // System.out.println(ssm.toString()); ssm.addStructureViewerListener(this); ssm.addSelectionListener(this); } public void initVarna() { + // vab.setFinishedInit(false); varnaPanel = vab.get_varnaPanel(); setBackground(Color.white); @@ -118,10 +149,12 @@ public class AppVarna extends JInternalFrame implements // getContentPane().add(vab.getTools(), BorderLayout.NORTH); varnaPanel.addVARNAListener(this); varnaPanel.addSelectionListener(this); - jalview.gui.Desktop.addInternalFrame(this, MessageManager.formatMessage("label.varna_params", new String[]{name}), - getBounds().width, getBounds().height); + jalview.gui.Desktop.addInternalFrame(this, + MessageManager.formatMessage("label.varna_params", new String[] + { name }), getBounds().width, getBounds().height); this.pack(); showPanel(true); + } public String replaceOddGaps(String oldStr) @@ -137,6 +170,7 @@ public class AppVarna extends JInternalFrame implements public RNA trimRNA(RNA rna, String name) { ShiftList offset = new ShiftList(); + RNA rnaTrim = new RNA(name); try { @@ -399,4 +433,18 @@ public class AppVarna extends JInternalFrame implements } + @Override + public void onTranslationChanged() + { + // TODO Auto-generated method stub + + } + + @Override + public void onZoomLevelChanged() + { + // TODO Auto-generated method stub + + } + }