/*
- * 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.0b1)
+ * Copyright (C) 2015 The Jalview Authors
*
* This file is part of Jalview.
*
int y1)
{
if (seq == null)
- {
+ {
return; // fix for racecondition
}
int i = start;
{
boolean srep = av.isDisplayReferenceSeq();
boolean getboxColour = false;
+ boolean isarep = av.getAlignment().getSeqrep() == seq;
+ boolean isgrep = currentSequenceGroup != null ? currentSequenceGroup
+ .getSeqrep() == seq : false;
+ char sr_c;
for (int i = start; i <= end; i++)
{
+
graphics.setColor(av.getTextColour());
getboxColour = false;
s = seq.getCharAt(i);
+
if (!renderGaps && jalview.util.Comparison.isGap(s))
{
continue;
{
graphics.setColor(currentSequenceGroup.textColour);
}
- if (currentSequenceGroup.getShowNonconserved()) // todo optimize
+ if (!isarep && !isgrep
+ && currentSequenceGroup.getShowNonconserved()) // todo
+ // optimize
{
// todo - use sequence group consensus
- s = getDisplayChar(srep, i, s,
- '.');
+ s = getDisplayChar(srep, i, s, '.', currentSequenceGroup);
}
graphics.setColor(av.getTextColour2());
}
}
- if (av.getShowUnconserved())
+ if (!isarep && av.getShowUnconserved())
{
- s = getDisplayChar(srep, i, s,
- '.');
+ s = getDisplayChar(srep, i, s, '.', currentSequenceGroup);
}
charOffset = (av.getCharWidth() - fm.charWidth(s)) / 2;
graphics.drawString(String.valueOf(s),
- charOffset + av.getCharWidth()
- * (i - start), y1);
+ charOffset + av.getCharWidth() * (i - start), y1);
}
}
* @return
*/
private char getDisplayChar(final boolean usesrep, int position,
- char sequenceChar, char conservedChar)
+ char sequenceChar, char conservedChar, SequenceGroup currentGroup)
{
// 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 != '-'
+ char conschar = (usesrep) ? (currentGroup == null ? av.getAlignment()
+ .getSeqrep().getCharAt(position)
+ : (currentGroup.getSeqrep() != null ? currentGroup.getSeqrep()
+ .getCharAt(position) : av.getAlignment().getSeqrep()
+ .getCharAt(position)))
+ : (currentGroup != null && currentGroup.getConsensus() != null) ? 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 = conservedChar;