JAL-1807 includes ?j2sdebug flag and DebugJS._(msg)
[jalviewjs.git] / bin / jalview / appletgui / UserDefinedColours.js
index 2cc0d9b..a1b23f6 100644 (file)
-Clazz.declarePackage ("jalview.appletgui");\r
-Clazz.load (["awt2swing.Panel", "java.awt.event.ActionListener", "$.AdjustmentListener", "$.FocusListener", "awt2swing.Button", "$.Label", "$.Scrollbar", "$.TextField", "java.awt.GridLayout", "java.util.Vector"], "jalview.appletgui.UserDefinedColours", ["awt2swing.Frame", "jalview.appletgui.AnnotationColourChooser", "$.FeatureColourChooser", "$.FeatureRenderer", "$.FeatureSettings", "jalview.bin.JalviewLite", "jalview.schemes.ResidueProperties", "$.UserColourScheme", "jalview.util.MessageManager", "java.awt.Color", "$.Dialog", "$.Font", "$.Rectangle", "java.awt.event.MouseAdapter", "java.lang.Error"], function () {\r
-c$ = Clazz.decorateAsClass (function () {\r
-this.ap = null;\r
-this.seqGroup = null;\r
-this.selectedButton = null;\r
-this.oldColours = null;\r
-this.oldColourScheme = null;\r
-this.frame = null;\r
-this.jmol = null;\r
-this.dialog = null;\r
-this.caller = null;\r
-this.originalLabel = null;\r
-this.originalColour = null;\r
-this.R = 0;\r
-this.G = 0;\r
-this.B = 0;\r
-this.buttonPanel = null;\r
-this.gridLayout = null;\r
-this.okcancelPanel = null;\r
-this.okButton = null;\r
-this.applyButton = null;\r
-this.cancelButton = null;\r
-this.rScroller = null;\r
-this.label1 = null;\r
-this.rText = null;\r
-this.label4 = null;\r
-this.gScroller = null;\r
-this.gText = null;\r
-this.label5 = null;\r
-this.bScroller = null;\r
-this.bText = null;\r
-this.target = null;\r
-Clazz.instantialize (this, arguments);\r
-}, jalview.appletgui, "UserDefinedColours", awt2swing.Panel, [java.awt.event.ActionListener, java.awt.event.AdjustmentListener, java.awt.event.FocusListener]);\r
-Clazz.prepareFields (c$, function () {\r
-this.oldColours =  new java.util.Vector ();\r
-this.buttonPanel =  new awt2swing.Panel ();\r
-this.gridLayout =  new java.awt.GridLayout ();\r
-this.okcancelPanel =  new awt2swing.Panel ();\r
-this.okButton =  new awt2swing.Button ();\r
-this.applyButton =  new awt2swing.Button ();\r
-this.cancelButton =  new awt2swing.Button ();\r
-this.rScroller =  new awt2swing.Scrollbar ();\r
-this.label1 =  new awt2swing.Label ();\r
-this.rText =  new awt2swing.TextField ();\r
-this.label4 =  new awt2swing.Label ();\r
-this.gScroller =  new awt2swing.Scrollbar ();\r
-this.gText =  new awt2swing.TextField ();\r
-this.label5 =  new awt2swing.Label ();\r
-this.bScroller =  new awt2swing.Scrollbar ();\r
-this.bText =  new awt2swing.TextField ();\r
-this.target =  new awt2swing.Panel ();\r
-});\r
-Clazz.defineMethod (c$, "loadDefaultColours", \r
-function () {\r
-return null;\r
-});\r
-Clazz.makeConstructor (c$, \r
-function (ap, sg) {\r
-Clazz.superConstructor (this, jalview.appletgui.UserDefinedColours, []);\r
-this.ap = ap;\r
-this.seqGroup = sg;\r
-if (this.seqGroup != null) {\r
-this.oldColourScheme = this.seqGroup.cs;\r
-} else {\r
-this.oldColourScheme = ap.av.getGlobalColourScheme ();\r
-}this.init ();\r
-}, "jalview.appletgui.AlignmentPanel,jalview.datamodel.SequenceGroup");\r
-Clazz.makeConstructor (c$, \r
-function (jmol) {\r
-Clazz.superConstructor (this, jalview.appletgui.UserDefinedColours, []);\r
-this.jmol = jmol;\r
-this.init ();\r
-}, "jalview.appletgui.AppletJmol");\r
-Clazz.makeConstructor (c$, \r
-function (fr, alignframe) {\r
-Clazz.superConstructor (this, jalview.appletgui.UserDefinedColours, []);\r
-this.caller = fr;\r
-this.originalColour = fr.colourPanel.getBackground ();\r
-this.originalLabel = "Feature Colour";\r
-this.setForDialog ("Select Feature Colour", alignframe);\r
-this.setTargetColour (fr.colourPanel.getBackground ());\r
-this.dialog.setVisible (true);\r
-}, "jalview.appletgui.FeatureRenderer,awt2swing.Frame");\r
-Clazz.makeConstructor (c$, \r
-function (caller, col1, alignframe) {\r
-this.construct (caller, col1, alignframe, "Select Colour");\r
-}, "java.awt.Component,java.awt.Color,awt2swing.Frame");\r
-Clazz.makeConstructor (c$, \r
-function (caller, col1, alignframe, title) {\r
-Clazz.superConstructor (this, jalview.appletgui.UserDefinedColours, []);\r
-this.caller = caller;\r
-this.originalColour = col1;\r
-this.originalLabel = title;\r
-this.setForDialog (title, alignframe);\r
-this.setTargetColour (col1);\r
-this.dialog.setVisible (true);\r
-}, "java.awt.Component,java.awt.Color,awt2swing.Frame,~S");\r
-Clazz.makeConstructor (c$, \r
-function (caller, label, colour) {\r
-this.construct (caller, label, colour, colour);\r
-}, "~O,~S,java.awt.Color");\r
-Clazz.makeConstructor (c$, \r
-function (me, type, graduatedColor) {\r
-this.construct (me, type, graduatedColor, graduatedColor.getMaxColor ());\r
-}, "jalview.appletgui.FeatureSettings,~S,jalview.schemes.GraduatedColor");\r
-Clazz.makeConstructor (c$, \r
-($fz = function (caller, label, ocolour, colour) {\r
-Clazz.superConstructor (this, jalview.appletgui.UserDefinedColours, []);\r
-this.caller = caller;\r
-this.originalColour = ocolour;\r
-this.originalLabel = label;\r
-this.init ();\r
-this.remove (this.buttonPanel);\r
-this.setTargetColour (colour);\r
-this.okcancelPanel.setBounds ( new java.awt.Rectangle (0, 113, 400, 35));\r
-this.frame.setTitle (jalview.util.MessageManager.getString ("label.user_defined_colours") + " - " + label);\r
-this.frame.setSize (420, 200);\r
-}, $fz.isPrivate = true, $fz), "~O,~S,~O,java.awt.Color");\r
-Clazz.defineMethod (c$, "setForDialog", \r
-function (title, alignframe) {\r
-this.init ();\r
-this.frame.setVisible (false);\r
-this.remove (this.buttonPanel);\r
-if (Clazz.instanceOf (alignframe, awt2swing.Frame)) {\r
-this.dialog =  new java.awt.Dialog (alignframe, title, true);\r
-} else {\r
-throw  new Error (jalview.util.MessageManager.getString ("label.error_unsupported_owwner_user_colour_scheme"));\r
-}this.dialog.add (this);\r
-this.setSize (400, 123);\r
-this.okcancelPanel.setBounds ( new java.awt.Rectangle (0, 123, 400, 35));\r
-var height = 160 + alignframe.getInsets ().top + this.getInsets ().bottom;\r
-var width = 400;\r
-this.dialog.setBounds (alignframe.getBounds ().x + Clazz.doubleToInt ((alignframe.getSize ().width - width) / 2), alignframe.getBounds ().y + Clazz.doubleToInt ((alignframe.getSize ().height - height) / 2), width, height);\r
-}, "~S,java.awt.Container");\r
-Clazz.overrideMethod (c$, "actionPerformed", \r
-function (evt) {\r
-var source = evt.getSource ();\r
-if (source === this.okButton) {\r
-this.okButton_actionPerformed ();\r
-} else if (source === this.applyButton) {\r
-this.applyButton_actionPerformed ();\r
-} else if (source === this.cancelButton) {\r
-this.cancelButton_actionPerformed ();\r
-} else if (source === this.rText) {\r
-this.rText_actionPerformed ();\r
-} else if (source === this.gText) {\r
-this.gText_actionPerformed ();\r
-} else if (source === this.bText) {\r
-this.bText_actionPerformed ();\r
-}}, "java.awt.event.ActionEvent");\r
-Clazz.overrideMethod (c$, "adjustmentValueChanged", \r
-function (evt) {\r
-if (evt.getSource () === this.rScroller) {\r
-this.rScroller_adjustmentValueChanged ();\r
-} else if (evt.getSource () === this.gScroller) {\r
-this.gScroller_adjustmentValueChanged ();\r
-} else if (evt.getSource () === this.bScroller) {\r
-this.bScroller_adjustmentValueChanged ();\r
-}}, "java.awt.event.AdjustmentEvent");\r
-Clazz.defineMethod (c$, "init", \r
-function () {\r
-try {\r
-this.jbInit ();\r
-} catch (e) {\r
-if (Clazz.exceptionOf (e, Exception)) {\r
-e.printStackTrace ();\r
-} else {\r
-throw e;\r
-}\r
-}\r
-this.frame =  new awt2swing.Frame ();\r
-this.frame.add (this);\r
-jalview.bin.JalviewLite.addFrame (this.frame, jalview.util.MessageManager.getString ("label.user_defined_colours"), 420, 345);\r
-if (this.seqGroup != null) {\r
-this.frame.setTitle (this.frame.getTitle () + " (" + this.seqGroup.getName () + ")");\r
-}for (var i = 0; i < 20; i++) {\r
-this.makeButton (jalview.schemes.ResidueProperties.aa2Triplet.get (jalview.schemes.ResidueProperties.aa[i]) + "", jalview.schemes.ResidueProperties.aa[i]);\r
-}\r
-this.makeButton ("B", "B");\r
-this.makeButton ("Z", "Z");\r
-this.makeButton ("X", "X");\r
-this.makeButton ("Gap", "'.','-',' '");\r
-this.validate ();\r
-});\r
-Clazz.defineMethod (c$, "rText_actionPerformed", \r
-function () {\r
-try {\r
-var i = Integer.parseInt (this.rText.getText ());\r
-this.rScroller.setValue (i);\r
-this.rScroller_adjustmentValueChanged ();\r
-} catch (ex) {\r
-if (Clazz.exceptionOf (ex, NumberFormatException)) {\r
-} else {\r
-throw ex;\r
-}\r
-}\r
-});\r
-Clazz.defineMethod (c$, "gText_actionPerformed", \r
-function () {\r
-try {\r
-var i = Integer.parseInt (this.gText.getText ());\r
-this.gScroller.setValue (i);\r
-this.gScroller_adjustmentValueChanged ();\r
-} catch (ex) {\r
-if (Clazz.exceptionOf (ex, NumberFormatException)) {\r
-} else {\r
-throw ex;\r
-}\r
-}\r
-});\r
-Clazz.defineMethod (c$, "bText_actionPerformed", \r
-function () {\r
-try {\r
-var i = Integer.parseInt (this.bText.getText ());\r
-this.bScroller.setValue (i);\r
-this.bScroller_adjustmentValueChanged ();\r
-} catch (ex) {\r
-if (Clazz.exceptionOf (ex, NumberFormatException)) {\r
-} else {\r
-throw ex;\r
-}\r
-}\r
-});\r
-Clazz.defineMethod (c$, "rScroller_adjustmentValueChanged", \r
-function () {\r
-this.R = this.rScroller.getValue ();\r
-this.rText.setText (this.R + "");\r
-this.colourChanged ();\r
-});\r
-Clazz.defineMethod (c$, "gScroller_adjustmentValueChanged", \r
-function () {\r
-this.G = this.gScroller.getValue ();\r
-this.gText.setText (this.G + "");\r
-this.colourChanged ();\r
-});\r
-Clazz.defineMethod (c$, "bScroller_adjustmentValueChanged", \r
-function () {\r
-this.B = this.bScroller.getValue ();\r
-this.bText.setText (this.B + "");\r
-this.colourChanged ();\r
-});\r
-Clazz.defineMethod (c$, "colourChanged", \r
-function () {\r
-var col =  new java.awt.Color (this.R, this.G, this.B);\r
-this.target.setBackground (col);\r
-this.target.repaint ();\r
-if (this.selectedButton != null) {\r
-this.selectedButton.setBackground (col);\r
-this.selectedButton.repaint ();\r
-}});\r
-Clazz.defineMethod (c$, "setTargetColour", \r
-function (col) {\r
-this.R = col.getRed ();\r
-this.G = col.getGreen ();\r
-this.B = col.getBlue ();\r
-this.rScroller.setValue (this.R);\r
-this.gScroller.setValue (this.G);\r
-this.bScroller.setValue (this.B);\r
-this.rText.setText (this.R + "");\r
-this.gText.setText (this.G + "");\r
-this.bText.setText (this.B + "");\r
-this.colourChanged ();\r
-}, "java.awt.Color");\r
-Clazz.defineMethod (c$, "colourButtonPressed", \r
-function (e) {\r
-this.selectedButton = e.getSource ();\r
-this.setTargetColour (this.selectedButton.getBackground ());\r
-}, "java.awt.event.MouseEvent");\r
-Clazz.defineMethod (c$, "makeButton", \r
-function (label, aa) {\r
-var button =  new awt2swing.Button ();\r
-var col = java.awt.Color.white;\r
-if (this.oldColourScheme != null) {\r
-try {\r
-col = this.oldColourScheme.findColour (aa.charAt (0), -1, null);\r
-} catch (ex) {\r
-if (Clazz.exceptionOf (ex, Exception)) {\r
-} else {\r
-throw ex;\r
-}\r
-}\r
-}button.setBackground (col);\r
-this.oldColours.addElement (col);\r
-button.setLabel (label);\r
-button.setForeground (col.darker ().darker ().darker ());\r
-button.setFont ( new java.awt.Font ("Verdana", 1, 10));\r
-button.addMouseListener (((Clazz.isClassDefined ("jalview.appletgui.UserDefinedColours$1") ? 0 : jalview.appletgui.UserDefinedColours.$UserDefinedColours$1$ ()), Clazz.innerTypeInstance (jalview.appletgui.UserDefinedColours$1, this, null)));\r
-this.buttonPanel.add (button, null);\r
-}, "~S,~S");\r
-Clazz.defineMethod (c$, "okButton_actionPerformed", \r
-function () {\r
-this.applyButton_actionPerformed ();\r
-if (this.dialog != null) {\r
-this.dialog.setVisible (false);\r
-}this.frame.setVisible (false);\r
-});\r
-Clazz.defineMethod (c$, "getColor", \r
-function () {\r
-return  new java.awt.Color (this.R, this.G, this.B);\r
-});\r
-Clazz.defineMethod (c$, "applyButton_actionPerformed", \r
-function () {\r
-if (this.caller != null) {\r
-if (Clazz.instanceOf (this.caller, jalview.appletgui.FeatureSettings)) {\r
-(this.caller).setUserColour (this.originalLabel, this.getColor ());\r
-} else if (Clazz.instanceOf (this.caller, jalview.appletgui.AnnotationColourChooser)) {\r
-if (this.originalLabel.equals ("Min Colour")) {\r
-(this.caller).minColour_actionPerformed (this.getColor ());\r
-} else {\r
-(this.caller).maxColour_actionPerformed (this.getColor ());\r
-}} else if (Clazz.instanceOf (this.caller, jalview.appletgui.FeatureRenderer)) {\r
-(this.caller).colourPanel.updateColor (this.getColor ());\r
-} else if (Clazz.instanceOf (this.caller, jalview.appletgui.FeatureColourChooser)) {\r
-if (this.originalLabel.indexOf ("inimum") > -1) {\r
-(this.caller).minColour_actionPerformed (this.getColor ());\r
-} else {\r
-(this.caller).maxColour_actionPerformed (this.getColor ());\r
-}}return;\r
-}var newColours =  new Array (24);\r
-for (var i = 0; i < 24; i++) {\r
-var button = this.buttonPanel.getComponent (i);\r
-newColours[i] = button.getBackground ();\r
-}\r
-var ucs =  new jalview.schemes.UserColourScheme (newColours);\r
-if (this.ap != null) {\r
-ucs.setThreshold (0, this.ap.av.isIgnoreGapsConsensus ());\r
-}if (this.ap != null) {\r
-if (this.seqGroup != null) {\r
-this.seqGroup.cs = ucs;\r
-} else {\r
-this.ap.av.setGlobalColourScheme (ucs);\r
-}this.ap.seqPanel.seqCanvas.img = null;\r
-this.ap.paintAlignment (true);\r
-} else if (this.jmol != null) {\r
-this.jmol.setJalviewColourScheme (ucs);\r
-}});\r
-Clazz.defineMethod (c$, "cancelButton_actionPerformed", \r
-function () {\r
-if (this.caller != null) {\r
-if (Clazz.instanceOf (this.caller, jalview.appletgui.FeatureSettings)) {\r
-(this.caller).setUserColour (this.originalLabel, this.originalColour);\r
-} else if (Clazz.instanceOf (this.caller, jalview.appletgui.AnnotationColourChooser)) {\r
-if (this.originalLabel.equals ("Min Colour")) {\r
-(this.caller).minColour_actionPerformed (this.originalColour);\r
-} else {\r
-(this.caller).maxColour_actionPerformed (this.originalColour);\r
-}} else if (Clazz.instanceOf (this.caller, jalview.appletgui.FeatureRenderer)) {\r
-(this.caller).colourPanel.updateColor (this.originalColour);\r
-} else if (Clazz.instanceOf (this.caller, jalview.appletgui.FeatureColourChooser)) {\r
-if (this.originalLabel.indexOf ("inimum") > -1) {\r
-(this.caller).minColour_actionPerformed (this.originalColour);\r
-} else {\r
-(this.caller).maxColour_actionPerformed (this.originalColour);\r
-}}if (this.dialog != null) {\r
-this.dialog.setVisible (false);\r
-}this.frame.setVisible (false);\r
-return;\r
-}var newColours =  new Array (24);\r
-for (var i = 0; i < 24; i++) {\r
-newColours[i] = this.oldColours.elementAt (i);\r
-this.buttonPanel.getComponent (i).setBackground (newColours[i]);\r
-}\r
-var ucs =  new jalview.schemes.UserColourScheme (newColours);\r
-if (this.ap != null) {\r
-if (this.seqGroup != null) {\r
-this.seqGroup.cs = ucs;\r
-} else {\r
-this.ap.av.setGlobalColourScheme (ucs);\r
-}this.ap.paintAlignment (true);\r
-} else if (this.jmol != null) {\r
-this.jmol.setJalviewColourScheme (ucs);\r
-}this.frame.setVisible (false);\r
-});\r
-Clazz.defineMethod (c$, "jbInit", \r
-($fz = function () {\r
-this.setLayout (null);\r
-this.buttonPanel.setLayout (this.gridLayout);\r
-this.gridLayout.setColumns (6);\r
-this.gridLayout.setRows (4);\r
-this.okButton.setFont ( new java.awt.Font ("Verdana", 0, 11));\r
-this.okButton.setLabel (jalview.util.MessageManager.getString ("action.ok"));\r
-this.okButton.addActionListener (this);\r
-this.applyButton.setFont ( new java.awt.Font ("Verdana", 0, 11));\r
-this.applyButton.setLabel (jalview.util.MessageManager.getString ("action.apply"));\r
-this.applyButton.addActionListener (this);\r
-this.cancelButton.setFont ( new java.awt.Font ("Verdana", 0, 11));\r
-this.cancelButton.setLabel (jalview.util.MessageManager.getString ("action.cancel"));\r
-this.cancelButton.addActionListener (this);\r
-this.setBackground ( new java.awt.Color (212, 208, 223));\r
-this.okcancelPanel.setBounds ( new java.awt.Rectangle (0, 265, 400, 35));\r
-this.buttonPanel.setBounds ( new java.awt.Rectangle (0, 123, 400, 142));\r
-this.rScroller.setMaximum (256);\r
-this.rScroller.setMinimum (0);\r
-this.rScroller.setOrientation (0);\r
-this.rScroller.setUnitIncrement (1);\r
-this.rScroller.setVisibleAmount (1);\r
-this.rScroller.setBounds ( new java.awt.Rectangle (36, 27, 119, 19));\r
-this.rScroller.addAdjustmentListener (this);\r
-this.label1.setAlignment (4);\r
-this.label1.setText ("R");\r
-this.label1.setBounds ( new java.awt.Rectangle (19, 30, 16, 15));\r
-this.rText.setFont ( new java.awt.Font ("Dialog", 0, 10));\r
-this.rText.setText ("0        ");\r
-this.rText.setBounds ( new java.awt.Rectangle (156, 27, 53, 19));\r
-this.rText.addActionListener (this);\r
-this.rText.addFocusListener (this);\r
-this.label4.setAlignment (4);\r
-this.label4.setText ("G");\r
-this.label4.setBounds ( new java.awt.Rectangle (15, 56, 20, 15));\r
-this.gScroller.setMaximum (256);\r
-this.gScroller.setMinimum (0);\r
-this.gScroller.setOrientation (0);\r
-this.gScroller.setUnitIncrement (1);\r
-this.gScroller.setVisibleAmount (1);\r
-this.gScroller.setBounds ( new java.awt.Rectangle (35, 52, 120, 20));\r
-this.gScroller.addAdjustmentListener (this);\r
-this.gText.setFont ( new java.awt.Font ("Dialog", 0, 10));\r
-this.gText.setText ("0        ");\r
-this.gText.setBounds ( new java.awt.Rectangle (156, 52, 53, 20));\r
-this.gText.addActionListener (this);\r
-this.gText.addFocusListener (this);\r
-this.label5.setAlignment (4);\r
-this.label5.setText ("B");\r
-this.label5.setBounds ( new java.awt.Rectangle (14, 82, 20, 15));\r
-this.bScroller.setMaximum (256);\r
-this.bScroller.setMinimum (0);\r
-this.bScroller.setOrientation (0);\r
-this.bScroller.setUnitIncrement (1);\r
-this.bScroller.setVisibleAmount (1);\r
-this.bScroller.setBounds ( new java.awt.Rectangle (35, 78, 120, 20));\r
-this.bScroller.addAdjustmentListener (this);\r
-this.bText.setFont ( new java.awt.Font ("Dialog", 0, 10));\r
-this.bText.setText ("0        ");\r
-this.bText.setBounds ( new java.awt.Rectangle (157, 78, 52, 20));\r
-this.bText.addActionListener (this);\r
-this.bText.addFocusListener (this);\r
-this.target.setBackground (java.awt.Color.black);\r
-this.target.setBounds ( new java.awt.Rectangle (229, 26, 134, 79));\r
-this.add (this.okcancelPanel, null);\r
-this.okcancelPanel.add (this.okButton, null);\r
-this.okcancelPanel.add (this.applyButton, null);\r
-this.okcancelPanel.add (this.cancelButton, null);\r
-this.add (this.rText);\r
-this.add (this.gText);\r
-this.add (this.bText);\r
-this.add (this.buttonPanel, null);\r
-this.add (this.target, null);\r
-this.add (this.gScroller);\r
-this.add (this.rScroller);\r
-this.add (this.bScroller);\r
-this.add (this.label5);\r
-this.add (this.label4);\r
-this.add (this.label1);\r
-}, $fz.isPrivate = true, $fz));\r
-Clazz.overrideMethod (c$, "focusGained", \r
-function (e) {\r
-}, "java.awt.event.FocusEvent");\r
-Clazz.overrideMethod (c$, "focusLost", \r
-function (e) {\r
-var c = e.getComponent ();\r
-if (c === this.rText) {\r
-this.rText_actionPerformed ();\r
-} else {\r
-if (c === this.gText) {\r
-this.gText_actionPerformed ();\r
-} else {\r
-if (c === this.bText) {\r
-this.bText_actionPerformed ();\r
-}}}}, "java.awt.event.FocusEvent");\r
-c$.$UserDefinedColours$1$ = function () {\r
-Clazz.pu$h ();\r
-c$ = Clazz.declareAnonymous (jalview.appletgui, "UserDefinedColours$1", java.awt.event.MouseAdapter);\r
-Clazz.overrideMethod (c$, "mousePressed", \r
-function (e) {\r
-this.b$["jalview.appletgui.UserDefinedColours"].colourButtonPressed (e);\r
-}, "java.awt.event.MouseEvent");\r
-c$ = Clazz.p0p ();\r
-};\r
-});\r
+Clazz.declarePackage ("jalview.appletgui");
+Clazz.load (["awt2swing.Panel", "java.awt.event.ActionListener", "$.AdjustmentListener", "$.FocusListener", "awt2swing.Button", "$.Label", "$.Scrollbar", "$.TextField", "java.awt.GridLayout", "java.util.Vector"], "jalview.appletgui.UserDefinedColours", ["awt2swing.Frame", "jalview.appletgui.AnnotationColourChooser", "$.FeatureColourChooser", "$.FeatureRenderer", "$.FeatureSettings", "jalview.bin.JalviewLite", "jalview.schemes.ResidueProperties", "$.UserColourScheme", "jalview.util.MessageManager", "java.awt.Color", "$.Dialog", "$.Font", "$.Rectangle", "java.awt.event.MouseAdapter", "java.lang.Error"], function () {
+c$ = Clazz.decorateAsClass (function () {
+this.ap = null;
+this.seqGroup = null;
+this.selectedButton = null;
+this.oldColours = null;
+this.oldColourScheme = null;
+this.frame = null;
+this.jmol = null;
+this.dialog = null;
+this.caller = null;
+this.originalLabel = null;
+this.originalColour = null;
+this.R = 0;
+this.G = 0;
+this.B = 0;
+this.buttonPanel = null;
+this.gridLayout = null;
+this.okcancelPanel = null;
+this.okButton = null;
+this.applyButton = null;
+this.cancelButton = null;
+this.rScroller = null;
+this.label1 = null;
+this.rText = null;
+this.label4 = null;
+this.gScroller = null;
+this.gText = null;
+this.label5 = null;
+this.bScroller = null;
+this.bText = null;
+this.target = null;
+Clazz.instantialize (this, arguments);
+}, jalview.appletgui, "UserDefinedColours", awt2swing.Panel, [java.awt.event.ActionListener, java.awt.event.AdjustmentListener, java.awt.event.FocusListener]);
+Clazz.prepareFields (c$, function () {
+this.oldColours =  new java.util.Vector ();
+this.buttonPanel =  new awt2swing.Panel ();
+this.gridLayout =  new java.awt.GridLayout ();
+this.okcancelPanel =  new awt2swing.Panel ();
+this.okButton =  new awt2swing.Button ();
+this.applyButton =  new awt2swing.Button ();
+this.cancelButton =  new awt2swing.Button ();
+this.rScroller =  new awt2swing.Scrollbar ();
+this.label1 =  new awt2swing.Label ();
+this.rText =  new awt2swing.TextField ();
+this.label4 =  new awt2swing.Label ();
+this.gScroller =  new awt2swing.Scrollbar ();
+this.gText =  new awt2swing.TextField ();
+this.label5 =  new awt2swing.Label ();
+this.bScroller =  new awt2swing.Scrollbar ();
+this.bText =  new awt2swing.TextField ();
+this.target =  new awt2swing.Panel ();
+});
+Clazz.defineMethod (c$, "loadDefaultColours", 
+function () {
+return null;
+});
+Clazz.makeConstructor (c$, 
+function (ap, sg) {
+Clazz.superConstructor (this, jalview.appletgui.UserDefinedColours, []);
+this.ap = ap;
+this.seqGroup = sg;
+if (this.seqGroup != null) {
+this.oldColourScheme = this.seqGroup.cs;
+} else {
+this.oldColourScheme = ap.av.getGlobalColourScheme ();
+}this.init ();
+}, "jalview.appletgui.AlignmentPanel,jalview.datamodel.SequenceGroup");
+Clazz.makeConstructor (c$, 
+function (jmol) {
+Clazz.superConstructor (this, jalview.appletgui.UserDefinedColours, []);
+this.jmol = jmol;
+this.init ();
+}, "jalview.appletgui.AppletJmol");
+Clazz.makeConstructor (c$, 
+function (fr, alignframe) {
+Clazz.superConstructor (this, jalview.appletgui.UserDefinedColours, []);
+this.caller = fr;
+this.originalColour = fr.colourPanel.getBackground ();
+this.originalLabel = "Feature Colour";
+this.setForDialog ("Select Feature Colour", alignframe);
+this.setTargetColour (fr.colourPanel.getBackground ());
+this.dialog.setVisible (true);
+}, "jalview.appletgui.FeatureRenderer,awt2swing.Frame");
+Clazz.makeConstructor (c$, 
+function (caller, col1, alignframe) {
+this.construct (caller, col1, alignframe, "Select Colour");
+}, "java.awt.Component,java.awt.Color,awt2swing.Frame");
+Clazz.makeConstructor (c$, 
+function (caller, col1, alignframe, title) {
+Clazz.superConstructor (this, jalview.appletgui.UserDefinedColours, []);
+this.caller = caller;
+this.originalColour = col1;
+this.originalLabel = title;
+this.setForDialog (title, alignframe);
+this.setTargetColour (col1);
+this.dialog.setVisible (true);
+}, "java.awt.Component,java.awt.Color,awt2swing.Frame,~S");
+Clazz.makeConstructor (c$, 
+function (caller, label, colour) {
+this.construct (caller, label, colour, colour);
+}, "~O,~S,java.awt.Color");
+Clazz.makeConstructor (c$, 
+function (me, type, graduatedColor) {
+this.construct (me, type, graduatedColor, graduatedColor.getMaxColor ());
+}, "jalview.appletgui.FeatureSettings,~S,jalview.schemes.GraduatedColor");
+Clazz.makeConstructor (c$, 
+($fz = function (caller, label, ocolour, colour) {
+Clazz.superConstructor (this, jalview.appletgui.UserDefinedColours, []);
+this.caller = caller;
+this.originalColour = ocolour;
+this.originalLabel = label;
+this.init ();
+this.remove (this.buttonPanel);
+this.setTargetColour (colour);
+this.okcancelPanel.setBounds ( new java.awt.Rectangle (0, 113, 400, 35));
+this.frame.setTitle (jalview.util.MessageManager.getString ("label.user_defined_colours") + " - " + label);
+this.frame.setSize (420, 200);
+}, $fz.isPrivate = true, $fz), "~O,~S,~O,java.awt.Color");
+Clazz.defineMethod (c$, "setForDialog", 
+function (title, alignframe) {
+this.init ();
+this.frame.setVisible (false);
+this.remove (this.buttonPanel);
+if (Clazz.instanceOf (alignframe, awt2swing.Frame)) {
+this.dialog =  new java.awt.Dialog (alignframe, title, true);
+} else {
+throw  new Error (jalview.util.MessageManager.getString ("label.error_unsupported_owwner_user_colour_scheme"));
+}this.dialog.add (this);
+this.setSize (400, 123);
+this.okcancelPanel.setBounds ( new java.awt.Rectangle (0, 123, 400, 35));
+var height = 160 + alignframe.getInsets ().top + this.getInsets ().bottom;
+var width = 400;
+this.dialog.setBounds (alignframe.getBounds ().x + Clazz.doubleToInt ((alignframe.getSize ().width - width) / 2), alignframe.getBounds ().y + Clazz.doubleToInt ((alignframe.getSize ().height - height) / 2), width, height);
+}, "~S,java.awt.Container");
+Clazz.overrideMethod (c$, "actionPerformed", 
+function (evt) {
+var source = evt.getSource ();
+if (source === this.okButton) {
+this.okButton_actionPerformed ();
+} else if (source === this.applyButton) {
+this.applyButton_actionPerformed ();
+} else if (source === this.cancelButton) {
+this.cancelButton_actionPerformed ();
+} else if (source === this.rText) {
+this.rText_actionPerformed ();
+} else if (source === this.gText) {
+this.gText_actionPerformed ();
+} else if (source === this.bText) {
+this.bText_actionPerformed ();
+}}, "java.awt.event.ActionEvent");
+Clazz.overrideMethod (c$, "adjustmentValueChanged", 
+function (evt) {
+if (evt.getSource () === this.rScroller) {
+this.rScroller_adjustmentValueChanged ();
+} else if (evt.getSource () === this.gScroller) {
+this.gScroller_adjustmentValueChanged ();
+} else if (evt.getSource () === this.bScroller) {
+this.bScroller_adjustmentValueChanged ();
+}}, "java.awt.event.AdjustmentEvent");
+Clazz.defineMethod (c$, "init", 
+function () {
+try {
+this.jbInit ();
+} catch (e) {
+if (Clazz.exceptionOf (e, Exception)) {
+e.printStackTrace ();
+} else {
+throw e;
+}
+}
+this.frame =  new awt2swing.Frame ();
+this.frame.add (this);
+jalview.bin.JalviewLite.addFrame (this.frame, jalview.util.MessageManager.getString ("label.user_defined_colours"), 420, 345);
+if (this.seqGroup != null) {
+this.frame.setTitle (this.frame.getTitle () + " (" + this.seqGroup.getName () + ")");
+}for (var i = 0; i < 20; i++) {
+this.makeButton (jalview.schemes.ResidueProperties.aa2Triplet.get (jalview.schemes.ResidueProperties.aa[i]) + "", jalview.schemes.ResidueProperties.aa[i]);
+}
+this.makeButton ("B", "B");
+this.makeButton ("Z", "Z");
+this.makeButton ("X", "X");
+this.makeButton ("Gap", "'.','-',' '");
+this.validate ();
+});
+Clazz.defineMethod (c$, "rText_actionPerformed", 
+function () {
+try {
+var i = Integer.parseInt (this.rText.getText ());
+this.rScroller.setValue (i);
+this.rScroller_adjustmentValueChanged ();
+} catch (ex) {
+if (Clazz.exceptionOf (ex, NumberFormatException)) {
+} else {
+throw ex;
+}
+}
+});
+Clazz.defineMethod (c$, "gText_actionPerformed", 
+function () {
+try {
+var i = Integer.parseInt (this.gText.getText ());
+this.gScroller.setValue (i);
+this.gScroller_adjustmentValueChanged ();
+} catch (ex) {
+if (Clazz.exceptionOf (ex, NumberFormatException)) {
+} else {
+throw ex;
+}
+}
+});
+Clazz.defineMethod (c$, "bText_actionPerformed", 
+function () {
+try {
+var i = Integer.parseInt (this.bText.getText ());
+this.bScroller.setValue (i);
+this.bScroller_adjustmentValueChanged ();
+} catch (ex) {
+if (Clazz.exceptionOf (ex, NumberFormatException)) {
+} else {
+throw ex;
+}
+}
+});
+Clazz.defineMethod (c$, "rScroller_adjustmentValueChanged", 
+function () {
+this.R = this.rScroller.getValue ();
+this.rText.setText (this.R + "");
+this.colourChanged ();
+});
+Clazz.defineMethod (c$, "gScroller_adjustmentValueChanged", 
+function () {
+this.G = this.gScroller.getValue ();
+this.gText.setText (this.G + "");
+this.colourChanged ();
+});
+Clazz.defineMethod (c$, "bScroller_adjustmentValueChanged", 
+function () {
+this.B = this.bScroller.getValue ();
+this.bText.setText (this.B + "");
+this.colourChanged ();
+});
+Clazz.defineMethod (c$, "colourChanged", 
+function () {
+var col =  new java.awt.Color (this.R, this.G, this.B);
+this.target.setBackground (col);
+this.target.repaint ();
+if (this.selectedButton != null) {
+this.selectedButton.setBackground (col);
+this.selectedButton.repaint ();
+}});
+Clazz.defineMethod (c$, "setTargetColour", 
+function (col) {
+this.R = col.getRed ();
+this.G = col.getGreen ();
+this.B = col.getBlue ();
+this.rScroller.setValue (this.R);
+this.gScroller.setValue (this.G);
+this.bScroller.setValue (this.B);
+this.rText.setText (this.R + "");
+this.gText.setText (this.G + "");
+this.bText.setText (this.B + "");
+this.colourChanged ();
+}, "java.awt.Color");
+Clazz.defineMethod (c$, "colourButtonPressed", 
+function (e) {
+this.selectedButton = e.getSource ();
+this.setTargetColour (this.selectedButton.getBackground ());
+}, "java.awt.event.MouseEvent");
+Clazz.defineMethod (c$, "makeButton", 
+function (label, aa) {
+var button =  new awt2swing.Button ();
+var col = java.awt.Color.white;
+if (this.oldColourScheme != null) {
+try {
+col = this.oldColourScheme.findColour (aa.charAt (0), -1, null);
+} catch (ex) {
+if (Clazz.exceptionOf (ex, Exception)) {
+} else {
+throw ex;
+}
+}
+}button.setBackground (col);
+this.oldColours.addElement (col);
+button.setLabel (label);
+button.setForeground (col.darker ().darker ().darker ());
+button.setFont ( new java.awt.Font ("Verdana", 1, 10));
+button.addMouseListener (((Clazz.isClassDefined ("jalview.appletgui.UserDefinedColours$1") ? 0 : jalview.appletgui.UserDefinedColours.$UserDefinedColours$1$ ()), Clazz.innerTypeInstance (jalview.appletgui.UserDefinedColours$1, this, null)));
+this.buttonPanel.add (button, null);
+}, "~S,~S");
+Clazz.defineMethod (c$, "okButton_actionPerformed", 
+function () {
+this.applyButton_actionPerformed ();
+if (this.dialog != null) {
+this.dialog.setVisible (false);
+}this.frame.setVisible (false);
+});
+Clazz.defineMethod (c$, "getColor", 
+function () {
+return  new java.awt.Color (this.R, this.G, this.B);
+});
+Clazz.defineMethod (c$, "applyButton_actionPerformed", 
+function () {
+if (this.caller != null) {
+if (Clazz.instanceOf (this.caller, jalview.appletgui.FeatureSettings)) {
+(this.caller).setUserColour (this.originalLabel, this.getColor ());
+} else if (Clazz.instanceOf (this.caller, jalview.appletgui.AnnotationColourChooser)) {
+if (this.originalLabel.equals ("Min Colour")) {
+(this.caller).minColour_actionPerformed (this.getColor ());
+} else {
+(this.caller).maxColour_actionPerformed (this.getColor ());
+}} else if (Clazz.instanceOf (this.caller, jalview.appletgui.FeatureRenderer)) {
+(this.caller).colourPanel.updateColor (this.getColor ());
+} else if (Clazz.instanceOf (this.caller, jalview.appletgui.FeatureColourChooser)) {
+if (this.originalLabel.indexOf ("inimum") > -1) {
+(this.caller).minColour_actionPerformed (this.getColor ());
+} else {
+(this.caller).maxColour_actionPerformed (this.getColor ());
+}}return;
+}var newColours =  new Array (24);
+for (var i = 0; i < 24; i++) {
+var button = this.buttonPanel.getComponent (i);
+newColours[i] = button.getBackground ();
+}
+var ucs =  new jalview.schemes.UserColourScheme (newColours);
+if (this.ap != null) {
+ucs.setThreshold (0, this.ap.av.isIgnoreGapsConsensus ());
+}if (this.ap != null) {
+if (this.seqGroup != null) {
+this.seqGroup.cs = ucs;
+} else {
+this.ap.av.setGlobalColourScheme (ucs);
+}this.ap.seqPanel.seqCanvas.img = null;
+this.ap.paintAlignment (true);
+} else if (this.jmol != null) {
+this.jmol.setJalviewColourScheme (ucs);
+}});
+Clazz.defineMethod (c$, "cancelButton_actionPerformed", 
+function () {
+if (this.caller != null) {
+if (Clazz.instanceOf (this.caller, jalview.appletgui.FeatureSettings)) {
+(this.caller).setUserColour (this.originalLabel, this.originalColour);
+} else if (Clazz.instanceOf (this.caller, jalview.appletgui.AnnotationColourChooser)) {
+if (this.originalLabel.equals ("Min Colour")) {
+(this.caller).minColour_actionPerformed (this.originalColour);
+} else {
+(this.caller).maxColour_actionPerformed (this.originalColour);
+}} else if (Clazz.instanceOf (this.caller, jalview.appletgui.FeatureRenderer)) {
+(this.caller).colourPanel.updateColor (this.originalColour);
+} else if (Clazz.instanceOf (this.caller, jalview.appletgui.FeatureColourChooser)) {
+if (this.originalLabel.indexOf ("inimum") > -1) {
+(this.caller).minColour_actionPerformed (this.originalColour);
+} else {
+(this.caller).maxColour_actionPerformed (this.originalColour);
+}}if (this.dialog != null) {
+this.dialog.setVisible (false);
+}this.frame.setVisible (false);
+return;
+}var newColours =  new Array (24);
+for (var i = 0; i < 24; i++) {
+newColours[i] = this.oldColours.elementAt (i);
+this.buttonPanel.getComponent (i).setBackground (newColours[i]);
+}
+var ucs =  new jalview.schemes.UserColourScheme (newColours);
+if (this.ap != null) {
+if (this.seqGroup != null) {
+this.seqGroup.cs = ucs;
+} else {
+this.ap.av.setGlobalColourScheme (ucs);
+}this.ap.paintAlignment (true);
+} else if (this.jmol != null) {
+this.jmol.setJalviewColourScheme (ucs);
+}this.frame.setVisible (false);
+});
+Clazz.defineMethod (c$, "jbInit", 
+($fz = function () {
+this.setLayout (null);
+this.buttonPanel.setLayout (this.gridLayout);
+this.gridLayout.setColumns (6);
+this.gridLayout.setRows (4);
+this.okButton.setFont ( new java.awt.Font ("Verdana", 0, 11));
+this.okButton.setLabel (jalview.util.MessageManager.getString ("action.ok"));
+this.okButton.addActionListener (this);
+this.applyButton.setFont ( new java.awt.Font ("Verdana", 0, 11));
+this.applyButton.setLabel (jalview.util.MessageManager.getString ("action.apply"));
+this.applyButton.addActionListener (this);
+this.cancelButton.setFont ( new java.awt.Font ("Verdana", 0, 11));
+this.cancelButton.setLabel (jalview.util.MessageManager.getString ("action.cancel"));
+this.cancelButton.addActionListener (this);
+this.setBackground ( new java.awt.Color (212, 208, 223));
+this.okcancelPanel.setBounds ( new java.awt.Rectangle (0, 265, 400, 35));
+this.buttonPanel.setBounds ( new java.awt.Rectangle (0, 123, 400, 142));
+this.rScroller.setMaximum (256);
+this.rScroller.setMinimum (0);
+this.rScroller.setOrientation (0);
+this.rScroller.setUnitIncrement (1);
+this.rScroller.setVisibleAmount (1);
+this.rScroller.setBounds ( new java.awt.Rectangle (36, 27, 119, 19));
+this.rScroller.addAdjustmentListener (this);
+this.label1.setAlignment (4);
+this.label1.setText ("R");
+this.label1.setBounds ( new java.awt.Rectangle (19, 30, 16, 15));
+this.rText.setFont ( new java.awt.Font ("Dialog", 0, 10));
+this.rText.setText ("0        ");
+this.rText.setBounds ( new java.awt.Rectangle (156, 27, 53, 19));
+this.rText.addActionListener (this);
+this.rText.addFocusListener (this);
+this.label4.setAlignment (4);
+this.label4.setText ("G");
+this.label4.setBounds ( new java.awt.Rectangle (15, 56, 20, 15));
+this.gScroller.setMaximum (256);
+this.gScroller.setMinimum (0);
+this.gScroller.setOrientation (0);
+this.gScroller.setUnitIncrement (1);
+this.gScroller.setVisibleAmount (1);
+this.gScroller.setBounds ( new java.awt.Rectangle (35, 52, 120, 20));
+this.gScroller.addAdjustmentListener (this);
+this.gText.setFont ( new java.awt.Font ("Dialog", 0, 10));
+this.gText.setText ("0        ");
+this.gText.setBounds ( new java.awt.Rectangle (156, 52, 53, 20));
+this.gText.addActionListener (this);
+this.gText.addFocusListener (this);
+this.label5.setAlignment (4);
+this.label5.setText ("B");
+this.label5.setBounds ( new java.awt.Rectangle (14, 82, 20, 15));
+this.bScroller.setMaximum (256);
+this.bScroller.setMinimum (0);
+this.bScroller.setOrientation (0);
+this.bScroller.setUnitIncrement (1);
+this.bScroller.setVisibleAmount (1);
+this.bScroller.setBounds ( new java.awt.Rectangle (35, 78, 120, 20));
+this.bScroller.addAdjustmentListener (this);
+this.bText.setFont ( new java.awt.Font ("Dialog", 0, 10));
+this.bText.setText ("0        ");
+this.bText.setBounds ( new java.awt.Rectangle (157, 78, 52, 20));
+this.bText.addActionListener (this);
+this.bText.addFocusListener (this);
+this.target.setBackground (java.awt.Color.black);
+this.target.setBounds ( new java.awt.Rectangle (229, 26, 134, 79));
+this.add (this.okcancelPanel, null);
+this.okcancelPanel.add (this.okButton, null);
+this.okcancelPanel.add (this.applyButton, null);
+this.okcancelPanel.add (this.cancelButton, null);
+this.add (this.rText);
+this.add (this.gText);
+this.add (this.bText);
+this.add (this.buttonPanel, null);
+this.add (this.target, null);
+this.add (this.gScroller);
+this.add (this.rScroller);
+this.add (this.bScroller);
+this.add (this.label5);
+this.add (this.label4);
+this.add (this.label1);
+}, $fz.isPrivate = true, $fz));
+Clazz.overrideMethod (c$, "focusGained", 
+function (e) {
+}, "java.awt.event.FocusEvent");
+Clazz.overrideMethod (c$, "focusLost", 
+function (e) {
+var c = e.getComponent ();
+if (c === this.rText) {
+this.rText_actionPerformed ();
+} else {
+if (c === this.gText) {
+this.gText_actionPerformed ();
+} else {
+if (c === this.bText) {
+this.bText_actionPerformed ();
+}}}}, "java.awt.event.FocusEvent");
+c$.$UserDefinedColours$1$ = function () {
+Clazz.pu$h ();
+c$ = Clazz.declareAnonymous (jalview.appletgui, "UserDefinedColours$1", java.awt.event.MouseAdapter);
+Clazz.overrideMethod (c$, "mousePressed", 
+function (e) {
+this.b$["jalview.appletgui.UserDefinedColours"].colourButtonPressed (e);
+}, "java.awt.event.MouseEvent");
+c$ = Clazz.p0p ();
+};
+});