X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FSliderPanel.java;h=647c70d279a676237afb618676d6ec3bee40a783;hb=0f7960c1a7b70cfffae875303e4445215278e9df;hp=c18cc055b7e0895eeab172b75a5849380c8f3d38;hpb=efc31b4a8d5cee63555586804a2b79c06bdb5a14;p=jalview.git diff --git a/src/jalview/gui/SliderPanel.java b/src/jalview/gui/SliderPanel.java index c18cc05..647c70d 100755 --- a/src/jalview/gui/SliderPanel.java +++ b/src/jalview/gui/SliderPanel.java @@ -1,6 +1,6 @@ /* * Jalview - A Sequence Alignment Editor and Viewer - * Copyright (C) 2005 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle + * Copyright (C) 2006 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -67,7 +67,7 @@ public class SliderPanel extends GSliderPanel { label.setText("Enter value to increase conservation visibility"); slider.setMinimum(0); - slider.setMaximum(50); + slider.setMaximum(100); } else { @@ -89,6 +89,7 @@ public class SliderPanel extends GSliderPanel valueField.setText(value + ""); } + /** * DOCUMENT ME! * @@ -102,11 +103,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 +176,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) { @@ -271,6 +262,7 @@ public class SliderPanel extends GSliderPanel toChange = cs; } + while (groupIndex > -1) { if (allGroups != null) @@ -287,14 +279,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--; @@ -325,7 +317,7 @@ public class SliderPanel extends GSliderPanel int i = Integer.parseInt(valueField.getText()); slider.setValue(i); } - catch (Exception ex) + catch (NumberFormatException ex) { valueField.setText(slider.getValue() + ""); } @@ -350,4 +342,11 @@ public class SliderPanel extends GSliderPanel { return Integer.parseInt(valueField.getText()); } + + public void slider_mouseReleased(MouseEvent e) + { + if (ap.overviewPanel != null) + ap.overviewPanel.updateOverviewImage(); + } + }