use of uk.ac.babraham.SeqMonk.Gradients.RedGreenColourGradient in project SeqMonk by s-andrews.
the class GradientScaleBar method main.
public static void main(String[] args) {
JFrame frame = new JFrame("Gradient test");
frame.setContentPane(new GradientScaleBar(new RedGreenColourGradient(), -5, 5));
frame.setSize(50, 300);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
}
use of uk.ac.babraham.SeqMonk.Gradients.RedGreenColourGradient 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