X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fappletgui%2FSliderPanel.java;h=9154aa03bdf685982c7c2cab1fcc804ca11bf018;hb=6d6c9b65d01adbdd8b624bea6a766165e4497bb6;hp=3e6dbe6ce3ef6f038cbe140b880266c5b86dcb15;hpb=49665d43dbcc49a55d7d44fbf58a7c27ab0ae860;p=jalview.git diff --git a/src/jalview/appletgui/SliderPanel.java b/src/jalview/appletgui/SliderPanel.java index 3e6dbe6..9154aa0 100644 --- a/src/jalview/appletgui/SliderPanel.java +++ b/src/jalview/appletgui/SliderPanel.java @@ -21,7 +21,7 @@ package jalview.appletgui; import jalview.datamodel.SequenceGroup; -import jalview.schemes.ColourSchemeI; +import jalview.renderer.ResidueShaderI; import jalview.util.MessageManager; import java.awt.BorderLayout; @@ -49,38 +49,39 @@ import java.util.Iterator; public class SliderPanel extends Panel implements ActionListener, AdjustmentListener, MouseListener { + private static final String BACKGROUND = "Background"; + AlignmentPanel ap; boolean forConservation = true; - ColourSchemeI cs; + ResidueShaderI cs; static Frame conservationSlider; static Frame PIDSlider; public static int setConservationSlider(AlignmentPanel ap, - ColourSchemeI cs, String source) + ResidueShaderI ccs, String source) { SliderPanel sp = null; if (conservationSlider == null) { - sp = new SliderPanel(ap, cs.getConservationInc(), true, cs); + sp = new SliderPanel(ap, ccs.getConservationInc(), true, ccs); conservationSlider = new Frame(); conservationSlider.add(sp); } else { sp = (SliderPanel) conservationSlider.getComponent(0); - sp.valueField.setText(String.valueOf(cs.getConservationInc())); - sp.cs = cs; + sp.cs = ccs; + sp.valueField.setText(String.valueOf(ccs.getConservationInc())); } - conservationSlider - .setTitle(MessageManager.formatMessage( - "label.conservation_colour_increment", - new String[] { source })); + conservationSlider.setTitle(MessageManager.formatMessage( + "label.conservation_colour_increment", + new String[] { source == null ? BACKGROUND : source })); if (ap.av.getAlignment().getGroups() != null) { sp.setAllGroupsCheckEnabled(true); @@ -120,26 +121,25 @@ public class SliderPanel extends Panel implements ActionListener, } - public static int setPIDSliderSource(AlignmentPanel ap, ColourSchemeI cs, - String source) + public static int setPIDSliderSource(AlignmentPanel ap, + ResidueShaderI ccs, String source) { SliderPanel pid = null; if (PIDSlider == null) { - pid = new SliderPanel(ap, cs.getThreshold(), false, cs); + pid = new SliderPanel(ap, ccs.getThreshold(), false, ccs); PIDSlider = new Frame(); PIDSlider.add(pid); } else { pid = (SliderPanel) PIDSlider.getComponent(0); - pid.valueField.setText(String.valueOf(cs.getThreshold())); - pid.cs = cs; + pid.cs = ccs; + pid.valueField.setText(String.valueOf(ccs.getThreshold())); } - PIDSlider - .setTitle(MessageManager.formatMessage( - "label.percentage_identity_threshold", - new String[] { source })); + PIDSlider.setTitle(MessageManager.formatMessage( + "label.percentage_identity_threshold", + new String[] { source == null ? BACKGROUND : source })); if (ap.av.getAlignment().getGroups() != null) { @@ -193,7 +193,7 @@ public class SliderPanel extends Panel implements ActionListener, } /** - * Hides the conservation slider panel if it is shown + * Hides the Conservation slider panel if it is shown */ public static void hideConservationSlider() { @@ -204,7 +204,7 @@ public class SliderPanel extends Panel implements ActionListener, } } public SliderPanel(AlignmentPanel ap, int value, boolean forConserve, - ColourSchemeI cs) + ResidueShaderI shader) { try { @@ -214,7 +214,7 @@ public class SliderPanel extends Panel implements ActionListener, e.printStackTrace(); } this.ap = ap; - this.cs = cs; + this.cs = shader; forConservation = forConserve; undoButton.setVisible(false); applyButton.setVisible(false); @@ -249,7 +249,7 @@ public class SliderPanel extends Panel implements ActionListener, return; } - ColourSchemeI toChange = cs; + ResidueShaderI toChange = cs; Iterator allGroups = null; if (allGroupsCheck.getState())