X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fjalview%2Fappletgui%2FSliderPanel.java;h=ed156a71377df77ef3088e200eccf0035a5557a8;hb=b3a9ff5a8616675f6526bb07c06b047fcc216f83;hp=a53e9dd613151de2acd56978ceb0012f9ee6758b;hpb=55e2e9b22b133db8b9ff0979b0338a33081fc8fd;p=jalview.git diff --git a/src/jalview/appletgui/SliderPanel.java b/src/jalview/appletgui/SliderPanel.java index a53e9dd..ed156a7 100755 --- a/src/jalview/appletgui/SliderPanel.java +++ b/src/jalview/appletgui/SliderPanel.java @@ -28,6 +28,9 @@ import jalview.datamodel.*; import jalview.schemes.*; public class SliderPanel extends Panel + implements ActionListener, + AdjustmentListener, + MouseListener { AlignmentPanel ap; boolean forConservation = true; @@ -176,14 +179,8 @@ public class SliderPanel extends Panel slider.setBlockIncrement(1); } - slider.addAdjustmentListener(new AdjustmentListener() - { - public void adjustmentValueChanged(AdjustmentEvent evt) - { - valueField.setText(slider.getValue() + ""); - valueChanged(slider.getValue()); - } - }); + slider.addAdjustmentListener(this); + slider.addMouseListener(this); slider.setValue(value); valueField.setText(value + ""); @@ -238,7 +235,24 @@ public class SliderPanel extends Panel allGroupsCheck.setEnabled(b); } - public void valueField_actionPerformed(ActionEvent e) + public void actionPerformed(ActionEvent evt) + { + if(evt.getSource()==applyButton) + applyButton_actionPerformed(); + else if(evt.getSource()==undoButton) + undoButton_actionPerformed(); + else if(evt.getSource()==valueField) + valueField_actionPerformed(); + } + + public void adjustmentValueChanged(AdjustmentEvent evt) + { + valueField.setText(slider.getValue() + ""); + valueChanged(slider.getValue()); + } + + + public void valueField_actionPerformed() { try { @@ -286,30 +300,18 @@ public class SliderPanel extends Panel slider.setOrientation(0); valueField.setFont(new java.awt.Font("Verdana", 0, 11)); valueField.setText(" "); - valueField.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(ActionEvent e) { - valueField_actionPerformed(e); - } - }); + valueField.addActionListener(this); label.setFont(new java.awt.Font("Verdana", 0, 11)); label.setText("set this label text"); jPanel1.setLayout(borderLayout1); jPanel2.setLayout(flowLayout1); applyButton.setFont(new java.awt.Font("Verdana", 0, 11)); applyButton.setLabel("Apply"); - applyButton.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(ActionEvent e) { - applyButton_actionPerformed(e); - } - }); + applyButton.addActionListener(this); undoButton.setEnabled(false); undoButton.setFont(new java.awt.Font("Verdana", 0, 11)); undoButton.setLabel("Undo"); - undoButton.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(ActionEvent e) { - undoButton_actionPerformed(e); - } - }); + undoButton.addActionListener(this); allGroupsCheck.setEnabled(false); allGroupsCheck.setFont(new java.awt.Font("Verdana", 0, 11)); allGroupsCheck.setLabel("Apply threshold to all groups"); @@ -326,11 +328,24 @@ public class SliderPanel extends Panel this.add(jPanel2, java.awt.BorderLayout.CENTER); } - protected void applyButton_actionPerformed(ActionEvent e) - { - } + protected void applyButton_actionPerformed() + { } + + protected void undoButton_actionPerformed() + { } + + public void mousePressed(MouseEvent evt) + { } - protected void undoButton_actionPerformed(ActionEvent e) + 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) + {} }