3 import jalview.jbgui.*;
\r
4 import jalview.schemes.*;
\r
5 import jalview.datamodel.*;
\r
6 import java.awt.event.*;
\r
7 import javax.swing.event.*;
\r
10 public class SliderPanel extends GSliderPanel
\r
13 boolean forConservation = true;
\r
16 public SliderPanel(AlignmentPanel ap, int value, boolean forConserve, ColourSchemeI cs)
\r
20 forConservation = forConserve;
\r
21 undoButton.setVisible(false);
\r
22 applyButton.setVisible(false);
\r
25 label.setText("Enter the value by which to decrease conservation colour intensity");
\r
26 slider.setMinimum(0);
\r
27 slider.setMaximum(50);
\r
31 label.setText("Enter the percent identity above which to colour residues");
\r
32 slider.setMinimum(0);
\r
33 slider.setMaximum(100);
\r
38 slider.addChangeListener( new ChangeListener()
\r
40 public void stateChanged(ChangeEvent evt)
\r
42 valueField.setText( slider.getValue()+"" );
\r
43 valueChanged( slider.getValue() );
\r
47 slider.setValue(value);
\r
48 valueField.setText(value+"");
\r
51 public void valueChanged(int i)
\r
56 ColourSchemeI toChange = null;
\r
57 Vector allGroups = null;
\r
60 if(allGroupsCheck.isSelected())
\r
62 allGroups = ap.av.alignment.getGroups();
\r
63 groupIndex = allGroups.size()-1;
\r
69 while( groupIndex > -1 )
\r
72 toChange = ((SequenceGroup)allGroups.get(groupIndex)).cs;
\r
74 if (forConservation)
\r
76 if (toChange instanceof ConservationColourScheme)
\r
77 ( (ConservationColourScheme) toChange).inc = i;
\r
81 if (toChange.canThreshold())
\r
82 ( (ResidueColourScheme) toChange).setThreshold(i);
\r
89 ap.seqPanel.seqCanvas.paintFlag=true;
\r
90 ap.seqPanel.repaint();
\r
94 public void setAllGroupsCheckEnabled(boolean b)
\r
96 allGroupsCheck.setEnabled(b);
\r
100 public void valueField_actionPerformed(ActionEvent e)
\r
103 int i = Integer.parseInt(valueField.getText());
\r
104 slider.setValue(i);
\r
106 catch(Exception ex)
\r
108 valueField.setText( slider.getValue()+"" );
\r
112 public int getValue()
\r
114 return Integer.parseInt(valueField.getText());
\r