From: gmungoc Date: Fri, 26 May 2017 11:05:38 +0000 (+0100) Subject: JAL-2290 no update if no change of residue JAL-2547 no features on X-Git-Tag: Release_2_10_3b1~228 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=40b116609ba77bee19c5ff8968dec1f9b1382e65;p=jalview.git JAL-2290 no update if no change of residue JAL-2547 no features on tooltip over gap --- 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());