X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fappletgui%2FSequenceRenderer.java;fp=src%2Fjalview%2Fappletgui%2FSequenceRenderer.java;h=a382c604a4937f0d54a03395780236d15c6cb6d0;hb=2f96125e48e277a8296e9e2b53719f346f043ceb;hp=38031e4e43f27e2afeb17b871e1d89e4de7a8762;hpb=5160a2b12eaed0e6fb398ec3ff3805e1630b9b83;p=jalview.git diff --git a/src/jalview/appletgui/SequenceRenderer.java b/src/jalview/appletgui/SequenceRenderer.java index 38031e4..a382c60 100755 --- a/src/jalview/appletgui/SequenceRenderer.java +++ b/src/jalview/appletgui/SequenceRenderer.java @@ -162,8 +162,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 tempColour = null; while (i <= end) @@ -309,8 +309,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); } } @@ -333,21 +333,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; } @@ -374,14 +378,15 @@ public class SequenceRenderer implements jalview.api.SequenceRenderer return false; } - public void drawHighlightedText(SequenceI seq, int start, int end, - int x1, int y1) + public void drawHighlightedText(SequenceI seq, int start, int end, int x1, + int y1) { int avCharWidth = av.getCharWidth(), avCharHeight = av.getCharHeight(); 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 = '~'; @@ -396,8 +401,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); } } }