JAL-3583 better handling of null or empty tooltip on annotation
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Tue, 16 Jun 2020 12:00:29 +0000 (13:00 +0100)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Tue, 16 Jun 2020 12:00:29 +0000 (13:00 +0100)
src/jalview/gui/AnnotationPanel.java
src/jalview/gui/SeqPanel.java

index 0eec840..9dfad08 100755 (executable)
@@ -878,6 +878,10 @@ public class AnnotationPanel extends JPanel implements AwtRenderPanelI,
             && ann.annotations[column] != null)
     {
       tooltip = ann.annotations[column].description;
+      if ("".equals(tooltip))
+      {
+        tooltip = null;
+      }
     }
 
     return tooltip;
index 9b3ae3e..fdb75a4 100644 (file)
@@ -1141,7 +1141,8 @@ public class SeqPanel extends JPanel
 
     String tooltip = AnnotationPanel.buildToolTip(anns[rowIndex], column,
             anns);
-    if (!tooltip.equals(lastTooltip))
+    boolean tooltipChanged = tooltip == null ? lastTooltip != null : !tooltip.equals(lastTooltip);
+    if (tooltipChanged)
     {
       lastTooltip = tooltip;
       lastFormattedTooltip = tooltip == null ? null