{
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);
}
* @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);
+ 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 (conschar != '-'
&& (sequenceChar == conschar || sequenceChar + CHAR_TO_UPPER == conschar))
{