From 6f26ddc0736f4e2daf7a9a07f4f257058bbe5605 Mon Sep 17 00:00:00 2001 From: Charles Ofoegbu Date: Tue, 18 Nov 2014 15:28:07 +0000 Subject: [PATCH] JAL-998 tooltip wrapping --- src/jalview/gui/SeqPanel.java | 48 ++++++++++++++++++++++++++++++----------- 1 file changed, 35 insertions(+), 13 deletions(-) diff --git a/src/jalview/gui/SeqPanel.java b/src/jalview/gui/SeqPanel.java index 02c6c16..61782b4 100644 --- a/src/jalview/gui/SeqPanel.java +++ b/src/jalview/gui/SeqPanel.java @@ -20,21 +20,38 @@ */ package jalview.gui; -import java.util.*; -import java.util.List; - -import java.awt.*; -import java.awt.event.*; - -import javax.swing.*; - -import jalview.commands.*; -import jalview.datamodel.*; +import jalview.commands.EditCommand; +import jalview.datamodel.ColumnSelection; +import jalview.datamodel.SearchResults; +import jalview.datamodel.Sequence; +import jalview.datamodel.SequenceFeature; +import jalview.datamodel.SequenceGroup; +import jalview.datamodel.SequenceI; import jalview.io.SequenceAnnotationReport; -import jalview.schemes.*; -import jalview.structure.*; +import jalview.schemes.ResidueProperties; +import jalview.structure.SelectionListener; +import jalview.structure.SelectionSource; +import jalview.structure.SequenceListener; +import jalview.structure.StructureSelectionManager; import jalview.util.MessageManager; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Font; +import java.awt.FontMetrics; +import java.awt.Point; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; +import java.awt.event.MouseMotionListener; +import java.awt.event.MouseWheelEvent; +import java.awt.event.MouseWheelListener; +import java.util.List; +import java.util.Vector; + +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.ToolTipManager; + /** * DOCUMENT ME! * @@ -245,7 +262,9 @@ public class SeqPanel extends JPanel implements MouseListener, .containsKey(features[i].featureGroup) && !((Boolean) seqCanvas.fr.featureGroups .get(features[i].featureGroup)).booleanValue()) + { continue; + } if ((features[i].getBegin() <= res) && (features[i].getEnd() >= res)) @@ -695,7 +714,9 @@ public class SeqPanel extends JPanel implements MouseListener, pos = setStatusMessage(sequence, res, seq); if (ssm != null && pos > -1) + { mouseOverSequence(sequence, res, pos); + } tooltipText.setLength(6); // Cuts the buffer back to @@ -746,7 +767,8 @@ public class SeqPanel extends JPanel implements MouseListener, if (lastTooltip == null || !lastTooltip.equals(tooltipText.toString())) { - setToolTipText(tooltipText.toString()); + setToolTipText(JvSwingUtils.wrapTooltip(true, + tooltipText.toString())); lastTooltip = tooltipText.toString(); } -- 1.7.10.2