X-Git-Url: http://source.jalview.org/gitweb/?p=jalviewjs.git;a=blobdiff_plain;f=site%2Fj2s%2Fjalview%2Fappletgui%2FFeatureColourChooser.js;h=b98505480e0428bdf2f523b51b0727d2c97436f8;hp=1720be66885cd56a600cee1ad152781dce3398c7;hb=b9b7a352eee79b7764c3b09c9d19663075061d8c;hpb=7301a2415adab88038b291fc54caeeb3a5a47a44 diff --git a/site/j2s/jalview/appletgui/FeatureColourChooser.js b/site/j2s/jalview/appletgui/FeatureColourChooser.js index 1720be6..b985054 100644 --- a/site/j2s/jalview/appletgui/FeatureColourChooser.js +++ b/site/j2s/jalview/appletgui/FeatureColourChooser.js @@ -1,292 +1,292 @@ -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"); -}); +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"); +});