Merge branch 'master' of https://source.jalview.org/git/jalviewjs.git
[jalviewjs.git] / site / j2s / jalview / appletgui / FeatureColourChooser.js
index 1720be6..b985054 100644 (file)
-Clazz.declarePackage ("jalview.appletgui");\r
-Clazz.load (["awt2swing.Panel", "java.awt.event.ActionListener", "$.AdjustmentListener", "$.ItemListener", "$.MouseListener", "awt2swing.Checkbox", "$.Choice", "$.Scrollbar", "$.TextField"], "jalview.appletgui.FeatureColourChooser", ["awt2swing.Label", "jalview.appletgui.JVDialog", "$.PaintRefresher", "$.UserDefinedColours", "jalview.datamodel.GraphLine", "jalview.schemes.GraduatedColor", "jalview.util.MessageManager", "java.awt.Color", "$.Dimension", "$.FlowLayout", "$.Font", "$.GridLayout", "java.awt.event.ActionEvent", "java.lang.Float"], function () {\r
-c$ = Clazz.decorateAsClass (function () {\r
-this.frame = null;\r
-this.owner = null;\r
-this.fr = null;\r
-this.fs = null;\r
-this.cs = null;\r
-this.oldcs = null;\r
-this.oldgroupColours = null;\r
-this.adjusting = false;\r
-this.min = 0;\r
-this.max = 0;\r
-this.type = null;\r
-this.af = null;\r
-this.minColour = null;\r
-this.maxColour = null;\r
-this.jPanel1 = null;\r
-this.jPanel2 = null;\r
-this.threshold = null;\r
-this.jPanel3 = null;\r
-this.jPanel4 = null;\r
-this.slider = null;\r
-this.thresholdValue = null;\r
-this.thresholdIsMin = null;\r
-this.colourFromLabel = null;\r
-this.threshline = null;\r
-Clazz.instantialize (this, arguments);\r
-}, jalview.appletgui, "FeatureColourChooser", awt2swing.Panel, [java.awt.event.ActionListener, java.awt.event.AdjustmentListener, java.awt.event.ItemListener, java.awt.event.MouseListener]);\r
-Clazz.prepareFields (c$, function () {\r
-this.minColour =  new awt2swing.Panel ();\r
-this.maxColour =  new awt2swing.Panel ();\r
-this.jPanel1 =  new awt2swing.Panel ();\r
-this.jPanel2 =  new awt2swing.Panel ();\r
-this.threshold =  new awt2swing.Choice ();\r
-this.jPanel3 =  new awt2swing.Panel ();\r
-this.jPanel4 =  new awt2swing.Panel ();\r
-this.slider =  new awt2swing.Scrollbar (0);\r
-this.thresholdValue =  new awt2swing.TextField (20);\r
-this.thresholdIsMin =  new awt2swing.Checkbox ();\r
-this.colourFromLabel =  new awt2swing.Checkbox ();\r
-});\r
-Clazz.makeConstructor (c$, \r
-function (af, type) {\r
-Clazz.superConstructor (this, jalview.appletgui.FeatureColourChooser, []);\r
-this.af = af;\r
-this.init (af.getSeqcanvas ().getFeatureRenderer (), type);\r
-}, "jalview.appletgui.AlignFrame,~S");\r
-Clazz.makeConstructor (c$, \r
-function (fsettings, type) {\r
-Clazz.superConstructor (this, jalview.appletgui.FeatureColourChooser, []);\r
-this.fs = fsettings;\r
-this.init (fsettings.fr, type);\r
-}, "jalview.appletgui.FeatureSettings,~S");\r
-Clazz.defineMethod (c$, "init", \r
- function (frenderer, type) {\r
-this.type = type;\r
-this.fr = frenderer;\r
-var mm = (this.fr.getMinMax ().get (type))[0];\r
-this.min = mm[0];\r
-this.max = mm[1];\r
-this.oldcs = this.fr.getFeatureColours ().get (type);\r
-if (Clazz.instanceOf (this.oldcs, jalview.schemes.GraduatedColor)) {\r
-this.cs =  new jalview.schemes.GraduatedColor (this.oldcs, this.min, this.max);\r
-} else {\r
-var bl = java.awt.Color.black;\r
-if (Clazz.instanceOf (this.oldcs, java.awt.Color)) {\r
-bl = this.oldcs;\r
-}this.cs =  new jalview.schemes.GraduatedColor (java.awt.Color.white, bl, mm[0], mm[1]);\r
-}this.minColour.setBackground (this.cs.getMinColor ());\r
-this.maxColour.setBackground (this.cs.getMaxColor ());\r
-this.minColour.setForeground (this.cs.getMinColor ());\r
-this.maxColour.setForeground (this.cs.getMaxColor ());\r
-this.colourFromLabel.setState (this.cs.isColourByLabel ());\r
-this.adjusting = true;\r
-try {\r
-this.jbInit ();\r
-} catch (ex) {\r
-if (Clazz.exceptionOf (ex, Exception)) {\r
-} else {\r
-throw ex;\r
-}\r
-}\r
-this.threshold.select (new Integer (this.cs.getThreshType () == -1 ? 0 : this.cs.getThreshType () == 1 ? 1 : 2));\r
-this.adjusting = false;\r
-this.changeColour ();\r
-this.colourFromLabel.addItemListener (this);\r
-this.slider.addAdjustmentListener (this);\r
-this.slider.addMouseListener (this);\r
-this.owner = (this.af != null) ? this.af : this.fs.frame;\r
-this.frame =  new jalview.appletgui.JVDialog (this.owner, jalview.util.MessageManager.formatMessage ("label.graduated_color_for_params",  Clazz.newArray (-1, [type])), true, 480, 248);\r
-this.frame.setMainPanel (this);\r
-this.validate ();\r
-this.frame.setVisible (true);\r
-if (this.frame.accept) {\r
-this.changeColour ();\r
-} else {\r
-this.reset ();\r
-jalview.appletgui.PaintRefresher.Refresh (this, this.fr.getViewport ().getSequenceSetId ());\r
-this.frame.setVisible (false);\r
-}}, "jalview.appletgui.FeatureRenderer,~S");\r
-Clazz.makeConstructor (c$, \r
-function () {\r
-Clazz.superConstructor (this, jalview.appletgui.FeatureColourChooser, []);\r
-try {\r
-this.jbInit ();\r
-} catch (ex) {\r
-if (Clazz.exceptionOf (ex, Exception)) {\r
-ex.printStackTrace ();\r
-} else {\r
-throw ex;\r
-}\r
-}\r
-});\r
-Clazz.defineMethod (c$, "jbInit", \r
- function () {\r
-var minLabel =  new awt2swing.Label (jalview.util.MessageManager.getString ("label.min"));\r
-var maxLabel =  new awt2swing.Label (jalview.util.MessageManager.getString ("label.max"));\r
-minLabel.setFont ( new java.awt.Font ("Verdana", 0, 11));\r
-maxLabel.setFont ( new java.awt.Font ("Verdana", 0, 11));\r
-this.minColour.setBounds (0, 0, 40, 27);\r
-this.maxColour.setBounds (0, 0, 40, 27);\r
-this.minColour.addMouseListener (this);\r
-this.maxColour.setFont ( new java.awt.Font ("Verdana", 0, 11));\r
-this.maxColour.addMouseListener (this);\r
-this.thresholdIsMin.addItemListener (this);\r
-this.setLayout ( new java.awt.GridLayout (4, 1));\r
-this.jPanel1.setLayout ( new java.awt.FlowLayout ());\r
-this.jPanel2.setLayout ( new java.awt.FlowLayout ());\r
-this.jPanel3.setLayout ( new java.awt.GridLayout (1, 1));\r
-this.jPanel4.setLayout ( new java.awt.FlowLayout ());\r
-this.jPanel1.setBackground (java.awt.Color.white);\r
-this.jPanel2.setBackground (java.awt.Color.white);\r
-this.jPanel4.setBackground (java.awt.Color.white);\r
-this.threshold.addItemListener (this);\r
-this.threshold.addItem (jalview.util.MessageManager.getString ("label.threshold_feature_no_thereshold"));\r
-this.threshold.addItem (jalview.util.MessageManager.getString ("label.threshold_feature_above_thereshold"));\r
-this.threshold.addItem (jalview.util.MessageManager.getString ("label.threshold_feature_below_thereshold"));\r
-this.thresholdValue.addActionListener (this);\r
-this.slider.setBackground (java.awt.Color.white);\r
-this.slider.setEnabled (false);\r
-this.slider.setSize ( new java.awt.Dimension (93, 21));\r
-this.thresholdValue.setEnabled (false);\r
-this.thresholdValue.setSize ( new java.awt.Dimension (79, 22));\r
-this.thresholdValue.setColumns (5);\r
-this.jPanel3.setBackground (java.awt.Color.white);\r
-this.colourFromLabel.setFont ( new java.awt.Font ("Verdana", 0, 11));\r
-this.colourFromLabel.setLabel (jalview.util.MessageManager.getString ("label.colour_by_label"));\r
-this.colourFromLabel.setSize ( new java.awt.Dimension (139, 22));\r
-this.thresholdIsMin.setBackground (java.awt.Color.white);\r
-this.thresholdIsMin.setLabel (jalview.util.MessageManager.getString ("label.threshold_minmax"));\r
-this.thresholdIsMin.setSize ( new java.awt.Dimension (135, 23));\r
-this.jPanel1.add (minLabel);\r
-this.jPanel1.add (this.minColour);\r
-this.jPanel1.add (maxLabel);\r
-this.jPanel1.add (this.maxColour);\r
-this.jPanel1.add (this.colourFromLabel);\r
-this.jPanel2.add (this.threshold);\r
-this.jPanel3.add (this.slider);\r
-this.jPanel4.add (this.thresholdValue);\r
-this.jPanel4.add (this.thresholdIsMin);\r
-this.add (this.jPanel1);\r
-this.add (this.jPanel2);\r
-this.add (this.jPanel3);\r
-this.add (this.jPanel4);\r
-});\r
-Clazz.overrideMethod (c$, "actionPerformed", \r
-function (evt) {\r
-if (evt.getSource () === this.thresholdValue) {\r
-try {\r
-var f =  new Float (this.thresholdValue.getText ()).floatValue ();\r
-this.slider.setValue (Clazz.floatToInt (f * 1000));\r
-this.adjustmentValueChanged (null);\r
-} catch (ex) {\r
-if (Clazz.exceptionOf (ex, NumberFormatException)) {\r
-} else {\r
-throw ex;\r
-}\r
-}\r
-} else if (evt.getSource () === this.minColour) {\r
-this.minColour_actionPerformed (null);\r
-} else if (evt.getSource () === this.maxColour) {\r
-this.maxColour_actionPerformed (null);\r
-} else {\r
-this.changeColour ();\r
-}}, "java.awt.event.ActionEvent");\r
-Clazz.overrideMethod (c$, "itemStateChanged", \r
-function (evt) {\r
-this.maxColour.setEnabled (!this.colourFromLabel.getState ());\r
-this.minColour.setEnabled (!this.colourFromLabel.getState ());\r
-this.changeColour ();\r
-}, "java.awt.event.ItemEvent");\r
-Clazz.overrideMethod (c$, "adjustmentValueChanged", \r
-function (evt) {\r
-if (!this.adjusting) {\r
-this.thresholdValue.setText ((this.slider.getValue () / 1000) + "");\r
-this.valueChanged ();\r
-}}, "java.awt.event.AdjustmentEvent");\r
-Clazz.defineMethod (c$, "valueChanged", \r
-function () {\r
-this.threshline.value = this.slider.getValue () / 1000;\r
-this.cs.setThresh (this.threshline.value);\r
-this.changeColour ();\r
-jalview.appletgui.PaintRefresher.Refresh (this, this.fr.getViewport ().getSequenceSetId ());\r
-});\r
-Clazz.defineMethod (c$, "minColour_actionPerformed", \r
-function (newCol) {\r
-if (newCol == null) {\r
-var udc =  new jalview.appletgui.UserDefinedColours (this, this.minColour.getBackground (), this.owner, jalview.util.MessageManager.getString ("label.select_colour_minimum_value"));\r
-} else {\r
-this.minColour.setBackground (newCol);\r
-this.minColour.setForeground (newCol);\r
-this.minColour.repaint ();\r
-this.changeColour ();\r
-}}, "java.awt.Color");\r
-Clazz.defineMethod (c$, "maxColour_actionPerformed", \r
-function (newCol) {\r
-if (newCol == null) {\r
-var udc =  new jalview.appletgui.UserDefinedColours (this, this.maxColour.getBackground (), this.owner, jalview.util.MessageManager.getString ("label.select_colour_maximum_value"));\r
-} else {\r
-this.maxColour.setBackground (newCol);\r
-this.maxColour.setForeground (newCol);\r
-this.maxColour.repaint ();\r
-this.changeColour ();\r
-}}, "java.awt.Color");\r
-Clazz.defineMethod (c$, "changeColour", \r
-function () {\r
-if (this.adjusting) {\r
-return;\r
-}var aboveThreshold = -1;\r
-if (this.threshold.getSelectedIndex () == 1) {\r
-aboveThreshold = 1;\r
-} else if (this.threshold.getSelectedIndex () == 2) {\r
-aboveThreshold = 0;\r
-}this.slider.setEnabled (true);\r
-this.thresholdValue.setEnabled (true);\r
-var acg =  new jalview.schemes.GraduatedColor (this.minColour.getBackground (), this.maxColour.getBackground (), this.min, this.max);\r
-acg.setColourByLabel (this.colourFromLabel.getState ());\r
-this.maxColour.setEnabled (!this.colourFromLabel.getState ());\r
-this.minColour.setEnabled (!this.colourFromLabel.getState ());\r
-if (aboveThreshold == -1) {\r
-this.slider.setEnabled (false);\r
-this.thresholdValue.setEnabled (false);\r
-this.thresholdValue.setText ("");\r
-} else if (aboveThreshold != -1 && this.threshline == null) {\r
-this.threshline =  new jalview.datamodel.GraphLine ((this.max - this.min) / 2, "Threshold", java.awt.Color.black);\r
-}if (aboveThreshold != -1) {\r
-this.adjusting = true;\r
-acg.setThresh (this.threshline.value);\r
-var range = this.max * 1000 - this.min * 1000;\r
-this.slider.setMinimum (Clazz.floatToInt (this.min * 1000));\r
-this.slider.setMaximum (Clazz.floatToInt (this.max * 1000));\r
-this.slider.setValue (Clazz.floatToInt (this.threshline.value * 1000));\r
-this.thresholdValue.setText (this.threshline.value + "");\r
-this.slider.setEnabled (true);\r
-this.thresholdValue.setEnabled (true);\r
-this.adjusting = false;\r
-}acg.setThreshType (aboveThreshold);\r
-if (this.thresholdIsMin.getState () && aboveThreshold != -1) {\r
-if (aboveThreshold == 1) {\r
-acg =  new jalview.schemes.GraduatedColor (acg, this.threshline.value, this.max);\r
-} else {\r
-acg =  new jalview.schemes.GraduatedColor (acg, this.min, this.threshline.value);\r
-}}this.fr.setColour (this.type, acg);\r
-this.cs = acg;\r
-jalview.appletgui.PaintRefresher.Refresh (this, this.fr.getViewport ().getSequenceSetId ());\r
-});\r
-Clazz.defineMethod (c$, "reset", \r
-function () {\r
-this.fr.setColour (this.type, this.oldcs);\r
-jalview.appletgui.PaintRefresher.Refresh (this, this.fr.getViewport ().getSequenceSetId ());\r
-});\r
-Clazz.overrideMethod (c$, "mouseClicked", \r
-function (evt) {\r
-}, "java.awt.event.MouseEvent");\r
-Clazz.overrideMethod (c$, "mousePressed", \r
-function (evt) {\r
-}, "java.awt.event.MouseEvent");\r
-Clazz.overrideMethod (c$, "mouseReleased", \r
-function (evt) {\r
-if (evt.getSource () === this.minColour || evt.getSource () === this.maxColour) {\r
-this.actionPerformed ( new java.awt.event.ActionEvent (evt.getSource (), 1, "Clicked"));\r
-} else {\r
-jalview.appletgui.PaintRefresher.Refresh (this, this.fr.getViewport ().getSequenceSetId ());\r
-}}, "java.awt.event.MouseEvent");\r
-Clazz.overrideMethod (c$, "mouseEntered", \r
-function (evt) {\r
-}, "java.awt.event.MouseEvent");\r
-Clazz.overrideMethod (c$, "mouseExited", \r
-function (evt) {\r
-}, "java.awt.event.MouseEvent");\r
-});\r
+Clazz.declarePackage ("jalview.appletgui");
+Clazz.load (["awt2swing.Panel", "java.awt.event.ActionListener", "$.AdjustmentListener", "$.ItemListener", "$.MouseListener", "awt2swing.Checkbox", "$.Choice", "$.Scrollbar", "$.TextField"], "jalview.appletgui.FeatureColourChooser", ["awt2swing.Label", "jalview.appletgui.JVDialog", "$.PaintRefresher", "$.UserDefinedColours", "jalview.datamodel.GraphLine", "jalview.schemes.GraduatedColor", "jalview.util.MessageManager", "java.awt.Color", "$.Dimension", "$.FlowLayout", "$.Font", "$.GridLayout", "java.awt.event.ActionEvent", "java.lang.Float"], function () {
+c$ = Clazz.decorateAsClass (function () {
+this.frame = null;
+this.owner = null;
+this.fr = null;
+this.fs = null;
+this.cs = null;
+this.oldcs = null;
+this.oldgroupColours = null;
+this.adjusting = false;
+this.min = 0;
+this.max = 0;
+this.type = null;
+this.af = null;
+this.minColour = null;
+this.maxColour = null;
+this.jPanel1 = null;
+this.jPanel2 = null;
+this.threshold = null;
+this.jPanel3 = null;
+this.jPanel4 = null;
+this.slider = null;
+this.thresholdValue = null;
+this.thresholdIsMin = null;
+this.colourFromLabel = null;
+this.threshline = null;
+Clazz.instantialize (this, arguments);
+}, jalview.appletgui, "FeatureColourChooser", awt2swing.Panel, [java.awt.event.ActionListener, java.awt.event.AdjustmentListener, java.awt.event.ItemListener, java.awt.event.MouseListener]);
+Clazz.prepareFields (c$, function () {
+this.minColour =  new awt2swing.Panel ();
+this.maxColour =  new awt2swing.Panel ();
+this.jPanel1 =  new awt2swing.Panel ();
+this.jPanel2 =  new awt2swing.Panel ();
+this.threshold =  new awt2swing.Choice ();
+this.jPanel3 =  new awt2swing.Panel ();
+this.jPanel4 =  new awt2swing.Panel ();
+this.slider =  new awt2swing.Scrollbar (0);
+this.thresholdValue =  new awt2swing.TextField (20);
+this.thresholdIsMin =  new awt2swing.Checkbox ();
+this.colourFromLabel =  new awt2swing.Checkbox ();
+});
+Clazz.makeConstructor (c$, 
+function (af, type) {
+Clazz.superConstructor (this, jalview.appletgui.FeatureColourChooser, []);
+this.af = af;
+this.init (af.getSeqcanvas ().getFeatureRenderer (), type);
+}, "jalview.appletgui.AlignFrame,~S");
+Clazz.makeConstructor (c$, 
+function (fsettings, type) {
+Clazz.superConstructor (this, jalview.appletgui.FeatureColourChooser, []);
+this.fs = fsettings;
+this.init (fsettings.fr, type);
+}, "jalview.appletgui.FeatureSettings,~S");
+Clazz.defineMethod (c$, "init", 
+ function (frenderer, type) {
+this.type = type;
+this.fr = frenderer;
+var mm = (this.fr.getMinMax ().get (type))[0];
+this.min = mm[0];
+this.max = mm[1];
+this.oldcs = this.fr.getFeatureColours ().get (type);
+if (Clazz.instanceOf (this.oldcs, jalview.schemes.GraduatedColor)) {
+this.cs =  new jalview.schemes.GraduatedColor (this.oldcs, this.min, this.max);
+} else {
+var bl = java.awt.Color.black;
+if (Clazz.instanceOf (this.oldcs, java.awt.Color)) {
+bl = this.oldcs;
+}this.cs =  new jalview.schemes.GraduatedColor (java.awt.Color.white, bl, mm[0], mm[1]);
+}this.minColour.setBackground (this.cs.getMinColor ());
+this.maxColour.setBackground (this.cs.getMaxColor ());
+this.minColour.setForeground (this.cs.getMinColor ());
+this.maxColour.setForeground (this.cs.getMaxColor ());
+this.colourFromLabel.setState (this.cs.isColourByLabel ());
+this.adjusting = true;
+try {
+this.jbInit ();
+} catch (ex) {
+if (Clazz.exceptionOf (ex, Exception)) {
+} else {
+throw ex;
+}
+}
+this.threshold.select (new Integer (this.cs.getThreshType () == -1 ? 0 : this.cs.getThreshType () == 1 ? 1 : 2));
+this.adjusting = false;
+this.changeColour ();
+this.colourFromLabel.addItemListener (this);
+this.slider.addAdjustmentListener (this);
+this.slider.addMouseListener (this);
+this.owner = (this.af != null) ? this.af : this.fs.frame;
+this.frame =  new jalview.appletgui.JVDialog (this.owner, jalview.util.MessageManager.formatMessage ("label.graduated_color_for_params",  Clazz.newArray (-1, [type])), true, 480, 248);
+this.frame.setMainPanel (this);
+this.validate ();
+this.frame.setVisible (true);
+if (this.frame.accept) {
+this.changeColour ();
+} else {
+this.reset ();
+jalview.appletgui.PaintRefresher.Refresh (this, this.fr.getViewport ().getSequenceSetId ());
+this.frame.setVisible (false);
+}}, "jalview.appletgui.FeatureRenderer,~S");
+Clazz.makeConstructor (c$, 
+function () {
+Clazz.superConstructor (this, jalview.appletgui.FeatureColourChooser, []);
+try {
+this.jbInit ();
+} catch (ex) {
+if (Clazz.exceptionOf (ex, Exception)) {
+ex.printStackTrace ();
+} else {
+throw ex;
+}
+}
+});
+Clazz.defineMethod (c$, "jbInit", 
+ function () {
+var minLabel =  new awt2swing.Label (jalview.util.MessageManager.getString ("label.min"));
+var maxLabel =  new awt2swing.Label (jalview.util.MessageManager.getString ("label.max"));
+minLabel.setFont ( new java.awt.Font ("Verdana", 0, 11));
+maxLabel.setFont ( new java.awt.Font ("Verdana", 0, 11));
+this.minColour.setBounds (0, 0, 40, 27);
+this.maxColour.setBounds (0, 0, 40, 27);
+this.minColour.addMouseListener (this);
+this.maxColour.setFont ( new java.awt.Font ("Verdana", 0, 11));
+this.maxColour.addMouseListener (this);
+this.thresholdIsMin.addItemListener (this);
+this.setLayout ( new java.awt.GridLayout (4, 1));
+this.jPanel1.setLayout ( new java.awt.FlowLayout ());
+this.jPanel2.setLayout ( new java.awt.FlowLayout ());
+this.jPanel3.setLayout ( new java.awt.GridLayout (1, 1));
+this.jPanel4.setLayout ( new java.awt.FlowLayout ());
+this.jPanel1.setBackground (java.awt.Color.white);
+this.jPanel2.setBackground (java.awt.Color.white);
+this.jPanel4.setBackground (java.awt.Color.white);
+this.threshold.addItemListener (this);
+this.threshold.addItem (jalview.util.MessageManager.getString ("label.threshold_feature_no_thereshold"));
+this.threshold.addItem (jalview.util.MessageManager.getString ("label.threshold_feature_above_thereshold"));
+this.threshold.addItem (jalview.util.MessageManager.getString ("label.threshold_feature_below_thereshold"));
+this.thresholdValue.addActionListener (this);
+this.slider.setBackground (java.awt.Color.white);
+this.slider.setEnabled (false);
+this.slider.setSize ( new java.awt.Dimension (93, 21));
+this.thresholdValue.setEnabled (false);
+this.thresholdValue.setSize ( new java.awt.Dimension (79, 22));
+this.thresholdValue.setColumns (5);
+this.jPanel3.setBackground (java.awt.Color.white);
+this.colourFromLabel.setFont ( new java.awt.Font ("Verdana", 0, 11));
+this.colourFromLabel.setLabel (jalview.util.MessageManager.getString ("label.colour_by_label"));
+this.colourFromLabel.setSize ( new java.awt.Dimension (139, 22));
+this.thresholdIsMin.setBackground (java.awt.Color.white);
+this.thresholdIsMin.setLabel (jalview.util.MessageManager.getString ("label.threshold_minmax"));
+this.thresholdIsMin.setSize ( new java.awt.Dimension (135, 23));
+this.jPanel1.add (minLabel);
+this.jPanel1.add (this.minColour);
+this.jPanel1.add (maxLabel);
+this.jPanel1.add (this.maxColour);
+this.jPanel1.add (this.colourFromLabel);
+this.jPanel2.add (this.threshold);
+this.jPanel3.add (this.slider);
+this.jPanel4.add (this.thresholdValue);
+this.jPanel4.add (this.thresholdIsMin);
+this.add (this.jPanel1);
+this.add (this.jPanel2);
+this.add (this.jPanel3);
+this.add (this.jPanel4);
+});
+Clazz.overrideMethod (c$, "actionPerformed", 
+function (evt) {
+if (evt.getSource () === this.thresholdValue) {
+try {
+var f =  new Float (this.thresholdValue.getText ()).floatValue ();
+this.slider.setValue (Clazz.floatToInt (f * 1000));
+this.adjustmentValueChanged (null);
+} catch (ex) {
+if (Clazz.exceptionOf (ex, NumberFormatException)) {
+} else {
+throw ex;
+}
+}
+} else if (evt.getSource () === this.minColour) {
+this.minColour_actionPerformed (null);
+} else if (evt.getSource () === this.maxColour) {
+this.maxColour_actionPerformed (null);
+} else {
+this.changeColour ();
+}}, "java.awt.event.ActionEvent");
+Clazz.overrideMethod (c$, "itemStateChanged", 
+function (evt) {
+this.maxColour.setEnabled (!this.colourFromLabel.getState ());
+this.minColour.setEnabled (!this.colourFromLabel.getState ());
+this.changeColour ();
+}, "java.awt.event.ItemEvent");
+Clazz.overrideMethod (c$, "adjustmentValueChanged", 
+function (evt) {
+if (!this.adjusting) {
+this.thresholdValue.setText ((this.slider.getValue () / 1000) + "");
+this.valueChanged ();
+}}, "java.awt.event.AdjustmentEvent");
+Clazz.defineMethod (c$, "valueChanged", 
+function () {
+this.threshline.value = this.slider.getValue () / 1000;
+this.cs.setThresh (this.threshline.value);
+this.changeColour ();
+jalview.appletgui.PaintRefresher.Refresh (this, this.fr.getViewport ().getSequenceSetId ());
+});
+Clazz.defineMethod (c$, "minColour_actionPerformed", 
+function (newCol) {
+if (newCol == null) {
+var udc =  new jalview.appletgui.UserDefinedColours (this, this.minColour.getBackground (), this.owner, jalview.util.MessageManager.getString ("label.select_colour_minimum_value"));
+} else {
+this.minColour.setBackground (newCol);
+this.minColour.setForeground (newCol);
+this.minColour.repaint ();
+this.changeColour ();
+}}, "java.awt.Color");
+Clazz.defineMethod (c$, "maxColour_actionPerformed", 
+function (newCol) {
+if (newCol == null) {
+var udc =  new jalview.appletgui.UserDefinedColours (this, this.maxColour.getBackground (), this.owner, jalview.util.MessageManager.getString ("label.select_colour_maximum_value"));
+} else {
+this.maxColour.setBackground (newCol);
+this.maxColour.setForeground (newCol);
+this.maxColour.repaint ();
+this.changeColour ();
+}}, "java.awt.Color");
+Clazz.defineMethod (c$, "changeColour", 
+function () {
+if (this.adjusting) {
+return;
+}var aboveThreshold = -1;
+if (this.threshold.getSelectedIndex () == 1) {
+aboveThreshold = 1;
+} else if (this.threshold.getSelectedIndex () == 2) {
+aboveThreshold = 0;
+}this.slider.setEnabled (true);
+this.thresholdValue.setEnabled (true);
+var acg =  new jalview.schemes.GraduatedColor (this.minColour.getBackground (), this.maxColour.getBackground (), this.min, this.max);
+acg.setColourByLabel (this.colourFromLabel.getState ());
+this.maxColour.setEnabled (!this.colourFromLabel.getState ());
+this.minColour.setEnabled (!this.colourFromLabel.getState ());
+if (aboveThreshold == -1) {
+this.slider.setEnabled (false);
+this.thresholdValue.setEnabled (false);
+this.thresholdValue.setText ("");
+} else if (aboveThreshold != -1 && this.threshline == null) {
+this.threshline =  new jalview.datamodel.GraphLine ((this.max - this.min) / 2, "Threshold", java.awt.Color.black);
+}if (aboveThreshold != -1) {
+this.adjusting = true;
+acg.setThresh (this.threshline.value);
+var range = this.max * 1000 - this.min * 1000;
+this.slider.setMinimum (Clazz.floatToInt (this.min * 1000));
+this.slider.setMaximum (Clazz.floatToInt (this.max * 1000));
+this.slider.setValue (Clazz.floatToInt (this.threshline.value * 1000));
+this.thresholdValue.setText (this.threshline.value + "");
+this.slider.setEnabled (true);
+this.thresholdValue.setEnabled (true);
+this.adjusting = false;
+}acg.setThreshType (aboveThreshold);
+if (this.thresholdIsMin.getState () && aboveThreshold != -1) {
+if (aboveThreshold == 1) {
+acg =  new jalview.schemes.GraduatedColor (acg, this.threshline.value, this.max);
+} else {
+acg =  new jalview.schemes.GraduatedColor (acg, this.min, this.threshline.value);
+}}this.fr.setColour (this.type, acg);
+this.cs = acg;
+jalview.appletgui.PaintRefresher.Refresh (this, this.fr.getViewport ().getSequenceSetId ());
+});
+Clazz.defineMethod (c$, "reset", 
+function () {
+this.fr.setColour (this.type, this.oldcs);
+jalview.appletgui.PaintRefresher.Refresh (this, this.fr.getViewport ().getSequenceSetId ());
+});
+Clazz.overrideMethod (c$, "mouseClicked", 
+function (evt) {
+}, "java.awt.event.MouseEvent");
+Clazz.overrideMethod (c$, "mousePressed", 
+function (evt) {
+}, "java.awt.event.MouseEvent");
+Clazz.overrideMethod (c$, "mouseReleased", 
+function (evt) {
+if (evt.getSource () === this.minColour || evt.getSource () === this.maxColour) {
+this.actionPerformed ( new java.awt.event.ActionEvent (evt.getSource (), 1, "Clicked"));
+} else {
+jalview.appletgui.PaintRefresher.Refresh (this, this.fr.getViewport ().getSequenceSetId ());
+}}, "java.awt.event.MouseEvent");
+Clazz.overrideMethod (c$, "mouseEntered", 
+function (evt) {
+}, "java.awt.event.MouseEvent");
+Clazz.overrideMethod (c$, "mouseExited", 
+function (evt) {
+}, "java.awt.event.MouseEvent");
+});