X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FSliderPanel.java;h=5b177d4beb41ef901bebd7abb1b6f902aa85456c;hb=0d7bb66cedf596855f6a68f2ab4dcfb29dff72db;hp=a9020c31d312a3ff4186b7a0f7e1d23088f232a5;hpb=9fff97021c2c637e426f6971d54dcf3fd4191985;p=jalview.git diff --git a/src/jalview/gui/SliderPanel.java b/src/jalview/gui/SliderPanel.java index a9020c3..5b177d4 100755 --- a/src/jalview/gui/SliderPanel.java +++ b/src/jalview/gui/SliderPanel.java @@ -102,11 +102,10 @@ public class SliderPanel extends GSliderPanel ColourSchemeI cs, String source) { SliderPanel sp = null; - ConservationColourScheme ccs = (ConservationColourScheme) cs; if (conservationSlider == null) { - sp = new SliderPanel(ap, ccs.inc, true, cs); + sp = new SliderPanel(ap, cs.getConservationInc(), true, cs); conservationSlider = new JInternalFrame(); conservationSlider.setContentPane(sp); conservationSlider.setLayer(JLayeredPane.PALETTE_LAYER); @@ -176,16 +175,7 @@ public class SliderPanel extends GSliderPanel { SliderPanel pid = null; - int threshold = 50; - - if (cs instanceof ResidueColourScheme) - { - threshold = (((ResidueColourScheme) cs).getThreshold()); - } - else if (cs instanceof ScoreColourScheme) - { - threshold = (((ScoreColourScheme) cs).getThreshold()); - } + int threshold = cs.getThreshold(); if (PIDSlider == null) { @@ -253,10 +243,12 @@ public class SliderPanel extends GSliderPanel public void valueChanged(int i) { if (cs == null) - { + {System.out.println("cs is null"); return; } + + ColourSchemeI toChange = null; Vector allGroups = null; int groupIndex = 0; @@ -271,6 +263,7 @@ public class SliderPanel extends GSliderPanel toChange = cs; } + while (groupIndex > -1) { if (allGroups != null) @@ -287,14 +280,14 @@ public class SliderPanel extends GSliderPanel if (forConservation) { - if (toChange instanceof ConservationColourScheme) + if (toChange.conservationApplied()) { - ((ConservationColourScheme) toChange).inc = i; + toChange.setConservationInc(i); } } else { - ((ResidueColourScheme) toChange).setThreshold(i, ap.av.getIgnoreGapsConsensus()); + toChange.setThreshold(i, ap.av.getIgnoreGapsConsensus()); } groupIndex--;