tooltip displays formatted annotation row description including sequence reference...
authorjprocter <Jim Procter>
Wed, 20 Aug 2008 15:53:34 +0000 (15:53 +0000)
committerjprocter <Jim Procter>
Wed, 20 Aug 2008 15:53:34 +0000 (15:53 +0000)
help/html/features/annotationsFormat.html
src/jalview/appletgui/AnnotationLabels.java
src/jalview/datamodel/AlignmentAnnotation.java
src/jalview/gui/AnnotationLabels.java

index b029e96..afee3b8 100755 (executable)
@@ -52,6 +52,9 @@ definition with the line:
 All Annotations defined after a SEQUENCE_REF command will then be
 associated with that sequence, and the first field in the Value field
 list will (optionally) be placed at the <em>startIndex</em>'th column.</p>
+<ul><em>New in Jalview 2.4</em>: the tooltip displayed when the mouse is moved over the row 
+label for sequence associated annotation  gives the associated 
+sequence's name followed by the annotation row's description.</ul> 
 <p>Sequence associations are turned off for subsequent annotation
 definitions by: 
 <pre>SEQUENCE_REF&#9;ALIGNMENT</pre>
index 5ddaa5e..2d2d748 100755 (executable)
@@ -199,14 +199,13 @@ public class AnnotationLabels
       if (tooltip == null)
       {
         tooltip = new Tooltip(ap.av.alignment.
-                              getAlignmentAnnotation()[row].
-                              description,
+                              getAlignmentAnnotation()[row].getDescription(true),
                               this);
       }
       else
       {
         tooltip.setTip(ap.av.alignment.
-                       getAlignmentAnnotation()[row].description);
+                       getAlignmentAnnotation()[row].getDescription(true));
       }
     }
     else if (tooltip != null)
index 40d2b7e..f2864db 100755 (executable)
@@ -699,4 +699,18 @@ public class AlignmentAnnotation
       }
     }
   }
+
+  /**
+   * format description string for display
+   * @param seqname
+   * @return Get the annotation description string optionally prefixed by associated sequence name (if any) 
+   */
+  public String getDescription(boolean seqname)
+  {
+    if (seqname && this.sequenceRef!=null)
+    {
+      return sequenceRef.getName()+" : "+description;
+    }
+    return description;
+  }
 }
index c0b8022..2eda839 100755 (executable)
@@ -369,7 +369,7 @@ public class AnnotationLabels
 
       if (aa.description != null && !aa.description.equals("New description"))
       {
-        desc.append(aa.description);
+        desc.append(aa.getDescription(true));
         if(aa.hasScore)
           desc.append("<br>");
       }