pid and conservation changes
[jalview.git] / src / jalview / gui / SeqPanel.java
index 3bfc7db..0fa6d17 100755 (executable)
@@ -420,14 +420,9 @@ public class SeqPanel extends JPanel
       stretchGroup = sg;\r
 \r
       if(av.getConservationSelected())\r
-        Desktop.setConservationSliderSource(ap, av.getGlobalColourScheme(), "Background");\r
-      else if(av.getGlobalColourScheme()!=null && av.getGlobalColourScheme().canThreshold())\r
-      {\r
-        ResidueColourScheme rcs = (ResidueColourScheme) av.getGlobalColourScheme();\r
-        int threshold = rcs.getThreshold();\r
-        if (threshold > 0)\r
-          Desktop.setPIDSliderSource(ap, av.getGlobalColourScheme(), "Background");\r
-      }\r
+        SliderPanel.setConservationSlider(ap, av.getGlobalColourScheme(), "Background");\r
+      if(av.getAbovePIDThreshold())\r
+        SliderPanel.setPIDSliderSource(ap, av.getGlobalColourScheme(), "Background");\r
 \r
     }\r
     else if( javax.swing.SwingUtilities.isRightMouseButton(evt))\r
@@ -472,13 +467,9 @@ public class SeqPanel extends JPanel
 \r
     else if(stretchGroup.cs instanceof ConservationColourScheme)\r
     {\r
-      ConservationColourScheme ccs = (ConservationColourScheme)stretchGroup.cs;\r
-\r
-\r
+       ConservationColourScheme ccs = (ConservationColourScheme)stretchGroup.cs;\r
        stretchGroup.cs = ccs;\r
-\r
-\r
-       Desktop.setConservationSliderSource(ap, stretchGroup.cs, stretchGroup.getName()) ;\r
+       SliderPanel.setConservationSlider(ap, stretchGroup.cs, stretchGroup.getName()) ;\r
 \r
        repaint();\r
     }\r
@@ -487,9 +478,7 @@ public class SeqPanel extends JPanel
       if(stretchGroup.cs !=null && stretchGroup.cs.canThreshold())\r
       {\r
         ResidueColourScheme rcs =  (ResidueColourScheme) stretchGroup.cs;\r
-        int threshold = rcs.getThreshold();\r
-        if(threshold>0)\r
-          Desktop.setPIDSliderSource(ap, stretchGroup.cs, stretchGroup.getName());\r
+        SliderPanel.setPIDSliderSource(ap, stretchGroup.cs, stretchGroup.getName());\r
       }\r
 \r
     }\r