ToolTip updated
authoramwaterhouse <Andrew Waterhouse>
Tue, 14 Jun 2005 15:06:03 +0000 (15:06 +0000)
committeramwaterhouse <Andrew Waterhouse>
Tue, 14 Jun 2005 15:06:03 +0000 (15:06 +0000)
src/jalview/gui/AnnotationPanel.java
src/jalview/gui/RotatableCanvas.java

index 449c449..50c9fef 100755 (executable)
@@ -52,13 +52,14 @@ public class AnnotationPanel
 \r
   public AnnotationPanel(AlignmentPanel ap)\r
   {\r
+    ToolTipManager.sharedInstance().registerComponent(this);\r
+    ToolTipManager.sharedInstance().setInitialDelay(0);\r
+    ToolTipManager.sharedInstance().setDismissDelay(10000);\r
     this.ap = ap;\r
     av = ap.av;\r
     this.setLayout(null);\r
     addMouseListener(this);\r
     addMouseMotionListener(this);\r
-    adjustPanelHeight();\r
-\r
     ap.annotationScroller.getVerticalScrollBar().addAdjustmentListener(this);\r
   }\r
 \r
@@ -259,6 +260,26 @@ public class AnnotationPanel
 \r
   public void mousePressed(MouseEvent evt)\r
   {\r
+    int height = 0;\r
+    activeRow = -1;\r
+    AlignmentAnnotation[] aa = av.alignment.getAlignmentAnnotation();\r
+\r
+    for (int i = 0; i < aa.length; i++)\r
+    {\r
+      height += aa[i].height;\r
+\r
+      if (evt.getY() < height)\r
+      {\r
+        if (aa[i].editable)\r
+           activeRow = i;\r
+         else\r
+           activeRes = null;\r
+\r
+        break;\r
+      }\r
+    }\r
+\r
+\r
     if (SwingUtilities.isRightMouseButton(evt))\r
     {\r
       if (activeRes == null)\r
@@ -266,6 +287,7 @@ public class AnnotationPanel
         return;\r
       }\r
 \r
+\r
       JPopupMenu pop = new JPopupMenu("Structure type");\r
       JMenuItem item = new JMenuItem(HELIX);\r
       item.addActionListener(this);\r
@@ -287,34 +309,12 @@ public class AnnotationPanel
       return;\r
     }\r
 \r
-    AlignmentAnnotation[] aa = av.alignment.getAlignmentAnnotation();\r
 \r
     if (aa == null)\r
     {\r
       return;\r
     }\r
 \r
-    int height = 0;\r
-    activeRow = -1;\r
-\r
-    for (int i = 0; i < aa.length; i++)\r
-    {\r
-      height += aa[i].height;\r
-\r
-      if (evt.getY() < height)\r
-      {\r
-        if (!aa[i].editable)\r
-        {\r
-          activeRes = null;\r
-\r
-          continue;\r
-        }\r
-\r
-        activeRow = i;\r
-\r
-        break;\r
-      }\r
-    }\r
 \r
     int res = (evt.getX() / av.getCharWidth()) + av.getStartRes();\r
 \r
@@ -374,8 +374,6 @@ public class AnnotationPanel
 \r
   public void mouseMoved(MouseEvent evt)\r
   {\r
-    ToolTipManager.sharedInstance().registerComponent(this);\r
-\r
     AlignmentAnnotation[] aa = av.alignment.getAlignmentAnnotation();\r
 \r
     if (aa == null)\r
index 6ae66a2..c3384f9 100755 (executable)
@@ -75,9 +75,10 @@ public class RotatableCanvas
     this.npoint = npoint;\r
     this.av = av;\r
     ToolTipManager.sharedInstance().registerComponent(this);\r
+    ToolTipManager.sharedInstance().setInitialDelay(0);\r
+    ToolTipManager.sharedInstance().setDismissDelay(10000);\r
     PaintRefresher.Register(this, av.alignment);\r
 \r
-    //\r
     prefsize = getPreferredSize();\r
     orig = new float[npoint][3];\r
 \r