tooltip is not shown for Annotation elements with zero length description
authorjprocter <Jim Procter>
Fri, 23 Apr 2010 15:10:22 +0000 (15:10 +0000)
committerjprocter <Jim Procter>
Fri, 23 Apr 2010 15:10:22 +0000 (15:10 +0000)
src/jalview/gui/AnnotationPanel.java

index 695eced..665b3ff 100755 (executable)
@@ -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)
       {