From 40b116609ba77bee19c5ff8968dec1f9b1382e65 Mon Sep 17 00:00:00 2001 From: gmungoc Date: Fri, 26 May 2017 12:05:38 +0100 Subject: [PATCH] JAL-2290 no update if no change of residue JAL-2547 no features on tooltip over gap --- src/jalview/gui/SeqPanel.java | 35 +++++++++++++++++++++++++++-------- 1 file changed, 27 insertions(+), 8 deletions(-) diff --git a/src/jalview/gui/SeqPanel.java b/src/jalview/gui/SeqPanel.java index 7dfac5e..dd1c68f 100644 --- a/src/jalview/gui/SeqPanel.java +++ b/src/jalview/gui/SeqPanel.java @@ -84,6 +84,16 @@ public class SeqPanel extends JPanel implements MouseListener, /** DOCUMENT ME!! */ public AlignmentPanel ap; + /* + * last column position for mouseMoved event + */ + private int lastMouseColumn; + + /* + * last sequence offset for mouseMoved event + */ + private int lastMouseSeq; + protected int lastres; protected int startseq; @@ -170,6 +180,9 @@ public class SeqPanel extends JPanel implements MouseListener, ssm.addStructureViewerListener(this); ssm.addSelectionListener(this); } + + lastMouseColumn = -1; + lastMouseSeq = -1; } int startWrapBlock = -1; @@ -747,6 +760,15 @@ public class SeqPanel extends JPanel implements MouseListener, { return; } + if (column == lastMouseColumn && seq == lastMouseSeq) + { + /* + * just a pixel move without change of residue + */ + return; + } + lastMouseColumn = column; + lastMouseSeq = seq; SequenceI sequence = av.getAlignment().getSequenceAt(seq); @@ -802,18 +824,15 @@ public class SeqPanel extends JPanel implements MouseListener, } else { - if (lastTooltip == null - || !lastTooltip.equals(tooltipText.toString())) + String textString = tooltipText.toString(); + if (lastTooltip == null || !lastTooltip.equals(textString)) { String formatedTooltipText = JvSwingUtils.wrapTooltip(true, - tooltipText.toString()); - // String formatedTooltipText = tooltipText.toString(); + textString); setToolTipText(formatedTooltipText); - lastTooltip = tooltipText.toString(); + lastTooltip = textString; } - } - } private Point lastp = null; @@ -907,9 +926,9 @@ public class SeqPanel extends JPanel implements MouseListener, } int pos = -1; - pos = sequence.findPosition(column); if (residue != null) { + pos = sequence.findPosition(column); text.append(" (").append(Integer.toString(pos)).append(")"); } ap.alignFrame.statusBar.setText(text.toString()); -- 1.7.10.2