From: gmungoc Date: Tue, 7 Nov 2017 09:01:44 +0000 (+0000) Subject: JAL-2820 limit length of residue tooltip X-Git-Tag: Release_2_11_0~150 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=78df97942188c9fa75a0ce0de3157b9b434be263;p=jalview.git JAL-2820 limit length of residue tooltip --- diff --git a/src/jalview/gui/SeqPanel.java b/src/jalview/gui/SeqPanel.java index b718783..29f68c1 100644 --- a/src/jalview/gui/SeqPanel.java +++ b/src/jalview/gui/SeqPanel.java @@ -75,12 +75,11 @@ import javax.swing.ToolTipManager; public class SeqPanel extends JPanel implements MouseListener, MouseMotionListener, MouseWheelListener, SequenceListener, SelectionListener - { - /** DOCUMENT ME!! */ + private static final int MAX_TOOLTIP_LENGTH = 300; + public SeqCanvas seqCanvas; - /** DOCUMENT ME!! */ public AlignmentPanel ap; /* @@ -811,6 +810,11 @@ public class SeqPanel extends JPanel } else { + if (tooltipText.length() > MAX_TOOLTIP_LENGTH) // constant + { + tooltipText.setLength(MAX_TOOLTIP_LENGTH); + tooltipText.append("..."); + } String textString = tooltipText.toString(); if (lastTooltip == null || !lastTooltip.equals(textString)) {