package jalview.appletgui;
import jalview.datamodel.SequenceGroup;
-import jalview.schemes.ColourSchemeI;
+import jalview.schemes.CollectionColourSchemeI;
import jalview.util.MessageManager;
import java.awt.BorderLayout;
boolean forConservation = true;
- ColourSchemeI cs;
+ CollectionColourSchemeI cs;
static Frame conservationSlider;
static Frame PIDSlider;
public static int setConservationSlider(AlignmentPanel ap,
- ColourSchemeI cs, String source)
+ CollectionColourSchemeI 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.cs = cs;
+ sp.cs = ccs;
+ sp.valueField.setText(String.valueOf(ccs.getConservationInc()));
}
conservationSlider
}
- 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;
+ pid.valueField.setText(String.valueOf(ccs.getThreshold()));
}
PIDSlider
.setTitle(MessageManager.formatMessage(
}
+ /**
+ * 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
{
e.printStackTrace();
}
this.ap = ap;
- this.cs = cs;
+ this.cs = collectionColourSchemeI;
forConservation = forConserve;
undoButton.setVisible(false);
applyButton.setVisible(false);
return;
}
- ColourSchemeI toChange = cs;
+ CollectionColourSchemeI toChange = cs;
Iterator<SequenceGroup> allGroups = null;
if (allGroupsCheck.getState())