Update overview on conservation/pid slider mouseRelease
authoramwaterhouse <Andrew Waterhouse>
Fri, 11 Aug 2006 16:34:23 +0000 (16:34 +0000)
committeramwaterhouse <Andrew Waterhouse>
Fri, 11 Aug 2006 16:34:23 +0000 (16:34 +0000)
src/jalview/appletgui/SliderPanel.java
src/jalview/gui/SliderPanel.java
src/jalview/jbgui/GSliderPanel.java

index c343df9..ed156a7 100755 (executable)
@@ -27,7 +27,10 @@ import java.awt.event.*;
 import jalview.datamodel.*;\r
 import jalview.schemes.*;\r
 \r
-public class SliderPanel extends Panel implements ActionListener, AdjustmentListener\r
+public class SliderPanel extends Panel\r
+    implements ActionListener,\r
+    AdjustmentListener,\r
+    MouseListener\r
 {\r
   AlignmentPanel ap;\r
   boolean forConservation = true;\r
@@ -177,6 +180,7 @@ public class SliderPanel extends Panel implements ActionListener, AdjustmentList
     }\r
 \r
     slider.addAdjustmentListener(this);\r
+    slider.addMouseListener(this);\r
 \r
     slider.setValue(value);\r
     valueField.setText(value + "");\r
@@ -325,10 +329,23 @@ public class SliderPanel extends Panel implements ActionListener, AdjustmentList
   }\r
 \r
   protected void applyButton_actionPerformed()\r
-  {\r
-  }\r
+  { }\r
 \r
   protected void undoButton_actionPerformed()\r
+  { }\r
+\r
+  public void mousePressed(MouseEvent evt)\r
+  { }\r
+\r
+  public void mouseReleased(MouseEvent evt)\r
   {\r
+    if (ap.overviewPanel != null)\r
+      ap.overviewPanel.updateOverviewImage();\r
   }\r
+  public void mouseClicked(MouseEvent evt)\r
+  {}\r
+  public void mouseEntered(MouseEvent evt)\r
+  {}\r
+  public void mouseExited(MouseEvent evt)\r
+  {}\r
 }\r
index b830d5d..9f4ab05 100755 (executable)
@@ -342,4 +342,11 @@ public class SliderPanel extends GSliderPanel
     {\r
         return Integer.parseInt(valueField.getText());\r
     }\r
+\r
+    public void slider_mouseReleased(MouseEvent e)\r
+    {\r
+      if (ap.overviewPanel != null)\r
+        ap.overviewPanel.updateOverviewImage();\r
+    }\r
+\r
 }\r
index d245442..da5f4e8 100755 (executable)
@@ -76,7 +76,14 @@ public class GSliderPanel extends JPanel
         slider.setBackground(Color.white);\r
         slider.setFont(new java.awt.Font("Verdana", 0, 11));\r
         slider.setDoubleBuffered(true);\r
-        valueField.setFont(new java.awt.Font("Verdana", 0, 11));\r
+    slider.addMouseListener(new MouseAdapter()\r
+    {\r
+      public void mouseReleased(MouseEvent e)\r
+      {\r
+        slider_mouseReleased(e);\r
+      }\r
+    });\r
+    valueField.setFont(new java.awt.Font("Verdana", 0, 11));\r
         valueField.setMinimumSize(new Dimension(6, 14));\r
         valueField.setPreferredSize(new Dimension(50, 12));\r
         valueField.setText("");\r
@@ -179,4 +186,9 @@ public class GSliderPanel extends JPanel
     protected void allGroupsCheck_actionPerformed(ActionEvent e)\r
     {\r
     }\r
-}\r
+\r
+    public void slider_mouseReleased(MouseEvent e)\r
+    {\r
+\r
+    }\r
+  }\r