From d2a92c8d68fbbc76964abe962cfd42cc4dfa6d34 Mon Sep 17 00:00:00 2001 From: amwaterhouse Date: Thu, 16 Mar 2006 15:28:13 +0000 Subject: [PATCH] Tooltip for hidden columns --- src/jalview/gui/ScalePanel.java | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/jalview/gui/ScalePanel.java b/src/jalview/gui/ScalePanel.java index 87e72dc..07be3d0 100755 --- a/src/jalview/gui/ScalePanel.java +++ b/src/jalview/gui/ScalePanel.java @@ -83,6 +83,8 @@ public class ScalePanel extends JPanel implements MouseMotionListener, MouseList av.getColumnSelection().revealHiddenColumns(reveal[0], av); reveal = null; ap.repaint(); + if(ap.overviewPanel != null) + ap.overviewPanel.updateOverviewImage(); } }); pop.add(item); @@ -97,6 +99,8 @@ public class ScalePanel extends JPanel implements MouseMotionListener, MouseList av.getColumnSelection().revealAllHiddenColumns(av); reveal = null; ap.repaint(); + if(ap.overviewPanel != null) + ap.overviewPanel.updateOverviewImage(); } }); pop.add(item); @@ -117,6 +121,8 @@ public class ScalePanel extends JPanel implements MouseMotionListener, MouseList { av.getColumnSelection().hideColumns(res, av); ap.repaint(); + if(ap.overviewPanel != null) + ap.overviewPanel.updateOverviewImage(); } }); pop.add(item); @@ -260,8 +266,13 @@ public class ScalePanel extends JPanel implements MouseMotionListener, MouseList if(res+1==region[0] || res-1==region[1]) { reveal = region; + ToolTipManager.sharedInstance().registerComponent(this); + this.setToolTipText("Reveal Hidden Columns with Right Mouse Button"); break; } + else + this.setToolTipText(null); + } repaint(); @@ -353,8 +364,8 @@ public class ScalePanel extends JPanel implements MouseMotionListener, MouseList { res = av.getColumnSelection().findHiddenRegionPosition( i )-startx; - gg.fillPolygon(new int[] { res*av.charWidth - 4, - res*av.charWidth + 4, + gg.fillPolygon(new int[] { res*av.charWidth - av.charHeight/4, + res*av.charWidth + av.charHeight/4, res*av.charWidth }, new int[] { @@ -362,6 +373,7 @@ public class ScalePanel extends JPanel implements MouseMotionListener, MouseList y + 8 }, 3); + } if (reveal != null && reveal[0] > startx && reveal[0] < endx) -- 1.7.10.2