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