use of uk.ac.babraham.SeqMonk.Gradients.RedWhiteColourGradient in project SeqMonk by s-andrews.
the class DisplayPreferences method setGradient.
public void setGradient(int gradientType) {
if (equalsAny(new int[] { GRADIENT_GREYSCALE, GRADIENT_HOT_COLD, GRADIENT_RED_GREEN, GRADIENT_MAGENTA_GREEN, GRADIENT_RED_WHITE }, gradientType)) {
currentGradientValue = gradientType;
switch(gradientType) {
case GRADIENT_GREYSCALE:
currentGradient = new GreyscaleColourGradient();
break;
case GRADIENT_HOT_COLD:
currentGradient = new HotColdColourGradient();
break;
case GRADIENT_RED_GREEN:
currentGradient = new RedGreenColourGradient();
break;
case GRADIENT_MAGENTA_GREEN:
currentGradient = new MagentaGreenColourGradient();
break;
case GRADIENT_RED_WHITE:
currentGradient = new RedWhiteColourGradient();
break;
}
if (invertGradient) {
currentGradient = new InvertedGradient(currentGradient);
}
optionsChanged();
} else {
throw new IllegalArgumentException("Value " + gradientType + " is not a valid gradient type");
}
}
Aggregations