X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fappletgui%2FSequenceRenderer.java;h=eab6e39fa8fefada05dd9fc932570331faad988b;hb=5a352aa2f3330ae269d9b70c4a7374c2518bfb2e;hp=516dcc176997b671f10e6a572bc1e649dfc0e7fe;hpb=fb548a8458941602b0b8b45da5aaf60206e10ec2;p=jalview.git diff --git a/src/jalview/appletgui/SequenceRenderer.java b/src/jalview/appletgui/SequenceRenderer.java index 516dcc1..eab6e39 100755 --- a/src/jalview/appletgui/SequenceRenderer.java +++ b/src/jalview/appletgui/SequenceRenderer.java @@ -84,8 +84,8 @@ public class SequenceRenderer implements jalview.api.SequenceRenderer { // TODO replace 8 or so code duplications with calls to this method // (refactored as needed) - return resColourFinder.getResidueColour(av.getResidueShading(), - allGroups, seq, position, finder); + return resColourFinder.getResidueColour(av.getShowBoxes(), + av.getResidueShading(), allGroups, seq, position, finder); } public Color findSequenceColour(SequenceI seq, int i) @@ -119,8 +119,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; @@ -136,8 +136,7 @@ public class SequenceRenderer implements jalview.api.SequenceRenderer if (currentSequenceGroup.getDisplayBoxes()) { resBoxColour = resColourFinder.getBoxColour( - currentSequenceGroup.getGroupColourScheme(), seq, - i); + currentSequenceGroup.getGroupColourScheme(), seq, i); } } else if (av.getShowBoxes()) @@ -275,8 +274,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); } } @@ -299,35 +298,40 @@ 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; } return sequenceChar; } - 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 = '~'; @@ -342,8 +346,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); } } }