formatting
[jalview.git] / src / jalview / appletgui / AnnotationColourChooser.java
index 1a661be..04864b1 100755 (executable)
@@ -58,7 +58,7 @@ public class AnnotationColourChooser extends Panel implements
     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)
         {
@@ -82,12 +82,13 @@ public class AnnotationColourChooser extends Panel implements
     }
 
     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());
       }
@@ -119,21 +120,23 @@ public class AnnotationColourChooser extends Panel implements
     {
       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;
@@ -149,10 +152,13 @@ public class AnnotationColourChooser extends Panel implements
 
   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
@@ -183,14 +189,14 @@ public class AnnotationColourChooser extends Panel implements
 
     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));
@@ -201,9 +207,9 @@ public class AnnotationColourChooser extends Panel implements
     thresholdIsMin.setLabel("Threshold is min/max");
 
     this.setLayout(borderLayout1);
-    
+
     jPanel1.setBackground(Color.white);
-    
+
     jPanel2.setLayout(new FlowLayout());
     jPanel2.setBackground(Color.white);
     threshold.addItemListener(this);
@@ -213,32 +219,30 @@ public class AnnotationColourChooser extends Panel implements
     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();
@@ -250,7 +254,7 @@ public class AnnotationColourChooser extends Panel implements
   Button ok = new Button();
 
   Button cancel = new Button();
-  
+
   Button defColours = new Button();
 
   Panel jPanel1 = new Panel();
@@ -296,7 +300,7 @@ public class AnnotationColourChooser extends Panel implements
     }
     else if (evt.getSource() == defColours)
     {
-       defColour_actionPerformed();
+      defColour_actionPerformed();
     }
     else if (evt.getSource() == ok)
     {
@@ -377,6 +381,7 @@ public class AnnotationColourChooser extends Panel implements
       new UserDefinedColours(this, "Max Colour", maxColour.getBackground());
     }
   }
+
   public void defColour_actionPerformed()
   {
     setDefaultMinMax();
@@ -384,6 +389,7 @@ public class AnnotationColourChooser extends Panel implements
     maxColour.repaint();
     changeColour();
   }
+
   void changeColour()
   {
     // Check if combobox is still adjusting
@@ -463,9 +469,9 @@ public class AnnotationColourChooser extends Panel implements
 
     if (av.getAlignment().getGroups() != null)
     {
-      for (SequenceGroup sg:ap.av.getAlignment().getGroups())
+      for (SequenceGroup sg : ap.av.getAlignment().getGroups())
       {
-     
+
         if (sg.cs == null)
         {
           continue;
@@ -495,7 +501,7 @@ public class AnnotationColourChooser extends Panel implements
     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)