X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FSliderPanel.java;h=5b177d4beb41ef901bebd7abb1b6f902aa85456c;hb=refs%2Fheads%2FvamsasDemo;hp=c18cc055b7e0895eeab172b75a5849380c8f3d38;hpb=efc31b4a8d5cee63555586804a2b79c06bdb5a14;p=jalview.git diff --git a/src/jalview/gui/SliderPanel.java b/src/jalview/gui/SliderPanel.java index c18cc05..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); + toChange.setThreshold(i, ap.av.getIgnoreGapsConsensus()); } groupIndex--;