From: jprocter Date: Fri, 23 Apr 2010 15:10:22 +0000 (+0000) Subject: tooltip is not shown for Annotation elements with zero length description X-Git-Tag: Release_2_5~50 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=c238278a92902fee2d4f10b6837dcdf9a841e579;p=jalview.git tooltip is not shown for Annotation elements with zero length description --- diff --git a/src/jalview/gui/AnnotationPanel.java b/src/jalview/gui/AnnotationPanel.java index 695eced..665b3ff 100755 --- a/src/jalview/gui/AnnotationPanel.java +++ b/src/jalview/gui/AnnotationPanel.java @@ -561,7 +561,7 @@ public class AnnotationPanel extends JPanel implements MouseListener, res = av.getColumnSelection().adjustForHiddenColumns(res); } - if (aa[row].annotations != null && row > -1 + if (row > -1 && aa[row].annotations != null && res < (int) aa[row].annotations.length) { if (aa[row].graphGroup > -1) @@ -583,10 +583,15 @@ public class AnnotationPanel extends JPanel implements MouseListener, } } else if (aa[row].annotations[res] != null - && aa[row].annotations[res].description != null) + && aa[row].annotations[res].description != null && aa[row].annotations[res].description.length()>0) { this.setToolTipText(aa[row].annotations[res].description); } + else + { + // clear the tooltip. + this.setToolTipText(null); + } if (aa[row].annotations[res] != null) {