if (av.getAlignment().getGroups() != null)
{
oldgroupColours = new Hashtable();
- for (SequenceGroup sg: ap.av.getAlignment().getGroups())
+ for (SequenceGroup sg : ap.av.getAlignment().getGroups())
{
if (sg.cs != null)
{
}
setDefaultMinMax();
-
+
if (oldcs instanceof AnnotationColourGradient)
{
AnnotationColourGradient acg = (AnnotationColourGradient) oldcs;
currentColours.setState(acg.predefinedColours);
- if (!acg.predefinedColours) {
+ if (!acg.predefinedColours)
+ {
minColour.setBackground(acg.getMinColour());
maxColour.setBackground(acg.getMaxColour());
}
{
AnnotationColourGradient acg = (AnnotationColourGradient) oldcs;
annotations.select(acg.getAnnotation());
- switch (acg.getAboveThreshold()) {
+ switch (acg.getAboveThreshold())
+ {
case AnnotationColourGradient.NO_THRESHOLD:
- threshold.select("No Threshold");
+ threshold.select("No Threshold");
break;
case AnnotationColourGradient.ABOVE_THRESHOLD:
- threshold.select("Above Threshold");
+ threshold.select("Above Threshold");
break;
case AnnotationColourGradient.BELOW_THRESHOLD:
threshold.select("Below Threshold");
break;
- default:
- throw new Error("Implementation error: don't know about threshold setting for current AnnotationColourGradient.");
+ default:
+ throw new Error(
+ "Implementation error: don't know about threshold setting for current AnnotationColourGradient.");
}
thresholdIsMin.setState(acg.thresholdIsMinMax);
- thresholdValue.setText(""+acg.getAnnotationThreshold());
+ thresholdValue.setText("" + acg.getAnnotationThreshold());
}
adjusting = false;
private void setDefaultMinMax()
{
- minColour.setBackground(av.applet.getDefaultColourParameter("ANNOTATIONCOLOUR_MIN",Color.orange));
- maxColour.setBackground(av.applet.getDefaultColourParameter("ANNOTATIONCOLOUR_MAX",Color.red));
+ minColour.setBackground(av.applet.getDefaultColourParameter(
+ "ANNOTATIONCOLOUR_MIN", Color.orange));
+ maxColour.setBackground(av.applet.getDefaultColourParameter(
+ "ANNOTATIONCOLOUR_MAX", Color.red));
}
+
public AnnotationColourChooser()
{
try
defColours.setLabel("Defaults");
defColours.addActionListener(this);
-
+
annotations.addItemListener(this);
thresholdValue.addActionListener(this);
slider.setBackground(Color.white);
- slider.setPreferredSize(new Dimension(193,21));
+ slider.setPreferredSize(new Dimension(193, 21));
slider.setEnabled(false);
- thresholdValue.setPreferredSize(new Dimension(79,22));
+ thresholdValue.setPreferredSize(new Dimension(79, 22));
thresholdValue.setEnabled(false);
thresholdValue.setColumns(5);
currentColours.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));
thresholdIsMin.setLabel("Threshold is min/max");
this.setLayout(borderLayout1);
-
+
jPanel1.setBackground(Color.white);
-
+
jPanel2.setLayout(new FlowLayout());
jPanel2.setBackground(Color.white);
threshold.addItemListener(this);
jPanel4.setLayout(new BorderLayout());
jPanel4.setBackground(Color.white);
-
jPanel1.add(ok);
jPanel1.add(cancel);
-
+
jPanel2.add(annotations);
jPanel2.add(currentColours);
jPanel2.add(minColour);
jPanel2.add(maxColour);
-
-
+
jPanel4.add(thresholdIsMin, BorderLayout.WEST);
jPanel4.add(slider, BorderLayout.CENTER);
jPanel4.add(thresholdValue, BorderLayout.EAST);
-
+
Panel jPanel34 = new Panel();
jPanel34.setLayout(new BorderLayout());
jPanel34.setBackground(Color.white);
jPanel34.add(jPanel2, BorderLayout.NORTH);
jPanel34.add(threshold, BorderLayout.WEST);
jPanel3.add(defColours);
- jPanel34.add(jPanel3, BorderLayout.EAST);
+ jPanel34.add(jPanel3, BorderLayout.EAST);
jPanel34.add(jPanel4, BorderLayout.SOUTH);
-
+
this.add(jPanel34, java.awt.BorderLayout.CENTER);
this.add(jPanel1, java.awt.BorderLayout.SOUTH);
-
+
}
Choice annotations = new Choice();
Button ok = new Button();
Button cancel = new Button();
-
+
Button defColours = new Button();
Panel jPanel1 = new Panel();
}
else if (evt.getSource() == defColours)
{
- defColour_actionPerformed();
+ defColour_actionPerformed();
}
else if (evt.getSource() == ok)
{
new UserDefinedColours(this, "Max Colour", maxColour.getBackground());
}
}
+
public void defColour_actionPerformed()
{
setDefaultMinMax();
maxColour.repaint();
changeColour();
}
+
void changeColour()
{
// Check if combobox is still adjusting
if (av.getAlignment().getGroups() != null)
{
- for (SequenceGroup sg:ap.av.getAlignment().getGroups())
+ for (SequenceGroup sg : ap.av.getAlignment().getGroups())
{
-
+
if (sg.cs == null)
{
continue;
av.setGlobalColourScheme(oldcs);
if (av.getAlignment().getGroups() != null)
{
- for (SequenceGroup sg:ap.av.getAlignment().getGroups())
+ for (SequenceGroup sg : ap.av.getAlignment().getGroups())
{
Object cs = oldgroupColours.get(sg);
if (cs instanceof ColourSchemeI)