package jalview.gui;\r
\r
import jalview.jbgui.*;\r
-import jalview.datamodel.*;\r
import jalview.schemes.*;\r
+import jalview.datamodel.*;\r
import java.awt.event.*;\r
import javax.swing.event.*;\r
+import java.util.*;\r
\r
public class SliderPanel extends GSliderPanel\r
{\r
\r
public void valueChanged(int i)\r
{\r
+ ColourSchemeI toChange = null;\r
+ Vector allGroups = null;\r
+ int groupIndex = 0;\r
\r
- if(forConservation)\r
+ if(allGroupsCheck.isSelected())\r
{\r
- if (cs instanceof ConservationColourScheme)\r
- ( (ConservationColourScheme) cs).inc = i;\r
+ allGroups = ap.av.alignment.getGroups();\r
+ groupIndex = allGroups.size()-1;\r
}\r
else\r
- {\r
- if( cs instanceof ResidueColourScheme)\r
- {\r
- ResidueColourScheme rcs = (ResidueColourScheme) cs;\r
- rcs.setThreshold(i);\r
- }\r
- else if( cs instanceof ScoreColourScheme)\r
- {\r
- ScoreColourScheme scs = (ScoreColourScheme) cs;\r
- scs.setThreshold(i);\r
- }\r
-\r
- }\r
+ toChange = cs;\r
+\r
+\r
+ while( groupIndex > -1 )\r
+ {\r
+ if(allGroups!=null)\r
+ toChange = ((SequenceGroup)allGroups.get(groupIndex)).cs;\r
+\r
+ if (forConservation)\r
+ {\r
+ if (toChange instanceof ConservationColourScheme)\r
+ ( (ConservationColourScheme) toChange).inc = i;\r
+ }\r
+ else\r
+ {\r
+ if (toChange.canThreshold())\r
+ ( (ResidueColourScheme) toChange).setThreshold(i);\r
+ }\r
+\r
+ groupIndex--;\r
+ }\r
+\r
\r
ap.seqPanel.seqCanvas.paintFlag=true;\r
ap.seqPanel.repaint();\r
\r
}\r
\r
+ public void setAllGroupsCheckEnabled(boolean b)\r
+ {\r
+ allGroupsCheck.setEnabled(b);\r
+ }\r
+\r
+\r
public void valueField_actionPerformed(ActionEvent e)\r
{\r
try{\r
{\r
return Integer.parseInt(valueField.getText());\r
}\r
+\r
+\r
}\r