Conservation colour scheme is no more
[jalview.git] / src / jalview / appletgui / APopupMenu.java
index 0cfa537..abd76d6 100755 (executable)
@@ -385,23 +385,15 @@ public class APopupMenu
                                                ap.av.alignment.getWidth()));\r
       int threshold = SliderPanel.setPIDSliderSource(ap, sg.cs,\r
           getGroup().getName());\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
+\r
+      sg.cs.setThreshold(threshold, ap.av.getIgnoreGapsConsensus());\r
 \r
       SliderPanel.showPIDSlider();\r
 \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
@@ -454,17 +446,15 @@ public class APopupMenu
 \r
       c.calculate();\r
       c.verdict(false, ap.av.ConsPercGaps);\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