From 56ad3ae1c8b2fefd7af371049e344acfc1f23944 Mon Sep 17 00:00:00 2001 From: jprocter Date: Wed, 20 Aug 2008 15:53:34 +0000 Subject: [PATCH] tooltip displays formatted annotation row description including sequence reference name (if any) --- help/html/features/annotationsFormat.html | 3 +++ src/jalview/appletgui/AnnotationLabels.java | 5 ++--- src/jalview/datamodel/AlignmentAnnotation.java | 14 ++++++++++++++ src/jalview/gui/AnnotationLabels.java | 2 +- 4 files changed, 20 insertions(+), 4 deletions(-) diff --git a/help/html/features/annotationsFormat.html b/help/html/features/annotationsFormat.html index b029e96..afee3b8 100755 --- a/help/html/features/annotationsFormat.html +++ b/help/html/features/annotationsFormat.html @@ -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 startIndex'th column.

+

Sequence associations are turned off for subsequent annotation definitions by:

SEQUENCE_REF	ALIGNMENT
diff --git a/src/jalview/appletgui/AnnotationLabels.java b/src/jalview/appletgui/AnnotationLabels.java index 5ddaa5e..2d2d748 100755 --- a/src/jalview/appletgui/AnnotationLabels.java +++ b/src/jalview/appletgui/AnnotationLabels.java @@ -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) diff --git a/src/jalview/datamodel/AlignmentAnnotation.java b/src/jalview/datamodel/AlignmentAnnotation.java index 40d2b7e..f2864db 100755 --- a/src/jalview/datamodel/AlignmentAnnotation.java +++ b/src/jalview/datamodel/AlignmentAnnotation.java @@ -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; + } } diff --git a/src/jalview/gui/AnnotationLabels.java b/src/jalview/gui/AnnotationLabels.java index c0b8022..2eda839 100755 --- a/src/jalview/gui/AnnotationLabels.java +++ b/src/jalview/gui/AnnotationLabels.java @@ -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("
"); } -- 1.7.10.2