From: gmungoc Date: Wed, 15 Jul 2015 11:03:28 +0000 (+0100) Subject: JAL-1813 only pair up A-Z with a-z if annotation is RNA X-Git-Tag: Release_2_10_0~575 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=2fa35cedbc936e82f7d2ccee409e4afa41a7b6db;p=jalview.git JAL-1813 only pair up A-Z with a-z if annotation is RNA --- diff --git a/src/jalview/renderer/AnnotationRenderer.java b/src/jalview/renderer/AnnotationRenderer.java index 3359678..61194ce 100644 --- a/src/jalview/renderer/AnnotationRenderer.java +++ b/src/jalview/renderer/AnnotationRenderer.java @@ -47,6 +47,12 @@ import com.stevesoft.pat.Regex; public class AnnotationRenderer { + private static final int UPPER_TO_LOWER = 'a' - 'A'; // 32 + + private static final int CHAR_A = 'A'; // 65 + + private static final int CHAR_Z = 'Z'; // 90 + /** * flag indicating if timing and redraw parameter info should be output */ @@ -715,14 +721,14 @@ public class AnnotationRenderer } } - if (ss >= 65) + if (isRNA && (ss >= CHAR_A) && (ss <= CHAR_Z)) { // distinguish between forward/backward base-pairing - if (displayChar.indexOf(ss + 32) > -1) + int ssLowerCase = ss + UPPER_TO_LOWER; + // TODO would .equals() be safer here? or charAt(0)? + if (displayChar.indexOf(ssLowerCase) > -1) { - - ss = (char) (ss + 32); - + ss = (char) ssLowerCase; } }