Merge branch 'feature/2588' into merge/develop_feature/2588_JAL-2588
[jalview.git] / src / jalview / appletgui / SequenceRenderer.java
index 684701e..e55f2a5 100755 (executable)
@@ -120,8 +120,8 @@ public class SequenceRenderer implements jalview.api.SequenceRenderer
     int length = seq.getLength();
 
     int curStart = -1;
-    int curWidth = av.getCharWidth(), avCharWidth = av.getCharWidth(), avCharHeight = av
-            .getCharHeight();
+    int curWidth = av.getCharWidth(), avCharWidth = av.getCharWidth(),
+            avCharHeight = av.getCharHeight();
 
     Color resBoxColour = Color.white;
     Color tempColour = null;
@@ -276,8 +276,8 @@ public class SequenceRenderer implements jalview.api.SequenceRenderer
       }
 
       charOffset = (avCharWidth - fm.charWidth(s)) / 2;
-      graphics.drawString(String.valueOf(s), charOffset + avCharWidth
-              * (i - start), y1);
+      graphics.drawString(String.valueOf(s),
+              charOffset + avCharWidth * (i - start), y1);
     }
 
   }
@@ -300,21 +300,25 @@ public class SequenceRenderer implements jalview.api.SequenceRenderer
     // currentSequenceGroup.getConsensus()
     char conschar = (usesrep) ? (currentGroup == null
             || position < currentGroup.getStartRes()
-            || position > currentGroup.getEndRes() ? av.getAlignment()
-            .getSeqrep().getCharAt(position)
-            : (currentGroup.getSeqrep() != null ? currentGroup.getSeqrep()
-                    .getCharAt(position) : av.getAlignment().getSeqrep()
-                    .getCharAt(position)))
+            || position > currentGroup.getEndRes()
+                    ? av.getAlignment().getSeqrep().getCharAt(position)
+                    : (currentGroup.getSeqrep() != null
+                            ? currentGroup.getSeqrep().getCharAt(position)
+                            : av.getAlignment().getSeqrep()
+                                    .getCharAt(position)))
             : (currentGroup != null && currentGroup.getConsensus() != null
                     && position >= currentGroup.getStartRes()
-                    && position <= currentGroup.getEndRes() && currentGroup
-                    .getConsensus().annotations.length > position) ? currentGroup
-                    .getConsensus().annotations[position].displayCharacter
-                    .charAt(0)
-                    : av.getAlignmentConsensusAnnotation().annotations[position].displayCharacter
-                            .charAt(0);
+                    && position <= currentGroup.getEndRes()
+                    && currentGroup
+                            .getConsensus().annotations.length > position)
+                                    ? currentGroup
+                                            .getConsensus().annotations[position].displayCharacter
+                                                    .charAt(0)
+                                    : av.getAlignmentConsensusAnnotation().annotations[position].displayCharacter
+                                            .charAt(0);
     if (!jalview.util.Comparison.isGap(conschar)
-            && (sequenceChar == conschar || sequenceChar + CHAR_TO_UPPER == conschar))
+            && (sequenceChar == conschar
+                    || sequenceChar + CHAR_TO_UPPER == conschar))
     {
       sequenceChar = conservedChar;
     }
@@ -328,7 +332,8 @@ public class SequenceRenderer implements jalview.api.SequenceRenderer
     int pady = avCharHeight / 5;
     int charOffset = 0;
     graphics.setColor(Color.black);
-    graphics.fillRect(x1, y1, avCharWidth * (end - start + 1), avCharHeight);
+    graphics.fillRect(x1, y1, avCharWidth * (end - start + 1),
+            avCharHeight);
     graphics.setColor(Color.white);
 
     char s = '~';
@@ -343,8 +348,9 @@ public class SequenceRenderer implements jalview.api.SequenceRenderer
         }
 
         charOffset = (avCharWidth - fm.charWidth(s)) / 2;
-        graphics.drawString(String.valueOf(s), charOffset + x1
-                + avCharWidth * (i - start), y1 + avCharHeight - pady);
+        graphics.drawString(String.valueOf(s),
+                charOffset + x1 + avCharWidth * (i - start),
+                y1 + avCharHeight - pady);
       }
     }
   }