Conservation colour scheme is no more
[jalview.git] / src / jalview / gui / SliderPanel.java
index a9020c3..5b177d4 100755 (executable)
@@ -102,11 +102,10 @@ public class SliderPanel extends GSliderPanel
         ColourSchemeI cs, String source)\r
     {\r
         SliderPanel sp = null;\r
-        ConservationColourScheme ccs = (ConservationColourScheme) cs;\r
 \r
         if (conservationSlider == null)\r
         {\r
-            sp = new SliderPanel(ap, ccs.inc, true, cs);\r
+            sp = new SliderPanel(ap, cs.getConservationInc(), true, cs);\r
             conservationSlider = new JInternalFrame();\r
             conservationSlider.setContentPane(sp);\r
             conservationSlider.setLayer(JLayeredPane.PALETTE_LAYER);\r
@@ -176,16 +175,7 @@ public class SliderPanel extends GSliderPanel
     {\r
         SliderPanel pid = null;\r
 \r
-        int threshold = 50;\r
-\r
-        if (cs instanceof ResidueColourScheme)\r
-        {\r
-            threshold = (((ResidueColourScheme) cs).getThreshold());\r
-        }\r
-        else if (cs instanceof ScoreColourScheme)\r
-        {\r
-            threshold = (((ScoreColourScheme) cs).getThreshold());\r
-        }\r
+        int threshold = cs.getThreshold();\r
 \r
         if (PIDSlider == null)\r
         {\r
@@ -253,10 +243,12 @@ public class SliderPanel extends GSliderPanel
     public void valueChanged(int i)\r
     {\r
         if (cs == null)\r
-        {\r
+        {System.out.println("cs is null");\r
             return;\r
         }\r
 \r
+\r
+\r
         ColourSchemeI toChange = null;\r
         Vector allGroups = null;\r
         int groupIndex = 0;\r
@@ -271,6 +263,7 @@ public class SliderPanel extends GSliderPanel
             toChange = cs;\r
         }\r
 \r
+\r
         while (groupIndex > -1)\r
         {\r
             if (allGroups != null)\r
@@ -287,14 +280,14 @@ public class SliderPanel extends GSliderPanel
 \r
             if (forConservation)\r
             {\r
-                if (toChange instanceof ConservationColourScheme)\r
+                if (toChange.conservationApplied())\r
                 {\r
-                    ((ConservationColourScheme) toChange).inc = i;\r
+                    toChange.setConservationInc(i);\r
                 }\r
             }\r
             else\r
             {\r
-                ((ResidueColourScheme) toChange).setThreshold(i, ap.av.getIgnoreGapsConsensus());\r
+                toChange.setThreshold(i, ap.av.getIgnoreGapsConsensus());\r
             }\r
 \r
             groupIndex--;\r