From 775dfa570270fb0f0a82948546a816996d999719 Mon Sep 17 00:00:00 2001 From: gmungoc Date: Tue, 16 Jun 2020 13:00:29 +0100 Subject: [PATCH] JAL-3583 better handling of null or empty tooltip on annotation --- src/jalview/gui/AnnotationPanel.java | 4 ++++ src/jalview/gui/SeqPanel.java | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/jalview/gui/AnnotationPanel.java b/src/jalview/gui/AnnotationPanel.java index 0eec840..9dfad08 100755 --- a/src/jalview/gui/AnnotationPanel.java +++ b/src/jalview/gui/AnnotationPanel.java @@ -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; diff --git a/src/jalview/gui/SeqPanel.java b/src/jalview/gui/SeqPanel.java index 9b3ae3e..fdb75a4 100644 --- a/src/jalview/gui/SeqPanel.java +++ b/src/jalview/gui/SeqPanel.java @@ -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 -- 1.7.10.2