JAL-1645 Version-Rel Version 2.9 Year-Rel 2015 Licensing glob
[jalview.git] / src / jalview / appletgui / AnnotationColourChooser.java
index c7b7c6c..9df3b73 100644 (file)
@@ -1,6 +1,6 @@
 /*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2)
- * Copyright (C) 2014 The Jalview Authors
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9)
+ * Copyright (C) 2015 The Jalview Authors
  * 
  * This file is part of Jalview.
  * 
  */
 package jalview.appletgui;
 
-import java.util.*;
-
-import java.awt.*;
-import java.awt.event.*;
-
-import jalview.datamodel.*;
-import jalview.schemes.*;
+import jalview.datamodel.SequenceGroup;
+import jalview.schemes.AnnotationColourGradient;
+import jalview.schemes.ColourSchemeI;
 import jalview.util.MessageManager;
 
+import java.awt.BorderLayout;
+import java.awt.Button;
+import java.awt.Checkbox;
+import java.awt.Choice;
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.FlowLayout;
+import java.awt.Font;
+import java.awt.Frame;
+import java.awt.Panel;
+import java.awt.Scrollbar;
+import java.awt.TextField;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.AdjustmentEvent;
+import java.awt.event.AdjustmentListener;
+import java.awt.event.ItemEvent;
+import java.awt.event.ItemListener;
+import java.awt.event.MouseEvent;
+import java.awt.event.MouseListener;
+import java.util.Hashtable;
+import java.util.Vector;
+
 public class AnnotationColourChooser extends Panel implements
         ActionListener, AdjustmentListener, ItemListener, MouseListener
 {
@@ -104,9 +123,13 @@ public class AnnotationColourChooser extends Panel implements
     {
       String label = av.getAlignment().getAlignmentAnnotation()[i].label;
       if (!list.contains(label))
+      {
         list.addElement(label);
+      }
       else
+      {
         list.addElement(label + "_" + (index++));
+      }
     }
 
     for (int i = 0; i < list.size(); i++)
@@ -137,7 +160,9 @@ public class AnnotationColourChooser extends Panel implements
         threshold.select(1);
         break;
       default:
-        throw new Error(MessageManager.getString("error.implementation_error_dont_know_thereshold_annotationcolourgradient"));
+        throw new Error(
+                MessageManager
+                        .getString("error.implementation_error_dont_know_thereshold_annotationcolourgradient"));
       }
       thresholdIsMin.setState(acg.thresholdIsMinMax);
       thresholdValue.setText("" + acg.getAnnotationThreshold());
@@ -311,7 +336,6 @@ public class AnnotationColourChooser extends Panel implements
     }
     else if (evt.getSource() == ok)
     {
-      changeColour();
       frame.setVisible(false);
     }
     else if (evt.getSource() == cancel)
@@ -348,14 +372,14 @@ public class AnnotationColourChooser extends Panel implements
   {
     if (!adjusting)
     {
-      thresholdValue.setText(((float) slider.getValue() / 1000f) + "");
+      thresholdValue.setText((slider.getValue() / 1000f) + "");
       if (currentColours.getState()
               && !(av.getGlobalColourScheme() instanceof AnnotationColourGradient))
       {
         changeColour();
       }
 
-      currentAnnotation.threshold.value = (float) slider.getValue() / 1000f;
+      currentAnnotation.threshold.value = slider.getValue() / 1000f;
       ap.paintAlignment(false);
     }
   }