Merge branch 'bug/JAL-1775' into develop
[jalview.git] / src / jalview / datamodel / AlignmentAnnotation.java
index 1bbe81e..a7e635f 100755 (executable)
@@ -503,8 +503,8 @@ public class AlignmentAnnotation
     {
       return ((index + offset < 0) || (index + offset) >= max
               || annotations[index + offset] == null || (annotations[index
- + offset].secondaryStructure < ' ') ? ' '
-              : annotations[index + offset].secondaryStructure);
+ + offset].secondaryStructure <= ' ') ? ' '
+              : annotations[index + offset].displayCharacter.charAt(0));
     }
 
     @Override
@@ -515,8 +515,8 @@ public class AlignmentAnnotation
 
       for (int i = offset; i < mx; i++)
       {
-        string[i] = (annotations[i] == null || (annotations[i].secondaryStructure < 32)) ? ' '
-                : annotations[i].secondaryStructure;
+        string[i] = (annotations[i] == null || (annotations[i].secondaryStructure <= 32)) ? ' '
+                : annotations[i].displayCharacter.charAt(0);
       }
       return new String(string);
     }
@@ -1359,8 +1359,21 @@ public class AlignmentAnnotation
   {
     if (properties == null)
     {
-      return Collections.EMPTY_LIST;
+      return Collections.emptyList();
     }
     return properties.keySet();
   }
+
+  /**
+   * Returns the Annotation for the given sequence position (base 1) if any,
+   * else null
+   * 
+   * @param position
+   * @return
+   */
+  public Annotation getAnnotationForPosition(int position)
+  {
+    return sequenceMapping == null ? null : sequenceMapping.get(position);
+
+  }
 }