X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fappletgui%2FSliderPanel.java;h=2aa010f3ccac3222b814ef4540ad39275849d887;hb=fd7eebe6dcf2346692d718ef91bb468cc12ebf44;hp=5ee665aa3f47f61f449b474273fb3d1eb4ab29b0;hpb=7dc7fb2a35c435d825bc91c5ae60ec6073419a69;p=jalview.git diff --git a/src/jalview/appletgui/SliderPanel.java b/src/jalview/appletgui/SliderPanel.java index 5ee665a..2aa010f 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.schemes.CollectionColourSchemeI; import jalview.util.MessageManager; import java.awt.BorderLayout; @@ -53,27 +53,29 @@ public class SliderPanel extends Panel implements ActionListener, boolean forConservation = true; - ColourSchemeI cs; + CollectionColourSchemeI cs; static Frame conservationSlider; static Frame PIDSlider; public static int setConservationSlider(AlignmentPanel ap, - ColourSchemeI cs, String source) + CollectionColourSchemeI collectionColourSchemeI, String source) { SliderPanel sp = null; if (conservationSlider == null) { - sp = new SliderPanel(ap, cs.getConservationInc(), true, cs); + sp = new SliderPanel(ap, + collectionColourSchemeI.getConservationInc(), true, + collectionColourSchemeI); conservationSlider = new Frame(); conservationSlider.add(sp); } else { sp = (SliderPanel) conservationSlider.getComponent(0); - sp.cs = cs; + sp.cs = collectionColourSchemeI; } conservationSlider @@ -119,20 +121,20 @@ public class SliderPanel extends Panel implements ActionListener, } - public static int setPIDSliderSource(AlignmentPanel ap, ColourSchemeI cs, - String source) + public static int setPIDSliderSource(AlignmentPanel ap, + CollectionColourSchemeI ccs, String source) { SliderPanel pid = null; if (PIDSlider == null) { - pid = new SliderPanel(ap, 50, false, cs); + pid = new SliderPanel(ap, ccs.getThreshold(), false, ccs); PIDSlider = new Frame(); PIDSlider.add(pid); } else { pid = (SliderPanel) PIDSlider.getComponent(0); - pid.cs = cs; + pid.cs = ccs; } PIDSlider .setTitle(MessageManager.formatMessage( @@ -178,19 +180,31 @@ public class SliderPanel extends Panel implements ActionListener, } + /** + * Hides the PID slider panel if it is shown + */ public static void hidePIDSlider() { - PIDSlider.setVisible(false); - PIDSlider = null; + if (PIDSlider != null) + { + PIDSlider.setVisible(false); + PIDSlider = null; + } } + /** + * Hides the Conservation slider panel if it is shown + */ public static void hideConservationSlider() { - conservationSlider.setVisible(false); - conservationSlider = null; + if (conservationSlider != null) + { + conservationSlider.setVisible(false); + conservationSlider = null; + } } public SliderPanel(AlignmentPanel ap, int value, boolean forConserve, - ColourSchemeI cs) + CollectionColourSchemeI collectionColourSchemeI) { try { @@ -200,7 +214,7 @@ public class SliderPanel extends Panel implements ActionListener, e.printStackTrace(); } this.ap = ap; - this.cs = cs; + this.cs = collectionColourSchemeI; forConservation = forConserve; undoButton.setVisible(false); applyButton.setVisible(false); @@ -235,7 +249,7 @@ public class SliderPanel extends Panel implements ActionListener, return; } - ColourSchemeI toChange = cs; + CollectionColourSchemeI toChange = cs; Iterator allGroups = null; if (allGroupsCheck.getState())