X-Git-Url: http://source.jalview.org/gitweb/?p=jalviewjs.git;a=blobdiff_plain;f=bin%2Fjalview%2Fschemes%2FCovariationColourScheme.js;h=68c8f1575169c66b26f62474153992b7e3463073;hp=3d75e42f4f5e177a26fe870a304070bf086a1744;hb=8ffd05b3abe52c0b6b79b011c0966361f82d5fe6;hpb=6154cb57a6eac3bb1344b8342495f5bb701ee921 diff --git a/bin/jalview/schemes/CovariationColourScheme.js b/bin/jalview/schemes/CovariationColourScheme.js index 3d75e42..68c8f15 100644 --- a/bin/jalview/schemes/CovariationColourScheme.js +++ b/bin/jalview/schemes/CovariationColourScheme.js @@ -1,41 +1,41 @@ -Clazz.declarePackage ("jalview.schemes"); -Clazz.load (["jalview.schemes.ResidueColourScheme", "java.util.Hashtable"], "jalview.schemes.CovariationColourScheme", ["jalview.schemes.ResidueProperties", "jalview.util.ColorUtils", "java.awt.Color"], function () { -c$ = Clazz.decorateAsClass (function () { -this.helixcolorhash = null; -this.positionsToHelix = null; -this.numHelix = 0; -this.annotation = null; -Clazz.instantialize (this, arguments); -}, jalview.schemes, "CovariationColourScheme", jalview.schemes.ResidueColourScheme); -Clazz.prepareFields (c$, function () { -this.helixcolorhash = new java.util.Hashtable (); -this.positionsToHelix = new java.util.Hashtable (); -}); -Clazz.makeConstructor (c$, -function (annotation) { -Clazz.superConstructor (this, jalview.schemes.CovariationColourScheme, []); -this.annotation = annotation; -for (var x = 0; x < this.annotation._rnasecstr.length; x++) { -this.positionsToHelix.put (new Integer (this.annotation._rnasecstr[x].getBegin ()), this.annotation._rnasecstr[x].getFeatureGroup ()); -this.positionsToHelix.put (new Integer (this.annotation._rnasecstr[x].getEnd ()), this.annotation._rnasecstr[x].getFeatureGroup ()); -if (Integer.parseInt (this.annotation._rnasecstr[x].getFeatureGroup ()) > this.numHelix) { -this.numHelix = Integer.parseInt (this.annotation._rnasecstr[x].getFeatureGroup ()); -}} -for (var j = 0; j <= this.numHelix; j++) { -this.helixcolorhash.put (Integer.toString (j), jalview.util.ColorUtils.generateRandomColor (java.awt.Color.white)); -} -}, "jalview.datamodel.AlignmentAnnotation"); -Clazz.defineMethod (c$, "findColour", -function (c) { -return jalview.schemes.ResidueProperties.purinepyrimidine[jalview.schemes.ResidueProperties.purinepyrimidineIndex[c.charCodeAt (0)]]; -}, "~S"); -Clazz.defineMethod (c$, "findColour", -function (c, j) { -var currentColour = java.awt.Color.white; -var currentHelix = null; -currentHelix = this.positionsToHelix.get (new Integer (j)); -if (currentHelix != null) { -currentColour = this.helixcolorhash.get (currentHelix); -}return currentColour; -}, "~S,~N"); -}); +Clazz.declarePackage ("jalview.schemes"); +Clazz.load (["jalview.schemes.ResidueColourScheme", "java.util.Hashtable"], "jalview.schemes.CovariationColourScheme", ["jalview.schemes.ResidueProperties", "jalview.util.ColorUtils", "java.awt.Color"], function () { +c$ = Clazz.decorateAsClass (function () { +this.helixcolorhash = null; +this.positionsToHelix = null; +this.numHelix = 0; +this.annotation = null; +Clazz.instantialize (this, arguments); +}, jalview.schemes, "CovariationColourScheme", jalview.schemes.ResidueColourScheme); +Clazz.prepareFields (c$, function () { +this.helixcolorhash = new java.util.Hashtable (); +this.positionsToHelix = new java.util.Hashtable (); +}); +Clazz.makeConstructor (c$, +function (annotation) { +Clazz.superConstructor (this, jalview.schemes.CovariationColourScheme, []); +this.annotation = annotation; +for (var x = 0; x < this.annotation._rnasecstr.length; x++) { +this.positionsToHelix.put (new Integer (this.annotation._rnasecstr[x].getBegin ()), this.annotation._rnasecstr[x].getFeatureGroup ()); +this.positionsToHelix.put (new Integer (this.annotation._rnasecstr[x].getEnd ()), this.annotation._rnasecstr[x].getFeatureGroup ()); +if (Integer.parseInt (this.annotation._rnasecstr[x].getFeatureGroup ()) > this.numHelix) { +this.numHelix = Integer.parseInt (this.annotation._rnasecstr[x].getFeatureGroup ()); +}} +for (var j = 0; j <= this.numHelix; j++) { +this.helixcolorhash.put (Integer.toString (j), jalview.util.ColorUtils.generateRandomColor (java.awt.Color.white)); +} +}, "jalview.datamodel.AlignmentAnnotation"); +Clazz.defineMethod (c$, "findColour", +function (c) { +return jalview.schemes.ResidueProperties.purinepyrimidine[jalview.schemes.ResidueProperties.purinepyrimidineIndex[c.charCodeAt (0)]]; +}, "~S"); +Clazz.defineMethod (c$, "findColour", +function (c, j) { +var currentColour = java.awt.Color.white; +var currentHelix = null; +currentHelix = this.positionsToHelix.get (new Integer (j)); +if (currentHelix != null) { +currentColour = this.helixcolorhash.get (currentHelix); +}return currentColour; +}, "~S,~N"); +});