From 9c41a929be328ca4c0039ae7594cf3925c1e03fe Mon Sep 17 00:00:00 2001 From: amwaterhouse Date: Tue, 6 Feb 2007 15:52:17 +0000 Subject: [PATCH] Dont add null description to tooltip --- src/jalview/gui/AnnotationPanel.java | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/jalview/gui/AnnotationPanel.java b/src/jalview/gui/AnnotationPanel.java index 1ebabfe..0427ecb 100755 --- a/src/jalview/gui/AnnotationPanel.java +++ b/src/jalview/gui/AnnotationPanel.java @@ -492,6 +492,7 @@ public class AnnotationPanel extends JPanel implements MouseListener, if (aa == null) { + this.setToolTipText(null); return; } @@ -514,7 +515,10 @@ public class AnnotationPanel extends JPanel implements MouseListener, } if(row==-1) - return; + { + this.setToolTipText(null); + return; + } int res = (evt.getX() / av.getCharWidth()) + av.getStartRes(); @@ -546,12 +550,16 @@ public class AnnotationPanel extends JPanel implements MouseListener, if(aa[row].annotations[res]!=null) { StringBuffer text = new StringBuffer("Sequence position " + - (res + 1) + " " + - aa[row].annotations[res].description); + (res + 1)); + + if (aa[row].annotations[res].description != null) + text.append(" " + aa[row].annotations[res].description); ap.alignFrame.statusBar.setText(text.toString()); } } + else + this.setToolTipText(null); } /** -- 1.7.10.2