JAL-1645 Version-Rel Version 2.9 Year-Rel 2015 Licensing glob
[jalview.git] / src / jalview / appletgui / SequenceRenderer.java
index feb2705..b843526 100755 (executable)
@@ -1,6 +1,6 @@
 /*
- * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
- * Copyright (C) $$Year-Rel$$ 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.
  * 
@@ -256,8 +256,7 @@ public class SequenceRenderer implements jalview.api.SequenceRenderer
         }
         if (currentSequenceGroup.getShowNonconserved())
         {
-          s = getDisplayChar(srep, i, s,
-                  '.');
+          s = getDisplayChar(srep, i, s, '.');
         }
       }
       else
@@ -281,8 +280,7 @@ public class SequenceRenderer implements jalview.api.SequenceRenderer
         }
         if (av.getShowUnconserved())
         {
-          s = getDisplayChar(srep, i, s,
-                  '.');
+          s = getDisplayChar(srep, i, s, '.');
 
         }
       }
@@ -314,14 +312,16 @@ public class SequenceRenderer implements jalview.api.SequenceRenderer
 
   }
 
-  private char getDisplayChar(final boolean usesrep, int position,
-          char s, char c)
+  private char getDisplayChar(final boolean usesrep, int position, char s,
+          char c)
   {
-    // TODO - use currentSequenceGroup rather than alignemnt 
+    // TODO - use currentSequenceGroup rather than alignment
     // currentSequenceGroup.getConsensus()
-    char conschar = (usesrep) ? av.getAlignment().getSeqrep().getCharAt(position) : av.getAlignmentConsensusAnnotation().annotations[position].displayCharacter
-            .charAt(0);
-    if (conschar != '-' && s == conschar)
+    char conschar = (usesrep) ? av.getAlignment().getSeqrep()
+            .getCharAt(position)
+            : av.getAlignmentConsensusAnnotation().annotations[position].displayCharacter
+                    .charAt(0);
+    if (!jalview.util.Comparison.isGap(conschar) && s == conschar)
     {
       s = c;
     }