use of uk.ac.babraham.SeqMonk.Gradients.InvertedGradient in project SeqMonk by s-andrews.
the class HierarchicalClusterDialog method progressComplete.
public void progressComplete(String command, Object result) {
clusterPanelGroup = new JPanel();
clusterPanelGroup.setLayout(new BorderLayout());
ColourGradient gradient = (ColourGradient) gradients.getSelectedItem();
if (invertGradient.isSelected()) {
gradient = new InvertedGradient(gradient);
}
if (negativeScale) {
scaleBar = new GradientScaleBar(gradient, -2, 2);
} else {
scaleBar = new GradientScaleBar(gradient, 0, 2);
}
JPanel topBottomSplit = new JPanel();
topBottomSplit.setLayout(new GridLayout(2, 1));
topBottomSplit.add(new JPanel());
topBottomSplit.add(scaleBar);
clusterPanel = new HierarchicalClusterPanel(probes, stores, (ClusterPair) result, normalise, (ColourGradient) gradients.getSelectedItem());
clusterPanelGroup.add(clusterPanel, BorderLayout.CENTER);
clusterPanelGroup.add(topBottomSplit, BorderLayout.EAST);
getContentPane().add(clusterPanelGroup, BorderLayout.CENTER);
setLocationRelativeTo(SeqMonkApplication.getInstance());
stateChanged(new ChangeEvent(clusterSlider));
setVisible(true);
}
use of uk.ac.babraham.SeqMonk.Gradients.InvertedGradient in project SeqMonk by s-andrews.
the class HierarchicalClusterDialog method updateGradients.
private void updateGradients() {
ColourGradient gradient = (ColourGradient) gradients.getSelectedItem();
if (invertGradient.isSelected()) {
gradient = new InvertedGradient(gradient);
}
if (clusterPanel != null) {
clusterPanel.setGradient(gradient);
scaleBar.setGradient(gradient);
}
}
use of uk.ac.babraham.SeqMonk.Gradients.InvertedGradient 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");
}
}
use of uk.ac.babraham.SeqMonk.Gradients.InvertedGradient in project SeqMonk by s-andrews.
the class DomainogramDialog method updateGradients.
private void updateGradients() {
ColourGradient gradient = (ColourGradient) gradients.getSelectedItem();
if (invertGradient.isSelected()) {
gradient = new InvertedGradient(gradient);
}
for (int i = 0; i < chromosomeDomainPanels.length; i++) {
// We skipped it
if (chromosomeDomainPanels[i] == null)
continue;
chromosomeDomainPanels[i].setGradient(gradient);
}
scaleBar.setGradient(gradient);
}
use of uk.ac.babraham.SeqMonk.Gradients.InvertedGradient in project SeqMonk by s-andrews.
the class CorrelationMatrix method updateGradients.
private void updateGradients() {
ColourGradient gradient = (ColourGradient) gradients.getSelectedItem();
if (invertGradient.isSelected()) {
gradient = new InvertedGradient(gradient);
}
this.gradient = gradient;
if (scaleBar != null) {
scaleBar.setGradient(gradient);
if (scaleBox.isSelected()) {
scaleBar.setLimits(-1, 1);
} else {
scaleBar.setLimits(model.getMinCorrelation(), model.getMaxCorrelation());
}
}
repaint();
}
Aggregations