Merge branch 'patch/JAL-2236_filtercolumns_seqassoc' into develop
[jalview.git] / src / jalview / appletgui / AnnotationRowFilter.java
index 8a0a44a..cd00fcf 100644 (file)
@@ -1,3 +1,23 @@
+/*
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
+ * 
+ * This file is part of Jalview.
+ * 
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License 
+ * as published by the Free Software Foundation, either version 3
+ * of the License, or (at your option) any later version.
+ *  
+ * Jalview is distributed in the hope that it will be useful, but 
+ * WITHOUT ANY WARRANTY; without even the implied warranty 
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
+ * PURPOSE.  See the GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
+ */
 package jalview.appletgui;
 
 import jalview.schemes.AnnotationColourGradient;
@@ -13,8 +33,6 @@ import java.awt.TextField;
 import java.awt.event.ActionEvent;
 import java.util.Vector;
 
-
-
 @SuppressWarnings("serial")
 public abstract class AnnotationRowFilter extends Panel
 {
@@ -56,7 +74,6 @@ public abstract class AnnotationRowFilter extends Panel
    */
   protected boolean sliderDragging = false;
 
-
   public AnnotationRowFilter(AlignViewport av, final AlignmentPanel ap)
   {
     this.av = av;
@@ -68,7 +85,6 @@ public abstract class AnnotationRowFilter extends Panel
 
   }
 
-
   public Vector getAnnotationItems(boolean isSeqAssociated)
   {
     Vector list = new Vector();
@@ -88,6 +104,16 @@ public abstract class AnnotationRowFilter extends Panel
         enableSeqAss = true;
       }
       String label = av.getAlignment().getAlignmentAnnotation()[i].label;
+      // add associated sequence ID if available
+      if (!isSeqAssociated
+              && av.getAlignment().getAlignmentAnnotation()[i].sequenceRef != null)
+      {
+        label = label
+                + "_"
+                + av.getAlignment().getAlignmentAnnotation()[i].sequenceRef
+                        .getName();
+      }
+      // make label unique
       if (!list.contains(label))
       {
         anmap[list.size()] = i;
@@ -167,18 +193,16 @@ public abstract class AnnotationRowFilter extends Panel
     }
   }
 
-
   protected void populateThresholdComboBox(Choice threshold)
   {
     threshold.addItem(MessageManager
-            .getString("label.threshold_feature_no_thereshold"));
+            .getString("label.threshold_feature_no_threshold"));
     threshold.addItem(MessageManager
-            .getString("label.threshold_feature_above_thereshold"));
+            .getString("label.threshold_feature_above_threshold"));
     threshold.addItem(MessageManager
-            .getString("label.threshold_feature_below_thereshold"));
+            .getString("label.threshold_feature_below_threshold"));
   }
 
-
   public jalview.datamodel.AlignmentAnnotation getCurrentAnnotation()
   {
     return currentAnnotation;
@@ -195,4 +219,4 @@ public abstract class AnnotationRowFilter extends Panel
   public abstract void updateView();
 
   public abstract void reset();
-}
\ No newline at end of file
+}