1 Clazz.declarePackage ("jalview.schemes");
\r
2 Clazz.load (["jalview.schemes.ResidueColourScheme"], "jalview.schemes.ScoreColourScheme", ["jalview.schemes.ResidueProperties", "jalview.util.Comparison", "java.awt.Color"], function () {
\r
3 c$ = Clazz.decorateAsClass (function () {
\r
7 Clazz.instantialize (this, arguments);
\r
8 }, jalview.schemes, "ScoreColourScheme", jalview.schemes.ResidueColourScheme);
\r
9 Clazz.makeConstructor (c$,
\r
10 function (symbolIndex, scores, min, max) {
\r
11 Clazz.superConstructor (this, jalview.schemes.ScoreColourScheme, [symbolIndex]);
\r
12 this.scores = scores;
\r
16 var iSize = scores.length;
\r
17 this.colors = new Array (scores.length);
\r
18 for (i = 0; i < iSize; i++) {
\r
19 var red = (scores[i] - min) / (max - min);
\r
24 }this.colors[i] = this.makeColour (red);
\r
27 Clazz.defineMethod (c$, "findColour",
\r
28 function (c, j, seq) {
\r
29 if (this.threshold > 0) {
\r
30 if (!this.aboveThreshold (c, j)) {
\r
31 return java.awt.Color.white;
\r
32 }}if (jalview.util.Comparison.isGap (c)) {
\r
33 return java.awt.Color.white;
\r
34 }var currentColour = this.colors[jalview.schemes.ResidueProperties.aaIndex[c.charCodeAt (0)]];
\r
35 if (this.conservationColouring) {
\r
36 currentColour = this.applyConservation (currentColour, j);
\r
37 }return currentColour;
\r
38 }, "~S,~N,jalview.datamodel.SequenceI");
\r
39 Clazz.defineMethod (c$, "makeColour",
\r
41 return new java.awt.Color (c, 0.0, 1.0 - c);
\r