Merge branch 'master' of https://source.jalview.org/git/jalviewjs.git
[jalviewjs.git] / site / j2s / jalview / schemes / RNAInteractionColourScheme.js
1 Clazz.declarePackage ("jalview.schemes");
2 Clazz.load (["jalview.schemes.ResidueColourScheme"], "jalview.schemes.RNAInteractionColourScheme", ["jalview.schemes.ResidueProperties", "java.awt.Color"], function () {
3 c$ = Clazz.declareType (jalview.schemes, "RNAInteractionColourScheme", jalview.schemes.ResidueColourScheme);
4 Clazz.defineMethod (c$, "findColour", 
5 function (c) {
6 return this.colors[jalview.schemes.ResidueProperties.nucleotideIndex[c.charCodeAt (0)]];
7 }, "~S");
8 Clazz.defineMethod (c$, "findColour", 
9 function (c, j, seq) {
10 var currentColour;
11 if ((this.threshold == 0) || this.aboveThreshold (c, j)) {
12 try {
13 currentColour = this.colors[jalview.schemes.ResidueProperties.nucleotideIndex[c.charCodeAt (0)]];
14 } catch (ex) {
15 if (Clazz.exceptionOf (ex, Exception)) {
16 return java.awt.Color.white;
17 } else {
18 throw ex;
19 }
20 }
21 } else {
22 return java.awt.Color.white;
23 }if (this.conservationColouring) {
24 currentColour = this.applyConservation (currentColour, j);
25 }return currentColour;
26 }, "~S,~N,jalview.datamodel.SequenceI");
27 });