(JAL-969) refactored alignmentViewport base class to own package and pulled up most...
[jalview.git] / src / jalview / datamodel / AlignmentAnnotation.java
index 9037008..25bba51 100755 (executable)
@@ -1,6 +1,6 @@
 /*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.6)
- * Copyright (C) 2010 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
@@ -37,7 +37,7 @@ public class AlignmentAnnotation
   public boolean autoCalculated = false;
 
   public String annotationId;
-
+  
   public SequenceI sequenceRef;
 
   /** DOCUMENT ME!! */
@@ -53,6 +53,8 @@ public class AlignmentAnnotation
    * RNA secondary structure contact positions
    */
   public SequenceFeature[] _rnasecstr = null;
+  
+  public String rnaStructure;
 
   /**
    * Updates the _rnasecstr field Determines the positions that base pair and
@@ -64,6 +66,8 @@ public class AlignmentAnnotation
   {
     _rnasecstr = Rna.GetBasePairs(RNAannot);
     Rna.HelixMap(_rnasecstr);
+    
+    setRNAStruc(RNAannot);
 
     if (_rnasecstr != null && _rnasecstr.length > 0)
     {
@@ -73,7 +77,7 @@ public class AlignmentAnnotation
     }
     // System.out.println("featuregroup " + _rnasecstr[0].getFeatureGroup());
   }
-
+  
   public java.util.Hashtable sequenceMapping;
 
   /** DOCUMENT ME!! */
@@ -304,7 +308,15 @@ public class AlignmentAnnotation
     annotationId = this.hashCode() + "";
   }
 
-  /**
+  public void setRNAStruc(String string) {
+       rnaStructure=string;    
+}
+  
+  public String getRNAStruc(){
+         return rnaStructure;
+  }
+
+/**
    * Creates a new AlignmentAnnotation object.
    * 
    * @param label
@@ -872,6 +884,12 @@ public class AlignmentAnnotation
   {
     if (seqname && this.sequenceRef != null)
     {
+      int i=description.toLowerCase().indexOf("<html>");
+      if (i>-1)
+      {
+        // move the html tag to before the sequence reference.
+        return "<html>"+sequenceRef.getName()+" : "+description.substring(i+6);
+      }
       return sequenceRef.getName() + " : " + description;
     }
     return description;