Check for null displayCharacters
authoramwaterhouse <Andrew Waterhouse>
Mon, 23 Apr 2007 12:46:14 +0000 (12:46 +0000)
committeramwaterhouse <Andrew Waterhouse>
Mon, 23 Apr 2007 12:46:14 +0000 (12:46 +0000)
src/jalview/datamodel/AlignmentAnnotation.java

index 81ea36f..16f8fb8 100755 (executable)
@@ -54,6 +54,8 @@ public class AlignmentAnnotation
   /** DOCUMENT ME!! */
   public float graphMax;
 
+  public float score;
+
   public GraphLine threshold;
 
   // Graphical hints and tips
@@ -87,6 +89,7 @@ public class AlignmentAnnotation
 
   public static final int LINE_GRAPH = 2;
 
+
   public static int getGraphValueFromString(String string)
   {
     if (string.equalsIgnoreCase("BAR_GRAPH"))
@@ -138,9 +141,11 @@ public class AlignmentAnnotation
           hasIcons = true;
       }
 
-      if (annotations[i].displayCharacter!=null)
-      {
-        if (annotations[i].displayCharacter.length() == 1
+      if(annotations[i].displayCharacter==null)
+        continue;
+
+
+      if (annotations[i].displayCharacter.length() == 1
           && !annotations[i].displayCharacter.equals("H")
           && !annotations[i].displayCharacter.equals("E")
           && !annotations[i].displayCharacter.equals("-")
@@ -160,8 +165,6 @@ public class AlignmentAnnotation
         else
           padGaps = false;
       }
-    }
-
 
     if (nonSSLabel)
     {
@@ -228,7 +231,9 @@ public class AlignmentAnnotation
           continue;
         }
 
-        if (drawValues && annotations[i].displayCharacter!=null && annotations[i].displayCharacter.length() > 1)
+        if (drawValues
+            && annotations[i].displayCharacter!=null
+            && annotations[i].displayCharacter.length() > 1)
         {
           drawValues = false;
         }
@@ -310,8 +315,8 @@ public class AlignmentAnnotation
             }
             for (int i=0; i<ann.length; i++)
             {
-              if (ann[i]==a) 
-              { 
+              if (ann[i]==a)
+              {
                 sequenceMapping.put(p, annotations[i]);
               }
             }
@@ -333,7 +338,7 @@ public class AlignmentAnnotation
   public void restrict(int startRes, int endRes)
   {
     Annotation[] temp = new Annotation[endRes-startRes+1];
-    if (startRes<annotations.length) 
+    if (startRes<annotations.length)
     {
       System.arraycopy(annotations, startRes, temp, 0, Math.min(endRes, annotations.length-1)-startRes+1);
     }
@@ -378,7 +383,7 @@ public class AlignmentAnnotation
       return true;
     }
     return annotations.length>length;
-    
+
   }
 
   /**