}
// original colour becomes the maximum colour
cs = new GraduatedColor(Color.white,bl,mm[0],mm[1]);
+ cs.setColourByLabel(false);
}
minColour.setBackground(cs.getMinColor());
maxColour.setBackground(cs.getMaxColor());
}
// update the gui from threshold state
thresholdIsMin.setSelected(!cs.isAutoScale());
+ colourByLabel.setSelected(cs.isColourByLabel());
if (cs.getThreshType()!=AnnotationColourGradient.NO_THRESHOLD)
{
// initialise threshold slider and selector
thresholdIsMin_actionPerformed(actionEvent);
}
});
+ colourByLabel.setBackground(Color.white);
+ colourByLabel.setText("Colour by Label");
+ colourByLabel.addActionListener(new ActionListener()
+ {
+ public void actionPerformed(ActionEvent actionEvent)
+ {
+ colourByLabel_actionPerformed(actionEvent);
+ }
+ });
jPanel1.add(ok);
jPanel1.add(cancel);
// jPanel2.add(currentColours);
jPanel3.add(slider);
jPanel3.add(thresholdValue);
jPanel3.add(thresholdIsMin);
+ jPanel3.add(colourByLabel);
this.add(jPanel1, java.awt.BorderLayout.SOUTH);
this.add(jPanel2, java.awt.BorderLayout.NORTH);
}
JCheckBox currentColours = new JCheckBox();
JCheckBox thresholdIsMin = new JCheckBox();
+ JCheckBox colourByLabel = new JCheckBox();
private GraphLine threshline;
} else {
acg.setAutoScaled(true);
}
-
+ acg.setColourByLabel(colourByLabel.isSelected());
fr.featureColours.put(type,acg);
cs = acg;
ap.paintAlignment(false);
{
changeColour();
}
+ public void colourByLabel_actionPerformed(ActionEvent actionEvent)
+ {
+ changeColour();
+ }
}