*/
public class SequenceRenderer implements jalview.api.SequenceRenderer
{
+ final static int CHAR_TO_UPPER = 'A' - 'a';
+
AlignViewport av;
FontMetrics fm;
}
}
+ /**
+ * Returns 'conservedChar' to represent the given position if the sequence
+ * character at that position is equal to the consensus (ignoring case), else
+ * returns the sequence character
+ *
+ * @param usesrep
+ * @param position
+ * @param sequenceChar
+ * @param conservedChar
+ * @return
+ */
private char getDisplayChar(final boolean usesrep, int position,
- char s, char c)
+ char sequenceChar, char conservedChar)
{
- // TODO - use currentSequenceGroup rather than alignemnt
+ // 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 != '-' && s == conschar)
+ if (conschar != '-'
+ && (sequenceChar == conschar || sequenceChar + CHAR_TO_UPPER == conschar))
{
- s = c;
+ sequenceChar = conservedChar;
}
- return s;
+ return sequenceChar;
}
/**