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