Merge branch 'master' of https://source.jalview.org/git/jalviewjs.git
[jalviewjs.git] / site / j2s / jalview / schemes / GraduatedColor.js
index 5daa0fb..e9998a1 100644 (file)
-Clazz.declarePackage ("jalview.schemes");\r
-Clazz.load (null, "jalview.schemes.GraduatedColor", ["jalview.schemes.UserColourScheme", "java.awt.Color", "java.lang.Float"], function () {\r
-c$ = Clazz.decorateAsClass (function () {\r
-this.thresholdState = -1;\r
-this.lr = 0;\r
-this.lg = 0;\r
-this.lb = 0;\r
-this.dr = 0;\r
-this.dg = 0;\r
-this.db = 0;\r
-this.base = 0;\r
-this.range = 0;\r
-this.thrsh = 0;\r
-this.tolow = false;\r
-this.autoScale = true;\r
-this.ucs = null;\r
-this.colourByLabel = false;\r
-Clazz.instantialize (this, arguments);\r
-}, jalview.schemes, "GraduatedColor");\r
-Clazz.makeConstructor (c$, \r
-function (low, high, min, max) {\r
-this.thrsh = NaN;\r
-this.tolow = min >= max;\r
-this.lr = low.getRed () / 255;\r
-this.lg = low.getGreen () / 255;\r
-this.lb = low.getBlue () / 255;\r
-this.dr = (high.getRed () / 255) - this.lr;\r
-this.dg = (high.getGreen () / 255) - this.lg;\r
-this.db = (high.getBlue () / 255) - this.lb;\r
-if (this.tolow) {\r
-this.base = max;\r
-this.range = min - max;\r
-} else {\r
-this.base = min;\r
-this.range = max - min;\r
-}}, "java.awt.Color,java.awt.Color,~N,~N");\r
-Clazz.makeConstructor (c$, \r
-function (oldcs) {\r
-this.lr = oldcs.lr;\r
-this.lg = oldcs.lg;\r
-this.lb = oldcs.lb;\r
-this.dr = oldcs.dr;\r
-this.dg = oldcs.dg;\r
-this.db = oldcs.db;\r
-this.base = oldcs.base;\r
-this.range = oldcs.range;\r
-this.tolow = oldcs.tolow;\r
-this.thresholdState = oldcs.thresholdState;\r
-this.thrsh = oldcs.thrsh;\r
-this.autoScale = oldcs.autoScale;\r
-this.colourByLabel = oldcs.colourByLabel;\r
-}, "jalview.schemes.GraduatedColor");\r
-Clazz.makeConstructor (c$, \r
-function (oldcs, min, max) {\r
-this.construct (oldcs);\r
-this.updateBounds (min, max);\r
-}, "jalview.schemes.GraduatedColor,~N,~N");\r
-Clazz.defineMethod (c$, "getMinColor", \r
-function () {\r
-return  new java.awt.Color (this.lr, this.lg, this.lb);\r
-});\r
-Clazz.defineMethod (c$, "getMaxColor", \r
-function () {\r
-return  new java.awt.Color (this.lr + this.dr, this.lg + this.dg, this.lb + this.db);\r
-});\r
-Clazz.defineMethod (c$, "getTolow", \r
-function () {\r
-return this.tolow;\r
-});\r
-Clazz.defineMethod (c$, "setTolow", \r
-function (tolower) {\r
-this.tolow = tolower;\r
-}, "~B");\r
-Clazz.defineMethod (c$, "isColored", \r
-function (feature) {\r
-var val = feature.getScore ();\r
-if (Float.isNaN (val)) {\r
-return true;\r
-}if (this.thresholdState == -1) {\r
-return true;\r
-}if (Float.isNaN (this.thrsh)) {\r
-return true;\r
-}var rtn = this.thresholdState == 1;\r
-if (val <= this.thrsh) {\r
-return !rtn;\r
-} else {\r
-return rtn;\r
-}}, "jalview.datamodel.SequenceFeature");\r
-Clazz.defineMethod (c$, "isColourByLabel", \r
-function () {\r
-return this.colourByLabel;\r
-});\r
-Clazz.defineMethod (c$, "setColourByLabel", \r
-function (colourByLabel) {\r
-this.colourByLabel = colourByLabel;\r
-}, "~B");\r
-Clazz.defineMethod (c$, "findColor", \r
-function (feature) {\r
-if (this.colourByLabel) {\r
-if (this.ucs == null) {\r
-this.ucs =  new jalview.schemes.UserColourScheme ();\r
-}return this.ucs.createColourFromName (feature.getDescription ());\r
-}if (this.range == 0.0) {\r
-return this.getMaxColor ();\r
-}var scr = feature.getScore ();\r
-if (Float.isNaN (scr)) {\r
-return this.getMinColor ();\r
-}var scl = (scr - this.base) / this.range;\r
-if (this.tolow) {\r
-scl = -scl;\r
-}if (scl < 0) {\r
-scl = 0;\r
-}if (scl > 1) {\r
-scl = 1;\r
-}return  new java.awt.Color (this.lr + scl * this.dr, this.lg + scl * this.dg, this.lb + scl * this.db);\r
-}, "jalview.datamodel.SequenceFeature");\r
-Clazz.defineMethod (c$, "setThresh", \r
-function (value) {\r
-this.thrsh = value;\r
-}, "~N");\r
-Clazz.defineMethod (c$, "getThresh", \r
-function () {\r
-return this.thrsh;\r
-});\r
-Clazz.defineMethod (c$, "setThreshType", \r
-function (aboveThreshold) {\r
-this.thresholdState = aboveThreshold;\r
-}, "~N");\r
-Clazz.defineMethod (c$, "getThreshType", \r
-function () {\r
-return this.thresholdState;\r
-});\r
-Clazz.defineMethod (c$, "getMax", \r
-function () {\r
-return (this.tolow) ? this.base : (this.base + this.range);\r
-});\r
-Clazz.defineMethod (c$, "getMin", \r
-function () {\r
-return (this.tolow) ? (this.base + this.range) : this.base;\r
-});\r
-Clazz.defineMethod (c$, "isAutoScale", \r
-function () {\r
-return this.autoScale;\r
-});\r
-Clazz.defineMethod (c$, "setAutoScaled", \r
-function (autoscale) {\r
-this.autoScale = autoscale;\r
-}, "~B");\r
-Clazz.defineMethod (c$, "updateBounds", \r
-function (min, max) {\r
-if (max < min) {\r
-this.base = max;\r
-this.range = min - max;\r
-this.tolow = true;\r
-} else {\r
-this.base = min;\r
-this.range = max - min;\r
-this.tolow = false;\r
-}}, "~N,~N");\r
-});\r
+Clazz.declarePackage ("jalview.schemes");
+Clazz.load (null, "jalview.schemes.GraduatedColor", ["jalview.schemes.UserColourScheme", "java.awt.Color", "java.lang.Float"], function () {
+c$ = Clazz.decorateAsClass (function () {
+this.thresholdState = -1;
+this.lr = 0;
+this.lg = 0;
+this.lb = 0;
+this.dr = 0;
+this.dg = 0;
+this.db = 0;
+this.base = 0;
+this.range = 0;
+this.thrsh = 0;
+this.tolow = false;
+this.autoScale = true;
+this.ucs = null;
+this.colourByLabel = false;
+Clazz.instantialize (this, arguments);
+}, jalview.schemes, "GraduatedColor");
+Clazz.makeConstructor (c$, 
+function (low, high, min, max) {
+this.thrsh = NaN;
+this.tolow = min >= max;
+this.lr = low.getRed () / 255;
+this.lg = low.getGreen () / 255;
+this.lb = low.getBlue () / 255;
+this.dr = (high.getRed () / 255) - this.lr;
+this.dg = (high.getGreen () / 255) - this.lg;
+this.db = (high.getBlue () / 255) - this.lb;
+if (this.tolow) {
+this.base = max;
+this.range = min - max;
+} else {
+this.base = min;
+this.range = max - min;
+}}, "java.awt.Color,java.awt.Color,~N,~N");
+Clazz.makeConstructor (c$, 
+function (oldcs) {
+this.lr = oldcs.lr;
+this.lg = oldcs.lg;
+this.lb = oldcs.lb;
+this.dr = oldcs.dr;
+this.dg = oldcs.dg;
+this.db = oldcs.db;
+this.base = oldcs.base;
+this.range = oldcs.range;
+this.tolow = oldcs.tolow;
+this.thresholdState = oldcs.thresholdState;
+this.thrsh = oldcs.thrsh;
+this.autoScale = oldcs.autoScale;
+this.colourByLabel = oldcs.colourByLabel;
+}, "jalview.schemes.GraduatedColor");
+Clazz.makeConstructor (c$, 
+function (oldcs, min, max) {
+this.construct (oldcs);
+this.updateBounds (min, max);
+}, "jalview.schemes.GraduatedColor,~N,~N");
+Clazz.defineMethod (c$, "getMinColor", 
+function () {
+return  new java.awt.Color (this.lr, this.lg, this.lb);
+});
+Clazz.defineMethod (c$, "getMaxColor", 
+function () {
+return  new java.awt.Color (this.lr + this.dr, this.lg + this.dg, this.lb + this.db);
+});
+Clazz.defineMethod (c$, "getTolow", 
+function () {
+return this.tolow;
+});
+Clazz.defineMethod (c$, "setTolow", 
+function (tolower) {
+this.tolow = tolower;
+}, "~B");
+Clazz.defineMethod (c$, "isColored", 
+function (feature) {
+var val = feature.getScore ();
+if (Float.isNaN (val)) {
+return true;
+}if (this.thresholdState == -1) {
+return true;
+}if (Float.isNaN (this.thrsh)) {
+return true;
+}var rtn = this.thresholdState == 1;
+if (val <= this.thrsh) {
+return !rtn;
+} else {
+return rtn;
+}}, "jalview.datamodel.SequenceFeature");
+Clazz.defineMethod (c$, "isColourByLabel", 
+function () {
+return this.colourByLabel;
+});
+Clazz.defineMethod (c$, "setColourByLabel", 
+function (colourByLabel) {
+this.colourByLabel = colourByLabel;
+}, "~B");
+Clazz.defineMethod (c$, "findColor", 
+function (feature) {
+if (this.colourByLabel) {
+if (this.ucs == null) {
+this.ucs =  new jalview.schemes.UserColourScheme ();
+}return this.ucs.createColourFromName (feature.getDescription ());
+}if (this.range == 0.0) {
+return this.getMaxColor ();
+}var scr = feature.getScore ();
+if (Float.isNaN (scr)) {
+return this.getMinColor ();
+}var scl = (scr - this.base) / this.range;
+if (this.tolow) {
+scl = -scl;
+}if (scl < 0) {
+scl = 0;
+}if (scl > 1) {
+scl = 1;
+}return  new java.awt.Color (this.lr + scl * this.dr, this.lg + scl * this.dg, this.lb + scl * this.db);
+}, "jalview.datamodel.SequenceFeature");
+Clazz.defineMethod (c$, "setThresh", 
+function (value) {
+this.thrsh = value;
+}, "~N");
+Clazz.defineMethod (c$, "getThresh", 
+function () {
+return this.thrsh;
+});
+Clazz.defineMethod (c$, "setThreshType", 
+function (aboveThreshold) {
+this.thresholdState = aboveThreshold;
+}, "~N");
+Clazz.defineMethod (c$, "getThreshType", 
+function () {
+return this.thresholdState;
+});
+Clazz.defineMethod (c$, "getMax", 
+function () {
+return (this.tolow) ? this.base : (this.base + this.range);
+});
+Clazz.defineMethod (c$, "getMin", 
+function () {
+return (this.tolow) ? (this.base + this.range) : this.base;
+});
+Clazz.defineMethod (c$, "isAutoScale", 
+function () {
+return this.autoScale;
+});
+Clazz.defineMethod (c$, "setAutoScaled", 
+function (autoscale) {
+this.autoScale = autoscale;
+}, "~B");
+Clazz.defineMethod (c$, "updateBounds", 
+function (min, max) {
+if (max < min) {
+this.base = max;
+this.range = min - max;
+this.tolow = true;
+} else {
+this.base = min;
+this.range = max - min;
+this.tolow = false;
+}}, "~N,~N");
+});