X-Git-Url: http://source.jalview.org/gitweb/?p=jalviewjs.git;a=blobdiff_plain;f=site%2Fj2s%2Fjalview%2Fschemes%2FScoreColourScheme.js;h=f097a4053c207e7de91d55cec0dccca3a19c794a;hp=5027bdf23d6acf7aadf91387daf81716a7c937a2;hb=b9b7a352eee79b7764c3b09c9d19663075061d8c;hpb=7301a2415adab88038b291fc54caeeb3a5a47a44 diff --git a/site/j2s/jalview/schemes/ScoreColourScheme.js b/site/j2s/jalview/schemes/ScoreColourScheme.js index 5027bdf..f097a40 100644 --- a/site/j2s/jalview/schemes/ScoreColourScheme.js +++ b/site/j2s/jalview/schemes/ScoreColourScheme.js @@ -1,43 +1,43 @@ -Clazz.declarePackage ("jalview.schemes"); -Clazz.load (["jalview.schemes.ResidueColourScheme"], "jalview.schemes.ScoreColourScheme", ["jalview.schemes.ResidueProperties", "jalview.util.Comparison", "java.awt.Color"], function () { -c$ = Clazz.decorateAsClass (function () { -this.min = 0; -this.max = 0; -this.scores = null; -Clazz.instantialize (this, arguments); -}, jalview.schemes, "ScoreColourScheme", jalview.schemes.ResidueColourScheme); -Clazz.makeConstructor (c$, -function (symbolIndex, scores, min, max) { -Clazz.superConstructor (this, jalview.schemes.ScoreColourScheme, [symbolIndex]); -this.scores = scores; -this.min = min; -this.max = max; -var i; -var iSize = scores.length; -this.colors = new Array (scores.length); -for (i = 0; i < iSize; i++) { -var red = (scores[i] - min) / (max - min); -if (red > 1.0) { -red = 1.0; -}if (red < 0.0) { -red = 0.0; -}this.colors[i] = this.makeColour (red); -} -}, "~A,~A,~N,~N"); -Clazz.defineMethod (c$, "findColour", -function (c, j, seq) { -if (this.threshold > 0) { -if (!this.aboveThreshold (c, j)) { -return java.awt.Color.white; -}}if (jalview.util.Comparison.isGap (c)) { -return java.awt.Color.white; -}var currentColour = this.colors[jalview.schemes.ResidueProperties.aaIndex[c.charCodeAt (0)]]; -if (this.conservationColouring) { -currentColour = this.applyConservation (currentColour, j); -}return currentColour; -}, "~S,~N,jalview.datamodel.SequenceI"); -Clazz.defineMethod (c$, "makeColour", -function (c) { -return new java.awt.Color (c, 0.0, 1.0 - c); -}, "~N"); -}); +Clazz.declarePackage ("jalview.schemes"); +Clazz.load (["jalview.schemes.ResidueColourScheme"], "jalview.schemes.ScoreColourScheme", ["jalview.schemes.ResidueProperties", "jalview.util.Comparison", "java.awt.Color"], function () { +c$ = Clazz.decorateAsClass (function () { +this.min = 0; +this.max = 0; +this.scores = null; +Clazz.instantialize (this, arguments); +}, jalview.schemes, "ScoreColourScheme", jalview.schemes.ResidueColourScheme); +Clazz.makeConstructor (c$, +function (symbolIndex, scores, min, max) { +Clazz.superConstructor (this, jalview.schemes.ScoreColourScheme, [symbolIndex]); +this.scores = scores; +this.min = min; +this.max = max; +var i; +var iSize = scores.length; +this.colors = new Array (scores.length); +for (i = 0; i < iSize; i++) { +var red = (scores[i] - min) / (max - min); +if (red > 1.0) { +red = 1.0; +}if (red < 0.0) { +red = 0.0; +}this.colors[i] = this.makeColour (red); +} +}, "~A,~A,~N,~N"); +Clazz.defineMethod (c$, "findColour", +function (c, j, seq) { +if (this.threshold > 0) { +if (!this.aboveThreshold (c, j)) { +return java.awt.Color.white; +}}if (jalview.util.Comparison.isGap (c)) { +return java.awt.Color.white; +}var currentColour = this.colors[jalview.schemes.ResidueProperties.aaIndex[c.charCodeAt (0)]]; +if (this.conservationColouring) { +currentColour = this.applyConservation (currentColour, j); +}return currentColour; +}, "~S,~N,jalview.datamodel.SequenceI"); +Clazz.defineMethod (c$, "makeColour", +function (c) { +return new java.awt.Color (c, 0.0, 1.0 - c); +}, "~N"); +});