From ab9608a2f5459d16f160bdbb229f47c7d9edbcd9 Mon Sep 17 00:00:00 2001 From: amwaterhouse Date: Fri, 11 Aug 2006 16:34:23 +0000 Subject: [PATCH] Update overview on conservation/pid slider mouseRelease --- src/jalview/appletgui/SliderPanel.java | 23 ++++++++++++++++++++--- src/jalview/gui/SliderPanel.java | 7 +++++++ src/jalview/jbgui/GSliderPanel.java | 16 ++++++++++++++-- 3 files changed, 41 insertions(+), 5 deletions(-) diff --git a/src/jalview/appletgui/SliderPanel.java b/src/jalview/appletgui/SliderPanel.java index c343df9..ed156a7 100755 --- a/src/jalview/appletgui/SliderPanel.java +++ b/src/jalview/appletgui/SliderPanel.java @@ -27,7 +27,10 @@ import java.awt.event.*; import jalview.datamodel.*; import jalview.schemes.*; -public class SliderPanel extends Panel implements ActionListener, AdjustmentListener +public class SliderPanel extends Panel + implements ActionListener, + AdjustmentListener, + MouseListener { AlignmentPanel ap; boolean forConservation = true; @@ -177,6 +180,7 @@ public class SliderPanel extends Panel implements ActionListener, AdjustmentList } slider.addAdjustmentListener(this); + slider.addMouseListener(this); slider.setValue(value); valueField.setText(value + ""); @@ -325,10 +329,23 @@ public class SliderPanel extends Panel implements ActionListener, AdjustmentList } protected void applyButton_actionPerformed() - { - } + { } protected void undoButton_actionPerformed() + { } + + public void mousePressed(MouseEvent evt) + { } + + public void mouseReleased(MouseEvent evt) { + if (ap.overviewPanel != null) + ap.overviewPanel.updateOverviewImage(); } + public void mouseClicked(MouseEvent evt) + {} + public void mouseEntered(MouseEvent evt) + {} + public void mouseExited(MouseEvent evt) + {} } diff --git a/src/jalview/gui/SliderPanel.java b/src/jalview/gui/SliderPanel.java index b830d5d..9f4ab05 100755 --- a/src/jalview/gui/SliderPanel.java +++ b/src/jalview/gui/SliderPanel.java @@ -342,4 +342,11 @@ public class SliderPanel extends GSliderPanel { return Integer.parseInt(valueField.getText()); } + + public void slider_mouseReleased(MouseEvent e) + { + if (ap.overviewPanel != null) + ap.overviewPanel.updateOverviewImage(); + } + } diff --git a/src/jalview/jbgui/GSliderPanel.java b/src/jalview/jbgui/GSliderPanel.java index d245442..da5f4e8 100755 --- a/src/jalview/jbgui/GSliderPanel.java +++ b/src/jalview/jbgui/GSliderPanel.java @@ -76,7 +76,14 @@ public class GSliderPanel extends JPanel slider.setBackground(Color.white); slider.setFont(new java.awt.Font("Verdana", 0, 11)); slider.setDoubleBuffered(true); - valueField.setFont(new java.awt.Font("Verdana", 0, 11)); + slider.addMouseListener(new MouseAdapter() + { + public void mouseReleased(MouseEvent e) + { + slider_mouseReleased(e); + } + }); + valueField.setFont(new java.awt.Font("Verdana", 0, 11)); valueField.setMinimumSize(new Dimension(6, 14)); valueField.setPreferredSize(new Dimension(50, 12)); valueField.setText(""); @@ -179,4 +186,9 @@ public class GSliderPanel extends JPanel protected void allGroupsCheck_actionPerformed(ActionEvent e) { } -} + + public void slider_mouseReleased(MouseEvent e) + { + + } + } -- 1.7.10.2