noColourmenuItem.setSelected(true);\r
}\r
\r
- if (sg.cs instanceof ConservationColourScheme)\r
+ if (sg.cs!=null && sg.cs.conservationApplied())\r
{\r
conservationMenuItem.setSelected(true);\r
}\r
int threshold = SliderPanel.setPIDSliderSource(ap, sg.cs,\r
getGroup().getName());\r
\r
- if (sg.cs instanceof ResidueColourScheme)\r
- {\r
- ((ResidueColourScheme) sg.cs).setThreshold(threshold, ap.av.getIgnoreGapsConsensus());\r
- }\r
- else if (sg.cs instanceof ScoreColourScheme)\r
- {\r
- ((ScoreColourScheme) sg.cs).setThreshold(threshold, ap.av.getIgnoreGapsConsensus());\r
- }\r
+ sg.cs.setThreshold(threshold, ap.av.getIgnoreGapsConsensus());\r
\r
SliderPanel.showPIDSlider();\r
}\r
else // remove PIDColouring\r
{\r
- ResidueColourScheme rcs = (ResidueColourScheme) sg.cs;\r
- rcs.setThreshold(0, ap.av.getIgnoreGapsConsensus());\r
- sg.cs = rcs;\r
+ sg.cs.setThreshold(0, ap.av.getIgnoreGapsConsensus());\r
}\r
\r
refresh();\r
c.calculate();\r
c.verdict(false, ap.av.ConsPercGaps);\r
\r
- ConservationColourScheme ccs = new ConservationColourScheme(c, sg.cs);\r
-\r
- sg.cs = ccs;\r
+ sg.cs.setConservation(c);\r
\r
- SliderPanel.setConservationSlider(ap, ccs, sg.getName());\r
+ SliderPanel.setConservationSlider(ap, sg.cs, sg.getName());\r
SliderPanel.showConservationSlider();\r
}\r
else // remove ConservationColouring\r
{\r
- ConservationColourScheme ccs = (ConservationColourScheme) sg.cs;\r
- sg.cs = ccs.cs;\r
+ sg.cs.setConservation(null);\r
}\r
\r
refresh();\r