X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FSequenceRenderer.java;fp=src%2Fjalview%2Fgui%2FSequenceRenderer.java;h=4498f881dd3689751d9132be8dcfaf36a5e6791c;hb=be762d8d9c71a7aa3121e845c45911c7192b7827;hp=36825eaf99f612a03aad300f068eff66629c263c;hpb=d1bb7a31fc091606aedbc255a5766ac79e36fa91;p=jalview.git diff --git a/src/jalview/gui/SequenceRenderer.java b/src/jalview/gui/SequenceRenderer.java index 36825ea..4498f88 100755 --- a/src/jalview/gui/SequenceRenderer.java +++ b/src/jalview/gui/SequenceRenderer.java @@ -77,8 +77,8 @@ public class SequenceRenderer implements jalview.api.SequenceRenderer // If EPS graphics, stringWidth will be a double, not an int double dwidth = fm.getStringBounds("M", g).getWidth(); - monospacedFont = (dwidth == fm.getStringBounds("|", g).getWidth() && av - .getCharWidth() == dwidth); + monospacedFont = (dwidth == fm.getStringBounds("|", g).getWidth() + && av.getCharWidth() == dwidth); this.renderGaps = renderGaps; } @@ -140,8 +140,7 @@ public class SequenceRenderer implements jalview.api.SequenceRenderer { if (shader.getColourScheme() != null) { - resBoxColour = shader.findColour(seq.getCharAt(i), - i, seq); + resBoxColour = shader.findColour(seq.getCharAt(i), i, seq); } else if (forOverview && !Comparison.isGap(seq.getCharAt(i))) { @@ -217,8 +216,8 @@ public class SequenceRenderer implements jalview.api.SequenceRenderer int length = seq.getLength(); int curStart = -1; - int curWidth = av.getCharWidth(), avWidth = av.getCharWidth(), avHeight = av - .getCharHeight(); + int curWidth = av.getCharWidth(), avWidth = av.getCharWidth(), + avHeight = av.getCharHeight(); Color tempColour = null; @@ -308,8 +307,9 @@ public class SequenceRenderer implements jalview.api.SequenceRenderer else { char gap = av.getGapCharacter(); - graphics.drawString(seq.getSequenceAsString(start, end + 1) - .replace(gap, ' '), 0, y1); + graphics.drawString( + seq.getSequenceAsString(start, end + 1).replace(gap, ' '), + 0, y1); } } else @@ -317,8 +317,9 @@ public class SequenceRenderer implements jalview.api.SequenceRenderer boolean srep = av.isDisplayReferenceSeq(); boolean getboxColour = false; boolean isarep = av.getAlignment().getSeqrep() == seq; - boolean isgrep = currentSequenceGroup != null ? currentSequenceGroup - .getSeqrep() == seq : false; + boolean isgrep = currentSequenceGroup != null + ? currentSequenceGroup.getSeqrep() == seq + : false; char sr_c; for (int i = start; i <= end; i++) { @@ -354,7 +355,8 @@ public class SequenceRenderer implements jalview.api.SequenceRenderer if (currentSequenceGroup.thresholdTextColour > 0) { if (resBoxColour.getRed() + resBoxColour.getBlue() - + resBoxColour.getGreen() < currentSequenceGroup.thresholdTextColour) + + resBoxColour + .getGreen() < currentSequenceGroup.thresholdTextColour) { graphics.setColor(currentSequenceGroup.textColour2); } @@ -443,21 +445,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; } @@ -511,8 +517,8 @@ public class SequenceRenderer implements jalview.api.SequenceRenderer * @param height * DOCUMENT ME! */ - 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 pady = av.getCharHeight() / 5; int charOffset = 0;