Tooltip for hidden columns
authoramwaterhouse <Andrew Waterhouse>
Thu, 16 Mar 2006 15:28:13 +0000 (15:28 +0000)
committeramwaterhouse <Andrew Waterhouse>
Thu, 16 Mar 2006 15:28:13 +0000 (15:28 +0000)
src/jalview/gui/ScalePanel.java

index 87e72dc..07be3d0 100755 (executable)
@@ -83,6 +83,8 @@ public class ScalePanel extends JPanel implements MouseMotionListener, MouseList
                 av.getColumnSelection().revealHiddenColumns(reveal[0], av);\r
                 reveal = null;\r
                 ap.repaint();\r
+                if(ap.overviewPanel != null)\r
+                    ap.overviewPanel.updateOverviewImage();\r
               }\r
             });\r
             pop.add(item);\r
@@ -97,6 +99,8 @@ public class ScalePanel extends JPanel implements MouseMotionListener, MouseList
                   av.getColumnSelection().revealAllHiddenColumns(av);\r
                   reveal = null;\r
                   ap.repaint();\r
+                  if(ap.overviewPanel != null)\r
+                    ap.overviewPanel.updateOverviewImage();\r
                 }\r
               });\r
               pop.add(item);\r
@@ -117,6 +121,8 @@ public class ScalePanel extends JPanel implements MouseMotionListener, MouseList
               {\r
                 av.getColumnSelection().hideColumns(res, av);\r
                 ap.repaint();\r
+                if(ap.overviewPanel != null)\r
+                  ap.overviewPanel.updateOverviewImage();\r
               }\r
             });\r
             pop.add(item);\r
@@ -260,8 +266,13 @@ public class ScalePanel extends JPanel implements MouseMotionListener, MouseList
         if(res+1==region[0] || res-1==region[1])\r
         {\r
           reveal = region;\r
+          ToolTipManager.sharedInstance().registerComponent(this);\r
+          this.setToolTipText("Reveal Hidden Columns with Right Mouse Button");\r
           break;\r
         }\r
+        else\r
+          this.setToolTipText(null);\r
+\r
       }\r
 \r
       repaint();\r
@@ -353,8 +364,8 @@ public class ScalePanel extends JPanel implements MouseMotionListener, MouseList
           {\r
             res = av.getColumnSelection().findHiddenRegionPosition( i )-startx;\r
 \r
-            gg.fillPolygon(new int[] { res*av.charWidth - 4,\r
-                                         res*av.charWidth + 4,\r
+            gg.fillPolygon(new int[] { res*av.charWidth - av.charHeight/4,\r
+                                         res*av.charWidth + av.charHeight/4,\r
                                          res*av.charWidth },\r
                                 new int[]\r
                                 {\r
@@ -362,6 +373,7 @@ public class ScalePanel extends JPanel implements MouseMotionListener, MouseList
                                     y + 8\r
                                 }, 3);\r
 \r
+\r
           }\r
 \r
           if (reveal != null && reveal[0] > startx && reveal[0] < endx)\r