JAL-942 - make sure rna structures get a sensible name
authorjprocter <jprocter@compbio.dundee.ac.uk>
Mon, 5 Mar 2012 09:16:01 +0000 (10:16 +0100)
committerjprocter <jprocter@compbio.dundee.ac.uk>
Mon, 5 Mar 2012 09:16:01 +0000 (10:16 +0100)
src/jalview/gui/AppVarna.java
src/jalview/gui/PopupMenu.java

index 7be007a..27c28ad 100644 (file)
@@ -73,7 +73,7 @@ public class AppVarna extends JInternalFrame implements
 
   AlignmentPanel ap;
 
-  public AppVarna(SequenceI seq, String strucseq, String struc,
+  public AppVarna(String sname, SequenceI seq, String strucseq, String struc,
           String name, AlignmentPanel ap)
   {
     this.ap = ap;
@@ -94,7 +94,7 @@ public class AppVarna extends JInternalFrame implements
     rnaList.add(rna1);
     rnas.put(seq, rna1);
     rnas.put(seq, trim);
-    rna1.setName("consensus_" + rna1.getName());
+    rna1.setName(sname+" (with gaps)");
 
     {
       seqs.put(trim, seq);
index 6139764..53ef5e8 100644 (file)
@@ -270,14 +270,14 @@ public class PopupMenu extends JPopupMenu
           if (aa[i].getRNAStruc() != null)
           {
             final String rnastruc = aa[i].getRNAStruc();
-            
+            final String structureLine=aa[i].label;
             menuItem = new JMenuItem();
-            menuItem.setText("RNA structure - consensus");
+            menuItem.setText("RNA structure "+structureLine);
             menuItem.addActionListener(new java.awt.event.ActionListener()
             {
               public void actionPerformed(ActionEvent e)
               {
-                new AppVarna(seq, seq.getSequenceAsString(), rnastruc, seq
+                new AppVarna(structureLine, seq, seq.getSequenceAsString(), rnastruc, seq
                         .getName(), ap);
               }
             });
@@ -304,7 +304,7 @@ public class PopupMenu extends JPopupMenu
                 public void actionPerformed(ActionEvent e)
                 {
                   // TODO: VARNA does'nt print gaps in the sequence
-                  new AppVarna(seq,seq.getSequenceAsString(), rnastruc, seq
+                  new AppVarna(seq.getName()+" structure",seq,seq.getSequenceAsString(), rnastruc, seq
                           .getName(), ap);
                 }
               });