JAL-1807 Bob
[jalviewjs.git] / site / j2s / core / corejalview.js
diff --git a/site/j2s/core/corejalview.js b/site/j2s/core/corejalview.js
new file mode 100644 (file)
index 0000000..89feb54
--- /dev/null
@@ -0,0 +1,72014 @@
+(function(Clazz
+,Clazz_getClassName
+,Clazz_newLongArray
+,Clazz_doubleToByte
+,Clazz_doubleToInt
+,Clazz_doubleToLong
+,Clazz_declarePackage
+,Clazz_instanceOf
+,Clazz_load
+,Clazz_instantialize
+,Clazz_decorateAsClass
+,Clazz_floatToInt
+,Clazz_floatToLong
+,Clazz_makeConstructor
+,Clazz_defineEnumConstant
+,Clazz_exceptionOf
+,Clazz_newIntArray
+,Clazz_defineStatics
+,Clazz_newFloatArray
+,Clazz_declareType
+,Clazz_prepareFields
+,Clazz_superConstructor
+,Clazz_newByteArray
+,Clazz_declareInterface
+,Clazz_p0p
+,Clazz_pu$h
+,Clazz_newShortArray
+,Clazz_innerTypeInstance
+,Clazz_isClassDefined
+,Clazz_prepareCallback
+,Clazz_newArray
+,Clazz_castNullAs
+,Clazz_floatToShort
+,Clazz_superCall
+,Clazz_decorateAsType
+,Clazz_newBooleanArray
+,Clazz_newCharArray
+,Clazz_implementOf
+,Clazz_newDoubleArray
+,Clazz_overrideConstructor
+,Clazz_clone
+,Clazz_doubleToShort
+,Clazz_getInheritedLevel
+,Clazz_getParamsType
+,Clazz_isAF
+,Clazz_isAI
+,Clazz_isAS
+,Clazz_isASS
+,Clazz_isAP
+,Clazz_isAFloat
+,Clazz_isAII
+,Clazz_isAFF
+,Clazz_isAFFF
+,Clazz_tryToSearchAndExecute
+,Clazz_getStackTrace
+,Clazz_inheritArgs
+,Clazz_alert
+,Clazz_defineMethod
+,Clazz_overrideMethod
+,Clazz_declareAnonymous
+,Clazz_checkPrivateMethod
+,Clazz_cloneFinals
+){
+var $t$;
+//var c$;
+Clazz_load (["java.io.Reader"], "java.io.InputStreamReader", ["java.lang.NullPointerException"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.$in = null;
+this.isOpen = true;
+this.charsetName = null;
+this.isUTF8 = false;
+this.bytearr = null;
+this.pos = 0;
+Clazz_instantialize (this, arguments);
+}, java.io, "InputStreamReader", java.io.Reader);
+Clazz_makeConstructor (c$, 
+function ($in) {
+//just sets lock Clazz_superConstructor (this, java.io.InputStreamReader, [$in]);
+this.$in = $in;
+var charsetName = (arguments.length > 1 ? arguments[1] : "UTF-8");
+
+this.charsetName = charsetName;
+if (!(this.isUTF8 = "UTF-8".equals (charsetName)) && !"ISO-8859-1".equals (charsetName)) throw  new NullPointerException ("charsetName");
+}, "java.io.InputStream");
+Clazz_defineMethod (c$, "getEncoding", 
+function () {
+return this.charsetName;
+});
+Clazz_overrideMethod (c$, "read", 
+function (cbuf, offset, length) {
+if (this.bytearr == null || this.bytearr.length < length) this.bytearr =  Clazz_newByteArray (length, 0);
+var c;
+var char2;
+var char3;
+var byteCount = 0;
+var charCount = offset;
+var byteLen = this.$in.read (this.bytearr, this.pos, length - this.pos);
+var nAvail = this.$in.available ();
+if (byteLen < 0) return -1;
+var nMax = byteLen;
+while (byteCount < nMax) {
+c = this.bytearr[byteCount] & 0xff;
+if (this.isUTF8) switch (c >> 4) {
+case 0xC:
+case 0xD:
+if (byteCount + 1 >= byteLen) {
+if (nAvail >= 1) {
+nMax = byteCount;
+continue;
+}} else if (((char2 = this.bytearr[byteCount + 1]) & 0xC0) == 0x80) {
+cbuf[charCount++] = String.fromCharCode (((c & 0x1F) << 6) | (char2 & 0x3F));
+byteCount += 2;
+continue;
+}this.isUTF8 = false;
+break;
+case 0xE:
+if (byteCount + 2 >= byteLen) {
+if (nAvail >= 2) {
+nMax = byteCount;
+continue;
+}} else if (((char2 = this.bytearr[byteCount + 1]) & 0xC0) == 0x80 && ((char3 = this.bytearr[byteCount + 2]) & 0xC0) == 0x80) {
+cbuf[charCount++] = String.fromCharCode (((c & 0x0F) << 12) | ((char2 & 0x3F) << 6) | (char3 & 0x3F));
+byteCount += 3;
+continue;
+}this.isUTF8 = false;
+break;
+}
+byteCount++;
+cbuf[charCount++] = String.fromCharCode (c);
+}
+this.pos = byteLen - byteCount;
+for (var i = 0; i < this.pos; i++) {
+this.bytearr[i] = this.bytearr[byteCount++];
+}
+return charCount - offset;
+}, "~A,~N,~N");
+Clazz_overrideMethod (c$, "ready", 
+function () {
+return this.isOpen;
+});
+Clazz_overrideMethod (c$, "close", 
+function () {
+this.$in.close ();
+this.isOpen = false;
+});
+});
+Clazz_declarePackage ("javax.swing.text");
+Clazz_load (["java.awt.event.FocusListener", "$.MouseListener", "javax.swing.ActionMap", "$.InputMap", "$.JComponent", "$.Scrollable", "javax.swing.event.CaretEvent", "$.ChangeListener", "javax.swing.text.Keymap", "javax.swing.DropMode"], "javax.swing.text.JTextComponent", ["java.io.IOException", "java.lang.Boolean", "$.Character", "$.IllegalArgumentException", "java.util.HashMap", "$.Hashtable", "$.Vector", "java.awt.Point", "javax.swing.Action", "$.JViewport", "$.UIManager", "javax.swing.event.CaretListener", "javax.swing.text.DefaultEditorKit", "$.JSMinimalAbstractDocument", "jssun.awt.AppContext", "swingjs.JSToolkit"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.model = null;
+this.caret = null;
+this.navigationFilter = null;
+this.highlighter = null;
+this.keymap = null;
+this.caretEvent = null;
+this.caretColor = null;
+this.selectionColor = null;
+this.selectedTextColor = null;
+this.disabledTextColor = null;
+this.editable = false;
+this.margin = null;
+this.focusAccelerator = '\0';
+this.dragEnabled = false;
+this.dropMode = null;
+this.composedTextAttribute = null;
+this.composedTextContent = null;
+this.composedTextStart = null;
+this.composedTextEnd = null;
+Clazz_instantialize (this, arguments);
+}, javax.swing.text, "JTextComponent", javax.swing.JComponent, javax.swing.Scrollable);
+Clazz_prepareFields (c$, function () {
+this.dropMode = javax.swing.DropMode.USE_SELECTION;
+});
+Clazz_makeConstructor (c$, 
+function () {
+Clazz_superConstructor (this, javax.swing.text.JTextComponent);
+this.enableEvents (2056);
+this.caretEvent =  new javax.swing.text.JTextComponent.MutableCaretEvent (this);
+this.addMouseListener (this.caretEvent);
+this.addFocusListener (this.caretEvent);
+this.setEditable (true);
+this.setDragEnabled (false);
+this.setLayout (null);
+this.updateUI ();
+});
+Clazz_overrideMethod (c$, "getUI", 
+function () {
+return this.ui;
+});
+Clazz_overrideMethod (c$, "updateUI", 
+function () {
+this.setUI (javax.swing.UIManager.getUI (this));
+this.invalidate ();
+});
+Clazz_defineMethod (c$, "addCaretListener", 
+function (listener) {
+this.listenerList.add (javax.swing.event.CaretListener, listener);
+}, "javax.swing.event.CaretListener");
+Clazz_defineMethod (c$, "removeCaretListener", 
+function (listener) {
+this.listenerList.remove (javax.swing.event.CaretListener, listener);
+}, "javax.swing.event.CaretListener");
+Clazz_defineMethod (c$, "getCaretListeners", 
+function () {
+return this.listenerList.getListeners (javax.swing.event.CaretListener);
+});
+Clazz_defineMethod (c$, "fireCaretUpdate", 
+function (e) {
+var listeners = this.listenerList.getListenerList ();
+for (var i = listeners.length - 2; i >= 0; i -= 2) {
+if (listeners[i] === javax.swing.event.CaretListener) {
+(listeners[i + 1]).caretUpdate (e);
+}}
+}, "javax.swing.event.CaretEvent");
+Clazz_defineMethod (c$, "setDocument", 
+function (doc) {
+var old = this.model;
+try {
+this.model = doc;
+this.firePropertyChangeObject ("document", old, doc);
+} finally {
+}
+this.revalidate ();
+this.repaint ();
+}, "javax.swing.text.Document");
+Clazz_defineMethod (c$, "getDocument", 
+function () {
+return this.model;
+});
+Clazz_defineMethod (c$, "getActions", 
+function () {
+if (this.getUI () == null) return null;
+return this.getUI ().getEditorKit (this).getActions ();
+});
+Clazz_defineMethod (c$, "setMargin", 
+function (m) {
+var old = this.margin;
+this.margin = m;
+this.firePropertyChangeObject ("margin", old, m);
+this.invalidate ();
+}, "java.awt.Insets");
+Clazz_defineMethod (c$, "getMargin", 
+function () {
+return this.margin;
+});
+Clazz_defineMethod (c$, "setNavigationFilter", 
+function (filter) {
+this.navigationFilter = filter;
+}, "javax.swing.text.NavigationFilter");
+Clazz_defineMethod (c$, "getNavigationFilter", 
+function () {
+return this.navigationFilter;
+});
+Clazz_defineMethod (c$, "getCaret", 
+function () {
+return this.caret;
+});
+Clazz_defineMethod (c$, "setCaret", 
+function (c) {
+if (this.caret != null) {
+this.caret.removeChangeListener (this.caretEvent);
+this.caret.deinstall (this);
+}var old = this.caret;
+this.caret = c;
+if (this.caret != null) {
+this.caret.install (this);
+this.caret.addChangeListener (this.caretEvent);
+}this.firePropertyChangeObject ("caret", old, this.caret);
+}, "javax.swing.text.Caret");
+Clazz_defineMethod (c$, "getHighlighter", 
+function () {
+return this.highlighter;
+});
+Clazz_defineMethod (c$, "setHighlighter", 
+function (h) {
+if (this.highlighter != null) {
+this.highlighter.deinstall (this);
+}var old = this.highlighter;
+this.highlighter = h;
+if (this.highlighter != null) {
+this.highlighter.install (this);
+}this.firePropertyChangeObject ("highlighter", old, h);
+}, "javax.swing.text.Highlighter");
+Clazz_defineMethod (c$, "setKeymap", 
+function (map) {
+var old = this.keymap;
+this.keymap = map;
+this.firePropertyChangeObject ("keymap", old, this.keymap);
+this.updateInputMap (old, map);
+}, "javax.swing.text.Keymap");
+Clazz_defineMethod (c$, "setDragEnabled", 
+function (b) {
+this.dragEnabled = b;
+}, "~B");
+Clazz_defineMethod (c$, "getDragEnabled", 
+function () {
+return this.dragEnabled;
+});
+Clazz_defineMethod (c$, "setDropMode", 
+function (dropMode) {
+if (dropMode != null) {
+switch (dropMode) {
+case javax.swing.DropMode.USE_SELECTION:
+case javax.swing.DropMode.INSERT:
+this.dropMode = dropMode;
+return;
+}
+}throw  new IllegalArgumentException (dropMode + ": Unsupported drop mode for text");
+}, "javax.swing.DropMode");
+Clazz_defineMethod (c$, "getDropMode", 
+function () {
+return this.dropMode;
+});
+Clazz_defineMethod (c$, "updateInputMap", 
+function (oldKm, newKm) {
+var km = this.getInputMap (0);
+var last = km;
+while (km != null && !(Clazz_instanceOf (km, javax.swing.text.JTextComponent.KeymapWrapper))) {
+last = km;
+km = km.getParent ();
+}
+if (km != null) {
+if (newKm == null) {
+if (last !== km) {
+last.setParent (km.getParent ());
+} else {
+last.setParent (null);
+}} else {
+var newKM =  new javax.swing.text.JTextComponent.KeymapWrapper (newKm);
+last.setParent (newKM);
+if (last !== km) {
+newKM.setParent (km.getParent ());
+}}} else if (newKm != null) {
+km = this.getInputMap (0);
+if (km != null) {
+var newKM =  new javax.swing.text.JTextComponent.KeymapWrapper (newKm);
+newKM.setParent (km.getParent ());
+km.setParent (newKM);
+}}var am = this.getActionMap ();
+var lastAM = am;
+while (am != null && !(Clazz_instanceOf (am, javax.swing.text.JTextComponent.KeymapActionMap))) {
+lastAM = am;
+am = am.getParent ();
+}
+if (am != null) {
+if (newKm == null) {
+if (lastAM !== am) {
+lastAM.setParent (am.getParent ());
+} else {
+lastAM.setParent (null);
+}} else {
+var newAM =  new javax.swing.text.JTextComponent.KeymapActionMap (newKm);
+lastAM.setParent (newAM);
+if (lastAM !== am) {
+newAM.setParent (am.getParent ());
+}}} else if (newKm != null) {
+am = this.getActionMap ();
+if (am != null) {
+var newAM =  new javax.swing.text.JTextComponent.KeymapActionMap (newKm);
+newAM.setParent (am.getParent ());
+am.setParent (newAM);
+}}}, "javax.swing.text.Keymap,javax.swing.text.Keymap");
+Clazz_defineMethod (c$, "getKeymap", 
+function () {
+return this.keymap;
+});
+c$.addKeymap = Clazz_defineMethod (c$, "addKeymap", 
+function (nm, parent) {
+var map =  new javax.swing.text.JTextComponent.DefaultKeymap (nm, parent);
+if (nm != null) {
+javax.swing.text.JTextComponent.getKeymapTable ().put (nm, map);
+}return map;
+}, "~S,javax.swing.text.Keymap");
+c$.removeKeymap = Clazz_defineMethod (c$, "removeKeymap", 
+function (nm) {
+return javax.swing.text.JTextComponent.getKeymapTable ().remove (nm);
+}, "~S");
+c$.getKeymap = Clazz_defineMethod (c$, "getKeymap", 
+function (nm) {
+return javax.swing.text.JTextComponent.getKeymapTable ().get (nm);
+}, "~S");
+c$.getKeymapTable = Clazz_defineMethod (c$, "getKeymapTable", 
+ function () {
+{
+var appContext = jssun.awt.AppContext.getAppContext ();
+var keymapTable = appContext.get (javax.swing.text.JTextComponent.KEYMAP_TABLE);
+if (keymapTable == null) {
+keymapTable =  new java.util.HashMap (17);
+appContext.put (javax.swing.text.JTextComponent.KEYMAP_TABLE, keymapTable);
+var binding = javax.swing.text.JTextComponent.addKeymap ("default", null);
+binding.setDefaultAction ( new javax.swing.text.DefaultEditorKit.DefaultKeyTypedAction ());
+}return keymapTable;
+}});
+c$.loadKeymap = Clazz_defineMethod (c$, "loadKeymap", 
+function (map, bindings, actions) {
+var h =  new java.util.Hashtable ();
+for (var i = 0; i < actions.length; i++) {
+var a = actions[i];
+var value = a.getValue ("Name");
+h.put ((value != null ? value : ""), a);
+}
+for (var i = 0; i < bindings.length; i++) {
+var a = h.get (bindings[i].actionName);
+if (a != null) {
+map.addActionForKeyStroke (bindings[i].key, a);
+}}
+}, "javax.swing.text.Keymap,~A,~A");
+Clazz_defineMethod (c$, "getCaretColor", 
+function () {
+return this.caretColor;
+});
+Clazz_defineMethod (c$, "setCaretColor", 
+function (c) {
+var old = this.caretColor;
+this.caretColor = c;
+this.firePropertyChangeObject ("caretColor", old, this.caretColor);
+}, "java.awt.Color");
+Clazz_defineMethod (c$, "getSelectionColor", 
+function () {
+return this.selectionColor;
+});
+Clazz_defineMethod (c$, "setSelectionColor", 
+function (c) {
+var old = this.selectionColor;
+this.selectionColor = c;
+this.firePropertyChangeObject ("selectionColor", old, this.selectionColor);
+}, "java.awt.Color");
+Clazz_defineMethod (c$, "getSelectedTextColor", 
+function () {
+return this.selectedTextColor;
+});
+Clazz_defineMethod (c$, "setSelectedTextColor", 
+function (c) {
+var old = this.selectedTextColor;
+this.selectedTextColor = c;
+this.firePropertyChangeObject ("selectedTextColor", old, this.selectedTextColor);
+}, "java.awt.Color");
+Clazz_defineMethod (c$, "getDisabledTextColor", 
+function () {
+return this.disabledTextColor;
+});
+Clazz_defineMethod (c$, "setDisabledTextColor", 
+function (c) {
+var old = this.disabledTextColor;
+this.disabledTextColor = c;
+this.firePropertyChangeObject ("disabledTextColor", old, this.disabledTextColor);
+}, "java.awt.Color");
+Clazz_defineMethod (c$, "replaceSelection", 
+function (content) {
+var doc = this.getDocument ();
+if (doc != null) {
+try {
+var composedTextSaved = this.saveComposedText (this.caret.getDot ());
+var p0 = Math.min (this.caret.getDot (), this.caret.getMark ());
+var p1 = Math.max (this.caret.getDot (), this.caret.getMark ());
+if (Clazz_instanceOf (doc, javax.swing.text.JSMinimalAbstractDocument)) {
+(doc).replace (p0, p1 - p0, content, null);
+} else {
+if (p0 != p1) {
+doc.remove (p0, p1 - p0);
+}if (content != null && content.length > 0) {
+doc.insertString (p0, content, null);
+}}if (composedTextSaved) {
+this.restoreComposedText ();
+}} catch (e) {
+if (Clazz_exceptionOf (e, javax.swing.text.BadLocationException)) {
+swingjs.JSToolkit.alert ("SWINGJS BAD LOCATION EXCEPTION (replace):" + e.getMessage () + swingjs.JSToolkit.getStackTrace (-10));
+} else {
+throw e;
+}
+}
+}}, "~S");
+Clazz_defineMethod (c$, "getText", 
+function (offs, len) {
+return this.getDocument ().getText (offs, len);
+}, "~N,~N");
+Clazz_defineMethod (c$, "modelToView", 
+function (pos) {
+return this.getUI ().modelToView (this, pos);
+}, "~N");
+Clazz_defineMethod (c$, "viewToModel", 
+function (pt) {
+return this.getUI ().viewToModel (this, pt);
+}, "java.awt.Point");
+Clazz_defineMethod (c$, "cut", 
+function () {
+});
+Clazz_defineMethod (c$, "copy", 
+function () {
+});
+Clazz_defineMethod (c$, "paste", 
+function () {
+});
+Clazz_defineMethod (c$, "moveCaretPosition", 
+function (pos) {
+var doc = this.getDocument ();
+if (doc != null) {
+if (pos > doc.getLength () || pos < 0) {
+throw  new IllegalArgumentException ("bad position: " + pos);
+}this.caret.moveDot (pos);
+}}, "~N");
+Clazz_defineMethod (c$, "setFocusAccelerator", 
+function (aKey) {
+aKey = Character.toUpperCase (aKey);
+var old = this.focusAccelerator;
+this.focusAccelerator = aKey;
+this.firePropertyChange ("focusAcceleratorKey", old, this.focusAccelerator);
+this.firePropertyChange ("focusAccelerator", old, this.focusAccelerator);
+}, "~S");
+Clazz_defineMethod (c$, "getFocusAccelerator", 
+function () {
+return this.focusAccelerator;
+});
+Clazz_defineMethod (c$, "read", 
+function ($in, desc) {
+var kit = this.getUI ().getEditorKit (this);
+var doc = kit.createDefaultDocument ();
+if (desc != null) {
+doc.putProperty ("stream", desc);
+}try {
+kit.read ($in, doc, 0);
+this.setDocument (doc);
+} catch (e) {
+if (Clazz_exceptionOf (e, javax.swing.text.BadLocationException)) {
+throw  new java.io.IOException (e.getMessage ());
+} else {
+throw e;
+}
+}
+}, "java.io.Reader,~O");
+Clazz_defineMethod (c$, "write", 
+function (out) {
+var doc = this.getDocument ();
+try {
+this.getUI ().getEditorKit (this).write (out, doc, 0, doc.getLength ());
+} catch (e) {
+if (Clazz_exceptionOf (e, javax.swing.text.BadLocationException)) {
+throw  new java.io.IOException (e.getMessage ());
+} else {
+throw e;
+}
+}
+}, "java.io.Writer");
+Clazz_defineMethod (c$, "removeNotify", 
+function () {
+Clazz_superCall (this, javax.swing.text.JTextComponent, "removeNotify", []);
+if (javax.swing.text.JTextComponent.getFocusedComponent () === this) {
+jssun.awt.AppContext.getAppContext ().remove (javax.swing.text.JTextComponent.FOCUSED_COMPONENT);
+}});
+Clazz_defineMethod (c$, "setCaretPosition", 
+function (position) {
+var doc = this.getDocument ();
+if (doc != null) {
+if (position > doc.getLength () || position < 0) {
+throw  new IllegalArgumentException ("bad position: " + position);
+}this.caret.setDot (position);
+}}, "~N");
+Clazz_defineMethod (c$, "getCaretPosition", 
+function () {
+return this.caret.getDot ();
+});
+Clazz_defineMethod (c$, "setText", 
+function (t) {
+try {
+var doc = this.getDocument ();
+if (Clazz_instanceOf (doc, javax.swing.text.JSMinimalAbstractDocument)) {
+(doc).replace (0, doc.getLength (), t, null);
+} else {
+doc.remove (0, doc.getLength ());
+doc.insertString (0, t, null);
+}} catch (e) {
+if (Clazz_exceptionOf (e, javax.swing.text.BadLocationException)) {
+swingjs.JSToolkit.alert ("SWINGJS BAD LOCATION EXCEPTION (setText):" + e.getMessage () + swingjs.JSToolkit.getStackTrace (-10));
+} else {
+throw e;
+}
+}
+}, "~S");
+Clazz_defineMethod (c$, "getText", 
+function () {
+var doc = this.getDocument ();
+var txt;
+try {
+txt = doc.getText (0, doc.getLength ());
+} catch (e) {
+if (Clazz_exceptionOf (e, javax.swing.text.BadLocationException)) {
+txt = null;
+} else {
+throw e;
+}
+}
+return txt;
+});
+Clazz_defineMethod (c$, "getSelectedText", 
+function () {
+var txt = null;
+var p0 = Math.min (this.caret.getDot (), this.caret.getMark ());
+var p1 = Math.max (this.caret.getDot (), this.caret.getMark ());
+if (p0 != p1) {
+try {
+var doc = this.getDocument ();
+txt = doc.getText (p0, p1 - p0);
+} catch (e) {
+if (Clazz_exceptionOf (e, javax.swing.text.BadLocationException)) {
+throw  new IllegalArgumentException (e.getMessage ());
+} else {
+throw e;
+}
+}
+}return txt;
+});
+Clazz_defineMethod (c$, "isEditable", 
+function () {
+return this.editable;
+});
+Clazz_defineMethod (c$, "setEditable", 
+function (b) {
+if (b != this.editable) {
+var oldVal = this.editable;
+this.editable = b;
+this.firePropertyChangeObject ("editable", Boolean.$valueOf (oldVal), Boolean.$valueOf (this.editable));
+this.repaint ();
+}}, "~B");
+Clazz_defineMethod (c$, "getSelectionStart", 
+function () {
+var start = Math.min (this.caret.getDot (), this.caret.getMark ());
+return start;
+});
+Clazz_defineMethod (c$, "setSelectionStart", 
+function (selectionStart) {
+this.select (selectionStart, this.getSelectionEnd ());
+}, "~N");
+Clazz_defineMethod (c$, "getSelectionEnd", 
+function () {
+var end = Math.max (this.caret.getDot (), this.caret.getMark ());
+return end;
+});
+Clazz_defineMethod (c$, "setSelectionEnd", 
+function (selectionEnd) {
+this.select (this.getSelectionStart (), selectionEnd);
+}, "~N");
+Clazz_defineMethod (c$, "select", 
+function (selectionStart, selectionEnd) {
+var docLength = this.getDocument ().getLength ();
+if (selectionStart < 0) {
+selectionStart = 0;
+}if (selectionStart > docLength) {
+selectionStart = docLength;
+}if (selectionEnd > docLength) {
+selectionEnd = docLength;
+}if (selectionEnd < selectionStart) {
+selectionEnd = selectionStart;
+}this.setCaretPosition (selectionStart);
+this.moveCaretPosition (selectionEnd);
+}, "~N,~N");
+Clazz_defineMethod (c$, "selectAll", 
+function () {
+var doc = this.getDocument ();
+if (doc != null) {
+this.setCaretPosition (0);
+this.moveCaretPosition (doc.getLength ());
+}});
+Clazz_defineMethod (c$, "getToolTipText", 
+function (event) {
+var retValue = Clazz_superCall (this, javax.swing.text.JTextComponent, "getToolTipText", [event]);
+if (retValue == null) {
+var ui = this.getUI ();
+if (ui != null) {
+retValue = ui.getToolTipText (this,  new java.awt.Point (event.getX (), event.getY ()));
+}}return retValue;
+}, "java.awt.event.MouseEvent");
+Clazz_overrideMethod (c$, "getPreferredScrollableViewportSize", 
+function () {
+return this.getPreferredSize ();
+});
+Clazz_overrideMethod (c$, "getScrollableUnitIncrement", 
+function (visibleRect, orientation, direction) {
+switch (orientation) {
+case 1:
+return Clazz_doubleToInt (visibleRect.height / 10);
+case 0:
+return Clazz_doubleToInt (visibleRect.width / 10);
+default:
+throw  new IllegalArgumentException ("Invalid orientation: " + orientation);
+}
+}, "java.awt.Rectangle,~N,~N");
+Clazz_overrideMethod (c$, "getScrollableBlockIncrement", 
+function (visibleRect, orientation, direction) {
+switch (orientation) {
+case 1:
+return visibleRect.height;
+case 0:
+return visibleRect.width;
+default:
+throw  new IllegalArgumentException ("Invalid orientation: " + orientation);
+}
+}, "java.awt.Rectangle,~N,~N");
+Clazz_overrideMethod (c$, "getScrollableTracksViewportWidth", 
+function () {
+if (Clazz_instanceOf (this.getParent (), javax.swing.JViewport)) {
+return ((this.getParent ()).getWidth () > this.getPreferredSize ().width);
+}return false;
+});
+Clazz_overrideMethod (c$, "getScrollableTracksViewportHeight", 
+function () {
+if (Clazz_instanceOf (this.getParent (), javax.swing.JViewport)) {
+return ((this.getParent ()).getHeight () > this.getPreferredSize ().height);
+}return false;
+});
+Clazz_defineMethod (c$, "paramString", 
+function () {
+var editableString = (this.editable ? "true" : "false");
+var caretColorString = (this.caretColor != null ? this.caretColor.toString () : "");
+var selectionColorString = (this.selectionColor != null ? this.selectionColor.toString () : "");
+var selectedTextColorString = (this.selectedTextColor != null ? this.selectedTextColor.toString () : "");
+var disabledTextColorString = (this.disabledTextColor != null ? this.disabledTextColor.toString () : "");
+var marginString = (this.margin != null ? this.margin.toString () : "");
+return Clazz_superCall (this, javax.swing.text.JTextComponent, "paramString", []) + ",caretColor=" + caretColorString + ",disabledTextColor=" + disabledTextColorString + ",editable=" + editableString + ",margin=" + marginString + ",selectedTextColor=" + selectedTextColorString + ",selectionColor=" + selectionColorString;
+});
+c$.getFocusedComponent = Clazz_defineMethod (c$, "getFocusedComponent", 
+function () {
+return jssun.awt.AppContext.getAppContext ().get (javax.swing.text.JTextComponent.FOCUSED_COMPONENT);
+});
+Clazz_defineMethod (c$, "addInputMethodListener", 
+function (l) {
+Clazz_superCall (this, javax.swing.text.JTextComponent, "addInputMethodListener", [l]);
+if (l != null) {
+}}, "java.awt.event.InputMethodListener");
+Clazz_defineMethod (c$, "saveComposedText", 
+ function (pos) {
+if (this.composedTextExists ()) {
+var start = this.composedTextStart.getOffset ();
+var len = this.composedTextEnd.getOffset () - this.composedTextStart.getOffset ();
+if (pos >= start && pos <= start + len) {
+try {
+this.getDocument ().remove (start, len);
+return true;
+} catch (ble) {
+if (Clazz_exceptionOf (ble, javax.swing.text.BadLocationException)) {
+} else {
+throw ble;
+}
+}
+}}return false;
+}, "~N");
+Clazz_defineMethod (c$, "restoreComposedText", 
+ function () {
+var doc = this.getDocument ();
+try {
+doc.insertString (this.caret.getDot (), this.composedTextContent, this.composedTextAttribute);
+this.composedTextStart = doc.createPosition (this.caret.getDot () - this.composedTextContent.length);
+this.composedTextEnd = doc.createPosition (this.caret.getDot ());
+} catch (ble) {
+if (Clazz_exceptionOf (ble, javax.swing.text.BadLocationException)) {
+} else {
+throw ble;
+}
+}
+});
+Clazz_defineMethod (c$, "composedTextExists", 
+function () {
+return (this.composedTextStart != null);
+});
+Clazz_pu$h(self.c$);
+c$ = Clazz_decorateAsClass (function () {
+this.key = null;
+this.actionName = null;
+Clazz_instantialize (this, arguments);
+}, javax.swing.text.JTextComponent, "KeyBinding");
+Clazz_makeConstructor (c$, 
+function (a, b) {
+this.key = a;
+this.actionName = b;
+}, "javax.swing.KeyStroke,~S");
+c$ = Clazz_p0p ();
+Clazz_pu$h(self.c$);
+c$ = Clazz_decorateAsClass (function () {
+this.nm = null;
+this.parent = null;
+this.bindings = null;
+this.defaultAction = null;
+Clazz_instantialize (this, arguments);
+}, javax.swing.text.JTextComponent, "DefaultKeymap", null, javax.swing.text.Keymap);
+Clazz_makeConstructor (c$, 
+function (a, b) {
+this.nm = a;
+this.parent = b;
+this.bindings =  new java.util.Hashtable ();
+}, "~S,javax.swing.text.Keymap");
+Clazz_defineMethod (c$, "getDefaultAction", 
+function () {
+if (this.defaultAction != null) {
+return this.defaultAction;
+}return (this.parent != null) ? this.parent.getDefaultAction () : null;
+});
+Clazz_overrideMethod (c$, "setDefaultAction", 
+function (a) {
+this.defaultAction = a;
+}, "javax.swing.Action");
+Clazz_overrideMethod (c$, "getName", 
+function () {
+return this.nm;
+});
+Clazz_defineMethod (c$, "getAction", 
+function (a) {
+var b = this.bindings.get (a);
+if ((b == null) && (this.parent != null)) {
+b = this.parent.getAction (a);
+}return b;
+}, "javax.swing.KeyStroke");
+Clazz_overrideMethod (c$, "getBoundKeyStrokes", 
+function () {
+var a =  new Array (this.bindings.size ());
+var b = 0;
+for (var c = this.bindings.keys (); c.hasMoreElements (); ) {
+a[b++] = c.nextElement ();
+}
+return a;
+});
+Clazz_overrideMethod (c$, "getBoundActions", 
+function () {
+var a =  new Array (this.bindings.size ());
+var b = 0;
+for (var c = this.bindings.elements (); c.hasMoreElements (); ) {
+a[b++] = c.nextElement ();
+}
+return a;
+});
+Clazz_defineMethod (c$, "getKeyStrokesForAction", 
+function (a) {
+if (a == null) {
+return null;
+}var b = null;
+var c = null;
+for (var d = this.bindings.keys (); d.hasMoreElements (); ) {
+var e = d.nextElement ();
+if (this.bindings.get (e) === a) {
+if (c == null) {
+c =  new java.util.Vector ();
+}c.addElement (e);
+}}
+if (this.parent != null) {
+var e = this.parent.getKeyStrokesForAction (a);
+if (e != null) {
+var f = 0;
+for (var g = e.length - 1; g >= 0; g--) {
+if (this.isLocallyDefined (e[g])) {
+e[g] = null;
+f++;
+}}
+if (f > 0 && f < e.length) {
+if (c == null) {
+c =  new java.util.Vector ();
+}for (var h = e.length - 1; h >= 0; h--) {
+if (e[h] != null) {
+c.addElement (e[h]);
+}}
+} else if (f == 0) {
+if (c == null) {
+b = e;
+} else {
+b =  new Array (c.size () + e.length);
+c.copyInto (b);
+System.arraycopy (e, 0, b, c.size (), e.length);
+c = null;
+}}}}if (c != null) {
+b =  new Array (c.size ());
+c.copyInto (b);
+}return b;
+}, "javax.swing.Action");
+Clazz_overrideMethod (c$, "isLocallyDefined", 
+function (a) {
+return this.bindings.containsKey (a);
+}, "javax.swing.KeyStroke");
+Clazz_overrideMethod (c$, "addActionForKeyStroke", 
+function (a, b) {
+this.bindings.put (a, b);
+}, "javax.swing.KeyStroke,javax.swing.Action");
+Clazz_overrideMethod (c$, "removeKeyStrokeBinding", 
+function (a) {
+this.bindings.remove (a);
+}, "javax.swing.KeyStroke");
+Clazz_overrideMethod (c$, "removeBindings", 
+function () {
+this.bindings.clear ();
+});
+Clazz_overrideMethod (c$, "getResolveParent", 
+function () {
+return this.parent;
+});
+Clazz_overrideMethod (c$, "setResolveParent", 
+function (a) {
+this.parent = a;
+}, "javax.swing.text.Keymap");
+Clazz_overrideMethod (c$, "toString", 
+function () {
+return "Keymap[" + this.nm + "]" + this.bindings;
+});
+c$ = Clazz_p0p ();
+Clazz_pu$h(self.c$);
+c$ = Clazz_decorateAsClass (function () {
+this.keymap = null;
+Clazz_instantialize (this, arguments);
+}, javax.swing.text.JTextComponent, "KeymapWrapper", javax.swing.InputMap);
+Clazz_makeConstructor (c$, 
+function (a) {
+Clazz_superConstructor (this, javax.swing.text.JTextComponent.KeymapWrapper, []);
+this.keymap = a;
+}, "javax.swing.text.Keymap");
+Clazz_defineMethod (c$, "keys", 
+function () {
+var a = Clazz_superCall (this, javax.swing.text.JTextComponent.KeymapWrapper, "keys", []);
+var b = this.keymap.getBoundKeyStrokes ();
+var c = (a == null) ? 0 : a.length;
+var d = (b == null) ? 0 : b.length;
+if (c == 0) {
+return b;
+}if (d == 0) {
+return a;
+}var e =  new Array (c + d);
+System.arraycopy (a, 0, e, 0, c);
+System.arraycopy (b, 0, e, c, d);
+return e;
+});
+Clazz_defineMethod (c$, "size", 
+function () {
+var a = this.keymap.getBoundKeyStrokes ();
+var b = (a == null) ? 0 : a.length;
+return Clazz_superCall (this, javax.swing.text.JTextComponent.KeymapWrapper, "size", []) + b;
+});
+Clazz_defineMethod (c$, "get", 
+function (a) {
+var b = this.keymap.getAction (a);
+if (b == null) {
+b = Clazz_superCall (this, javax.swing.text.JTextComponent.KeymapWrapper, "get", [a]);
+if (b == null && a.getKeyChar () != '\uffff' && this.keymap.getDefaultAction () != null) {
+b = javax.swing.text.JTextComponent.KeymapWrapper.DefaultActionKey;
+}}return b;
+}, "javax.swing.KeyStroke");
+c$.DefaultActionKey = c$.prototype.DefaultActionKey =  new Clazz._O ();
+c$ = Clazz_p0p ();
+Clazz_pu$h(self.c$);
+c$ = Clazz_decorateAsClass (function () {
+this.keymap = null;
+Clazz_instantialize (this, arguments);
+}, javax.swing.text.JTextComponent, "KeymapActionMap", javax.swing.ActionMap);
+Clazz_makeConstructor (c$, 
+function (a) {
+Clazz_superConstructor (this, javax.swing.text.JTextComponent.KeymapActionMap, []);
+this.keymap = a;
+}, "javax.swing.text.Keymap");
+Clazz_defineMethod (c$, "keys", 
+function () {
+var a = Clazz_superCall (this, javax.swing.text.JTextComponent.KeymapActionMap, "keys", []);
+var b = this.keymap.getBoundActions ();
+var c = (a == null) ? 0 : a.length;
+var d = (b == null) ? 0 : b.length;
+var e = (this.keymap.getDefaultAction () != null);
+if (e) {
+d++;
+}if (c == 0) {
+if (e) {
+var f =  new Array (d);
+if (d > 1) {
+System.arraycopy (b, 0, f, 0, d - 1);
+}f[d - 1] = javax.swing.text.JTextComponent.KeymapWrapper.DefaultActionKey;
+return f;
+}return b;
+}if (d == 0) {
+return a;
+}var f =  new Array (c + d);
+System.arraycopy (a, 0, f, 0, c);
+if (e) {
+if (d > 1) {
+System.arraycopy (b, 0, f, c, d - 1);
+}f[c + d - 1] = javax.swing.text.JTextComponent.KeymapWrapper.DefaultActionKey;
+} else {
+System.arraycopy (b, 0, f, c, d);
+}return f;
+});
+Clazz_defineMethod (c$, "size", 
+function () {
+var a = this.keymap.getBoundActions ();
+var b = (a == null) ? 0 : a.length;
+if (this.keymap.getDefaultAction () != null) {
+b++;
+}return Clazz_superCall (this, javax.swing.text.JTextComponent.KeymapActionMap, "size", []) + b;
+});
+Clazz_defineMethod (c$, "get", 
+function (a) {
+var b = Clazz_superCall (this, javax.swing.text.JTextComponent.KeymapActionMap, "get", [a]);
+if (b == null) {
+if (a === javax.swing.text.JTextComponent.KeymapWrapper.DefaultActionKey) {
+b = this.keymap.getDefaultAction ();
+} else if (Clazz_instanceOf (a, javax.swing.Action)) {
+b = a;
+}}return b;
+}, "~O");
+c$ = Clazz_p0p ();
+Clazz_pu$h(self.c$);
+c$ = Clazz_decorateAsClass (function () {
+this.dragActive = false;
+this.dot = 0;
+this.mark = 0;
+Clazz_instantialize (this, arguments);
+}, javax.swing.text.JTextComponent, "MutableCaretEvent", javax.swing.event.CaretEvent, [javax.swing.event.ChangeListener, java.awt.event.FocusListener, java.awt.event.MouseListener]);
+Clazz_defineMethod (c$, "fire", 
+function () {
+var a = this.getSource ();
+if (a != null) {
+var b = a.getCaret ();
+if (b != null) {
+this.dot = b.getDot ();
+this.mark = b.getMark ();
+a.fireCaretUpdate (this);
+}}});
+Clazz_overrideMethod (c$, "toString", 
+function () {
+return "dot=" + this.dot + "," + "mark=" + this.mark;
+});
+Clazz_overrideMethod (c$, "getDot", 
+function () {
+return this.dot;
+});
+Clazz_overrideMethod (c$, "getMark", 
+function () {
+return this.mark;
+});
+Clazz_overrideMethod (c$, "stateChanged", 
+function (a) {
+if (!this.dragActive) {
+this.fire ();
+}}, "javax.swing.event.ChangeEvent");
+Clazz_overrideMethod (c$, "focusGained", 
+function (a) {
+jssun.awt.AppContext.getAppContext ().put (javax.swing.text.JTextComponent.FOCUSED_COMPONENT, a.getSource ());
+}, "java.awt.event.FocusEvent");
+Clazz_overrideMethod (c$, "focusLost", 
+function (a) {
+}, "java.awt.event.FocusEvent");
+Clazz_overrideMethod (c$, "mousePressed", 
+function (a) {
+this.dragActive = true;
+}, "java.awt.event.MouseEvent");
+Clazz_overrideMethod (c$, "mouseReleased", 
+function (a) {
+this.dragActive = false;
+this.fire ();
+}, "java.awt.event.MouseEvent");
+Clazz_overrideMethod (c$, "mouseClicked", 
+function (a) {
+}, "java.awt.event.MouseEvent");
+Clazz_overrideMethod (c$, "mouseEntered", 
+function (a) {
+}, "java.awt.event.MouseEvent");
+Clazz_overrideMethod (c$, "mouseExited", 
+function (a) {
+}, "java.awt.event.MouseEvent");
+c$ = Clazz_p0p ();
+Clazz_defineStatics (c$,
+"FOCUS_ACCELERATOR_KEY", "focusAcceleratorKey");
+c$.KEYMAP_TABLE = c$.prototype.KEYMAP_TABLE =  new Clazz._O ();
+c$.FOCUSED_COMPONENT = c$.prototype.FOCUSED_COMPONENT =  new Clazz._O ();
+Clazz_defineStatics (c$,
+"DEFAULT_KEYMAP", "default");
+});
+Clazz_declarePackage ("javax.swing.text");
+Clazz_declareInterface (javax.swing.text, "Keymap");
+Clazz_declarePackage ("javax.swing.text");
+Clazz_load (["javax.swing.text.EditorKit", "$.TextAction"], "javax.swing.text.DefaultEditorKit", ["java.io.InputStreamReader", "$.OutputStreamWriter", "java.awt.ComponentOrientation", "$.Point", "$.Rectangle", "javax.swing.UIManager", "javax.swing.text.BadLocationException", "$.DefaultCaret", "$.Position", "$.Segment", "$.Utilities", "swingjs.JSPlainDocument"], function () {
+c$ = Clazz_declareType (javax.swing.text, "DefaultEditorKit", javax.swing.text.EditorKit);
+Clazz_makeConstructor (c$, 
+function () {
+Clazz_superConstructor (this, javax.swing.text.DefaultEditorKit, []);
+});
+Clazz_overrideMethod (c$, "getContentType", 
+function () {
+return "text/plain";
+});
+Clazz_overrideMethod (c$, "getViewFactory", 
+function () {
+return null;
+});
+Clazz_overrideMethod (c$, "getActions", 
+function () {
+return javax.swing.text.DefaultEditorKit.defaultActions;
+});
+Clazz_overrideMethod (c$, "createCaret", 
+function () {
+return null;
+});
+Clazz_overrideMethod (c$, "createDefaultDocument", 
+function () {
+return  new swingjs.JSPlainDocument ();
+});
+Clazz_defineMethod (c$, "read", 
+function ($in, doc, pos) {
+this.read ( new java.io.InputStreamReader ($in), doc, pos);
+}, "java.io.InputStream,javax.swing.text.Document,~N");
+Clazz_defineMethod (c$, "write", 
+function (out, doc, pos, len) {
+var osw =  new java.io.OutputStreamWriter (out);
+this.write (osw, doc, pos, len);
+osw.flush ();
+}, "java.io.OutputStream,javax.swing.text.Document,~N,~N");
+Clazz_defineMethod (c$, "getInputAttributes", 
+function () {
+return null;
+});
+Clazz_defineMethod (c$, "read", 
+function ($in, doc, pos) {
+var buff =  Clazz_newCharArray (4096, '\0');
+var nch;
+var lastWasCR = false;
+var isCRLF = false;
+var isCR = false;
+var last;
+var wasEmpty = (doc.getLength () == 0);
+var attr = this.getInputAttributes ();
+while ((nch = $in.read (buff, 0, buff.length)) != -1) {
+last = 0;
+for (var counter = 0; counter < nch; counter++) {
+switch (buff[counter]) {
+case '\r':
+if (lastWasCR) {
+isCR = true;
+if (counter == 0) {
+doc.insertString (pos, "\n", attr);
+pos++;
+} else {
+buff[counter - 1] = '\n';
+}} else {
+lastWasCR = true;
+}break;
+case '\n':
+if (lastWasCR) {
+if (counter > (last + 1)) {
+doc.insertString (pos,  String.instantialize (buff, last, counter - last - 1), attr);
+pos += (counter - last - 1);
+}lastWasCR = false;
+last = counter;
+isCRLF = true;
+}break;
+default:
+if (lastWasCR) {
+isCR = true;
+if (counter == 0) {
+doc.insertString (pos, "\n", attr);
+pos++;
+} else {
+buff[counter - 1] = '\n';
+}lastWasCR = false;
+}break;
+}
+}
+if (last < nch) {
+if (lastWasCR) {
+if (last < (nch - 1)) {
+doc.insertString (pos,  String.instantialize (buff, last, nch - last - 1), attr);
+pos += (nch - last - 1);
+}} else {
+doc.insertString (pos,  String.instantialize (buff, last, nch - last), attr);
+pos += (nch - last);
+}}}
+if (lastWasCR) {
+doc.insertString (pos, "\n", attr);
+isCR = true;
+}if (wasEmpty) {
+if (isCRLF) {
+doc.putProperty ("__EndOfLine__", "\r\n");
+} else if (isCR) {
+doc.putProperty ("__EndOfLine__", "\r");
+} else {
+doc.putProperty ("__EndOfLine__", "\n");
+}}}, "java.io.Reader,javax.swing.text.Document,~N");
+Clazz_defineMethod (c$, "write", 
+function (out, doc, pos, len) {
+if ((pos < 0) || ((pos + len) > doc.getLength ())) {
+throw  new javax.swing.text.BadLocationException ("DefaultEditorKit.write", pos);
+}var data =  new javax.swing.text.Segment ();
+var nleft = len;
+var offs = pos;
+var endOfLineProperty = doc.getProperty ("__EndOfLine__");
+if (endOfLineProperty == null) {
+try {
+endOfLineProperty = System.getProperty ("line.separator");
+} catch (se) {
+if (Clazz_exceptionOf (se, SecurityException)) {
+} else {
+throw se;
+}
+}
+}var endOfLine;
+if (Clazz_instanceOf (endOfLineProperty, String)) {
+endOfLine = endOfLineProperty;
+} else {
+endOfLine = null;
+}if (endOfLineProperty != null && !endOfLine.equals ("\n")) {
+while (nleft > 0) {
+var n = Math.min (nleft, 4096);
+doc.getText (offs, n, data);
+var last = data.offset;
+var array = data.array;
+var maxCounter = last + data.count;
+for (var counter = last; counter < maxCounter; counter++) {
+if (array[counter] == '\n') {
+if (counter > last) {
+out.write (array, last, counter - last);
+}out.write (endOfLine);
+last = counter + 1;
+}}
+if (maxCounter > last) {
+out.write (array, last, maxCounter - last);
+}offs += n;
+nleft -= n;
+}
+} else {
+while (nleft > 0) {
+var n = Math.min (nleft, 4096);
+doc.getText (offs, n, data);
+out.write (data.array, data.offset, data.count);
+offs += n;
+nleft -= n;
+}
+}out.flush ();
+}, "java.io.Writer,javax.swing.text.Document,~N,~N");
+Clazz_pu$h(self.c$);
+c$ = Clazz_declareType (javax.swing.text.DefaultEditorKit, "DefaultKeyTypedAction", javax.swing.text.TextAction);
+Clazz_makeConstructor (c$, 
+function () {
+Clazz_superConstructor (this, javax.swing.text.DefaultEditorKit.DefaultKeyTypedAction, ["default-typed"]);
+});
+Clazz_overrideMethod (c$, "actionPerformed", 
+function (a) {
+var b = this.getTextComponent (a);
+if ((b != null) && (a != null)) {
+if ((!b.isEditable ()) || (!b.isEnabled ())) {
+return;
+}var c = a.getActionCommand ();
+var d = a.getModifiers ();
+if ((c != null) && (c.length > 0) && ((d & 8) == (d & 2))) {
+var e = c.charAt (0);
+if ((e.charCodeAt (0) >= 0x20) && (e.charCodeAt (0) != 0x7F)) {
+b.replaceSelection (c);
+}}}}, "java.awt.event.ActionEvent");
+c$ = Clazz_p0p ();
+Clazz_pu$h(self.c$);
+c$ = Clazz_declareType (javax.swing.text.DefaultEditorKit, "InsertContentAction", javax.swing.text.TextAction);
+Clazz_makeConstructor (c$, 
+function () {
+Clazz_superConstructor (this, javax.swing.text.DefaultEditorKit.InsertContentAction, ["insert-content"]);
+});
+Clazz_overrideMethod (c$, "actionPerformed", 
+function (a) {
+var b = this.getTextComponent (a);
+if ((b != null) && (a != null)) {
+if ((!b.isEditable ()) || (!b.isEnabled ())) {
+javax.swing.UIManager.getLookAndFeel ().provideErrorFeedback (b);
+return;
+}var c = a.getActionCommand ();
+if (c != null) {
+b.replaceSelection (c);
+} else {
+javax.swing.UIManager.getLookAndFeel ().provideErrorFeedback (b);
+}}}, "java.awt.event.ActionEvent");
+c$ = Clazz_p0p ();
+Clazz_pu$h(self.c$);
+c$ = Clazz_declareType (javax.swing.text.DefaultEditorKit, "InsertBreakAction", javax.swing.text.TextAction);
+Clazz_makeConstructor (c$, 
+function () {
+Clazz_superConstructor (this, javax.swing.text.DefaultEditorKit.InsertBreakAction, ["insert-break"]);
+});
+Clazz_overrideMethod (c$, "actionPerformed", 
+function (a) {
+var b = this.getTextComponent (a);
+if (b != null) {
+if ((!b.isEditable ()) || (!b.isEnabled ())) {
+javax.swing.UIManager.getLookAndFeel ().provideErrorFeedback (b);
+return;
+}b.replaceSelection ("\n");
+}}, "java.awt.event.ActionEvent");
+c$ = Clazz_p0p ();
+Clazz_pu$h(self.c$);
+c$ = Clazz_declareType (javax.swing.text.DefaultEditorKit, "InsertTabAction", javax.swing.text.TextAction);
+Clazz_makeConstructor (c$, 
+function () {
+Clazz_superConstructor (this, javax.swing.text.DefaultEditorKit.InsertTabAction, ["insert-tab"]);
+});
+Clazz_overrideMethod (c$, "actionPerformed", 
+function (a) {
+var b = this.getTextComponent (a);
+if (b != null) {
+if ((!b.isEditable ()) || (!b.isEnabled ())) {
+javax.swing.UIManager.getLookAndFeel ().provideErrorFeedback (b);
+return;
+}b.replaceSelection ("\t");
+}}, "java.awt.event.ActionEvent");
+c$ = Clazz_p0p ();
+Clazz_pu$h(self.c$);
+c$ = Clazz_declareType (javax.swing.text.DefaultEditorKit, "DeletePrevCharAction", javax.swing.text.TextAction);
+Clazz_makeConstructor (c$, 
+function () {
+Clazz_superConstructor (this, javax.swing.text.DefaultEditorKit.DeletePrevCharAction, ["delete-previous"]);
+});
+Clazz_overrideMethod (c$, "actionPerformed", 
+function (a) {
+var b = this.getTextComponent (a);
+var c = true;
+if ((b != null) && (b.isEditable ())) {
+try {
+var d = b.getDocument ();
+var e = b.getCaret ();
+var f = e.getDot ();
+var g = e.getMark ();
+if (f != g) {
+d.remove (Math.min (f, g), Math.abs (f - g));
+c = false;
+} else if (f > 0) {
+var h = 1;
+if (f > 1) {
+var i = d.getText (f - 2, 2);
+var j = i.charAt (0);
+var k = i.charAt (1);
+if (j >= '\uD800' && j <= '\uDBFF' && k >= '\uDC00' && k <= '\uDFFF') {
+h = 2;
+}}d.remove (f - h, h);
+c = false;
+}} catch (bl) {
+if (Clazz_exceptionOf (bl, javax.swing.text.BadLocationException)) {
+} else {
+throw bl;
+}
+}
+}if (c) {
+javax.swing.UIManager.getLookAndFeel ().provideErrorFeedback (b);
+}}, "java.awt.event.ActionEvent");
+c$ = Clazz_p0p ();
+Clazz_pu$h(self.c$);
+c$ = Clazz_declareType (javax.swing.text.DefaultEditorKit, "DeleteNextCharAction", javax.swing.text.TextAction);
+Clazz_makeConstructor (c$, 
+function () {
+Clazz_superConstructor (this, javax.swing.text.DefaultEditorKit.DeleteNextCharAction, ["delete-next"]);
+});
+Clazz_overrideMethod (c$, "actionPerformed", 
+function (a) {
+var b = this.getTextComponent (a);
+var c = true;
+if ((b != null) && (b.isEditable ())) {
+try {
+var d = b.getDocument ();
+var e = b.getCaret ();
+var f = e.getDot ();
+var g = e.getMark ();
+if (f != g) {
+d.remove (Math.min (f, g), Math.abs (f - g));
+c = false;
+} else if (f < d.getLength ()) {
+var h = 1;
+if (f < d.getLength () - 1) {
+var i = d.getText (f, 2);
+var j = i.charAt (0);
+var k = i.charAt (1);
+if (j >= '\uD800' && j <= '\uDBFF' && k >= '\uDC00' && k <= '\uDFFF') {
+h = 2;
+}}d.remove (f, h);
+c = false;
+}} catch (bl) {
+if (Clazz_exceptionOf (bl, javax.swing.text.BadLocationException)) {
+} else {
+throw bl;
+}
+}
+}if (c) {
+javax.swing.UIManager.getLookAndFeel ().provideErrorFeedback (b);
+}}, "java.awt.event.ActionEvent");
+c$ = Clazz_p0p ();
+Clazz_pu$h(self.c$);
+c$ = Clazz_declareType (javax.swing.text.DefaultEditorKit, "ReadOnlyAction", javax.swing.text.TextAction);
+Clazz_makeConstructor (c$, 
+function () {
+Clazz_superConstructor (this, javax.swing.text.DefaultEditorKit.ReadOnlyAction, ["set-read-only"]);
+});
+Clazz_overrideMethod (c$, "actionPerformed", 
+function (a) {
+var b = this.getTextComponent (a);
+if (b != null) {
+b.setEditable (false);
+}}, "java.awt.event.ActionEvent");
+c$ = Clazz_p0p ();
+Clazz_pu$h(self.c$);
+c$ = Clazz_declareType (javax.swing.text.DefaultEditorKit, "WritableAction", javax.swing.text.TextAction);
+Clazz_makeConstructor (c$, 
+function () {
+Clazz_superConstructor (this, javax.swing.text.DefaultEditorKit.WritableAction, ["set-writable"]);
+});
+Clazz_overrideMethod (c$, "actionPerformed", 
+function (a) {
+var b = this.getTextComponent (a);
+if (b != null) {
+b.setEditable (true);
+}}, "java.awt.event.ActionEvent");
+c$ = Clazz_p0p ();
+Clazz_pu$h(self.c$);
+c$ = Clazz_declareType (javax.swing.text.DefaultEditorKit, "CutAction", javax.swing.text.TextAction);
+Clazz_makeConstructor (c$, 
+function () {
+Clazz_superConstructor (this, javax.swing.text.DefaultEditorKit.CutAction, ["cut-to-clipboard"]);
+});
+Clazz_overrideMethod (c$, "actionPerformed", 
+function (a) {
+var b = this.getTextComponent (a);
+if (b != null) {
+b.cut ();
+}}, "java.awt.event.ActionEvent");
+c$ = Clazz_p0p ();
+Clazz_pu$h(self.c$);
+c$ = Clazz_declareType (javax.swing.text.DefaultEditorKit, "CopyAction", javax.swing.text.TextAction);
+Clazz_makeConstructor (c$, 
+function () {
+Clazz_superConstructor (this, javax.swing.text.DefaultEditorKit.CopyAction, ["copy-to-clipboard"]);
+});
+Clazz_overrideMethod (c$, "actionPerformed", 
+function (a) {
+var b = this.getTextComponent (a);
+if (b != null) {
+b.copy ();
+}}, "java.awt.event.ActionEvent");
+c$ = Clazz_p0p ();
+Clazz_pu$h(self.c$);
+c$ = Clazz_declareType (javax.swing.text.DefaultEditorKit, "PasteAction", javax.swing.text.TextAction);
+Clazz_makeConstructor (c$, 
+function () {
+Clazz_superConstructor (this, javax.swing.text.DefaultEditorKit.PasteAction, ["paste-from-clipboard"]);
+});
+Clazz_overrideMethod (c$, "actionPerformed", 
+function (a) {
+var b = this.getTextComponent (a);
+if (b != null) {
+b.paste ();
+}}, "java.awt.event.ActionEvent");
+c$ = Clazz_p0p ();
+Clazz_pu$h(self.c$);
+c$ = Clazz_declareType (javax.swing.text.DefaultEditorKit, "BeepAction", javax.swing.text.TextAction);
+Clazz_makeConstructor (c$, 
+function () {
+Clazz_superConstructor (this, javax.swing.text.DefaultEditorKit.BeepAction, ["beep"]);
+});
+Clazz_overrideMethod (c$, "actionPerformed", 
+function (a) {
+var b = this.getTextComponent (a);
+javax.swing.UIManager.getLookAndFeel ().provideErrorFeedback (b);
+}, "java.awt.event.ActionEvent");
+c$ = Clazz_p0p ();
+Clazz_pu$h(self.c$);
+c$ = Clazz_decorateAsClass (function () {
+this.select = false;
+this.direction = 0;
+Clazz_instantialize (this, arguments);
+}, javax.swing.text.DefaultEditorKit, "VerticalPageAction", javax.swing.text.TextAction);
+Clazz_makeConstructor (c$, 
+function (a, b, c) {
+Clazz_superConstructor (this, javax.swing.text.DefaultEditorKit.VerticalPageAction, [a]);
+this.select = c;
+this.direction = b;
+}, "~S,~N,~B");
+Clazz_overrideMethod (c$, "actionPerformed", 
+function (a) {
+var b = this.getTextComponent (a);
+if (b != null) {
+var c = b.getVisibleRect ();
+var d =  new java.awt.Rectangle (c);
+var e = b.getCaretPosition ();
+var f = this.direction * b.getScrollableBlockIncrement (c, 1, this.direction);
+var g = c.y;
+var h = b.getCaret ();
+var i = h.getMagicCaretPosition ();
+if (e != -1) {
+try {
+var j = b.modelToView (e);
+var k = (i != null) ? i.x : j.x;
+var l = j.height;
+if (l > 0) {
+f = Clazz_doubleToInt (f / l) * l;
+}d.y = this.constrainY (b, g + f, c.height);
+var m;
+if (c.contains (j.x, j.y)) {
+m = b.viewToModel ( new java.awt.Point (k, this.constrainY (b, j.y + f, 0)));
+} else {
+if (this.direction == -1) {
+m = b.viewToModel ( new java.awt.Point (k, d.y));
+} else {
+m = b.viewToModel ( new java.awt.Point (k, d.y + c.height));
+}}m = this.constrainOffset (b, m);
+if (m != e) {
+this.adjustScrollIfNecessary (b, d, g, m);
+if (this.select) {
+b.moveCaretPosition (m);
+} else {
+b.setCaretPosition (m);
+}}} catch (ble) {
+if (Clazz_exceptionOf (ble, javax.swing.text.BadLocationException)) {
+} else {
+throw ble;
+}
+}
+} else {
+d.y = this.constrainY (b, g + f, c.height);
+}if (i != null) {
+h.setMagicCaretPosition (i);
+}b.scrollRectToVisible (d);
+}}, "java.awt.event.ActionEvent");
+Clazz_defineMethod (c$, "constrainY", 
+ function (a, b, c) {
+if (b < 0) {
+b = 0;
+} else if (b + c > a.getHeight ()) {
+b = Math.max (0, a.getHeight () - c);
+}return b;
+}, "javax.swing.text.JTextComponent,~N,~N");
+Clazz_defineMethod (c$, "constrainOffset", 
+ function (a, b) {
+var c = a.getDocument ();
+if ((b != 0) && (b > c.getLength ())) {
+b = c.getLength ();
+}if (b < 0) {
+b = 0;
+}return b;
+}, "javax.swing.text.JTextComponent,~N");
+Clazz_defineMethod (c$, "adjustScrollIfNecessary", 
+ function (a, b, c, d) {
+try {
+var e = a.modelToView (d);
+if (e.y < b.y || (e.y > (b.y + b.height)) || (e.y + e.height) > (b.y + b.height)) {
+var f;
+if (e.y < b.y) {
+f = e.y;
+} else {
+f = e.y + e.height - b.height;
+}if ((this.direction == -1 && f < c) || (this.direction == 1 && f > c)) {
+b.y = f;
+}}} catch (ble) {
+if (Clazz_exceptionOf (ble, javax.swing.text.BadLocationException)) {
+} else {
+throw ble;
+}
+}
+}, "javax.swing.text.JTextComponent,java.awt.Rectangle,~N,~N");
+c$ = Clazz_p0p ();
+Clazz_pu$h(self.c$);
+c$ = Clazz_decorateAsClass (function () {
+this.select = false;
+this.left = false;
+Clazz_instantialize (this, arguments);
+}, javax.swing.text.DefaultEditorKit, "PageAction", javax.swing.text.TextAction);
+Clazz_makeConstructor (c$, 
+function (a, b, c) {
+Clazz_superConstructor (this, javax.swing.text.DefaultEditorKit.PageAction, [a]);
+this.select = c;
+this.left = b;
+}, "~S,~B,~B");
+Clazz_overrideMethod (c$, "actionPerformed", 
+function (a) {
+var b = this.getTextComponent (a);
+if (b != null) {
+var c;
+var d =  new java.awt.Rectangle ();
+b.computeVisibleRect (d);
+if (this.left) {
+d.x = Math.max (0, d.x - d.width);
+} else {
+d.x += d.width;
+}c = b.getCaretPosition ();
+if (c != -1) {
+if (this.left) {
+c = b.viewToModel ( new java.awt.Point (d.x, d.y));
+} else {
+c = b.viewToModel ( new java.awt.Point (d.x + d.width - 1, d.y + d.height - 1));
+}var e = b.getDocument ();
+if ((c != 0) && (c > (e.getLength () - 1))) {
+c = e.getLength () - 1;
+} else if (c < 0) {
+c = 0;
+}if (this.select) b.moveCaretPosition (c);
+ else b.setCaretPosition (c);
+}}}, "java.awt.event.ActionEvent");
+c$ = Clazz_p0p ();
+Clazz_pu$h(self.c$);
+c$ = Clazz_decorateAsClass (function () {
+this.select = false;
+this.direction = 0;
+Clazz_instantialize (this, arguments);
+}, javax.swing.text.DefaultEditorKit, "NextVisualPositionAction", javax.swing.text.TextAction);
+Clazz_makeConstructor (c$, 
+function (a, b, c) {
+Clazz_superConstructor (this, javax.swing.text.DefaultEditorKit.NextVisualPositionAction, [a]);
+this.select = b;
+this.direction = c;
+}, "~S,~B,~N");
+Clazz_overrideMethod (c$, "actionPerformed", 
+function (a) {
+var b = this.getTextComponent (a);
+if (b != null) {
+var c = b.getCaret ();
+var d = (Clazz_instanceOf (c, javax.swing.text.DefaultCaret)) ? c : null;
+var e = c.getDot ();
+var f =  new Array (1);
+var g = c.getMagicCaretPosition ();
+try {
+if (g == null && (this.direction == 1 || this.direction == 5)) {
+var h = (d != null) ? b.getUI ().modelToView (b, e, d.getDotBias ()) : b.modelToView (e);
+g =  new java.awt.Point (h.x, h.y);
+}var h = b.getNavigationFilter ();
+if (h != null) {
+e = h.getNextVisualPositionFrom (b, e, (d != null) ? d.getDotBias () : javax.swing.text.Position.Bias.Forward, this.direction, f);
+} else {
+e = b.getUI ().getNextVisualPositionFrom (b, e, (d != null) ? d.getDotBias () : javax.swing.text.Position.Bias.Forward, this.direction, f);
+}if (f[0] == null) {
+f[0] = javax.swing.text.Position.Bias.Forward;
+}if (d != null) {
+if (this.select) {
+d.moveDot (e, f[0]);
+} else {
+d.setDot (e, f[0]);
+}} else {
+if (this.select) {
+c.moveDot (e);
+} else {
+c.setDot (e);
+}}if (g != null && (this.direction == 1 || this.direction == 5)) {
+b.getCaret ().setMagicCaretPosition (g);
+}} catch (ex) {
+if (Clazz_exceptionOf (ex, javax.swing.text.BadLocationException)) {
+} else {
+throw ex;
+}
+}
+}}, "java.awt.event.ActionEvent");
+c$ = Clazz_p0p ();
+Clazz_pu$h(self.c$);
+c$ = Clazz_decorateAsClass (function () {
+this.select = false;
+Clazz_instantialize (this, arguments);
+}, javax.swing.text.DefaultEditorKit, "BeginWordAction", javax.swing.text.TextAction);
+Clazz_makeConstructor (c$, 
+function (a, b) {
+Clazz_superConstructor (this, javax.swing.text.DefaultEditorKit.BeginWordAction, [a]);
+this.select = b;
+}, "~S,~B");
+Clazz_overrideMethod (c$, "actionPerformed", 
+function (a) {
+var b = this.getTextComponent (a);
+if (b != null) {
+try {
+var c = b.getCaretPosition ();
+var d = javax.swing.text.Utilities.getWordStart (b, c);
+if (this.select) {
+b.moveCaretPosition (d);
+} else {
+b.setCaretPosition (d);
+}} catch (bl) {
+if (Clazz_exceptionOf (bl, javax.swing.text.BadLocationException)) {
+javax.swing.UIManager.getLookAndFeel ().provideErrorFeedback (b);
+} else {
+throw bl;
+}
+}
+}}, "java.awt.event.ActionEvent");
+c$ = Clazz_p0p ();
+Clazz_pu$h(self.c$);
+c$ = Clazz_decorateAsClass (function () {
+this.select = false;
+Clazz_instantialize (this, arguments);
+}, javax.swing.text.DefaultEditorKit, "EndWordAction", javax.swing.text.TextAction);
+Clazz_makeConstructor (c$, 
+function (a, b) {
+Clazz_superConstructor (this, javax.swing.text.DefaultEditorKit.EndWordAction, [a]);
+this.select = b;
+}, "~S,~B");
+Clazz_overrideMethod (c$, "actionPerformed", 
+function (a) {
+var b = this.getTextComponent (a);
+if (b != null) {
+try {
+var c = b.getCaretPosition ();
+var d = javax.swing.text.Utilities.getWordEnd (b, c);
+if (this.select) {
+b.moveCaretPosition (d);
+} else {
+b.setCaretPosition (d);
+}} catch (bl) {
+if (Clazz_exceptionOf (bl, javax.swing.text.BadLocationException)) {
+javax.swing.UIManager.getLookAndFeel ().provideErrorFeedback (b);
+} else {
+throw bl;
+}
+}
+}}, "java.awt.event.ActionEvent");
+c$ = Clazz_p0p ();
+Clazz_pu$h(self.c$);
+c$ = Clazz_decorateAsClass (function () {
+this.select = false;
+Clazz_instantialize (this, arguments);
+}, javax.swing.text.DefaultEditorKit, "PreviousWordAction", javax.swing.text.TextAction);
+Clazz_makeConstructor (c$, 
+function (a, b) {
+Clazz_superConstructor (this, javax.swing.text.DefaultEditorKit.PreviousWordAction, [a]);
+this.select = b;
+}, "~S,~B");
+Clazz_overrideMethod (c$, "actionPerformed", 
+function (a) {
+var b = this.getTextComponent (a);
+if (b != null) {
+var c = b.getCaretPosition ();
+var d = false;
+try {
+var e = javax.swing.text.Utilities.getParagraphElement (b, c);
+c = javax.swing.text.Utilities.getPreviousWord (b, c);
+if (c < e.getStartOffset ()) {
+c = javax.swing.text.Utilities.getParagraphElement (b, c).getEndOffset () - 1;
+}} catch (bl) {
+if (Clazz_exceptionOf (bl, javax.swing.text.BadLocationException)) {
+if (c != 0) {
+c = 0;
+} else {
+d = true;
+}} else {
+throw bl;
+}
+}
+if (!d) {
+if (this.select) {
+b.moveCaretPosition (c);
+} else {
+b.setCaretPosition (c);
+}} else {
+javax.swing.UIManager.getLookAndFeel ().provideErrorFeedback (b);
+}}}, "java.awt.event.ActionEvent");
+c$ = Clazz_p0p ();
+Clazz_pu$h(self.c$);
+c$ = Clazz_decorateAsClass (function () {
+this.select = false;
+Clazz_instantialize (this, arguments);
+}, javax.swing.text.DefaultEditorKit, "NextWordAction", javax.swing.text.TextAction);
+Clazz_makeConstructor (c$, 
+function (a, b) {
+Clazz_superConstructor (this, javax.swing.text.DefaultEditorKit.NextWordAction, [a]);
+this.select = b;
+}, "~S,~B");
+Clazz_overrideMethod (c$, "actionPerformed", 
+function (a) {
+var b = this.getTextComponent (a);
+if (b != null) {
+var c = b.getCaretPosition ();
+var d = false;
+var e = c;
+var f = javax.swing.text.Utilities.getParagraphElement (b, c);
+try {
+c = javax.swing.text.Utilities.getNextWord (b, c);
+if (c >= f.getEndOffset () && e != f.getEndOffset () - 1) {
+c = f.getEndOffset () - 1;
+}} catch (bl) {
+if (Clazz_exceptionOf (bl, javax.swing.text.BadLocationException)) {
+var g = b.getDocument ().getLength ();
+if (c != g) {
+if (e != f.getEndOffset () - 1) {
+c = f.getEndOffset () - 1;
+} else {
+c = g;
+}} else {
+d = true;
+}} else {
+throw bl;
+}
+}
+if (!d) {
+if (this.select) {
+b.moveCaretPosition (c);
+} else {
+b.setCaretPosition (c);
+}} else {
+javax.swing.UIManager.getLookAndFeel ().provideErrorFeedback (b);
+}}}, "java.awt.event.ActionEvent");
+c$ = Clazz_p0p ();
+Clazz_pu$h(self.c$);
+c$ = Clazz_decorateAsClass (function () {
+this.select = false;
+Clazz_instantialize (this, arguments);
+}, javax.swing.text.DefaultEditorKit, "BeginLineAction", javax.swing.text.TextAction);
+Clazz_makeConstructor (c$, 
+function (a, b) {
+Clazz_superConstructor (this, javax.swing.text.DefaultEditorKit.BeginLineAction, [a]);
+this.select = b;
+}, "~S,~B");
+Clazz_overrideMethod (c$, "actionPerformed", 
+function (a) {
+var b = this.getTextComponent (a);
+if (b != null) {
+try {
+var c = b.getCaretPosition ();
+var d = javax.swing.text.Utilities.getRowStart (b, c);
+if (this.select) {
+b.moveCaretPosition (d);
+} else {
+b.setCaretPosition (d);
+}} catch (bl) {
+if (Clazz_exceptionOf (bl, javax.swing.text.BadLocationException)) {
+javax.swing.UIManager.getLookAndFeel ().provideErrorFeedback (b);
+} else {
+throw bl;
+}
+}
+}}, "java.awt.event.ActionEvent");
+c$ = Clazz_p0p ();
+Clazz_pu$h(self.c$);
+c$ = Clazz_decorateAsClass (function () {
+this.select = false;
+Clazz_instantialize (this, arguments);
+}, javax.swing.text.DefaultEditorKit, "EndLineAction", javax.swing.text.TextAction);
+Clazz_makeConstructor (c$, 
+function (a, b) {
+Clazz_superConstructor (this, javax.swing.text.DefaultEditorKit.EndLineAction, [a]);
+this.select = b;
+}, "~S,~B");
+Clazz_overrideMethod (c$, "actionPerformed", 
+function (a) {
+var b = this.getTextComponent (a);
+if (b != null) {
+try {
+var c = b.getCaretPosition ();
+var d = javax.swing.text.Utilities.getRowEnd (b, c);
+if (this.select) {
+b.moveCaretPosition (d);
+} else {
+b.setCaretPosition (d);
+}} catch (bl) {
+if (Clazz_exceptionOf (bl, javax.swing.text.BadLocationException)) {
+javax.swing.UIManager.getLookAndFeel ().provideErrorFeedback (b);
+} else {
+throw bl;
+}
+}
+}}, "java.awt.event.ActionEvent");
+c$ = Clazz_p0p ();
+Clazz_pu$h(self.c$);
+c$ = Clazz_decorateAsClass (function () {
+this.select = false;
+Clazz_instantialize (this, arguments);
+}, javax.swing.text.DefaultEditorKit, "BeginParagraphAction", javax.swing.text.TextAction);
+Clazz_makeConstructor (c$, 
+function (a, b) {
+Clazz_superConstructor (this, javax.swing.text.DefaultEditorKit.BeginParagraphAction, [a]);
+this.select = b;
+}, "~S,~B");
+Clazz_overrideMethod (c$, "actionPerformed", 
+function (a) {
+var b = this.getTextComponent (a);
+if (b != null) {
+var c = b.getCaretPosition ();
+var d = javax.swing.text.Utilities.getParagraphElement (b, c);
+c = d.getStartOffset ();
+if (this.select) {
+b.moveCaretPosition (c);
+} else {
+b.setCaretPosition (c);
+}}}, "java.awt.event.ActionEvent");
+c$ = Clazz_p0p ();
+Clazz_pu$h(self.c$);
+c$ = Clazz_decorateAsClass (function () {
+this.select = false;
+Clazz_instantialize (this, arguments);
+}, javax.swing.text.DefaultEditorKit, "EndParagraphAction", javax.swing.text.TextAction);
+Clazz_makeConstructor (c$, 
+function (a, b) {
+Clazz_superConstructor (this, javax.swing.text.DefaultEditorKit.EndParagraphAction, [a]);
+this.select = b;
+}, "~S,~B");
+Clazz_overrideMethod (c$, "actionPerformed", 
+function (a) {
+var b = this.getTextComponent (a);
+if (b != null) {
+var c = b.getCaretPosition ();
+var d = javax.swing.text.Utilities.getParagraphElement (b, c);
+c = Math.min (b.getDocument ().getLength (), d.getEndOffset ());
+if (this.select) {
+b.moveCaretPosition (c);
+} else {
+b.setCaretPosition (c);
+}}}, "java.awt.event.ActionEvent");
+c$ = Clazz_p0p ();
+Clazz_pu$h(self.c$);
+c$ = Clazz_decorateAsClass (function () {
+this.select = false;
+Clazz_instantialize (this, arguments);
+}, javax.swing.text.DefaultEditorKit, "BeginAction", javax.swing.text.TextAction);
+Clazz_makeConstructor (c$, 
+function (a, b) {
+Clazz_superConstructor (this, javax.swing.text.DefaultEditorKit.BeginAction, [a]);
+this.select = b;
+}, "~S,~B");
+Clazz_overrideMethod (c$, "actionPerformed", 
+function (a) {
+var b = this.getTextComponent (a);
+if (b != null) {
+if (this.select) {
+b.moveCaretPosition (0);
+} else {
+b.setCaretPosition (0);
+}}}, "java.awt.event.ActionEvent");
+c$ = Clazz_p0p ();
+Clazz_pu$h(self.c$);
+c$ = Clazz_decorateAsClass (function () {
+this.select = false;
+Clazz_instantialize (this, arguments);
+}, javax.swing.text.DefaultEditorKit, "EndAction", javax.swing.text.TextAction);
+Clazz_makeConstructor (c$, 
+function (a, b) {
+Clazz_superConstructor (this, javax.swing.text.DefaultEditorKit.EndAction, [a]);
+this.select = b;
+}, "~S,~B");
+Clazz_overrideMethod (c$, "actionPerformed", 
+function (a) {
+var b = this.getTextComponent (a);
+if (b != null) {
+var c = b.getDocument ();
+var d = c.getLength ();
+if (this.select) {
+b.moveCaretPosition (d);
+} else {
+b.setCaretPosition (d);
+}}}, "java.awt.event.ActionEvent");
+c$ = Clazz_p0p ();
+Clazz_pu$h(self.c$);
+c$ = Clazz_decorateAsClass (function () {
+this.start = null;
+this.end = null;
+Clazz_instantialize (this, arguments);
+}, javax.swing.text.DefaultEditorKit, "SelectWordAction", javax.swing.text.TextAction);
+Clazz_makeConstructor (c$, 
+function () {
+Clazz_superConstructor (this, javax.swing.text.DefaultEditorKit.SelectWordAction, ["select-word"]);
+this.start =  new javax.swing.text.DefaultEditorKit.BeginWordAction ("pigdog", false);
+this.end =  new javax.swing.text.DefaultEditorKit.EndWordAction ("pigdog", true);
+});
+Clazz_defineMethod (c$, "actionPerformed", 
+function (a) {
+this.start.actionPerformed (a);
+this.end.actionPerformed (a);
+}, "java.awt.event.ActionEvent");
+c$ = Clazz_p0p ();
+Clazz_pu$h(self.c$);
+c$ = Clazz_decorateAsClass (function () {
+this.start = null;
+this.end = null;
+Clazz_instantialize (this, arguments);
+}, javax.swing.text.DefaultEditorKit, "SelectLineAction", javax.swing.text.TextAction);
+Clazz_makeConstructor (c$, 
+function () {
+Clazz_superConstructor (this, javax.swing.text.DefaultEditorKit.SelectLineAction, ["select-line"]);
+this.start =  new javax.swing.text.DefaultEditorKit.BeginLineAction ("pigdog", false);
+this.end =  new javax.swing.text.DefaultEditorKit.EndLineAction ("pigdog", true);
+});
+Clazz_defineMethod (c$, "actionPerformed", 
+function (a) {
+this.start.actionPerformed (a);
+this.end.actionPerformed (a);
+}, "java.awt.event.ActionEvent");
+c$ = Clazz_p0p ();
+Clazz_pu$h(self.c$);
+c$ = Clazz_decorateAsClass (function () {
+this.start = null;
+this.end = null;
+Clazz_instantialize (this, arguments);
+}, javax.swing.text.DefaultEditorKit, "SelectParagraphAction", javax.swing.text.TextAction);
+Clazz_makeConstructor (c$, 
+function () {
+Clazz_superConstructor (this, javax.swing.text.DefaultEditorKit.SelectParagraphAction, ["select-paragraph"]);
+this.start =  new javax.swing.text.DefaultEditorKit.BeginParagraphAction ("pigdog", false);
+this.end =  new javax.swing.text.DefaultEditorKit.EndParagraphAction ("pigdog", true);
+});
+Clazz_defineMethod (c$, "actionPerformed", 
+function (a) {
+this.start.actionPerformed (a);
+this.end.actionPerformed (a);
+}, "java.awt.event.ActionEvent");
+c$ = Clazz_p0p ();
+Clazz_pu$h(self.c$);
+c$ = Clazz_declareType (javax.swing.text.DefaultEditorKit, "SelectAllAction", javax.swing.text.TextAction);
+Clazz_makeConstructor (c$, 
+function () {
+Clazz_superConstructor (this, javax.swing.text.DefaultEditorKit.SelectAllAction, ["select-all"]);
+});
+Clazz_overrideMethod (c$, "actionPerformed", 
+function (a) {
+var b = this.getTextComponent (a);
+if (b != null) {
+var c = b.getDocument ();
+b.setCaretPosition (0);
+b.moveCaretPosition (c.getLength ());
+}}, "java.awt.event.ActionEvent");
+c$ = Clazz_p0p ();
+Clazz_pu$h(self.c$);
+c$ = Clazz_declareType (javax.swing.text.DefaultEditorKit, "UnselectAction", javax.swing.text.TextAction);
+Clazz_makeConstructor (c$, 
+function () {
+Clazz_superConstructor (this, javax.swing.text.DefaultEditorKit.UnselectAction, ["unselect"]);
+});
+Clazz_overrideMethod (c$, "actionPerformed", 
+function (a) {
+var b = this.getTextComponent (a);
+if (b != null) {
+b.setCaretPosition (b.getCaretPosition ());
+}}, "java.awt.event.ActionEvent");
+c$ = Clazz_p0p ();
+Clazz_pu$h(self.c$);
+c$ = Clazz_declareType (javax.swing.text.DefaultEditorKit, "ToggleComponentOrientationAction", javax.swing.text.TextAction);
+Clazz_makeConstructor (c$, 
+function () {
+Clazz_superConstructor (this, javax.swing.text.DefaultEditorKit.ToggleComponentOrientationAction, ["toggle-componentOrientation"]);
+});
+Clazz_overrideMethod (c$, "actionPerformed", 
+function (a) {
+var b = this.getTextComponent (a);
+if (b != null) {
+var c = b.getComponentOrientation ();
+var d;
+if (c === java.awt.ComponentOrientation.RIGHT_TO_LEFT) d = java.awt.ComponentOrientation.LEFT_TO_RIGHT;
+ else d = java.awt.ComponentOrientation.RIGHT_TO_LEFT;
+b.setComponentOrientation (d);
+b.repaint ();
+}}, "java.awt.event.ActionEvent");
+c$ = Clazz_p0p ();
+Clazz_defineStatics (c$,
+"EndOfLineStringProperty", "__EndOfLine__",
+"insertContentAction", "insert-content",
+"insertBreakAction", "insert-break",
+"insertTabAction", "insert-tab",
+"deletePrevCharAction", "delete-previous",
+"deleteNextCharAction", "delete-next",
+"deleteNextWordAction", "delete-next-word",
+"deletePrevWordAction", "delete-previous-word",
+"readOnlyAction", "set-read-only",
+"writableAction", "set-writable",
+"cutAction", "cut-to-clipboard",
+"copyAction", "copy-to-clipboard",
+"pasteAction", "paste-from-clipboard",
+"beepAction", "beep",
+"pageUpAction", "page-up",
+"pageDownAction", "page-down",
+"selectionPageUpAction", "selection-page-up",
+"selectionPageDownAction", "selection-page-down",
+"selectionPageLeftAction", "selection-page-left",
+"selectionPageRightAction", "selection-page-right",
+"forwardAction", "caret-forward",
+"backwardAction", "caret-backward",
+"selectionForwardAction", "selection-forward",
+"selectionBackwardAction", "selection-backward",
+"upAction", "caret-up",
+"downAction", "caret-down",
+"selectionUpAction", "selection-up",
+"selectionDownAction", "selection-down",
+"beginWordAction", "caret-begin-word",
+"endWordAction", "caret-end-word",
+"selectionBeginWordAction", "selection-begin-word",
+"selectionEndWordAction", "selection-end-word",
+"previousWordAction", "caret-previous-word",
+"nextWordAction", "caret-next-word",
+"selectionPreviousWordAction", "selection-previous-word",
+"selectionNextWordAction", "selection-next-word",
+"beginLineAction", "caret-begin-line",
+"endLineAction", "caret-end-line",
+"selectionBeginLineAction", "selection-begin-line",
+"selectionEndLineAction", "selection-end-line",
+"beginParagraphAction", "caret-begin-paragraph",
+"endParagraphAction", "caret-end-paragraph",
+"selectionBeginParagraphAction", "selection-begin-paragraph",
+"selectionEndParagraphAction", "selection-end-paragraph",
+"beginAction", "caret-begin",
+"endAction", "caret-end",
+"selectionBeginAction", "selection-begin",
+"selectionEndAction", "selection-end",
+"selectWordAction", "select-word",
+"selectLineAction", "select-line",
+"selectParagraphAction", "select-paragraph",
+"selectAllAction", "select-all",
+"unselectAction", "unselect",
+"toggleComponentOrientationAction", "toggle-componentOrientation",
+"defaultKeyTypedAction", "default-typed");
+c$.defaultActions = c$.prototype.defaultActions =  Clazz_newArray (-1, [ new javax.swing.text.DefaultEditorKit.InsertContentAction (),  new javax.swing.text.DefaultEditorKit.DeletePrevCharAction (),  new javax.swing.text.DefaultEditorKit.DeleteNextCharAction (),  new javax.swing.text.DefaultEditorKit.ReadOnlyAction (),  new javax.swing.text.DefaultEditorKit.WritableAction (),  new javax.swing.text.DefaultEditorKit.CutAction (),  new javax.swing.text.DefaultEditorKit.CopyAction (),  new javax.swing.text.DefaultEditorKit.PasteAction (),  new javax.swing.text.DefaultEditorKit.VerticalPageAction ("page-up", -1, false),  new javax.swing.text.DefaultEditorKit.VerticalPageAction ("page-down", 1, false),  new javax.swing.text.DefaultEditorKit.VerticalPageAction ("selection-page-up", -1, true),  new javax.swing.text.DefaultEditorKit.VerticalPageAction ("selection-page-down", 1, true),  new javax.swing.text.DefaultEditorKit.PageAction ("selection-page-left", true, true),  new javax.swing.text.DefaultEditorKit.PageAction ("selection-page-right", false, true),  new javax.swing.text.DefaultEditorKit.InsertBreakAction (),  new javax.swing.text.DefaultEditorKit.BeepAction (),  new javax.swing.text.DefaultEditorKit.NextVisualPositionAction ("caret-forward", false, 3),  new javax.swing.text.DefaultEditorKit.NextVisualPositionAction ("caret-backward", false, 7),  new javax.swing.text.DefaultEditorKit.NextVisualPositionAction ("selection-forward", true, 3),  new javax.swing.text.DefaultEditorKit.NextVisualPositionAction ("selection-backward", true, 7),  new javax.swing.text.DefaultEditorKit.NextVisualPositionAction ("caret-up", false, 1),  new javax.swing.text.DefaultEditorKit.NextVisualPositionAction ("caret-down", false, 5),  new javax.swing.text.DefaultEditorKit.NextVisualPositionAction ("selection-up", true, 1),  new javax.swing.text.DefaultEditorKit.NextVisualPositionAction ("selection-down", true, 5),  new javax.swing.text.DefaultEditorKit.BeginWordAction ("caret-begin-word", false),  new javax.swing.text.DefaultEditorKit.EndWordAction ("caret-end-word", false),  new javax.swing.text.DefaultEditorKit.BeginWordAction ("selection-begin-word", true),  new javax.swing.text.DefaultEditorKit.EndWordAction ("selection-end-word", true),  new javax.swing.text.DefaultEditorKit.PreviousWordAction ("caret-previous-word", false),  new javax.swing.text.DefaultEditorKit.NextWordAction ("caret-next-word", false),  new javax.swing.text.DefaultEditorKit.PreviousWordAction ("selection-previous-word", true),  new javax.swing.text.DefaultEditorKit.NextWordAction ("selection-next-word", true),  new javax.swing.text.DefaultEditorKit.BeginLineAction ("caret-begin-line", false),  new javax.swing.text.DefaultEditorKit.EndLineAction ("caret-end-line", false),  new javax.swing.text.DefaultEditorKit.BeginLineAction ("selection-begin-line", true),  new javax.swing.text.DefaultEditorKit.EndLineAction ("selection-end-line", true),  new javax.swing.text.DefaultEditorKit.BeginParagraphAction ("caret-begin-paragraph", false),  new javax.swing.text.DefaultEditorKit.EndParagraphAction ("caret-end-paragraph", false),  new javax.swing.text.DefaultEditorKit.BeginParagraphAction ("selection-begin-paragraph", true),  new javax.swing.text.DefaultEditorKit.EndParagraphAction ("selection-end-paragraph", true),  new javax.swing.text.DefaultEditorKit.BeginAction ("caret-begin", false),  new javax.swing.text.DefaultEditorKit.EndAction ("caret-end", false),  new javax.swing.text.DefaultEditorKit.BeginAction ("selection-begin", true),  new javax.swing.text.DefaultEditorKit.EndAction ("selection-end", true),  new javax.swing.text.DefaultEditorKit.DefaultKeyTypedAction (),  new javax.swing.text.DefaultEditorKit.InsertTabAction (),  new javax.swing.text.DefaultEditorKit.SelectWordAction (),  new javax.swing.text.DefaultEditorKit.SelectLineAction (),  new javax.swing.text.DefaultEditorKit.SelectParagraphAction (),  new javax.swing.text.DefaultEditorKit.SelectAllAction (),  new javax.swing.text.DefaultEditorKit.UnselectAction (),  new javax.swing.text.DefaultEditorKit.ToggleComponentOrientationAction ()]);
+});
+Clazz_declarePackage ("javax.swing.text");
+c$ = Clazz_declareType (javax.swing.text, "EditorKit", null, Cloneable);
+Clazz_makeConstructor (c$, 
+function () {
+});
+Clazz_defineMethod (c$, "clone", 
+function () {
+var o;
+try {
+o = Clazz_superCall (this, javax.swing.text.EditorKit, "clone", []);
+} catch (cnse) {
+if (Clazz_exceptionOf (cnse, CloneNotSupportedException)) {
+o = null;
+} else {
+throw cnse;
+}
+}
+return o;
+});
+Clazz_defineMethod (c$, "install", 
+function (c) {
+}, "javax.swing.JEditorPane");
+Clazz_defineMethod (c$, "deinstall", 
+function (c) {
+}, "javax.swing.JEditorPane");
+Clazz_declarePackage ("javax.swing.text");
+Clazz_load (["javax.swing.AbstractAction"], "javax.swing.text.TextAction", ["java.util.Hashtable", "javax.swing.text.JTextComponent"], function () {
+c$ = Clazz_declareType (javax.swing.text, "TextAction", javax.swing.AbstractAction);
+Clazz_defineMethod (c$, "getTextComponent", 
+function (e) {
+if (e != null) {
+var o = e.getSource ();
+if (Clazz_instanceOf (o, javax.swing.text.JTextComponent)) {
+return o;
+}}return this.getFocusedComponent ();
+}, "java.awt.event.ActionEvent");
+c$.augmentList = Clazz_defineMethod (c$, "augmentList", 
+function (list1, list2) {
+var h =  new java.util.Hashtable ();
+if (list1 != null) for (var i = 0; i < list1.length; i++) {
+var a = list1[i];
+var value = a.getValue ("Name");
+h.put ((value != null ? value : ""), a);
+}
+for (var i = 0; i < list2.length; i++) {
+var a = list2[i];
+var value = a.getValue ("Name");
+h.put ((value != null ? value : ""), a);
+}
+var actions =  new Array (h.size ());
+var index = 0;
+for (var e = h.elements (); e.hasMoreElements (); ) {
+actions[index++] = e.nextElement ();
+}
+return actions;
+}, "~A,~A");
+Clazz_defineMethod (c$, "getFocusedComponent", 
+function () {
+return javax.swing.text.JTextComponent.getFocusedComponent ();
+});
+});
+Clazz_declarePackage ("javax.swing.text");
+Clazz_load (["java.lang.Exception"], "javax.swing.text.BadLocationException", null, function () {
+c$ = Clazz_decorateAsClass (function () {
+this.offs = 0;
+Clazz_instantialize (this, arguments);
+}, javax.swing.text, "BadLocationException", Exception);
+Clazz_makeConstructor (c$, 
+function (s, offs) {
+Clazz_superConstructor (this, javax.swing.text.BadLocationException, [s]);
+this.offs = offs;
+}, "~S,~N");
+Clazz_defineMethod (c$, "offsetRequested", 
+function () {
+return this.offs;
+});
+});
+Clazz_declarePackage ("javax.swing.text");
+Clazz_load (["java.awt.Rectangle", "java.awt.event.ActionListener", "$.FocusListener", "$.MouseListener", "$.MouseMotionListener", "java.beans.PropertyChangeListener", "javax.swing.event.DocumentListener", "javax.swing.text.Caret", "$.NavigationFilter", "javax.swing.event.EventListenerList"], "javax.swing.text.DefaultCaret", ["java.lang.Boolean", "$.IllegalArgumentException", "java.awt.Point", "java.awt.event.ActionEvent", "javax.swing.SwingUtilities", "javax.swing.event.ChangeEvent", "$.ChangeListener", "javax.swing.text.AbstractDocument", "javax.swing.text.AbstractDocument.UndoRedoDocumentEvent", "javax.swing.text.DefaultEditorKit", "$.DefaultHighlighter", "$.Document", "$.Position", "$.Segment", "$.StateInvariantError"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.listenerList = null;
+this.changeEvent = null;
+this.component = null;
+this.updatePolicy = 0;
+this.visible = false;
+this.active = false;
+this.dot = 0;
+this.mark = 0;
+this.selectionTag = null;
+this.selectionVisible = false;
+this.magicCaretPosition = null;
+this.dotBias = null;
+this.markBias = null;
+this.dotLTR = false;
+this.markLTR = false;
+this.handler = null;
+this.flagXPoints = null;
+this.flagYPoints = null;
+this.filterBypass = null;
+this.ownsSelection = false;
+this.forceCaretPositionChange = false;
+this.shouldHandleRelease = false;
+this.selectedWordEvent = null;
+this.caretWidth = -1;
+this.aspectRatio = -1;
+if (!Clazz_isClassDefined ("javax.swing.text.DefaultCaret.SafeScroller")) {
+javax.swing.text.DefaultCaret.$DefaultCaret$SafeScroller$ ();
+}
+if (!Clazz_isClassDefined ("javax.swing.text.DefaultCaret.Handler")) {
+javax.swing.text.DefaultCaret.$DefaultCaret$Handler$ ();
+}
+if (!Clazz_isClassDefined ("javax.swing.text.DefaultCaret.DefaultFilterBypass")) {
+javax.swing.text.DefaultCaret.$DefaultCaret$DefaultFilterBypass$ ();
+}
+Clazz_instantialize (this, arguments);
+}, javax.swing.text, "DefaultCaret", java.awt.Rectangle, [javax.swing.text.Caret, java.awt.event.FocusListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener]);
+Clazz_prepareFields (c$, function () {
+this.listenerList =  new javax.swing.event.EventListenerList ();
+this.handler = Clazz_innerTypeInstance (javax.swing.text.DefaultCaret.Handler, this, null);
+this.flagXPoints =  Clazz_newIntArray (3, 0);
+this.flagYPoints =  Clazz_newIntArray (3, 0);
+});
+Clazz_makeConstructor (c$, 
+function () {
+Clazz_superConstructor (this, javax.swing.text.DefaultCaret, []);
+});
+Clazz_defineMethod (c$, "setUpdatePolicy", 
+function (policy) {
+this.updatePolicy = policy;
+}, "~N");
+Clazz_defineMethod (c$, "getUpdatePolicy", 
+function () {
+return this.updatePolicy;
+});
+Clazz_defineMethod (c$, "getComponent", 
+function () {
+return this.component;
+});
+Clazz_defineMethod (c$, "repaint", 
+function () {
+if (this.component != null) {
+this.component.repaint (this.x, this.y, this.width, this.height);
+}});
+Clazz_defineMethod (c$, "damage", 
+function (r) {
+if (r != null) {
+var damageWidth = this.getCaretWidth (r.height);
+this.x = r.x - 4 - (damageWidth >> 1);
+this.y = r.y;
+this.width = 9 + damageWidth;
+this.height = r.height;
+this.repaint ();
+}}, "java.awt.Rectangle");
+Clazz_defineMethod (c$, "adjustVisibility", 
+function (nloc) {
+if (this.component == null) {
+return;
+}if (javax.swing.SwingUtilities.isEventDispatchThread ()) {
+this.component.scrollRectToVisible (nloc);
+} else {
+javax.swing.SwingUtilities.invokeLater (Clazz_innerTypeInstance (javax.swing.text.DefaultCaret.SafeScroller, this, null, nloc));
+}}, "java.awt.Rectangle");
+Clazz_defineMethod (c$, "getSelectionPainter", 
+function () {
+return javax.swing.text.DefaultHighlighter.DefaultPainter;
+});
+Clazz_defineMethod (c$, "positionCaret", 
+function (e) {
+var pt =  new java.awt.Point (e.getX (), e.getY ());
+var biasRet =  new Array (1);
+var pos = this.component.getUI ().viewToModel (this.component, pt, biasRet);
+if (biasRet[0] == null) biasRet[0] = javax.swing.text.Position.Bias.Forward;
+if (pos >= 0) {
+this.setDot (pos, biasRet[0]);
+}}, "java.awt.event.MouseEvent");
+Clazz_defineMethod (c$, "moveCaret", 
+function (e) {
+var pt =  new java.awt.Point (e.getX (), e.getY ());
+var biasRet =  new Array (1);
+var pos = this.component.getUI ().viewToModel (this.component, pt, biasRet);
+if (biasRet[0] == null) biasRet[0] = javax.swing.text.Position.Bias.Forward;
+if (pos >= 0) {
+this.moveDot (pos, biasRet[0]);
+}}, "java.awt.event.MouseEvent");
+Clazz_overrideMethod (c$, "focusGained", 
+function (e) {
+if (this.component.isEnabled ()) {
+if (this.component.isEditable ()) {
+this.setVisible (true);
+}this.setSelectionVisible (true);
+}}, "java.awt.event.FocusEvent");
+Clazz_overrideMethod (c$, "focusLost", 
+function (e) {
+this.setVisible (false);
+this.setSelectionVisible (this.ownsSelection || e.isTemporary ());
+}, "java.awt.event.FocusEvent");
+Clazz_overrideMethod (c$, "mouseClicked", 
+function (e) {
+var nclicks = e.getClickCount ();
+if (!e.isConsumed ()) {
+if (javax.swing.SwingUtilities.isLeftMouseButton (e)) {
+if (nclicks == 1) {
+this.selectedWordEvent = null;
+}} else if (javax.swing.SwingUtilities.isMiddleMouseButton (e)) {
+}}}, "java.awt.event.MouseEvent");
+Clazz_overrideMethod (c$, "mousePressed", 
+function (e) {
+if (javax.swing.SwingUtilities.isLeftMouseButton (e)) {
+if (e.isConsumed ()) {
+this.shouldHandleRelease = true;
+} else {
+this.shouldHandleRelease = false;
+this.adjustCaretAndFocus (e);
+}}}, "java.awt.event.MouseEvent");
+Clazz_defineMethod (c$, "adjustCaretAndFocus", 
+function (e) {
+this.adjustCaret (e);
+this.adjustFocus (false);
+}, "java.awt.event.MouseEvent");
+Clazz_defineMethod (c$, "adjustCaret", 
+ function (e) {
+if ((e.getModifiers () & 1) != 0 && this.getDot () != -1) {
+this.moveCaret (e);
+} else {
+this.positionCaret (e);
+}}, "java.awt.event.MouseEvent");
+Clazz_defineMethod (c$, "adjustFocus", 
+ function (inWindow) {
+if ((this.component != null) && this.component.isEnabled () && this.component.isRequestFocusEnabled ()) {
+if (inWindow) {
+this.component.requestFocusInWindow ();
+} else {
+this.component.requestFocus ();
+}}}, "~B");
+Clazz_overrideMethod (c$, "mouseReleased", 
+function (e) {
+if (!e.isConsumed () && this.shouldHandleRelease && javax.swing.SwingUtilities.isLeftMouseButton (e)) {
+this.adjustCaretAndFocus (e);
+}}, "java.awt.event.MouseEvent");
+Clazz_overrideMethod (c$, "mouseEntered", 
+function (e) {
+}, "java.awt.event.MouseEvent");
+Clazz_overrideMethod (c$, "mouseExited", 
+function (e) {
+}, "java.awt.event.MouseEvent");
+Clazz_overrideMethod (c$, "mouseDragged", 
+function (e) {
+if ((!e.isConsumed ()) && javax.swing.SwingUtilities.isLeftMouseButton (e)) {
+this.moveCaret (e);
+}}, "java.awt.event.MouseEvent");
+Clazz_overrideMethod (c$, "mouseMoved", 
+function (e) {
+}, "java.awt.event.MouseEvent");
+Clazz_overrideMethod (c$, "paint", 
+function (g) {
+if (this.isVisible ()) {
+try {
+var mapper = this.component.getUI ();
+var r = mapper.modelToView (this.component, this.dot, this.dotBias);
+if ((r == null) || ((r.width == 0) && (r.height == 0))) {
+return;
+}if (this.width > 0 && this.height > 0 && !this._contains (r.x, r.y, r.width, r.height)) {
+var clip = g.getClipBounds ();
+if (clip != null && !clip.contains (this)) {
+this.repaint ();
+}this.damage (r);
+}g.setColor (this.component.getCaretColor ());
+var paintWidth = this.getCaretWidth (r.height);
+r.x -= paintWidth >> 1;
+g.fillRect (r.x, r.y, paintWidth, r.height);
+var doc = this.component.getDocument ();
+if (Clazz_instanceOf (doc, javax.swing.text.AbstractDocument)) {
+var bidi = (doc).getBidiRootElement ();
+if ((bidi != null) && (bidi.getElementCount () > 1)) {
+this.flagXPoints[0] = r.x + ((this.dotLTR) ? paintWidth : 0);
+this.flagYPoints[0] = r.y;
+this.flagXPoints[1] = this.flagXPoints[0];
+this.flagYPoints[1] = this.flagYPoints[0] + 4;
+this.flagXPoints[2] = this.flagXPoints[0] + ((this.dotLTR) ? 4 : -4);
+this.flagYPoints[2] = this.flagYPoints[0];
+g.fillPolygon (this.flagXPoints, this.flagYPoints, 3);
+}}} catch (e) {
+if (Clazz_exceptionOf (e, javax.swing.text.BadLocationException)) {
+} else {
+throw e;
+}
+}
+}}, "java.awt.Graphics");
+Clazz_overrideMethod (c$, "install", 
+function (c) {
+this.component = c;
+var doc = c.getDocument ();
+this.dot = this.mark = 0;
+this.dotLTR = this.markLTR = true;
+this.dotBias = this.markBias = javax.swing.text.Position.Bias.Forward;
+if (doc != null) {
+doc.addDocumentListener (this.handler);
+}c.addPropertyChangeListener (this.handler);
+c.addFocusListener (this);
+c.addMouseListener (this);
+c.addMouseMotionListener (this);
+if (this.component.hasFocus ()) {
+this.focusGained (null);
+}var ratio = c.getClientProperty ("caretAspectRatio");
+if (ratio != null) {
+this.aspectRatio = ratio.floatValue ();
+} else {
+this.aspectRatio = -1;
+}var width = c.getClientProperty ("caretWidth");
+if (width != null) {
+this.caretWidth = width.intValue ();
+} else {
+this.caretWidth = -1;
+}}, "javax.swing.text.JTextComponent");
+Clazz_overrideMethod (c$, "deinstall", 
+function (c) {
+c.removeMouseListener (this);
+c.removeMouseMotionListener (this);
+c.removeFocusListener (this);
+c.removePropertyChangeListener (this.handler);
+var doc = c.getDocument ();
+if (doc != null) {
+doc.removeDocumentListener (this.handler);
+}{
+this.component = null;
+}}, "javax.swing.text.JTextComponent");
+Clazz_overrideMethod (c$, "addChangeListener", 
+function (l) {
+this.listenerList.add (javax.swing.event.ChangeListener, l);
+}, "javax.swing.event.ChangeListener");
+Clazz_overrideMethod (c$, "removeChangeListener", 
+function (l) {
+this.listenerList.remove (javax.swing.event.ChangeListener, l);
+}, "javax.swing.event.ChangeListener");
+Clazz_defineMethod (c$, "getChangeListeners", 
+function () {
+return this.listenerList.getListeners (javax.swing.event.ChangeListener);
+});
+Clazz_defineMethod (c$, "fireStateChanged", 
+function () {
+var listeners = this.listenerList.getListenerList ();
+for (var i = listeners.length - 2; i >= 0; i -= 2) {
+if (listeners[i] === javax.swing.event.ChangeListener) {
+if (this.changeEvent == null) this.changeEvent =  new javax.swing.event.ChangeEvent (this);
+(listeners[i + 1]).stateChanged (this.changeEvent);
+}}
+});
+Clazz_defineMethod (c$, "getListeners", 
+function (listenerType) {
+return this.listenerList.getListeners (listenerType);
+}, "Class");
+Clazz_overrideMethod (c$, "setSelectionVisible", 
+function (vis) {
+if (vis != this.selectionVisible) {
+this.selectionVisible = vis;
+if (this.selectionVisible) {
+var h = this.component.getHighlighter ();
+if ((this.dot != this.mark) && (h != null) && (this.selectionTag == null)) {
+var p0 = Math.min (this.dot, this.mark);
+var p1 = Math.max (this.dot, this.mark);
+var p = this.getSelectionPainter ();
+try {
+this.selectionTag = h.addHighlight (p0, p1, p);
+} catch (bl) {
+if (Clazz_exceptionOf (bl, javax.swing.text.BadLocationException)) {
+this.selectionTag = null;
+} else {
+throw bl;
+}
+}
+}} else {
+if (this.selectionTag != null) {
+var h = this.component.getHighlighter ();
+h.removeHighlight (this.selectionTag);
+this.selectionTag = null;
+}}}}, "~B");
+Clazz_overrideMethod (c$, "isSelectionVisible", 
+function () {
+return this.selectionVisible;
+});
+Clazz_defineMethod (c$, "isActive", 
+function () {
+return this.active;
+});
+Clazz_overrideMethod (c$, "isVisible", 
+function () {
+return this.visible;
+});
+Clazz_overrideMethod (c$, "setVisible", 
+function (e) {
+if (this.component != null) {
+this.active = e;
+var mapper = this.component.getUI ();
+if (this.visible != e) {
+this.visible = e;
+try {
+var loc = mapper.modelToView (this.component, this.dot, this.dotBias);
+this.damage (loc);
+} catch (badloc) {
+if (Clazz_exceptionOf (badloc, javax.swing.text.BadLocationException)) {
+} else {
+throw badloc;
+}
+}
+}}}, "~B");
+Clazz_overrideMethod (c$, "setBlinkRate", 
+function (rate) {
+}, "~N");
+Clazz_overrideMethod (c$, "getBlinkRate", 
+function () {
+return 0;
+});
+Clazz_overrideMethod (c$, "getDot", 
+function () {
+return this.dot;
+});
+Clazz_overrideMethod (c$, "getMark", 
+function () {
+return this.mark;
+});
+Clazz_defineMethod (c$, "setDot", 
+function (dot) {
+this.setDot (dot, javax.swing.text.Position.Bias.Forward);
+}, "~N");
+Clazz_defineMethod (c$, "moveDot", 
+function (dot) {
+this.moveDot (dot, javax.swing.text.Position.Bias.Forward);
+}, "~N");
+Clazz_defineMethod (c$, "moveDot", 
+function (dot, dotBias) {
+if (dotBias == null) {
+throw  new IllegalArgumentException ("null bias");
+}if (!this.component.isEnabled ()) {
+this.setDot (dot, dotBias);
+return;
+}if (dot != this.dot) {
+var filter = this.component.getNavigationFilter ();
+if (filter != null) {
+filter.moveDot (this.getFilterBypass (), dot, dotBias);
+} else {
+this.handleMoveDot (dot, dotBias);
+}}}, "~N,javax.swing.text.Position.Bias");
+Clazz_defineMethod (c$, "handleMoveDot", 
+function (dot, dotBias) {
+this.changeCaretPosition (dot, dotBias);
+if (this.selectionVisible) {
+var h = this.component.getHighlighter ();
+if (h != null) {
+var p0 = Math.min (dot, this.mark);
+var p1 = Math.max (dot, this.mark);
+if (p0 == p1) {
+if (this.selectionTag != null) {
+h.removeHighlight (this.selectionTag);
+this.selectionTag = null;
+}} else {
+try {
+if (this.selectionTag != null) {
+h.changeHighlight (this.selectionTag, p0, p1);
+} else {
+var p = this.getSelectionPainter ();
+this.selectionTag = h.addHighlight (p0, p1, p);
+}} catch (e) {
+if (Clazz_exceptionOf (e, javax.swing.text.BadLocationException)) {
+throw  new javax.swing.text.StateInvariantError ("Bad caret position");
+} else {
+throw e;
+}
+}
+}}}}, "~N,javax.swing.text.Position.Bias");
+Clazz_defineMethod (c$, "setDot", 
+function (dot, dotBias) {
+if (dotBias == null) {
+throw  new IllegalArgumentException ("null bias");
+}var filter = this.component.getNavigationFilter ();
+if (filter != null) {
+filter.setDot (this.getFilterBypass (), dot, dotBias);
+} else {
+this.handleSetDot (dot, dotBias);
+}}, "~N,javax.swing.text.Position.Bias");
+Clazz_defineMethod (c$, "handleSetDot", 
+function (dot, dotBias) {
+var doc = this.component.getDocument ();
+if (doc != null) {
+dot = Math.min (dot, doc.getLength ());
+}dot = Math.max (dot, 0);
+if (dot == 0) dotBias = javax.swing.text.Position.Bias.Forward;
+this.mark = dot;
+if (this.dot != dot || this.dotBias !== dotBias || this.selectionTag != null || this.forceCaretPositionChange) {
+this.changeCaretPosition (dot, dotBias);
+}this.markBias = this.dotBias;
+this.markLTR = this.dotLTR;
+var h = this.component.getHighlighter ();
+if ((h != null) && (this.selectionTag != null)) {
+h.removeHighlight (this.selectionTag);
+this.selectionTag = null;
+}}, "~N,javax.swing.text.Position.Bias");
+Clazz_defineMethod (c$, "getDotBias", 
+function () {
+return this.dotBias;
+});
+Clazz_defineMethod (c$, "getMarkBias", 
+function () {
+return this.markBias;
+});
+Clazz_defineMethod (c$, "isDotLeftToRight", 
+function () {
+return this.dotLTR;
+});
+Clazz_defineMethod (c$, "isMarkLeftToRight", 
+function () {
+return this.markLTR;
+});
+Clazz_defineMethod (c$, "isPositionLTR", 
+function (position, bias) {
+var doc = this.component.getDocument ();
+if (Clazz_instanceOf (doc, javax.swing.text.AbstractDocument)) {
+if (bias === javax.swing.text.Position.Bias.Backward && --position < 0) position = 0;
+return (doc).isLeftToRight (position, position);
+}return true;
+}, "~N,javax.swing.text.Position.Bias");
+Clazz_defineMethod (c$, "guessBiasForOffset", 
+function (offset, lastBias, lastLTR) {
+if (lastLTR != this.isPositionLTR (offset, lastBias)) {
+lastBias = javax.swing.text.Position.Bias.Backward;
+} else if (lastBias !== javax.swing.text.Position.Bias.Backward && lastLTR != this.isPositionLTR (offset, javax.swing.text.Position.Bias.Backward)) {
+lastBias = javax.swing.text.Position.Bias.Backward;
+}if (lastBias === javax.swing.text.Position.Bias.Backward && offset > 0) {
+try {
+var s =  new javax.swing.text.Segment ();
+this.component.getDocument ().getText (offset - 1, 1, s);
+if (s.count > 0 && s.array[s.offset] == '\n') {
+lastBias = javax.swing.text.Position.Bias.Forward;
+}} catch (ble) {
+if (Clazz_exceptionOf (ble, javax.swing.text.BadLocationException)) {
+} else {
+throw ble;
+}
+}
+}return lastBias;
+}, "~N,javax.swing.text.Position.Bias,~B");
+Clazz_defineMethod (c$, "changeCaretPosition", 
+function (dot, dotBias) {
+this.repaint ();
+this.dot = dot;
+this.dotBias = dotBias;
+this.dotLTR = this.isPositionLTR (dot, dotBias);
+this.fireStateChanged ();
+this.updateSystemSelection ();
+this.setMagicCaretPosition (null);
+var callRepaintNewCaret = ((Clazz_isClassDefined ("javax.swing.text.DefaultCaret$1") ? 0 : javax.swing.text.DefaultCaret.$DefaultCaret$1$ ()), Clazz_innerTypeInstance (javax.swing.text.DefaultCaret$1, this, null));
+javax.swing.SwingUtilities.invokeLater (callRepaintNewCaret);
+}, "~N,javax.swing.text.Position.Bias");
+Clazz_defineMethod (c$, "repaintNewCaret", 
+function () {
+if (this.component != null) {
+var mapper = this.component.getUI ();
+var doc = this.component.getDocument ();
+if ((mapper != null) && (doc != null)) {
+var newLoc;
+try {
+newLoc = mapper.modelToView (this.component, this.dot, this.dotBias);
+} catch (e) {
+if (Clazz_exceptionOf (e, javax.swing.text.BadLocationException)) {
+newLoc = null;
+} else {
+throw e;
+}
+}
+if (newLoc != null) {
+this.adjustVisibility (newLoc);
+if (this.getMagicCaretPosition () == null) {
+this.setMagicCaretPosition ( new java.awt.Point (newLoc.x, newLoc.y));
+}}this.damage (newLoc);
+}}});
+Clazz_defineMethod (c$, "updateSystemSelection", 
+ function () {
+});
+Clazz_defineMethod (c$, "ensureValidPosition", 
+ function () {
+var length = this.component.getDocument ().getLength ();
+if (this.dot > length || this.mark > length) {
+this.handleSetDot (length, javax.swing.text.Position.Bias.Forward);
+}});
+Clazz_overrideMethod (c$, "setMagicCaretPosition", 
+function (p) {
+this.magicCaretPosition = p;
+}, "java.awt.Point");
+Clazz_overrideMethod (c$, "getMagicCaretPosition", 
+function () {
+return this.magicCaretPosition;
+});
+Clazz_overrideMethod (c$, "equals", 
+function (obj) {
+return (this === obj);
+}, "~O");
+Clazz_overrideMethod (c$, "toString", 
+function () {
+var s = "Dot=(" + this.dot + ", " + this.dotBias + ")";
+s += " Mark=(" + this.mark + ", " + this.markBias + ")";
+return s;
+});
+Clazz_defineMethod (c$, "getFilterBypass", 
+ function () {
+if (this.filterBypass == null) {
+this.filterBypass = Clazz_innerTypeInstance (javax.swing.text.DefaultCaret.DefaultFilterBypass, this, null);
+}return this.filterBypass;
+});
+Clazz_defineMethod (c$, "_contains", 
+ function (X, Y, W, H) {
+var w = this.width;
+var h = this.height;
+if ((w | h | W | H) < 0) {
+return false;
+}var x = this.x;
+var y = this.y;
+if (X < x || Y < y) {
+return false;
+}if (W > 0) {
+w += x;
+W += X;
+if (W <= X) {
+if (w >= x || W > w) return false;
+} else {
+if (w >= x && W > w) return false;
+}} else if ((x + w) < X) {
+return false;
+}if (H > 0) {
+h += y;
+H += Y;
+if (H <= Y) {
+if (h >= y || H > h) return false;
+} else {
+if (h >= y && H > h) return false;
+}} else if ((y + h) < Y) {
+return false;
+}return true;
+}, "~N,~N,~N,~N");
+Clazz_defineMethod (c$, "getCaretWidth", 
+function (height) {
+if (this.aspectRatio > -1) {
+return Clazz_floatToInt (this.aspectRatio * height) + 1;
+}if (this.caretWidth > -1) {
+return this.caretWidth;
+}return 1;
+}, "~N");
+c$.$DefaultCaret$SafeScroller$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_decorateAsClass (function () {
+Clazz_prepareCallback (this, arguments);
+this.r = null;
+Clazz_instantialize (this, arguments);
+}, javax.swing.text.DefaultCaret, "SafeScroller", null, Runnable);
+Clazz_makeConstructor (c$, 
+function (a) {
+this.r = a;
+}, "java.awt.Rectangle");
+Clazz_overrideMethod (c$, "run", 
+function () {
+if (this.b$["javax.swing.text.DefaultCaret"].component != null) {
+this.b$["javax.swing.text.DefaultCaret"].component.scrollRectToVisible (this.r);
+}});
+c$ = Clazz_p0p ();
+};
+c$.$DefaultCaret$Handler$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_decorateAsClass (function () {
+Clazz_prepareCallback (this, arguments);
+Clazz_instantialize (this, arguments);
+}, javax.swing.text.DefaultCaret, "Handler", null, [java.beans.PropertyChangeListener, javax.swing.event.DocumentListener, java.awt.event.ActionListener]);
+Clazz_overrideMethod (c$, "actionPerformed", 
+function (a) {
+if (this.b$["javax.swing.text.DefaultCaret"].width == 0 || this.b$["javax.swing.text.DefaultCaret"].height == 0) {
+if (this.b$["javax.swing.text.DefaultCaret"].component != null) {
+var b = this.b$["javax.swing.text.DefaultCaret"].component.getUI ();
+try {
+var c = b.modelToView (this.b$["javax.swing.text.DefaultCaret"].component, this.b$["javax.swing.text.DefaultCaret"].dot, this.b$["javax.swing.text.DefaultCaret"].dotBias);
+if (c != null && c.width != 0 && c.height != 0) {
+this.b$["javax.swing.text.DefaultCaret"].damage (c);
+}} catch (ble) {
+if (Clazz_exceptionOf (ble, javax.swing.text.BadLocationException)) {
+} else {
+throw ble;
+}
+}
+}}this.b$["javax.swing.text.DefaultCaret"].visible = !this.b$["javax.swing.text.DefaultCaret"].visible;
+this.b$["javax.swing.text.DefaultCaret"].repaint ();
+}, "java.awt.event.ActionEvent");
+Clazz_overrideMethod (c$, "insertUpdate", 
+function (a) {
+if (this.b$["javax.swing.text.DefaultCaret"].getUpdatePolicy () == 1 || (this.b$["javax.swing.text.DefaultCaret"].getUpdatePolicy () == 0 && !javax.swing.SwingUtilities.isEventDispatchThread ())) {
+if ((a.getOffset () <= this.b$["javax.swing.text.DefaultCaret"].dot || a.getOffset () <= this.b$["javax.swing.text.DefaultCaret"].mark) && this.b$["javax.swing.text.DefaultCaret"].selectionTag != null) {
+try {
+this.b$["javax.swing.text.DefaultCaret"].component.getHighlighter ().changeHighlight (this.b$["javax.swing.text.DefaultCaret"].selectionTag, Math.min (this.b$["javax.swing.text.DefaultCaret"].dot, this.b$["javax.swing.text.DefaultCaret"].mark), Math.max (this.b$["javax.swing.text.DefaultCaret"].dot, this.b$["javax.swing.text.DefaultCaret"].mark));
+} catch (e1) {
+if (Clazz_exceptionOf (e1, javax.swing.text.BadLocationException)) {
+e1.printStackTrace ();
+} else {
+throw e1;
+}
+}
+}return;
+}var b = 0;
+var c = a.getOffset ();
+var d = a.getLength ();
+var e = this.b$["javax.swing.text.DefaultCaret"].dot;
+var f = 0;
+if (Clazz_instanceOf (a, javax.swing.text.AbstractDocument.UndoRedoDocumentEvent)) {
+this.b$["javax.swing.text.DefaultCaret"].setDot (c + d);
+return;
+}if (e >= c) {
+e += d;
+f |= 1;
+}var g = this.b$["javax.swing.text.DefaultCaret"].mark;
+if (g >= c) {
+g += d;
+f |= 2;
+}if (f != 0) {
+var h = this.b$["javax.swing.text.DefaultCaret"].dotBias;
+if (this.b$["javax.swing.text.DefaultCaret"].dot == c) {
+var i = this.b$["javax.swing.text.DefaultCaret"].component.getDocument ();
+var j;
+try {
+var k =  new javax.swing.text.Segment ();
+i.getText (e - 1, 1, k);
+j = (k.count > 0 && k.array[k.offset] == '\n');
+} catch (ble) {
+if (Clazz_exceptionOf (ble, javax.swing.text.BadLocationException)) {
+j = false;
+} else {
+throw ble;
+}
+}
+if (j) {
+h = javax.swing.text.Position.Bias.Forward;
+} else {
+h = javax.swing.text.Position.Bias.Backward;
+}}if (g == e) {
+this.b$["javax.swing.text.DefaultCaret"].setDot (e, h);
+this.b$["javax.swing.text.DefaultCaret"].ensureValidPosition ();
+} else {
+this.b$["javax.swing.text.DefaultCaret"].setDot (g, this.b$["javax.swing.text.DefaultCaret"].markBias);
+if (this.b$["javax.swing.text.DefaultCaret"].getDot () == g) {
+this.b$["javax.swing.text.DefaultCaret"].moveDot (e, h);
+}this.b$["javax.swing.text.DefaultCaret"].ensureValidPosition ();
+}}}, "javax.swing.event.DocumentEvent");
+Clazz_overrideMethod (c$, "removeUpdate", 
+function (a) {
+if (this.b$["javax.swing.text.DefaultCaret"].getUpdatePolicy () == 1 || (this.b$["javax.swing.text.DefaultCaret"].getUpdatePolicy () == 0 && !javax.swing.SwingUtilities.isEventDispatchThread ())) {
+var b = this.b$["javax.swing.text.DefaultCaret"].component.getDocument ().getLength ();
+this.b$["javax.swing.text.DefaultCaret"].dot = Math.min (this.b$["javax.swing.text.DefaultCaret"].dot, b);
+this.b$["javax.swing.text.DefaultCaret"].mark = Math.min (this.b$["javax.swing.text.DefaultCaret"].mark, b);
+if ((a.getOffset () < this.b$["javax.swing.text.DefaultCaret"].dot || a.getOffset () < this.b$["javax.swing.text.DefaultCaret"].mark) && this.b$["javax.swing.text.DefaultCaret"].selectionTag != null) {
+try {
+this.b$["javax.swing.text.DefaultCaret"].component.getHighlighter ().changeHighlight (this.b$["javax.swing.text.DefaultCaret"].selectionTag, Math.min (this.b$["javax.swing.text.DefaultCaret"].dot, this.b$["javax.swing.text.DefaultCaret"].mark), Math.max (this.b$["javax.swing.text.DefaultCaret"].dot, this.b$["javax.swing.text.DefaultCaret"].mark));
+} catch (e1) {
+if (Clazz_exceptionOf (e1, javax.swing.text.BadLocationException)) {
+e1.printStackTrace ();
+} else {
+throw e1;
+}
+}
+}return;
+}var b = a.getOffset ();
+var c = b + a.getLength ();
+var d = 0;
+var e = this.b$["javax.swing.text.DefaultCaret"].dot;
+var f = false;
+var g = this.b$["javax.swing.text.DefaultCaret"].mark;
+var h = false;
+if (Clazz_instanceOf (a, javax.swing.text.AbstractDocument.UndoRedoDocumentEvent)) {
+this.b$["javax.swing.text.DefaultCaret"].setDot (b);
+return;
+}if (e >= c) {
+e -= (c - b);
+if (e == c) {
+f = true;
+}} else if (e >= b) {
+e = b;
+f = true;
+}if (g >= c) {
+g -= (c - b);
+if (g == c) {
+h = true;
+}} else if (g >= b) {
+g = b;
+h = true;
+}if (g == e) {
+this.b$["javax.swing.text.DefaultCaret"].forceCaretPositionChange = true;
+try {
+this.b$["javax.swing.text.DefaultCaret"].setDot (e, this.b$["javax.swing.text.DefaultCaret"].guessBiasForOffset (e, this.b$["javax.swing.text.DefaultCaret"].dotBias, this.b$["javax.swing.text.DefaultCaret"].dotLTR));
+} finally {
+this.b$["javax.swing.text.DefaultCaret"].forceCaretPositionChange = false;
+}
+this.b$["javax.swing.text.DefaultCaret"].ensureValidPosition ();
+} else {
+var i = this.b$["javax.swing.text.DefaultCaret"].dotBias;
+var j = this.b$["javax.swing.text.DefaultCaret"].markBias;
+if (f) {
+i = this.b$["javax.swing.text.DefaultCaret"].guessBiasForOffset (e, i, this.b$["javax.swing.text.DefaultCaret"].dotLTR);
+}if (h) {
+j = this.b$["javax.swing.text.DefaultCaret"].guessBiasForOffset (this.b$["javax.swing.text.DefaultCaret"].mark, j, this.b$["javax.swing.text.DefaultCaret"].markLTR);
+}this.b$["javax.swing.text.DefaultCaret"].setDot (g, j);
+if (this.b$["javax.swing.text.DefaultCaret"].getDot () == g) {
+this.b$["javax.swing.text.DefaultCaret"].moveDot (e, i);
+}this.b$["javax.swing.text.DefaultCaret"].ensureValidPosition ();
+}}, "javax.swing.event.DocumentEvent");
+Clazz_overrideMethod (c$, "changedUpdate", 
+function (a) {
+if (this.b$["javax.swing.text.DefaultCaret"].getUpdatePolicy () == 1 || (this.b$["javax.swing.text.DefaultCaret"].getUpdatePolicy () == 0 && !javax.swing.SwingUtilities.isEventDispatchThread ())) {
+return;
+}if (Clazz_instanceOf (a, javax.swing.text.AbstractDocument.UndoRedoDocumentEvent)) {
+this.b$["javax.swing.text.DefaultCaret"].setDot (a.getOffset () + a.getLength ());
+}}, "javax.swing.event.DocumentEvent");
+Clazz_overrideMethod (c$, "propertyChange", 
+function (a) {
+var b = a.getOldValue ();
+var c = a.getNewValue ();
+if ((Clazz_instanceOf (b, javax.swing.text.Document)) || (Clazz_instanceOf (c, javax.swing.text.Document))) {
+this.b$["javax.swing.text.DefaultCaret"].setDot (0);
+if (b != null) {
+(b).removeDocumentListener (this);
+}if (c != null) {
+(c).addDocumentListener (this);
+}} else if ("enabled".equals (a.getPropertyName ())) {
+var d = a.getNewValue ();
+if (this.b$["javax.swing.text.DefaultCaret"].component.isFocusOwner ()) {
+if (d === Boolean.TRUE) {
+if (this.b$["javax.swing.text.DefaultCaret"].component.isEditable ()) {
+this.b$["javax.swing.text.DefaultCaret"].setVisible (true);
+}this.b$["javax.swing.text.DefaultCaret"].setSelectionVisible (true);
+} else {
+this.b$["javax.swing.text.DefaultCaret"].setVisible (false);
+this.b$["javax.swing.text.DefaultCaret"].setSelectionVisible (false);
+}}} else if ("caretWidth".equals (a.getPropertyName ())) {
+var d = a.getNewValue ();
+if (d != null) {
+this.b$["javax.swing.text.DefaultCaret"].caretWidth = d.intValue ();
+} else {
+this.b$["javax.swing.text.DefaultCaret"].caretWidth = -1;
+}this.b$["javax.swing.text.DefaultCaret"].repaint ();
+} else if ("caretAspectRatio".equals (a.getPropertyName ())) {
+var d = a.getNewValue ();
+if (d != null) {
+this.b$["javax.swing.text.DefaultCaret"].aspectRatio = d.floatValue ();
+} else {
+this.b$["javax.swing.text.DefaultCaret"].aspectRatio = -1;
+}this.b$["javax.swing.text.DefaultCaret"].repaint ();
+}}, "java.beans.PropertyChangeEvent");
+c$ = Clazz_p0p ();
+};
+c$.$DefaultCaret$DefaultFilterBypass$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_decorateAsClass (function () {
+Clazz_prepareCallback (this, arguments);
+Clazz_instantialize (this, arguments);
+}, javax.swing.text.DefaultCaret, "DefaultFilterBypass", javax.swing.text.NavigationFilter.FilterBypass);
+Clazz_overrideMethod (c$, "getCaret", 
+function () {
+return this.b$["javax.swing.text.DefaultCaret"];
+});
+Clazz_overrideMethod (c$, "setDot", 
+function (a, b) {
+this.b$["javax.swing.text.DefaultCaret"].handleSetDot (a, b);
+}, "~N,javax.swing.text.Position.Bias");
+Clazz_overrideMethod (c$, "moveDot", 
+function (a, b) {
+this.b$["javax.swing.text.DefaultCaret"].handleMoveDot (a, b);
+}, "~N,javax.swing.text.Position.Bias");
+c$ = Clazz_p0p ();
+};
+c$.$DefaultCaret$1$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_declareAnonymous (javax.swing.text, "DefaultCaret$1", null, Runnable);
+Clazz_overrideMethod (c$, "run", 
+function () {
+this.b$["javax.swing.text.DefaultCaret"].repaintNewCaret ();
+});
+c$ = Clazz_p0p ();
+};
+Clazz_defineStatics (c$,
+"UPDATE_WHEN_ON_EDT", 0,
+"NEVER_UPDATE", 1,
+"ALWAYS_UPDATE", 2,
+"$selectWord", null,
+"selectLine", null);
+});
+Clazz_declarePackage ("javax.swing.text");
+Clazz_declareInterface (javax.swing.text, "Caret");
+Clazz_declarePackage ("javax.swing.text");
+c$ = Clazz_declareType (javax.swing.text, "NavigationFilter");
+Clazz_defineMethod (c$, "setDot", 
+function (fb, dot, bias) {
+fb.setDot (dot, bias);
+}, "javax.swing.text.NavigationFilter.FilterBypass,~N,javax.swing.text.Position.Bias");
+Clazz_defineMethod (c$, "moveDot", 
+function (fb, dot, bias) {
+fb.moveDot (dot, bias);
+}, "javax.swing.text.NavigationFilter.FilterBypass,~N,javax.swing.text.Position.Bias");
+Clazz_defineMethod (c$, "getNextVisualPositionFrom", 
+function (text, pos, bias, direction, biasRet) {
+return text.getUI ().getNextVisualPositionFrom (text, pos, bias, direction, biasRet);
+}, "javax.swing.text.JTextComponent,~N,javax.swing.text.Position.Bias,~N,~A");
+Clazz_pu$h(self.c$);
+c$ = Clazz_declareType (javax.swing.text.NavigationFilter, "FilterBypass");
+c$ = Clazz_p0p ();
+Clazz_declarePackage ("javax.swing.text");
+Clazz_load (["javax.swing.event.DocumentEvent", "javax.swing.text.DocumentFilter", "$.Element", "$.JSMinimalAbstractDocument", "$.MutableAttributeSet", "javax.swing.tree.TreeNode", "javax.swing.undo.AbstractUndoableEdit", "$.CompoundEdit", "javax.swing.event.EventListenerList"], "javax.swing.text.AbstractDocument", ["java.lang.Boolean", "java.util.Hashtable", "$.Vector", "javax.swing.UIManager", "javax.swing.event.DocumentEvent.ElementChange", "javax.swing.event.DocumentListener", "$.UndoableEditEvent", "$.UndoableEditListener", "javax.swing.text.BadLocationException", "$.SegmentCache", "$.StateInvariantError", "$.StyleConstants", "$.StyleContext", "$.Utilities"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.documentProperties = null;
+this.listenerList = null;
+this.data = null;
+this.context = null;
+this.bidiRoot = null;
+this.documentFilter = null;
+this.filterBypass = null;
+if (!Clazz_isClassDefined ("javax.swing.text.AbstractDocument.AbstractElement")) {
+javax.swing.text.AbstractDocument.$AbstractDocument$AbstractElement$ ();
+}
+if (!Clazz_isClassDefined ("javax.swing.text.AbstractDocument.BranchElement")) {
+javax.swing.text.AbstractDocument.$AbstractDocument$BranchElement$ ();
+}
+if (!Clazz_isClassDefined ("javax.swing.text.AbstractDocument.LeafElement")) {
+javax.swing.text.AbstractDocument.$AbstractDocument$LeafElement$ ();
+}
+if (!Clazz_isClassDefined ("javax.swing.text.AbstractDocument.DefaultDocumentEvent")) {
+javax.swing.text.AbstractDocument.$AbstractDocument$DefaultDocumentEvent$ ();
+}
+if (!Clazz_isClassDefined ("javax.swing.text.AbstractDocument.UndoRedoDocumentEvent")) {
+javax.swing.text.AbstractDocument.$AbstractDocument$UndoRedoDocumentEvent$ ();
+}
+if (!Clazz_isClassDefined ("javax.swing.text.AbstractDocument.DefaultFilterBypass")) {
+javax.swing.text.AbstractDocument.$AbstractDocument$DefaultFilterBypass$ ();
+}
+Clazz_instantialize (this, arguments);
+}, javax.swing.text, "AbstractDocument", null, javax.swing.text.JSMinimalAbstractDocument);
+Clazz_prepareFields (c$, function () {
+this.listenerList =  new javax.swing.event.EventListenerList ();
+});
+Clazz_makeConstructor (c$, 
+function (data) {
+this.construct (data, javax.swing.text.StyleContext.getDefaultStyleContext ());
+}, "javax.swing.text.AbstractDocument.Content");
+Clazz_makeConstructor (c$, 
+function (data, context) {
+this.data = data;
+this.context = context;
+}, "javax.swing.text.AbstractDocument.Content,javax.swing.text.AbstractDocument.AttributeContext");
+Clazz_defineMethod (c$, "getDocumentProperties", 
+function () {
+if (this.documentProperties == null) {
+this.documentProperties =  new java.util.Hashtable (2);
+}return this.documentProperties;
+});
+Clazz_defineMethod (c$, "setDocumentProperties", 
+function (x) {
+this.documentProperties = x;
+}, "java.util.Dictionary");
+Clazz_defineMethod (c$, "fireInsertUpdate", 
+function (e) {
+try {
+var listeners = this.listenerList.getListenerList ();
+for (var i = listeners.length - 2; i >= 0; i -= 2) {
+if (listeners[i] === javax.swing.event.DocumentListener) {
+(listeners[i + 1]).insertUpdate (e);
+}}
+} finally {
+}
+}, "javax.swing.event.DocumentEvent");
+Clazz_defineMethod (c$, "fireChangedUpdate", 
+function (e) {
+try {
+var listeners = this.listenerList.getListenerList ();
+for (var i = listeners.length - 2; i >= 0; i -= 2) {
+if (listeners[i] === javax.swing.event.DocumentListener) {
+(listeners[i + 1]).changedUpdate (e);
+}}
+} finally {
+}
+}, "javax.swing.event.DocumentEvent");
+Clazz_defineMethod (c$, "fireRemoveUpdate", 
+function (e) {
+try {
+var listeners = this.listenerList.getListenerList ();
+for (var i = listeners.length - 2; i >= 0; i -= 2) {
+if (listeners[i] === javax.swing.event.DocumentListener) {
+(listeners[i + 1]).removeUpdate (e);
+}}
+} finally {
+}
+}, "javax.swing.event.DocumentEvent");
+Clazz_defineMethod (c$, "fireUndoableEditUpdate", 
+function (e) {
+var listeners = this.listenerList.getListenerList ();
+for (var i = listeners.length - 2; i >= 0; i -= 2) {
+if (listeners[i] === javax.swing.event.UndoableEditListener) {
+(listeners[i + 1]).undoableEditHappened (e);
+}}
+}, "javax.swing.event.UndoableEditEvent");
+Clazz_defineMethod (c$, "getListeners", 
+function (listenerType) {
+return this.listenerList.getListeners (listenerType);
+}, "Class");
+Clazz_overrideMethod (c$, "getAsynchronousLoadPriority", 
+function () {
+var loadPriority = this.getProperty ("load priority");
+if (loadPriority != null) {
+return loadPriority.intValue ();
+}return -1;
+});
+Clazz_defineMethod (c$, "setAsynchronousLoadPriority", 
+function (p) {
+var loadPriority = (p >= 0) ?  new Integer (p) : null;
+this.putProperty ("load priority", loadPriority);
+}, "~N");
+Clazz_overrideMethod (c$, "setDocumentFilter", 
+function (filter) {
+this.documentFilter = filter;
+}, "javax.swing.text.DocumentFilter");
+Clazz_defineMethod (c$, "getDocumentFilter", 
+function () {
+return this.documentFilter;
+});
+Clazz_overrideMethod (c$, "getLength", 
+function () {
+return this.data.length () - 1;
+});
+Clazz_overrideMethod (c$, "addDocumentListener", 
+function (listener) {
+this.listenerList.add (javax.swing.event.DocumentListener, listener);
+}, "javax.swing.event.DocumentListener");
+Clazz_overrideMethod (c$, "removeDocumentListener", 
+function (listener) {
+this.listenerList.remove (javax.swing.event.DocumentListener, listener);
+}, "javax.swing.event.DocumentListener");
+Clazz_defineMethod (c$, "getDocumentListeners", 
+function () {
+return this.listenerList.getListeners (javax.swing.event.DocumentListener);
+});
+Clazz_overrideMethod (c$, "addUndoableEditListener", 
+function (listener) {
+this.listenerList.add (javax.swing.event.UndoableEditListener, listener);
+}, "javax.swing.event.UndoableEditListener");
+Clazz_overrideMethod (c$, "removeUndoableEditListener", 
+function (listener) {
+this.listenerList.remove (javax.swing.event.UndoableEditListener, listener);
+}, "javax.swing.event.UndoableEditListener");
+Clazz_defineMethod (c$, "getUndoableEditListeners", 
+function () {
+return this.listenerList.getListeners (javax.swing.event.UndoableEditListener);
+});
+Clazz_overrideMethod (c$, "getProperty", 
+function (key) {
+return this.getDocumentProperties ().get (key);
+}, "~O");
+Clazz_overrideMethod (c$, "putProperty", 
+function (key, value) {
+if (value != null) {
+this.getDocumentProperties ().put (key, value);
+} else {
+this.getDocumentProperties ().remove (key);
+}}, "~O,~O");
+Clazz_overrideMethod (c$, "remove", 
+function (offs, len) {
+var filter = this.getDocumentFilter ();
+this.writeLock ();
+try {
+if (filter != null) {
+filter.remove (this.getFilterBypass (), offs, len);
+} else {
+this.handleRemove (offs, len);
+}} finally {
+this.writeUnlock ();
+}
+}, "~N,~N");
+Clazz_defineMethod (c$, "handleRemove", 
+function (offs, len) {
+if (len > 0) {
+if (offs < 0 || (offs + len) > this.getLength ()) {
+throw  new javax.swing.text.BadLocationException ("Invalid remove", this.getLength () + 1);
+}var chng = Clazz_innerTypeInstance (javax.swing.text.AbstractDocument.DefaultDocumentEvent, this, null, offs, len, javax.swing.event.DocumentEvent.EventType.REMOVE);
+var isComposedTextElement = false;
+isComposedTextElement = javax.swing.text.Utilities.isComposedTextElement (this, offs);
+this.removeUpdate (chng);
+var u = this.data.remove (offs, len);
+if (u != null) {
+chng.addEdit (u);
+}this.postRemoveUpdate (chng);
+chng.end ();
+this.fireRemoveUpdate (chng);
+if ((u != null) && !isComposedTextElement) {
+this.fireUndoableEditUpdate ( new javax.swing.event.UndoableEditEvent (this, chng));
+}}}, "~N,~N");
+Clazz_overrideMethod (c$, "replace", 
+function (offset, length, text, attrs) {
+if (length == 0 && (text == null || text.length == 0)) {
+return;
+}var filter = this.getDocumentFilter ();
+this.writeLock ();
+try {
+if (filter != null) {
+filter.replace (this.getFilterBypass (), offset, length, text, attrs);
+} else {
+if (length > 0) {
+this.remove (offset, length);
+}if (text != null && text.length > 0) {
+this.insertString (offset, text, attrs);
+}}} finally {
+this.writeUnlock ();
+}
+}, "~N,~N,~S,javax.swing.text.AttributeSet");
+Clazz_overrideMethod (c$, "insertString", 
+function (offs, str, a) {
+if ((str == null) || (str.length == 0)) {
+return;
+}var filter = this.getDocumentFilter ();
+this.writeLock ();
+try {
+if (filter != null) {
+filter.insertString (this.getFilterBypass (), offs, str, a);
+} else {
+this.handleInsertString (offs, str, a);
+}} finally {
+this.writeUnlock ();
+}
+}, "~N,~S,javax.swing.text.AttributeSet");
+Clazz_defineMethod (c$, "handleInsertString", 
+function (offs, str, a) {
+if ((str == null) || (str.length == 0)) {
+return;
+}var u = this.data.insertString (offs, str);
+var e = Clazz_innerTypeInstance (javax.swing.text.AbstractDocument.DefaultDocumentEvent, this, null, offs, str.length, javax.swing.event.DocumentEvent.EventType.INSERT);
+if (u != null) {
+e.addEdit (u);
+}if (this.getProperty ("i18n").equals (Boolean.FALSE)) {
+}this.insertUpdate (e, a);
+e.end ();
+this.fireInsertUpdate (e);
+if (u != null && (a == null || !a.isDefined (javax.swing.text.StyleConstants.ComposedTextAttribute))) {
+this.fireUndoableEditUpdate ( new javax.swing.event.UndoableEditEvent (this, e));
+}}, "~N,~S,javax.swing.text.AttributeSet");
+Clazz_defineMethod (c$, "getText", 
+function (offset, length) {
+if (length < 0) {
+throw  new javax.swing.text.BadLocationException ("Length must be positive", length);
+}var str = this.data.getString (offset, length);
+return str;
+}, "~N,~N");
+Clazz_defineMethod (c$, "getText", 
+function (offset, length, txt) {
+if (length < 0) {
+throw  new javax.swing.text.BadLocationException ("Length must be positive", length);
+}this.data.getChars (offset, length, txt);
+}, "~N,~N,javax.swing.text.Segment");
+Clazz_overrideMethod (c$, "createPosition", 
+function (offs) {
+return this.data.createPosition (offs);
+}, "~N");
+Clazz_overrideMethod (c$, "getStartPosition", 
+function () {
+var p;
+try {
+p = this.createPosition (0);
+} catch (bl) {
+if (Clazz_exceptionOf (bl, javax.swing.text.BadLocationException)) {
+p = null;
+} else {
+throw bl;
+}
+}
+return p;
+});
+Clazz_overrideMethod (c$, "getEndPosition", 
+function () {
+var p;
+try {
+p = this.createPosition (this.data.length ());
+} catch (bl) {
+if (Clazz_exceptionOf (bl, javax.swing.text.BadLocationException)) {
+p = null;
+} else {
+throw bl;
+}
+}
+return p;
+});
+Clazz_overrideMethod (c$, "getRootElements", 
+function () {
+var elems =  new Array (2);
+elems[0] = this.getDefaultRootElement ();
+elems[1] = this.getBidiRootElement ();
+return elems;
+});
+Clazz_defineMethod (c$, "getFilterBypass", 
+ function () {
+if (this.filterBypass == null) {
+this.filterBypass = Clazz_innerTypeInstance (javax.swing.text.AbstractDocument.DefaultFilterBypass, this, null);
+}return this.filterBypass;
+});
+Clazz_defineMethod (c$, "getBidiRootElement", 
+function () {
+return this.bidiRoot;
+});
+Clazz_defineMethod (c$, "isLeftToRight", 
+function (p0, p1) {
+if (!this.getProperty ("i18n").equals (Boolean.TRUE)) {
+return true;
+}var bidiRoot = this.getBidiRootElement ();
+var index = bidiRoot.getElementIndex (p0);
+var bidiElem = bidiRoot.getElement (index);
+if (bidiElem.getEndOffset () >= p1) {
+var bidiAttrs = bidiElem.getAttributes ();
+return ((javax.swing.text.StyleConstants.getBidiLevel (bidiAttrs) % 2) == 0);
+}return true;
+}, "~N,~N");
+Clazz_defineMethod (c$, "getAttributeContext", 
+function () {
+return this.context;
+});
+Clazz_defineMethod (c$, "insertUpdate", 
+function (chng, attr) {
+if (chng.type === javax.swing.event.DocumentEvent.EventType.INSERT && chng.getLength () > 0 && !Boolean.TRUE.equals (this.getProperty (javax.swing.text.AbstractDocument.MultiByteProperty))) {
+var segment = javax.swing.text.SegmentCache.getSharedSegment ();
+try {
+this.getText (chng.getOffset (), chng.getLength (), segment);
+segment.first ();
+do {
+if ((segment.current ()).charCodeAt (0) > 255) {
+this.putProperty (javax.swing.text.AbstractDocument.MultiByteProperty, Boolean.TRUE);
+break;
+}} while (segment.next () != '\uffff');
+} catch (ble) {
+if (Clazz_exceptionOf (ble, javax.swing.text.BadLocationException)) {
+} else {
+throw ble;
+}
+}
+javax.swing.text.SegmentCache.releaseSharedSegment (segment);
+}}, "javax.swing.text.AbstractDocument.DefaultDocumentEvent,javax.swing.text.AttributeSet");
+Clazz_defineMethod (c$, "removeUpdate", 
+function (chng) {
+}, "javax.swing.text.AbstractDocument.DefaultDocumentEvent");
+Clazz_defineMethod (c$, "postRemoveUpdate", 
+function (chng) {
+}, "javax.swing.text.AbstractDocument.DefaultDocumentEvent");
+Clazz_defineMethod (c$, "getContent", 
+function () {
+return this.data;
+});
+Clazz_defineMethod (c$, "createLeafElement", 
+function (parent, a, p0, p1) {
+return Clazz_innerTypeInstance (javax.swing.text.AbstractDocument.LeafElement, this, null, parent, a, p0, p1);
+}, "javax.swing.text.Element,javax.swing.text.AttributeSet,~N,~N");
+Clazz_defineMethod (c$, "createBranchElement", 
+function (parent, a) {
+return Clazz_innerTypeInstance (javax.swing.text.AbstractDocument.BranchElement, this, null, parent, a);
+}, "javax.swing.text.Element,javax.swing.text.AttributeSet");
+Clazz_defineMethod (c$, "writeLock", 
+function () {
+});
+Clazz_defineMethod (c$, "writeUnlock", 
+function () {
+});
+Clazz_defineMethod (c$, "readLock", 
+function () {
+});
+Clazz_defineMethod (c$, "readUnlock", 
+function () {
+});
+c$.$AbstractDocument$AbstractElement$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_decorateAsClass (function () {
+Clazz_prepareCallback (this, arguments);
+this.parent = null;
+this.attributes = null;
+Clazz_instantialize (this, arguments);
+}, javax.swing.text.AbstractDocument, "AbstractElement", null, [javax.swing.text.Element, javax.swing.text.MutableAttributeSet, javax.swing.tree.TreeNode]);
+Clazz_makeConstructor (c$, 
+function (a, b) {
+this.parent = a;
+this.attributes = this.b$["javax.swing.text.AbstractDocument"].getAttributeContext ().getEmptySet ();
+if (b != null) {
+this.addAttributes (b);
+}}, "javax.swing.text.Element,javax.swing.text.AttributeSet");
+Clazz_defineMethod (c$, "getAttributeCount", 
+function () {
+return this.attributes.getAttributeCount ();
+});
+Clazz_defineMethod (c$, "isDefined", 
+function (a) {
+return this.attributes.isDefined (a);
+}, "~O");
+Clazz_defineMethod (c$, "isEqual", 
+function (a) {
+return this.attributes.isEqual (a);
+}, "javax.swing.text.AttributeSet");
+Clazz_defineMethod (c$, "copyAttributes", 
+function () {
+return this.attributes.copyAttributes ();
+});
+Clazz_defineMethod (c$, "getAttribute", 
+function (a) {
+var b = this.attributes.getAttribute (a);
+if (b == null) {
+var c = (this.parent != null) ? this.parent.getAttributes () : null;
+if (c != null) {
+b = c.getAttribute (a);
+}}return b;
+}, "~O");
+Clazz_defineMethod (c$, "getAttributeNames", 
+function () {
+return this.attributes.getAttributeNames ();
+});
+Clazz_defineMethod (c$, "containsAttribute", 
+function (a, b) {
+return this.attributes.containsAttribute (a, b);
+}, "~O,~O");
+Clazz_defineMethod (c$, "containsAttributes", 
+function (a) {
+return this.attributes.containsAttributes (a);
+}, "javax.swing.text.AttributeSet");
+Clazz_defineMethod (c$, "getResolveParent", 
+function () {
+var a = this.attributes.getResolveParent ();
+if ((a == null) && (this.parent != null)) {
+a = this.parent.getAttributes ();
+}return a;
+});
+Clazz_overrideMethod (c$, "addAttribute", 
+function (a, b) {
+this.checkForIllegalCast ();
+var c = this.b$["javax.swing.text.AbstractDocument"].getAttributeContext ();
+this.attributes = c.addAttribute (this.attributes, a, b);
+}, "~O,~O");
+Clazz_overrideMethod (c$, "addAttributes", 
+function (a) {
+this.checkForIllegalCast ();
+var b = this.b$["javax.swing.text.AbstractDocument"].getAttributeContext ();
+this.attributes = b.addAttributes (this.attributes, a);
+}, "javax.swing.text.AttributeSet");
+Clazz_overrideMethod (c$, "removeAttribute", 
+function (a) {
+this.checkForIllegalCast ();
+var b = this.b$["javax.swing.text.AbstractDocument"].getAttributeContext ();
+this.attributes = b.removeAttribute (this.attributes, a);
+}, "~O");
+Clazz_defineMethod (c$, "removeAttributes", 
+function (a) {
+this.checkForIllegalCast ();
+var b = this.b$["javax.swing.text.AbstractDocument"].getAttributeContext ();
+this.attributes = b.removeAttributes (this.attributes, a);
+}, "java.util.Enumeration");
+Clazz_defineMethod (c$, "removeAttributes", 
+function (a) {
+this.checkForIllegalCast ();
+var b = this.b$["javax.swing.text.AbstractDocument"].getAttributeContext ();
+if (a === this) {
+this.attributes = b.getEmptySet ();
+} else {
+this.attributes = b.removeAttributes (this.attributes, a);
+}}, "javax.swing.text.AttributeSet");
+Clazz_overrideMethod (c$, "setResolveParent", 
+function (a) {
+this.checkForIllegalCast ();
+var b = this.b$["javax.swing.text.AbstractDocument"].getAttributeContext ();
+if (a != null) {
+this.attributes = b.addAttribute (this.attributes, javax.swing.text.StyleConstants.ResolveAttribute, a);
+} else {
+this.attributes = b.removeAttribute (this.attributes, javax.swing.text.StyleConstants.ResolveAttribute);
+}}, "javax.swing.text.AttributeSet");
+Clazz_defineMethod (c$, "checkForIllegalCast", 
+ function () {
+});
+Clazz_overrideMethod (c$, "getDocument", 
+function () {
+return this.b$["javax.swing.text.AbstractDocument"];
+});
+Clazz_overrideMethod (c$, "getParentElement", 
+function () {
+return this.parent;
+});
+Clazz_defineMethod (c$, "getAttributes", 
+function () {
+return this;
+});
+Clazz_overrideMethod (c$, "getName", 
+function () {
+if (this.attributes.isDefined ("$ename")) {
+return this.attributes.getAttribute ("$ename");
+}return null;
+});
+Clazz_overrideMethod (c$, "getChildAt", 
+function (a) {
+return this.getElement (a);
+}, "~N");
+Clazz_overrideMethod (c$, "getChildCount", 
+function () {
+return this.getElementCount ();
+});
+Clazz_overrideMethod (c$, "getParent", 
+function () {
+return this.getParentElement ();
+});
+Clazz_overrideMethod (c$, "getIndex", 
+function (a) {
+for (var b = this.getChildCount () - 1; b >= 0; b--) if (this.getChildAt (b) === a) return b;
+
+return -1;
+}, "javax.swing.tree.TreeNode");
+c$ = Clazz_p0p ();
+};
+c$.$AbstractDocument$BranchElement$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_decorateAsClass (function () {
+Clazz_prepareCallback (this, arguments);
+this.$children = null;
+this.nchildren = 0;
+this.lastIndex = 0;
+Clazz_instantialize (this, arguments);
+}, javax.swing.text.AbstractDocument, "BranchElement", javax.swing.text.AbstractDocument.AbstractElement, null, Clazz_innerTypeInstance (javax.swing.text.AbstractDocument.AbstractElement, this, null, Clazz_inheritArgs));
+Clazz_makeConstructor (c$, 
+function (a, b) {
+Clazz_superConstructor (this, javax.swing.text.AbstractDocument.BranchElement, [a, b]);
+this.$children =  new Array (1);
+this.nchildren = 0;
+this.lastIndex = -1;
+}, "javax.swing.text.Element,javax.swing.text.AttributeSet");
+Clazz_defineMethod (c$, "positionToElement", 
+function (a) {
+var b = this.getElementIndex (a);
+var c = this.$children[b];
+var d = c.getStartOffset ();
+var e = c.getEndOffset ();
+if ((a >= d) && (a < e)) {
+return c;
+}return null;
+}, "~N");
+Clazz_defineMethod (c$, "replace", 
+function (a, b, c) {
+var d = c.length - b;
+var e = a + b;
+var f = this.nchildren - e;
+var g = e + d;
+if ((this.nchildren + d) >= this.$children.length) {
+var h = Math.max (2 * this.$children.length, this.nchildren + d);
+var i =  new Array (h);
+System.arraycopy (this.$children, 0, i, 0, a);
+System.arraycopy (c, 0, i, a, c.length);
+System.arraycopy (this.$children, e, i, g, f);
+this.$children = i;
+} else {
+System.arraycopy (this.$children, e, this.$children, g, f);
+System.arraycopy (c, 0, this.$children, a, c.length);
+}this.nchildren = this.nchildren + d;
+}, "~N,~N,~A");
+Clazz_overrideMethod (c$, "toString", 
+function () {
+return "BranchElement(" + this.getName () + ") " + this.getStartOffset () + "," + this.getEndOffset () + "\n";
+});
+Clazz_defineMethod (c$, "getName", 
+function () {
+var a = Clazz_superCall (this, javax.swing.text.AbstractDocument.BranchElement, "getName", []);
+if (a == null) {
+a = "paragraph";
+}return a;
+});
+Clazz_defineMethod (c$, "getStartOffset", 
+function () {
+return this.$children[0].getStartOffset ();
+});
+Clazz_overrideMethod (c$, "getEndOffset", 
+function () {
+var a = (this.nchildren > 0) ? this.$children[this.nchildren - 1] : this.$children[0];
+return a.getEndOffset ();
+});
+Clazz_overrideMethod (c$, "getElement", 
+function (a) {
+if (a < this.nchildren) {
+return this.$children[a];
+}return null;
+}, "~N");
+Clazz_overrideMethod (c$, "getElementCount", 
+function () {
+return this.nchildren;
+});
+Clazz_overrideMethod (c$, "getElementIndex", 
+function (a) {
+var b;
+var c = 0;
+var d = this.nchildren - 1;
+var e = 0;
+var f = this.getStartOffset ();
+var g;
+if (this.nchildren == 0) {
+return 0;
+}if (a >= this.getEndOffset ()) {
+return this.nchildren - 1;
+}if ((this.lastIndex >= c) && (this.lastIndex <= d)) {
+var h = this.$children[this.lastIndex];
+f = h.getStartOffset ();
+g = h.getEndOffset ();
+if ((a >= f) && (a < g)) {
+return this.lastIndex;
+}if (a < f) {
+d = this.lastIndex;
+} else {
+c = this.lastIndex;
+}}while (c <= d) {
+e = c + (Clazz_doubleToInt ((d - c) / 2));
+var h = this.$children[e];
+f = h.getStartOffset ();
+g = h.getEndOffset ();
+if ((a >= f) && (a < g)) {
+b = e;
+this.lastIndex = b;
+return b;
+} else if (a < f) {
+d = e - 1;
+} else {
+c = e + 1;
+}}
+if (a < f) {
+b = e;
+} else {
+b = e + 1;
+}this.lastIndex = b;
+return b;
+}, "~N");
+Clazz_overrideMethod (c$, "isLeaf", 
+function () {
+return false;
+});
+Clazz_overrideMethod (c$, "getAllowsChildren", 
+function () {
+return true;
+});
+Clazz_overrideMethod (c$, "children", 
+function () {
+if (this.nchildren == 0) return null;
+var a =  new java.util.Vector (this.nchildren);
+for (var b = 0; b < this.nchildren; b++) a.addElement (this.$children[b]);
+
+return a.elements ();
+});
+c$ = Clazz_p0p ();
+};
+c$.$AbstractDocument$LeafElement$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_decorateAsClass (function () {
+Clazz_prepareCallback (this, arguments);
+this.p0 = null;
+this.p1 = null;
+Clazz_instantialize (this, arguments);
+}, javax.swing.text.AbstractDocument, "LeafElement", javax.swing.text.AbstractDocument.AbstractElement, null, Clazz_innerTypeInstance (javax.swing.text.AbstractDocument.AbstractElement, this, null, Clazz_inheritArgs));
+Clazz_makeConstructor (c$, 
+function (a, b, c, d) {
+Clazz_superConstructor (this, javax.swing.text.AbstractDocument.LeafElement, [a, b]);
+try {
+this.p0 = this.b$["javax.swing.text.AbstractDocument"].createPosition (c);
+this.p1 = this.b$["javax.swing.text.AbstractDocument"].createPosition (d);
+} catch (e) {
+if (Clazz_exceptionOf (e, javax.swing.text.BadLocationException)) {
+this.p0 = null;
+this.p1 = null;
+throw  new javax.swing.text.StateInvariantError ("Can't create Position references");
+} else {
+throw e;
+}
+}
+}, "javax.swing.text.Element,javax.swing.text.AttributeSet,~N,~N");
+Clazz_overrideMethod (c$, "toString", 
+function () {
+return "LeafElement(" + this.getName () + ") " + this.p0 + "," + this.p1 + "\n";
+});
+Clazz_overrideMethod (c$, "getStartOffset", 
+function () {
+return this.p0.getOffset ();
+});
+Clazz_overrideMethod (c$, "getEndOffset", 
+function () {
+return this.p1.getOffset ();
+});
+Clazz_defineMethod (c$, "getName", 
+function () {
+var a = Clazz_superCall (this, javax.swing.text.AbstractDocument.LeafElement, "getName", []);
+if (a == null) {
+a = "content";
+}return a;
+});
+Clazz_overrideMethod (c$, "getElementIndex", 
+function (a) {
+return -1;
+}, "~N");
+Clazz_overrideMethod (c$, "getElement", 
+function (a) {
+return null;
+}, "~N");
+Clazz_overrideMethod (c$, "getElementCount", 
+function () {
+return 0;
+});
+Clazz_overrideMethod (c$, "isLeaf", 
+function () {
+return true;
+});
+Clazz_overrideMethod (c$, "getAllowsChildren", 
+function () {
+return false;
+});
+Clazz_overrideMethod (c$, "children", 
+function () {
+return null;
+});
+c$ = Clazz_p0p ();
+};
+c$.$AbstractDocument$DefaultDocumentEvent$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_decorateAsClass (function () {
+Clazz_prepareCallback (this, arguments);
+this.offset = 0;
+this.length = 0;
+this.changeLookup = null;
+this.type = null;
+Clazz_instantialize (this, arguments);
+}, javax.swing.text.AbstractDocument, "DefaultDocumentEvent", javax.swing.undo.CompoundEdit, javax.swing.event.DocumentEvent);
+Clazz_makeConstructor (c$, 
+function (a, b, c) {
+Clazz_superConstructor (this, javax.swing.text.AbstractDocument.DefaultDocumentEvent);
+this.offset = a;
+this.length = b;
+this.type = c;
+}, "~N,~N,javax.swing.event.DocumentEvent.EventType");
+Clazz_overrideMethod (c$, "toString", 
+function () {
+return this.edits.toString ();
+});
+Clazz_defineMethod (c$, "addEdit", 
+function (a) {
+if ((this.changeLookup == null) && (this.edits.size () > 10)) {
+this.changeLookup =  new java.util.Hashtable ();
+var b = this.edits.size ();
+for (var c = 0; c < b; c++) {
+var d = this.edits.elementAt (c);
+if (Clazz_instanceOf (d, javax.swing.event.DocumentEvent.ElementChange)) {
+var e = d;
+this.changeLookup.put (e.getElement (), e);
+}}
+}if ((this.changeLookup != null) && (Clazz_instanceOf (a, javax.swing.event.DocumentEvent.ElementChange))) {
+var b = a;
+this.changeLookup.put (b.getElement (), b);
+}return Clazz_superCall (this, javax.swing.text.AbstractDocument.DefaultDocumentEvent, "addEdit", [a]);
+}, "javax.swing.undo.UndoableEdit");
+Clazz_defineMethod (c$, "redo", 
+function () {
+this.b$["javax.swing.text.AbstractDocument"].writeLock ();
+try {
+Clazz_superCall (this, javax.swing.text.AbstractDocument.DefaultDocumentEvent, "redo", []);
+var a = Clazz_innerTypeInstance (javax.swing.text.AbstractDocument.UndoRedoDocumentEvent, this, null, this, false);
+if (this.type === javax.swing.event.DocumentEvent.EventType.INSERT) {
+this.b$["javax.swing.text.AbstractDocument"].fireInsertUpdate (a);
+} else if (this.type === javax.swing.event.DocumentEvent.EventType.REMOVE) {
+this.b$["javax.swing.text.AbstractDocument"].fireRemoveUpdate (a);
+} else {
+this.b$["javax.swing.text.AbstractDocument"].fireChangedUpdate (a);
+}} finally {
+this.b$["javax.swing.text.AbstractDocument"].writeUnlock ();
+}
+});
+Clazz_defineMethod (c$, "undo", 
+function () {
+this.b$["javax.swing.text.AbstractDocument"].writeLock ();
+try {
+Clazz_superCall (this, javax.swing.text.AbstractDocument.DefaultDocumentEvent, "undo", []);
+var a = Clazz_innerTypeInstance (javax.swing.text.AbstractDocument.UndoRedoDocumentEvent, this, null, this, true);
+if (this.type === javax.swing.event.DocumentEvent.EventType.REMOVE) {
+this.b$["javax.swing.text.AbstractDocument"].fireInsertUpdate (a);
+} else if (this.type === javax.swing.event.DocumentEvent.EventType.INSERT) {
+this.b$["javax.swing.text.AbstractDocument"].fireRemoveUpdate (a);
+} else {
+this.b$["javax.swing.text.AbstractDocument"].fireChangedUpdate (a);
+}} finally {
+this.b$["javax.swing.text.AbstractDocument"].writeUnlock ();
+}
+});
+Clazz_overrideMethod (c$, "isSignificant", 
+function () {
+return true;
+});
+Clazz_overrideMethod (c$, "getPresentationName", 
+function () {
+var a = this.getType ();
+if (a === javax.swing.event.DocumentEvent.EventType.INSERT) return javax.swing.UIManager.getString ("AbstractDocument.additionText");
+if (a === javax.swing.event.DocumentEvent.EventType.REMOVE) return javax.swing.UIManager.getString ("AbstractDocument.deletionText");
+return javax.swing.UIManager.getString ("AbstractDocument.styleChangeText");
+});
+Clazz_overrideMethod (c$, "getUndoPresentationName", 
+function () {
+return javax.swing.UIManager.getString ("AbstractDocument.undoText") + " " + this.getPresentationName ();
+});
+Clazz_overrideMethod (c$, "getRedoPresentationName", 
+function () {
+return javax.swing.UIManager.getString ("AbstractDocument.redoText") + " " + this.getPresentationName ();
+});
+Clazz_overrideMethod (c$, "getType", 
+function () {
+return this.type;
+});
+Clazz_overrideMethod (c$, "getOffset", 
+function () {
+return this.offset;
+});
+Clazz_overrideMethod (c$, "getLength", 
+function () {
+return this.length;
+});
+Clazz_overrideMethod (c$, "getDocument", 
+function () {
+return this.b$["javax.swing.text.AbstractDocument"];
+});
+Clazz_overrideMethod (c$, "getChange", 
+function (a) {
+if (this.changeLookup != null) {
+return this.changeLookup.get (a);
+}var b = this.edits.size ();
+for (var c = 0; c < b; c++) {
+var d = this.edits.elementAt (c);
+if (Clazz_instanceOf (d, javax.swing.event.DocumentEvent.ElementChange)) {
+var e = d;
+if (a.equals (e.getElement ())) {
+return e;
+}}}
+return null;
+}, "javax.swing.text.Element");
+c$ = Clazz_p0p ();
+};
+c$.$AbstractDocument$UndoRedoDocumentEvent$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_decorateAsClass (function () {
+Clazz_prepareCallback (this, arguments);
+this.src = null;
+this.type = null;
+Clazz_instantialize (this, arguments);
+}, javax.swing.text.AbstractDocument, "UndoRedoDocumentEvent", null, javax.swing.event.DocumentEvent);
+Clazz_makeConstructor (c$, 
+function (a, b) {
+this.src = a;
+if (b) {
+if (a.getType ().equals (javax.swing.event.DocumentEvent.EventType.INSERT)) {
+this.type = javax.swing.event.DocumentEvent.EventType.REMOVE;
+} else if (a.getType ().equals (javax.swing.event.DocumentEvent.EventType.REMOVE)) {
+this.type = javax.swing.event.DocumentEvent.EventType.INSERT;
+} else {
+this.type = a.getType ();
+}} else {
+this.type = a.getType ();
+}}, "javax.swing.text.AbstractDocument.DefaultDocumentEvent,~B");
+Clazz_defineMethod (c$, "getSource", 
+function () {
+return this.src;
+});
+Clazz_overrideMethod (c$, "getOffset", 
+function () {
+return this.src.getOffset ();
+});
+Clazz_overrideMethod (c$, "getLength", 
+function () {
+return this.src.getLength ();
+});
+Clazz_overrideMethod (c$, "getDocument", 
+function () {
+return this.src.getDocument ();
+});
+Clazz_overrideMethod (c$, "getType", 
+function () {
+return this.type;
+});
+Clazz_overrideMethod (c$, "getChange", 
+function (a) {
+return this.src.getChange (a);
+}, "javax.swing.text.Element");
+c$ = Clazz_p0p ();
+};
+c$.$AbstractDocument$DefaultFilterBypass$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_decorateAsClass (function () {
+Clazz_prepareCallback (this, arguments);
+Clazz_instantialize (this, arguments);
+}, javax.swing.text.AbstractDocument, "DefaultFilterBypass", javax.swing.text.DocumentFilter.FilterBypass);
+Clazz_overrideMethod (c$, "getDocument", 
+function () {
+return this.b$["javax.swing.text.AbstractDocument"];
+});
+Clazz_overrideMethod (c$, "remove", 
+function (a, b) {
+this.b$["javax.swing.text.AbstractDocument"].handleRemove (a, b);
+}, "~N,~N");
+Clazz_overrideMethod (c$, "insertString", 
+function (a, b, c) {
+this.b$["javax.swing.text.AbstractDocument"].handleInsertString (a, b, c);
+}, "~N,~S,javax.swing.text.AttributeSet");
+Clazz_overrideMethod (c$, "replace", 
+function (a, b, c, d) {
+this.b$["javax.swing.text.AbstractDocument"].handleRemove (a, b);
+this.b$["javax.swing.text.AbstractDocument"].handleInsertString (a, c, d);
+}, "~N,~N,~S,javax.swing.text.AttributeSet");
+c$ = Clazz_p0p ();
+};
+Clazz_declareInterface (javax.swing.text.AbstractDocument, "Content");
+Clazz_declareInterface (javax.swing.text.AbstractDocument, "AttributeContext");
+Clazz_pu$h(self.c$);
+c$ = Clazz_decorateAsClass (function () {
+this.e = null;
+this.index = 0;
+this.removed = null;
+this.added = null;
+Clazz_instantialize (this, arguments);
+}, javax.swing.text.AbstractDocument, "ElementEdit", javax.swing.undo.AbstractUndoableEdit, javax.swing.event.DocumentEvent.ElementChange);
+Clazz_makeConstructor (c$, 
+function (a, b, c, d) {
+Clazz_superConstructor (this, javax.swing.text.AbstractDocument.ElementEdit);
+this.e = a;
+this.index = b;
+this.removed = c;
+this.added = d;
+}, "javax.swing.text.Element,~N,~A,~A");
+Clazz_overrideMethod (c$, "getElement", 
+function () {
+return this.e;
+});
+Clazz_overrideMethod (c$, "getIndex", 
+function () {
+return this.index;
+});
+Clazz_overrideMethod (c$, "getChildrenRemoved", 
+function () {
+return this.removed;
+});
+Clazz_overrideMethod (c$, "getChildrenAdded", 
+function () {
+return this.added;
+});
+Clazz_defineMethod (c$, "redo", 
+function () {
+Clazz_superCall (this, javax.swing.text.AbstractDocument.ElementEdit, "redo", []);
+var a = this.removed;
+this.removed = this.added;
+this.added = a;
+(this.e).replace (this.index, this.removed.length, this.added);
+});
+Clazz_defineMethod (c$, "undo", 
+function () {
+Clazz_superCall (this, javax.swing.text.AbstractDocument.ElementEdit, "undo", []);
+(this.e).replace (this.index, this.added.length, this.removed);
+var a = this.removed;
+this.removed = this.added;
+this.added = a;
+});
+c$ = Clazz_p0p ();
+Clazz_defineStatics (c$,
+"BAD_LOCATION", "document location failure",
+"ParagraphElementName", "paragraph",
+"ContentElementName", "content",
+"SectionElementName", "section",
+"BidiElementName", "bidi level",
+"ElementNameAttribute", "$ename",
+"I18NProperty", "i18n",
+"MultiByteProperty", "multiByte",
+"AsyncLoadPriority", "load priority");
+});
+Clazz_declarePackage ("javax.swing.event");
+Clazz_declareInterface (javax.swing.event, "DocumentEvent");
+Clazz_pu$h(self.c$);
+c$ = Clazz_decorateAsClass (function () {
+this.typeString = null;
+Clazz_instantialize (this, arguments);
+}, javax.swing.event.DocumentEvent, "EventType");
+Clazz_makeConstructor (c$, 
+ function (a) {
+this.typeString = a;
+}, "~S");
+Clazz_overrideMethod (c$, "toString", 
+function () {
+return this.typeString;
+});
+c$.INSERT = c$.prototype.INSERT =  new javax.swing.event.DocumentEvent.EventType ("INSERT");
+c$.REMOVE = c$.prototype.REMOVE =  new javax.swing.event.DocumentEvent.EventType ("REMOVE");
+c$.CHANGE = c$.prototype.CHANGE =  new javax.swing.event.DocumentEvent.EventType ("CHANGE");
+c$ = Clazz_p0p ();
+Clazz_declareInterface (javax.swing.event.DocumentEvent, "ElementChange");
+Clazz_declarePackage ("javax.swing.text");
+c$ = Clazz_declareType (javax.swing.text, "DocumentFilter");
+Clazz_defineMethod (c$, "remove", 
+function (fb, offset, length) {
+fb.remove (offset, length);
+}, "javax.swing.text.DocumentFilter.FilterBypass,~N,~N");
+Clazz_defineMethod (c$, "insertString", 
+function (fb, offset, string, attr) {
+fb.insertString (offset, string, attr);
+}, "javax.swing.text.DocumentFilter.FilterBypass,~N,~S,javax.swing.text.AttributeSet");
+Clazz_defineMethod (c$, "replace", 
+function (fb, offset, length, text, attrs) {
+fb.replace (offset, length, text, attrs);
+}, "javax.swing.text.DocumentFilter.FilterBypass,~N,~N,~S,javax.swing.text.AttributeSet");
+Clazz_pu$h(self.c$);
+c$ = Clazz_declareType (javax.swing.text.DocumentFilter, "FilterBypass");
+c$ = Clazz_p0p ();
+Clazz_declarePackage ("javax.swing.text");
+Clazz_declareInterface (javax.swing.text, "Element");
+Clazz_declarePackage ("javax.swing.text");
+Clazz_load (["javax.swing.text.Document"], "javax.swing.text.JSMinimalAbstractDocument", null, function () {
+Clazz_declareInterface (javax.swing.text, "JSMinimalAbstractDocument", javax.swing.text.Document);
+});
+Clazz_declarePackage ("javax.swing.text");
+c$ = Clazz_declareInterface (javax.swing.text, "Document");
+Clazz_defineStatics (c$,
+"StreamDescriptionProperty", "stream",
+"TitleProperty", "title");
+Clazz_declarePackage ("javax.swing.text");
+Clazz_load (["javax.swing.text.AttributeSet"], "javax.swing.text.MutableAttributeSet", null, function () {
+Clazz_declareInterface (javax.swing.text, "MutableAttributeSet", javax.swing.text.AttributeSet);
+});
+Clazz_declarePackage ("javax.swing.text");
+Clazz_declareInterface (javax.swing.text, "AttributeSet");
+Clazz_declareInterface (javax.swing.text.AttributeSet, "FontAttribute");
+Clazz_declareInterface (javax.swing.text.AttributeSet, "ColorAttribute");
+Clazz_declareInterface (javax.swing.text.AttributeSet, "CharacterAttribute");
+Clazz_declareInterface (javax.swing.text.AttributeSet, "ParagraphAttribute");
+Clazz_declarePackage ("javax.swing.tree");
+Clazz_declareInterface (javax.swing.tree, "TreeNode");
+Clazz_declarePackage ("javax.swing.undo");
+Clazz_load (["javax.swing.undo.UndoableEdit"], "javax.swing.undo.AbstractUndoableEdit", ["javax.swing.UIManager", "javax.swing.undo.CannotRedoException", "$.CannotUndoException"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.hasBeenDone = false;
+this.alive = false;
+Clazz_instantialize (this, arguments);
+}, javax.swing.undo, "AbstractUndoableEdit", null, javax.swing.undo.UndoableEdit);
+Clazz_makeConstructor (c$, 
+function () {
+this.hasBeenDone = true;
+this.alive = true;
+});
+Clazz_overrideMethod (c$, "die", 
+function () {
+this.alive = false;
+});
+Clazz_overrideMethod (c$, "undo", 
+function () {
+if (!this.canUndo ()) {
+throw  new javax.swing.undo.CannotUndoException ();
+}this.hasBeenDone = false;
+});
+Clazz_overrideMethod (c$, "canUndo", 
+function () {
+return this.alive && this.hasBeenDone;
+});
+Clazz_overrideMethod (c$, "redo", 
+function () {
+if (!this.canRedo ()) {
+throw  new javax.swing.undo.CannotRedoException ();
+}this.hasBeenDone = true;
+});
+Clazz_overrideMethod (c$, "canRedo", 
+function () {
+return this.alive && !this.hasBeenDone;
+});
+Clazz_overrideMethod (c$, "addEdit", 
+function (anEdit) {
+return false;
+}, "javax.swing.undo.UndoableEdit");
+Clazz_overrideMethod (c$, "replaceEdit", 
+function (anEdit) {
+return false;
+}, "javax.swing.undo.UndoableEdit");
+Clazz_overrideMethod (c$, "isSignificant", 
+function () {
+return true;
+});
+Clazz_overrideMethod (c$, "getPresentationName", 
+function () {
+return "";
+});
+Clazz_overrideMethod (c$, "getUndoPresentationName", 
+function () {
+var name = this.getPresentationName ();
+if (!"".equals (name)) {
+name = javax.swing.UIManager.getString ("AbstractUndoableEdit.undoText") + " " + name;
+} else {
+name = javax.swing.UIManager.getString ("AbstractUndoableEdit.undoText");
+}return name;
+});
+Clazz_overrideMethod (c$, "getRedoPresentationName", 
+function () {
+var name = this.getPresentationName ();
+if (!"".equals (name)) {
+name = javax.swing.UIManager.getString ("AbstractUndoableEdit.redoText") + " " + name;
+} else {
+name = javax.swing.UIManager.getString ("AbstractUndoableEdit.redoText");
+}return name;
+});
+Clazz_defineMethod (c$, "toString", 
+function () {
+return Clazz_superCall (this, javax.swing.undo.AbstractUndoableEdit, "toString", []) + " hasBeenDone: " + this.hasBeenDone + " alive: " + this.alive;
+});
+Clazz_defineStatics (c$,
+"UndoName", "Undo",
+"RedoName", "Redo");
+});
+Clazz_declarePackage ("javax.swing.undo");
+Clazz_declareInterface (javax.swing.undo, "UndoableEdit");
+Clazz_declarePackage ("javax.swing.undo");
+Clazz_load (["java.lang.RuntimeException"], "javax.swing.undo.CannotRedoException", null, function () {
+c$ = Clazz_declareType (javax.swing.undo, "CannotRedoException", RuntimeException);
+});
+Clazz_declarePackage ("javax.swing.undo");
+Clazz_load (["java.lang.RuntimeException"], "javax.swing.undo.CannotUndoException", null, function () {
+c$ = Clazz_declareType (javax.swing.undo, "CannotUndoException", RuntimeException);
+});
+Clazz_declarePackage ("javax.swing.undo");
+Clazz_load (["javax.swing.undo.AbstractUndoableEdit"], "javax.swing.undo.CompoundEdit", ["java.util.Vector"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.inProgress = false;
+this.edits = null;
+Clazz_instantialize (this, arguments);
+}, javax.swing.undo, "CompoundEdit", javax.swing.undo.AbstractUndoableEdit);
+Clazz_makeConstructor (c$, 
+function () {
+Clazz_superConstructor (this, javax.swing.undo.CompoundEdit);
+this.inProgress = true;
+this.edits =  new java.util.Vector ();
+});
+Clazz_defineMethod (c$, "undo", 
+function () {
+Clazz_superCall (this, javax.swing.undo.CompoundEdit, "undo", []);
+var i = this.edits.size ();
+while (i-- > 0) {
+var e = this.edits.elementAt (i);
+e.undo ();
+}
+});
+Clazz_defineMethod (c$, "redo", 
+function () {
+Clazz_superCall (this, javax.swing.undo.CompoundEdit, "redo", []);
+var cursor = this.edits.elements ();
+while (cursor.hasMoreElements ()) {
+(cursor.nextElement ()).redo ();
+}
+});
+Clazz_defineMethod (c$, "lastEdit", 
+function () {
+var count = this.edits.size ();
+if (count > 0) return this.edits.elementAt (count - 1);
+ else return null;
+});
+Clazz_defineMethod (c$, "die", 
+function () {
+var size = this.edits.size ();
+for (var i = size - 1; i >= 0; i--) {
+var e = this.edits.elementAt (i);
+e.die ();
+}
+Clazz_superCall (this, javax.swing.undo.CompoundEdit, "die", []);
+});
+Clazz_overrideMethod (c$, "addEdit", 
+function (anEdit) {
+if (!this.inProgress) {
+return false;
+} else {
+var last = this.lastEdit ();
+if (last == null) {
+this.edits.addElement (anEdit);
+} else if (!last.addEdit (anEdit)) {
+if (anEdit.replaceEdit (last)) {
+this.edits.removeElementAt (this.edits.size () - 1);
+}this.edits.addElement (anEdit);
+}return true;
+}}, "javax.swing.undo.UndoableEdit");
+Clazz_defineMethod (c$, "end", 
+function () {
+this.inProgress = false;
+});
+Clazz_defineMethod (c$, "canUndo", 
+function () {
+return !this.isInProgress () && Clazz_superCall (this, javax.swing.undo.CompoundEdit, "canUndo", []);
+});
+Clazz_defineMethod (c$, "canRedo", 
+function () {
+return !this.isInProgress () && Clazz_superCall (this, javax.swing.undo.CompoundEdit, "canRedo", []);
+});
+Clazz_defineMethod (c$, "isInProgress", 
+function () {
+return this.inProgress;
+});
+Clazz_overrideMethod (c$, "isSignificant", 
+function () {
+var cursor = this.edits.elements ();
+while (cursor.hasMoreElements ()) {
+if ((cursor.nextElement ()).isSignificant ()) {
+return true;
+}}
+return false;
+});
+Clazz_defineMethod (c$, "getPresentationName", 
+function () {
+var last = this.lastEdit ();
+if (last != null) {
+return last.getPresentationName ();
+} else {
+return Clazz_superCall (this, javax.swing.undo.CompoundEdit, "getPresentationName", []);
+}});
+Clazz_defineMethod (c$, "getUndoPresentationName", 
+function () {
+var last = this.lastEdit ();
+if (last != null) {
+return last.getUndoPresentationName ();
+} else {
+return Clazz_superCall (this, javax.swing.undo.CompoundEdit, "getUndoPresentationName", []);
+}});
+Clazz_defineMethod (c$, "getRedoPresentationName", 
+function () {
+var last = this.lastEdit ();
+if (last != null) {
+return last.getRedoPresentationName ();
+} else {
+return Clazz_superCall (this, javax.swing.undo.CompoundEdit, "getRedoPresentationName", []);
+}});
+Clazz_defineMethod (c$, "toString", 
+function () {
+return Clazz_superCall (this, javax.swing.undo.CompoundEdit, "toString", []) + " inProgress: " + this.inProgress + " edits: " + this.edits;
+});
+});
+Clazz_declarePackage ("javax.swing.event");
+Clazz_load (["java.util.EventObject"], "javax.swing.event.UndoableEditEvent", null, function () {
+c$ = Clazz_decorateAsClass (function () {
+this.myEdit = null;
+Clazz_instantialize (this, arguments);
+}, javax.swing.event, "UndoableEditEvent", java.util.EventObject);
+Clazz_makeConstructor (c$, 
+function (source, edit) {
+Clazz_superConstructor (this, javax.swing.event.UndoableEditEvent, [source]);
+this.myEdit = edit;
+}, "~O,javax.swing.undo.UndoableEdit");
+Clazz_defineMethod (c$, "getEdit", 
+function () {
+return this.myEdit;
+});
+});
+Clazz_declarePackage ("javax.swing.event");
+Clazz_load (["java.util.EventListener"], "javax.swing.event.UndoableEditListener", null, function () {
+Clazz_declareInterface (javax.swing.event, "UndoableEditListener", java.util.EventListener);
+});
+Clazz_declarePackage ("javax.swing.text");
+Clazz_load (["javax.swing.text.Segment"], "javax.swing.text.SegmentCache", ["java.util.ArrayList"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.segments = null;
+Clazz_instantialize (this, arguments);
+}, javax.swing.text, "SegmentCache");
+c$.getSharedInstance = Clazz_defineMethod (c$, "getSharedInstance", 
+function () {
+return javax.swing.text.SegmentCache.sharedCache;
+});
+c$.getSharedSegment = Clazz_defineMethod (c$, "getSharedSegment", 
+function () {
+return javax.swing.text.SegmentCache.getSharedInstance ().getSegment ();
+});
+c$.releaseSharedSegment = Clazz_defineMethod (c$, "releaseSharedSegment", 
+function (segment) {
+javax.swing.text.SegmentCache.getSharedInstance ().releaseSegment (segment);
+}, "javax.swing.text.Segment");
+Clazz_makeConstructor (c$, 
+function () {
+this.segments =  new java.util.ArrayList (11);
+});
+Clazz_defineMethod (c$, "getSegment", 
+function () {
+{
+var size = this.segments.size ();
+if (size > 0) {
+return this.segments.remove (size - 1);
+}}return  new javax.swing.text.SegmentCache.CachedSegment ();
+});
+Clazz_defineMethod (c$, "releaseSegment", 
+function (segment) {
+if (Clazz_instanceOf (segment, javax.swing.text.SegmentCache.CachedSegment)) {
+{
+segment.array = null;
+segment.count = 0;
+this.segments.add (segment);
+}}}, "javax.swing.text.Segment");
+Clazz_pu$h(self.c$);
+c$ = Clazz_declareType (javax.swing.text.SegmentCache, "CachedSegment", javax.swing.text.Segment);
+c$ = Clazz_p0p ();
+c$.sharedCache = c$.prototype.sharedCache =  new javax.swing.text.SegmentCache ();
+});
+Clazz_declarePackage ("javax.swing.text");
+Clazz_load (["java.text.CharacterIterator"], "javax.swing.text.Segment", ["java.lang.IllegalArgumentException", "$.StringIndexOutOfBoundsException"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.array = null;
+this.offset = 0;
+this.count = 0;
+this.partialReturn = false;
+this.pos = 0;
+Clazz_instantialize (this, arguments);
+}, javax.swing.text, "Segment", null, [Cloneable, java.text.CharacterIterator, CharSequence]);
+Clazz_makeConstructor (c$, 
+function () {
+this.construct (null, 0, 0);
+});
+Clazz_makeConstructor (c$, 
+function (array, offset, count) {
+this.array = array;
+this.offset = offset;
+this.count = count;
+this.partialReturn = false;
+}, "~A,~N,~N");
+Clazz_defineMethod (c$, "setPartialReturn", 
+function (p) {
+this.partialReturn = p;
+}, "~B");
+Clazz_defineMethod (c$, "isPartialReturn", 
+function () {
+return this.partialReturn;
+});
+Clazz_overrideMethod (c$, "toString", 
+function () {
+if (this.array != null) {
+return  String.instantialize (this.array, this.offset, this.count);
+}return  String.instantialize ();
+});
+Clazz_overrideMethod (c$, "first", 
+function () {
+this.pos = this.offset;
+if (this.count != 0) {
+return this.array[this.pos];
+}return '\uffff';
+});
+Clazz_overrideMethod (c$, "last", 
+function () {
+this.pos = this.offset + this.count;
+if (this.count != 0) {
+this.pos -= 1;
+return this.array[this.pos];
+}return '\uffff';
+});
+Clazz_overrideMethod (c$, "current", 
+function () {
+if (this.count != 0 && this.pos < this.offset + this.count) {
+return this.array[this.pos];
+}return '\uffff';
+});
+Clazz_overrideMethod (c$, "next", 
+function () {
+this.pos += 1;
+var end = this.offset + this.count;
+if (this.pos >= end) {
+this.pos = end;
+return '\uffff';
+}return this.current ();
+});
+Clazz_overrideMethod (c$, "previous", 
+function () {
+if (this.pos == this.offset) {
+return '\uffff';
+}this.pos -= 1;
+return this.current ();
+});
+Clazz_overrideMethod (c$, "setIndex", 
+function (position) {
+var end = this.offset + this.count;
+if ((position < this.offset) || (position > end)) {
+throw  new IllegalArgumentException ("bad position: " + position);
+}this.pos = position;
+if ((this.pos != end) && (this.count != 0)) {
+return this.array[this.pos];
+}return '\uffff';
+}, "~N");
+Clazz_overrideMethod (c$, "getBeginIndex", 
+function () {
+return this.offset;
+});
+Clazz_overrideMethod (c$, "getEndIndex", 
+function () {
+return this.offset + this.count;
+});
+Clazz_overrideMethod (c$, "getIndex", 
+function () {
+return this.pos;
+});
+Clazz_overrideMethod (c$, "charAt", 
+function (index) {
+if (index < 0 || index >= this.count) {
+throw  new StringIndexOutOfBoundsException (index);
+}return this.array[this.offset + index];
+}, "~N");
+Clazz_overrideMethod (c$, "length", 
+function () {
+return this.count;
+});
+Clazz_overrideMethod (c$, "subSequence", 
+function (start, end) {
+if (start < 0) {
+throw  new StringIndexOutOfBoundsException (start);
+}if (end > this.count) {
+throw  new StringIndexOutOfBoundsException (end);
+}if (start > end) {
+throw  new StringIndexOutOfBoundsException (end - start);
+}var segment =  new javax.swing.text.Segment ();
+segment.array = this.array;
+segment.offset = this.offset + start;
+segment.count = end - start;
+return segment;
+}, "~N,~N");
+Clazz_overrideMethod (c$, "clone", 
+function () {
+var o;
+try {
+o = Clazz_superCall (this, javax.swing.text.Segment, "clone", []);
+} catch (cnse) {
+if (Clazz_exceptionOf (cnse, CloneNotSupportedException)) {
+o = null;
+} else {
+throw cnse;
+}
+}
+return o;
+});
+});
+Clazz_declarePackage ("javax.swing.text");
+Clazz_load (["java.lang.Error"], "javax.swing.text.StateInvariantError", null, function () {
+c$ = Clazz_declareType (javax.swing.text, "StateInvariantError", Error);
+});
+Clazz_declarePackage ("javax.swing.text");
+Clazz_load (["javax.swing.text.AttributeSet"], "javax.swing.text.StyleConstants", ["java.lang.Boolean", "$.Float", "java.awt.Color"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.representation = null;
+Clazz_instantialize (this, arguments);
+}, javax.swing.text, "StyleConstants");
+Clazz_overrideMethod (c$, "toString", 
+function () {
+return this.representation;
+});
+c$.getBidiLevel = Clazz_defineMethod (c$, "getBidiLevel", 
+function (a) {
+var o = a.getAttribute (javax.swing.text.StyleConstants.BidiLevel);
+if (o != null) {
+return o.intValue ();
+}return 0;
+}, "javax.swing.text.AttributeSet");
+c$.setBidiLevel = Clazz_defineMethod (c$, "setBidiLevel", 
+function (a, o) {
+a.addAttribute (javax.swing.text.StyleConstants.BidiLevel,  new Integer (o));
+}, "javax.swing.text.MutableAttributeSet,~N");
+c$.getComponent = Clazz_defineMethod (c$, "getComponent", 
+function (a) {
+return a.getAttribute (javax.swing.text.StyleConstants.ComponentAttribute);
+}, "javax.swing.text.AttributeSet");
+c$.setComponent = Clazz_defineMethod (c$, "setComponent", 
+function (a, c) {
+a.addAttribute ("$ename", "component");
+a.addAttribute (javax.swing.text.StyleConstants.ComponentAttribute, c);
+}, "javax.swing.text.MutableAttributeSet,java.awt.Component");
+c$.getIcon = Clazz_defineMethod (c$, "getIcon", 
+function (a) {
+return a.getAttribute (javax.swing.text.StyleConstants.IconAttribute);
+}, "javax.swing.text.AttributeSet");
+c$.setIcon = Clazz_defineMethod (c$, "setIcon", 
+function (a, c) {
+a.addAttribute ("$ename", "icon");
+a.addAttribute (javax.swing.text.StyleConstants.IconAttribute, c);
+}, "javax.swing.text.MutableAttributeSet,javax.swing.Icon");
+c$.getFontFamily = Clazz_defineMethod (c$, "getFontFamily", 
+function (a) {
+var family = a.getAttribute (javax.swing.text.StyleConstants.FontFamily);
+if (family == null) {
+family = "Monospaced";
+}return family;
+}, "javax.swing.text.AttributeSet");
+c$.setFontFamily = Clazz_defineMethod (c$, "setFontFamily", 
+function (a, fam) {
+a.addAttribute (javax.swing.text.StyleConstants.FontFamily, fam);
+}, "javax.swing.text.MutableAttributeSet,~S");
+c$.getFontSize = Clazz_defineMethod (c$, "getFontSize", 
+function (a) {
+var size = a.getAttribute (javax.swing.text.StyleConstants.FontSize);
+if (size != null) {
+return size.intValue ();
+}return 12;
+}, "javax.swing.text.AttributeSet");
+c$.setFontSize = Clazz_defineMethod (c$, "setFontSize", 
+function (a, s) {
+a.addAttribute (javax.swing.text.StyleConstants.FontSize,  new Integer (s));
+}, "javax.swing.text.MutableAttributeSet,~N");
+c$.isBold = Clazz_defineMethod (c$, "isBold", 
+function (a) {
+var bold = a.getAttribute (javax.swing.text.StyleConstants.Bold);
+if (bold != null) {
+return bold.booleanValue ();
+}return false;
+}, "javax.swing.text.AttributeSet");
+c$.setBold = Clazz_defineMethod (c$, "setBold", 
+function (a, b) {
+a.addAttribute (javax.swing.text.StyleConstants.Bold, Boolean.$valueOf (b));
+}, "javax.swing.text.MutableAttributeSet,~B");
+c$.isItalic = Clazz_defineMethod (c$, "isItalic", 
+function (a) {
+var italic = a.getAttribute (javax.swing.text.StyleConstants.Italic);
+if (italic != null) {
+return italic.booleanValue ();
+}return false;
+}, "javax.swing.text.AttributeSet");
+c$.setItalic = Clazz_defineMethod (c$, "setItalic", 
+function (a, b) {
+a.addAttribute (javax.swing.text.StyleConstants.Italic, Boolean.$valueOf (b));
+}, "javax.swing.text.MutableAttributeSet,~B");
+c$.isUnderline = Clazz_defineMethod (c$, "isUnderline", 
+function (a) {
+var underline = a.getAttribute (javax.swing.text.StyleConstants.Underline);
+if (underline != null) {
+return underline.booleanValue ();
+}return false;
+}, "javax.swing.text.AttributeSet");
+c$.isStrikeThrough = Clazz_defineMethod (c$, "isStrikeThrough", 
+function (a) {
+var strike = a.getAttribute (javax.swing.text.StyleConstants.StrikeThrough);
+if (strike != null) {
+return strike.booleanValue ();
+}return false;
+}, "javax.swing.text.AttributeSet");
+c$.isSuperscript = Clazz_defineMethod (c$, "isSuperscript", 
+function (a) {
+var superscript = a.getAttribute (javax.swing.text.StyleConstants.Superscript);
+if (superscript != null) {
+return superscript.booleanValue ();
+}return false;
+}, "javax.swing.text.AttributeSet");
+c$.isSubscript = Clazz_defineMethod (c$, "isSubscript", 
+function (a) {
+var subscript = a.getAttribute (javax.swing.text.StyleConstants.Subscript);
+if (subscript != null) {
+return subscript.booleanValue ();
+}return false;
+}, "javax.swing.text.AttributeSet");
+c$.setUnderline = Clazz_defineMethod (c$, "setUnderline", 
+function (a, b) {
+a.addAttribute (javax.swing.text.StyleConstants.Underline, Boolean.$valueOf (b));
+}, "javax.swing.text.MutableAttributeSet,~B");
+c$.setStrikeThrough = Clazz_defineMethod (c$, "setStrikeThrough", 
+function (a, b) {
+a.addAttribute (javax.swing.text.StyleConstants.StrikeThrough, Boolean.$valueOf (b));
+}, "javax.swing.text.MutableAttributeSet,~B");
+c$.setSuperscript = Clazz_defineMethod (c$, "setSuperscript", 
+function (a, b) {
+a.addAttribute (javax.swing.text.StyleConstants.Superscript, Boolean.$valueOf (b));
+}, "javax.swing.text.MutableAttributeSet,~B");
+c$.setSubscript = Clazz_defineMethod (c$, "setSubscript", 
+function (a, b) {
+a.addAttribute (javax.swing.text.StyleConstants.Subscript, Boolean.$valueOf (b));
+}, "javax.swing.text.MutableAttributeSet,~B");
+c$.getForeground = Clazz_defineMethod (c$, "getForeground", 
+function (a) {
+var fg = a.getAttribute (javax.swing.text.StyleConstants.Foreground);
+if (fg == null) {
+fg = java.awt.Color.black;
+}return fg;
+}, "javax.swing.text.AttributeSet");
+c$.setForeground = Clazz_defineMethod (c$, "setForeground", 
+function (a, fg) {
+a.addAttribute (javax.swing.text.StyleConstants.Foreground, fg);
+}, "javax.swing.text.MutableAttributeSet,java.awt.Color");
+c$.getBackground = Clazz_defineMethod (c$, "getBackground", 
+function (a) {
+var fg = a.getAttribute (javax.swing.text.StyleConstants.Background);
+if (fg == null) {
+fg = java.awt.Color.black;
+}return fg;
+}, "javax.swing.text.AttributeSet");
+c$.setBackground = Clazz_defineMethod (c$, "setBackground", 
+function (a, fg) {
+a.addAttribute (javax.swing.text.StyleConstants.Background, fg);
+}, "javax.swing.text.MutableAttributeSet,java.awt.Color");
+c$.getFirstLineIndent = Clazz_defineMethod (c$, "getFirstLineIndent", 
+function (a) {
+var indent = a.getAttribute (javax.swing.text.StyleConstants.FirstLineIndent);
+if (indent != null) {
+return indent.floatValue ();
+}return 0;
+}, "javax.swing.text.AttributeSet");
+c$.setFirstLineIndent = Clazz_defineMethod (c$, "setFirstLineIndent", 
+function (a, i) {
+a.addAttribute (javax.swing.text.StyleConstants.FirstLineIndent,  new Float (i));
+}, "javax.swing.text.MutableAttributeSet,~N");
+c$.getRightIndent = Clazz_defineMethod (c$, "getRightIndent", 
+function (a) {
+var indent = a.getAttribute (javax.swing.text.StyleConstants.RightIndent);
+if (indent != null) {
+return indent.floatValue ();
+}return 0;
+}, "javax.swing.text.AttributeSet");
+c$.setRightIndent = Clazz_defineMethod (c$, "setRightIndent", 
+function (a, i) {
+a.addAttribute (javax.swing.text.StyleConstants.RightIndent,  new Float (i));
+}, "javax.swing.text.MutableAttributeSet,~N");
+c$.getLeftIndent = Clazz_defineMethod (c$, "getLeftIndent", 
+function (a) {
+var indent = a.getAttribute (javax.swing.text.StyleConstants.LeftIndent);
+if (indent != null) {
+return indent.floatValue ();
+}return 0;
+}, "javax.swing.text.AttributeSet");
+c$.setLeftIndent = Clazz_defineMethod (c$, "setLeftIndent", 
+function (a, i) {
+a.addAttribute (javax.swing.text.StyleConstants.LeftIndent,  new Float (i));
+}, "javax.swing.text.MutableAttributeSet,~N");
+c$.getLineSpacing = Clazz_defineMethod (c$, "getLineSpacing", 
+function (a) {
+var space = a.getAttribute (javax.swing.text.StyleConstants.LineSpacing);
+if (space != null) {
+return space.floatValue ();
+}return 0;
+}, "javax.swing.text.AttributeSet");
+c$.setLineSpacing = Clazz_defineMethod (c$, "setLineSpacing", 
+function (a, i) {
+a.addAttribute (javax.swing.text.StyleConstants.LineSpacing,  new Float (i));
+}, "javax.swing.text.MutableAttributeSet,~N");
+c$.getSpaceAbove = Clazz_defineMethod (c$, "getSpaceAbove", 
+function (a) {
+var space = a.getAttribute (javax.swing.text.StyleConstants.SpaceAbove);
+if (space != null) {
+return space.floatValue ();
+}return 0;
+}, "javax.swing.text.AttributeSet");
+c$.setSpaceAbove = Clazz_defineMethod (c$, "setSpaceAbove", 
+function (a, i) {
+a.addAttribute (javax.swing.text.StyleConstants.SpaceAbove,  new Float (i));
+}, "javax.swing.text.MutableAttributeSet,~N");
+c$.getSpaceBelow = Clazz_defineMethod (c$, "getSpaceBelow", 
+function (a) {
+var space = a.getAttribute (javax.swing.text.StyleConstants.SpaceBelow);
+if (space != null) {
+return space.floatValue ();
+}return 0;
+}, "javax.swing.text.AttributeSet");
+c$.setSpaceBelow = Clazz_defineMethod (c$, "setSpaceBelow", 
+function (a, i) {
+a.addAttribute (javax.swing.text.StyleConstants.SpaceBelow,  new Float (i));
+}, "javax.swing.text.MutableAttributeSet,~N");
+c$.getAlignment = Clazz_defineMethod (c$, "getAlignment", 
+function (a) {
+var align = a.getAttribute (javax.swing.text.StyleConstants.Alignment);
+if (align != null) {
+return align.intValue ();
+}return 0;
+}, "javax.swing.text.AttributeSet");
+c$.setAlignment = Clazz_defineMethod (c$, "setAlignment", 
+function (a, align) {
+a.addAttribute (javax.swing.text.StyleConstants.Alignment,  new Integer (align));
+}, "javax.swing.text.MutableAttributeSet,~N");
+c$.getTabSet = Clazz_defineMethod (c$, "getTabSet", 
+function (a) {
+var tabs = a.getAttribute (javax.swing.text.StyleConstants.TabSet);
+return tabs;
+}, "javax.swing.text.AttributeSet");
+c$.setTabSet = Clazz_defineMethod (c$, "setTabSet", 
+function (a, tabs) {
+a.addAttribute (javax.swing.text.StyleConstants.TabSet, tabs);
+}, "javax.swing.text.MutableAttributeSet,javax.swing.text.TabSet");
+Clazz_makeConstructor (c$, 
+function (representation) {
+this.representation = representation;
+}, "~S");
+Clazz_pu$h(self.c$);
+c$ = Clazz_declareType (javax.swing.text.StyleConstants, "ParagraphConstants", javax.swing.text.StyleConstants, javax.swing.text.AttributeSet.ParagraphAttribute);
+c$ = Clazz_p0p ();
+Clazz_pu$h(self.c$);
+c$ = Clazz_declareType (javax.swing.text.StyleConstants, "CharacterConstants", javax.swing.text.StyleConstants, javax.swing.text.AttributeSet.CharacterAttribute);
+c$ = Clazz_p0p ();
+Clazz_pu$h(self.c$);
+c$ = Clazz_declareType (javax.swing.text.StyleConstants, "ColorConstants", javax.swing.text.StyleConstants, [javax.swing.text.AttributeSet.ColorAttribute, javax.swing.text.AttributeSet.CharacterAttribute]);
+c$ = Clazz_p0p ();
+Clazz_pu$h(self.c$);
+c$ = Clazz_declareType (javax.swing.text.StyleConstants, "FontConstants", javax.swing.text.StyleConstants, [javax.swing.text.AttributeSet.FontAttribute, javax.swing.text.AttributeSet.CharacterAttribute]);
+c$ = Clazz_p0p ();
+Clazz_defineStatics (c$,
+"ComponentElementName", "component",
+"IconElementName", "icon");
+c$.NameAttribute = c$.prototype.NameAttribute =  new javax.swing.text.StyleConstants ("name");
+c$.ResolveAttribute = c$.prototype.ResolveAttribute =  new javax.swing.text.StyleConstants ("resolver");
+c$.ModelAttribute = c$.prototype.ModelAttribute =  new javax.swing.text.StyleConstants ("model");
+c$.BidiLevel = c$.prototype.BidiLevel =  new javax.swing.text.StyleConstants.CharacterConstants ("bidiLevel");
+c$.FontFamily = c$.prototype.FontFamily =  new javax.swing.text.StyleConstants.FontConstants ("family");
+c$.Family = c$.prototype.Family = javax.swing.text.StyleConstants.FontFamily;
+c$.FontSize = c$.prototype.FontSize =  new javax.swing.text.StyleConstants.FontConstants ("size");
+c$.Size = c$.prototype.Size = javax.swing.text.StyleConstants.FontSize;
+c$.Bold = c$.prototype.Bold =  new javax.swing.text.StyleConstants.FontConstants ("bold");
+c$.Italic = c$.prototype.Italic =  new javax.swing.text.StyleConstants.FontConstants ("italic");
+c$.Underline = c$.prototype.Underline =  new javax.swing.text.StyleConstants.CharacterConstants ("underline");
+c$.StrikeThrough = c$.prototype.StrikeThrough =  new javax.swing.text.StyleConstants.CharacterConstants ("strikethrough");
+c$.Superscript = c$.prototype.Superscript =  new javax.swing.text.StyleConstants.CharacterConstants ("superscript");
+c$.Subscript = c$.prototype.Subscript =  new javax.swing.text.StyleConstants.CharacterConstants ("subscript");
+c$.Foreground = c$.prototype.Foreground =  new javax.swing.text.StyleConstants.ColorConstants ("foreground");
+c$.Background = c$.prototype.Background =  new javax.swing.text.StyleConstants.ColorConstants ("background");
+c$.ComponentAttribute = c$.prototype.ComponentAttribute =  new javax.swing.text.StyleConstants.CharacterConstants ("component");
+c$.IconAttribute = c$.prototype.IconAttribute =  new javax.swing.text.StyleConstants.CharacterConstants ("icon");
+c$.ComposedTextAttribute = c$.prototype.ComposedTextAttribute =  new javax.swing.text.StyleConstants ("composed text");
+c$.FirstLineIndent = c$.prototype.FirstLineIndent =  new javax.swing.text.StyleConstants.ParagraphConstants ("FirstLineIndent");
+c$.LeftIndent = c$.prototype.LeftIndent =  new javax.swing.text.StyleConstants.ParagraphConstants ("LeftIndent");
+c$.RightIndent = c$.prototype.RightIndent =  new javax.swing.text.StyleConstants.ParagraphConstants ("RightIndent");
+c$.LineSpacing = c$.prototype.LineSpacing =  new javax.swing.text.StyleConstants.ParagraphConstants ("LineSpacing");
+c$.SpaceAbove = c$.prototype.SpaceAbove =  new javax.swing.text.StyleConstants.ParagraphConstants ("SpaceAbove");
+c$.SpaceBelow = c$.prototype.SpaceBelow =  new javax.swing.text.StyleConstants.ParagraphConstants ("SpaceBelow");
+c$.Alignment = c$.prototype.Alignment =  new javax.swing.text.StyleConstants.ParagraphConstants ("Alignment");
+c$.TabSet = c$.prototype.TabSet =  new javax.swing.text.StyleConstants.ParagraphConstants ("TabSet");
+c$.Orientation = c$.prototype.Orientation =  new javax.swing.text.StyleConstants.ParagraphConstants ("Orientation");
+Clazz_defineStatics (c$,
+"ALIGN_LEFT", 0,
+"ALIGN_CENTER", 1,
+"ALIGN_RIGHT", 2,
+"ALIGN_JUSTIFIED", 3);
+c$.keys = c$.prototype.keys =  Clazz_newArray (-1, [javax.swing.text.StyleConstants.NameAttribute, javax.swing.text.StyleConstants.ResolveAttribute, javax.swing.text.StyleConstants.BidiLevel, javax.swing.text.StyleConstants.FontFamily, javax.swing.text.StyleConstants.FontSize, javax.swing.text.StyleConstants.Bold, javax.swing.text.StyleConstants.Italic, javax.swing.text.StyleConstants.Underline, javax.swing.text.StyleConstants.StrikeThrough, javax.swing.text.StyleConstants.Superscript, javax.swing.text.StyleConstants.Subscript, javax.swing.text.StyleConstants.Foreground, javax.swing.text.StyleConstants.Background, javax.swing.text.StyleConstants.ComponentAttribute, javax.swing.text.StyleConstants.IconAttribute, javax.swing.text.StyleConstants.FirstLineIndent, javax.swing.text.StyleConstants.LeftIndent, javax.swing.text.StyleConstants.RightIndent, javax.swing.text.StyleConstants.LineSpacing, javax.swing.text.StyleConstants.SpaceAbove, javax.swing.text.StyleConstants.SpaceBelow, javax.swing.text.StyleConstants.Alignment, javax.swing.text.StyleConstants.TabSet, javax.swing.text.StyleConstants.Orientation, javax.swing.text.StyleConstants.ModelAttribute, javax.swing.text.StyleConstants.ComposedTextAttribute]);
+});
+Clazz_declarePackage ("javax.swing.text");
+Clazz_load (["java.util.Enumeration", "javax.swing.text.AbstractDocument", "$.AttributeSet", "$.Style", "java.util.Collections", "$.HashMap", "$.Hashtable", "$.Vector", "javax.swing.event.EventListenerList", "javax.swing.text.SimpleAttributeSet"], "javax.swing.text.StyleContext", ["java.util.NoSuchElementException", "java.awt.Font", "$.Toolkit", "javax.swing.SwingUtilities", "javax.swing.event.ChangeEvent", "$.ChangeListener", "javax.swing.text.MutableAttributeSet", "$.StyleConstants"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.styles = null;
+this.fontSearch = null;
+this.fontTable = null;
+this.attributesPool = null;
+this.search = null;
+if (!Clazz_isClassDefined ("javax.swing.text.StyleContext.SmallAttributeSet")) {
+javax.swing.text.StyleContext.$StyleContext$SmallAttributeSet$ ();
+}
+if (!Clazz_isClassDefined ("javax.swing.text.StyleContext.KeyEnumeration")) {
+javax.swing.text.StyleContext.$StyleContext$KeyEnumeration$ ();
+}
+if (!Clazz_isClassDefined ("javax.swing.text.StyleContext.KeyBuilder")) {
+javax.swing.text.StyleContext.$StyleContext$KeyBuilder$ ();
+}
+if (!Clazz_isClassDefined ("javax.swing.text.StyleContext.NamedStyle")) {
+javax.swing.text.StyleContext.$StyleContext$NamedStyle$ ();
+}
+Clazz_instantialize (this, arguments);
+}, javax.swing.text, "StyleContext", null, javax.swing.text.AbstractDocument.AttributeContext);
+Clazz_prepareFields (c$, function () {
+this.fontSearch =  new javax.swing.text.StyleContext.FontKey (null, 0, 0);
+this.fontTable =  new java.util.Hashtable ();
+this.attributesPool = java.util.Collections.synchronizedMap ( new java.util.HashMap ());
+this.search =  new javax.swing.text.SimpleAttributeSet ();
+});
+c$.getDefaultStyleContext = Clazz_defineMethod (c$, "getDefaultStyleContext", 
+function () {
+if (javax.swing.text.StyleContext.defaultContext == null) {
+javax.swing.text.StyleContext.defaultContext =  new javax.swing.text.StyleContext ();
+}return javax.swing.text.StyleContext.defaultContext;
+});
+Clazz_makeConstructor (c$, 
+function () {
+this.styles = Clazz_innerTypeInstance (javax.swing.text.StyleContext.NamedStyle, this, null, null);
+this.addStyle ("default", null);
+});
+Clazz_defineMethod (c$, "addStyle", 
+function (nm, parent) {
+var style = Clazz_innerTypeInstance (javax.swing.text.StyleContext.NamedStyle, this, null, nm, parent);
+if (nm != null) {
+this.styles.addAttribute (nm, style);
+}return style;
+}, "~S,javax.swing.text.Style");
+Clazz_defineMethod (c$, "removeStyle", 
+function (nm) {
+this.styles.removeAttribute (nm);
+}, "~S");
+Clazz_defineMethod (c$, "getStyle", 
+function (nm) {
+return this.styles.getAttribute (nm);
+}, "~S");
+Clazz_defineMethod (c$, "getStyleNames", 
+function () {
+return this.styles.getAttributeNames ();
+});
+Clazz_defineMethod (c$, "addChangeListener", 
+function (l) {
+this.styles.addChangeListener (l);
+}, "javax.swing.event.ChangeListener");
+Clazz_defineMethod (c$, "removeChangeListener", 
+function (l) {
+this.styles.removeChangeListener (l);
+}, "javax.swing.event.ChangeListener");
+Clazz_defineMethod (c$, "getChangeListeners", 
+function () {
+return (this.styles).getChangeListeners ();
+});
+Clazz_defineMethod (c$, "getFont", 
+function (attr) {
+var style = 0;
+if (javax.swing.text.StyleConstants.isBold (attr)) {
+style |= 1;
+}if (javax.swing.text.StyleConstants.isItalic (attr)) {
+style |= 2;
+}var family = javax.swing.text.StyleConstants.getFontFamily (attr);
+var size = javax.swing.text.StyleConstants.getFontSize (attr);
+if (javax.swing.text.StyleConstants.isSuperscript (attr) || javax.swing.text.StyleConstants.isSubscript (attr)) {
+size -= 2;
+}return this.getFont (family, style, size);
+}, "javax.swing.text.AttributeSet");
+Clazz_defineMethod (c$, "getForeground", 
+function (attr) {
+return javax.swing.text.StyleConstants.getForeground (attr);
+}, "javax.swing.text.AttributeSet");
+Clazz_defineMethod (c$, "getBackground", 
+function (attr) {
+return javax.swing.text.StyleConstants.getBackground (attr);
+}, "javax.swing.text.AttributeSet");
+Clazz_defineMethod (c$, "getFont", 
+function (family, style, size) {
+this.fontSearch.setValue (family, style, size);
+var f = this.fontTable.get (this.fontSearch);
+if (f == null) {
+var defaultStyle = this.getStyle ("default");
+if (defaultStyle != null) {
+var FONT_ATTRIBUTE_KEY = "FONT_ATTRIBUTE_KEY";
+var defaultFont = defaultStyle.getAttribute ("FONT_ATTRIBUTE_KEY");
+if (defaultFont != null && defaultFont.getFamily ().equalsIgnoreCase (family)) {
+f = defaultFont.deriveFont (style, size);
+}}if (f == null) {
+f =  new java.awt.Font (family, style, size);
+}var key =  new javax.swing.text.StyleContext.FontKey (family, style, size);
+this.fontTable.put (key, f);
+}return f;
+}, "~S,~N,~N");
+Clazz_defineMethod (c$, "getFontMetrics", 
+function (f) {
+return java.awt.Toolkit.getDefaultToolkit ().getFontMetrics (f);
+}, "java.awt.Font");
+Clazz_overrideMethod (c$, "addAttribute", 
+function (old, name, value) {
+if ((old.getAttributeCount () + 1) <= this.getCompressionThreshold ()) {
+this.search.removeAttributes (this.search);
+this.search.addAttributes (old);
+this.search.addAttribute (name, value);
+this.reclaim (old);
+return this.getImmutableUniqueSet ();
+}var ma = this.getMutableAttributeSet (old);
+ma.addAttribute (name, value);
+return ma;
+}, "javax.swing.text.AttributeSet,~O,~O");
+Clazz_overrideMethod (c$, "addAttributes", 
+function (old, attr) {
+if ((old.getAttributeCount () + attr.getAttributeCount ()) <= this.getCompressionThreshold ()) {
+this.search.removeAttributes (this.search);
+this.search.addAttributes (old);
+this.search.addAttributes (attr);
+this.reclaim (old);
+return this.getImmutableUniqueSet ();
+}var ma = this.getMutableAttributeSet (old);
+ma.addAttributes (attr);
+return ma;
+}, "javax.swing.text.AttributeSet,javax.swing.text.AttributeSet");
+Clazz_overrideMethod (c$, "removeAttribute", 
+function (old, name) {
+if ((old.getAttributeCount () - 1) <= this.getCompressionThreshold ()) {
+this.search.removeAttributes (this.search);
+this.search.addAttributes (old);
+this.search.removeAttribute (name);
+this.reclaim (old);
+return this.getImmutableUniqueSet ();
+}var ma = this.getMutableAttributeSet (old);
+ma.removeAttribute (name);
+return ma;
+}, "javax.swing.text.AttributeSet,~O");
+Clazz_defineMethod (c$, "removeAttributes", 
+function (old, names) {
+if (old.getAttributeCount () <= this.getCompressionThreshold ()) {
+this.search.removeAttributes (this.search);
+this.search.addAttributes (old);
+this.search.removeAttributes (names);
+this.reclaim (old);
+return this.getImmutableUniqueSet ();
+}var ma = this.getMutableAttributeSet (old);
+ma.removeAttributes (names);
+return ma;
+}, "javax.swing.text.AttributeSet,java.util.Enumeration");
+Clazz_defineMethod (c$, "removeAttributes", 
+function (old, attrs) {
+if (old.getAttributeCount () <= this.getCompressionThreshold ()) {
+this.search.removeAttributes (this.search);
+this.search.addAttributes (old);
+this.search.removeAttributes (attrs);
+this.reclaim (old);
+return this.getImmutableUniqueSet ();
+}var ma = this.getMutableAttributeSet (old);
+ma.removeAttributes (attrs);
+return ma;
+}, "javax.swing.text.AttributeSet,javax.swing.text.AttributeSet");
+Clazz_overrideMethod (c$, "getEmptySet", 
+function () {
+return javax.swing.text.SimpleAttributeSet.EMPTY;
+});
+Clazz_overrideMethod (c$, "reclaim", 
+function (a) {
+if (javax.swing.SwingUtilities.isEventDispatchThread ()) {
+this.attributesPool.size ();
+}}, "javax.swing.text.AttributeSet");
+Clazz_defineMethod (c$, "getCompressionThreshold", 
+function () {
+return 9;
+});
+Clazz_defineMethod (c$, "createSmallAttributeSet", 
+function (a) {
+return Clazz_innerTypeInstance (javax.swing.text.StyleContext.SmallAttributeSet, this, null, a);
+}, "javax.swing.text.AttributeSet");
+Clazz_defineMethod (c$, "createLargeAttributeSet", 
+function (a) {
+return  new javax.swing.text.SimpleAttributeSet (a);
+}, "javax.swing.text.AttributeSet");
+Clazz_defineMethod (c$, "removeUnusedSets", 
+function () {
+this.attributesPool.size ();
+});
+Clazz_defineMethod (c$, "getImmutableUniqueSet", 
+function () {
+return null;
+});
+Clazz_defineMethod (c$, "getMutableAttributeSet", 
+function (a) {
+if (Clazz_instanceOf (a, javax.swing.text.MutableAttributeSet) && a !== javax.swing.text.SimpleAttributeSet.EMPTY) {
+return a;
+}return this.createLargeAttributeSet (a);
+}, "javax.swing.text.AttributeSet");
+Clazz_defineMethod (c$, "toString", 
+function () {
+this.removeUnusedSets ();
+var s = "";
+var iterator = this.attributesPool.keySet ().iterator ();
+while (iterator.hasNext ()) {
+var set = iterator.next ();
+s = s + set + "\n";
+}
+return s;
+});
+c$.registerStaticAttributeKey = Clazz_defineMethod (c$, "registerStaticAttributeKey", 
+function (key) {
+var ioFmt = key.getClass ().getName () + "." + key.toString ();
+if (javax.swing.text.StyleContext.freezeKeyMap == null) {
+javax.swing.text.StyleContext.freezeKeyMap =  new java.util.Hashtable ();
+javax.swing.text.StyleContext.thawKeyMap =  new java.util.Hashtable ();
+}javax.swing.text.StyleContext.freezeKeyMap.put (key, ioFmt);
+javax.swing.text.StyleContext.thawKeyMap.put (ioFmt, key);
+}, "~O");
+c$.getStaticAttribute = Clazz_defineMethod (c$, "getStaticAttribute", 
+function (key) {
+if (javax.swing.text.StyleContext.thawKeyMap == null || key == null) {
+return null;
+}return javax.swing.text.StyleContext.thawKeyMap.get (key);
+}, "~O");
+c$.getStaticAttributeKey = Clazz_defineMethod (c$, "getStaticAttributeKey", 
+function (key) {
+return key.getClass ().getName () + "." + key.toString ();
+}, "~O");
+c$.$StyleContext$SmallAttributeSet$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_decorateAsClass (function () {
+Clazz_prepareCallback (this, arguments);
+this.attributes = null;
+this.resolveParent = null;
+Clazz_instantialize (this, arguments);
+}, javax.swing.text.StyleContext, "SmallAttributeSet", null, javax.swing.text.AttributeSet);
+Clazz_makeConstructor (c$, 
+function (a) {
+this.attributes = a;
+this.updateResolveParent ();
+}, "~A");
+Clazz_makeConstructor (c$, 
+function (a) {
+var b = a.getAttributeCount ();
+var c =  new Array (2 * b);
+var d = a.getAttributeNames ();
+var e = 0;
+while (d.hasMoreElements ()) {
+c[e] = d.nextElement ();
+c[e + 1] = a.getAttribute (c[e]);
+e += 2;
+}
+this.attributes = c;
+this.updateResolveParent ();
+}, "javax.swing.text.AttributeSet");
+Clazz_defineMethod (c$, "updateResolveParent", 
+ function () {
+this.resolveParent = null;
+var a = this.attributes;
+for (var b = 0; b < a.length; b += 2) {
+if (a[b] === javax.swing.text.StyleConstants.ResolveAttribute) {
+this.resolveParent = a[b + 1];
+break;
+}}
+});
+Clazz_defineMethod (c$, "getLocalAttribute", 
+function (a) {
+if (a === javax.swing.text.StyleConstants.ResolveAttribute) {
+return this.resolveParent;
+}var b = this.attributes;
+for (var c = 0; c < b.length; c += 2) {
+if (a.equals (b[c])) {
+return b[c + 1];
+}}
+return null;
+}, "~O");
+Clazz_overrideMethod (c$, "toString", 
+function () {
+var a = "{";
+var b = this.attributes;
+for (var c = 0; c < b.length; c += 2) {
+if (Clazz_instanceOf (b[c + 1], javax.swing.text.AttributeSet)) {
+a = a + b[c] + "=" + "AttributeSet" + ",";
+} else {
+a = a + b[c] + "=" + b[c + 1] + ",";
+}}
+a = a + "}";
+return a;
+});
+Clazz_defineMethod (c$, "hashCode", 
+function () {
+var a = 0;
+var b = this.attributes;
+for (var c = 1; c < b.length; c += 2) {
+a ^= b[c].hashCode ();
+}
+return a;
+});
+Clazz_defineMethod (c$, "equals", 
+function (a) {
+if (Clazz_instanceOf (a, javax.swing.text.AttributeSet)) {
+var b = a;
+return ((this.getAttributeCount () == b.getAttributeCount ()) && this.containsAttributes (b));
+}return false;
+}, "~O");
+Clazz_overrideMethod (c$, "clone", 
+function () {
+return this;
+});
+Clazz_defineMethod (c$, "getAttributeCount", 
+function () {
+return Clazz_doubleToInt (this.attributes.length / 2);
+});
+Clazz_overrideMethod (c$, "isDefined", 
+function (a) {
+var b = this.attributes;
+var c = b.length;
+for (var d = 0; d < c; d += 2) {
+if (a.equals (b[d])) {
+return true;
+}}
+return false;
+}, "~O");
+Clazz_overrideMethod (c$, "isEqual", 
+function (a) {
+if (Clazz_instanceOf (a, javax.swing.text.StyleContext.SmallAttributeSet)) {
+return a === this;
+}return ((this.getAttributeCount () == a.getAttributeCount ()) && this.containsAttributes (a));
+}, "javax.swing.text.AttributeSet");
+Clazz_overrideMethod (c$, "copyAttributes", 
+function () {
+return this;
+});
+Clazz_defineMethod (c$, "getAttribute", 
+function (a) {
+var b = this.getLocalAttribute (a);
+if (b == null) {
+var c = this.getResolveParent ();
+if (c != null) b = c.getAttribute (a);
+}return b;
+}, "~O");
+Clazz_defineMethod (c$, "getAttributeNames", 
+function () {
+return Clazz_innerTypeInstance (javax.swing.text.StyleContext.KeyEnumeration, this, null, this.attributes);
+});
+Clazz_overrideMethod (c$, "containsAttribute", 
+function (a, b) {
+return b.equals (this.getAttribute (a));
+}, "~O,~O");
+Clazz_overrideMethod (c$, "containsAttributes", 
+function (a) {
+var b = true;
+var c = a.getAttributeNames ();
+while (b && c.hasMoreElements ()) {
+var d = c.nextElement ();
+b = a.getAttribute (d).equals (this.getAttribute (d));
+}
+return b;
+}, "javax.swing.text.AttributeSet");
+Clazz_overrideMethod (c$, "getResolveParent", 
+function () {
+return this.resolveParent;
+});
+c$ = Clazz_p0p ();
+};
+c$.$StyleContext$KeyEnumeration$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_decorateAsClass (function () {
+Clazz_prepareCallback (this, arguments);
+this.attr = null;
+this.i = 0;
+Clazz_instantialize (this, arguments);
+}, javax.swing.text.StyleContext, "KeyEnumeration", null, java.util.Enumeration);
+Clazz_makeConstructor (c$, 
+function (a) {
+this.attr = a;
+this.i = 0;
+}, "~A");
+Clazz_overrideMethod (c$, "hasMoreElements", 
+function () {
+return this.i < this.attr.length;
+});
+Clazz_overrideMethod (c$, "nextElement", 
+function () {
+if (this.i < this.attr.length) {
+var a = this.attr[this.i];
+this.i += 2;
+return a;
+}throw  new java.util.NoSuchElementException ();
+});
+c$ = Clazz_p0p ();
+};
+c$.$StyleContext$KeyBuilder$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_decorateAsClass (function () {
+Clazz_prepareCallback (this, arguments);
+this.keys = null;
+this.data = null;
+Clazz_instantialize (this, arguments);
+}, javax.swing.text.StyleContext, "KeyBuilder");
+Clazz_prepareFields (c$, function () {
+this.keys =  new java.util.Vector ();
+this.data =  new java.util.Vector ();
+});
+Clazz_defineMethod (c$, "initialize", 
+function (a) {
+if (Clazz_instanceOf (a, javax.swing.text.StyleContext.SmallAttributeSet)) {
+this.initialize ((a).attributes);
+} else {
+this.keys.removeAllElements ();
+this.data.removeAllElements ();
+var b = a.getAttributeNames ();
+while (b.hasMoreElements ()) {
+var c = b.nextElement ();
+this.addAttribute (c, a.getAttribute (c));
+}
+}}, "javax.swing.text.AttributeSet");
+Clazz_defineMethod (c$, "initialize", 
+ function (a) {
+this.keys.removeAllElements ();
+this.data.removeAllElements ();
+var b = a.length;
+for (var c = 0; c < b; c += 2) {
+this.keys.addElement (a[c]);
+this.data.addElement (a[c + 1]);
+}
+}, "~A");
+Clazz_defineMethod (c$, "createTable", 
+function () {
+var a = this.keys.size ();
+var b =  new Array (2 * a);
+for (var c = 0; c < a; c++) {
+var d = 2 * c;
+b[d] = this.keys.elementAt (c);
+b[d + 1] = this.data.elementAt (c);
+}
+return b;
+});
+Clazz_defineMethod (c$, "getCount", 
+function () {
+return this.keys.size ();
+});
+Clazz_defineMethod (c$, "addAttribute", 
+function (a, b) {
+this.keys.addElement (a);
+this.data.addElement (b);
+}, "~O,~O");
+Clazz_defineMethod (c$, "addAttributes", 
+function (a) {
+if (Clazz_instanceOf (a, javax.swing.text.StyleContext.SmallAttributeSet)) {
+var b = (a).attributes;
+var c = b.length;
+for (var d = 0; d < c; d += 2) {
+this.addAttribute (b[d], b[d + 1]);
+}
+} else {
+var b = a.getAttributeNames ();
+while (b.hasMoreElements ()) {
+var c = b.nextElement ();
+this.addAttribute (c, a.getAttribute (c));
+}
+}}, "javax.swing.text.AttributeSet");
+Clazz_defineMethod (c$, "removeAttribute", 
+function (a) {
+var b = this.keys.size ();
+for (var c = 0; c < b; c++) {
+if (this.keys.elementAt (c).equals (a)) {
+this.keys.removeElementAt (c);
+this.data.removeElementAt (c);
+return;
+}}
+}, "~O");
+Clazz_defineMethod (c$, "removeAttributes", 
+function (a) {
+while (a.hasMoreElements ()) {
+var b = a.nextElement ();
+this.removeAttribute (b);
+}
+}, "java.util.Enumeration");
+Clazz_defineMethod (c$, "removeAttributes", 
+function (a) {
+var b = a.getAttributeNames ();
+while (b.hasMoreElements ()) {
+var c = b.nextElement ();
+var d = a.getAttribute (c);
+this.removeSearchAttribute (c, d);
+}
+}, "javax.swing.text.AttributeSet");
+Clazz_defineMethod (c$, "removeSearchAttribute", 
+ function (a, b) {
+var c = this.keys.size ();
+for (var d = 0; d < c; d++) {
+if (this.keys.elementAt (d).equals (a)) {
+if (this.data.elementAt (d).equals (b)) {
+this.keys.removeElementAt (d);
+this.data.removeElementAt (d);
+}return;
+}}
+}, "~O,~O");
+c$ = Clazz_p0p ();
+};
+c$.$StyleContext$NamedStyle$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_decorateAsClass (function () {
+Clazz_prepareCallback (this, arguments);
+this.listenerList = null;
+this.changeEvent = null;
+this.attributes = null;
+Clazz_instantialize (this, arguments);
+}, javax.swing.text.StyleContext, "NamedStyle", null, javax.swing.text.Style);
+Clazz_prepareFields (c$, function () {
+this.listenerList =  new javax.swing.event.EventListenerList ();
+});
+Clazz_makeConstructor (c$, 
+function (a, b) {
+this.attributes = this.b$["javax.swing.text.StyleContext"].getEmptySet ();
+if (a != null) {
+this.setName (a);
+}if (b != null) {
+this.setResolveParent (b);
+}}, "~S,javax.swing.text.Style");
+Clazz_makeConstructor (c$, 
+function (a) {
+this.construct (null, a);
+}, "javax.swing.text.Style");
+Clazz_makeConstructor (c$, 
+function () {
+this.attributes = this.b$["javax.swing.text.StyleContext"].getEmptySet ();
+});
+Clazz_defineMethod (c$, "toString", 
+function () {
+return "NamedStyle:" + this.getName () + " " + this.attributes;
+});
+Clazz_overrideMethod (c$, "getName", 
+function () {
+if (this.isDefined (javax.swing.text.StyleConstants.NameAttribute)) {
+return this.getAttribute (javax.swing.text.StyleConstants.NameAttribute).toString ();
+}return null;
+});
+Clazz_defineMethod (c$, "setName", 
+function (a) {
+if (a != null) {
+this.addAttribute (javax.swing.text.StyleConstants.NameAttribute, a);
+}}, "~S");
+Clazz_overrideMethod (c$, "addChangeListener", 
+function (a) {
+this.listenerList.add (javax.swing.event.ChangeListener, a);
+}, "javax.swing.event.ChangeListener");
+Clazz_overrideMethod (c$, "removeChangeListener", 
+function (a) {
+this.listenerList.remove (javax.swing.event.ChangeListener, a);
+}, "javax.swing.event.ChangeListener");
+Clazz_defineMethod (c$, "getChangeListeners", 
+function () {
+return this.listenerList.getListeners (javax.swing.event.ChangeListener);
+});
+Clazz_defineMethod (c$, "fireStateChanged", 
+function () {
+var a = this.listenerList.getListenerList ();
+for (var b = a.length - 2; b >= 0; b -= 2) {
+if (a[b] === javax.swing.event.ChangeListener) {
+if (this.changeEvent == null) this.changeEvent =  new javax.swing.event.ChangeEvent (this);
+(a[b + 1]).stateChanged (this.changeEvent);
+}}
+});
+Clazz_defineMethod (c$, "getListeners", 
+function (a) {
+return this.listenerList.getListeners (a);
+}, "Class");
+Clazz_defineMethod (c$, "getAttributeCount", 
+function () {
+return this.attributes.getAttributeCount ();
+});
+Clazz_defineMethod (c$, "isDefined", 
+function (a) {
+return this.attributes.isDefined (a);
+}, "~O");
+Clazz_defineMethod (c$, "isEqual", 
+function (a) {
+return this.attributes.isEqual (a);
+}, "javax.swing.text.AttributeSet");
+Clazz_defineMethod (c$, "copyAttributes", 
+function () {
+var a = Clazz_innerTypeInstance (javax.swing.text.StyleContext.NamedStyle, this, null);
+a.attributes = this.attributes.copyAttributes ();
+return a;
+});
+Clazz_defineMethod (c$, "getAttribute", 
+function (a) {
+return this.attributes.getAttribute (a);
+}, "~O");
+Clazz_defineMethod (c$, "getAttributeNames", 
+function () {
+return this.attributes.getAttributeNames ();
+});
+Clazz_defineMethod (c$, "containsAttribute", 
+function (a, b) {
+return this.attributes.containsAttribute (a, b);
+}, "~O,~O");
+Clazz_defineMethod (c$, "containsAttributes", 
+function (a) {
+return this.attributes.containsAttributes (a);
+}, "javax.swing.text.AttributeSet");
+Clazz_defineMethod (c$, "getResolveParent", 
+function () {
+return this.attributes.getResolveParent ();
+});
+Clazz_overrideMethod (c$, "addAttribute", 
+function (a, b) {
+var c = this.b$["javax.swing.text.StyleContext"];
+this.attributes = c.addAttribute (this.attributes, a, b);
+this.fireStateChanged ();
+}, "~O,~O");
+Clazz_overrideMethod (c$, "addAttributes", 
+function (a) {
+var b = this.b$["javax.swing.text.StyleContext"];
+this.attributes = b.addAttributes (this.attributes, a);
+this.fireStateChanged ();
+}, "javax.swing.text.AttributeSet");
+Clazz_overrideMethod (c$, "removeAttribute", 
+function (a) {
+var b = this.b$["javax.swing.text.StyleContext"];
+this.attributes = b.removeAttribute (this.attributes, a);
+this.fireStateChanged ();
+}, "~O");
+Clazz_defineMethod (c$, "removeAttributes", 
+function (a) {
+var b = this.b$["javax.swing.text.StyleContext"];
+this.attributes = b.removeAttributes (this.attributes, a);
+this.fireStateChanged ();
+}, "java.util.Enumeration");
+Clazz_defineMethod (c$, "removeAttributes", 
+function (a) {
+var b = this.b$["javax.swing.text.StyleContext"];
+if (a === this) {
+this.attributes = b.getEmptySet ();
+} else {
+this.attributes = b.removeAttributes (this.attributes, a);
+}this.fireStateChanged ();
+}, "javax.swing.text.AttributeSet");
+Clazz_overrideMethod (c$, "setResolveParent", 
+function (a) {
+if (a != null) {
+this.addAttribute (javax.swing.text.StyleConstants.ResolveAttribute, a);
+} else {
+this.removeAttribute (javax.swing.text.StyleConstants.ResolveAttribute);
+}}, "javax.swing.text.AttributeSet");
+c$ = Clazz_p0p ();
+};
+Clazz_pu$h(self.c$);
+c$ = Clazz_decorateAsClass (function () {
+this.family = null;
+this.style = 0;
+this.size = 0;
+Clazz_instantialize (this, arguments);
+}, javax.swing.text.StyleContext, "FontKey");
+Clazz_makeConstructor (c$, 
+function (a, b, c) {
+this.setValue (a, b, c);
+}, "~S,~N,~N");
+Clazz_defineMethod (c$, "setValue", 
+function (a, b, c) {
+this.family = (a != null) ? a.intern () : null;
+this.style = b;
+this.size = c;
+}, "~S,~N,~N");
+Clazz_overrideMethod (c$, "hashCode", 
+function () {
+var a = (this.family != null) ? this.family.hashCode () : 0;
+return a ^ this.style ^ this.size;
+});
+Clazz_overrideMethod (c$, "equals", 
+function (a) {
+if (Clazz_instanceOf (a, javax.swing.text.StyleContext.FontKey)) {
+var b = a;
+return (this.size == b.size) && (this.style == b.style) && (this.family === b.family);
+}return false;
+}, "~O");
+c$ = Clazz_p0p ();
+Clazz_defineStatics (c$,
+"defaultContext", null,
+"DEFAULT_STYLE", "default",
+"freezeKeyMap", null,
+"thawKeyMap", null,
+"THRESHOLD", 9);
+{
+}});
+Clazz_declarePackage ("javax.swing.text");
+Clazz_load (["javax.swing.text.MutableAttributeSet"], "javax.swing.text.Style", null, function () {
+Clazz_declareInterface (javax.swing.text, "Style", javax.swing.text.MutableAttributeSet);
+});
+Clazz_declarePackage ("javax.swing.text");
+Clazz_load (["javax.swing.text.AttributeSet", "$.MutableAttributeSet", "java.util.Hashtable"], "javax.swing.text.SimpleAttributeSet", ["java.util.Enumeration", "$.NoSuchElementException", "javax.swing.text.StyleConstants"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.table = null;
+Clazz_instantialize (this, arguments);
+}, javax.swing.text, "SimpleAttributeSet", null, [javax.swing.text.MutableAttributeSet, Cloneable]);
+Clazz_prepareFields (c$, function () {
+this.table =  new java.util.Hashtable (3);
+});
+Clazz_makeConstructor (c$, 
+function () {
+});
+Clazz_makeConstructor (c$, 
+function (source) {
+this.addAttributes (source);
+}, "javax.swing.text.AttributeSet");
+Clazz_defineMethod (c$, "isEmpty", 
+function () {
+return this.table.isEmpty ();
+});
+Clazz_defineMethod (c$, "getAttributeCount", 
+function () {
+return this.table.size ();
+});
+Clazz_overrideMethod (c$, "isDefined", 
+function (attrName) {
+return this.table.containsKey (attrName);
+}, "~O");
+Clazz_overrideMethod (c$, "isEqual", 
+function (attr) {
+return ((this.getAttributeCount () == attr.getAttributeCount ()) && this.containsAttributes (attr));
+}, "javax.swing.text.AttributeSet");
+Clazz_overrideMethod (c$, "copyAttributes", 
+function () {
+return this.clone ();
+});
+Clazz_defineMethod (c$, "getAttributeNames", 
+function () {
+return this.table.keys ();
+});
+Clazz_defineMethod (c$, "getAttribute", 
+function (name) {
+var value = this.table.get (name);
+if (value == null) {
+var parent = this.getResolveParent ();
+if (parent != null) {
+value = parent.getAttribute (name);
+}}return value;
+}, "~O");
+Clazz_overrideMethod (c$, "containsAttribute", 
+function (name, value) {
+return value.equals (this.getAttribute (name));
+}, "~O,~O");
+Clazz_overrideMethod (c$, "containsAttributes", 
+function (attributes) {
+var result = true;
+var names = attributes.getAttributeNames ();
+while (result && names.hasMoreElements ()) {
+var name = names.nextElement ();
+result = attributes.getAttribute (name).equals (this.getAttribute (name));
+}
+return result;
+}, "javax.swing.text.AttributeSet");
+Clazz_overrideMethod (c$, "addAttribute", 
+function (name, value) {
+this.table.put (name, value);
+}, "~O,~O");
+Clazz_overrideMethod (c$, "addAttributes", 
+function (attributes) {
+var names = attributes.getAttributeNames ();
+while (names.hasMoreElements ()) {
+var name = names.nextElement ();
+this.addAttribute (name, attributes.getAttribute (name));
+}
+}, "javax.swing.text.AttributeSet");
+Clazz_overrideMethod (c$, "removeAttribute", 
+function (name) {
+this.table.remove (name);
+}, "~O");
+Clazz_defineMethod (c$, "removeAttributes", 
+function (names) {
+while (names.hasMoreElements ()) this.removeAttribute (names.nextElement ());
+
+}, "java.util.Enumeration");
+Clazz_defineMethod (c$, "removeAttributes", 
+function (attributes) {
+if (attributes === this) {
+this.table.clear ();
+} else {
+var names = attributes.getAttributeNames ();
+while (names.hasMoreElements ()) {
+var name = names.nextElement ();
+var value = attributes.getAttribute (name);
+if (value.equals (this.getAttribute (name))) this.removeAttribute (name);
+}
+}}, "javax.swing.text.AttributeSet");
+Clazz_overrideMethod (c$, "getResolveParent", 
+function () {
+return this.table.get (javax.swing.text.StyleConstants.ResolveAttribute);
+});
+Clazz_overrideMethod (c$, "setResolveParent", 
+function (parent) {
+this.addAttribute (javax.swing.text.StyleConstants.ResolveAttribute, parent);
+}, "javax.swing.text.AttributeSet");
+Clazz_defineMethod (c$, "clone", 
+function () {
+var attr;
+try {
+attr = Clazz_superCall (this, javax.swing.text.SimpleAttributeSet, "clone", []);
+attr.table = this.table.clone ();
+} catch (cnse) {
+if (Clazz_exceptionOf (cnse, CloneNotSupportedException)) {
+attr = null;
+} else {
+throw cnse;
+}
+}
+return attr;
+});
+Clazz_overrideMethod (c$, "hashCode", 
+function () {
+return this.table.hashCode ();
+});
+Clazz_defineMethod (c$, "equals", 
+function (obj) {
+if (this === obj) {
+return true;
+}if (Clazz_instanceOf (obj, javax.swing.text.AttributeSet)) {
+var attrs = obj;
+return this.isEqual (attrs);
+}return false;
+}, "~O");
+Clazz_overrideMethod (c$, "toString", 
+function () {
+var s = "";
+var names = this.getAttributeNames ();
+while (names.hasMoreElements ()) {
+var key = names.nextElement ();
+var value = this.getAttribute (key);
+if (Clazz_instanceOf (value, javax.swing.text.AttributeSet)) {
+s = s + key + "=**AttributeSet** ";
+} else {
+s = s + key + "=" + value + " ";
+}}
+return s;
+});
+Clazz_pu$h(self.c$);
+c$ = Clazz_declareType (javax.swing.text.SimpleAttributeSet, "EmptyAttributeSet", null, javax.swing.text.AttributeSet);
+Clazz_defineMethod (c$, "getAttributeCount", 
+function () {
+return 0;
+});
+Clazz_overrideMethod (c$, "isDefined", 
+function (a) {
+return false;
+}, "~O");
+Clazz_overrideMethod (c$, "isEqual", 
+function (a) {
+return (a.getAttributeCount () == 0);
+}, "javax.swing.text.AttributeSet");
+Clazz_overrideMethod (c$, "copyAttributes", 
+function () {
+return this;
+});
+Clazz_overrideMethod (c$, "getAttribute", 
+function (a) {
+return null;
+}, "~O");
+Clazz_overrideMethod (c$, "getAttributeNames", 
+function () {
+return ((Clazz_isClassDefined ("javax.swing.text.SimpleAttributeSet$EmptyAttributeSet$1") ? 0 : javax.swing.text.SimpleAttributeSet.EmptyAttributeSet.$SimpleAttributeSet$EmptyAttributeSet$1$ ()), Clazz_innerTypeInstance (javax.swing.text.SimpleAttributeSet$EmptyAttributeSet$1, this, null));
+});
+Clazz_overrideMethod (c$, "containsAttribute", 
+function (a, b) {
+return false;
+}, "~O,~O");
+Clazz_overrideMethod (c$, "containsAttributes", 
+function (a) {
+return (a.getAttributeCount () == 0);
+}, "javax.swing.text.AttributeSet");
+Clazz_overrideMethod (c$, "getResolveParent", 
+function () {
+return null;
+});
+Clazz_overrideMethod (c$, "equals", 
+function (a) {
+if (this === a) {
+return true;
+}return ((Clazz_instanceOf (a, javax.swing.text.AttributeSet)) && ((a).getAttributeCount () == 0));
+}, "~O");
+Clazz_overrideMethod (c$, "hashCode", 
+function () {
+return 0;
+});
+c$.$SimpleAttributeSet$EmptyAttributeSet$1$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_declareAnonymous (javax.swing.text, "SimpleAttributeSet$EmptyAttributeSet$1", null, java.util.Enumeration);
+Clazz_overrideMethod (c$, "hasMoreElements", 
+function () {
+return false;
+});
+Clazz_overrideMethod (c$, "nextElement", 
+function () {
+throw  new java.util.NoSuchElementException ();
+});
+c$ = Clazz_p0p ();
+};
+c$ = Clazz_p0p ();
+c$.EMPTY = c$.prototype.EMPTY =  new javax.swing.text.SimpleAttributeSet.EmptyAttributeSet ();
+});
+Clazz_declarePackage ("javax.swing.text");
+Clazz_load (null, "javax.swing.text.Utilities", ["javax.swing.JComponent", "javax.swing.text.CompositeView", "$.Position", "$.StyleConstants", "$.StyledDocument"], function () {
+c$ = Clazz_declareType (javax.swing.text, "Utilities");
+c$.getJComponent = Clazz_defineMethod (c$, "getJComponent", 
+function (view) {
+if (view != null) {
+var component = view.getContainer ();
+if (Clazz_instanceOf (component, javax.swing.JComponent)) {
+return component;
+}}return null;
+}, "javax.swing.text.View");
+c$.getTabbedTextWidth = Clazz_defineMethod (c$, "getTabbedTextWidth", 
+function (s, metrics, x, e, startOffset) {
+return javax.swing.text.Utilities.getTabbedTextWidth (null, s, metrics, x, e, startOffset, null);
+}, "javax.swing.text.Segment,java.awt.FontMetrics,~N,javax.swing.text.TabExpander,~N");
+c$.getTabbedTextWidth = Clazz_defineMethod (c$, "getTabbedTextWidth", 
+function (view, s, metrics, x, e, startOffset, justificationData) {
+var nextX = x;
+var txt = s.array;
+var txtOffset = s.offset;
+var n = s.offset + s.count;
+var charCount = 0;
+var spaceAddon = 0;
+var spaceAddonLeftoverEnd = -1;
+var startJustifiableContent = 0;
+var endJustifiableContent = 0;
+if (justificationData != null) {
+var offset = -startOffset + txtOffset;
+var parent = null;
+if (view != null && (parent = view.getParent ()) != null) {
+offset += parent.getStartOffset ();
+}spaceAddon = justificationData[0];
+spaceAddonLeftoverEnd = justificationData[1] + offset;
+startJustifiableContent = justificationData[2] + offset;
+endJustifiableContent = justificationData[3] + offset;
+}for (var i = txtOffset; i < n; i++) {
+if (txt[i] == '\t' || ((spaceAddon != 0 || i <= spaceAddonLeftoverEnd) && (txt[i] == ' ') && startJustifiableContent <= i && i <= endJustifiableContent)) {
+nextX += metrics.charsWidth (txt, i - charCount, charCount);
+charCount = 0;
+if (txt[i] == '\t') {
+if (e != null) {
+nextX = Clazz_floatToInt (e.nextTabStop (nextX, startOffset + i - txtOffset));
+} else {
+nextX += metrics.charWidth (' ');
+}} else if (txt[i] == ' ') {
+nextX += metrics.charWidth (' ') + spaceAddon;
+if (i <= spaceAddonLeftoverEnd) {
+nextX++;
+}}} else if (txt[i] == '\n') {
+nextX += metrics.charsWidth (txt, i - charCount, charCount);
+charCount = 0;
+} else {
+charCount++;
+}}
+nextX += metrics.charsWidth (txt, n - charCount, charCount);
+return nextX - x;
+}, "javax.swing.text.View,javax.swing.text.Segment,java.awt.FontMetrics,~N,javax.swing.text.TabExpander,~N,~A");
+c$.getTabbedTextOffset = Clazz_defineMethod (c$, "getTabbedTextOffset", 
+function (s, metrics, x0, x, e, startOffset) {
+return javax.swing.text.Utilities.getTabbedTextOffset (s, metrics, x0, x, e, startOffset, true);
+}, "javax.swing.text.Segment,java.awt.FontMetrics,~N,~N,javax.swing.text.TabExpander,~N");
+c$.getTabbedTextOffset = Clazz_defineMethod (c$, "getTabbedTextOffset", 
+function (view, s, metrics, x0, x, e, startOffset, justificationData) {
+return javax.swing.text.Utilities.getTabbedTextOffset (view, s, metrics, x0, x, e, startOffset, true, justificationData);
+}, "javax.swing.text.View,javax.swing.text.Segment,java.awt.FontMetrics,~N,~N,javax.swing.text.TabExpander,~N,~A");
+c$.getTabbedTextOffset = Clazz_defineMethod (c$, "getTabbedTextOffset", 
+function (s, metrics, x0, x, e, startOffset, round) {
+return javax.swing.text.Utilities.getTabbedTextOffset (null, s, metrics, x0, x, e, startOffset, round, null);
+}, "javax.swing.text.Segment,java.awt.FontMetrics,~N,~N,javax.swing.text.TabExpander,~N,~B");
+c$.getTabbedTextOffset = Clazz_defineMethod (c$, "getTabbedTextOffset", 
+function (view, s, metrics, x0, x, e, startOffset, round, justificationData) {
+if (x0 >= x) {
+return 0;
+}var currX = x0;
+var nextX = currX;
+var txt = s.array;
+var txtOffset = s.offset;
+var txtCount = s.count;
+var spaceAddon = 0;
+var spaceAddonLeftoverEnd = -1;
+var startJustifiableContent = 0;
+var endJustifiableContent = 0;
+if (justificationData != null) {
+var offset = -startOffset + txtOffset;
+var parent = null;
+if (view != null && (parent = view.getParent ()) != null) {
+offset += parent.getStartOffset ();
+}spaceAddon = justificationData[0];
+spaceAddonLeftoverEnd = justificationData[1] + offset;
+startJustifiableContent = justificationData[2] + offset;
+endJustifiableContent = justificationData[3] + offset;
+}var n = s.offset + s.count;
+for (var i = s.offset; i < n; i++) {
+if (txt[i] == '\t' || ((spaceAddon != 0 || i <= spaceAddonLeftoverEnd) && (txt[i] == ' ') && startJustifiableContent <= i && i <= endJustifiableContent)) {
+if (txt[i] == '\t') {
+if (e != null) {
+nextX = Clazz_floatToInt (e.nextTabStop (nextX, startOffset + i - txtOffset));
+} else {
+nextX += metrics.charWidth (' ');
+}} else if (txt[i] == ' ') {
+nextX += metrics.charWidth (' ') + spaceAddon;
+if (i <= spaceAddonLeftoverEnd) {
+nextX++;
+}}} else {
+nextX += metrics.charWidth (txt[i]);
+}if ((x >= currX) && (x < nextX)) {
+if ((round == false) || ((x - currX) < (nextX - x))) {
+return i - txtOffset;
+} else {
+return i + 1 - txtOffset;
+}}currX = nextX;
+}
+return txtCount;
+}, "javax.swing.text.View,javax.swing.text.Segment,java.awt.FontMetrics,~N,~N,javax.swing.text.TabExpander,~N,~B,~A");
+c$.getBreakLocation = Clazz_defineMethod (c$, "getBreakLocation", 
+function (s, metrics, x0, x, e, startOffset) {
+return 0;
+}, "javax.swing.text.Segment,java.awt.FontMetrics,~N,~N,javax.swing.text.TabExpander,~N");
+c$.getRowStart = Clazz_defineMethod (c$, "getRowStart", 
+function (c, offs) {
+var r = c.modelToView (offs);
+if (r == null) {
+return -1;
+}var lastOffs = offs;
+var y = r.y;
+while ((r != null) && (y == r.y)) {
+if (r.height != 0) {
+offs = lastOffs;
+}lastOffs -= 1;
+r = (lastOffs >= 0) ? c.modelToView (lastOffs) : null;
+}
+return offs;
+}, "javax.swing.text.JTextComponent,~N");
+c$.getRowEnd = Clazz_defineMethod (c$, "getRowEnd", 
+function (c, offs) {
+var r = c.modelToView (offs);
+if (r == null) {
+return -1;
+}var n = c.getDocument ().getLength ();
+var lastOffs = offs;
+var y = r.y;
+while ((r != null) && (y == r.y)) {
+if (r.height != 0) {
+offs = lastOffs;
+}lastOffs += 1;
+r = (lastOffs <= n) ? c.modelToView (lastOffs) : null;
+}
+return offs;
+}, "javax.swing.text.JTextComponent,~N");
+c$.getPositionAbove = Clazz_defineMethod (c$, "getPositionAbove", 
+function (c, offs, x) {
+var lastOffs = javax.swing.text.Utilities.getRowStart (c, offs) - 1;
+if (lastOffs < 0) {
+return -1;
+}var bestSpan = 2147483647;
+var y = 0;
+var r = null;
+if (lastOffs >= 0) {
+r = c.modelToView (lastOffs);
+y = r.y;
+}while ((r != null) && (y == r.y)) {
+var span = Math.abs (r.x - x);
+if (span < bestSpan) {
+offs = lastOffs;
+bestSpan = span;
+}lastOffs -= 1;
+r = (lastOffs >= 0) ? c.modelToView (lastOffs) : null;
+}
+return offs;
+}, "javax.swing.text.JTextComponent,~N,~N");
+c$.getPositionBelow = Clazz_defineMethod (c$, "getPositionBelow", 
+function (c, offs, x) {
+var lastOffs = javax.swing.text.Utilities.getRowEnd (c, offs) + 1;
+if (lastOffs <= 0) {
+return -1;
+}var bestSpan = 2147483647;
+var n = c.getDocument ().getLength ();
+var y = 0;
+var r = null;
+if (lastOffs <= n) {
+r = c.modelToView (lastOffs);
+y = r.y;
+}while ((r != null) && (y == r.y)) {
+var span = Math.abs (x - r.x);
+if (span < bestSpan) {
+offs = lastOffs;
+bestSpan = span;
+}lastOffs += 1;
+r = (lastOffs <= n) ? c.modelToView (lastOffs) : null;
+}
+return offs;
+}, "javax.swing.text.JTextComponent,~N,~N");
+c$.getWordStart = Clazz_defineMethod (c$, "getWordStart", 
+function (c, offs) {
+return 0;
+}, "javax.swing.text.JTextComponent,~N");
+c$.getWordEnd = Clazz_defineMethod (c$, "getWordEnd", 
+function (c, offs) {
+return 0;
+}, "javax.swing.text.JTextComponent,~N");
+c$.getNextWord = Clazz_defineMethod (c$, "getNextWord", 
+function (c, offs) {
+var nextWord;
+var line = javax.swing.text.Utilities.getParagraphElement (c, offs);
+for (nextWord = javax.swing.text.Utilities.getNextWordInParagraph (c, line, offs, false); nextWord == -1; nextWord = javax.swing.text.Utilities.getNextWordInParagraph (c, line, offs, true)) {
+offs = line.getEndOffset ();
+line = javax.swing.text.Utilities.getParagraphElement (c, offs);
+}
+return nextWord;
+}, "javax.swing.text.JTextComponent,~N");
+c$.getNextWordInParagraph = Clazz_defineMethod (c$, "getNextWordInParagraph", 
+function (c, line, offs, first) {
+return 0;
+}, "javax.swing.text.JTextComponent,javax.swing.text.Element,~N,~B");
+c$.getPreviousWord = Clazz_defineMethod (c$, "getPreviousWord", 
+function (c, offs) {
+var prevWord;
+var line = javax.swing.text.Utilities.getParagraphElement (c, offs);
+for (prevWord = javax.swing.text.Utilities.getPrevWordInParagraph (c, line, offs); prevWord == -1; prevWord = javax.swing.text.Utilities.getPrevWordInParagraph (c, line, offs)) {
+offs = line.getStartOffset () - 1;
+line = javax.swing.text.Utilities.getParagraphElement (c, offs);
+}
+return prevWord;
+}, "javax.swing.text.JTextComponent,~N");
+c$.getPrevWordInParagraph = Clazz_defineMethod (c$, "getPrevWordInParagraph", 
+function (c, line, offs) {
+return 0;
+}, "javax.swing.text.JTextComponent,javax.swing.text.Element,~N");
+c$.getParagraphElement = Clazz_defineMethod (c$, "getParagraphElement", 
+function (c, offs) {
+var doc = c.getDocument ();
+if (Clazz_instanceOf (doc, javax.swing.text.StyledDocument)) {
+return (doc).getParagraphElement (offs);
+}var map = doc.getDefaultRootElement ();
+var index = map.getElementIndex (offs);
+var paragraph = map.getElement (index);
+if ((offs >= paragraph.getStartOffset ()) && (offs < paragraph.getEndOffset ())) {
+return paragraph;
+}return null;
+}, "javax.swing.text.JTextComponent,~N");
+c$.isComposedTextElement = Clazz_defineMethod (c$, "isComposedTextElement", 
+function (doc, offset) {
+var elem = doc.getDefaultRootElement ();
+while (!elem.isLeaf ()) {
+elem = elem.getElement (elem.getElementIndex (offset));
+}
+return javax.swing.text.Utilities.isComposedTextElement (elem);
+}, "javax.swing.text.Document,~N");
+c$.isComposedTextElement = Clazz_defineMethod (c$, "isComposedTextElement", 
+function (elem) {
+var as = elem.getAttributes ();
+return javax.swing.text.Utilities.isComposedTextAttributeDefined (as);
+}, "javax.swing.text.Element");
+c$.isComposedTextAttributeDefined = Clazz_defineMethod (c$, "isComposedTextAttributeDefined", 
+function (as) {
+return ((as != null) && (as.isDefined (javax.swing.text.StyleConstants.ComposedTextAttribute)));
+}, "javax.swing.text.AttributeSet");
+c$.isLeftToRight = Clazz_defineMethod (c$, "isLeftToRight", 
+function (c) {
+return c.getComponentOrientation ().isLeftToRight ();
+}, "java.awt.Component");
+c$.getNextVisualPositionFrom = Clazz_defineMethod (c$, "getNextVisualPositionFrom", 
+function (v, pos, b, alloc, direction, biasRet) {
+if (v.getViewCount () == 0) {
+return pos;
+}var top = (direction == 1 || direction == 7);
+var retValue;
+if (pos == -1) {
+var childIndex = (top) ? v.getViewCount () - 1 : 0;
+var child = v.getView (childIndex);
+var childBounds = v.getChildAllocation (childIndex, alloc);
+retValue = child.getNextVisualPositionFrom (pos, b, childBounds, direction, biasRet);
+if (retValue == -1 && !top && v.getViewCount () > 1) {
+child = v.getView (1);
+childBounds = v.getChildAllocation (1, alloc);
+retValue = child.getNextVisualPositionFrom (-1, biasRet[0], childBounds, direction, biasRet);
+}} else {
+var increment = (top) ? -1 : 1;
+var childIndex;
+if (b === javax.swing.text.Position.Bias.Backward && pos > 0) {
+childIndex = v.getViewIndex (pos - 1, javax.swing.text.Position.Bias.Forward);
+} else {
+childIndex = v.getViewIndex (pos, javax.swing.text.Position.Bias.Forward);
+}var child = v.getView (childIndex);
+var childBounds = v.getChildAllocation (childIndex, alloc);
+retValue = child.getNextVisualPositionFrom (pos, b, childBounds, direction, biasRet);
+if ((direction == 3 || direction == 7) && (Clazz_instanceOf (v, javax.swing.text.CompositeView)) && (v).flipEastAndWestAtEnds (pos, b)) {
+increment *= -1;
+}childIndex += increment;
+if (retValue == -1 && childIndex >= 0 && childIndex < v.getViewCount ()) {
+child = v.getView (childIndex);
+childBounds = v.getChildAllocation (childIndex, alloc);
+retValue = child.getNextVisualPositionFrom (-1, b, childBounds, direction, biasRet);
+if (retValue == pos && biasRet[0] !== b) {
+return javax.swing.text.Utilities.getNextVisualPositionFrom (v, pos, biasRet[0], alloc, direction, biasRet);
+}} else if (retValue != -1 && biasRet[0] !== b && ((increment == 1 && child.getEndOffset () == retValue) || (increment == -1 && child.getStartOffset () == retValue)) && childIndex >= 0 && childIndex < v.getViewCount ()) {
+child = v.getView (childIndex);
+childBounds = v.getChildAllocation (childIndex, alloc);
+var originalBias = biasRet[0];
+var nextPos = child.getNextVisualPositionFrom (-1, b, childBounds, direction, biasRet);
+if (biasRet[0] === b) {
+retValue = nextPos;
+} else {
+biasRet[0] = originalBias;
+}}}return retValue;
+}, "javax.swing.text.View,~N,javax.swing.text.Position.Bias,java.awt.Shape,~N,~A");
+});
+Clazz_declarePackage ("javax.swing.text");
+Clazz_load (["javax.swing.text.View"], "javax.swing.text.CompositeView", ["java.lang.IllegalArgumentException", "java.awt.Rectangle", "javax.swing.text.BadLocationException", "$.Position", "$.StyleConstants", "$.Utilities"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.children = null;
+this.nchildren = 0;
+this.left = 0;
+this.right = 0;
+this.top = 0;
+this.bottom = 0;
+this.childAlloc = null;
+Clazz_instantialize (this, arguments);
+}, javax.swing.text, "CompositeView", javax.swing.text.View);
+Clazz_makeConstructor (c$, 
+function (elem) {
+Clazz_superConstructor (this, javax.swing.text.CompositeView, [elem]);
+this.children =  new Array (1);
+this.nchildren = 0;
+this.childAlloc =  new java.awt.Rectangle ();
+}, "javax.swing.text.Element");
+Clazz_defineMethod (c$, "loadChildren", 
+function (f) {
+if (f == null) {
+return;
+}var e = this.getElement ();
+var n = e.getElementCount ();
+if (n > 0) {
+var added =  new Array (n);
+for (var i = 0; i < n; i++) {
+added[i] = f.create (e.getElement (i));
+}
+this.replace (0, 0, added);
+}}, "javax.swing.text.ViewFactory");
+Clazz_defineMethod (c$, "setParent", 
+function (parent) {
+Clazz_superCall (this, javax.swing.text.CompositeView, "setParent", [parent]);
+if ((parent != null) && (this.nchildren == 0)) {
+var f = this.getViewFactory ();
+this.loadChildren (f);
+}}, "javax.swing.text.View");
+Clazz_overrideMethod (c$, "getViewCount", 
+function () {
+return this.nchildren;
+});
+Clazz_overrideMethod (c$, "getView", 
+function (n) {
+return this.children[n];
+}, "~N");
+Clazz_overrideMethod (c$, "replace", 
+function (offset, length, views) {
+if (views == null) {
+views = javax.swing.text.CompositeView.ZERO;
+}for (var i = offset; i < offset + length; i++) {
+if (this.children[i].getParent () === this) {
+this.children[i].setParent (null);
+}this.children[i] = null;
+}
+var delta = views.length - length;
+var src = offset + length;
+var nmove = this.nchildren - src;
+var dest = src + delta;
+if ((this.nchildren + delta) >= this.children.length) {
+var newLength = Math.max (2 * this.children.length, this.nchildren + delta);
+var newChildren =  new Array (newLength);
+System.arraycopy (this.children, 0, newChildren, 0, offset);
+System.arraycopy (views, 0, newChildren, offset, views.length);
+System.arraycopy (this.children, src, newChildren, dest, nmove);
+this.children = newChildren;
+} else {
+System.arraycopy (this.children, src, this.children, dest, nmove);
+System.arraycopy (views, 0, this.children, offset, views.length);
+}this.nchildren = this.nchildren + delta;
+for (var i = 0; i < views.length; i++) {
+views[i].setParent (this);
+}
+}, "~N,~N,~A");
+Clazz_overrideMethod (c$, "getChildAllocation", 
+function (index, a) {
+var alloc = this.getInsideAllocation (a);
+this.childAllocation (index, alloc);
+return alloc;
+}, "~N,java.awt.Shape");
+Clazz_defineMethod (c$, "modelToView", 
+function (pos, a, b) {
+var isBackward = (b === javax.swing.text.Position.Bias.Backward);
+var testPos = (isBackward) ? Math.max (0, pos - 1) : pos;
+if (isBackward && testPos < this.getStartOffset ()) {
+return null;
+}var vIndex = this.getViewIndexAtPosition (testPos);
+if ((vIndex != -1) && (vIndex < this.getViewCount ())) {
+var v = this.getView (vIndex);
+if (v != null && testPos >= v.getStartOffset () && testPos < v.getEndOffset ()) {
+var childShape = this.getChildAllocation (vIndex, a);
+if (childShape == null) {
+return null;
+}var retShape = v.modelToView (pos, childShape, b);
+if (retShape == null && v.getEndOffset () == pos) {
+if (++vIndex < this.getViewCount ()) {
+v = this.getView (vIndex);
+retShape = v.modelToView (pos, this.getChildAllocation (vIndex, a), b);
+}}return retShape;
+}}throw  new javax.swing.text.BadLocationException ("Position not represented by view", pos);
+}, "~N,java.awt.Shape,javax.swing.text.Position.Bias");
+Clazz_defineMethod (c$, "modelToView", 
+function (p0, b0, p1, b1, a) {
+if (p0 == this.getStartOffset () && p1 == this.getEndOffset ()) {
+return a;
+}var alloc = this.getInsideAllocation (a);
+var r0 =  new java.awt.Rectangle (alloc);
+var v0 = this.getViewAtPosition ((b0 === javax.swing.text.Position.Bias.Backward) ? Math.max (0, p0 - 1) : p0, r0);
+var r1 =  new java.awt.Rectangle (alloc);
+var v1 = this.getViewAtPosition ((b1 === javax.swing.text.Position.Bias.Backward) ? Math.max (0, p1 - 1) : p1, r1);
+if (v0 === v1) {
+if (v0 == null) {
+return a;
+}return v0.modelToView (p0, b0, p1, b1, r0);
+}var viewCount = this.getViewCount ();
+var counter = 0;
+while (counter < viewCount) {
+var v;
+if ((v = this.getView (counter)) === v0 || v === v1) {
+var endView;
+var retRect;
+var tempRect =  new java.awt.Rectangle ();
+if (v === v0) {
+retRect = v0.modelToView (p0, b0, v0.getEndOffset (), javax.swing.text.Position.Bias.Backward, r0).getBounds ();
+endView = v1;
+} else {
+retRect = v1.modelToView (v1.getStartOffset (), javax.swing.text.Position.Bias.Forward, p1, b1, r1).getBounds ();
+endView = v0;
+}while (++counter < viewCount && (v = this.getView (counter)) !== endView) {
+tempRect.setBounds (alloc);
+this.childAllocation (counter, tempRect);
+retRect.add (tempRect);
+}
+if (endView != null) {
+var endShape;
+if (endView === v1) {
+endShape = v1.modelToView (v1.getStartOffset (), javax.swing.text.Position.Bias.Forward, p1, b1, r1);
+} else {
+endShape = v0.modelToView (p0, b0, v0.getEndOffset (), javax.swing.text.Position.Bias.Backward, r0);
+}if (Clazz_instanceOf (endShape, java.awt.Rectangle)) {
+retRect.add (endShape);
+} else {
+retRect.add (endShape.getBounds ());
+}}return retRect;
+}counter++;
+}
+throw  new javax.swing.text.BadLocationException ("Position not represented by view", p0);
+}, "~N,javax.swing.text.Position.Bias,~N,javax.swing.text.Position.Bias,java.awt.Shape");
+Clazz_defineMethod (c$, "viewToModel", 
+function (x, y, a, bias) {
+var alloc = this.getInsideAllocation (a);
+if (this.isBefore (Clazz_floatToInt (x), Clazz_floatToInt (y), alloc)) {
+var retValue = -1;
+try {
+retValue = this.getNextVisualPositionFrom (-1, javax.swing.text.Position.Bias.Forward, a, 3, bias);
+} catch (e$$) {
+if (Clazz_exceptionOf (e$$, javax.swing.text.BadLocationException)) {
+var ble = e$$;
+{
+}
+} else if (Clazz_exceptionOf (e$$, IllegalArgumentException)) {
+var iae = e$$;
+{
+}
+} else {
+throw e$$;
+}
+}
+if (retValue == -1) {
+retValue = this.getStartOffset ();
+bias[0] = javax.swing.text.Position.Bias.Forward;
+}return retValue;
+} else if (this.isAfter (Clazz_floatToInt (x), Clazz_floatToInt (y), alloc)) {
+var retValue = -1;
+try {
+retValue = this.getNextVisualPositionFrom (-1, javax.swing.text.Position.Bias.Forward, a, 7, bias);
+} catch (e$$) {
+if (Clazz_exceptionOf (e$$, javax.swing.text.BadLocationException)) {
+var ble = e$$;
+{
+}
+} else if (Clazz_exceptionOf (e$$, IllegalArgumentException)) {
+var iae = e$$;
+{
+}
+} else {
+throw e$$;
+}
+}
+if (retValue == -1) {
+retValue = this.getEndOffset () - 1;
+bias[0] = javax.swing.text.Position.Bias.Forward;
+}return retValue;
+} else {
+var v = this.getViewAtPoint (Clazz_floatToInt (x), Clazz_floatToInt (y), alloc);
+if (v != null) {
+return v.viewToModel (x, y, alloc, bias);
+}}return -1;
+}, "~N,~N,java.awt.Shape,~A");
+Clazz_overrideMethod (c$, "getNextVisualPositionFrom", 
+function (pos, b, a, direction, biasRet) {
+switch (direction) {
+case 1:
+return this.getNextNorthSouthVisualPositionFrom (pos, b, a, direction, biasRet);
+case 5:
+return this.getNextNorthSouthVisualPositionFrom (pos, b, a, direction, biasRet);
+case 3:
+return this.getNextEastWestVisualPositionFrom (pos, b, a, direction, biasRet);
+case 7:
+return this.getNextEastWestVisualPositionFrom (pos, b, a, direction, biasRet);
+default:
+throw  new IllegalArgumentException ("Bad direction: " + direction);
+}
+}, "~N,javax.swing.text.Position.Bias,java.awt.Shape,~N,~A");
+Clazz_defineMethod (c$, "getViewIndex", 
+function (pos, b) {
+if (b === javax.swing.text.Position.Bias.Backward) {
+pos -= 1;
+}if ((pos >= this.getStartOffset ()) && (pos < this.getEndOffset ())) {
+return this.getViewIndexAtPosition (pos);
+}return -1;
+}, "~N,javax.swing.text.Position.Bias");
+Clazz_defineMethod (c$, "getViewAtPosition", 
+function (pos, a) {
+var index = this.getViewIndexAtPosition (pos);
+if ((index >= 0) && (index < this.getViewCount ())) {
+var v = this.getView (index);
+if (a != null) {
+this.childAllocation (index, a);
+}return v;
+}return null;
+}, "~N,java.awt.Rectangle");
+Clazz_defineMethod (c$, "getViewIndexAtPosition", 
+function (pos) {
+var elem = this.getElement ();
+return elem.getElementIndex (pos);
+}, "~N");
+Clazz_defineMethod (c$, "getInsideAllocation", 
+function (a) {
+if (a != null) {
+var alloc;
+if (Clazz_instanceOf (a, java.awt.Rectangle)) {
+alloc = a;
+} else {
+alloc = a.getBounds ();
+}this.childAlloc.setBounds (alloc);
+this.childAlloc.x += this.getLeftInset ();
+this.childAlloc.y += this.getTopInset ();
+this.childAlloc.width -= this.getLeftInset () + this.getRightInset ();
+this.childAlloc.height -= this.getTopInset () + this.getBottomInset ();
+return this.childAlloc;
+}return null;
+}, "java.awt.Shape");
+Clazz_defineMethod (c$, "setParagraphInsets", 
+function (attr) {
+this.top = Clazz_floatToShort (javax.swing.text.StyleConstants.getSpaceAbove (attr));
+this.left = Clazz_floatToShort (javax.swing.text.StyleConstants.getLeftIndent (attr));
+this.bottom = Clazz_floatToShort (javax.swing.text.StyleConstants.getSpaceBelow (attr));
+this.right = Clazz_floatToShort (javax.swing.text.StyleConstants.getRightIndent (attr));
+}, "javax.swing.text.AttributeSet");
+Clazz_defineMethod (c$, "setInsets", 
+function (top, left, bottom, right) {
+this.top = top;
+this.left = left;
+this.right = right;
+this.bottom = bottom;
+}, "~N,~N,~N,~N");
+Clazz_defineMethod (c$, "getLeftInset", 
+function () {
+return this.left;
+});
+Clazz_defineMethod (c$, "getRightInset", 
+function () {
+return this.right;
+});
+Clazz_defineMethod (c$, "getTopInset", 
+function () {
+return this.top;
+});
+Clazz_defineMethod (c$, "getBottomInset", 
+function () {
+return this.bottom;
+});
+Clazz_defineMethod (c$, "getNextNorthSouthVisualPositionFrom", 
+function (pos, b, a, direction, biasRet) {
+return javax.swing.text.Utilities.getNextVisualPositionFrom (this, pos, b, a, direction, biasRet);
+}, "~N,javax.swing.text.Position.Bias,java.awt.Shape,~N,~A");
+Clazz_defineMethod (c$, "getNextEastWestVisualPositionFrom", 
+function (pos, b, a, direction, biasRet) {
+return javax.swing.text.Utilities.getNextVisualPositionFrom (this, pos, b, a, direction, biasRet);
+}, "~N,javax.swing.text.Position.Bias,java.awt.Shape,~N,~A");
+Clazz_defineMethod (c$, "flipEastAndWestAtEnds", 
+function (position, bias) {
+return false;
+}, "~N,javax.swing.text.Position.Bias");
+c$.ZERO = c$.prototype.ZERO =  new Array (0);
+});
+Clazz_declarePackage ("javax.swing.text");
+Clazz_load (["javax.swing.SwingConstants"], "javax.swing.text.View", ["java.lang.IllegalArgumentException", "java.awt.Rectangle", "javax.swing.event.DocumentEvent", "javax.swing.text.Position", "$.Utilities"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.parent = null;
+this.elem = null;
+Clazz_instantialize (this, arguments);
+}, javax.swing.text, "View", null, javax.swing.SwingConstants);
+Clazz_makeConstructor (c$, 
+function (elem) {
+this.elem = elem;
+}, "javax.swing.text.Element");
+Clazz_defineMethod (c$, "getParent", 
+function () {
+return this.parent;
+});
+Clazz_defineMethod (c$, "isVisible", 
+function () {
+return true;
+});
+Clazz_defineMethod (c$, "getMinimumSpan", 
+function (axis) {
+var w = this.getResizeWeight (axis);
+if (w == 0) {
+return this.getPreferredSpan (axis);
+}return 0;
+}, "~N");
+Clazz_defineMethod (c$, "getMaximumSpan", 
+function (axis) {
+var w = this.getResizeWeight (axis);
+if (w == 0) {
+return this.getPreferredSpan (axis);
+}return 2147483647;
+}, "~N");
+Clazz_defineMethod (c$, "preferenceChanged", 
+function (child, width, height) {
+var parent = this.getParent ();
+if (parent != null) {
+parent.preferenceChanged (this, width, height);
+}}, "javax.swing.text.View,~B,~B");
+Clazz_defineMethod (c$, "getAlignment", 
+function (axis) {
+return 0.5;
+}, "~N");
+Clazz_defineMethod (c$, "setParent", 
+function (parent) {
+if (parent == null) {
+for (var i = 0; i < this.getViewCount (); i++) {
+if (this.getView (i).getParent () === this) {
+this.getView (i).setParent (null);
+}}
+}this.parent = parent;
+}, "javax.swing.text.View");
+Clazz_defineMethod (c$, "getViewCount", 
+function () {
+return 0;
+});
+Clazz_defineMethod (c$, "getView", 
+function (n) {
+return null;
+}, "~N");
+Clazz_defineMethod (c$, "removeAll", 
+function () {
+this.replace (0, this.getViewCount (), null);
+});
+Clazz_defineMethod (c$, "remove", 
+function (i) {
+this.replace (i, 1, null);
+}, "~N");
+Clazz_defineMethod (c$, "insert", 
+function (offs, v) {
+var one =  new Array (1);
+one[0] = v;
+this.replace (offs, 0, one);
+}, "~N,javax.swing.text.View");
+Clazz_defineMethod (c$, "append", 
+function (v) {
+var one =  new Array (1);
+one[0] = v;
+this.replace (this.getViewCount (), 0, one);
+}, "javax.swing.text.View");
+Clazz_defineMethod (c$, "replace", 
+function (offset, length, views) {
+}, "~N,~N,~A");
+Clazz_defineMethod (c$, "getViewIndex", 
+function (pos, b) {
+return -1;
+}, "~N,javax.swing.text.Position.Bias");
+Clazz_defineMethod (c$, "getChildAllocation", 
+function (index, a) {
+return null;
+}, "~N,java.awt.Shape");
+Clazz_defineMethod (c$, "getNextVisualPositionFrom", 
+function (pos, b, a, direction, biasRet) {
+biasRet[0] = javax.swing.text.Position.Bias.Forward;
+switch (direction) {
+case 1:
+case 5:
+{
+if (pos == -1) {
+pos = (direction == 1) ? Math.max (0, this.getEndOffset () - 1) : this.getStartOffset ();
+break;
+}var target = this.getContainer ();
+var c = (target != null) ? target.getCaret () : null;
+var mcp;
+if (c != null) {
+mcp = c.getMagicCaretPosition ();
+} else {
+mcp = null;
+}var x;
+if (mcp == null) {
+var loc = target.modelToView (pos);
+x = (loc == null) ? 0 : loc.x;
+} else {
+x = mcp.x;
+}if (direction == 1) {
+pos = javax.swing.text.Utilities.getPositionAbove (target, pos, x);
+} else {
+pos = javax.swing.text.Utilities.getPositionBelow (target, pos, x);
+}}break;
+case 7:
+if (pos == -1) {
+pos = Math.max (0, this.getEndOffset () - 1);
+} else {
+pos = Math.max (0, pos - 1);
+}break;
+case 3:
+if (pos == -1) {
+pos = this.getStartOffset ();
+} else {
+pos = Math.min (pos + 1, this.getDocument ().getLength ());
+}break;
+default:
+throw  new IllegalArgumentException ("Bad direction: " + direction);
+}
+return pos;
+}, "~N,javax.swing.text.Position.Bias,java.awt.Shape,~N,~A");
+Clazz_defineMethod (c$, "modelToView", 
+function (p0, b0, p1, b1, a) {
+var s0 = this.modelToView (p0, a, b0);
+var s1;
+if (p1 == this.getEndOffset ()) {
+try {
+s1 = this.modelToView (p1, a, b1);
+} catch (ble) {
+if (Clazz_exceptionOf (ble, javax.swing.text.BadLocationException)) {
+s1 = null;
+} else {
+throw ble;
+}
+}
+if (s1 == null) {
+var alloc = (Clazz_instanceOf (a, java.awt.Rectangle)) ? a : a.getBounds ();
+s1 =  new java.awt.Rectangle (alloc.x + alloc.width - 1, alloc.y, 1, alloc.height);
+}} else {
+s1 = this.modelToView (p1, a, b1);
+}var r0 = s0.getBounds ();
+var r1 = (Clazz_instanceOf (s1, java.awt.Rectangle)) ? s1 : s1.getBounds ();
+if (r0.y != r1.y) {
+var alloc = (Clazz_instanceOf (a, java.awt.Rectangle)) ? a : a.getBounds ();
+r0.x = alloc.x;
+r0.width = alloc.width;
+}r0.add (r1);
+return r0;
+}, "~N,javax.swing.text.Position.Bias,~N,javax.swing.text.Position.Bias,java.awt.Shape");
+Clazz_defineMethod (c$, "insertUpdate", 
+function (e, a, f) {
+if (this.getViewCount () > 0) {
+var elem = this.getElement ();
+var ec = e.getChange (elem);
+if (ec != null) {
+if (!this.updateChildren (ec, e, f)) {
+ec = null;
+}}this.forwardUpdate (ec, e, a, f);
+this.updateLayout (ec, e, a);
+}}, "javax.swing.event.DocumentEvent,java.awt.Shape,javax.swing.text.ViewFactory");
+Clazz_defineMethod (c$, "removeUpdate", 
+function (e, a, f) {
+if (this.getViewCount () > 0) {
+var elem = this.getElement ();
+var ec = e.getChange (elem);
+if (ec != null) {
+if (!this.updateChildren (ec, e, f)) {
+ec = null;
+}}this.forwardUpdate (ec, e, a, f);
+this.updateLayout (ec, e, a);
+}}, "javax.swing.event.DocumentEvent,java.awt.Shape,javax.swing.text.ViewFactory");
+Clazz_defineMethod (c$, "changedUpdate", 
+function (e, a, f) {
+if (this.getViewCount () > 0) {
+var elem = this.getElement ();
+var ec = e.getChange (elem);
+if (ec != null) {
+if (!this.updateChildren (ec, e, f)) {
+ec = null;
+}}this.forwardUpdate (ec, e, a, f);
+this.updateLayout (ec, e, a);
+}}, "javax.swing.event.DocumentEvent,java.awt.Shape,javax.swing.text.ViewFactory");
+Clazz_defineMethod (c$, "getDocument", 
+function () {
+return this.elem.getDocument ();
+});
+Clazz_defineMethod (c$, "getStartOffset", 
+function () {
+return this.elem.getStartOffset ();
+});
+Clazz_defineMethod (c$, "getEndOffset", 
+function () {
+return this.elem.getEndOffset ();
+});
+Clazz_defineMethod (c$, "getElement", 
+function () {
+return this.elem;
+});
+Clazz_defineMethod (c$, "getGraphics", 
+function () {
+var c = this.getContainer ();
+return c.getGraphics ();
+});
+Clazz_defineMethod (c$, "getAttributes", 
+function () {
+return this.elem.getAttributes ();
+});
+Clazz_defineMethod (c$, "breakView", 
+function (axis, offset, pos, len) {
+return this;
+}, "~N,~N,~N,~N");
+Clazz_defineMethod (c$, "createFragment", 
+function (p0, p1) {
+return this;
+}, "~N,~N");
+Clazz_defineMethod (c$, "getBreakWeight", 
+function (axis, pos, len) {
+if (len > this.getPreferredSpan (axis)) {
+return 1000;
+}return 0;
+}, "~N,~N,~N");
+Clazz_defineMethod (c$, "getResizeWeight", 
+function (axis) {
+return 0;
+}, "~N");
+Clazz_defineMethod (c$, "setSize", 
+function (width, height) {
+}, "~N,~N");
+Clazz_defineMethod (c$, "getContainer", 
+function () {
+var v = this.getParent ();
+return (v != null) ? v.getContainer () : null;
+});
+Clazz_defineMethod (c$, "getViewFactory", 
+function () {
+var v = this.getParent ();
+return (v != null) ? v.getViewFactory () : null;
+});
+Clazz_defineMethod (c$, "getToolTipText", 
+function (x, y, allocation) {
+var viewIndex = this.getViewIndex (x, y, allocation);
+if (viewIndex >= 0) {
+allocation = this.getChildAllocation (viewIndex, allocation);
+var rect = (Clazz_instanceOf (allocation, java.awt.Rectangle)) ? allocation : allocation.getBounds ();
+if (rect.contains (x, y)) {
+return this.getView (viewIndex).getToolTipText (x, y, allocation);
+}}return null;
+}, "~N,~N,java.awt.Shape");
+Clazz_defineMethod (c$, "getViewIndex", 
+function (x, y, allocation) {
+for (var counter = this.getViewCount () - 1; counter >= 0; counter--) {
+var childAllocation = this.getChildAllocation (counter, allocation);
+if (childAllocation != null) {
+var rect = (Clazz_instanceOf (childAllocation, java.awt.Rectangle)) ? childAllocation : childAllocation.getBounds ();
+if (rect.contains (x, y)) {
+return counter;
+}}}
+return -1;
+}, "~N,~N,java.awt.Shape");
+Clazz_defineMethod (c$, "updateChildren", 
+function (ec, e, f) {
+var removedElems = ec.getChildrenRemoved ();
+var addedElems = ec.getChildrenAdded ();
+var added = null;
+if (addedElems != null) {
+added =  new Array (addedElems.length);
+for (var i = 0; i < addedElems.length; i++) {
+added[i] = f.create (addedElems[i]);
+}
+}var nremoved = 0;
+var index = ec.getIndex ();
+if (removedElems != null) {
+nremoved = removedElems.length;
+}this.replace (index, nremoved, added);
+return true;
+}, "javax.swing.event.DocumentEvent.ElementChange,javax.swing.event.DocumentEvent,javax.swing.text.ViewFactory");
+Clazz_defineMethod (c$, "forwardUpdate", 
+function (ec, e, a, f) {
+var elem = this.getElement ();
+var pos = e.getOffset ();
+var index0 = this.getViewIndex (pos, javax.swing.text.Position.Bias.Forward);
+if (index0 == -1 && e.getType () === javax.swing.event.DocumentEvent.EventType.REMOVE && pos >= this.getEndOffset ()) {
+index0 = this.getViewCount () - 1;
+}var index1 = index0;
+var v = (index0 >= 0) ? this.getView (index0) : null;
+if (v != null) {
+if ((v.getStartOffset () == pos) && (pos > 0)) {
+index0 = Math.max (index0 - 1, 0);
+}}if (e.getType () !== javax.swing.event.DocumentEvent.EventType.REMOVE) {
+index1 = this.getViewIndex (pos + e.getLength (), javax.swing.text.Position.Bias.Forward);
+if (index1 < 0) {
+index1 = this.getViewCount () - 1;
+}}var hole0 = index1 + 1;
+var hole1 = hole0;
+var addedElems = (ec != null) ? ec.getChildrenAdded () : null;
+if ((addedElems != null) && (addedElems.length > 0)) {
+hole0 = ec.getIndex ();
+hole1 = hole0 + addedElems.length - 1;
+}index0 = Math.max (index0, 0);
+for (var i = index0; i <= index1; i++) {
+if (!((i >= hole0) && (i <= hole1))) {
+v = this.getView (i);
+if (v != null) {
+var childAlloc = this.getChildAllocation (i, a);
+this.forwardUpdateToView (v, e, childAlloc, f);
+}}}
+}, "javax.swing.event.DocumentEvent.ElementChange,javax.swing.event.DocumentEvent,java.awt.Shape,javax.swing.text.ViewFactory");
+Clazz_defineMethod (c$, "forwardUpdateToView", 
+function (v, e, a, f) {
+var type = e.getType ();
+if (type === javax.swing.event.DocumentEvent.EventType.INSERT) {
+v.insertUpdate (e, a, f);
+} else if (type === javax.swing.event.DocumentEvent.EventType.REMOVE) {
+v.removeUpdate (e, a, f);
+} else {
+v.changedUpdate (e, a, f);
+}}, "javax.swing.text.View,javax.swing.event.DocumentEvent,java.awt.Shape,javax.swing.text.ViewFactory");
+Clazz_defineMethod (c$, "updateLayout", 
+function (ec, e, a) {
+if ((ec != null) && (a != null)) {
+this.preferenceChanged (null, true, true);
+var host = this.getContainer ();
+if (host != null) {
+host.repaint ();
+}}}, "javax.swing.event.DocumentEvent.ElementChange,javax.swing.event.DocumentEvent,java.awt.Shape");
+Clazz_defineMethod (c$, "modelToView", 
+function (pos, a) {
+return this.modelToView (pos, a, javax.swing.text.Position.Bias.Forward);
+}, "~N,java.awt.Shape");
+Clazz_defineMethod (c$, "viewToModel", 
+function (x, y, a) {
+javax.swing.text.View.sharedBiasReturn[0] = javax.swing.text.Position.Bias.Forward;
+return this.viewToModel (x, y, a, javax.swing.text.View.sharedBiasReturn);
+}, "~N,~N,java.awt.Shape");
+Clazz_defineStatics (c$,
+"BadBreakWeight", 0,
+"GoodBreakWeight", 1000,
+"ExcellentBreakWeight", 2000,
+"ForcedBreakWeight", 3000,
+"X_AXIS", 0,
+"Y_AXIS", 1);
+c$.sharedBiasReturn = c$.prototype.sharedBiasReturn =  new Array (1);
+});
+Clazz_declarePackage ("javax.swing.text");
+Clazz_declareInterface (javax.swing.text, "Position");
+Clazz_pu$h(self.c$);
+c$ = Clazz_decorateAsClass (function () {
+this.name = null;
+Clazz_instantialize (this, arguments);
+}, javax.swing.text.Position, "Bias");
+Clazz_overrideMethod (c$, "toString", 
+function () {
+return this.name;
+});
+Clazz_makeConstructor (c$, 
+ function (a) {
+this.name = a;
+}, "~S");
+c$.Forward = c$.prototype.Forward =  new javax.swing.text.Position.Bias ("Forward");
+c$.Backward = c$.prototype.Backward =  new javax.swing.text.Position.Bias ("Backward");
+c$ = Clazz_p0p ();
+Clazz_declarePackage ("javax.swing.text");
+Clazz_load (["javax.swing.text.Document"], "javax.swing.text.StyledDocument", null, function () {
+Clazz_declareInterface (javax.swing.text, "StyledDocument", javax.swing.text.Document);
+});
+Clazz_declarePackage ("javax.swing.text");
+Clazz_load (["javax.swing.text.Highlighter", "$.LayeredHighlighter", "java.util.Vector"], "javax.swing.text.DefaultHighlighter", ["java.awt.Rectangle", "javax.swing.SwingUtilities", "javax.swing.text.LayeredHighlighter.LayerPainter", "javax.swing.text.Position"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.highlights = null;
+this.component = null;
+this.drawsLayeredHighlights = false;
+this.safeDamager = null;
+if (!Clazz_isClassDefined ("javax.swing.text.DefaultHighlighter.HighlightInfo")) {
+javax.swing.text.DefaultHighlighter.$DefaultHighlighter$HighlightInfo$ ();
+}
+if (!Clazz_isClassDefined ("javax.swing.text.DefaultHighlighter.LayeredHighlightInfo")) {
+javax.swing.text.DefaultHighlighter.$DefaultHighlighter$LayeredHighlightInfo$ ();
+}
+if (!Clazz_isClassDefined ("javax.swing.text.DefaultHighlighter.SafeDamager")) {
+javax.swing.text.DefaultHighlighter.$DefaultHighlighter$SafeDamager$ ();
+}
+Clazz_instantialize (this, arguments);
+}, javax.swing.text, "DefaultHighlighter", javax.swing.text.LayeredHighlighter);
+Clazz_prepareFields (c$, function () {
+this.highlights =  new java.util.Vector ();
+this.safeDamager = Clazz_innerTypeInstance (javax.swing.text.DefaultHighlighter.SafeDamager, this, null);
+});
+Clazz_makeConstructor (c$, 
+function () {
+Clazz_superConstructor (this, javax.swing.text.DefaultHighlighter, []);
+this.drawsLayeredHighlights = true;
+});
+Clazz_overrideMethod (c$, "paint", 
+function (g) {
+var len = this.highlights.size ();
+for (var i = 0; i < len; i++) {
+var info = this.highlights.elementAt (i);
+if (!(Clazz_instanceOf (info, javax.swing.text.DefaultHighlighter.LayeredHighlightInfo))) {
+var a = this.component.getBounds ();
+var insets = this.component.getInsets ();
+a.x = insets.left;
+a.y = insets.top;
+a.width -= insets.left + insets.right;
+a.height -= insets.top + insets.bottom;
+for (; i < len; i++) {
+info = this.highlights.elementAt (i);
+if (!(Clazz_instanceOf (info, javax.swing.text.DefaultHighlighter.LayeredHighlightInfo))) {
+var p = info.getPainter ();
+p.paint (g, info.getStartOffset (), info.getEndOffset (), a, this.component);
+}}
+}}
+}, "java.awt.Graphics");
+Clazz_overrideMethod (c$, "install", 
+function (c) {
+this.component = c;
+this.removeAllHighlights ();
+}, "javax.swing.text.JTextComponent");
+Clazz_overrideMethod (c$, "deinstall", 
+function (c) {
+this.component = null;
+}, "javax.swing.text.JTextComponent");
+Clazz_overrideMethod (c$, "addHighlight", 
+function (p0, p1, p) {
+var doc = this.component.getDocument ();
+var i = (this.getDrawsLayeredHighlights () && (Clazz_instanceOf (p, javax.swing.text.LayeredHighlighter.LayerPainter))) ? Clazz_innerTypeInstance (javax.swing.text.DefaultHighlighter.LayeredHighlightInfo, this, null) : Clazz_innerTypeInstance (javax.swing.text.DefaultHighlighter.HighlightInfo, this, null);
+i.painter = p;
+i.p0 = doc.createPosition (p0);
+i.p1 = doc.createPosition (p1);
+this.highlights.addElement (i);
+this.safeDamageRange (p0, p1);
+return i;
+}, "~N,~N,javax.swing.text.Highlighter.HighlightPainter");
+Clazz_overrideMethod (c$, "removeHighlight", 
+function (tag) {
+if (Clazz_instanceOf (tag, javax.swing.text.DefaultHighlighter.LayeredHighlightInfo)) {
+var lhi = tag;
+if (lhi.width > 0 && lhi.height > 0) {
+this.component.repaint (lhi.x, lhi.y, lhi.width, lhi.height);
+}} else {
+var info = tag;
+this.safeDamageRange (info.p0, info.p1);
+}this.highlights.removeElement (tag);
+}, "~O");
+Clazz_overrideMethod (c$, "removeAllHighlights", 
+function () {
+var mapper = this.component.getUI ();
+if (this.getDrawsLayeredHighlights ()) {
+var len = this.highlights.size ();
+if (len != 0) {
+var minX = 0;
+var minY = 0;
+var maxX = 0;
+var maxY = 0;
+var p0 = -1;
+var p1 = -1;
+for (var i = 0; i < len; i++) {
+var hi = this.highlights.elementAt (i);
+if (Clazz_instanceOf (hi, javax.swing.text.DefaultHighlighter.LayeredHighlightInfo)) {
+var info = hi;
+minX = Math.min (minX, info.x);
+minY = Math.min (minY, info.y);
+maxX = Math.max (maxX, info.x + info.width);
+maxY = Math.max (maxY, info.y + info.height);
+} else {
+if (p0 == -1) {
+p0 = hi.p0.getOffset ();
+p1 = hi.p1.getOffset ();
+} else {
+p0 = Math.min (p0, hi.p0.getOffset ());
+p1 = Math.max (p1, hi.p1.getOffset ());
+}}}
+if (minX != maxX && minY != maxY) {
+this.component.repaint (minX, minY, maxX - minX, maxY - minY);
+}if (p0 != -1) {
+try {
+this.safeDamageRange (p0, p1);
+} catch (e) {
+if (Clazz_exceptionOf (e, javax.swing.text.BadLocationException)) {
+} else {
+throw e;
+}
+}
+}this.highlights.removeAllElements ();
+}} else if (mapper != null) {
+var len = this.highlights.size ();
+if (len != 0) {
+var p0 = 2147483647;
+var p1 = 0;
+for (var i = 0; i < len; i++) {
+var info = this.highlights.elementAt (i);
+p0 = Math.min (p0, info.p0.getOffset ());
+p1 = Math.max (p1, info.p1.getOffset ());
+}
+try {
+this.safeDamageRange (p0, p1);
+} catch (e) {
+if (Clazz_exceptionOf (e, javax.swing.text.BadLocationException)) {
+} else {
+throw e;
+}
+}
+this.highlights.removeAllElements ();
+}}});
+Clazz_overrideMethod (c$, "changeHighlight", 
+function (tag, p0, p1) {
+var doc = this.component.getDocument ();
+if (Clazz_instanceOf (tag, javax.swing.text.DefaultHighlighter.LayeredHighlightInfo)) {
+var lhi = tag;
+if (lhi.width > 0 && lhi.height > 0) {
+this.component.repaint (lhi.x, lhi.y, lhi.width, lhi.height);
+}lhi.width = lhi.height = 0;
+lhi.p0 = doc.createPosition (p0);
+lhi.p1 = doc.createPosition (p1);
+this.safeDamageRange (Math.min (p0, p1), Math.max (p0, p1));
+} else {
+var info = tag;
+var oldP0 = info.p0.getOffset ();
+var oldP1 = info.p1.getOffset ();
+if (p0 == oldP0) {
+this.safeDamageRange (Math.min (oldP1, p1), Math.max (oldP1, p1));
+} else if (p1 == oldP1) {
+this.safeDamageRange (Math.min (p0, oldP0), Math.max (p0, oldP0));
+} else {
+this.safeDamageRange (oldP0, oldP1);
+this.safeDamageRange (p0, p1);
+}info.p0 = doc.createPosition (p0);
+info.p1 = doc.createPosition (p1);
+}}, "~O,~N,~N");
+Clazz_overrideMethod (c$, "getHighlights", 
+function () {
+var size = this.highlights.size ();
+if (size == 0) {
+return javax.swing.text.DefaultHighlighter.noHighlights;
+}var h =  new Array (size);
+this.highlights.copyInto (h);
+return h;
+});
+Clazz_overrideMethod (c$, "paintLayeredHighlights", 
+function (g, p0, p1, viewBounds, editor, view) {
+for (var counter = this.highlights.size () - 1; counter >= 0; counter--) {
+var tag = this.highlights.elementAt (counter);
+if (Clazz_instanceOf (tag, javax.swing.text.DefaultHighlighter.LayeredHighlightInfo)) {
+var lhi = tag;
+var start = lhi.getStartOffset ();
+var end = lhi.getEndOffset ();
+if ((p0 < start && p1 > start) || (p0 >= start && p0 < end)) {
+lhi.paintLayeredHighlights (g, p0, p1, viewBounds, editor, view);
+}}}
+}, "java.awt.Graphics,~N,~N,java.awt.Shape,javax.swing.text.JTextComponent,javax.swing.text.View");
+Clazz_defineMethod (c$, "safeDamageRange", 
+ function (p0, p1) {
+this.safeDamager.damageRange (p0, p1);
+}, "javax.swing.text.Position,javax.swing.text.Position");
+Clazz_defineMethod (c$, "safeDamageRange", 
+ function (a0, a1) {
+var doc = this.component.getDocument ();
+this.safeDamageRange (doc.createPosition (a0), doc.createPosition (a1));
+}, "~N,~N");
+Clazz_defineMethod (c$, "setDrawsLayeredHighlights", 
+function (newValue) {
+this.drawsLayeredHighlights = newValue;
+}, "~B");
+Clazz_defineMethod (c$, "getDrawsLayeredHighlights", 
+function () {
+return this.drawsLayeredHighlights;
+});
+c$.$DefaultHighlighter$HighlightInfo$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_decorateAsClass (function () {
+Clazz_prepareCallback (this, arguments);
+this.p0 = null;
+this.p1 = null;
+this.painter = null;
+Clazz_instantialize (this, arguments);
+}, javax.swing.text.DefaultHighlighter, "HighlightInfo", null, javax.swing.text.Highlighter.Highlight);
+Clazz_overrideMethod (c$, "getStartOffset", 
+function () {
+return this.p0.getOffset ();
+});
+Clazz_overrideMethod (c$, "getEndOffset", 
+function () {
+return this.p1.getOffset ();
+});
+Clazz_overrideMethod (c$, "getPainter", 
+function () {
+return this.painter;
+});
+c$ = Clazz_p0p ();
+};
+c$.$DefaultHighlighter$LayeredHighlightInfo$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_decorateAsClass (function () {
+Clazz_prepareCallback (this, arguments);
+this.x = 0;
+this.y = 0;
+this.width = 0;
+this.height = 0;
+Clazz_instantialize (this, arguments);
+}, javax.swing.text.DefaultHighlighter, "LayeredHighlightInfo", javax.swing.text.DefaultHighlighter.HighlightInfo, null, Clazz_innerTypeInstance (javax.swing.text.DefaultHighlighter.HighlightInfo, this, null, Clazz_inheritArgs));
+Clazz_defineMethod (c$, "union", 
+function (a) {
+if (a == null) return;
+var b;
+if (Clazz_instanceOf (a, java.awt.Rectangle)) {
+b = a;
+} else {
+b = a.getBounds ();
+}if (this.width == 0 || this.height == 0) {
+this.x = b.x;
+this.y = b.y;
+this.width = b.width;
+this.height = b.height;
+} else {
+this.width = Math.max (this.x + this.width, b.x + b.width);
+this.height = Math.max (this.y + this.height, b.y + b.height);
+this.x = Math.min (this.x, b.x);
+this.width -= this.x;
+this.y = Math.min (this.y, b.y);
+this.height -= this.y;
+}}, "java.awt.Shape");
+Clazz_defineMethod (c$, "paintLayeredHighlights", 
+function (a, b, c, d, e, f) {
+var g = this.getStartOffset ();
+var h = this.getEndOffset ();
+b = Math.max (g, b);
+c = Math.min (h, c);
+this.union ((this.painter).paintLayer (a, b, c, d, e, f));
+}, "java.awt.Graphics,~N,~N,java.awt.Shape,javax.swing.text.JTextComponent,javax.swing.text.View");
+c$ = Clazz_p0p ();
+};
+c$.$DefaultHighlighter$SafeDamager$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_decorateAsClass (function () {
+Clazz_prepareCallback (this, arguments);
+this.p0 = null;
+this.p1 = null;
+this.lastDoc = null;
+Clazz_instantialize (this, arguments);
+}, javax.swing.text.DefaultHighlighter, "SafeDamager", null, Runnable);
+Clazz_prepareFields (c$, function () {
+this.p0 =  new java.util.Vector (10);
+this.p1 =  new java.util.Vector (10);
+});
+Clazz_overrideMethod (c$, "run", 
+function () {
+if (this.b$["javax.swing.text.DefaultHighlighter"].component != null) {
+var a = this.b$["javax.swing.text.DefaultHighlighter"].component.getUI ();
+if (a != null && this.lastDoc === this.b$["javax.swing.text.DefaultHighlighter"].component.getDocument ()) {
+var b = this.p0.size ();
+for (var c = 0; c < b; c++) {
+a.damageRange (this.b$["javax.swing.text.DefaultHighlighter"].component, (this.p0.get (c)).getOffset (), (this.p1.get (c)).getOffset ());
+}
+}}this.p0.clear ();
+this.p1.clear ();
+this.lastDoc = null;
+});
+Clazz_defineMethod (c$, "damageRange", 
+function (a, b) {
+if (this.b$["javax.swing.text.DefaultHighlighter"].component == null) {
+this.p0.clear ();
+this.lastDoc = null;
+return;
+}var c = this.p0.isEmpty ();
+var d = this.b$["javax.swing.text.DefaultHighlighter"].component.getDocument ();
+if (d !== this.lastDoc) {
+if (!this.p0.isEmpty ()) {
+this.p0.clear ();
+this.p1.clear ();
+}this.lastDoc = d;
+}this.p0.add (a);
+this.p1.add (b);
+if (c) {
+javax.swing.SwingUtilities.invokeLater (this);
+}}, "javax.swing.text.Position,javax.swing.text.Position");
+c$ = Clazz_p0p ();
+};
+Clazz_pu$h(self.c$);
+c$ = Clazz_decorateAsClass (function () {
+this.color = null;
+Clazz_instantialize (this, arguments);
+}, javax.swing.text.DefaultHighlighter, "DefaultHighlightPainter", javax.swing.text.LayeredHighlighter.LayerPainter);
+Clazz_makeConstructor (c$, 
+function (a) {
+Clazz_superConstructor (this, javax.swing.text.DefaultHighlighter.DefaultHighlightPainter, []);
+this.color = a;
+}, "java.awt.Color");
+Clazz_defineMethod (c$, "getColor", 
+function () {
+return this.color;
+});
+Clazz_overrideMethod (c$, "paint", 
+function (a, b, c, d, e) {
+var f = d.getBounds ();
+try {
+var g = e.getUI ();
+var h = g.modelToView (e, b);
+var i = g.modelToView (e, c);
+var j = this.getColor ();
+if (j == null) {
+a.setColor (e.getSelectionColor ());
+} else {
+a.setColor (j);
+}if (h.y == i.y) {
+var k = h.union (i);
+a.fillRect (k.x, k.y, k.width, k.height);
+} else {
+var k = f.x + f.width - h.x;
+a.fillRect (h.x, h.y, k, h.height);
+if ((h.y + h.height) != i.y) {
+a.fillRect (f.x, h.y + h.height, f.width, i.y - (h.y + h.height));
+}a.fillRect (f.x, i.y, (i.x - f.x), i.height);
+}} catch (e) {
+if (Clazz_exceptionOf (e, javax.swing.text.BadLocationException)) {
+} else {
+throw e;
+}
+}
+}, "java.awt.Graphics,~N,~N,java.awt.Shape,javax.swing.text.JTextComponent");
+Clazz_overrideMethod (c$, "paintLayer", 
+function (a, b, c, d, e, f) {
+var g = this.getColor ();
+if (g == null) {
+a.setColor (e.getSelectionColor ());
+} else {
+a.setColor (g);
+}var h;
+if (b == f.getStartOffset () && c == f.getEndOffset ()) {
+if (Clazz_instanceOf (d, java.awt.Rectangle)) {
+h = d;
+} else {
+h = d.getBounds ();
+}} else {
+try {
+var i = f.modelToView (b, javax.swing.text.Position.Bias.Forward, c, javax.swing.text.Position.Bias.Backward, d);
+h = (Clazz_instanceOf (i, java.awt.Rectangle)) ? i : i.getBounds ();
+} catch (e) {
+if (Clazz_exceptionOf (e, javax.swing.text.BadLocationException)) {
+h = null;
+} else {
+throw e;
+}
+}
+}if (h != null) {
+h.width = Math.max (h.width, 1);
+a.fillRect (h.x, h.y, h.width, h.height);
+}return h;
+}, "java.awt.Graphics,~N,~N,java.awt.Shape,javax.swing.text.JTextComponent,javax.swing.text.View");
+c$ = Clazz_p0p ();
+c$.noHighlights = c$.prototype.noHighlights =  new Array (0);
+c$.DefaultPainter = c$.prototype.DefaultPainter =  new javax.swing.text.DefaultHighlighter.DefaultHighlightPainter (null);
+});
+Clazz_declarePackage ("javax.swing.text");
+Clazz_declareInterface (javax.swing.text, "Highlighter");
+Clazz_declareInterface (javax.swing.text.Highlighter, "HighlightPainter");
+Clazz_declareInterface (javax.swing.text.Highlighter, "Highlight");
+Clazz_declarePackage ("javax.swing.text");
+Clazz_load (["javax.swing.text.Highlighter"], "javax.swing.text.LayeredHighlighter", null, function () {
+c$ = Clazz_declareType (javax.swing.text, "LayeredHighlighter", null, javax.swing.text.Highlighter);
+Clazz_pu$h(self.c$);
+c$ = Clazz_declareType (javax.swing.text.LayeredHighlighter, "LayerPainter", null, javax.swing.text.Highlighter.HighlightPainter);
+c$ = Clazz_p0p ();
+});
+Clazz_declarePackage ("swingjs");
+Clazz_load (["swingjs.JSAbstractDocument"], "swingjs.JSPlainDocument", ["java.util.Hashtable", "JU.SB", "swingjs.JSPosition"], function () {
+c$ = Clazz_declareType (swingjs, "JSPlainDocument", swingjs.JSAbstractDocument);
+Clazz_makeConstructor (c$, 
+function () {
+Clazz_superConstructor (this, swingjs.JSPlainDocument);
+this.sb =  new JU.SB ();
+this.root = Clazz_innerTypeInstance (swingjs.JSAbstractDocument.JSElement, this, null);
+});
+Clazz_overrideMethod (c$, "getLength", 
+function () {
+return this.sb.length ();
+});
+Clazz_defineMethod (c$, "getText", 
+function (offset, length) {
+this.checkLoc (offset, offset + length);
+return this.sb.substring2 (offset, offset + length);
+}, "~N,~N");
+Clazz_defineMethod (c$, "getText", 
+function (offset, length, chars) {
+this.checkLoc (offset, offset + length);
+if (this.tempChar == null) {
+this.tempChar =  Clazz_newCharArray (this.sb.length (), '\0');
+for (var i = this.tempChar.length; --i >= 0; ) this.tempChar[i] = this.sb.charAt (i);
+
+}chars.array = this.tempChar;
+chars.offset = offset;
+chars.count = length;
+}, "~N,~N,javax.swing.text.Segment");
+Clazz_overrideMethod (c$, "getStartPosition", 
+function () {
+return  new swingjs.JSPosition (0);
+});
+Clazz_overrideMethod (c$, "getEndPosition", 
+function () {
+return  new swingjs.JSPosition (this.sb.length ());
+});
+Clazz_overrideMethod (c$, "createPosition", 
+function (offs) {
+this.checkLoc (offs, offs);
+var i = Integer.$valueOf (offs);
+if (this.positions == null) this.positions =  new java.util.Hashtable ();
+var p = this.positions.get (i);
+if (p == null) this.positions.put (i, p =  new swingjs.JSPosition (offs));
+return p;
+}, "~N");
+Clazz_overrideMethod (c$, "getDefaultRootElement", 
+function () {
+return this.root;
+});
+Clazz_overrideMethod (c$, "render", 
+function (r) {
+}, "Runnable");
+Clazz_defineStatics (c$,
+"tabSizeAttribute", "tabSize",
+"lineLimitAttribute", "lineLimit");
+});
+Clazz_declarePackage ("swingjs");
+Clazz_load (["javax.swing.text.DocumentFilter", "$.Element", "$.JSMinimalAbstractDocument"], "swingjs.JSAbstractDocument", ["java.lang.IllegalStateException", "java.util.HashMap", "JU.AU", "javax.swing.event.DocumentEvent", "$.DocumentListener", "$.EventListenerList", "javax.swing.text.BadLocationException", "swingjs.JSDocumentEvent"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.props = null;
+this.root = null;
+this.positions = null;
+this.listenerList = null;
+this.notifyingListeners = false;
+this.filterBypass = null;
+this.me = null;
+this.sb = null;
+this.tempChar = null;
+this.filter = null;
+if (!Clazz_isClassDefined ("swingjs.JSAbstractDocument.DefaultFilterBypass")) {
+swingjs.JSAbstractDocument.$JSAbstractDocument$DefaultFilterBypass$ ();
+}
+if (!Clazz_isClassDefined ("swingjs.JSAbstractDocument.JSElement")) {
+swingjs.JSAbstractDocument.$JSAbstractDocument$JSElement$ ();
+}
+Clazz_instantialize (this, arguments);
+}, swingjs, "JSAbstractDocument", null, javax.swing.text.JSMinimalAbstractDocument);
+Clazz_makeConstructor (c$, 
+function () {
+this.me = this;
+this.props =  new java.util.HashMap ();
+});
+Clazz_overrideMethod (c$, "getRootElements", 
+function () {
+return  Clazz_newArray (-1, [this.root, null]);
+});
+Clazz_defineMethod (c$, "checkLoc", 
+function (start, end) {
+if (start < 0 || end > this.getLength ()) throw  new javax.swing.text.BadLocationException ("JSAbstractDocument: out of range", (start < 0 ? start : end));
+}, "~N,~N");
+Clazz_defineMethod (c$, "fixPositions", 
+function (offset, length, isInsert) {
+if (this.positions == null || this.positions.isEmpty ()) return;
+if (isInsert) {
+for (var i, $i = this.positions.keySet ().iterator (); $i.hasNext () && ((i = $i.next ()) || true);) {
+var pos = i.intValue ();
+if (pos > offset) this.positions.get (i).pos += length;
+}
+return;
+}for (var i, $i = this.positions.keySet ().iterator (); $i.hasNext () && ((i = $i.next ()) || true);) {
+var pos = i.intValue ();
+if (pos <= offset) continue;
+if (pos >= offset + length) this.positions.get (i).pos -= length;
+ else this.positions.get (i).pos = offset;
+}
+}, "~N,~N,~B");
+Clazz_defineMethod (c$, "getFilterBypass", 
+ function () {
+if (this.filterBypass == null) {
+this.filterBypass = Clazz_innerTypeInstance (swingjs.JSAbstractDocument.DefaultFilterBypass, this, null);
+}return this.filterBypass;
+});
+Clazz_overrideMethod (c$, "remove", 
+function (offs, len) {
+var filter = this.getDocumentFilter ();
+if (filter == null) this.handleRemove (offs, len);
+ else filter.remove (this.getFilterBypass (), offs, len);
+}, "~N,~N");
+Clazz_overrideMethod (c$, "insertString", 
+function (offset, str, a) {
+var filter = this.getDocumentFilter ();
+if (filter == null) this.handleInsertString (offset, str, a);
+ else filter.insertString (this.getFilterBypass (), offset, str, a);
+}, "~N,~S,javax.swing.text.AttributeSet");
+Clazz_overrideMethod (c$, "replace", 
+function (offset, length, text, attrs) {
+if (length == 0 && (text == null || text.length == 0)) return;
+var filter = this.getDocumentFilter ();
+if (filter != null) {
+filter.replace (this.getFilterBypass (), offset, length, text, attrs);
+} else {
+if (length > 0) this.remove (offset, length);
+if (text != null && text.length > 0) this.insertString (offset, text, attrs);
+}}, "~N,~N,~S,javax.swing.text.AttributeSet");
+Clazz_defineMethod (c$, "taint", 
+ function () {
+this.tempChar = null;
+});
+Clazz_defineMethod (c$, "setLines", 
+ function () {
+this.root = Clazz_innerTypeInstance (swingjs.JSAbstractDocument.JSElement, this, null);
+var s = this.sb.toString ();
+if (s.lastIndexOf ('\n') != s.length - 1) s += "\n";
+var ilast = 0;
+for (var i = 0; i < s.length; i++) {
+if (s.charAt (i) != '\n') continue;
+var e = Clazz_innerTypeInstance (swingjs.JSAbstractDocument.JSElement, this, null);
+e.start = ilast;
+e.end = i;
+ilast = i + 1;
+this.root.addChild (e);
+}
+});
+Clazz_defineMethod (c$, "handleInsertString", 
+function (offs, str, a) {
+if ((str == null) || (str.length == 0)) {
+return;
+}this.checkLoc (offs, offs);
+this.taint ();
+this.sb.insert (offs, str);
+this.fixPositions (offs, str.length, true);
+if (str.indexOf ('\n') >= 0) this.setLines ();
+var e =  new swingjs.JSDocumentEvent (this, offs, str.length, javax.swing.event.DocumentEvent.EventType.INSERT);
+this.fireInsertUpdate (e);
+}, "~N,~S,javax.swing.text.AttributeSet");
+Clazz_defineMethod (c$, "handleRemove", 
+function (offs, len) {
+this.checkLoc (offs, offs + len);
+this.taint ();
+var str = this.sb.substring2 (offs, offs + len);
+this.sb.replace (offs, offs + len, "");
+this.fixPositions (offs, offs + len, false);
+if (str.indexOf ('\n') >= 0) this.setLines ();
+if (len > 0) {
+var chng =  new swingjs.JSDocumentEvent (this, offs, len, javax.swing.event.DocumentEvent.EventType.REMOVE);
+this.fireRemoveUpdate (chng);
+}}, "~N,~N");
+Clazz_defineMethod (c$, "fireInsertUpdate", 
+function (e) {
+if (this.listenerList == null) return;
+this.checkAlreadyNotifying ();
+this.notifyingListeners = true;
+try {
+var listeners = this.listenerList.getListenerList ();
+for (var i = listeners.length - 2; i >= 0; i -= 2) {
+if (listeners[i] === javax.swing.event.DocumentListener) {
+(listeners[i + 1]).insertUpdate (e);
+}}
+} finally {
+this.notifyingListeners = false;
+}
+}, "javax.swing.event.DocumentEvent");
+Clazz_defineMethod (c$, "fireChangedUpdate", 
+function (e) {
+if (this.listenerList == null) return;
+this.checkAlreadyNotifying ();
+this.notifyingListeners = true;
+try {
+var listeners = this.listenerList.getListenerList ();
+for (var i = listeners.length - 2; i >= 0; i -= 2) {
+if (listeners[i] === javax.swing.event.DocumentListener) {
+(listeners[i + 1]).changedUpdate (e);
+}}
+} finally {
+this.notifyingListeners = false;
+}
+}, "javax.swing.event.DocumentEvent");
+Clazz_defineMethod (c$, "fireRemoveUpdate", 
+function (e) {
+if (this.listenerList == null) return;
+this.checkAlreadyNotifying ();
+this.notifyingListeners = true;
+try {
+var listeners = this.listenerList.getListenerList ();
+for (var i = listeners.length - 2; i >= 0; i -= 2) {
+if (listeners[i] === javax.swing.event.DocumentListener) {
+(listeners[i + 1]).removeUpdate (e);
+}}
+} finally {
+this.notifyingListeners = false;
+}
+}, "javax.swing.event.DocumentEvent");
+Clazz_defineMethod (c$, "checkAlreadyNotifying", 
+ function () {
+if (this.notifyingListeners) throw  new IllegalStateException ("One of the document listeners modifed the document. This is not allowed.");
+});
+Clazz_overrideMethod (c$, "addDocumentListener", 
+function (listener) {
+if (this.listenerList == null) this.listenerList =  new javax.swing.event.EventListenerList ();
+this.listenerList.add (javax.swing.event.DocumentListener, listener);
+}, "javax.swing.event.DocumentListener");
+Clazz_overrideMethod (c$, "removeDocumentListener", 
+function (listener) {
+if (this.listenerList != null) this.listenerList.remove (javax.swing.event.DocumentListener, listener);
+}, "javax.swing.event.DocumentListener");
+Clazz_overrideMethod (c$, "addUndoableEditListener", 
+function (listener) {
+}, "javax.swing.event.UndoableEditListener");
+Clazz_overrideMethod (c$, "removeUndoableEditListener", 
+function (listener) {
+}, "javax.swing.event.UndoableEditListener");
+Clazz_overrideMethod (c$, "getProperty", 
+function (key) {
+return this.props.get (key);
+}, "~O");
+Clazz_overrideMethod (c$, "putProperty", 
+function (key, value) {
+this.props.put (key, value);
+}, "~O,~O");
+Clazz_overrideMethod (c$, "getAsynchronousLoadPriority", 
+function () {
+return -1;
+});
+Clazz_overrideMethod (c$, "setDocumentFilter", 
+function (filter) {
+this.filter = filter;
+}, "javax.swing.text.DocumentFilter");
+Clazz_defineMethod (c$, "getDocumentFilter", 
+function () {
+return this.filter;
+});
+c$.$JSAbstractDocument$DefaultFilterBypass$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_decorateAsClass (function () {
+Clazz_prepareCallback (this, arguments);
+Clazz_instantialize (this, arguments);
+}, swingjs.JSAbstractDocument, "DefaultFilterBypass", javax.swing.text.DocumentFilter.FilterBypass);
+Clazz_overrideMethod (c$, "getDocument", 
+function () {
+return this.b$["swingjs.JSAbstractDocument"].me;
+});
+Clazz_overrideMethod (c$, "remove", 
+function (a, b) {
+this.b$["swingjs.JSAbstractDocument"].handleRemove (a, b);
+}, "~N,~N");
+Clazz_overrideMethod (c$, "insertString", 
+function (a, b, c) {
+this.b$["swingjs.JSAbstractDocument"].handleInsertString (a, b, c);
+}, "~N,~S,javax.swing.text.AttributeSet");
+Clazz_overrideMethod (c$, "replace", 
+function (a, b, c, d) {
+this.b$["swingjs.JSAbstractDocument"].handleRemove (a, b);
+this.b$["swingjs.JSAbstractDocument"].handleInsertString (a, c, d);
+}, "~N,~N,~S,javax.swing.text.AttributeSet");
+c$ = Clazz_p0p ();
+};
+c$.$JSAbstractDocument$JSElement$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_decorateAsClass (function () {
+Clazz_prepareCallback (this, arguments);
+this.parent = null;
+this.attributeSet = null;
+this.start = 0;
+this.end = 0;
+this.nchildren = 0;
+this.children = null;
+this.lastIndex = 0;
+Clazz_instantialize (this, arguments);
+}, swingjs.JSAbstractDocument, "JSElement", null, javax.swing.text.Element);
+Clazz_makeConstructor (c$, 
+function () {
+this.children = null;
+this.nchildren = 0;
+this.lastIndex = -1;
+});
+Clazz_defineMethod (c$, "addChild", 
+function (a) {
+if (this.children == null) this.children =  new Array (10);
+ else if (this.nchildren == this.children.length) this.children = JU.AU.doubleLength (this.children);
+this.children[this.nchildren++] = a;
+}, "swingjs.JSAbstractDocument.JSElement");
+Clazz_overrideMethod (c$, "getDocument", 
+function () {
+return this.b$["swingjs.JSAbstractDocument"].me;
+});
+Clazz_overrideMethod (c$, "getParentElement", 
+function () {
+return this.parent;
+});
+Clazz_overrideMethod (c$, "getName", 
+function () {
+return this.getName ();
+});
+Clazz_overrideMethod (c$, "getAttributes", 
+function () {
+return this.attributeSet;
+});
+Clazz_defineMethod (c$, "getStartOffset", 
+function () {
+return this.start;
+});
+Clazz_defineMethod (c$, "getEndOffset", 
+function () {
+return this.end;
+});
+Clazz_overrideMethod (c$, "getElementIndex", 
+function (a) {
+var b;
+var c = 0;
+var d = this.nchildren - 1;
+var e = 0;
+var f = this.getStartOffset ();
+var g;
+if (this.nchildren == 0) {
+return 0;
+}if (a >= this.getEndOffset ()) {
+return this.nchildren - 1;
+}if ((this.lastIndex >= c) && (this.lastIndex <= d)) {
+var h = this.children[this.lastIndex];
+f = h.getStartOffset ();
+g = h.getEndOffset ();
+if ((a >= f) && (a < g)) {
+return this.lastIndex;
+}if (a < f) {
+d = this.lastIndex;
+} else {
+c = this.lastIndex;
+}}while (c <= d) {
+e = c + (Clazz_doubleToInt ((d - c) / 2));
+var h = this.children[e];
+f = h.getStartOffset ();
+g = h.getEndOffset ();
+if ((a >= f) && (a < g)) {
+b = e;
+this.lastIndex = b;
+return b;
+} else if (a < f) {
+d = e - 1;
+} else {
+c = e + 1;
+}}
+if (a < f) {
+b = e;
+} else {
+b = e + 1;
+}this.lastIndex = b;
+return b;
+}, "~N");
+Clazz_overrideMethod (c$, "getElementCount", 
+function () {
+return this.nchildren;
+});
+Clazz_overrideMethod (c$, "getElement", 
+function (a) {
+return (a >= this.nchildren ? null : this.children[a]);
+}, "~N");
+Clazz_overrideMethod (c$, "isLeaf", 
+function () {
+return (this.parent != null);
+});
+c$ = Clazz_p0p ();
+};
+Clazz_defineStatics (c$,
+"ParagraphElementName", "paragraph",
+"ContentElementName", "content");
+});
+Clazz_declarePackage ("swingjs");
+Clazz_load (["javax.swing.event.DocumentEvent"], "swingjs.JSDocumentEvent", ["swingjs.JSToolkit"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.off = 0;
+this.len = 0;
+this.type = null;
+this.doc = null;
+Clazz_instantialize (this, arguments);
+}, swingjs, "JSDocumentEvent", null, javax.swing.event.DocumentEvent);
+Clazz_makeConstructor (c$, 
+function (doc, offs, len, eventType) {
+this.off = offs;
+this.len = len;
+this.type = eventType;
+this.doc = doc;
+}, "swingjs.JSAbstractDocument,~N,~N,javax.swing.event.DocumentEvent.EventType");
+Clazz_overrideMethod (c$, "getOffset", 
+function () {
+return this.off;
+});
+Clazz_overrideMethod (c$, "getLength", 
+function () {
+return this.len;
+});
+Clazz_overrideMethod (c$, "getDocument", 
+function () {
+return this.doc;
+});
+Clazz_overrideMethod (c$, "getType", 
+function () {
+return this.type;
+});
+Clazz_overrideMethod (c$, "getChange", 
+function (elem) {
+swingjs.JSToolkit.notImplemented ("");
+return null;
+}, "javax.swing.text.Element");
+});
+Clazz_declarePackage ("swingjs");
+Clazz_load (["javax.swing.text.Position"], "swingjs.JSPosition", null, function () {
+c$ = Clazz_decorateAsClass (function () {
+this.pos = 0;
+Clazz_instantialize (this, arguments);
+}, swingjs, "JSPosition", null, javax.swing.text.Position);
+Clazz_makeConstructor (c$, 
+function (offset) {
+this.pos = offset;
+}, "~N");
+Clazz_overrideMethod (c$, "getOffset", 
+function () {
+return this.pos;
+});
+});
+Clazz_declarePackage ("swingjs.api");
+c$ = Clazz_declareType (swingjs.api, "HTML5CanvasContext2D");
+c$.stretchImage = Clazz_defineMethod (c$, "stretchImage", 
+function (ctx, img, sx, sy, swidth, sheight, dx, dy, dwidth, dheight) {
+{
+ctx.drawImage(img, sx, sy, swidth, sheight, dx, dy, dwidth, dheight);
+}}, "swingjs.api.HTML5CanvasContext2D,swingjs.api.DOMNode,~N,~N,~N,~N,~N,~N,~N,~N");
+Clazz_declarePackage ("javax.swing");
+Clazz_load (["javax.swing.JLabel", "$.ListCellRenderer", "javax.swing.plaf.UIResource", "javax.swing.border.EmptyBorder"], "javax.swing.DefaultListCellRenderer", ["javax.swing.Icon", "jssun.swing.DefaultLookup"], function () {
+c$ = Clazz_declareType (javax.swing, "DefaultListCellRenderer", javax.swing.JLabel, javax.swing.ListCellRenderer);
+Clazz_makeConstructor (c$, 
+function () {
+Clazz_superConstructor (this, javax.swing.DefaultListCellRenderer);
+this.setOpaque (true);
+this.setBorder (this.getNoFocusBorder ());
+this.setName ("List.cellRenderer");
+});
+Clazz_defineMethod (c$, "getNoFocusBorder", 
+ function () {
+var border = jssun.swing.DefaultLookup.getBorder (this, this.ui, "List.cellNoFocusBorder");
+if (System.getSecurityManager () != null) {
+if (border != null) return border;
+return javax.swing.DefaultListCellRenderer.SAFE_NO_FOCUS_BORDER;
+} else {
+if (border != null && (javax.swing.DefaultListCellRenderer.noFocusBorder == null || javax.swing.DefaultListCellRenderer.noFocusBorder === javax.swing.DefaultListCellRenderer.DEFAULT_NO_FOCUS_BORDER)) {
+return border;
+}return javax.swing.DefaultListCellRenderer.noFocusBorder;
+}});
+Clazz_overrideMethod (c$, "getListCellRendererComponent", 
+function (list, value, index, isSelected, cellHasFocus) {
+this.setComponentOrientation (list.getComponentOrientation ());
+var bg = null;
+var fg = null;
+if (isSelected) {
+this.setBackground (bg == null ? list.getSelectionBackground () : bg);
+this.setForeground (fg == null ? list.getSelectionForeground () : fg);
+} else {
+this.setBackground (list.getBackground ());
+this.setForeground (list.getForeground ());
+}if (Clazz_instanceOf (value, javax.swing.Icon)) {
+this.setIcon (value);
+this.setText ("");
+} else {
+this.setIcon (null);
+this.setText ((value == null) ? "" : value.toString ());
+}this.setEnabled (list.isEnabled ());
+this.setFont (list.getFont ());
+var border = null;
+if (cellHasFocus) {
+if (isSelected) {
+border = jssun.swing.DefaultLookup.getBorder (this, this.ui, "List.focusSelectedCellHighlightBorder");
+}if (border == null) {
+border = jssun.swing.DefaultLookup.getBorder (this, this.ui, "List.focusCellHighlightBorder");
+}} else {
+border = this.getNoFocusBorder ();
+}this.setBorder (border);
+return this;
+}, "javax.swing.JList,~O,~N,~B,~B");
+Clazz_defineMethod (c$, "isOpaque", 
+function () {
+var back = this.getBackground ();
+var p = this.getParent ();
+if (p != null) {
+p = p.getParent ();
+}var colorMatch = (back != null) && (p != null) && back.equals (p.getBackground ()) && p.isOpaque ();
+return !colorMatch && Clazz_superCall (this, javax.swing.DefaultListCellRenderer, "isOpaque", []);
+});
+Clazz_overrideMethod (c$, "validate", 
+function () {
+});
+Clazz_overrideMethod (c$, "invalidate", 
+function () {
+});
+Clazz_defineMethod (c$, "repaint", 
+function () {
+});
+Clazz_overrideMethod (c$, "revalidate", 
+function () {
+});
+Clazz_defineMethod (c$, "repaint", 
+function (tm, x, y, width, height) {
+}, "~N,~N,~N,~N,~N");
+Clazz_defineMethod (c$, "repaint", 
+function (r) {
+}, "java.awt.Rectangle");
+Clazz_overrideMethod (c$, "firePropertyChangeObject", 
+function (propertyName, oldValue, newValue) {
+}, "~S,~O,~O");
+Clazz_overrideMethod (c$, "firePropertyChangeByte", 
+function (propertyName, oldValue, newValue) {
+}, "~S,~N,~N");
+Clazz_overrideMethod (c$, "firePropertyChangeChar", 
+function (propertyName, oldValue, newValue) {
+}, "~S,~S,~S");
+Clazz_overrideMethod (c$, "firePropertyChangeShort", 
+function (propertyName, oldValue, newValue) {
+}, "~S,~N,~N");
+Clazz_overrideMethod (c$, "firePropertyChangeInt", 
+function (propertyName, oldValue, newValue) {
+}, "~S,~N,~N");
+Clazz_overrideMethod (c$, "firePropertyChangeLong", 
+function (propertyName, oldValue, newValue) {
+}, "~S,~N,~N");
+Clazz_overrideMethod (c$, "firePropertyChangeFloat", 
+function (propertyName, oldValue, newValue) {
+}, "~S,~N,~N");
+Clazz_overrideMethod (c$, "firePropertyChangeDouble", 
+function (propertyName, oldValue, newValue) {
+}, "~S,~N,~N");
+Clazz_overrideMethod (c$, "firePropertyChangeBool", 
+function (propertyName, oldValue, newValue) {
+}, "~S,~B,~B");
+Clazz_pu$h(self.c$);
+c$ = Clazz_declareType (javax.swing.DefaultListCellRenderer, "UIResource", javax.swing.DefaultListCellRenderer, javax.swing.plaf.UIResource);
+c$ = Clazz_p0p ();
+c$.SAFE_NO_FOCUS_BORDER = c$.prototype.SAFE_NO_FOCUS_BORDER =  new javax.swing.border.EmptyBorder (1, 1, 1, 1);
+c$.DEFAULT_NO_FOCUS_BORDER = c$.prototype.DEFAULT_NO_FOCUS_BORDER =  new javax.swing.border.EmptyBorder (1, 1, 1, 1);
+c$.noFocusBorder = c$.prototype.noFocusBorder = javax.swing.DefaultListCellRenderer.DEFAULT_NO_FOCUS_BORDER;
+});
+Clazz_declarePackage ("javax.swing");
+Clazz_declareInterface (javax.swing, "ListCellRenderer");
+Clazz_declarePackage ("javax.swing.border");
+Clazz_load (["javax.swing.border.AbstractBorder"], "javax.swing.border.EmptyBorder", ["java.awt.Insets"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.left = 0;
+this.right = 0;
+this.top = 0;
+this.bottom = 0;
+Clazz_instantialize (this, arguments);
+}, javax.swing.border, "EmptyBorder", javax.swing.border.AbstractBorder);
+Clazz_makeConstructor (c$, 
+function (top, left, bottom, right) {
+Clazz_superConstructor (this, javax.swing.border.EmptyBorder, []);
+this.top = top;
+this.right = right;
+this.bottom = bottom;
+this.left = left;
+}, "~N,~N,~N,~N");
+Clazz_makeConstructor (c$, 
+function (borderInsets) {
+Clazz_superConstructor (this, javax.swing.border.EmptyBorder, []);
+this.top = borderInsets.top;
+this.right = borderInsets.right;
+this.bottom = borderInsets.bottom;
+this.left = borderInsets.left;
+}, "java.awt.Insets");
+Clazz_overrideMethod (c$, "paintBorder", 
+function (c, g, x, y, width, height) {
+}, "java.awt.Component,java.awt.Graphics,~N,~N,~N,~N");
+Clazz_defineMethod (c$, "getBorderInsets", 
+function (c) {
+return this.getBorderInsets ();
+}, "java.awt.Component");
+Clazz_defineMethod (c$, "getBorderInsets", 
+function (c, insets) {
+insets.left = this.left;
+insets.top = this.top;
+insets.right = this.right;
+insets.bottom = this.bottom;
+return insets;
+}, "java.awt.Component,java.awt.Insets");
+Clazz_defineMethod (c$, "getBorderInsets", 
+function () {
+return  new java.awt.Insets (this.top, this.left, this.bottom, this.right);
+});
+Clazz_overrideMethod (c$, "isBorderOpaque", 
+function () {
+return false;
+});
+});
+Clazz_declarePackage ("jssun.swing");
+Clazz_load (null, "jssun.swing.DefaultLookup", ["java.lang.Boolean", "$.Number", "$.Thread", "java.awt.Color", "$.Insets", "javax.swing.Icon", "$.UIManager", "javax.swing.border.Border", "jssun.awt.AppContext"], function () {
+c$ = Clazz_declareType (jssun.swing, "DefaultLookup");
+c$.setDefaultLookup = Clazz_defineMethod (c$, "setDefaultLookup", 
+function (lookup) {
+{
+if (!jssun.swing.DefaultLookup.isLookupSet && lookup == null) {
+return;
+} else if (lookup == null) {
+lookup =  new jssun.swing.DefaultLookup ();
+}jssun.swing.DefaultLookup.isLookupSet = true;
+jssun.awt.AppContext.getAppContext ().put (jssun.swing.DefaultLookup.DEFAULT_LOOKUP_KEY, lookup);
+jssun.swing.DefaultLookup.currentDefaultThread = Thread.currentThread ();
+jssun.swing.DefaultLookup.currentDefaultLookup = lookup;
+}}, "jssun.swing.DefaultLookup");
+c$.get = Clazz_defineMethod (c$, "get", 
+function (c, ui, key) {
+var lookupSet;
+{
+lookupSet = jssun.swing.DefaultLookup.isLookupSet;
+}if (!lookupSet) {
+return javax.swing.UIManager.get (key, c.getLocale ());
+}var thisThread = Thread.currentThread ();
+var lookup;
+{
+if (thisThread === jssun.swing.DefaultLookup.currentDefaultThread) {
+lookup = jssun.swing.DefaultLookup.currentDefaultLookup;
+} else {
+lookup = jssun.awt.AppContext.getAppContext ().get (jssun.swing.DefaultLookup.DEFAULT_LOOKUP_KEY);
+if (lookup == null) {
+lookup =  new jssun.swing.DefaultLookup ();
+jssun.awt.AppContext.getAppContext ().put (jssun.swing.DefaultLookup.DEFAULT_LOOKUP_KEY, lookup);
+}jssun.swing.DefaultLookup.currentDefaultThread = thisThread;
+jssun.swing.DefaultLookup.currentDefaultLookup = lookup;
+}}return lookup.getDefault (c, ui, key);
+}, "javax.swing.JComponent,javax.swing.plaf.ComponentUI,~S");
+c$.getInt = Clazz_defineMethod (c$, "getInt", 
+function (c, ui, key, defaultValue) {
+var iValue = jssun.swing.DefaultLookup.get (c, ui, key);
+if (iValue == null || !(Clazz_instanceOf (iValue, Number))) {
+return defaultValue;
+}return (iValue).intValue ();
+}, "javax.swing.JComponent,javax.swing.plaf.ComponentUI,~S,~N");
+c$.getInt = Clazz_defineMethod (c$, "getInt", 
+function (c, ui, key) {
+return jssun.swing.DefaultLookup.getInt (c, ui, key, -1);
+}, "javax.swing.JComponent,javax.swing.plaf.ComponentUI,~S");
+c$.getInsets = Clazz_defineMethod (c$, "getInsets", 
+function (c, ui, key, defaultValue) {
+var iValue = jssun.swing.DefaultLookup.get (c, ui, key);
+if (iValue == null || !(Clazz_instanceOf (iValue, java.awt.Insets))) {
+return defaultValue;
+}return iValue;
+}, "javax.swing.JComponent,javax.swing.plaf.ComponentUI,~S,java.awt.Insets");
+c$.getInsets = Clazz_defineMethod (c$, "getInsets", 
+function (c, ui, key) {
+return jssun.swing.DefaultLookup.getInsets (c, ui, key, null);
+}, "javax.swing.JComponent,javax.swing.plaf.ComponentUI,~S");
+c$.getBoolean = Clazz_defineMethod (c$, "getBoolean", 
+function (c, ui, key, defaultValue) {
+var iValue = jssun.swing.DefaultLookup.get (c, ui, key);
+if (iValue == null || !(Clazz_instanceOf (iValue, Boolean))) {
+return defaultValue;
+}return (iValue).booleanValue ();
+}, "javax.swing.JComponent,javax.swing.plaf.ComponentUI,~S,~B");
+c$.getBoolean = Clazz_defineMethod (c$, "getBoolean", 
+function (c, ui, key) {
+return jssun.swing.DefaultLookup.getBoolean (c, ui, key, false);
+}, "javax.swing.JComponent,javax.swing.plaf.ComponentUI,~S");
+c$.getColor = Clazz_defineMethod (c$, "getColor", 
+function (c, ui, key, defaultValue) {
+var iValue = jssun.swing.DefaultLookup.get (c, ui, key);
+if (iValue == null || !(Clazz_instanceOf (iValue, java.awt.Color))) {
+return defaultValue;
+}return iValue;
+}, "javax.swing.JComponent,javax.swing.plaf.ComponentUI,~S,java.awt.Color");
+c$.getColor = Clazz_defineMethod (c$, "getColor", 
+function (c, ui, key) {
+return jssun.swing.DefaultLookup.getColor (c, ui, key, null);
+}, "javax.swing.JComponent,javax.swing.plaf.ComponentUI,~S");
+c$.getIcon = Clazz_defineMethod (c$, "getIcon", 
+function (c, ui, key, defaultValue) {
+var iValue = jssun.swing.DefaultLookup.get (c, ui, key);
+if (iValue == null || !(Clazz_instanceOf (iValue, javax.swing.Icon))) {
+return defaultValue;
+}return iValue;
+}, "javax.swing.JComponent,javax.swing.plaf.ComponentUI,~S,javax.swing.Icon");
+c$.getIcon = Clazz_defineMethod (c$, "getIcon", 
+function (c, ui, key) {
+return jssun.swing.DefaultLookup.getIcon (c, ui, key, null);
+}, "javax.swing.JComponent,javax.swing.plaf.ComponentUI,~S");
+c$.getBorder = Clazz_defineMethod (c$, "getBorder", 
+function (c, ui, key, defaultValue) {
+var iValue = jssun.swing.DefaultLookup.get (c, ui, key);
+if (iValue == null || !(Clazz_instanceOf (iValue, javax.swing.border.Border))) {
+return defaultValue;
+}return iValue;
+}, "javax.swing.JComponent,javax.swing.plaf.ComponentUI,~S,javax.swing.border.Border");
+c$.getBorder = Clazz_defineMethod (c$, "getBorder", 
+function (c, ui, key) {
+return jssun.swing.DefaultLookup.getBorder (c, ui, key, null);
+}, "javax.swing.JComponent,javax.swing.plaf.ComponentUI,~S");
+Clazz_defineMethod (c$, "getDefault", 
+function (c, ui, key) {
+return javax.swing.UIManager.get (key, c.getLocale ());
+}, "javax.swing.JComponent,javax.swing.plaf.ComponentUI,~S");
+c$.DEFAULT_LOOKUP_KEY = c$.prototype.DEFAULT_LOOKUP_KEY =  new Clazz._O ();
+Clazz_defineStatics (c$,
+"currentDefaultThread", null,
+"currentDefaultLookup", null,
+"isLookupSet", false);
+});
+Clazz_declarePackage ("javax.swing.plaf");
+Clazz_load (["java.awt.Dimension", "javax.swing.plaf.UIResource"], "javax.swing.plaf.DimensionUIResource", null, function () {
+c$ = Clazz_declareType (javax.swing.plaf, "DimensionUIResource", java.awt.Dimension, javax.swing.plaf.UIResource);
+});
+Clazz_declarePackage ("javax.swing.plaf");
+Clazz_load (["java.awt.Insets", "javax.swing.plaf.UIResource"], "javax.swing.plaf.InsetsUIResource", null, function () {
+c$ = Clazz_declareType (javax.swing.plaf, "InsetsUIResource", java.awt.Insets, javax.swing.plaf.UIResource);
+});
+Clazz_declarePackage ("swingjs.plaf");
+Clazz_declareInterface (swingjs.plaf, "JSEventHandler");
+Clazz_declarePackage ("JU");
+Clazz_load (["java.net.URLStreamHandlerFactory", "java.util.Hashtable"], "JU.AjaxURLStreamHandlerFactory", ["JU.AjaxURLStreamHandler"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.htFactories = null;
+Clazz_instantialize (this, arguments);
+}, JU, "AjaxURLStreamHandlerFactory", null, java.net.URLStreamHandlerFactory);
+Clazz_prepareFields (c$, function () {
+this.htFactories =  new java.util.Hashtable ();
+});
+Clazz_overrideMethod (c$, "createURLStreamHandler", 
+function (protocol) {
+var fac = this.htFactories.get (protocol);
+if (fac == null) this.htFactories.put (protocol, fac =  new JU.AjaxURLStreamHandler (protocol));
+return (fac.protocol == null ? null : fac);
+}, "~S");
+});
+Clazz_declarePackage ("java.net");
+Clazz_declareInterface (java.net, "URLStreamHandlerFactory");
+Clazz_declarePackage ("JU");
+Clazz_load (["java.net.URLStreamHandler"], "JU.AjaxURLStreamHandler", ["JU.AjaxURLConnection", "$.SB"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.protocol = null;
+Clazz_instantialize (this, arguments);
+}, JU, "AjaxURLStreamHandler", java.net.URLStreamHandler);
+Clazz_makeConstructor (c$, 
+function (protocol) {
+Clazz_superConstructor (this, JU.AjaxURLStreamHandler, []);
+this.protocol = protocol;
+}, "~S");
+Clazz_overrideMethod (c$, "openConnection", 
+function (url) {
+return  new JU.AjaxURLConnection (url);
+}, "java.net.URL");
+Clazz_overrideMethod (c$, "toExternalForm", 
+function (u) {
+var result =  new JU.SB ();
+result.append (u.getProtocol ());
+result.append (":");
+if (u.getAuthority () != null && u.getAuthority ().length > 0) {
+result.append ("//");
+result.append (u.getAuthority ());
+}if (u.getPath () != null) {
+result.append (u.getPath ());
+}if (u.getQuery () != null) {
+result.append ("?");
+result.append (u.getQuery ());
+}if (u.getRef () != null) {
+result.append ("#");
+result.append (u.getRef ());
+}return result.toString ();
+}, "java.net.URL");
+});
+Clazz_declarePackage ("java.net");
+Clazz_load (null, "java.net.URLStreamHandler", ["java.lang.IllegalArgumentException", "$.SecurityException", "$.UnsupportedOperationException"], function () {
+c$ = Clazz_declareType (java.net, "URLStreamHandler");
+Clazz_defineMethod (c$, "openConnectionProxy", 
+function (u, p) {
+throw  new UnsupportedOperationException ("Method not implemented.");
+}, "java.net.URL,java.net.Proxy");
+Clazz_defineMethod (c$, "parseURL", 
+function (u, spec, start, limit) {
+var protocol = u.getProtocol ();
+var authority = u.getAuthority ();
+var userInfo = u.getUserInfo ();
+var host = u.getHost ();
+var port = u.getPort ();
+var path = u.getPath ();
+var query = u.getQuery ();
+var ref = u.getRef ();
+var isRelPath = false;
+var queryOnly = false;
+if (start < limit) {
+var queryStart = spec.indexOf ('?');
+queryOnly = queryStart == start;
+if ((queryStart != -1) && (queryStart < limit)) {
+query = spec.substring (queryStart + 1, limit);
+if (limit > queryStart) limit = queryStart;
+spec = spec.substring (0, queryStart);
+}}var i = 0;
+var isUNCName = (start <= limit - 4) && (spec.charAt (start) == '/') && (spec.charAt (start + 1) == '/') && (spec.charAt (start + 2) == '/') && (spec.charAt (start + 3) == '/');
+if (!isUNCName && (start <= limit - 2) && (spec.charAt (start) == '/') && (spec.charAt (start + 1) == '/')) {
+start += 2;
+i = spec.indexOf ('/', start);
+if (i < 0) {
+i = spec.indexOf ('?', start);
+if (i < 0) i = limit;
+}host = authority = spec.substring (start, i);
+var ind = authority.indexOf ('@');
+if (ind != -1) {
+userInfo = authority.substring (0, ind);
+host = authority.substring (ind + 1);
+} else {
+userInfo = null;
+}if (host != null) {
+if (host.length > 0 && (host.charAt (0) == '[')) {
+throw  new IllegalArgumentException ("Invalid host: " + host);
+}ind = host.indexOf (':');
+port = -1;
+if (ind >= 0) {
+if (host.length > (ind + 1)) {
+port = Integer.parseInt (host.substring (ind + 1));
+}host = host.substring (0, ind);
+}} else {
+host = "";
+}if (port < -1) throw  new IllegalArgumentException ("Invalid port number :" + port);
+start = i;
+if (authority.length > 0) path = "";
+}if (host == null) {
+host = "";
+}if (start < limit) {
+if (spec.charAt (start) == '/') {
+path = spec.substring (start, limit);
+} else if (path != null && path.length > 0) {
+isRelPath = true;
+var ind = path.lastIndexOf ('/');
+var seperator = "";
+if (ind == -1 && authority != null) seperator = "/";
+path = path.substring (0, ind + 1) + seperator + spec.substring (start, limit);
+} else {
+var seperator = (authority != null) ? "/" : "";
+path = seperator + spec.substring (start, limit);
+}} else if (queryOnly && path != null) {
+var ind = path.lastIndexOf ('/');
+if (ind < 0) ind = 0;
+path = path.substring (0, ind) + "/";
+}if (path == null) path = "";
+if (isRelPath) {
+while ((i = path.indexOf ("/./")) >= 0) {
+path = path.substring (0, i) + path.substring (i + 2);
+}
+i = 0;
+while ((i = path.indexOf ("/../", i)) >= 0) {
+if (i > 0 && (limit = path.lastIndexOf ('/', i - 1)) >= 0 && (path.indexOf ("/../", limit) != 0)) {
+path = path.substring (0, limit) + path.substring (i + 3);
+i = 0;
+} else {
+i = i + 3;
+}}
+while (path.endsWith ("/..")) {
+i = path.indexOf ("/..");
+if ((limit = path.lastIndexOf ('/', i - 1)) >= 0) {
+path = path.substring (0, limit + 1);
+} else {
+break;
+}}
+if (path.startsWith ("./") && path.length > 2) path = path.substring (2);
+if (path.endsWith ("/.")) path = path.substring (0, path.length - 1);
+}this.setURL (u, protocol, host, port, authority, userInfo, path, query, ref);
+}, "java.net.URL,~S,~N,~N");
+Clazz_defineMethod (c$, "getDefaultPort", 
+function () {
+return -1;
+});
+Clazz_defineMethod (c$, "equals2", 
+function (u1, u2) {
+var ref1 = u1.getRef ();
+var ref2 = u2.getRef ();
+return (ref1 === ref2 || (ref1 != null && ref1.equals (ref2))) && this.sameFile (u1, u2);
+}, "java.net.URL,java.net.URL");
+Clazz_defineMethod (c$, "hashCode", 
+function (u) {
+var h = 0;
+var protocol = u.getProtocol ();
+if (protocol != null) h += protocol.hashCode ();
+h += u.toString ().hashCode ();
+var file = u.getFile ();
+if (file != null) h += file.hashCode ();
+if (u.getPort () == -1) h += this.getDefaultPort ();
+ else h += u.getPort ();
+var ref = u.getRef ();
+if (ref != null) h += ref.hashCode ();
+return h;
+}, "java.net.URL");
+Clazz_defineMethod (c$, "sameFile", 
+function (u1, u2) {
+if (!((u1.getProtocol () === u2.getProtocol ()) || (u1.getProtocol () != null && u1.getProtocol ().equalsIgnoreCase (u2.getProtocol ())))) return false;
+if (!(u1.getFile () === u2.getFile () || (u1.getFile () != null && u1.getFile ().equals (u2.getFile ())))) return false;
+var port1;
+var port2;
+port1 = (u1.getPort () != -1) ? u1.getPort () : u1.handler.getDefaultPort ();
+port2 = (u2.getPort () != -1) ? u2.getPort () : u2.handler.getDefaultPort ();
+if (port1 != port2) return false;
+if (!this.hostsEqual (u1, u2)) return false;
+return true;
+}, "java.net.URL,java.net.URL");
+Clazz_defineMethod (c$, "hostsEqual", 
+function (u1, u2) {
+if (u1.getHost () != null && u2.getHost () != null) return u1.getHost ().equalsIgnoreCase (u2.getHost ());
+return u1.getHost () == null && u2.getHost () == null;
+}, "java.net.URL,java.net.URL");
+Clazz_defineMethod (c$, "toExternalForm", 
+function (u) {
+return "";
+}, "java.net.URL");
+Clazz_defineMethod (c$, "setURL", 
+function (u, protocol, host, port, authority, userInfo, path, query, ref) {
+if (this !== u.handler) {
+throw  new SecurityException ("handler for url different from this handler");
+}u.set (u.getProtocol (), host, port, authority, userInfo, path, query, ref);
+}, "java.net.URL,~S,~S,~N,~S,~S,~S,~S,~S");
+Clazz_defineMethod (c$, "setURLDeprecated", 
+function (u, protocol, host, port, file, ref) {
+var authority = null;
+var userInfo = null;
+if (host != null && host.length != 0) {
+authority = (port == -1) ? host : host + ":" + port;
+var at = host.lastIndexOf ('@');
+if (at != -1) {
+userInfo = host.substring (0, at);
+host = host.substring (at + 1);
+}}var path = null;
+var query = null;
+if (file != null) {
+var q = file.lastIndexOf ('?');
+if (q != -1) {
+query = file.substring (q + 1);
+path = file.substring (0, q);
+} else path = file;
+}this.setURL (u, protocol, host, port, authority, userInfo, path, query, ref);
+}, "java.net.URL,~S,~S,~N,~S,~S");
+});
+Clazz_declarePackage ("JU");
+Clazz_load (["java.net.URLConnection"], "JU.AjaxURLConnection", ["JU.AU", "$.Rdr", "$.SB"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.bytesOut = null;
+this.postOut = "";
+Clazz_instantialize (this, arguments);
+}, JU, "AjaxURLConnection", java.net.URLConnection);
+Clazz_defineMethod (c$, "doAjax", 
+ function () {
+{
+return Jmol._doAjax(this.url, this.postOut, this.bytesOut);
+}});
+Clazz_overrideMethod (c$, "connect", 
+function () {
+});
+Clazz_defineMethod (c$, "outputBytes", 
+function (bytes) {
+this.bytesOut = bytes;
+}, "~A");
+Clazz_defineMethod (c$, "outputString", 
+function (post) {
+this.postOut = post;
+}, "~S");
+Clazz_overrideMethod (c$, "getInputStream", 
+function () {
+var is = null;
+var o = this.doAjax ();
+if (JU.AU.isAB (o)) is = JU.Rdr.getBIS (o);
+ else if (Clazz_instanceOf (o, JU.SB)) is = JU.Rdr.getBIS (JU.Rdr.getBytesFromSB (o));
+ else if (Clazz_instanceOf (o, String)) is = JU.Rdr.getBIS ((o).getBytes ());
+return is;
+});
+Clazz_defineMethod (c$, "getContents", 
+function () {
+return this.doAjax ();
+});
+});
+Clazz_declarePackage ("java.net");
+Clazz_load (null, "java.net.URLConnection", ["java.lang.IllegalStateException", "$.NullPointerException", "java.net.UnknownServiceException", "JU.Lst"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.url = null;
+this.doInput = true;
+this.doOutput = false;
+this.connected = false;
+this.requests = null;
+Clazz_instantialize (this, arguments);
+}, java.net, "URLConnection");
+Clazz_defineMethod (c$, "setDoInput", 
+function (doinput) {
+if (this.connected) throw  new IllegalStateException ("Already connected");
+this.doInput = doinput;
+}, "~B");
+Clazz_defineMethod (c$, "getDoInput", 
+function () {
+return this.doInput;
+});
+Clazz_defineMethod (c$, "setDoOutput", 
+function (dooutput) {
+if (this.connected) throw  new IllegalStateException ("Already connected");
+this.doOutput = dooutput;
+}, "~B");
+Clazz_defineMethod (c$, "getDoOutput", 
+function () {
+return this.doOutput;
+});
+Clazz_makeConstructor (c$, 
+function (url) {
+this.url = url;
+}, "java.net.URL");
+Clazz_defineMethod (c$, "getURL", 
+function () {
+return this.url;
+});
+Clazz_defineMethod (c$, "getInputStream", 
+function () {
+throw  new java.net.UnknownServiceException ("protocol doesn't support input");
+});
+Clazz_defineMethod (c$, "getOutputStream", 
+function () {
+throw  new java.net.UnknownServiceException ("protocol doesn't support output");
+});
+Clazz_defineMethod (c$, "setRequestProperty", 
+function (key, value) {
+if (this.connected) throw  new IllegalStateException ("Already connected");
+if (key == null) throw  new NullPointerException ("key is null");
+if (this.requests == null) this.requests =  new JU.Lst ();
+for (var i = this.requests.size (); --i >= 0; ) if (this.requests.get (i)[0].equals (key)) {
+this.requests.get (i)[1] = value;
+return;
+}
+this.requests.addLast ( Clazz_newArray (-1, [key, value]));
+}, "~S,~S");
+});
+Clazz_declarePackage ("java.net");
+Clazz_load (["java.io.IOException"], "java.net.UnknownServiceException", null, function () {
+c$ = Clazz_declareType (java.net, "UnknownServiceException", java.io.IOException);
+Clazz_makeConstructor (c$, 
+function () {
+Clazz_superConstructor (this, java.net.UnknownServiceException, []);
+});
+});
+Clazz_declarePackage ("jalview.bin");
+Clazz_load (["jalview.api.StructureSelectionManagerProvider", "jalview.javascript.JalviewLiteJsApi", "java.lang.Thread", "javax.swing.JApplet", "jalview.util.MessageManager", "java.util.Hashtable", "$.Vector", "javax.swing.JButton"], "jalview.bin.JalviewLite", ["awt2swing.Util", "jalview.analysis.SequenceIdMatcher", "jalview.appletgui.AlignFrame", "$.EmbmenuFrame", "$.FeatureSettings", "$.SplitFrame", "jalview.datamodel.Alignment", "$.AlignmentOrder", "$.ColumnSelection", "$.PDBEntry", "$.SequenceGroup", "jalview.io.AnnotationFile", "$.AppletFormatAdapter", "$.FileParse", "$.IdentifyFile", "$.JnetAnnotationMaker", "$.NewickFile", "jalview.javascript.JSFunctionExec", "$.JsSelectionSender", "$.MouseOverListener", "$.MouseOverStructureListener", "jalview.jsdev.GenericFileAdapter", "jalview.schemes.ColourSchemeProperty", "$.UserColourScheme", "jalview.structure.SelectionListener", "$.StructureSelectionManager", "java.awt.Color", "$.EventQueue", "$.Font", "java.awt.event.ActionListener", "$.WindowAdapter", "java.io.BufferedReader", "$.InputStreamReader", "java.lang.Error", "$.StringBuffer", "java.net.URL", "java.util.StringTokenizer", "netscape.javascript.JSObject"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.embedded = false;
+this.enableSplitFrame = false;
+this.showButton = true;
+this.checkForJmol = true;
+this.jalviewServletURL = null;
+this.startupFile = "No file";
+this.helpUrl = null;
+this.externalstructureviewer = null;
+this.sep = null;
+this.rgb = null;
+this.labelColour = null;
+this.initjscallback = null;
+this.pdbFile = null;
+this.sequence = null;
+this.jnetFile = null;
+this.annotations = null;
+this.hideFeatureGroups = null;
+this.showFeatureGroups = null;
+this.features = null;
+this.showFeatureSettings = null;
+this.scoreFile = null;
+this.treeFile = null;
+this.windowWidth = null;
+this.windowHeight = null;
+this.defaultColour = null;
+this.sortBy = null;
+this.wrap = null;
+this.centrecolumnlabels = null;
+this.userDefinedColour = null;
+this.widthScale = null;
+this.heightScale = null;
+this.upperCase = null;
+this.file2 = null;
+this.javascriptListeners = null;
+this.jsFunctionExec = null;
+this.fileFound = true;
+this.launcher = null;
+this.currentAlignFrame = null;
+this.initialAlignFrame = null;
+this.checkedForJmol = false;
+this.jmolAvailable = false;
+this.alignPdbStructures = false;
+this.useXtrnalSviewer = false;
+this.haveShownLoadMessage = false;
+if (!Clazz_isClassDefined ("jalview.bin.JalviewLite.LoadJmolThread")) {
+jalview.bin.JalviewLite.$JalviewLite$LoadJmolThread$ ();
+}
+if (!Clazz_isClassDefined ("jalview.bin.JalviewLite.LoadingThread")) {
+jalview.bin.JalviewLite.$JalviewLite$LoadingThread$ ();
+}
+this.separator = "\u00ac";
+this.jsfallbackEnabled = false;
+this.jshashes = null;
+this.jsmessages = null;
+this.jsExecQueue = null;
+Clazz_instantialize (this, arguments);
+}, jalview.bin, "JalviewLite", javax.swing.JApplet, [jalview.api.StructureSelectionManagerProvider, jalview.javascript.JalviewLiteJsApi]);
+Clazz_prepareFields (c$, function () {
+this.javascriptListeners =  new java.util.Vector ();
+this.launcher =  new javax.swing.JButton (jalview.util.MessageManager.getString ("label.start_jalview"));
+this.jshashes =  new java.util.Hashtable ();
+this.jsmessages =  new java.util.Hashtable ();
+this.jsExecQueue =  new java.util.Vector ();
+});
+Clazz_defineMethod (c$, "setParams", 
+ function () {
+jalview.bin.JalviewLite.debug = "true".equalsIgnoreCase (this.getParameter ("debug"));
+this.enableSplitFrame = "true".equalsIgnoreCase (this.getParameter ("enableSplitFrame"));
+this.embedded = "true".equalsIgnoreCase (this.getParameter ("embedded"));
+this.showButton = !"false".equalsIgnoreCase (this.getParameter ("showbutton"));
+this.jalviewServletURL = this.getParameter ("APPLICATION_URL");
+this.startupFile = this.getParameter ("file");
+this.helpUrl = this.getParameter ("jalviewhelpurl");
+this.externalstructureviewer = this.getParameter ("externalstructureviewer");
+this.checkForJmol = !"true".equals (this.getParameter ("nojmol"));
+this.sep = this.getParameter ("separator");
+this.rgb = this.getParameter ("RGB");
+this.labelColour = this.getParameter ("label");
+this.initjscallback = this.getParameter ("oninit");
+this.pdbFile = this.getParameter ("PDBFILE");
+this.sequence = this.getParameter ("PDBSEQ");
+this.jnetFile = this.getParameter ("jnetfile");
+this.annotations = this.getParameter ("annotations");
+this.hideFeatureGroups = this.getParameter ("hidefeaturegroups");
+this.showFeatureGroups = this.getParameter ("showfeaturegroups");
+this.features = this.getParameter ("features");
+this.showFeatureSettings = this.getParameter ("showFeatureSettings");
+this.scoreFile = this.getParameter ("scoreFile");
+this.treeFile = this.getParameter ("tree");
+if (this.treeFile == null) this.treeFile = this.getParameter ("treeFile");
+this.windowWidth = this.getParameter ("windowWidth");
+this.windowHeight = this.getParameter ("windowHeight");
+this.defaultColour = this.getParameter ("defaultColour");
+this.sortBy = this.getParameter ("sortBy");
+this.wrap = this.getParameter ("wrap");
+this.centrecolumnlabels = this.getParameter ("centrecolumnlabels");
+this.userDefinedColour = this.getParameter ("userDefinedColour");
+this.widthScale = this.getParameter ("widthScale");
+this.heightScale = this.getParameter ("heightScale");
+this.upperCase = this.getParameter ("upperCase");
+this.file2 = this.getParameter ("file2");
+});
+Clazz_defineMethod (c$, "getDefaultParameter", 
+function (name, def) {
+var stn;
+if ((stn = this.getParameter (name)) == null) {
+return def;
+}if (stn.toLowerCase ().equals ("true")) {
+return true;
+}return false;
+}, "~S,~B");
+Clazz_defineMethod (c$, "getLinkParams", 
+function (links) {
+var label;
+var url;
+for (var i = 1; i < 10; i++) {
+label = this.getParameter ("linkLabel_" + i);
+url = this.getParameter ("linkURL_" + i);
+if (label != null && url != null) {
+links.addElement (label + "|" + url);
+}}
+}, "java.util.Vector");
+Clazz_defineMethod (c$, "getStructureSelectionManager", 
+function () {
+return jalview.structure.StructureSelectionManager.getStructureSelectionManager (this);
+});
+Clazz_defineMethod (c$, "getSelectedSequences", 
+function () {
+return this.getSelectedSequencesFrom (this.getDefaultTargetFrame ());
+});
+Clazz_defineMethod (c$, "getSelectedSequences", 
+function (sep) {
+return this.getSelectedSequencesFrom (this.getDefaultTargetFrame (), sep);
+}, "~S");
+Clazz_defineMethod (c$, "getSelectedSequencesFrom", 
+function (alf) {
+return this.getSelectedSequencesFrom (alf, this.separator);
+}, "jalview.appletgui.AlignFrame");
+Clazz_defineMethod (c$, "getSelectedSequencesFrom", 
+function (alf, sep) {
+var result =  new StringBuffer ("");
+if (sep == null || sep.length == 0) {
+sep = this.separator;
+}if (alf.viewport.getSelectionGroup () != null) {
+var seqs = alf.viewport.getSelectionGroup ().getSequencesInOrder (alf.viewport.getAlignment ());
+for (var i = 0; i < seqs.length; i++) {
+result.append (seqs[i].getName ());
+result.append (sep);
+}
+}return result.toString ();
+}, "jalview.appletgui.AlignFrame,~S");
+Clazz_overrideMethod (c$, "highlight", 
+function (sequenceId, position, alignedPosition) {
+this.highlightIn (this.getDefaultTargetFrame (), sequenceId, position, alignedPosition);
+}, "~S,~S,~S");
+Clazz_overrideMethod (c$, "highlightIn", 
+function (alf, sequenceId, position, alignedPosition) {
+var matcher =  new jalview.analysis.SequenceIdMatcher (alf.viewport.getAlignment ().getSequencesArray ());
+var sq = matcher.findIdMatch (sequenceId);
+if (sq != null) {
+var apos = -1;
+try {
+apos =  new Integer (position).intValue ();
+apos--;
+} catch (ex) {
+if (Clazz_exceptionOf (ex, NumberFormatException)) {
+return;
+} else {
+throw ex;
+}
+}
+var me = this;
+var pos = apos;
+if (alignedPosition != null && (alignedPosition.trim ().length == 0 || alignedPosition.toLowerCase ().indexOf ("false") > -1)) {
+java.awt.EventQueue.invokeLater (((Clazz_isClassDefined ("jalview.bin.JalviewLite$1") ? 0 : jalview.bin.JalviewLite.$JalviewLite$1$ ()), Clazz_innerTypeInstance (jalview.bin.JalviewLite$1, this, Clazz_cloneFinals ("me", me, "sq", sq, "pos", pos))));
+} else {
+java.awt.EventQueue.invokeLater (((Clazz_isClassDefined ("jalview.bin.JalviewLite$2") ? 0 : jalview.bin.JalviewLite.$JalviewLite$2$ ()), Clazz_innerTypeInstance (jalview.bin.JalviewLite$2, this, Clazz_cloneFinals ("me", me, "sq", sq, "pos", pos))));
+}}}, "jalview.appletgui.AlignFrame,~S,~S,~S");
+Clazz_defineMethod (c$, "select", 
+function (sequenceIds, columns) {
+this.selectIn (this.getDefaultTargetFrame (), sequenceIds, columns, this.separator);
+}, "~S,~S");
+Clazz_defineMethod (c$, "select", 
+function (sequenceIds, columns, sep) {
+this.selectIn (this.getDefaultTargetFrame (), sequenceIds, columns, sep);
+}, "~S,~S,~S");
+Clazz_defineMethod (c$, "selectIn", 
+function (alf, sequenceIds, columns) {
+this.selectIn (alf, sequenceIds, columns, this.separator);
+}, "jalview.appletgui.AlignFrame,~S,~S");
+Clazz_defineMethod (c$, "selectIn", 
+function (alf, sequenceIds, columns, sep) {
+if (sep == null || sep.length == 0) {
+sep = this.separator;
+} else {
+if (jalview.bin.JalviewLite.debug) {
+System.err.println ("Selecting region using separator string '" + this.separator + "'");
+}}var ids = this.separatorListToArray (sequenceIds, sep);
+var cols = this.separatorListToArray (columns, sep);
+var sel =  new jalview.datamodel.SequenceGroup ();
+var csel =  new jalview.datamodel.ColumnSelection ();
+var al = alf.viewport.getAlignment ();
+var matcher =  new jalview.analysis.SequenceIdMatcher (alf.viewport.getAlignment ().getSequencesArray ());
+var start = 0;
+var end = al.getWidth ();
+var alw = al.getWidth ();
+var seqsfound = true;
+if (ids != null && ids.length > 0) {
+seqsfound = false;
+for (var i = 0; i < ids.length; i++) {
+if (ids[i].trim ().length == 0) {
+continue;
+}var sq = matcher.findIdMatch (ids[i]);
+if (sq != null) {
+seqsfound = true;
+sel.addSequence (sq, false);
+}}
+}var inseqpos = false;
+if (cols != null && cols.length > 0) {
+var seset = false;
+for (var i = 0; i < cols.length; i++) {
+var cl = cols[i].trim ();
+if (cl.length == 0) {
+continue;
+}var p;
+if ((p = cl.indexOf ("-")) > -1) {
+var from = -1;
+var to = -1;
+try {
+from =  new Integer (cl.substring (0, p)).intValue ();
+from--;
+} catch (ex) {
+if (Clazz_exceptionOf (ex, NumberFormatException)) {
+System.err.println ("ERROR: Couldn't parse first integer in range element column selection string '" + cl + "' - format is 'from-to'");
+return;
+} else {
+throw ex;
+}
+}
+try {
+to =  new Integer (cl.substring (p + 1)).intValue ();
+to--;
+} catch (ex) {
+if (Clazz_exceptionOf (ex, NumberFormatException)) {
+System.err.println ("ERROR: Couldn't parse second integer in range element column selection string '" + cl + "' - format is 'from-to'");
+return;
+} else {
+throw ex;
+}
+}
+if (from >= 0 && to >= 0) {
+if (from < to) {
+var t = to;
+to = from;
+to = t;
+}if (!seset) {
+start = from;
+end = to;
+seset = true;
+} else {
+if (start > from) {
+start = from;
+}if (end < to) {
+end = to;
+}}for (var r = from; r <= to; r++) {
+if (r >= 0 && r < alw) {
+csel.addElement (r);
+}}
+if (jalview.bin.JalviewLite.debug) {
+System.err.println ("Range '" + cl + "' deparsed as [" + from + "," + to + "]");
+}} else {
+System.err.println ("ERROR: Invalid Range '" + cl + "' deparsed as [" + from + "," + to + "]");
+}} else {
+var r = -1;
+try {
+r =  new Integer (cl).intValue ();
+r--;
+} catch (ex) {
+if (Clazz_exceptionOf (ex, NumberFormatException)) {
+if (cl.toLowerCase ().equals ("sequence")) {
+inseqpos = true;
+} else {
+System.err.println ("ERROR: Couldn't parse integer from point selection element of column selection string '" + cl + "'");
+return;
+}} else {
+throw ex;
+}
+}
+if (r >= 0 && r <= alw) {
+if (!seset) {
+start = r;
+end = r;
+seset = true;
+} else {
+if (start > r) {
+start = r;
+}if (end < r) {
+end = r;
+}}csel.addElement (r);
+if (jalview.bin.JalviewLite.debug) {
+System.err.println ("Point selection '" + cl + "' deparsed as [" + r + "]");
+}} else {
+System.err.println ("ERROR: Invalid Point selection '" + cl + "' deparsed as [" + r + "]");
+}}}
+}if (seqsfound) {
+if (inseqpos && sel.getSize () > 0) {
+var rs = sel.getSequenceAt (0);
+start = rs.findIndex (start);
+end = rs.findIndex (end);
+if (csel != null) {
+var cs = csel.getSelected ();
+csel.clear ();
+for (var selectedCol, $selectedCol = cs.iterator (); $selectedCol.hasNext () && ((selectedCol = $selectedCol.next ()) || true);) {
+csel.addElement (rs.findIndex ((selectedCol).intValue ()));
+}
+}}sel.setStartRes (start);
+sel.setEndRes (end);
+java.awt.EventQueue.invokeLater (((Clazz_isClassDefined ("jalview.bin.JalviewLite$3") ? 0 : jalview.bin.JalviewLite.$JalviewLite$3$ ()), Clazz_innerTypeInstance (jalview.bin.JalviewLite$3, this, Clazz_cloneFinals ("alf", alf, "sel", sel, "csel", csel))));
+}}, "jalview.appletgui.AlignFrame,~S,~S,~S");
+Clazz_overrideMethod (c$, "getSelectedSequencesAsAlignment", 
+function (format, suffix) {
+return this.getSelectedSequencesAsAlignmentFrom (this.getDefaultTargetFrame (), format, suffix);
+}, "~S,~S");
+Clazz_overrideMethod (c$, "getSelectedSequencesAsAlignmentFrom", 
+function (alf, format, suffix) {
+try {
+var seqlimits = suffix.equalsIgnoreCase ("true");
+if (alf.viewport.getSelectionGroup () != null) {
+var reply =  new jalview.io.AppletFormatAdapter ().formatSequences (format,  new jalview.datamodel.Alignment (alf.viewport.getSelectionAsNewSequence ()), seqlimits);
+return reply;
+}} catch (ex) {
+if (Clazz_exceptionOf (ex, Exception)) {
+ex.printStackTrace ();
+return "Error retrieving alignment in " + format + " format. ";
+} else {
+throw ex;
+}
+}
+return "";
+}, "jalview.appletgui.AlignFrame,~S,~S");
+Clazz_overrideMethod (c$, "getAlignmentOrder", 
+function () {
+return this.getAlignmentOrderFrom (this.getDefaultTargetFrame ());
+});
+Clazz_defineMethod (c$, "getAlignmentOrderFrom", 
+function (alf) {
+return this.getAlignmentOrderFrom (alf, this.separator);
+}, "jalview.appletgui.AlignFrame");
+Clazz_defineMethod (c$, "getAlignmentOrderFrom", 
+function (alf, sep) {
+var alorder = alf.getAlignViewport ().getAlignment ();
+var order =  new Array (alorder.getHeight ());
+for (var i = 0; i < order.length; i++) {
+order[i] = alorder.getSequenceAt (i).getName ();
+}
+return this.arrayToSeparatorList (order);
+}, "jalview.appletgui.AlignFrame,~S");
+Clazz_defineMethod (c$, "orderBy", 
+function (order, undoName) {
+return this.orderBy (order, undoName, this.separator);
+}, "~S,~S");
+Clazz_defineMethod (c$, "orderBy", 
+function (order, undoName, sep) {
+return this.orderAlignmentBy (this.getDefaultTargetFrame (), order, undoName, sep);
+}, "~S,~S,~S");
+Clazz_overrideMethod (c$, "orderAlignmentBy", 
+function (alf, order, undoName, sep) {
+var ids = this.separatorListToArray (order, sep);
+var sqs = null;
+if (ids != null && ids.length > 0) {
+var matcher =  new jalview.analysis.SequenceIdMatcher (alf.viewport.getAlignment ().getSequencesArray ());
+var s = 0;
+sqs =  new Array (ids.length);
+for (var i = 0; i < ids.length; i++) {
+if (ids[i].trim ().length == 0) {
+continue;
+}var sq = matcher.findIdMatch (ids[i]);
+if (sq != null) {
+sqs[s++] = sq;
+}}
+if (s > 0) {
+var sqq =  new Array (s);
+System.arraycopy (sqs, 0, sqq, 0, s);
+sqs = sqq;
+} else {
+sqs = null;
+}}if (sqs == null) {
+return "";
+};var aorder =  new jalview.datamodel.AlignmentOrder (sqs);
+if (undoName != null && undoName.trim ().length == 0) {
+undoName = null;
+}var _undoName = undoName;
+return alf.sortBy (aorder, _undoName) ? "true" : "";
+}, "jalview.appletgui.AlignFrame,~S,~S,~S");
+Clazz_defineMethod (c$, "getAlignment", 
+function (format) {
+return this.getAlignmentFrom (this.getDefaultTargetFrame (), format, "true");
+}, "~S");
+Clazz_defineMethod (c$, "getAlignmentFrom", 
+function (alf, format) {
+return this.getAlignmentFrom (alf, format, "true");
+}, "jalview.appletgui.AlignFrame,~S");
+Clazz_defineMethod (c$, "getAlignment", 
+function (format, suffix) {
+return this.getAlignmentFrom (this.getDefaultTargetFrame (), format, suffix);
+}, "~S,~S");
+Clazz_defineMethod (c$, "getAlignmentFrom", 
+function (alf, format, suffix) {
+try {
+var seqlimits = suffix.equalsIgnoreCase ("true");
+var reply =  new jalview.io.AppletFormatAdapter ().formatSequences (format, alf.viewport.getAlignment (), seqlimits);
+return reply;
+} catch (ex) {
+if (Clazz_exceptionOf (ex, Exception)) {
+ex.printStackTrace ();
+return "Error retrieving alignment in " + format + " format. ";
+} else {
+throw ex;
+}
+}
+}, "jalview.appletgui.AlignFrame,~S,~S");
+Clazz_overrideMethod (c$, "loadAnnotation", 
+function (annotation) {
+this.loadAnnotationFrom (this.getDefaultTargetFrame (), annotation);
+}, "~S");
+Clazz_overrideMethod (c$, "loadAnnotationFrom", 
+function (alf, annotation) {
+if ( new jalview.io.AnnotationFile ().annotateAlignmentView (alf.getAlignViewport (), annotation, jalview.io.AppletFormatAdapter.PASTE)) {
+alf.alignPanel.fontChanged ();
+alf.alignPanel.setScrollValues (0, 0);
+} else {
+alf.parseFeaturesFile (annotation, jalview.io.AppletFormatAdapter.PASTE);
+}}, "jalview.appletgui.AlignFrame,~S");
+Clazz_overrideMethod (c$, "loadFeatures", 
+function (features, autoenabledisplay) {
+this.loadFeaturesFrom (this.getDefaultTargetFrame (), features, autoenabledisplay);
+}, "~S,~B");
+Clazz_overrideMethod (c$, "loadFeaturesFrom", 
+function (alf, features, autoenabledisplay) {
+return alf.parseFeaturesFile (features, jalview.io.AppletFormatAdapter.PASTE, autoenabledisplay);
+}, "jalview.appletgui.AlignFrame,~S,~B");
+Clazz_overrideMethod (c$, "getFeatures", 
+function (format) {
+return this.getFeaturesFrom (this.getDefaultTargetFrame (), format);
+}, "~S");
+Clazz_overrideMethod (c$, "getFeaturesFrom", 
+function (alf, format) {
+return alf.outputFeatures (false, format);
+}, "jalview.appletgui.AlignFrame,~S");
+Clazz_overrideMethod (c$, "getAnnotation", 
+function () {
+return this.getAnnotationFrom (this.getDefaultTargetFrame ());
+});
+Clazz_overrideMethod (c$, "getAnnotationFrom", 
+function (alf) {
+return alf.outputAnnotations (false);
+}, "jalview.appletgui.AlignFrame");
+Clazz_defineMethod (c$, "newView", 
+function () {
+return this.newViewFrom (this.getDefaultTargetFrame ());
+});
+Clazz_defineMethod (c$, "newView", 
+function (name) {
+return this.newViewFrom (this.getDefaultTargetFrame (), name);
+}, "~S");
+Clazz_defineMethod (c$, "newViewFrom", 
+function (alf) {
+return alf.newView (null);
+}, "jalview.appletgui.AlignFrame");
+Clazz_defineMethod (c$, "newViewFrom", 
+function (alf, name) {
+return alf.newView (name);
+}, "jalview.appletgui.AlignFrame,~S");
+Clazz_overrideMethod (c$, "loadAlignment", 
+function (text, title) {
+var al = null;
+var format =  new jalview.io.IdentifyFile ().Identify (text, jalview.io.AppletFormatAdapter.PASTE);
+try {
+al =  new jalview.io.AppletFormatAdapter ().readFile (text, jalview.io.AppletFormatAdapter.PASTE, format);
+if (al.getHeight () > 0) {
+return  new jalview.appletgui.AlignFrame (al, this, title, false);
+}} catch (ex) {
+if (Clazz_exceptionOf (ex, java.io.IOException)) {
+ex.printStackTrace ();
+} else {
+throw ex;
+}
+}
+return null;
+}, "~S,~S");
+Clazz_defineMethod (c$, "setMouseoverListener", 
+function (listener) {
+this.setMouseoverListener (this.currentAlignFrame, listener);
+}, "~S");
+Clazz_defineMethod (c$, "setMouseoverListener", 
+function (af, listener) {
+if (listener != null) {
+listener = listener.trim ();
+if (listener.length == 0) {
+System.err.println ("jalview Javascript error: Ignoring empty function for mouseover listener.");
+return;
+}}var mol =  new jalview.javascript.MouseOverListener (this, af, listener);
+this.javascriptListeners.addElement (mol);
+jalview.structure.StructureSelectionManager.getStructureSelectionManager (this).addStructureViewerListener (mol);
+if (jalview.bin.JalviewLite.debug) {
+System.err.println ("Added a mouseover listener for " + ((af == null) ? "All frames" : "Just views for " + af.getAlignViewport ().getSequenceSetId ()));
+System.err.println ("There are now " + this.javascriptListeners.size () + " listeners in total.");
+}}, "jalview.appletgui.AlignFrame,~S");
+Clazz_defineMethod (c$, "setSelectionListener", 
+function (listener) {
+this.setSelectionListener (null, listener);
+}, "~S");
+Clazz_defineMethod (c$, "setSelectionListener", 
+function (af, listener) {
+if (listener != null) {
+listener = listener.trim ();
+if (listener.length == 0) {
+System.err.println ("jalview Javascript error: Ignoring empty function for selection listener.");
+return;
+}}var mol =  new jalview.javascript.JsSelectionSender (this, af, listener);
+this.javascriptListeners.addElement (mol);
+jalview.structure.StructureSelectionManager.getStructureSelectionManager (this).addSelectionListener (mol);
+if (jalview.bin.JalviewLite.debug) {
+System.err.println ("Added a selection listener for " + ((af == null) ? "All frames" : "Just views for " + af.getAlignViewport ().getSequenceSetId ()));
+System.err.println ("There are now " + this.javascriptListeners.size () + " listeners in total.");
+}}, "jalview.appletgui.AlignFrame,~S");
+Clazz_overrideMethod (c$, "setStructureListener", 
+function (listener, modelSet) {
+if (listener != null) {
+listener = listener.trim ();
+if (listener.length == 0) {
+System.err.println ("jalview Javascript error: Ignoring empty function for selection listener.");
+return;
+}}var mol =  new jalview.javascript.MouseOverStructureListener (this, listener, this.separatorListToArray (modelSet));
+this.javascriptListeners.addElement (mol);
+jalview.structure.StructureSelectionManager.getStructureSelectionManager (this).addStructureViewerListener (mol);
+if (jalview.bin.JalviewLite.debug) {
+System.err.println ("Added a javascript structure viewer listener '" + listener + "'");
+System.err.println ("There are now " + this.javascriptListeners.size () + " listeners in total.");
+}}, "~S,~S");
+Clazz_overrideMethod (c$, "removeJavascriptListener", 
+function (af, listener) {
+if (listener != null) {
+listener = listener.trim ();
+if (listener.length == 0) {
+listener = null;
+}}var rprt = false;
+for (var ms = 0, msSize = this.javascriptListeners.size (); ms < msSize; ) {
+var lstn = this.javascriptListeners.elementAt (ms);
+var lstner = lstn;
+if ((af == null || lstner.getAlignFrame () === af) && (listener == null || lstner.getListenerFunction ().equals (listener))) {
+this.javascriptListeners.removeElement (lstner);
+msSize--;
+if (Clazz_instanceOf (lstner, jalview.structure.SelectionListener)) {
+jalview.structure.StructureSelectionManager.getStructureSelectionManager (this).removeSelectionListener (lstner);
+} else {
+jalview.structure.StructureSelectionManager.getStructureSelectionManager (this).removeStructureViewerListener (lstner, null);
+}rprt = jalview.bin.JalviewLite.debug;
+if (jalview.bin.JalviewLite.debug) {
+System.err.println ("Removed listener '" + listener + "'");
+}} else {
+ms++;
+}}
+if (rprt) {
+System.err.println ("There are now " + this.javascriptListeners.size () + " listeners in total.");
+}}, "jalview.appletgui.AlignFrame,~S");
+Clazz_overrideMethod (c$, "stop", 
+function () {
+System.err.println ("Applet " + this.getName () + " stop().");
+this.tidyUp ();
+});
+Clazz_overrideMethod (c$, "destroy", 
+function () {
+System.err.println ("Applet " + this.getName () + " destroy().");
+this.tidyUp ();
+});
+Clazz_defineMethod (c$, "tidyUp", 
+ function () {
+this.removeAll ();
+if (this.currentAlignFrame != null && this.currentAlignFrame.viewport != null && this.currentAlignFrame.viewport.applet != null) {
+var av = this.currentAlignFrame.viewport;
+this.currentAlignFrame.closeMenuItem_actionPerformed ();
+av.applet = null;
+this.currentAlignFrame = null;
+}if (this.javascriptListeners != null) {
+while (this.javascriptListeners.size () > 0) {
+var mol = this.javascriptListeners.elementAt (0);
+this.javascriptListeners.removeElement (mol);
+if (Clazz_instanceOf (mol, jalview.structure.SelectionListener)) {
+jalview.structure.StructureSelectionManager.getStructureSelectionManager (this).removeSelectionListener (mol);
+} else {
+jalview.structure.StructureSelectionManager.getStructureSelectionManager (this).removeStructureViewerListener (mol, null);
+}mol.jvlite = null;
+}
+}if (this.jsFunctionExec != null) {
+this.jsFunctionExec.stopQueue ();
+this.jsFunctionExec.jvlite = null;
+}this.initialAlignFrame = null;
+this.jsFunctionExec = null;
+this.javascriptListeners = null;
+jalview.structure.StructureSelectionManager.release (this);
+});
+Clazz_overrideMethod (c$, "mouseOverStructure", 
+function (pdbResNum, chain, pdbfile) {
+var me = this;
+java.awt.EventQueue.invokeLater (((Clazz_isClassDefined ("jalview.bin.JalviewLite$4") ? 0 : jalview.bin.JalviewLite.$JalviewLite$4$ ()), Clazz_innerTypeInstance (jalview.bin.JalviewLite$4, this, Clazz_cloneFinals ("me", me, "pdbResNum", pdbResNum, "chain", chain, "pdbfile", pdbfile))));
+}, "~S,~S,~S");
+Clazz_overrideMethod (c$, "scrollViewToIn", 
+function (alf, topRow, leftHandColumn) {
+java.awt.EventQueue.invokeLater (((Clazz_isClassDefined ("jalview.bin.JalviewLite$5") ? 0 : jalview.bin.JalviewLite.$JalviewLite$5$ ()), Clazz_innerTypeInstance (jalview.bin.JalviewLite$5, this, Clazz_cloneFinals ("alf", alf, "topRow", topRow, "leftHandColumn", leftHandColumn))));
+}, "jalview.appletgui.AlignFrame,~S,~S");
+Clazz_overrideMethod (c$, "scrollViewToRowIn", 
+function (alf, topRow) {
+java.awt.EventQueue.invokeLater (((Clazz_isClassDefined ("jalview.bin.JalviewLite$6") ? 0 : jalview.bin.JalviewLite.$JalviewLite$6$ ()), Clazz_innerTypeInstance (jalview.bin.JalviewLite$6, this, Clazz_cloneFinals ("alf", alf, "topRow", topRow))));
+}, "jalview.appletgui.AlignFrame,~S");
+Clazz_overrideMethod (c$, "scrollViewToColumnIn", 
+function (alf, leftHandColumn) {
+java.awt.EventQueue.invokeLater (((Clazz_isClassDefined ("jalview.bin.JalviewLite$7") ? 0 : jalview.bin.JalviewLite.$JalviewLite$7$ ()), Clazz_innerTypeInstance (jalview.bin.JalviewLite$7, this, Clazz_cloneFinals ("alf", alf, "leftHandColumn", leftHandColumn))));
+}, "jalview.appletgui.AlignFrame,~S");
+c$.initBuildDetails = Clazz_defineMethod (c$, "initBuildDetails", 
+ function () {
+if (jalview.bin.JalviewLite.builddate == null) {
+jalview.bin.JalviewLite.builddate = "unknown";
+jalview.bin.JalviewLite.version = "test";
+jalview.bin.JalviewLite.installation = "Webstart";
+var url = jalview.bin.JalviewLite.getResource ("/.build_properties");
+if (url != null) {
+try {
+var reader =  new java.io.BufferedReader ( new java.io.InputStreamReader (url.openStream ()));
+var line;
+while ((line = reader.readLine ()) != null) {
+if (line.indexOf ("VERSION") > -1) {
+jalview.bin.JalviewLite.version = line.substring (line.indexOf ("=") + 1);
+}if (line.indexOf ("BUILD_DATE") > -1) {
+jalview.bin.JalviewLite.builddate = line.substring (line.indexOf ("=") + 1);
+}if (line.indexOf ("INSTALLATION") > -1) {
+jalview.bin.JalviewLite.installation = line.substring (line.indexOf ("=") + 1);
+}}
+} catch (ex) {
+if (Clazz_exceptionOf (ex, Exception)) {
+ex.printStackTrace ();
+} else {
+throw ex;
+}
+}
+}}});
+c$.getBuildDate = Clazz_defineMethod (c$, "getBuildDate", 
+function () {
+jalview.bin.JalviewLite.initBuildDetails ();
+return jalview.bin.JalviewLite.builddate;
+});
+c$.getInstallation = Clazz_defineMethod (c$, "getInstallation", 
+function () {
+jalview.bin.JalviewLite.initBuildDetails ();
+return jalview.bin.JalviewLite.installation;
+});
+c$.getVersion = Clazz_defineMethod (c$, "getVersion", 
+function () {
+jalview.bin.JalviewLite.initBuildDetails ();
+return jalview.bin.JalviewLite.version;
+});
+Clazz_overrideMethod (c$, "init", 
+function () {
+this.setParams ();
+try {
+if (jalview.bin.JalviewLite.debug) {
+System.err.println ("Applet context is '" + this.getAppletContext ().getClass ().toString () + "'");
+}var scriptObject = netscape.javascript.JSObject.getWindow (this);
+if (jalview.bin.JalviewLite.debug && scriptObject != null) {
+System.err.println ("Applet has Javascript callback support.");
+}} catch (ex) {
+if (Clazz_exceptionOf (ex, Exception)) {
+System.err.println ("Warning: No JalviewLite javascript callbacks available.");
+if (jalview.bin.JalviewLite.debug) {
+ex.printStackTrace ();
+}} else {
+throw ex;
+}
+}
+if (jalview.bin.JalviewLite.debug) {
+System.err.println ("JalviewLite Version " + jalview.bin.JalviewLite.getVersion ());
+System.err.println ("Build Date : " + jalview.bin.JalviewLite.getBuildDate ());
+System.err.println ("Installation : " + jalview.bin.JalviewLite.getInstallation ());
+}if (this.externalstructureviewer != null) {
+this.useXtrnalSviewer = this.externalstructureviewer.trim ().toLowerCase ().equals ("true");
+}if (this.sep != null) {
+if (this.sep.length > 0) {
+this.separator = this.sep;
+if (jalview.bin.JalviewLite.debug) {
+System.err.println ("Separator set to '" + this.separator + "'");
+}} else {
+throw  new Error (jalview.util.MessageManager.getString ("error.invalid_separator_parameter"));
+}}var r = 255;
+var g = 255;
+var b = 255;
+if (this.rgb != null) {
+try {
+r = Integer.parseInt (this.rgb.substring (0, 2), 16);
+g = Integer.parseInt (this.rgb.substring (2, 4), 16);
+b = Integer.parseInt (this.rgb.substring (4, 6), 16);
+} catch (ex) {
+if (Clazz_exceptionOf (ex, Exception)) {
+r = 255;
+g = 255;
+b = 255;
+} else {
+throw ex;
+}
+}
+}this.rgb = this.labelColour;
+if (this.rgb != null) {
+this.launcher.setLabel (this.rgb);
+}this.setBackground ( new java.awt.Color (r, g, b));
+if (this.startupFile == null) {
+var data =  new StringBuffer ("PASTE");
+var i = 1;
+while ((this.startupFile = this.getParameter ("sequence" + i)) != null) {
+data.append (this.startupFile.toString () + "\n");
+i++;
+}
+if (data.length () > 5) {
+this.startupFile = data.toString ();
+}}if (!this.enableSplitFrame) {
+this.file2 = null;
+}if (this.embedded) {
+var loader = Clazz_innerTypeInstance (jalview.bin.JalviewLite.LoadingThread, this, null, this.startupFile, this.file2, this);
+{
+loader.run();
+}} else if (this.startupFile != null) {
+if (!this.showButton) {
+var loader = Clazz_innerTypeInstance (jalview.bin.JalviewLite.LoadingThread, this, null, this.startupFile, this.file2, this);
+loader.start ();
+} else {
+this.add (this.launcher);
+this.launcher.addActionListener (((Clazz_isClassDefined ("jalview.bin.JalviewLite$8") ? 0 : jalview.bin.JalviewLite.$JalviewLite$8$ ()), Clazz_innerTypeInstance (jalview.bin.JalviewLite$8, this, null)));
+}} else {
+this.startupFile = "NO FILE";
+this.fileFound = false;
+this.callInitCallback ();
+}});
+Clazz_defineMethod (c$, "initLiveConnect", 
+ function () {
+var notFailed = false;
+var tries = 0;
+while (!notFailed && tries < 10) {
+if (tries > 0) {
+System.err.println ("LiveConnect request thread going to sleep.");
+}try {
+Thread.sleep (700 * (1 + tries));
+} catch (q) {
+if (Clazz_exceptionOf (q, InterruptedException)) {
+} else {
+throw q;
+}
+}
+;if (tries++ > 0) {
+System.err.println ("LiveConnect request thread woken up.");
+}try {
+var scriptObject = netscape.javascript.JSObject.getWindow (this);
+if (scriptObject.eval ("navigator") != null) {
+notFailed = true;
+}} catch (jsex) {
+if (Clazz_exceptionOf (jsex, Exception)) {
+System.err.println ("Attempt " + tries + " to access LiveConnect javascript failed.");
+} else {
+throw jsex;
+}
+}
+}
+});
+Clazz_defineMethod (c$, "callInitCallback", 
+ function () {
+if (this.initjscallback == null) {
+return;
+}this.initjscallback = this.initjscallback.trim ();
+if (this.initjscallback.length > 0) {
+var scriptObject = null;
+try {
+scriptObject = netscape.javascript.JSObject.getWindow (this);
+} catch (ex) {
+if (Clazz_exceptionOf (ex, Exception)) {
+} else {
+throw ex;
+}
+}
+;this.initLiveConnect ();
+if (scriptObject != null) {
+try {
+ new jalview.javascript.JSFunctionExec (this).executeJavascriptFunction (true, this.initjscallback, null, "Calling oninit callback '" + this.initjscallback + "'.");
+} catch (e) {
+if (Clazz_exceptionOf (e, Exception)) {
+System.err.println ("Exception when executing _oninit callback '" + this.initjscallback + "'.");
+e.printStackTrace ();
+} else {
+throw e;
+}
+}
+} else {
+System.err.println ("Not executing _oninit callback '" + this.initjscallback + "' - no scripting allowed.");
+}}});
+c$.addFrame = Clazz_defineMethod (c$, "addFrame", 
+function (frame, title, width, height) {
+frame.setLocation (jalview.bin.JalviewLite.lastFrameX, jalview.bin.JalviewLite.lastFrameY);
+jalview.bin.JalviewLite.lastFrameX += 40;
+jalview.bin.JalviewLite.lastFrameY += 40;
+frame.setSize (width, height);
+frame.setTitle (title);
+frame.addWindowListener (((Clazz_isClassDefined ("jalview.bin.JalviewLite$9") ? 0 : jalview.bin.JalviewLite.$JalviewLite$9$ ()), Clazz_innerTypeInstance (jalview.bin.JalviewLite$9, this, Clazz_cloneFinals ("frame", frame))));
+frame.setVisible (true);
+}, "javax.swing.JFrame,~S,~N,~N");
+Clazz_defineMethod (c$, "paintComponent", 
+function (g) {
+if (!this.fileFound) {
+g.setColor ( new java.awt.Color (200, 200, 200));
+g.setColor (java.awt.Color.cyan);
+g.fillRect (0, 0, this.getSize ().width, this.getSize ().height);
+g.setColor (java.awt.Color.red);
+awt2swing.Util.drawString (g, jalview.util.MessageManager.getString ("label.jalview_cannot_open_file"), 5, 15);
+awt2swing.Util.drawString (g, "\"" + this.startupFile + "\"", 5, 30);
+} else if (this.embedded && !this.haveShownLoadMessage) {
+g.setColor (java.awt.Color.black);
+g.setFont ( new java.awt.Font ("Arial", 1, 24));
+awt2swing.Util.drawString (g, jalview.util.MessageManager.getString ("label.jalview_applet"), 50, Clazz_doubleToInt (this.getSize ().height / 2) - 30);
+awt2swing.Util.drawString (g, jalview.util.MessageManager.getString ("label.loading_data") + "...", 50, Clazz_doubleToInt (this.getSize ().height / 2));
+this.haveShownLoadMessage = true;
+}}, "java.awt.Graphics");
+Clazz_defineMethod (c$, "getAppletWindow", 
+function (class1) {
+var wnds =  new java.util.Vector ();
+var cmp = this.getComponents ();
+if (cmp != null) {
+for (var i = 0; i < cmp.length; i++) {
+if (class1.isAssignableFrom (cmp[i].getClass ())) {
+wnds.addElement (cmp);
+}}
+}return wnds;
+}, "Class");
+Clazz_defineMethod (c$, "getDefaultTargetFrame", 
+function () {
+if (this.currentAlignFrame != null) {
+return this.currentAlignFrame;
+}if (this.initialAlignFrame != null) {
+return this.initialAlignFrame;
+}System.err.println ("Implementation error: Jalview Applet API cannot work out which AlignFrame to use.");
+return null;
+});
+Clazz_defineMethod (c$, "separatorListToArray", 
+function (list) {
+return this.separatorListToArray (list, this.separator);
+}, "~S");
+Clazz_defineMethod (c$, "separatorListToArray", 
+function (list, separator) {
+var seplen = separator.length;
+if (list == null || list.equals ("") || list.equals (separator)) {
+return null;
+}var jv =  new java.util.Vector ();
+var cp = 0;
+var pos;
+while ((pos = list.indexOf (separator, cp)) > cp) {
+jv.addElement (list.substring (cp, pos));
+cp = pos + seplen;
+}
+if (cp < list.length) {
+var c = list.substring (cp);
+if (!c.equals (separator)) {
+jv.addElement (c);
+}}if (jv.size () > 0) {
+var v =  new Array (jv.size ());
+for (var i = 0; i < v.length; i++) {
+v[i] = jv.elementAt (i);
+}
+jv.removeAllElements ();
+if (jalview.bin.JalviewLite.debug) {
+System.err.println ("Array from '" + separator + "' separated List:\n" + v.length);
+for (var i = 0; i < v.length; i++) {
+System.err.println ("item " + i + " '" + v[i] + "'");
+}
+}return v;
+}if (jalview.bin.JalviewLite.debug) {
+System.err.println ("Empty Array from '" + separator + "' separated List");
+}return null;
+}, "~S,~S");
+Clazz_defineMethod (c$, "arrayToSeparatorList", 
+function (list) {
+return this.arrayToSeparatorList (list, this.separator);
+}, "~A");
+Clazz_defineMethod (c$, "arrayToSeparatorList", 
+function (list, separator) {
+var v =  new StringBuffer ();
+if (list != null && list.length > 0) {
+for (var i = 0, iSize = list.length; i < iSize; i++) {
+if (list[i] != null) {
+if (i > 0) {
+v.append (separator);
+}v.append (list[i]);
+}}
+if (jalview.bin.JalviewLite.debug) {
+System.err.println ("Returning '" + separator + "' separated List:\n");
+System.err.println (v);
+}return v.toString ();
+}if (jalview.bin.JalviewLite.debug) {
+System.err.println ("Returning empty '" + separator + "' separated List\n");
+}return "" + separator;
+}, "~A,~S");
+Clazz_overrideMethod (c$, "getFeatureGroups", 
+function () {
+var lst = this.arrayToSeparatorList (this.getDefaultTargetFrame ().getFeatureGroups ());
+return lst;
+});
+Clazz_overrideMethod (c$, "getFeatureGroupsOn", 
+function (alf) {
+var lst = this.arrayToSeparatorList (alf.getFeatureGroups ());
+return lst;
+}, "jalview.appletgui.AlignFrame");
+Clazz_overrideMethod (c$, "getFeatureGroupsOfState", 
+function (visible) {
+return this.arrayToSeparatorList (this.getDefaultTargetFrame ().getFeatureGroupsOfState (visible));
+}, "~B");
+Clazz_overrideMethod (c$, "getFeatureGroupsOfStateOn", 
+function (alf, visible) {
+return this.arrayToSeparatorList (alf.getFeatureGroupsOfState (visible));
+}, "jalview.appletgui.AlignFrame,~B");
+Clazz_overrideMethod (c$, "setFeatureGroupStateOn", 
+function (alf, groups, state) {
+var st = state;
+java.awt.EventQueue.invokeLater (((Clazz_isClassDefined ("jalview.bin.JalviewLite$10") ? 0 : jalview.bin.JalviewLite.$JalviewLite$10$ ()), Clazz_innerTypeInstance (jalview.bin.JalviewLite$10, this, Clazz_cloneFinals ("alf", alf, "groups", groups, "st", st))));
+}, "jalview.appletgui.AlignFrame,~S,~B");
+Clazz_overrideMethod (c$, "setFeatureGroupState", 
+function (groups, state) {
+this.setFeatureGroupStateOn (this.getDefaultTargetFrame (), groups, state);
+}, "~S,~B");
+Clazz_overrideMethod (c$, "getSeparator", 
+function () {
+return this.separator;
+});
+Clazz_overrideMethod (c$, "setSeparator", 
+function (separator) {
+if (separator == null || separator.length < 1) {
+separator = "\u00ac";
+}this.separator = separator;
+if (jalview.bin.JalviewLite.debug) {
+System.err.println ("Default Separator now: '" + separator + "'");
+}}, "~S");
+Clazz_overrideMethod (c$, "addPdbFile", 
+function (alFrame, sequenceId, pdbEntryString, pdbFile) {
+return alFrame.addPdbFile (sequenceId, pdbEntryString, pdbFile);
+}, "jalview.appletgui.AlignFrame,~S,~S,~S");
+Clazz_defineMethod (c$, "setAlignPdbStructures", 
+function (alignPdbStructures) {
+this.alignPdbStructures = alignPdbStructures;
+}, "~B");
+Clazz_defineMethod (c$, "isAlignPdbStructures", 
+function () {
+return this.alignPdbStructures;
+});
+Clazz_overrideMethod (c$, "start", 
+function () {
+});
+Clazz_defineMethod (c$, "setJsMessageSet", 
+function (messageclass, viewId, colcommands) {
+var msgset = this.jsmessages.get (messageclass);
+if (msgset == null) {
+msgset =  new java.util.Hashtable ();
+this.jsmessages.put (messageclass, msgset);
+}msgset.put (viewId, colcommands);
+var l =  Clazz_newLongArray (colcommands.length, 0);
+for (var i = 0; i < colcommands.length; i++) {
+l[i] = colcommands[i].hashCode ();
+}
+this.jshashes.put (messageclass + "|" + viewId, l);
+}, "~S,~S,~A");
+Clazz_overrideMethod (c$, "getJsMessage", 
+function (messageclass, viewId) {
+var msgset = this.jsmessages.get (messageclass);
+if (msgset != null) {
+var msgs = msgset.get (viewId);
+if (msgs != null) {
+for (var i = 0; i < msgs.length; i++) {
+if (msgs[i] != null) {
+var m = msgs[i];
+msgs[i] = null;
+return m;
+}}
+}}return "";
+}, "~S,~S");
+Clazz_defineMethod (c$, "isJsMessageSetChanged", 
+function (string, string2, colcommands) {
+var l = this.jshashes.get (string + "|" + string2);
+if (l == null && colcommands != null) {
+return true;
+}for (var i = 0; i < colcommands.length; i++) {
+if (l[i] != colcommands[i].hashCode ()) {
+return true;
+}}
+return false;
+}, "~S,~S,~A");
+Clazz_defineMethod (c$, "getJsExecQueue", 
+function () {
+return this.jsExecQueue;
+});
+Clazz_defineMethod (c$, "setExecutor", 
+function (jsFunctionExec2) {
+this.jsFunctionExec = jsFunctionExec2;
+}, "jalview.javascript.JSFunctionExec");
+Clazz_defineMethod (c$, "getDefaultColourParameter", 
+function (colparam, defcolour) {
+var colprop = this.getParameter (colparam);
+if (colprop == null || colprop.trim ().length == 0) {
+return defcolour;
+}var col = jalview.schemes.ColourSchemeProperty.getAWTColorFromName (colprop);
+if (col == null) {
+try {
+col =  new jalview.schemes.UserColourScheme (colprop).findColour ('A');
+} catch (ex) {
+if (Clazz_exceptionOf (ex, Exception)) {
+System.err.println ("Couldn't parse '" + colprop + "' as a colour for " + colparam);
+col = null;
+} else {
+throw ex;
+}
+}
+}return (col == null) ? defcolour : col;
+}, "~S,java.awt.Color");
+Clazz_defineMethod (c$, "openJalviewHelpUrl", 
+function () {
+if (this.helpUrl == null || this.helpUrl.trim ().length < 5) {
+this.helpUrl = "http://www.jalview.org/help.html";
+}this.showURL (this.helpUrl, "HELP");
+});
+Clazz_defineMethod (c$, "resolveUrlForLocalOrAbsolute", 
+ function (url, localref) {
+var codebase = localref.toString ();
+var pt = codebase.indexOf ("?");
+if (pt < 0) pt = codebase.length;
+codebase = codebase.substring (0, pt);
+codebase = codebase.substring (0, codebase.lastIndexOf ("/") + 1);
+if (url.indexOf ("/") == 0 && !localref.getProtocol ().equals ("file")) {
+pt = codebase.indexOf ("/", 8);
+return codebase.substring (0, pt) + url;
+}return codebase + url;
+}, "~S,java.net.URL");
+Clazz_defineMethod (c$, "showURL", 
+function (url, target) {
+try {
+if (url.indexOf (":") == -1) {
+var prepend;
+url = this.resolveUrlForLocalOrAbsolute (url, prepend = this.getDefaultParameter ("resolvetocodebase", false) ? this.getDocumentBase () : this.getCodeBase ());
+if (jalview.bin.JalviewLite.debug) {
+System.err.println ("Show url (prepended " + prepend + " - toggle resolvetocodebase if code/docbase resolution is wrong): " + url);
+}} else {
+if (jalview.bin.JalviewLite.debug) {
+System.err.println ("Show url: " + url);
+}}if (url.indexOf ("javascript:") == 0) {
+this.getAppletContext ().showDocument ( new java.net.URL (url));
+} else {
+this.getAppletContext ().showDocument ( new java.net.URL (url), target);
+}} catch (ex) {
+if (Clazz_exceptionOf (ex, Exception)) {
+ex.printStackTrace ();
+} else {
+throw ex;
+}
+}
+}, "~S,~S");
+c$.$JalviewLite$LoadJmolThread$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_decorateAsClass (function () {
+Clazz_prepareCallback (this, arguments);
+this.running = false;
+Clazz_instantialize (this, arguments);
+}, jalview.bin.JalviewLite, "LoadJmolThread", Thread);
+Clazz_overrideMethod (c$, "run", 
+function () {
+if (this.running || this.b$["jalview.bin.JalviewLite"].checkedForJmol) {
+return;
+}this.running = true;
+if (this.b$["jalview.bin.JalviewLite"].checkForJmol) {
+try {
+if (!System.getProperty ("java.version").startsWith ("1.1")) {
+Clazz._4Name ("org.jmol.adapter.smarter.SmarterJmolAdapter");
+this.b$["jalview.bin.JalviewLite"].jmolAvailable = true;
+}if (!this.b$["jalview.bin.JalviewLite"].jmolAvailable) {
+System.out.println ("Jmol not available - Using MCview for structures");
+}} catch (ex) {
+if (Clazz_exceptionOf (ex, ClassNotFoundException)) {
+} else {
+throw ex;
+}
+}
+} else {
+this.b$["jalview.bin.JalviewLite"].jmolAvailable = false;
+if (jalview.bin.JalviewLite.debug) {
+System.err.println ("Skipping Jmol check. Will use MCView (probably)");
+}}this.b$["jalview.bin.JalviewLite"].checkedForJmol = true;
+this.running = false;
+});
+Clazz_defineMethod (c$, "notFinished", 
+function () {
+return this.running || !this.b$["jalview.bin.JalviewLite"].checkedForJmol;
+});
+c$ = Clazz_p0p ();
+};
+c$.$JalviewLite$LoadingThread$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_decorateAsClass (function () {
+Clazz_prepareCallback (this, arguments);
+this.protocol = null;
+this._file = null;
+this._file2 = null;
+this.applet = null;
+Clazz_instantialize (this, arguments);
+}, jalview.bin.JalviewLite, "LoadingThread", Thread);
+Clazz_defineMethod (c$, "dbgMsg", 
+ function (a) {
+if (jalview.bin.JalviewLite.debug) {
+System.err.println (a);
+}}, "~S");
+Clazz_defineMethod (c$, "setProtocolState", 
+function (a) {
+if (a.startsWith ("PASTE")) {
+a = a.substring (5);
+this.protocol = jalview.io.AppletFormatAdapter.PASTE;
+} else if (this.inArchive (a)) {
+this.protocol = jalview.io.AppletFormatAdapter.CLASSLOADER;
+} else {
+a = this.addProtocol (a);
+this.protocol = jalview.io.AppletFormatAdapter.URL;
+}this.dbgMsg ("Protocol identified as '" + this.protocol + "'");
+return a;
+}, "~S");
+Clazz_makeConstructor (c$, 
+function (a, b, c) {
+Clazz_superConstructor (this, jalview.bin.JalviewLite.LoadingThread, []);
+this._file = a;
+this._file2 = b;
+this.applet = c;
+}, "~S,~S,jalview.bin.JalviewLite");
+Clazz_overrideMethod (c$, "run", 
+function () {
+{
+System.out.println("BYPASSING JMOL LOADING FOR NOW. THIS WILL BE DONE ANOTHER WAY")
+}this.startLoading ();
+});
+Clazz_defineMethod (c$, "startLoading", 
+ function () {
+this.dbgMsg ("Loading thread started with:\n>>file\n" + this._file + ">>endfile");
+this.dbgMsg ("Loading started.");
+var a = this.readAlignment (this._file);
+var b = this.readAlignment (this._file2);
+if (a != null) {
+this.addToDisplay (a, b);
+this.loadTree (a);
+this.loadScoreFile (a);
+this.loadFeatures (a);
+this.loadAnnotations (a);
+this.loadJnetFile (a);
+this.loadPdbFiles (a);
+} else {
+this.b$["jalview.bin.JalviewLite"].fileFound = false;
+this.applet.remove (this.b$["jalview.bin.JalviewLite"].launcher);
+this.applet.repaint ();
+}this.b$["jalview.bin.JalviewLite"].callInitCallback ();
+});
+Clazz_defineMethod (c$, "addToDisplay", 
+function (a, b) {
+if (b == null) {
+a.addToDisplay (this.b$["jalview.bin.JalviewLite"].embedded);
+} else {
+var c =  new jalview.appletgui.SplitFrame (a, b);
+c.addToDisplay (this.b$["jalview.bin.JalviewLite"].embedded, this.b$["jalview.bin.JalviewLite"]);
+}}, "jalview.appletgui.AlignFrame,jalview.appletgui.AlignFrame");
+Clazz_defineMethod (c$, "readAlignment", 
+function (a) {
+if (a == null) {
+return null;
+}var b = this.setProtocolState (a);
+var c =  new jalview.io.IdentifyFile ().Identify (b, this.protocol);
+this.dbgMsg ("File identified as '" + c + "'");
+var d = null;
+try {
+d =  new jalview.io.AppletFormatAdapter ().readFile (b, this.protocol, c);
+if ((d != null) && (d.getHeight () > 0)) {
+this.dbgMsg ("Successfully loaded file.");
+d.setDataset (null);
+var e =  new jalview.appletgui.AlignFrame (d, this.applet, b, this.b$["jalview.bin.JalviewLite"].embedded, false);
+e.setTitle (b);
+if (this.b$["jalview.bin.JalviewLite"].initialAlignFrame == null) {
+this.b$["jalview.bin.JalviewLite"].initialAlignFrame = e;
+}this.b$["jalview.bin.JalviewLite"].currentAlignFrame = e;
+if (this.protocol === jalview.io.AppletFormatAdapter.PASTE) {
+e.setTitle (jalview.util.MessageManager.formatMessage ("label.sequences_from",  Clazz_newArray (-1, [this.applet.getDocumentBase ().toString ()])));
+}e.setStatus (jalview.util.MessageManager.formatMessage ("label.successfully_loaded_file",  Clazz_newArray (-1, [b])));
+return e;
+}} catch (ex) {
+if (Clazz_exceptionOf (ex, java.io.IOException)) {
+this.dbgMsg ("File load exception.");
+ex.printStackTrace ();
+if (jalview.bin.JalviewLite.debug) {
+try {
+var e =  new jalview.io.FileParse (b, this.protocol);
+var f = null;
+this.dbgMsg (">>>Dumping contents of '" + b + "' " + "(" + this.protocol + ")");
+while ((f = e.nextLine ()) != null) {
+this.dbgMsg (f);
+}
+this.dbgMsg (">>>Dump finished.");
+} catch (e) {
+if (Clazz_exceptionOf (e, Exception)) {
+System.err.println ("Exception when trying to dump the content of the file parameter.");
+e.printStackTrace ();
+} else {
+throw e;
+}
+}
+}} else {
+throw ex;
+}
+}
+return null;
+}, "~S");
+Clazz_defineMethod (c$, "loadPdbFiles", 
+function (a) {
+var b = false;
+this.applet.setAlignPdbStructures (this.b$["jalview.bin.JalviewLite"].getDefaultParameter ("alignpdbfiles", false));
+var c = 0;
+var d =  new java.util.Vector ();
+var e = (this.applet.getDefaultParameter ("relaxedidmatch", false)) ?  new jalview.analysis.SequenceIdMatcher (a.getAlignViewport ().getAlignment ().getSequencesArray ()) : null;
+var f;
+do {
+if (c > 0) {
+f = this.applet.getParameter ("PDBFILE" + c);
+} else {
+f = this.b$["jalview.bin.JalviewLite"].pdbFile;
+}if (f != null) {
+var g =  new jalview.datamodel.PDBEntry ();
+var h;
+var i = null;
+var j = null;
+var k =  new java.util.StringTokenizer (f, " ");
+if (k.countTokens () < 2) {
+if (this.b$["jalview.bin.JalviewLite"].sequence != null) {
+i =  Clazz_newArray (-1, [e == null ? a.getAlignViewport ().getAlignment ().findName (this.b$["jalview.bin.JalviewLite"].sequence) : e.findIdMatch (this.b$["jalview.bin.JalviewLite"].sequence)]);
+}} else {
+f = k.nextToken ();
+var l =  new java.util.Vector ();
+var m =  new java.util.Vector ();
+while (k.hasMoreTokens ()) {
+h = k.nextToken ();
+var n =  new java.util.StringTokenizer (h, "=");
+if (n.countTokens () > 1) {
+m.addElement (n.nextToken ());
+h = n.nextToken ();
+}l.addElement (e == null ? a.getAlignViewport ().getAlignment ().findName (h) : e.findIdMatch (h));
+}
+i =  new Array (l.size ());
+l.copyInto (i);
+if (m.size () == l.size ()) {
+j =  new Array (m.size ());
+m.copyInto (j);
+}}f = this.setProtocolState (f);
+if (this.protocol === jalview.io.AppletFormatAdapter.CLASSLOADER && !this.b$["jalview.bin.JalviewLite"].useXtrnalSviewer) {
+this.protocol = jalview.io.AppletFormatAdapter.URL;
+f = this.addProtocol (f);
+}g.setFile (f);
+if (i != null) {
+for (var l = 0; l < i.length; l++) {
+if (i[l] != null) {
+(i[l]).addPDBId (g);
+jalview.structure.StructureSelectionManager.getStructureSelectionManager (this.applet).registerPDBEntry (g);
+} else {
+if (jalview.bin.JalviewLite.debug) {
+System.err.println ("Warning: Possible input parsing error: Null sequence for attachment of PDB (sequence " + l + ")");
+}}}
+if (!this.b$["jalview.bin.JalviewLite"].alignPdbStructures) {
+a.newStructureView (this.applet, g, i, j, this.protocol);
+} else {
+d.addElement ( Clazz_newArray (-1, [g, i, j,  String.instantialize (this.protocol)]));
+}}}c++;
+} while (f != null || c < 10);
+if (d.size () > 0) {
+var g =  new Array (d.size ());
+var h =  new Array (d.size ());
+var i =  new Array (d.size ());
+var j =  new Array (d.size ());
+for (var k = 0, l = d.size (); k < l; k++) {
+var m = d.elementAt (k);
+h[k] = m[0];
+g[k] = m[1];
+i[k] = m[2];
+j[k] = m[3];
+}
+a.alignedStructureView (this.applet, h, g, i, j);
+b = true;
+}return b;
+}, "jalview.appletgui.AlignFrame");
+Clazz_defineMethod (c$, "loadJnetFile", 
+function (a) {
+var b = false;
+var c = this.b$["jalview.bin.JalviewLite"].jnetFile;
+if (c != null) {
+try {
+c = this.setProtocolState (c);
+var d = jalview.jsdev.GenericFileAdapter.getFile ("JPredFile", [c, this.protocol]);
+jalview.io.JnetAnnotationMaker.add_annotation (d, a.viewport.getAlignment (), 0, false);
+var e = a.viewport.getAlignment ().getSequenceAt (0);
+a.viewport.getAlignment ().setSeqrep (e);
+var f =  new jalview.datamodel.ColumnSelection ();
+f.hideInsertionsFor (e);
+a.viewport.setColumnSelection (f);
+a.alignPanel.fontChanged ();
+a.alignPanel.setScrollValues (0, 0);
+b = true;
+} catch (ex) {
+if (Clazz_exceptionOf (ex, Exception)) {
+ex.printStackTrace ();
+} else {
+throw ex;
+}
+}
+}return b;
+}, "jalview.appletgui.AlignFrame");
+Clazz_defineMethod (c$, "loadAnnotations", 
+function (a) {
+var b = false;
+var c = this.b$["jalview.bin.JalviewLite"].annotations;
+if (c != null) {
+c = this.setProtocolState (c);
+if ( new jalview.io.AnnotationFile ().annotateAlignmentView (a.viewport, c, this.protocol)) {
+a.alignPanel.fontChanged ();
+a.alignPanel.setScrollValues (0, 0);
+b = true;
+} else {
+System.err.println ("Annotations were not added from annotation file '" + c + "'");
+}}return b;
+}, "jalview.appletgui.AlignFrame");
+Clazz_defineMethod (c$, "loadFeatures", 
+function (a) {
+var b = false;
+var c = this.b$["jalview.bin.JalviewLite"].hideFeatureGroups;
+if (c != null) {
+a.setFeatureGroupState (this.b$["jalview.bin.JalviewLite"].separatorListToArray (c), false);
+}c = this.b$["jalview.bin.JalviewLite"].showFeatureGroups;
+if (c != null) {
+a.setFeatureGroupState (this.b$["jalview.bin.JalviewLite"].separatorListToArray (c), true);
+}c = this.b$["jalview.bin.JalviewLite"].features;
+if (c != null) {
+c = this.setProtocolState (c);
+b = a.parseFeaturesFile (c, this.protocol);
+}c = this.b$["jalview.bin.JalviewLite"].showFeatureSettings;
+if (c != null && c.equalsIgnoreCase ("true")) {
+a.viewport.setShowSequenceFeatures (true);
+ new jalview.appletgui.FeatureSettings (a.alignPanel);
+}return b;
+}, "jalview.appletgui.AlignFrame");
+Clazz_defineMethod (c$, "loadScoreFile", 
+function (a) {
+var b = false;
+if (this.b$["jalview.bin.JalviewLite"].scoreFile != null && !"".equals (this.b$["jalview.bin.JalviewLite"].scoreFile)) {
+try {
+if (jalview.bin.JalviewLite.debug) {
+System.err.println ("Attempting to load T-COFFEE score file from the scoreFile parameter");
+}b = a.loadScoreFile (this.b$["jalview.bin.JalviewLite"].scoreFile);
+if (!b) {
+System.err.println ("Failed to parse T-COFFEE parameter as a valid score file ('" + this.b$["jalview.bin.JalviewLite"].scoreFile + "')");
+}} catch (e) {
+if (Clazz_exceptionOf (e, Exception)) {
+System.err.printf ("Cannot read score file: '%s'. Cause: %s \n", [this.b$["jalview.bin.JalviewLite"].scoreFile, e.getMessage ()]);
+} else {
+throw e;
+}
+}
+}return b;
+}, "jalview.appletgui.AlignFrame");
+Clazz_defineMethod (c$, "loadTree", 
+function (a) {
+var b = false;
+if (this.b$["jalview.bin.JalviewLite"].treeFile == null) {
+this.b$["jalview.bin.JalviewLite"].treeFile = this.applet.getParameter ("treeFile");
+}if (this.b$["jalview.bin.JalviewLite"].treeFile != null) {
+try {
+this.b$["jalview.bin.JalviewLite"].treeFile = this.setProtocolState (this.b$["jalview.bin.JalviewLite"].treeFile);
+var c =  new jalview.io.NewickFile (this.b$["jalview.bin.JalviewLite"].treeFile, this.protocol);
+c.parse ();
+if (c.getTree () != null) {
+a.loadTree (c, this.b$["jalview.bin.JalviewLite"].treeFile);
+b = true;
+this.dbgMsg ("Successfully imported tree.");
+} else {
+this.dbgMsg ("Tree parameter did not resolve to a valid tree.");
+}} catch (ex) {
+if (Clazz_exceptionOf (ex, Exception)) {
+ex.printStackTrace ();
+} else {
+throw ex;
+}
+}
+}return b;
+}, "jalview.appletgui.AlignFrame");
+Clazz_defineMethod (c$, "inArchive", 
+function (a) {
+try {
+var b = (this.getClass ().getResourceAsStream ("/" + a) != null);
+if (jalview.bin.JalviewLite.debug) {
+System.err.println ("Resource '" + a + "' was " + (b ? "" : "not") + " located by classloader.");
+}return b;
+} catch (ex) {
+if (Clazz_exceptionOf (ex, Exception)) {
+System.out.println ("Exception checking resources: " + a + " " + ex);
+return false;
+} else {
+throw ex;
+}
+}
+}, "~S");
+Clazz_defineMethod (c$, "addProtocol", 
+function (a) {
+if (a.indexOf ("://") == -1) {
+var b = this.applet.resolveUrlForLocalOrAbsolute (a, this.b$["jalview.bin.JalviewLite"].getDocumentBase ());
+if (this.urlExists (b)) {
+if (jalview.bin.JalviewLite.debug) {
+System.err.println ("Prepended document base for resource: '" + a + "'");
+}return b;
+}b = this.applet.resolveUrlForLocalOrAbsolute (a, this.b$["jalview.bin.JalviewLite"].getCodeBase ());
+if (this.urlExists (b)) {
+if (jalview.bin.JalviewLite.debug) {
+System.err.println ("Prepended codebase for resource: '" + a + "'");
+}return b;
+}}return a;
+}, "~S");
+Clazz_defineMethod (c$, "urlExists", 
+ function (a) {
+var b = null;
+try {
+b =  new java.net.URL (a).openStream ();
+if (b != null) {
+return true;
+}} catch (x) {
+if (Clazz_exceptionOf (x, Exception)) {
+} else {
+throw x;
+}
+} finally {
+if (b != null) {
+try {
+b.close ();
+} catch (e) {
+if (Clazz_exceptionOf (e, java.io.IOException)) {
+} else {
+throw e;
+}
+}
+}}
+return false;
+}, "~S");
+c$ = Clazz_p0p ();
+};
+c$.$JalviewLite$1$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_declareAnonymous (jalview.bin, "JalviewLite$1", null, Runnable);
+Clazz_overrideMethod (c$, "run", 
+function () {
+jalview.structure.StructureSelectionManager.getStructureSelectionManager (this.f$.me).mouseOverVamsasSequence (this.f$.sq, this.f$.sq.findIndex (this.f$.pos), null);
+});
+c$ = Clazz_p0p ();
+};
+c$.$JalviewLite$2$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_declareAnonymous (jalview.bin, "JalviewLite$2", null, Runnable);
+Clazz_overrideMethod (c$, "run", 
+function () {
+jalview.structure.StructureSelectionManager.getStructureSelectionManager (this.f$.me).mouseOverVamsasSequence (this.f$.sq, this.f$.pos, null);
+});
+c$ = Clazz_p0p ();
+};
+c$.$JalviewLite$3$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_declareAnonymous (jalview.bin, "JalviewLite$3", null, Runnable);
+Clazz_overrideMethod (c$, "run", 
+function () {
+this.f$.alf.select (this.f$.sel, this.f$.csel);
+});
+c$ = Clazz_p0p ();
+};
+c$.$JalviewLite$4$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_declareAnonymous (jalview.bin, "JalviewLite$4", null, Runnable);
+Clazz_overrideMethod (c$, "run", 
+function () {
+try {
+jalview.structure.StructureSelectionManager.getStructureSelectionManager (this.f$.me).mouseOverStructure ( new Integer (this.f$.pdbResNum).intValue (), this.f$.chain, this.f$.pdbfile);
+if (jalview.bin.JalviewLite.debug) {
+System.err.println ("mouseOver for '" + this.f$.pdbResNum + "' in chain '" + this.f$.chain + "' in structure '" + this.f$.pdbfile + "'");
+}} catch (e) {
+if (Clazz_exceptionOf (e, NumberFormatException)) {
+System.err.println ("Ignoring invalid residue number string '" + this.f$.pdbResNum + "'");
+} else {
+throw e;
+}
+}
+});
+c$ = Clazz_p0p ();
+};
+c$.$JalviewLite$5$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_declareAnonymous (jalview.bin, "JalviewLite$5", null, Runnable);
+Clazz_overrideMethod (c$, "run", 
+function () {
+try {
+this.f$.alf.scrollTo ( new Integer (this.f$.topRow).intValue (),  new Integer (this.f$.leftHandColumn).intValue ());
+} catch (ex) {
+if (Clazz_exceptionOf (ex, Exception)) {
+System.err.println ("Couldn't parse integer arguments (topRow='" + this.f$.topRow + "' and leftHandColumn='" + this.f$.leftHandColumn + "')");
+ex.printStackTrace ();
+} else {
+throw ex;
+}
+}
+});
+c$ = Clazz_p0p ();
+};
+c$.$JalviewLite$6$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_declareAnonymous (jalview.bin, "JalviewLite$6", null, Runnable);
+Clazz_overrideMethod (c$, "run", 
+function () {
+try {
+this.f$.alf.scrollToRow ( new Integer (this.f$.topRow).intValue ());
+} catch (ex) {
+if (Clazz_exceptionOf (ex, Exception)) {
+System.err.println ("Couldn't parse integer arguments (topRow='" + this.f$.topRow + "')");
+ex.printStackTrace ();
+} else {
+throw ex;
+}
+}
+});
+c$ = Clazz_p0p ();
+};
+c$.$JalviewLite$7$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_declareAnonymous (jalview.bin, "JalviewLite$7", null, Runnable);
+Clazz_overrideMethod (c$, "run", 
+function () {
+try {
+this.f$.alf.scrollToColumn ( new Integer (this.f$.leftHandColumn).intValue ());
+} catch (ex) {
+if (Clazz_exceptionOf (ex, Exception)) {
+System.err.println ("Couldn't parse integer arguments (leftHandColumn='" + this.f$.leftHandColumn + "')");
+ex.printStackTrace ();
+} else {
+throw ex;
+}
+}
+});
+c$ = Clazz_p0p ();
+};
+c$.$JalviewLite$8$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_declareAnonymous (jalview.bin, "JalviewLite$8", null, java.awt.event.ActionListener);
+Clazz_overrideMethod (c$, "actionPerformed", 
+function (e) {
+var loader = Clazz_innerTypeInstance (jalview.bin.JalviewLite.LoadingThread, this, null, this.b$["jalview.bin.JalviewLite"].startupFile, this.b$["jalview.bin.JalviewLite"].file2, this.b$["jalview.bin.JalviewLite"]);
+loader.start ();
+}, "java.awt.event.ActionEvent");
+c$ = Clazz_p0p ();
+};
+c$.$JalviewLite$9$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_declareAnonymous (jalview.bin, "JalviewLite$9", java.awt.event.WindowAdapter);
+Clazz_overrideMethod (c$, "windowClosing", 
+function (e) {
+if (Clazz_instanceOf (this.f$.frame, jalview.appletgui.AlignFrame)) {
+var vp = (this.f$.frame).viewport;
+(this.f$.frame).closeMenuItem_actionPerformed ();
+if (vp.applet.currentAlignFrame === this.f$.frame) {
+vp.applet.currentAlignFrame = null;
+}vp.applet = null;
+vp = null;
+}jalview.bin.JalviewLite.lastFrameX -= 40;
+jalview.bin.JalviewLite.lastFrameY -= 40;
+if (Clazz_instanceOf (this.f$.frame, jalview.appletgui.EmbmenuFrame)) {
+(this.f$.frame).destroyMenus ();
+}this.f$.frame.setMenuBar (null);
+this.f$.frame.dispose ();
+}, "java.awt.event.WindowEvent");
+Clazz_defineMethod (c$, "windowActivated", 
+function (e) {
+if (Clazz_instanceOf (this.f$.frame, jalview.appletgui.AlignFrame)) {
+(this.f$.frame).viewport.applet.currentAlignFrame = this.f$.frame;
+if (jalview.bin.JalviewLite.debug) {
+System.err.println ("Activated window " + this.f$.frame);
+}}Clazz_superCall (this, jalview.bin.JalviewLite$9, "windowActivated", [e]);
+}, "java.awt.event.WindowEvent");
+c$ = Clazz_p0p ();
+};
+c$.$JalviewLite$10$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_declareAnonymous (jalview.bin, "JalviewLite$10", null, Runnable);
+Clazz_overrideMethod (c$, "run", 
+function () {
+this.f$.alf.setFeatureGroupState (this.b$["jalview.bin.JalviewLite"].separatorListToArray (this.f$.groups), this.f$.st);
+});
+c$ = Clazz_p0p ();
+};
+Clazz_defineStatics (c$,
+"TRUE", "true",
+"FALSE", "false",
+"debug", false,
+"lastFrameX", 200,
+"lastFrameY", 200,
+"builddate", null,
+"version", null,
+"installation", null);
+});
+Clazz_declarePackage ("javax.swing");
+Clazz_load (["javax.swing.AbstractButton"], "javax.swing.JButton", ["javax.swing.DefaultButtonModel", "$.SwingUtilities", "$.UIManager"], function () {
+c$ = Clazz_declareType (javax.swing, "JButton", javax.swing.AbstractButton);
+Clazz_makeConstructor (c$, 
+function () {
+this.construct (null, null);
+});
+Clazz_makeConstructor (c$, 
+function (icon) {
+this.construct (null, icon);
+}, "javax.swing.Icon");
+Clazz_makeConstructor (c$, 
+function (text) {
+this.construct (text, null);
+}, "~S");
+Clazz_makeConstructor (c$, 
+function (a) {
+this.construct ();
+this.setAction (a);
+}, "javax.swing.Action");
+Clazz_makeConstructor (c$, 
+function (text, icon) {
+Clazz_superConstructor (this, javax.swing.JButton, []);
+this.setModel ( new javax.swing.DefaultButtonModel ());
+this.init (text, icon);
+}, "~S,javax.swing.Icon");
+Clazz_overrideMethod (c$, "updateUI", 
+function () {
+this.setUI (javax.swing.UIManager.getUI (this));
+});
+Clazz_overrideMethod (c$, "getUIClassID", 
+function () {
+return "ButtonUI";
+});
+Clazz_defineMethod (c$, "isDefaultButton", 
+function () {
+var root = javax.swing.SwingUtilities.getRootPane (this);
+if (root != null) {
+return root.getDefaultButton () === this;
+}return false;
+});
+Clazz_defineMethod (c$, "isDefaultCapable", 
+function () {
+return this.defaultCapable;
+});
+Clazz_defineMethod (c$, "setDefaultCapable", 
+function (defaultCapable) {
+var oldDefaultCapable = this.defaultCapable;
+this.defaultCapable = defaultCapable;
+this.firePropertyChangeBool ("defaultCapable", oldDefaultCapable, defaultCapable);
+}, "~B");
+Clazz_defineMethod (c$, "removeNotify", 
+function () {
+var root = javax.swing.SwingUtilities.getRootPane (this);
+if (root != null && root.getDefaultButton () === this) {
+root.setDefaultButton (null);
+}Clazz_superCall (this, javax.swing.JButton, "removeNotify", []);
+});
+Clazz_defineMethod (c$, "paramString", 
+function () {
+var defaultCapableString = (this.defaultCapable ? "true" : "false");
+return Clazz_superCall (this, javax.swing.JButton, "paramString", []) + ",defaultCapable=" + defaultCapableString;
+});
+Clazz_defineStatics (c$,
+"$uiClassID", "ButtonUI");
+});
+Clazz_declarePackage ("jalview.util");
+Clazz_load (["java.text.MessageFormat", "java.util.logging.Logger"], "jalview.util.MessageManager", ["java.util.Locale", "$.ResourceBundle", "java.util.logging.Level"], function () {
+c$ = Clazz_declareType (jalview.util, "MessageManager");
+c$.getString = Clazz_defineMethod (c$, "getString", 
+function (key) {
+var value = "[missing key] " + key;
+try {
+value = jalview.util.MessageManager.rb.getString (key);
+} catch (e) {
+if (Clazz_exceptionOf (e, Exception)) {
+jalview.util.MessageManager.log.warning ("I18N missing: " + jalview.util.MessageManager.loc + "\t" + key);
+} else {
+throw e;
+}
+}
+return value;
+}, "~S");
+c$.getLocale = Clazz_defineMethod (c$, "getLocale", 
+function () {
+return jalview.util.MessageManager.loc;
+});
+c$.formatMessage = Clazz_defineMethod (c$, "formatMessage", 
+function (key, params) {
+return java.text.MessageFormat.format (jalview.util.MessageManager.getString (key), params);
+}, "~S,~A");
+c$.formatMessage = Clazz_defineMethod (c$, "formatMessage", 
+function (key, params) {
+return java.text.MessageFormat.format (jalview.util.MessageManager.getString (key), params);
+}, "~S,~A");
+c$.getStringOrReturn = Clazz_defineMethod (c$, "getStringOrReturn", 
+function (keyroot, name) {
+var smkey = keyroot + name.toLowerCase ().replaceAll (" ", "");
+try {
+name = jalview.util.MessageManager.rb.getString (smkey);
+} catch (x) {
+if (Clazz_exceptionOf (x, Exception)) {
+jalview.util.MessageManager.log.finest ("I18N missing key with root " + keyroot + ": " + jalview.util.MessageManager.loc + "\t" + smkey);
+} else {
+throw x;
+}
+}
+return name;
+}, "~S,~S");
+Clazz_defineStatics (c$,
+"rb", null);
+c$.log = c$.prototype.log = java.util.logging.Logger.getLogger (jalview.util.MessageManager.getCanonicalName ());
+Clazz_defineStatics (c$,
+"loc", null);
+{
+try {
+jalview.util.MessageManager.loc = java.util.Locale.getDefault ();
+jalview.util.MessageManager.log.info ("Getting messages for lang: " + jalview.util.MessageManager.loc);
+jalview.util.MessageManager.rb = java.util.ResourceBundle.getBundle ("lang.Messages", jalview.util.MessageManager.loc);
+if (jalview.util.MessageManager.rb == null || jalview.util.MessageManager.log.isLoggable (java.util.logging.Level.FINEST)) {
+jalview.util.MessageManager.log.finest ("Language keys: " + jalview.util.MessageManager.rb.keySet ());
+}} catch (e$$) {
+if (Clazz_exceptionOf (e$$, Exception)) {
+var q = e$$;
+{
+jalview.util.MessageManager.log.warning ("Exception when initting Locale for i18n messages\n" + q.getMessage ());
+q.printStackTrace ();
+}
+} else if (Clazz_exceptionOf (e$$, Error)) {
+var v = e$$;
+{
+jalview.util.MessageManager.log.warning ("Error when initting Locale for i18n messages\n" + v.getMessage ());
+v.printStackTrace ();
+}
+} else {
+throw e$$;
+}
+}
+}});
+Clazz_declarePackage ("java.util.logging");
+Clazz_load (["java.util.Hashtable", "java.util.logging.Level", "$.LogRecord"], "java.util.logging.Logger", null, function () {
+c$ = Clazz_decorateAsClass (function () {
+this.name = null;
+this.levelObject = null;
+this.levelValue = 0;
+Clazz_instantialize (this, arguments);
+}, java.util.logging, "Logger");
+Clazz_makeConstructor (c$, 
+function (name, resourceBundleName) {
+this.construct (name, resourceBundleName, null, false);
+}, "~S,~S");
+Clazz_makeConstructor (c$, 
+function (name, resourceBundleName, caller, isSystemLogger) {
+this.name = name;
+this.levelValue = java.util.logging.Level.INFO.intValue ();
+}, "~S,~S,Class,~B");
+Clazz_makeConstructor (c$, 
+ function (name) {
+this.name = name;
+this.levelValue = java.util.logging.Level.INFO.intValue ();
+}, "~S");
+c$.getLogger = Clazz_defineMethod (c$, "getLogger", 
+function (name) {
+var log = java.util.logging.Logger.loggers.get (name);
+if (log == null) java.util.logging.Logger.loggers.put (name, log =  new java.util.logging.Logger (name));
+return log;
+}, "~S");
+c$.getLogger = Clazz_defineMethod (c$, "getLogger", 
+function (name, resourceBundleName) {
+return java.util.logging.Logger.getLogger (name);
+}, "~S,~S");
+c$.getAnonymousLogger = Clazz_defineMethod (c$, "getAnonymousLogger", 
+function () {
+return java.util.logging.Logger.getAnonymousLogger (null);
+});
+c$.getAnonymousLogger = Clazz_defineMethod (c$, "getAnonymousLogger", 
+function (resourceBundleName) {
+return java.util.logging.Logger.global;
+}, "~S");
+Clazz_defineMethod (c$, "log", 
+function (record) {
+if (record.getLevel ().intValue () < this.levelValue || this.levelValue == java.util.logging.Logger.offValue) {
+return;
+}System.out.println (record.getLoggerName () + ": " + record.getMessage ());
+}, "java.util.logging.LogRecord");
+Clazz_defineMethod (c$, "doLog", 
+ function (lr) {
+lr.setLoggerName (this.name);
+this.log (lr);
+}, "java.util.logging.LogRecord");
+Clazz_defineMethod (c$, "log", 
+function (level, msg) {
+if (level.intValue () < this.levelValue || this.levelValue == java.util.logging.Logger.offValue) {
+return;
+}var lr =  new java.util.logging.LogRecord (level, msg);
+this.doLog (lr);
+}, "java.util.logging.Level,~S");
+Clazz_defineMethod (c$, "log", 
+function (level, msg, param1) {
+if (level.intValue () < this.levelValue || this.levelValue == java.util.logging.Logger.offValue) {
+return;
+}var lr =  new java.util.logging.LogRecord (level, msg);
+var params =  Clazz_newArray (-1, [param1]);
+lr.setParameters (params);
+this.doLog (lr);
+}, "java.util.logging.Level,~S,~O");
+Clazz_defineMethod (c$, "log", 
+function (level, msg, params) {
+if (level.intValue () < this.levelValue || this.levelValue == java.util.logging.Logger.offValue) {
+return;
+}var lr =  new java.util.logging.LogRecord (level, msg);
+lr.setParameters (params);
+this.doLog (lr);
+}, "java.util.logging.Level,~S,~A");
+Clazz_defineMethod (c$, "log", 
+function (level, msg, thrown) {
+if (level.intValue () < this.levelValue || this.levelValue == java.util.logging.Logger.offValue) {
+return;
+}var lr =  new java.util.logging.LogRecord (level, msg);
+lr.setThrown (thrown);
+this.doLog (lr);
+}, "java.util.logging.Level,~S,Throwable");
+Clazz_defineMethod (c$, "logp", 
+function (level, sourceClass, sourceMethod, msg) {
+if (level.intValue () < this.levelValue || this.levelValue == java.util.logging.Logger.offValue) {
+return;
+}var lr =  new java.util.logging.LogRecord (level, msg);
+lr.setSourceClassName (sourceClass);
+lr.setSourceMethodName (sourceMethod);
+this.doLog (lr);
+}, "java.util.logging.Level,~S,~S,~S");
+Clazz_defineMethod (c$, "logp", 
+function (level, sourceClass, sourceMethod, msg, param1) {
+if (level.intValue () < this.levelValue || this.levelValue == java.util.logging.Logger.offValue) {
+return;
+}var lr =  new java.util.logging.LogRecord (level, msg);
+lr.setSourceClassName (sourceClass);
+lr.setSourceMethodName (sourceMethod);
+var params =  Clazz_newArray (-1, [param1]);
+lr.setParameters (params);
+this.doLog (lr);
+}, "java.util.logging.Level,~S,~S,~S,~O");
+Clazz_defineMethod (c$, "logp", 
+function (level, sourceClass, sourceMethod, msg, params) {
+if (level.intValue () < this.levelValue || this.levelValue == java.util.logging.Logger.offValue) {
+return;
+}var lr =  new java.util.logging.LogRecord (level, msg);
+lr.setSourceClassName (sourceClass);
+lr.setSourceMethodName (sourceMethod);
+lr.setParameters (params);
+this.doLog (lr);
+}, "java.util.logging.Level,~S,~S,~S,~A");
+Clazz_defineMethod (c$, "logp", 
+function (level, sourceClass, sourceMethod, msg, thrown) {
+if (level.intValue () < this.levelValue || this.levelValue == java.util.logging.Logger.offValue) {
+return;
+}var lr =  new java.util.logging.LogRecord (level, msg);
+lr.setSourceClassName (sourceClass);
+lr.setSourceMethodName (sourceMethod);
+lr.setThrown (thrown);
+this.doLog (lr);
+}, "java.util.logging.Level,~S,~S,~S,Throwable");
+Clazz_defineMethod (c$, "entering", 
+function (sourceClass, sourceMethod) {
+if (java.util.logging.Level.FINER.intValue () < this.levelValue) {
+return;
+}this.logp (java.util.logging.Level.FINER, sourceClass, sourceMethod, "ENTRY");
+}, "~S,~S");
+Clazz_defineMethod (c$, "entering", 
+function (sourceClass, sourceMethod, param1) {
+if (java.util.logging.Level.FINER.intValue () < this.levelValue) {
+return;
+}var params =  Clazz_newArray (-1, [param1]);
+this.logp (java.util.logging.Level.FINER, sourceClass, sourceMethod, "ENTRY {0}", params);
+}, "~S,~S,~O");
+Clazz_defineMethod (c$, "entering", 
+function (sourceClass, sourceMethod, params) {
+if (java.util.logging.Level.FINER.intValue () < this.levelValue) {
+return;
+}var msg = "ENTRY";
+if (params == null) {
+this.logp (java.util.logging.Level.FINER, sourceClass, sourceMethod, msg);
+return;
+}for (var i = 0; i < params.length; i++) {
+msg = msg + " {" + i + "}";
+}
+this.logp (java.util.logging.Level.FINER, sourceClass, sourceMethod, msg, params);
+}, "~S,~S,~A");
+Clazz_defineMethod (c$, "exiting", 
+function (sourceClass, sourceMethod) {
+if (java.util.logging.Level.FINER.intValue () < this.levelValue) {
+return;
+}this.logp (java.util.logging.Level.FINER, sourceClass, sourceMethod, "RETURN");
+}, "~S,~S");
+Clazz_defineMethod (c$, "exiting", 
+function (sourceClass, sourceMethod, result) {
+if (java.util.logging.Level.FINER.intValue () < this.levelValue) {
+return;
+}this.logp (java.util.logging.Level.FINER, sourceClass, sourceMethod, "RETURN {0}", result);
+}, "~S,~S,~O");
+Clazz_defineMethod (c$, "throwing", 
+function (sourceClass, sourceMethod, thrown) {
+if (java.util.logging.Level.FINER.intValue () < this.levelValue || this.levelValue == java.util.logging.Logger.offValue) {
+return;
+}var lr =  new java.util.logging.LogRecord (java.util.logging.Level.FINER, "THROW");
+lr.setSourceClassName (sourceClass);
+lr.setSourceMethodName (sourceMethod);
+lr.setThrown (thrown);
+this.doLog (lr);
+}, "~S,~S,Throwable");
+Clazz_defineMethod (c$, "severe", 
+function (msg) {
+if (java.util.logging.Level.SEVERE.intValue () < this.levelValue) {
+return;
+}this.log (java.util.logging.Level.SEVERE, msg);
+}, "~S");
+Clazz_defineMethod (c$, "warning", 
+function (msg) {
+if (java.util.logging.Level.WARNING.intValue () < this.levelValue) {
+return;
+}this.log (java.util.logging.Level.WARNING, msg);
+}, "~S");
+Clazz_defineMethod (c$, "info", 
+function (msg) {
+if (java.util.logging.Level.INFO.intValue () < this.levelValue) {
+return;
+}this.log (java.util.logging.Level.INFO, msg);
+}, "~S");
+Clazz_defineMethod (c$, "config", 
+function (msg) {
+if (java.util.logging.Level.CONFIG.intValue () < this.levelValue) {
+return;
+}this.log (java.util.logging.Level.CONFIG, msg);
+}, "~S");
+Clazz_defineMethod (c$, "fine", 
+function (msg) {
+if (java.util.logging.Level.FINE.intValue () < this.levelValue) {
+return;
+}this.log (java.util.logging.Level.FINE, msg);
+}, "~S");
+Clazz_defineMethod (c$, "finer", 
+function (msg) {
+if (java.util.logging.Level.FINER.intValue () < this.levelValue) {
+return;
+}this.log (java.util.logging.Level.FINER, msg);
+}, "~S");
+Clazz_defineMethod (c$, "finest", 
+function (msg) {
+if (java.util.logging.Level.FINEST.intValue () < this.levelValue) {
+return;
+}this.log (java.util.logging.Level.FINEST, msg);
+}, "~S");
+Clazz_defineMethod (c$, "setLevel", 
+function (newLevel) {
+this.levelObject = newLevel;
+this.updateEffectiveLevel ();
+}, "java.util.logging.Level");
+Clazz_defineMethod (c$, "getLevel", 
+function () {
+return this.levelObject;
+});
+Clazz_defineMethod (c$, "isLoggable", 
+function (level) {
+if (level.intValue () < this.levelValue || this.levelValue == java.util.logging.Logger.offValue) {
+return false;
+}return true;
+}, "java.util.logging.Level");
+Clazz_defineMethod (c$, "getName", 
+function () {
+return this.name;
+});
+Clazz_defineMethod (c$, "updateEffectiveLevel", 
+ function () {
+var newLevelValue;
+if (this.levelObject != null) {
+newLevelValue = this.levelObject.intValue ();
+} else {
+newLevelValue = java.util.logging.Level.INFO.intValue ();
+}if (this.levelValue == newLevelValue) {
+return;
+}this.levelValue = newLevelValue;
+});
+c$.offValue = c$.prototype.offValue = java.util.logging.Level.OFF.intValue ();
+Clazz_defineStatics (c$,
+"GLOBAL_LOGGER_NAME", "global");
+c$.global = c$.prototype.global =  new java.util.logging.Logger ("global");
+c$.loggers = c$.prototype.loggers =  new java.util.Hashtable ();
+{
+java.util.logging.Logger.loggers.put ("global", java.util.logging.Logger.global);
+}});
+Clazz_declarePackage ("java.util.logging");
+Clazz_load (null, "java.util.logging.LogRecord", ["java.lang.NullPointerException", "$.Throwable"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.level = null;
+this.sequenceNumber = 0;
+this.sourceClassName = null;
+this.sourceMethodName = null;
+this.message = null;
+this.threadID = 0;
+this.millis = 0;
+this.thrown = null;
+this.loggerName = null;
+this.resourceBundleName = null;
+this.needToInferCaller = false;
+this.parameters = null;
+this.resourceBundle = null;
+Clazz_instantialize (this, arguments);
+}, java.util.logging, "LogRecord", null, java.io.Serializable);
+Clazz_makeConstructor (c$, 
+function (level, msg) {
+level.getClass ();
+this.level = level;
+this.message = msg;
+this.millis = System.currentTimeMillis ();
+this.needToInferCaller = true;
+}, "java.util.logging.Level,~S");
+Clazz_defineMethod (c$, "getLoggerName", 
+function () {
+return this.loggerName;
+});
+Clazz_defineMethod (c$, "setLoggerName", 
+function (name) {
+this.loggerName = name;
+}, "~S");
+Clazz_defineMethod (c$, "getResourceBundle", 
+function () {
+return this.resourceBundle;
+});
+Clazz_defineMethod (c$, "setResourceBundle", 
+function (bundle) {
+this.resourceBundle = bundle;
+}, "java.util.ResourceBundle");
+Clazz_defineMethod (c$, "getResourceBundleName", 
+function () {
+return this.resourceBundleName;
+});
+Clazz_defineMethod (c$, "setResourceBundleName", 
+function (name) {
+this.resourceBundleName = name;
+}, "~S");
+Clazz_defineMethod (c$, "getLevel", 
+function () {
+return this.level;
+});
+Clazz_defineMethod (c$, "setLevel", 
+function (level) {
+if (level == null) {
+throw  new NullPointerException ();
+}this.level = level;
+}, "java.util.logging.Level");
+Clazz_defineMethod (c$, "getSequenceNumber", 
+function () {
+return this.sequenceNumber;
+});
+Clazz_defineMethod (c$, "setSequenceNumber", 
+function (seq) {
+this.sequenceNumber = seq;
+}, "~N");
+Clazz_defineMethod (c$, "getSourceClassName", 
+function () {
+if (this.needToInferCaller) {
+this.inferCaller ();
+}return this.sourceClassName;
+});
+Clazz_defineMethod (c$, "setSourceClassName", 
+function (sourceClassName) {
+this.sourceClassName = sourceClassName;
+this.needToInferCaller = false;
+}, "~S");
+Clazz_defineMethod (c$, "getSourceMethodName", 
+function () {
+if (this.needToInferCaller) {
+this.inferCaller ();
+}return this.sourceMethodName;
+});
+Clazz_defineMethod (c$, "setSourceMethodName", 
+function (sourceMethodName) {
+this.sourceMethodName = sourceMethodName;
+this.needToInferCaller = false;
+}, "~S");
+Clazz_defineMethod (c$, "getMessage", 
+function () {
+return this.message;
+});
+Clazz_defineMethod (c$, "setMessage", 
+function (message) {
+this.message = message;
+}, "~S");
+Clazz_defineMethod (c$, "getParameters", 
+function () {
+return this.parameters;
+});
+Clazz_defineMethod (c$, "setParameters", 
+function (parameters) {
+this.parameters = parameters;
+}, "~A");
+Clazz_defineMethod (c$, "getThreadID", 
+function () {
+return this.threadID;
+});
+Clazz_defineMethod (c$, "setThreadID", 
+function (threadID) {
+this.threadID = threadID;
+}, "~N");
+Clazz_defineMethod (c$, "getMillis", 
+function () {
+return this.millis;
+});
+Clazz_defineMethod (c$, "setMillis", 
+function (millis) {
+this.millis = millis;
+}, "~N");
+Clazz_defineMethod (c$, "getThrown", 
+function () {
+return this.thrown;
+});
+Clazz_defineMethod (c$, "setThrown", 
+function (thrown) {
+this.thrown = thrown;
+}, "Throwable");
+Clazz_defineMethod (c$, "inferCaller", 
+ function () {
+this.needToInferCaller = false;
+var stack = ( new Throwable ()).getStackTrace ();
+var ix = 0;
+while (ix < stack.length) {
+var frame = stack[ix];
+var cname = frame.getClassName ();
+if (cname.equals ("java.util.logging.Logger")) {
+break;
+}ix++;
+}
+while (ix < stack.length) {
+var frame = stack[ix];
+var cname = frame.getClassName ();
+if (!cname.equals ("java.util.logging.Logger")) {
+this.setSourceClassName (cname);
+this.setSourceMethodName (frame.getMethodName ());
+return;
+}ix++;
+}
+});
+Clazz_defineStatics (c$,
+"globalSequenceNumber", 0);
+});
+Clazz_declarePackage ("java.util.logging");
+Clazz_load (["java.util.HashMap"], "java.util.logging.Level", ["java.lang.IllegalArgumentException", "$.NullPointerException", "java.util.ArrayList", "$.ResourceBundle"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.name = null;
+this.value = 0;
+this.resourceBundleName = null;
+this.localizedLevelName = null;
+Clazz_instantialize (this, arguments);
+}, java.util.logging, "Level", null, java.io.Serializable);
+Clazz_makeConstructor (c$, 
+function (name, value) {
+this.construct (name, value, null);
+}, "~S,~N");
+Clazz_makeConstructor (c$, 
+function (name, value, resourceBundleName) {
+if (name == null) {
+throw  new NullPointerException ();
+}this.name = name;
+this.value = value;
+this.resourceBundleName = resourceBundleName;
+this.localizedLevelName = resourceBundleName == null ? name : null;
+java.util.logging.Level.KnownLevel.add (this);
+}, "~S,~N,~S");
+Clazz_defineMethod (c$, "getResourceBundleName", 
+function () {
+return this.resourceBundleName;
+});
+Clazz_defineMethod (c$, "getName", 
+function () {
+return this.name;
+});
+Clazz_defineMethod (c$, "getLocalizedName", 
+function () {
+return this.getLocalizedLevelName ();
+});
+Clazz_defineMethod (c$, "getLevelName", 
+function () {
+return this.name;
+});
+Clazz_defineMethod (c$, "getLocalizedLevelName", 
+function () {
+if (this.localizedLevelName != null) {
+return this.localizedLevelName;
+}try {
+var rb = java.util.ResourceBundle.getBundle (this.resourceBundleName);
+this.localizedLevelName = rb.getString (this.name);
+} catch (ex) {
+if (Clazz_exceptionOf (ex, Exception)) {
+this.localizedLevelName = this.name;
+} else {
+throw ex;
+}
+}
+return this.localizedLevelName;
+});
+c$.findLevel = Clazz_defineMethod (c$, "findLevel", 
+function (name) {
+if (name == null) {
+throw  new NullPointerException ();
+}var level;
+level = java.util.logging.Level.KnownLevel.findByName (name);
+if (level != null) {
+return level.mirroredLevel;
+}try {
+var x = Integer.parseInt (name);
+level = java.util.logging.Level.KnownLevel.findByValue (x);
+if (level == null) {
+var levelObject =  new java.util.logging.Level (name, x);
+level = java.util.logging.Level.KnownLevel.findByValue (x);
+}return level.mirroredLevel;
+} catch (ex) {
+if (Clazz_exceptionOf (ex, NumberFormatException)) {
+} else {
+throw ex;
+}
+}
+level = java.util.logging.Level.KnownLevel.findByLocalizedLevelName (name);
+if (level != null) {
+return level.mirroredLevel;
+}return null;
+}, "~S");
+Clazz_overrideMethod (c$, "toString", 
+function () {
+return this.name;
+});
+Clazz_defineMethod (c$, "intValue", 
+function () {
+return this.value;
+});
+c$.parse = Clazz_defineMethod (c$, "parse", 
+function (name) {
+name.length;
+var level;
+level = java.util.logging.Level.KnownLevel.findByName (name);
+if (level != null) {
+return level.levelObject;
+}try {
+var x = Integer.parseInt (name);
+level = java.util.logging.Level.KnownLevel.findByValue (x);
+if (level == null) {
+var levelObject =  new java.util.logging.Level (name, x);
+level = java.util.logging.Level.KnownLevel.findByValue (x);
+}return level.levelObject;
+} catch (ex) {
+if (Clazz_exceptionOf (ex, NumberFormatException)) {
+} else {
+throw ex;
+}
+}
+level = java.util.logging.Level.KnownLevel.findByLocalizedName (name);
+if (level != null) {
+return level.levelObject;
+}throw  new IllegalArgumentException ("Bad level \"" + name + "\"");
+}, "~S");
+Clazz_overrideMethod (c$, "equals", 
+function (ox) {
+try {
+var lx = ox;
+return (lx.value == this.value);
+} catch (ex) {
+if (Clazz_exceptionOf (ex, Exception)) {
+return false;
+} else {
+throw ex;
+}
+}
+}, "~O");
+Clazz_overrideMethod (c$, "hashCode", 
+function () {
+return this.value;
+});
+Clazz_pu$h(self.c$);
+c$ = Clazz_decorateAsClass (function () {
+this.levelObject = null;
+this.mirroredLevel = null;
+Clazz_instantialize (this, arguments);
+}, java.util.logging.Level, "KnownLevel");
+Clazz_makeConstructor (c$, 
+function (a) {
+this.levelObject = a;
+if (a.getClass () === java.util.logging.Level) {
+this.mirroredLevel = a;
+} else {
+this.mirroredLevel =  new java.util.logging.Level (a.name, a.value, a.resourceBundleName);
+}}, "java.util.logging.Level");
+c$.add = Clazz_defineMethod (c$, "add", 
+function (a) {
+var b =  new java.util.logging.Level.KnownLevel (a);
+var c = java.util.logging.Level.KnownLevel.nameToLevels.get (a.name);
+if (c == null) {
+c =  new java.util.ArrayList ();
+java.util.logging.Level.KnownLevel.nameToLevels.put (a.name, c);
+}c.add (b);
+c = java.util.logging.Level.KnownLevel.intToLevels.get (new Integer (a.value));
+if (c == null) {
+c =  new java.util.ArrayList ();
+java.util.logging.Level.KnownLevel.intToLevels.put (new Integer (a.value), c);
+}c.add (b);
+}, "java.util.logging.Level");
+c$.findByName = Clazz_defineMethod (c$, "findByName", 
+function (a) {
+var b = java.util.logging.Level.KnownLevel.nameToLevels.get (a);
+if (b != null) {
+return b.get (0);
+}return null;
+}, "~S");
+c$.findByValue = Clazz_defineMethod (c$, "findByValue", 
+function (a) {
+var b = java.util.logging.Level.KnownLevel.intToLevels.get (new Integer (a));
+if (b != null) {
+return b.get (0);
+}return null;
+}, "~N");
+c$.findByLocalizedLevelName = Clazz_defineMethod (c$, "findByLocalizedLevelName", 
+function (a) {
+for (var levels, $levels = java.util.logging.Level.KnownLevel.nameToLevels.values ().iterator (); $levels.hasNext () && ((levels = $levels.next ()) || true);) {
+for (var l, $l = levels.iterator (); $l.hasNext () && ((l = $l.next ()) || true);) {
+var b = l.levelObject.getLocalizedLevelName ();
+if (a.equals (b)) {
+return l;
+}}
+}
+return null;
+}, "~S");
+c$.findByLocalizedName = Clazz_defineMethod (c$, "findByLocalizedName", 
+function (a) {
+for (var levels, $levels = java.util.logging.Level.KnownLevel.nameToLevels.values ().iterator (); $levels.hasNext () && ((levels = $levels.next ()) || true);) {
+for (var l, $l = levels.iterator (); $l.hasNext () && ((l = $l.next ()) || true);) {
+var b = l.levelObject.getLocalizedName ();
+if (a.equals (b)) {
+return l;
+}}
+}
+return null;
+}, "~S");
+c$.matches = Clazz_defineMethod (c$, "matches", 
+function (a) {
+var b = java.util.logging.Level.KnownLevel.nameToLevels.get (a.name);
+if (b != null) {
+for (var level, $level = b.iterator (); $level.hasNext () && ((level = $level.next ()) || true);) {
+var c = level.mirroredLevel;
+if (a.value == c.value && (a.resourceBundleName === c.resourceBundleName || (a.resourceBundleName != null && a.resourceBundleName.equals (c.resourceBundleName)))) {
+return level;
+}}
+}return null;
+}, "java.util.logging.Level");
+c$.nameToLevels = c$.prototype.nameToLevels =  new java.util.HashMap ();
+c$.intToLevels = c$.prototype.intToLevels =  new java.util.HashMap ();
+c$ = Clazz_p0p ();
+Clazz_defineStatics (c$,
+"defaultBundle", "sun.util.logging.resources.logging");
+c$.OFF = c$.prototype.OFF =  new java.util.logging.Level ("OFF", 2147483647, java.util.logging.Level.defaultBundle);
+c$.SEVERE = c$.prototype.SEVERE =  new java.util.logging.Level ("SEVERE", 1000, java.util.logging.Level.defaultBundle);
+c$.WARNING = c$.prototype.WARNING =  new java.util.logging.Level ("WARNING", 900, java.util.logging.Level.defaultBundle);
+c$.INFO = c$.prototype.INFO =  new java.util.logging.Level ("INFO", 800, java.util.logging.Level.defaultBundle);
+c$.CONFIG = c$.prototype.CONFIG =  new java.util.logging.Level ("CONFIG", 700, java.util.logging.Level.defaultBundle);
+c$.FINE = c$.prototype.FINE =  new java.util.logging.Level ("FINE", 500, java.util.logging.Level.defaultBundle);
+c$.FINER = c$.prototype.FINER =  new java.util.logging.Level ("FINER", 400, java.util.logging.Level.defaultBundle);
+c$.FINEST = c$.prototype.FINEST =  new java.util.logging.Level ("FINEST", 300, java.util.logging.Level.defaultBundle);
+c$.ALL = c$.prototype.ALL =  new java.util.logging.Level ("ALL", -2147483648, java.util.logging.Level.defaultBundle);
+});
+Clazz_declarePackage("java.text");
+c$=Clazz_decorateAsClass(function(){
+this.pattern=null;
+Clazz_instantialize(this,arguments);
+},java.text,"MessageFormat");
+Clazz_makeConstructor(c$,
+function(pattern){
+this.pattern=pattern;
+},"~S");
+Clazz_makeConstructor(c$,
+function(pattern,locale){
+this.pattern=pattern;
+},"~S,java.util.Locale");
+c$.format=Clazz_defineMethod(c$,"format",
+function(pattern,args){
+return pattern.replace(/\{(\d+)\}/g,function($0,$1){
+var i=parseInt($1);
+if(args==null)return null;
+return args[i];
+});
+},"~S,~A");
+Clazz_defineMethod(c$,"format",
+function(obj){
+return java.text.MessageFormat.format(this.pattern,[obj]);
+},"~O");
+Clazz_declarePackage ("java.util");
+Clazz_load (["java.util.ResourceBundle"], "java.util.PropertyResourceBundle", ["java.lang.NullPointerException", "java.util.HashMap", "java.util.Properties", "jssun.util.ResourceBundleEnumeration"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.lookup = null;
+Clazz_instantialize (this, arguments);
+}, java.util, "PropertyResourceBundle", java.util.ResourceBundle);
+Clazz_makeConstructor (c$, 
+function (stream) {
+Clazz_superConstructor (this, java.util.PropertyResourceBundle, []);
+this.setStream (stream);
+}, "java.io.InputStream");
+Clazz_defineMethod (c$, "setStream", 
+function (stream) {
+var properties =  new java.util.Properties ();
+properties.load (stream);
+this.lookup =  new java.util.HashMap (properties);
+return this;
+}, "java.io.InputStream");
+Clazz_makeConstructor (c$, 
+function (reader) {
+Clazz_superConstructor (this, java.util.PropertyResourceBundle, []);
+var properties =  new java.util.Properties ();
+properties.load (reader);
+this.lookup =  new java.util.HashMap (properties);
+}, "java.io.Reader");
+Clazz_makeConstructor (c$, 
+function () {
+Clazz_superConstructor (this, java.util.PropertyResourceBundle, []);
+});
+Clazz_overrideMethod (c$, "handleGetObject", 
+function (key) {
+if (key == null) {
+throw  new NullPointerException ();
+}return this.lookup.get (key);
+}, "~S");
+Clazz_defineMethod (c$, "getKeys", 
+function () {
+var parent = this.parent;
+return  new jssun.util.ResourceBundleEnumeration (this.lookup.keySet (), (parent != null) ? parent.getKeys () : null);
+});
+Clazz_overrideMethod (c$, "handleKeySet", 
+function () {
+return this.lookup.keySet ();
+});
+});
+Clazz_declarePackage ("jalview.javascript");
+Clazz_declareInterface (jalview.javascript, "JalviewLiteJsApi");
+Clazz_declarePackage ("jalview.api");
+Clazz_declareInterface (jalview.api, "StructureSelectionManagerProvider");
+Clazz_declarePackage ("awt2swing");
+c$ = Clazz_declareType (awt2swing, "Util");
+c$.drawString = Clazz_defineMethod (c$, "drawString", 
+function (g, text, x, y) {
+{
+g.drawStringUnique(text, x, y);
+}}, "java.awt.Graphics,~S,~N,~N");
+Clazz_declarePackage ("jalview.analysis");
+Clazz_load (null, "jalview.analysis.SequenceIdMatcher", ["java.util.ArrayList", "$.Arrays", "$.HashMap", "$.Vector"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.names = null;
+if (!Clazz_isClassDefined ("jalview.analysis.SequenceIdMatcher.SeqIdName")) {
+jalview.analysis.SequenceIdMatcher.$SequenceIdMatcher$SeqIdName$ ();
+}
+Clazz_instantialize (this, arguments);
+}, jalview.analysis, "SequenceIdMatcher");
+Clazz_makeConstructor (c$, 
+function (seqs) {
+this.names =  new java.util.HashMap ();
+this.addAll (seqs);
+}, "java.util.List");
+Clazz_defineMethod (c$, "addAll", 
+function (seqs) {
+for (var seq, $seq = seqs.iterator (); $seq.hasNext () && ((seq = $seq.next ()) || true);) {
+this.names.put (Clazz_innerTypeInstance (jalview.analysis.SequenceIdMatcher.SeqIdName, this, null, seq.getDisplayId (true)), seq);
+var dbseq = seq;
+while (dbseq.getDatasetSequence () != null) {
+dbseq = dbseq.getDatasetSequence ();
+}
+if (dbseq.getDBRef () != null) {
+var dbr = dbseq.getDBRef ();
+var sid = null;
+for (var r = 0; r < dbr.length; r++) {
+sid = Clazz_innerTypeInstance (jalview.analysis.SequenceIdMatcher.SeqIdName, this, null, dbr[r].getAccessionId ());
+if (!this.names.containsKey (sid)) {
+this.names.put (sid, seq);
+}}
+}}
+}, "java.util.List");
+Clazz_makeConstructor (c$, 
+function (sequences) {
+this.construct (java.util.Arrays.asList (sequences));
+}, "~A");
+Clazz_defineMethod (c$, "pickbestMatch", 
+ function (candName, matches) {
+var st = this.pickbestMatches (candName, matches);
+return st == null || st.size () == 0 ? null : st.get (0);
+}, "jalview.analysis.SequenceIdMatcher.SeqIdName,java.util.List");
+Clazz_defineMethod (c$, "pickbestMatches", 
+ function (candName, matches) {
+var best =  new java.util.ArrayList ();
+if (candName == null || matches == null || matches.size () == 0) {
+return null;
+}var match = matches.remove (0);
+best.add (match);
+this.names.put (Clazz_innerTypeInstance (jalview.analysis.SequenceIdMatcher.SeqIdName, this, null, match.getName ()), match);
+var matchlen = match.getName ().length;
+var namlen = candName.id.length;
+while (matches.size () > 0) {
+var cand = matches.remove (0);
+this.names.put (Clazz_innerTypeInstance (jalview.analysis.SequenceIdMatcher.SeqIdName, this, null, cand.getName ()), cand);
+var q;
+var w;
+var candlen = cand.getName ().length;
+if ((q = Math.abs (matchlen - namlen)) > (w = Math.abs (candlen - namlen)) && candlen > matchlen) {
+best.clear ();
+match = cand;
+matchlen = candlen;
+best.add (match);
+}if (q == w && candlen == matchlen) {
+best.add (cand);
+}}
+if (best.size () == 0) {
+return null;
+};return best;
+}, "jalview.analysis.SequenceIdMatcher.SeqIdName,java.util.List");
+Clazz_defineMethod (c$, "findIdMatch", 
+function (seq) {
+var nam = Clazz_innerTypeInstance (jalview.analysis.SequenceIdMatcher.SeqIdName, this, null, seq.getName ());
+return this.findIdMatch (nam);
+}, "jalview.datamodel.SequenceI");
+Clazz_defineMethod (c$, "findIdMatch", 
+function (seqnam) {
+var nam = Clazz_innerTypeInstance (jalview.analysis.SequenceIdMatcher.SeqIdName, this, null, seqnam);
+return this.findIdMatch (nam);
+}, "~S");
+Clazz_defineMethod (c$, "findAllIdMatches", 
+function (seqnam) {
+var nam = Clazz_innerTypeInstance (jalview.analysis.SequenceIdMatcher.SeqIdName, this, null, seqnam);
+var m = this.findAllIdMatches (nam);
+if (m != null) {
+return m.toArray ( new Array (m.size ()));
+}return null;
+}, "~S");
+Clazz_defineMethod (c$, "findIdMatch", 
+function (seqs) {
+var namedseqs = null;
+var i = 0;
+var nam;
+if (seqs.length > 0) {
+namedseqs =  new Array (seqs.length);
+do {
+nam = Clazz_innerTypeInstance (jalview.analysis.SequenceIdMatcher.SeqIdName, this, null, seqs[i].getName ());
+if (this.names.containsKey (nam)) {
+namedseqs[i] = this.findIdMatch (nam);
+} else {
+namedseqs[i] = null;
+}} while (++i < seqs.length);
+}return namedseqs;
+}, "~A");
+Clazz_defineMethod (c$, "findIdMatch", 
+ function (nam) {
+var matches =  new java.util.Vector ();
+while (this.names.containsKey (nam)) {
+matches.addElement (this.names.remove (nam));
+}
+return this.pickbestMatch (nam, matches);
+}, "jalview.analysis.SequenceIdMatcher.SeqIdName");
+Clazz_defineMethod (c$, "findAllIdMatches", 
+ function (nam) {
+var matches =  new java.util.ArrayList ();
+while (this.names.containsKey (nam)) {
+matches.add (this.names.remove (nam));
+}
+var r = this.pickbestMatches (nam, matches);
+return r;
+}, "jalview.analysis.SequenceIdMatcher.SeqIdName");
+c$.$SequenceIdMatcher$SeqIdName$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_decorateAsClass (function () {
+Clazz_prepareCallback (this, arguments);
+this.id = null;
+this.WORD_SEP = "~. |#\\/<>!\"\u00a4$%^*)}[@\',?_";
+Clazz_instantialize (this, arguments);
+}, jalview.analysis.SequenceIdMatcher, "SeqIdName");
+Clazz_makeConstructor (c$, 
+function (a) {
+if (a != null) {
+this.id =  String.instantialize (a);
+} else {
+this.id = "";
+}}, "~S");
+Clazz_overrideMethod (c$, "hashCode", 
+function () {
+return ((this.id.length >= 4) ? this.id.substring (0, 4).hashCode () : this.id.hashCode ());
+});
+Clazz_defineMethod (c$, "equals", 
+function (a) {
+if (a == null) {
+return false;
+}if (Clazz_instanceOf (a, jalview.analysis.SequenceIdMatcher.SeqIdName)) {
+return this.equals (a);
+} else {
+if (Clazz_instanceOf (a, String)) {
+return this.equals (a);
+}}return false;
+}, "~O");
+Clazz_defineMethod (c$, "equals", 
+function (a) {
+if (this.id.length > a.id.length) {
+return this.id.startsWith (a.id) ? (this.WORD_SEP.indexOf (this.id.charAt (a.id.length)) > -1) : false;
+} else {
+return a.id.startsWith (this.id) ? (a.id.equals (this.id) ? true : (this.WORD_SEP.indexOf (a.id.charAt (this.id.length)) > -1)) : false;
+}}, "jalview.analysis.SequenceIdMatcher.SeqIdName");
+Clazz_defineMethod (c$, "equals", 
+function (a) {
+if (this.id.length > a.length) {
+return this.id.startsWith (a) ? (this.WORD_SEP.indexOf (this.id.charAt (a.length)) > -1) : false;
+} else {
+return a.startsWith (this.id) ? (a.equals (this.id) ? true : (this.WORD_SEP.indexOf (a.charAt (this.id.length)) > -1)) : false;
+}}, "~S");
+c$ = Clazz_p0p ();
+};
+});
+Clazz_declarePackage ("jalview.appletgui");
+Clazz_load (["awt2swing.Canvas", "jalview.api.AlignViewControllerGuiI", "jalview.appletgui.EmbmenuFrame", "java.awt.event.ActionListener", "$.ItemListener", "$.KeyListener", "awt2swing.CheckboxMenuItem", "$.Label", "$.Menu", "$.MenuBar", "$.MenuItem", "jalview.util.MessageManager", "java.awt.BorderLayout"], "jalview.appletgui.AlignFrame", ["awt2swing.Frame", "$.Util", "jalview.analysis.AlignmentSorter", "$.AnnotationSorter", "jalview.appletgui.AlignViewport", "$.AlignmentPanel", "$.AnnotationColourChooser", "$.AnnotationColumnChooser", "$.AppletJmol", "$.CutAndPasteTransfer", "$.FeatureSettings", "$.Finder", "$.FontChooser", "$.OverviewPanel", "$.PCAPanel", "$.PaintRefresher", "$.PairwiseAlignPanel", "$.RedundancyPanel", "$.SliderPanel", "$.TreePanel", "$.UserDefinedColours", "jalview.bin.JalviewLite", "jalview.commands.EditCommand", "$.OrderCommand", "$.RemoveGapColCommand", "$.RemoveGapsCommand", "$.SlideSequencesCommand", "$.TrimRegionCommand", "jalview.controller.AlignViewController", "jalview.datamodel.Alignment", "$.PDBEntry", "$.Sequence", "$.SequenceGroup", "jalview.io.AlignmentProperties", "$.AnnotationFile", "$.AppletFormatAdapter", "$.FeaturesFile", "jalview.jsdev.GenericFileAdapter", "jalview.schemes.Blosum62ColourScheme", "$.BuriedColourScheme", "$.ClustalxColourScheme", "$.HelixColourScheme", "$.HydrophobicColourScheme", "$.NucleotideColourScheme", "$.PIDColourScheme", "$.PurinePyrimidineColourScheme", "$.RNAHelicesColourChooser", "$.RNAInteractionColourScheme", "$.StrandColourScheme", "$.TCoffeeColourScheme", "$.TaylorColourScheme", "$.TurnColourScheme", "$.ZappoColourScheme", "jalview.structure.StructureSelectionManager", "jalview.util.Comparison", "$.MappingUtils", "java.awt.Color", "$.Font", "java.awt.event.FocusListener", "$.WindowAdapter", "java.lang.Character", "$.StringBuffer", "java.net.URL", "$.URLEncoder", "java.util.Arrays", "$.HashMap", "$.Hashtable", "$.StringTokenizer", "$.Vector"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.avc = null;
+this.alignPanel = null;
+this.viewport = null;
+this.frameWidth = 700;
+this.frameHeight = 500;
+this.jalviewServletURL = null;
+this.showAutoCalculatedAbove = false;
+this.annotationSortOrder = null;
+this.alignFrameMenuBar = null;
+this.fileMenu = null;
+this.loadApplication = null;
+this.$loadTree = null;
+this.$loadAnnotations = null;
+this.$outputFeatures = null;
+this.$outputAnnotations = null;
+this.closeMenuItem = null;
+this.selectAllSequenceMenuItem = null;
+this.deselectAllSequenceMenuItem = null;
+this.invertSequenceMenuItem = null;
+this.remove2LeftMenuItem = null;
+this.remove2RightMenuItem = null;
+this.removeGappedColumnMenuItem = null;
+this.removeAllGapsMenuItem = null;
+this.viewBoxesMenuItem = null;
+this.viewTextMenuItem = null;
+this.sortPairwiseMenuItem = null;
+this.sortIDMenuItem = null;
+this.sortLengthMenuItem = null;
+this.sortGroupMenuItem = null;
+this.removeRedundancyMenuItem = null;
+this.pairwiseAlignmentMenuItem = null;
+this.PCAMenuItem = null;
+this.averageDistanceTreeMenuItem = null;
+this.neighbourTreeMenuItem = null;
+this.borderLayout1 = null;
+this.statusBar = null;
+this.clustalColour = null;
+this.zappoColour = null;
+this.taylorColour = null;
+this.hydrophobicityColour = null;
+this.helixColour = null;
+this.strandColour = null;
+this.turnColour = null;
+this.buriedColour = null;
+this.purinePyrimidineColour = null;
+this.RNAInteractionColour = null;
+this.RNAHelixColour = null;
+this.userDefinedColour = null;
+this.PIDColour = null;
+this.BLOSUM62Colour = null;
+this.tcoffeeColour = null;
+this.njTreeBlosumMenuItem = null;
+this.avDistanceTreeBlosumMenuItem = null;
+this.annotationPanelMenuItem = null;
+this.colourTextMenuItem = null;
+this.displayNonconservedMenuItem = null;
+this.alProperties = null;
+this.overviewMenuItem = null;
+this.undoMenuItem = null;
+this.redoMenuItem = null;
+this.conservationMenuItem = null;
+this.noColourmenuItem = null;
+this.wrapMenuItem = null;
+this.renderGapsMenuItem = null;
+this.findMenuItem = null;
+this.abovePIDThreshold = null;
+this.nucleotideColour = null;
+this.deleteGroups = null;
+this.grpsFromSelection = null;
+this.createGroup = null;
+this.unGroup = null;
+this.$delete = null;
+this.copy = null;
+this.cut = null;
+this.pasteMenu = null;
+this.pasteNew = null;
+this.pasteThis = null;
+this.applyToAllGroups = null;
+this.$font = null;
+this.scaleAbove = null;
+this.scaleLeft = null;
+this.scaleRight = null;
+this.modifyPID = null;
+this.modifyConservation = null;
+this.autoCalculate = null;
+this.$sortByTree = null;
+this.sortByTreeMenu = null;
+this.inputText = null;
+this.documentation = null;
+this.about = null;
+this.seqLimits = null;
+this.centreColumnLabelFlag = null;
+this.followMouseOverFlag = null;
+this.showSequenceLogo = null;
+this.applyAutoAnnotationSettings = null;
+this.showConsensusHistogram = null;
+this.showGroupConsensus = null;
+this.showGroupConservation = null;
+this.normSequenceLogo = null;
+this.featureSettings = null;
+this.sequenceFeatures = null;
+this.annotationColour = null;
+this.annotationColumnSelection = null;
+this.invertColSel = null;
+this.showColumns = null;
+this.showSeqs = null;
+this.hideColumns = null;
+this.hideSequences = null;
+this.hideAllButSelection = null;
+this.hideAllSelection = null;
+this.showAllHidden = null;
+this.$newView = null;
+this.showAlignmentAnnotations = null;
+this.showSequenceAnnotations = null;
+this.sortAnnBySequence = null;
+this.sortAnnByLabel = null;
+this.showAutoFirst = null;
+this.showAutoLast = null;
+this.splitFrame = null;
+Clazz_instantialize (this, arguments);
+}, jalview.appletgui, "AlignFrame", jalview.appletgui.EmbmenuFrame, [java.awt.event.ActionListener, java.awt.event.ItemListener, java.awt.event.KeyListener, jalview.api.AlignViewControllerGuiI]);
+Clazz_prepareFields (c$, function () {
+this.alignFrameMenuBar =  new awt2swing.MenuBar ();
+this.fileMenu =  new awt2swing.Menu (jalview.util.MessageManager.getString ("action.file"));
+this.loadApplication =  new awt2swing.MenuItem (jalview.util.MessageManager.getString ("label.view_full_application"));
+this.$loadTree =  new awt2swing.MenuItem (jalview.util.MessageManager.getString ("label.load_associated_tree"));
+this.$loadAnnotations =  new awt2swing.MenuItem (jalview.util.MessageManager.getString ("label.load_features_annotations"));
+this.$outputFeatures =  new awt2swing.MenuItem (jalview.util.MessageManager.getString ("label.export_features").concat ("..."));
+this.$outputAnnotations =  new awt2swing.MenuItem (jalview.util.MessageManager.getString ("label.export_annotations").concat ("..."));
+this.closeMenuItem =  new awt2swing.MenuItem (jalview.util.MessageManager.getString ("action.close"));
+this.selectAllSequenceMenuItem =  new awt2swing.MenuItem (jalview.util.MessageManager.getString ("action.select_all"));
+this.deselectAllSequenceMenuItem =  new awt2swing.MenuItem (jalview.util.MessageManager.getString ("action.deselect_all"));
+this.invertSequenceMenuItem =  new awt2swing.MenuItem (jalview.util.MessageManager.getString ("action.invert_selection"));
+this.remove2LeftMenuItem =  new awt2swing.MenuItem ();
+this.remove2RightMenuItem =  new awt2swing.MenuItem ();
+this.removeGappedColumnMenuItem =  new awt2swing.MenuItem ();
+this.removeAllGapsMenuItem =  new awt2swing.MenuItem ();
+this.viewBoxesMenuItem =  new awt2swing.CheckboxMenuItem ();
+this.viewTextMenuItem =  new awt2swing.CheckboxMenuItem ();
+this.sortPairwiseMenuItem =  new awt2swing.MenuItem ();
+this.sortIDMenuItem =  new awt2swing.MenuItem ();
+this.sortLengthMenuItem =  new awt2swing.MenuItem ();
+this.sortGroupMenuItem =  new awt2swing.MenuItem ();
+this.removeRedundancyMenuItem =  new awt2swing.MenuItem ();
+this.pairwiseAlignmentMenuItem =  new awt2swing.MenuItem ();
+this.PCAMenuItem =  new awt2swing.MenuItem ();
+this.averageDistanceTreeMenuItem =  new awt2swing.MenuItem ();
+this.neighbourTreeMenuItem =  new awt2swing.MenuItem ();
+this.borderLayout1 =  new java.awt.BorderLayout ();
+this.statusBar =  new awt2swing.Label ();
+this.clustalColour =  new awt2swing.MenuItem ();
+this.zappoColour =  new awt2swing.MenuItem ();
+this.taylorColour =  new awt2swing.MenuItem ();
+this.hydrophobicityColour =  new awt2swing.MenuItem ();
+this.helixColour =  new awt2swing.MenuItem ();
+this.strandColour =  new awt2swing.MenuItem ();
+this.turnColour =  new awt2swing.MenuItem ();
+this.buriedColour =  new awt2swing.MenuItem ();
+this.purinePyrimidineColour =  new awt2swing.MenuItem ();
+this.RNAInteractionColour =  new awt2swing.MenuItem ();
+this.RNAHelixColour =  new awt2swing.MenuItem ();
+this.userDefinedColour =  new awt2swing.MenuItem ();
+this.PIDColour =  new awt2swing.MenuItem ();
+this.BLOSUM62Colour =  new awt2swing.MenuItem ();
+this.tcoffeeColour =  new awt2swing.MenuItem ();
+this.njTreeBlosumMenuItem =  new awt2swing.MenuItem ();
+this.avDistanceTreeBlosumMenuItem =  new awt2swing.MenuItem ();
+this.annotationPanelMenuItem =  new awt2swing.CheckboxMenuItem ();
+this.colourTextMenuItem =  new awt2swing.CheckboxMenuItem ();
+this.displayNonconservedMenuItem =  new awt2swing.CheckboxMenuItem ();
+this.alProperties =  new awt2swing.MenuItem (jalview.util.MessageManager.getString ("label.alignment_props"));
+this.overviewMenuItem =  new awt2swing.MenuItem ();
+this.undoMenuItem =  new awt2swing.MenuItem ();
+this.redoMenuItem =  new awt2swing.MenuItem ();
+this.conservationMenuItem =  new awt2swing.CheckboxMenuItem ();
+this.noColourmenuItem =  new awt2swing.MenuItem ();
+this.wrapMenuItem =  new awt2swing.CheckboxMenuItem ();
+this.renderGapsMenuItem =  new awt2swing.CheckboxMenuItem ();
+this.findMenuItem =  new awt2swing.MenuItem ();
+this.abovePIDThreshold =  new awt2swing.CheckboxMenuItem ();
+this.nucleotideColour =  new awt2swing.MenuItem ();
+this.deleteGroups =  new awt2swing.MenuItem ();
+this.grpsFromSelection =  new awt2swing.MenuItem ();
+this.createGroup =  new awt2swing.MenuItem ();
+this.unGroup =  new awt2swing.MenuItem ();
+this.$delete =  new awt2swing.MenuItem ();
+this.copy =  new awt2swing.MenuItem ();
+this.cut =  new awt2swing.MenuItem ();
+this.pasteMenu =  new awt2swing.Menu ();
+this.pasteNew =  new awt2swing.MenuItem ();
+this.pasteThis =  new awt2swing.MenuItem ();
+this.applyToAllGroups =  new awt2swing.CheckboxMenuItem ();
+this.$font =  new awt2swing.MenuItem ();
+this.scaleAbove =  new awt2swing.CheckboxMenuItem ();
+this.scaleLeft =  new awt2swing.CheckboxMenuItem ();
+this.scaleRight =  new awt2swing.CheckboxMenuItem ();
+this.modifyPID =  new awt2swing.MenuItem ();
+this.modifyConservation =  new awt2swing.MenuItem ();
+this.$sortByTree =  new awt2swing.CheckboxMenuItem ("Sort Alignment With New Tree", true);
+this.sortByTreeMenu =  new awt2swing.Menu ();
+this.inputText =  new awt2swing.MenuItem ();
+this.documentation =  new awt2swing.MenuItem ();
+this.about =  new awt2swing.MenuItem ();
+this.seqLimits =  new awt2swing.CheckboxMenuItem ();
+this.centreColumnLabelFlag =  new awt2swing.CheckboxMenuItem ();
+this.followMouseOverFlag =  new awt2swing.CheckboxMenuItem ();
+this.showSequenceLogo =  new awt2swing.CheckboxMenuItem ();
+this.applyAutoAnnotationSettings =  new awt2swing.CheckboxMenuItem ();
+this.showConsensusHistogram =  new awt2swing.CheckboxMenuItem ();
+this.showGroupConsensus =  new awt2swing.CheckboxMenuItem ();
+this.showGroupConservation =  new awt2swing.CheckboxMenuItem ();
+this.normSequenceLogo =  new awt2swing.CheckboxMenuItem ();
+this.featureSettings =  new awt2swing.MenuItem ();
+this.sequenceFeatures =  new awt2swing.CheckboxMenuItem ();
+this.annotationColour =  new awt2swing.MenuItem ();
+this.annotationColumnSelection =  new awt2swing.MenuItem ();
+this.invertColSel =  new awt2swing.MenuItem ();
+this.showColumns =  new awt2swing.MenuItem ();
+this.showSeqs =  new awt2swing.MenuItem ();
+this.hideColumns =  new awt2swing.MenuItem ();
+this.hideSequences =  new awt2swing.MenuItem ();
+this.hideAllButSelection =  new awt2swing.MenuItem ();
+this.hideAllSelection =  new awt2swing.MenuItem ();
+this.showAllHidden =  new awt2swing.MenuItem ();
+this.$newView =  new awt2swing.MenuItem ();
+});
+Clazz_makeConstructor (c$, 
+function (al, applet, title, embedded) {
+this.construct (al, applet, title, embedded, true);
+}, "jalview.datamodel.AlignmentI,jalview.bin.JalviewLite,~S,~B");
+Clazz_makeConstructor (c$, 
+function (al, applet, title, embedded, addToDisplay) {
+this.construct (al, null, null, applet, title, embedded, addToDisplay);
+}, "jalview.datamodel.AlignmentI,jalview.bin.JalviewLite,~S,~B,~B");
+Clazz_makeConstructor (c$, 
+function (al, hiddenSeqs, columnSelection, applet, title, embedded) {
+this.construct (al, hiddenSeqs, columnSelection, applet, title, embedded, true);
+}, "jalview.datamodel.AlignmentI,~A,jalview.datamodel.ColumnSelection,jalview.bin.JalviewLite,~S,~B");
+Clazz_makeConstructor (c$, 
+function (al, hiddenSeqs, columnSelection, applet, title, embedded, addToDisplay) {
+Clazz_superConstructor (this, jalview.appletgui.AlignFrame, []);
+if (applet != null) {
+this.jalviewServletURL = applet.jalviewServletURL;
+}try {
+this.jbInit ();
+} catch (ex) {
+if (Clazz_exceptionOf (ex, Exception)) {
+ex.printStackTrace ();
+} else {
+throw ex;
+}
+}
+if (applet != null) {
+var param;
+try {
+param = applet.windowWidth;
+if (param != null) {
+var width = Integer.parseInt (param);
+this.frameWidth = width;
+}param = applet.windowHeight;
+if (param != null) {
+var height = Integer.parseInt (param);
+this.frameHeight = height;
+}} catch (ex) {
+if (Clazz_exceptionOf (ex, Exception)) {
+} else {
+throw ex;
+}
+}
+}this.viewport =  new jalview.appletgui.AlignViewport (al, applet);
+if (hiddenSeqs != null && hiddenSeqs.length > 0) {
+this.viewport.hideSequence (hiddenSeqs);
+}if (columnSelection != null) {
+this.viewport.setColumnSelection (columnSelection);
+}this.alignPanel =  new jalview.appletgui.AlignmentPanel (this, this.viewport);
+this.avc =  new jalview.controller.AlignViewController (this, this.viewport, this.alignPanel);
+this.viewport.updateConservation (this.alignPanel);
+this.viewport.updateConsensus (this.alignPanel);
+this.displayNonconservedMenuItem.setState (this.viewport.getShowUnconserved ());
+this.followMouseOverFlag.setState (this.viewport.isFollowHighlight ());
+this.showGroupConsensus.setState (this.viewport.isShowGroupConsensus ());
+this.showGroupConservation.setState (this.viewport.isShowGroupConservation ());
+this.showConsensusHistogram.setState (this.viewport.isShowConsensusHistogram ());
+this.showSequenceLogo.setState (this.viewport.isShowSequenceLogo ());
+this.normSequenceLogo.setState (this.viewport.isNormaliseSequenceLogo ());
+this.applyToAllGroups.setState (this.viewport.getColourAppliesToAllGroups ());
+this.annotationPanelMenuItem.setState (this.viewport.isShowAnnotation ());
+this.showAlignmentAnnotations.setState (this.viewport.isShowAnnotation ());
+this.showSequenceAnnotations.setState (this.viewport.isShowAnnotation ());
+this.seqLimits.setState (this.viewport.getShowJVSuffix ());
+if (applet != null) {
+var param = applet.sortBy;
+if (param != null) {
+if (param.equalsIgnoreCase ("Id")) {
+this.sortIDMenuItem_actionPerformed ();
+} else if (param.equalsIgnoreCase ("Pairwise Identity")) {
+this.sortPairwiseMenuItem_actionPerformed ();
+} else if (param.equalsIgnoreCase ("Length")) {
+this.sortLengthMenuItem_actionPerformed ();
+}}param = applet.wrap;
+if (param != null) {
+if (param.equalsIgnoreCase ("true")) {
+this.wrapMenuItem.setState (true);
+this.wrapMenuItem_actionPerformed ();
+}}param = applet.centrecolumnlabels;
+if (param != null) {
+this.centreColumnLabelFlag.setState (true);
+this.centreColumnLabelFlag_stateChanged ();
+}}if (this.viewport.getAlignment ().isNucleotide ()) {
+this.viewport.updateStrucConsensus (this.alignPanel);
+if (this.viewport.getAlignment ().hasRNAStructure ()) {
+this.RNAHelixColour.setEnabled (true);
+} else {
+this.RNAHelixColour.setEnabled (false);
+}} else {
+this.RNAHelixColour.setEnabled (false);
+this.purinePyrimidineColour.setEnabled (false);
+}this.addKeyListener (this);
+this.alignPanel.seqPanel.seqCanvas.addKeyListener (this);
+this.alignPanel.idPanel.idCanvas.addKeyListener (this);
+this.alignPanel.scalePanel.addKeyListener (this);
+this.alignPanel.annotationPanel.addKeyListener (this);
+this.alignPanel.annotationPanelHolder.addKeyListener (this);
+this.alignPanel.annotationSpaceFillerHolder.addKeyListener (this);
+this.alignPanel.alabels.addKeyListener (this);
+if (addToDisplay) {
+this.addToDisplay (embedded);
+}}, "jalview.datamodel.AlignmentI,~A,jalview.datamodel.ColumnSelection,jalview.bin.JalviewLite,~S,~B,~B");
+Clazz_defineMethod (c$, "addToDisplay", 
+function (embedded) {
+this.createAlignFrameWindow (embedded);
+this.validate ();
+this.alignPanel.adjustAnnotationHeight ();
+this.alignPanel.paintAlignment (true);
+}, "~B");
+Clazz_defineMethod (c$, "getAlignViewport", 
+function () {
+return this.viewport;
+});
+Clazz_defineMethod (c$, "getSeqcanvas", 
+function () {
+return this.alignPanel.seqPanel.seqCanvas;
+});
+Clazz_defineMethod (c$, "parseFeaturesFile", 
+function (file, type) {
+return this.parseFeaturesFile (file, type, true);
+}, "~S,~S");
+Clazz_defineMethod (c$, "parseFeaturesFile", 
+function (file, type, autoenabledisplay) {
+var featureLinks =  new java.util.Hashtable ();
+var featuresFile = false;
+try {
+featuresFile =  new jalview.io.FeaturesFile (file, type).parse (this.viewport.getAlignment (), this.alignPanel.seqPanel.seqCanvas.getFeatureRenderer ().getFeatureColours (), featureLinks, true, this.viewport.applet.getDefaultParameter ("relaxedidmatch", false));
+} catch (ex) {
+if (Clazz_exceptionOf (ex, Exception)) {
+ex.printStackTrace ();
+} else {
+throw ex;
+}
+}
+if (featuresFile) {
+if (featureLinks.size () > 0) {
+this.alignPanel.seqPanel.seqCanvas.getFeatureRenderer ().featureLinks = featureLinks;
+}if (autoenabledisplay) {
+this.viewport.setShowSequenceFeatures (true);
+this.sequenceFeatures.setState (true);
+}if (this.alignPanel.seqPanel.seqCanvas.fr != null) {
+this.alignPanel.seqPanel.seqCanvas.fr.findAllFeatures (true);
+}if (this.viewport.featureSettings != null) {
+this.viewport.featureSettings.refreshTable ();
+}this.alignPanel.paintAlignment (true);
+this.setStatus (jalview.util.MessageManager.getString ("label.successfully_added_features_alignment"));
+}return featuresFile;
+}, "~S,~S,~B");
+Clazz_overrideMethod (c$, "keyPressed", 
+function (evt) {
+if (this.viewport.cursorMode && ((evt.getKeyCode () >= 48 && evt.getKeyCode () <= 57) || (evt.getKeyCode () >= 96 && evt.getKeyCode () <= 105)) && Character.isDigit (evt.getKeyChar ())) {
+this.alignPanel.seqPanel.numberPressed (evt.getKeyChar ());
+}switch (evt.getKeyCode ()) {
+case 27:
+this.deselectAllSequenceMenuItem_actionPerformed ();
+this.alignPanel.alabels.cancelDrag ();
+break;
+case 88:
+if (evt.isControlDown () || evt.isMetaDown ()) {
+this.cut_actionPerformed ();
+}break;
+case 67:
+if (this.viewport.cursorMode && !evt.isControlDown ()) {
+this.alignPanel.seqPanel.setCursorColumn ();
+}if (evt.isControlDown () || evt.isMetaDown ()) {
+this.copy_actionPerformed ();
+}break;
+case 86:
+if (evt.isControlDown ()) {
+this.paste (evt.isShiftDown ());
+}break;
+case 65:
+if (evt.isControlDown () || evt.isMetaDown ()) {
+this.selectAllSequenceMenuItem_actionPerformed ();
+}break;
+case 40:
+if (this.viewport.cursorMode) {
+this.alignPanel.seqPanel.moveCursor (0, 1);
+} else {
+this.moveSelectedSequences (false);
+}break;
+case 38:
+if (this.viewport.cursorMode) {
+this.alignPanel.seqPanel.moveCursor (0, -1);
+} else {
+this.moveSelectedSequences (true);
+}break;
+case 37:
+if (evt.isAltDown () || !this.viewport.cursorMode) {
+this.slideSequences (false, this.alignPanel.seqPanel.getKeyboardNo1 ());
+} else {
+this.alignPanel.seqPanel.moveCursor (-1, 0);
+}break;
+case 39:
+if (evt.isAltDown () || !this.viewport.cursorMode) {
+this.slideSequences (true, this.alignPanel.seqPanel.getKeyboardNo1 ());
+} else {
+this.alignPanel.seqPanel.moveCursor (1, 0);
+}break;
+case 32:
+if (this.viewport.cursorMode) {
+this.alignPanel.seqPanel.insertGapAtCursor (evt.isControlDown () || evt.isShiftDown () || evt.isAltDown ());
+}break;
+case 127:
+case 8:
+if (this.viewport.cursorMode) {
+this.alignPanel.seqPanel.deleteGapAtCursor (evt.isControlDown () || evt.isShiftDown () || evt.isAltDown ());
+} else {
+this.cut_actionPerformed ();
+this.alignPanel.seqPanel.seqCanvas.repaint ();
+}break;
+case 83:
+if (this.viewport.cursorMode) {
+this.alignPanel.seqPanel.setCursorRow ();
+}break;
+case 80:
+if (this.viewport.cursorMode) {
+this.alignPanel.seqPanel.setCursorPosition ();
+}break;
+case 10:
+case 44:
+if (this.viewport.cursorMode) {
+this.alignPanel.seqPanel.setCursorRowAndColumn ();
+}break;
+case 81:
+if (this.viewport.cursorMode) {
+this.alignPanel.seqPanel.setSelectionAreaAtCursor (true);
+}break;
+case 77:
+if (this.viewport.cursorMode) {
+this.alignPanel.seqPanel.setSelectionAreaAtCursor (false);
+}break;
+case 113:
+this.viewport.cursorMode = !this.viewport.cursorMode;
+this.setStatus (jalview.util.MessageManager.formatMessage ("label.keyboard_editing_mode",  Clazz_newArray (-1, [(this.viewport.cursorMode ? "on" : "off")])));
+if (this.viewport.cursorMode) {
+this.alignPanel.seqPanel.seqCanvas.cursorX = this.viewport.startRes;
+this.alignPanel.seqPanel.seqCanvas.cursorY = this.viewport.startSeq;
+}break;
+case 70:
+if (evt.isControlDown ()) {
+this.findMenuItem_actionPerformed ();
+}break;
+case 72:
+{
+var toggleSeqs = !evt.isControlDown ();
+var toggleCols = !evt.isShiftDown ();
+this.toggleHiddenRegions (toggleSeqs, toggleCols);
+break;
+}case 33:
+if (this.viewport.getWrapAlignment ()) {
+this.alignPanel.scrollUp (true);
+} else {
+this.alignPanel.setScrollValues (this.viewport.startRes, this.viewport.startSeq - this.viewport.endSeq + this.viewport.startSeq);
+}break;
+case 34:
+if (this.viewport.getWrapAlignment ()) {
+this.alignPanel.scrollUp (false);
+} else {
+this.alignPanel.setScrollValues (this.viewport.startRes, this.viewport.startSeq + this.viewport.endSeq - this.viewport.startSeq);
+}break;
+case 90:
+if (evt.isControlDown ()) {
+this.undoMenuItem_actionPerformed ();
+}break;
+case 89:
+if (evt.isControlDown ()) {
+this.redoMenuItem_actionPerformed ();
+}break;
+case 76:
+if (evt.isControlDown ()) {
+this.trimAlignment (true);
+}break;
+case 82:
+if (evt.isControlDown ()) {
+this.trimAlignment (false);
+}break;
+case 69:
+if (evt.isControlDown ()) {
+if (evt.isShiftDown ()) {
+this.removeAllGapsMenuItem_actionPerformed ();
+} else {
+this.removeGappedColumnMenuItem_actionPerformed ();
+}}break;
+case 73:
+if (evt.isControlDown ()) {
+if (evt.isAltDown ()) {
+this.invertColSel_actionPerformed ();
+} else {
+this.invertSequenceMenuItem_actionPerformed ();
+}}break;
+case 71:
+if (evt.isControlDown ()) {
+if (evt.isShiftDown ()) {
+this.unGroup_actionPerformed ();
+} else {
+this.createGroup_actionPerformed ();
+}}break;
+case 85:
+if (evt.isControlDown ()) {
+this.deleteGroups_actionPerformed ();
+}break;
+case 84:
+if (evt.isControlDown ()) {
+this.newView (null);
+}break;
+}
+this.alignPanel.paintAlignment (true);
+}, "java.awt.event.KeyEvent");
+Clazz_defineMethod (c$, "toggleHiddenRegions", 
+ function (toggleSeqs, toggleCols) {
+var hide = false;
+var sg = this.viewport.getSelectionGroup ();
+if (!toggleSeqs && !toggleCols) {
+if ((this.viewport.getColumnSelection () != null && this.viewport.getColumnSelection ().getSelected () != null && this.viewport.getColumnSelection ().getSelected ().size () > 0) || (sg != null && sg.getSize () > 0 && sg.getStartRes () <= sg.getEndRes ())) {
+if (sg != null) {
+this.invertSequenceMenuItem_actionPerformed ();
+sg = this.viewport.getSelectionGroup ();
+toggleSeqs = true;
+}this.viewport.expandColSelection (sg, true);
+this.invertColSel_actionPerformed ();
+toggleCols = true;
+}}if (toggleSeqs) {
+if (sg != null && sg.getSize () != this.viewport.getAlignment ().getHeight ()) {
+hide = true;
+this.viewport.hideAllSelectedSeqs ();
+} else if (!(toggleCols && this.viewport.getColumnSelection ().getSelected ().size () > 0)) {
+this.viewport.showAllHiddenSeqs ();
+}}if (toggleCols) {
+if (this.viewport.getColumnSelection ().getSelected ().size () > 0) {
+this.viewport.hideSelectedColumns ();
+if (!toggleSeqs) {
+this.viewport.setSelectionGroup (sg);
+}} else if (!hide) {
+this.viewport.showAllHiddenColumns ();
+}}}, "~B,~B");
+Clazz_overrideMethod (c$, "keyReleased", 
+function (evt) {
+}, "java.awt.event.KeyEvent");
+Clazz_overrideMethod (c$, "keyTyped", 
+function (evt) {
+}, "java.awt.event.KeyEvent");
+Clazz_overrideMethod (c$, "itemStateChanged", 
+function (evt) {
+var source = evt.getSource ();
+if (source === this.displayNonconservedMenuItem) {
+this.displayNonconservedMenuItem_actionPerformed ();
+} else if (source === this.colourTextMenuItem) {
+this.colourTextMenuItem_actionPerformed ();
+} else if (source === this.wrapMenuItem) {
+this.wrapMenuItem_actionPerformed ();
+} else if (source === this.scaleAbove) {
+this.viewport.setScaleAboveWrapped (this.scaleAbove.getState ());
+} else if (source === this.scaleLeft) {
+this.viewport.setScaleLeftWrapped (this.scaleLeft.getState ());
+} else if (source === this.scaleRight) {
+this.viewport.setScaleRightWrapped (this.scaleRight.getState ());
+} else if (source === this.seqLimits) {
+this.seqLimits_itemStateChanged ();
+} else if (source === this.viewBoxesMenuItem) {
+this.viewport.setShowBoxes (this.viewBoxesMenuItem.getState ());
+} else if (source === this.viewTextMenuItem) {
+this.viewport.setShowText (this.viewTextMenuItem.getState ());
+} else if (source === this.renderGapsMenuItem) {
+this.viewport.setRenderGaps (this.renderGapsMenuItem.getState ());
+} else if (source === this.annotationPanelMenuItem) {
+this.viewport.setShowAnnotation (this.annotationPanelMenuItem.getState ());
+this.alignPanel.setAnnotationVisible (this.annotationPanelMenuItem.getState ());
+} else if (source === this.sequenceFeatures) {
+this.viewport.setShowSequenceFeatures (this.sequenceFeatures.getState ());
+this.alignPanel.seqPanel.seqCanvas.repaint ();
+} else if (source === this.showAlignmentAnnotations) {
+this.setAnnotationsVisibility ();
+} else if (source === this.showSequenceAnnotations) {
+this.setAnnotationsVisibility ();
+} else if (source === this.sortAnnBySequence) {
+var newState = this.sortAnnBySequence.getState ();
+this.sortAnnByLabel.setState (false);
+this.setAnnotationSortOrder (newState ? jalview.analysis.AnnotationSorter.SequenceAnnotationOrder.SEQUENCE_AND_LABEL : jalview.analysis.AnnotationSorter.SequenceAnnotationOrder.NONE);
+this.setViewportAnnotationOrder ();
+} else if (source === this.sortAnnByLabel) {
+var newState = this.sortAnnByLabel.getState ();
+this.sortAnnBySequence.setState (false);
+this.setAnnotationSortOrder (newState ? jalview.analysis.AnnotationSorter.SequenceAnnotationOrder.LABEL_AND_SEQUENCE : jalview.analysis.AnnotationSorter.SequenceAnnotationOrder.NONE);
+this.setViewportAnnotationOrder ();
+} else if (source === this.showAutoFirst) {
+this.showAutoLast.setState (!this.showAutoFirst.getState ());
+this.setShowAutoCalculatedAbove (this.showAutoFirst.getState ());
+this.setViewportAnnotationOrder ();
+} else if (source === this.showAutoLast) {
+this.showAutoFirst.setState (!this.showAutoLast.getState ());
+this.setShowAutoCalculatedAbove (this.showAutoFirst.getState ());
+this.setViewportAnnotationOrder ();
+} else if (source === this.conservationMenuItem) {
+this.conservationMenuItem_actionPerformed ();
+} else if (source === this.abovePIDThreshold) {
+this.abovePIDThreshold_actionPerformed ();
+} else if (source === this.applyToAllGroups) {
+this.viewport.setColourAppliesToAllGroups (this.applyToAllGroups.getState ());
+} else if (source === this.autoCalculate) {
+this.viewport.autoCalculateConsensus = this.autoCalculate.getState ();
+} else if (source === this.$sortByTree) {
+this.viewport.sortByTree = this.$sortByTree.getState ();
+} else if (source === this.centreColumnLabelFlag) {
+this.centreColumnLabelFlag_stateChanged ();
+} else if (source === this.followMouseOverFlag) {
+this.mouseOverFlag_stateChanged ();
+} else if (source === this.showGroupConsensus) {
+this.showGroupConsensus_actionPerformed ();
+} else if (source === this.showGroupConservation) {
+this.showGroupConservation_actionPerformed ();
+} else if (source === this.showSequenceLogo) {
+this.showSequenceLogo_actionPerformed ();
+} else if (source === this.normSequenceLogo) {
+this.normSequenceLogo_actionPerformed ();
+} else if (source === this.showConsensusHistogram) {
+this.showConsensusHistogram_actionPerformed ();
+} else if (source === this.applyAutoAnnotationSettings) {
+this.applyAutoAnnotationSettings_actionPerformed ();
+}this.alignPanel.paintAlignment (true);
+}, "java.awt.event.ItemEvent");
+Clazz_defineMethod (c$, "setAnnotationsVisibility", 
+ function () {
+var showForAlignment = this.showAlignmentAnnotations.getState ();
+var showForSequences = this.showSequenceAnnotations.getState ();
+for (var aa, $aa = 0, $$aa = this.alignPanel.getAlignment ().getAlignmentAnnotation (); $aa < $$aa.length && ((aa = $$aa[$aa]) || true); $aa++) {
+var visible = (aa.sequenceRef == null ? showForAlignment : showForSequences);
+aa.visible = visible;
+}
+this.alignPanel.validateAnnotationDimensions (true);
+this.validate ();
+this.repaint ();
+});
+Clazz_defineMethod (c$, "setAnnotationSortOrder", 
+ function (order) {
+this.annotationSortOrder = order;
+}, "jalview.analysis.AnnotationSorter.SequenceAnnotationOrder");
+Clazz_defineMethod (c$, "setViewportAnnotationOrder", 
+ function () {
+this.alignPanel.av.setSortAnnotationsBy (this.annotationSortOrder);
+this.alignPanel.av.setShowAutocalculatedAbove (this.showAutoCalculatedAbove);
+});
+Clazz_defineMethod (c$, "setShowAutoCalculatedAbove", 
+ function (showAbove) {
+this.showAutoCalculatedAbove = showAbove;
+}, "~B");
+Clazz_defineMethod (c$, "mouseOverFlag_stateChanged", 
+ function () {
+this.viewport.setFollowHighlight (this.followMouseOverFlag.getState ());
+});
+Clazz_defineMethod (c$, "centreColumnLabelFlag_stateChanged", 
+ function () {
+this.viewport.centreColumnLabels = this.centreColumnLabelFlag.getState ();
+this.alignPanel.annotationPanel.repaint ();
+});
+Clazz_overrideMethod (c$, "actionPerformed", 
+function (evt) {
+var source = evt.getSource ();
+if (source === this.inputText) {
+this.inputText_actionPerformed ();
+} else if (source === this.$loadTree) {
+this.loadTree_actionPerformed ();
+} else if (source === this.loadApplication) {
+this.launchFullApplication ();
+} else if (source === this.$loadAnnotations) {
+this.loadAnnotations ();
+} else if (source === this.$outputAnnotations) {
+this.outputAnnotations (true);
+} else if (source === this.$outputFeatures) {
+this.outputFeatures (true, "Jalview");
+} else if (source === this.closeMenuItem) {
+this.closeMenuItem_actionPerformed ();
+} else if (source === this.copy) {
+this.copy_actionPerformed ();
+} else if (source === this.undoMenuItem) {
+this.undoMenuItem_actionPerformed ();
+} else if (source === this.redoMenuItem) {
+this.redoMenuItem_actionPerformed ();
+} else if (source === this.inputText) {
+this.inputText_actionPerformed ();
+} else if (source === this.closeMenuItem) {
+this.closeMenuItem_actionPerformed ();
+} else if (source === this.undoMenuItem) {
+this.undoMenuItem_actionPerformed ();
+} else if (source === this.redoMenuItem) {
+this.redoMenuItem_actionPerformed ();
+} else if (source === this.copy) {
+this.copy_actionPerformed ();
+} else if (source === this.pasteNew) {
+this.pasteNew_actionPerformed ();
+} else if (source === this.pasteThis) {
+this.pasteThis_actionPerformed ();
+} else if (source === this.cut) {
+this.cut_actionPerformed ();
+} else if (source === this.$delete) {
+this.delete_actionPerformed ();
+} else if (source === this.grpsFromSelection) {
+this.makeGrpsFromSelection_actionPerformed ();
+} else if (source === this.deleteGroups) {
+this.deleteGroups_actionPerformed ();
+} else if (source === this.selectAllSequenceMenuItem) {
+this.selectAllSequenceMenuItem_actionPerformed ();
+} else if (source === this.deselectAllSequenceMenuItem) {
+this.deselectAllSequenceMenuItem_actionPerformed ();
+} else if (source === this.invertSequenceMenuItem) {
+this.invertSequenceMenuItem_actionPerformed ();
+} else if (source === this.invertColSel) {
+this.viewport.invertColumnSelection ();
+this.alignPanel.paintAlignment (true);
+} else if (source === this.remove2LeftMenuItem) {
+this.trimAlignment (true);
+} else if (source === this.remove2RightMenuItem) {
+this.trimAlignment (false);
+} else if (source === this.removeGappedColumnMenuItem) {
+this.removeGappedColumnMenuItem_actionPerformed ();
+} else if (source === this.removeAllGapsMenuItem) {
+this.removeAllGapsMenuItem_actionPerformed ();
+} else if (source === this.findMenuItem) {
+this.findMenuItem_actionPerformed ();
+} else if (source === this.$font) {
+ new jalview.appletgui.FontChooser (this.alignPanel);
+} else if (source === this.$newView) {
+this.newView (null);
+} else if (source === this.showColumns) {
+this.viewport.showAllHiddenColumns ();
+this.alignPanel.paintAlignment (true);
+} else if (source === this.showSeqs) {
+this.viewport.showAllHiddenSeqs ();
+this.alignPanel.paintAlignment (true);
+} else if (source === this.hideColumns) {
+this.viewport.hideSelectedColumns ();
+this.alignPanel.paintAlignment (true);
+} else if (source === this.hideSequences && this.viewport.getSelectionGroup () != null) {
+this.viewport.hideAllSelectedSeqs ();
+this.alignPanel.paintAlignment (true);
+} else if (source === this.hideAllButSelection) {
+this.toggleHiddenRegions (false, false);
+this.alignPanel.paintAlignment (true);
+} else if (source === this.hideAllSelection) {
+var sg = this.viewport.getSelectionGroup ();
+this.viewport.expandColSelection (sg, false);
+this.viewport.hideAllSelectedSeqs ();
+this.viewport.hideSelectedColumns ();
+this.alignPanel.paintAlignment (true);
+} else if (source === this.showAllHidden) {
+this.viewport.showAllHiddenColumns ();
+this.viewport.showAllHiddenSeqs ();
+this.alignPanel.paintAlignment (true);
+} else if (source === this.showGroupConsensus) {
+this.showGroupConsensus_actionPerformed ();
+} else if (source === this.showGroupConservation) {
+this.showGroupConservation_actionPerformed ();
+} else if (source === this.showSequenceLogo) {
+this.showSequenceLogo_actionPerformed ();
+} else if (source === this.normSequenceLogo) {
+this.normSequenceLogo_actionPerformed ();
+} else if (source === this.showConsensusHistogram) {
+this.showConsensusHistogram_actionPerformed ();
+} else if (source === this.applyAutoAnnotationSettings) {
+this.applyAutoAnnotationSettings_actionPerformed ();
+} else if (source === this.featureSettings) {
+ new jalview.appletgui.FeatureSettings (this.alignPanel);
+} else if (source === this.alProperties) {
+var contents =  new jalview.io.AlignmentProperties (this.viewport.getAlignment ()).formatAsString ();
+var cap =  new jalview.appletgui.CutAndPasteTransfer (false, this);
+cap.setText (contents.toString ());
+var frame =  new awt2swing.Frame ();
+frame.add (cap);
+jalview.bin.JalviewLite.addFrame (frame, jalview.util.MessageManager.formatMessage ("label.alignment_properties",  Clazz_newArray (-1, [this.getTitle ()])), 400, 250);
+} else if (source === this.overviewMenuItem) {
+this.overviewMenuItem_actionPerformed ();
+} else if (source === this.noColourmenuItem) {
+this.changeColour (null);
+} else if (source === this.clustalColour) {
+this.abovePIDThreshold.setState (false);
+this.changeColour ( new jalview.schemes.ClustalxColourScheme (this.viewport.getAlignment (), null));
+} else if (source === this.zappoColour) {
+this.changeColour ( new jalview.schemes.ZappoColourScheme ());
+} else if (source === this.taylorColour) {
+this.changeColour ( new jalview.schemes.TaylorColourScheme ());
+} else if (source === this.hydrophobicityColour) {
+this.changeColour ( new jalview.schemes.HydrophobicColourScheme ());
+} else if (source === this.helixColour) {
+this.changeColour ( new jalview.schemes.HelixColourScheme ());
+} else if (source === this.strandColour) {
+this.changeColour ( new jalview.schemes.StrandColourScheme ());
+} else if (source === this.turnColour) {
+this.changeColour ( new jalview.schemes.TurnColourScheme ());
+} else if (source === this.buriedColour) {
+this.changeColour ( new jalview.schemes.BuriedColourScheme ());
+} else if (source === this.nucleotideColour) {
+this.changeColour ( new jalview.schemes.NucleotideColourScheme ());
+} else if (source === this.purinePyrimidineColour) {
+this.changeColour ( new jalview.schemes.PurinePyrimidineColourScheme ());
+} else if (source === this.RNAInteractionColour) {
+this.changeColour ( new jalview.schemes.RNAInteractionColourScheme ());
+} else if (source === this.RNAHelixColour) {
+ new jalview.schemes.RNAHelicesColourChooser (this.viewport, this.alignPanel);
+} else if (source === this.modifyPID) {
+this.modifyPID_actionPerformed ();
+} else if (source === this.modifyConservation) {
+this.modifyConservation_actionPerformed ();
+} else if (source === this.userDefinedColour) {
+ new jalview.appletgui.UserDefinedColours (this.alignPanel, null);
+} else if (source === this.PIDColour) {
+this.changeColour ( new jalview.schemes.PIDColourScheme ());
+} else if (source === this.BLOSUM62Colour) {
+this.changeColour ( new jalview.schemes.Blosum62ColourScheme ());
+} else if (source === this.tcoffeeColour) {
+this.changeColour ( new jalview.schemes.TCoffeeColourScheme (this.alignPanel.getAlignment ()));
+} else if (source === this.annotationColour) {
+ new jalview.appletgui.AnnotationColourChooser (this.viewport, this.alignPanel);
+} else if (source === this.annotationColumnSelection) {
+ new jalview.appletgui.AnnotationColumnChooser (this.viewport, this.alignPanel);
+} else if (source === this.sortPairwiseMenuItem) {
+this.sortPairwiseMenuItem_actionPerformed ();
+} else if (source === this.sortIDMenuItem) {
+this.sortIDMenuItem_actionPerformed ();
+} else if (source === this.sortLengthMenuItem) {
+this.sortLengthMenuItem_actionPerformed ();
+} else if (source === this.sortGroupMenuItem) {
+this.sortGroupMenuItem_actionPerformed ();
+} else if (source === this.removeRedundancyMenuItem) {
+this.removeRedundancyMenuItem_actionPerformed ();
+} else if (source === this.pairwiseAlignmentMenuItem) {
+this.pairwiseAlignmentMenuItem_actionPerformed ();
+} else if (source === this.PCAMenuItem) {
+this.PCAMenuItem_actionPerformed ();
+} else if (source === this.averageDistanceTreeMenuItem) {
+this.averageDistanceTreeMenuItem_actionPerformed ();
+} else if (source === this.neighbourTreeMenuItem) {
+this.neighbourTreeMenuItem_actionPerformed ();
+} else if (source === this.njTreeBlosumMenuItem) {
+this.njTreeBlosumMenuItem_actionPerformed ();
+} else if (source === this.avDistanceTreeBlosumMenuItem) {
+this.avTreeBlosumMenuItem_actionPerformed ();
+} else if (source === this.documentation) {
+this.documentation_actionPerformed ();
+} else if (source === this.about) {
+this.about_actionPerformed ();
+}}, "java.awt.event.ActionEvent");
+Clazz_defineMethod (c$, "inputText_actionPerformed", 
+function () {
+var cap =  new jalview.appletgui.CutAndPasteTransfer (true, this);
+var frame =  new awt2swing.Frame ();
+frame.add (cap);
+jalview.bin.JalviewLite.addFrame (frame, jalview.util.MessageManager.getString ("label.input_cut_paste"), 500, 500);
+});
+Clazz_defineMethod (c$, "outputText_actionPerformed", 
+function (e) {
+var cap =  new jalview.appletgui.CutAndPasteTransfer (true, this);
+var frame =  new awt2swing.Frame ();
+frame.add (cap);
+jalview.bin.JalviewLite.addFrame (frame, jalview.util.MessageManager.formatMessage ("label.alignment_output_command",  Clazz_newArray (-1, [e.getActionCommand ()])), 600, 500);
+var fr = this.alignPanel.cloneFeatureRenderer ();
+cap.setText ( new jalview.io.AppletFormatAdapter (this.alignPanel).formatSequences (e.getActionCommand (), this.viewport.getAlignment (), this.viewport.getShowJVSuffix ()));
+}, "java.awt.event.ActionEvent");
+Clazz_defineMethod (c$, "loadAnnotations", 
+function () {
+var cap =  new jalview.appletgui.CutAndPasteTransfer (true, this);
+cap.setText (jalview.util.MessageManager.getString ("label.paste_features_annotations_Tcoffee_here"));
+cap.setAnnotationImport ();
+var frame =  new awt2swing.Frame ();
+frame.add (cap);
+jalview.bin.JalviewLite.addFrame (frame, jalview.util.MessageManager.getString ("action.paste_annotations"), 400, 300);
+});
+Clazz_defineMethod (c$, "outputAnnotations", 
+function (displayTextbox) {
+var annotation =  new jalview.io.AnnotationFile ().printAnnotationsForView (this.viewport);
+if (displayTextbox) {
+var cap =  new jalview.appletgui.CutAndPasteTransfer (false, this);
+var frame =  new awt2swing.Frame ();
+frame.add (cap);
+jalview.bin.JalviewLite.addFrame (frame, jalview.util.MessageManager.getString ("label.annotations"), 600, 500);
+cap.setText (annotation);
+}return annotation;
+}, "~B");
+Clazz_defineMethod (c$, "getDisplayedFeatureCols", 
+ function () {
+if (this.alignPanel.getFeatureRenderer () != null && this.viewport.getFeaturesDisplayed () != null) {
+return this.alignPanel.getFeatureRenderer ().getDisplayedFeatureCols ();
+}return null;
+});
+Clazz_defineMethod (c$, "outputFeatures", 
+function (displayTextbox, format) {
+var features;
+if (format.equalsIgnoreCase ("Jalview")) {
+features =  new jalview.io.FeaturesFile ().printJalviewFormat (this.viewport.getAlignment ().getSequencesArray (), this.getDisplayedFeatureCols ());
+} else {
+features =  new jalview.io.FeaturesFile ().printGFFFormat (this.viewport.getAlignment ().getSequencesArray (), this.getDisplayedFeatureCols ());
+}if (displayTextbox) {
+var frimport = false;
+if (features == null || features.equals ("No Features Visible")) {
+features = "# No features visible - paste some and import them here.";
+frimport = true;
+}var cap =  new jalview.appletgui.CutAndPasteTransfer (frimport, this);
+if (frimport) {
+cap.setAnnotationImport ();
+}var frame =  new awt2swing.Frame ();
+frame.add (cap);
+jalview.bin.JalviewLite.addFrame (frame, jalview.util.MessageManager.getString ("label.features"), 600, 500);
+cap.setText (features);
+} else {
+if (features == null) {
+features = "";
+}}return features;
+}, "~B,~S");
+Clazz_defineMethod (c$, "launchFullApplication", 
+function () {
+var url =  new StringBuffer (this.jalviewServletURL);
+var firstSep = url.lastIndexOf ("?") > url.lastIndexOf ("/") ? "&" : "?";
+url.append (firstSep);
+var applet = this.viewport.applet;
+var s = applet.startupFile;
+url.append ("open=" + this.appendProtocol (s));
+if (this.viewport.applet.features != null) {
+url.append ("&features=");
+url.append (this.appendProtocol (applet.features));
+}if (applet.annotations != null) {
+url.append ("&annotations=");
+url.append (this.appendProtocol (applet.annotations));
+}if (applet.jnetFile != null) {
+url.append ("&annotations=");
+url.append (this.appendProtocol (applet.jnetFile));
+}if (applet.defaultColour != null) {
+url.append ("&colour=" + this.removeWhiteSpace (applet.defaultColour));
+}if (applet.userDefinedColour != null) {
+url.append ("&colour=" + this.removeWhiteSpace (applet.userDefinedColour));
+}if (applet.treeFile != null) {
+url.append ("&tree=" + this.appendProtocol (applet.treeFile));
+}this.showURL (url.toString (), "FULL_APP");
+});
+Clazz_defineMethod (c$, "removeWhiteSpace", 
+function (colour) {
+var sb =  new StringBuffer ();
+for (var i = 0; i < colour.length; i++) {
+if (Character.isWhitespace (colour.charAt (i))) {
+sb.append ("%20");
+} else {
+sb.append (colour.charAt (i));
+}}
+return sb.toString ();
+}, "~S");
+Clazz_defineMethod (c$, "appendProtocol", 
+function (url) {
+try {
+ new java.net.URL (url);
+url = java.net.URLEncoder.encode (url);
+} catch (ex) {
+if (Clazz_exceptionOf (ex, java.net.MalformedURLException)) {
+url = this.viewport.applet.getCodeBase () + url;
+} else {
+throw ex;
+}
+}
+return url;
+}, "~S");
+Clazz_defineMethod (c$, "closeMenuItem_actionPerformed", 
+function () {
+jalview.appletgui.PaintRefresher.RemoveComponent (this.alignPanel);
+if (this.alignPanel.seqPanel != null && this.alignPanel.seqPanel.seqCanvas != null) {
+jalview.appletgui.PaintRefresher.RemoveComponent (this.alignPanel.seqPanel.seqCanvas);
+}if (this.alignPanel.idPanel != null && this.alignPanel.idPanel.idCanvas != null) {
+jalview.appletgui.PaintRefresher.RemoveComponent (this.alignPanel.idPanel.idCanvas);
+}if (jalview.appletgui.PaintRefresher.components.size () == 0 && this.viewport.applet == null) {
+System.exit (0);
+} else {
+}this.viewport = null;
+this.alignPanel = null;
+this.dispose ();
+});
+Clazz_defineMethod (c$, "updateEditMenuBar", 
+function () {
+if (this.viewport.getHistoryList ().size () > 0) {
+this.undoMenuItem.setEnabled (true);
+var command = this.viewport.getHistoryList ().peek ();
+this.undoMenuItem.setLabel (jalview.util.MessageManager.formatMessage ("label.undo_command",  Clazz_newArray (-1, [command.getDescription ()])));
+} else {
+this.undoMenuItem.setEnabled (false);
+this.undoMenuItem.setLabel (jalview.util.MessageManager.getString ("action.undo"));
+}if (this.viewport.getRedoList ().size () > 0) {
+this.redoMenuItem.setEnabled (true);
+var command = this.viewport.getRedoList ().peek ();
+this.redoMenuItem.setLabel (jalview.util.MessageManager.formatMessage ("label.redo_command",  Clazz_newArray (-1, [command.getDescription ()])));
+} else {
+this.redoMenuItem.setEnabled (false);
+this.redoMenuItem.setLabel (jalview.util.MessageManager.getString ("action.redo"));
+}});
+Clazz_overrideMethod (c$, "addHistoryItem", 
+function (command) {
+if (command.getSize () > 0) {
+this.viewport.addToHistoryList (command);
+this.viewport.clearRedoList ();
+this.updateEditMenuBar ();
+this.viewport.updateHiddenColumns ();
+}}, "jalview.commands.CommandI");
+Clazz_defineMethod (c$, "undoMenuItem_actionPerformed", 
+function () {
+if (this.viewport.getHistoryList ().isEmpty ()) {
+return;
+}var command = this.viewport.getHistoryList ().pop ();
+this.viewport.addToRedoList (command);
+command.undoCommand (null);
+var originalSource = this.getOriginatingSource (command);
+if (originalSource !== this.viewport) {
+System.err.println ("Warning: Viewport object mismatch whilst undoing");
+}originalSource.updateHiddenColumns ();
+this.updateEditMenuBar ();
+originalSource.firePropertyChange ("alignment", null, originalSource.getAlignment ().getSequences ());
+});
+Clazz_defineMethod (c$, "redoMenuItem_actionPerformed", 
+function () {
+if (this.viewport.getRedoList ().isEmpty ()) {
+return;
+}var command = this.viewport.getRedoList ().pop ();
+this.viewport.addToHistoryList (command);
+command.doCommand (null);
+var originalSource = this.getOriginatingSource (command);
+if (originalSource !== this.viewport) {
+System.err.println ("Warning: Viewport object mismatch whilst re-doing");
+}originalSource.updateHiddenColumns ();
+this.updateEditMenuBar ();
+originalSource.firePropertyChange ("alignment", null, originalSource.getAlignment ().getSequences ());
+});
+Clazz_defineMethod (c$, "getOriginatingSource", 
+function (command) {
+var originalSource = null;
+var al = null;
+if (Clazz_instanceOf (command, jalview.commands.EditCommand)) {
+var editCommand = command;
+al = editCommand.getAlignment ();
+var comps = jalview.appletgui.PaintRefresher.components.get (this.viewport.getSequenceSetId ());
+for (var i = 0; i < comps.size (); i++) {
+if (Clazz_instanceOf (comps.elementAt (i), jalview.appletgui.AlignmentPanel)) {
+if (al === (comps.elementAt (i)).av.getAlignment ()) {
+originalSource = (comps.elementAt (i)).av;
+break;
+}}}
+}if (originalSource == null) {
+if (al != null) {
+jalview.appletgui.PaintRefresher.validateSequences (al, this.viewport.getAlignment ());
+}originalSource = this.viewport;
+}return originalSource;
+}, "jalview.commands.CommandI");
+Clazz_defineMethod (c$, "moveSelectedSequences", 
+function (up) {
+var sg = this.viewport.getSelectionGroup ();
+if (sg == null) {
+return;
+}this.viewport.getAlignment ().moveSelectedSequencesByOne (sg, up ? null : this.viewport.getHiddenRepSequences (), up);
+this.alignPanel.paintAlignment (true);
+var complement = this.viewport.getCodingComplement ();
+if (complement != null) {
+var mappedSelection = jalview.util.MappingUtils.mapSequenceGroup (sg, this.viewport, complement);
+complement.getAlignment ().moveSelectedSequencesByOne (mappedSelection, up ? null : complement.getHiddenRepSequences (), up);
+}}, "~B");
+Clazz_defineMethod (c$, "slideSequences", 
+function (right, size) {
+var sg =  new java.util.Vector ();
+if (this.viewport.cursorMode) {
+sg.add (this.viewport.getAlignment ().getSequenceAt (this.alignPanel.seqPanel.seqCanvas.cursorY));
+} else if (this.viewport.getSelectionGroup () != null && this.viewport.getSelectionGroup ().getSize () != this.viewport.getAlignment ().getHeight ()) {
+sg = this.viewport.getSelectionGroup ().getSequences (this.viewport.getHiddenRepSequences ());
+}if (sg.size () < 1) {
+return;
+}var invertGroup =  new java.util.Vector ();
+for (var i = 0; i < this.viewport.getAlignment ().getHeight (); i++) {
+if (!sg.contains (this.viewport.getAlignment ().getSequenceAt (i))) {
+invertGroup.addElement (this.viewport.getAlignment ().getSequenceAt (i));
+}}
+var seqs1 = sg.toArray ( new Array (sg.size ()));
+var seqs2 = invertGroup.toArray ( new Array (invertGroup.size ()));
+for (var i = 0; i < invertGroup.size (); i++) {
+seqs2[i] = invertGroup.elementAt (i);
+}
+var ssc;
+if (right) {
+ssc =  new jalview.commands.SlideSequencesCommand ("Slide Sequences", seqs2, seqs1, size, this.viewport.getGapCharacter ());
+} else {
+ssc =  new jalview.commands.SlideSequencesCommand ("Slide Sequences", seqs1, seqs2, size, this.viewport.getGapCharacter ());
+}var groupAdjustment = 0;
+if (ssc.getGapsInsertedBegin () && right) {
+if (this.viewport.cursorMode) {
+this.alignPanel.seqPanel.moveCursor (size, 0);
+} else {
+groupAdjustment = size;
+}} else if (!ssc.getGapsInsertedBegin () && !right) {
+if (this.viewport.cursorMode) {
+this.alignPanel.seqPanel.moveCursor (-size, 0);
+} else {
+groupAdjustment = -size;
+}}if (groupAdjustment != 0) {
+this.viewport.getSelectionGroup ().setStartRes (this.viewport.getSelectionGroup ().getStartRes () + groupAdjustment);
+this.viewport.getSelectionGroup ().setEndRes (this.viewport.getSelectionGroup ().getEndRes () + groupAdjustment);
+}var appendHistoryItem = false;
+var historyList = this.viewport.getHistoryList ();
+if (historyList != null && historyList.size () > 0 && Clazz_instanceOf (historyList.peek (), jalview.commands.SlideSequencesCommand)) {
+appendHistoryItem = ssc.appendSlideCommand (historyList.peek ());
+}if (!appendHistoryItem) {
+this.addHistoryItem (ssc);
+}this.repaint ();
+}, "~B,~N");
+Clazz_defineMethod (c$, "copy_actionPerformed", 
+function () {
+if (this.viewport.getSelectionGroup () == null) {
+return;
+}var sg = this.viewport.getSelectionGroup ();
+jalview.appletgui.AlignFrame.copiedSequences =  new StringBuffer ();
+var orderedSeqs =  new java.util.HashMap ();
+for (var i = 0; i < sg.getSize (); i++) {
+var seq = sg.getSequenceAt (i);
+var index = this.viewport.getAlignment ().findIndex (seq);
+orderedSeqs.put (new Integer (index), seq);
+}
+var index = 0;
+var startRes;
+var endRes;
+var ch;
+if (this.viewport.hasHiddenColumns () && this.viewport.getSelectionGroup () != null) {
+jalview.appletgui.AlignFrame.copiedHiddenColumns =  new java.util.Vector ();
+var hiddenOffset = this.viewport.getSelectionGroup ().getStartRes ();
+for (var region, $region = this.viewport.getColumnSelection ().getHiddenColumns ().iterator (); $region.hasNext () && ((region = $region.next ()) || true);) {
+jalview.appletgui.AlignFrame.copiedHiddenColumns.addElement ( Clazz_newIntArray (-1, [region[0] - hiddenOffset, region[1] - hiddenOffset]));
+}
+} else {
+jalview.appletgui.AlignFrame.copiedHiddenColumns = null;
+}for (var i = 0; i < sg.getSize (); i++) {
+var seq = null;
+while (seq == null) {
+if (orderedSeqs.containsKey (new Integer (index))) {
+seq = orderedSeqs.get (new Integer (index));
+index++;
+break;
+} else {
+index++;
+}}
+startRes = seq.findPosition (sg.getStartRes ());
+endRes = 0;
+for (var j = 0; j < sg.getEndRes () + 1 && j < seq.getLength (); j++) {
+ch = seq.getCharAt (j);
+if (!jalview.util.Comparison.isGap ((ch))) {
+endRes++;
+}}
+if (endRes > 0) {
+endRes += seq.getStart () - 1;
+}jalview.appletgui.AlignFrame.copiedSequences.append (seq.getName () + "\t" + startRes + "\t" + endRes + "\t" + seq.getSequenceAsString (sg.getStartRes (), sg.getEndRes () + 1) + "\n");
+}
+});
+Clazz_defineMethod (c$, "pasteNew_actionPerformed", 
+function () {
+this.paste (true);
+});
+Clazz_defineMethod (c$, "pasteThis_actionPerformed", 
+function () {
+this.paste (false);
+});
+Clazz_defineMethod (c$, "paste", 
+function (newAlignment) {
+try {
+if (jalview.appletgui.AlignFrame.copiedSequences == null) {
+return;
+}var st =  new java.util.StringTokenizer (jalview.appletgui.AlignFrame.copiedSequences.toString ());
+var seqs =  new java.util.Vector ();
+while (st.hasMoreElements ()) {
+var name = st.nextToken ();
+var start = Integer.parseInt (st.nextToken ());
+var end = Integer.parseInt (st.nextToken ());
+seqs.addElement ( new jalview.datamodel.Sequence (name, st.nextToken (), start, end));
+}
+var newSeqs =  new Array (seqs.size ());
+for (var i = 0; i < seqs.size (); i++) {
+newSeqs[i] = seqs.elementAt (i);
+}
+if (newAlignment) {
+var newtitle = jalview.util.MessageManager.getString ("label.copied_sequences");
+if (this.getTitle ().startsWith (jalview.util.MessageManager.getString ("label.copied_sequences"))) {
+newtitle = this.getTitle ();
+} else {
+newtitle = newtitle.concat (jalview.util.MessageManager.formatMessage ("label.from_msname",  Clazz_newArray (-1, [this.getTitle ()])));
+}var af =  new jalview.appletgui.AlignFrame ( new jalview.datamodel.Alignment (newSeqs), this.viewport.applet, newtitle, false);
+if (jalview.appletgui.AlignFrame.copiedHiddenColumns != null) {
+for (var i = 0; i < jalview.appletgui.AlignFrame.copiedHiddenColumns.size (); i++) {
+var region = jalview.appletgui.AlignFrame.copiedHiddenColumns.elementAt (i);
+af.viewport.hideColumns (region[0], region[1]);
+}
+}jalview.bin.JalviewLite.addFrame (af, newtitle, this.frameWidth, this.frameHeight);
+} else {
+this.addSequences (newSeqs);
+}} catch (ex) {
+if (Clazz_exceptionOf (ex, Exception)) {
+} else {
+throw ex;
+}
+}
+}, "~B");
+Clazz_defineMethod (c$, "addSequences", 
+function (seqs) {
+for (var i = 0; i < seqs.length; i++) {
+this.viewport.getAlignment ().addSequence (seqs[i]);
+}
+this.addHistoryItem ( new jalview.commands.EditCommand (jalview.util.MessageManager.getString ("label.add_sequences"), jalview.commands.EditCommand.Action.PASTE, seqs, 0, this.viewport.getAlignment ().getWidth (), this.viewport.getAlignment ()));
+this.viewport.setEndSeq (this.viewport.getAlignment ().getHeight ());
+this.viewport.getAlignment ().getWidth ();
+this.viewport.firePropertyChange ("alignment", null, this.viewport.getAlignment ().getSequences ());
+}, "~A");
+Clazz_defineMethod (c$, "cut_actionPerformed", 
+function () {
+this.copy_actionPerformed ();
+this.delete_actionPerformed ();
+});
+Clazz_defineMethod (c$, "delete_actionPerformed", 
+function () {
+var sg = this.viewport.getSelectionGroup ();
+if (sg == null) {
+return;
+}var seqs =  new java.util.Vector ();
+var seq;
+for (var i = 0; i < sg.getSize (); i++) {
+seq = sg.getSequenceAt (i);
+seqs.addElement (seq);
+}
+if (sg.getSize () == this.viewport.getAlignment ().getHeight ()) {
+this.viewport.getColumnSelection ().removeElements (sg.getStartRes (), sg.getEndRes () + 1);
+}var cut =  new Array (seqs.size ());
+for (var i = 0; i < seqs.size (); i++) {
+cut[i] = seqs.elementAt (i);
+}
+this.addHistoryItem ( new jalview.commands.EditCommand (jalview.util.MessageManager.getString ("label.cut_sequences"), jalview.commands.EditCommand.Action.CUT, cut, sg.getStartRes (), sg.getEndRes () - sg.getStartRes () + 1, this.viewport.getAlignment ()));
+this.viewport.setSelectionGroup (null);
+this.viewport.getAlignment ().deleteGroup (sg);
+this.viewport.firePropertyChange ("alignment", null, this.viewport.getAlignment ().getSequences ());
+if (this.viewport.getAlignment ().getHeight () < 1) {
+this.setVisible (false);
+}this.viewport.sendSelection ();
+});
+Clazz_defineMethod (c$, "showGroupConsensus_actionPerformed", 
+function () {
+this.viewport.setShowGroupConsensus (this.showGroupConsensus.getState ());
+this.alignPanel.updateAnnotation (this.applyAutoAnnotationSettings.getState ());
+});
+Clazz_defineMethod (c$, "showGroupConservation_actionPerformed", 
+function () {
+this.viewport.setShowGroupConservation (this.showGroupConservation.getState ());
+this.alignPanel.updateAnnotation (this.applyAutoAnnotationSettings.getState ());
+});
+Clazz_defineMethod (c$, "showConsensusHistogram_actionPerformed", 
+function () {
+this.viewport.setShowConsensusHistogram (this.showConsensusHistogram.getState ());
+this.alignPanel.updateAnnotation (this.applyAutoAnnotationSettings.getState ());
+});
+Clazz_defineMethod (c$, "showSequenceLogo_actionPerformed", 
+function () {
+this.viewport.setShowSequenceLogo (this.showSequenceLogo.getState ());
+this.alignPanel.updateAnnotation (this.applyAutoAnnotationSettings.getState ());
+});
+Clazz_defineMethod (c$, "normSequenceLogo_actionPerformed", 
+function () {
+this.showSequenceLogo.setState (true);
+this.viewport.setShowSequenceLogo (true);
+this.viewport.setNormaliseSequenceLogo (this.normSequenceLogo.getState ());
+this.alignPanel.updateAnnotation (this.applyAutoAnnotationSettings.getState ());
+});
+Clazz_defineMethod (c$, "applyAutoAnnotationSettings_actionPerformed", 
+function () {
+this.alignPanel.updateAnnotation (this.applyAutoAnnotationSettings.getState ());
+});
+Clazz_defineMethod (c$, "makeGrpsFromSelection_actionPerformed", 
+function () {
+if (this.avc.makeGroupsFromSelection ()) {
+jalview.appletgui.PaintRefresher.Refresh (this, this.viewport.getSequenceSetId ());
+this.alignPanel.updateAnnotation ();
+this.alignPanel.paintAlignment (true);
+}});
+Clazz_defineMethod (c$, "createGroup_actionPerformed", 
+function () {
+this.avc.createGroup ();
+});
+Clazz_defineMethod (c$, "unGroup_actionPerformed", 
+function () {
+if (this.avc.unGroup ()) {
+this.alignPanel.alignmentChanged ();
+}});
+Clazz_defineMethod (c$, "deleteGroups_actionPerformed", 
+function () {
+if (this.avc.deleteGroups ()) {
+this.alignPanel.alignmentChanged ();
+}});
+Clazz_defineMethod (c$, "selectAllSequenceMenuItem_actionPerformed", 
+function () {
+var sg =  new jalview.datamodel.SequenceGroup ();
+for (var i = 0; i < this.viewport.getAlignment ().getSequences ().size (); i++) {
+sg.addSequence (this.viewport.getAlignment ().getSequenceAt (i), false);
+}
+sg.setEndRes (this.viewport.getAlignment ().getWidth () - 1);
+this.viewport.setSelectionGroup (sg);
+this.alignPanel.paintAlignment (true);
+jalview.appletgui.PaintRefresher.Refresh (this.alignPanel, this.viewport.getSequenceSetId ());
+this.viewport.sendSelection ();
+});
+Clazz_defineMethod (c$, "deselectAllSequenceMenuItem_actionPerformed", 
+function () {
+if (this.viewport.cursorMode) {
+this.alignPanel.seqPanel.keyboardNo1 = null;
+this.alignPanel.seqPanel.keyboardNo2 = null;
+}this.viewport.setSelectionGroup (null);
+this.viewport.getColumnSelection ().clear ();
+this.viewport.setSelectionGroup (null);
+this.alignPanel.idPanel.idCanvas.searchResults = null;
+this.alignPanel.seqPanel.seqCanvas.highlightSearchResults (null);
+this.alignPanel.paintAlignment (true);
+jalview.appletgui.PaintRefresher.Refresh (this.alignPanel, this.viewport.getSequenceSetId ());
+this.viewport.sendSelection ();
+});
+Clazz_defineMethod (c$, "invertSequenceMenuItem_actionPerformed", 
+function () {
+var sg = this.viewport.getSelectionGroup ();
+for (var i = 0; i < this.viewport.getAlignment ().getSequences ().size (); i++) {
+sg.addOrRemove (this.viewport.getAlignment ().getSequenceAt (i), false);
+}
+jalview.appletgui.PaintRefresher.Refresh (this.alignPanel, this.viewport.getSequenceSetId ());
+this.viewport.sendSelection ();
+});
+Clazz_defineMethod (c$, "invertColSel_actionPerformed", 
+function () {
+this.viewport.invertColumnSelection ();
+this.alignPanel.paintAlignment (true);
+jalview.appletgui.PaintRefresher.Refresh (this.alignPanel, this.viewport.getSequenceSetId ());
+this.viewport.sendSelection ();
+});
+Clazz_defineMethod (c$, "trimAlignment", 
+function (trimLeft) {
+var colSel = this.viewport.getColumnSelection ();
+var column;
+if (colSel.size () > 0) {
+if (trimLeft) {
+column = colSel.getMin ();
+} else {
+column = colSel.getMax ();
+}var seqs;
+if (this.viewport.getSelectionGroup () != null) {
+seqs = this.viewport.getSelectionGroup ().getSequencesAsArray (this.viewport.getHiddenRepSequences ());
+} else {
+seqs = this.viewport.getAlignment ().getSequencesArray ();
+}var trimRegion;
+if (trimLeft) {
+trimRegion =  new jalview.commands.TrimRegionCommand ("Remove Left", jalview.commands.TrimRegionCommand.TRIM_LEFT, seqs, column, this.viewport.getAlignment (), this.viewport.getColumnSelection (), this.viewport.getSelectionGroup ());
+this.viewport.setStartRes (0);
+} else {
+trimRegion =  new jalview.commands.TrimRegionCommand ("Remove Right", jalview.commands.TrimRegionCommand.TRIM_RIGHT, seqs, column, this.viewport.getAlignment (), this.viewport.getColumnSelection (), this.viewport.getSelectionGroup ());
+}this.setStatus (jalview.util.MessageManager.formatMessage ("label.removed_columns",  Clazz_newArray (-1, [Integer.$valueOf (trimRegion.getSize ()).toString ()])));
+this.addHistoryItem (trimRegion);
+for (var sg, $sg = this.viewport.getAlignment ().getGroups ().iterator (); $sg.hasNext () && ((sg = $sg.next ()) || true);) {
+if ((trimLeft && !sg.adjustForRemoveLeft (column)) || (!trimLeft && !sg.adjustForRemoveRight (column))) {
+this.viewport.getAlignment ().deleteGroup (sg);
+}}
+this.viewport.firePropertyChange ("alignment", null, this.viewport.getAlignment ().getSequences ());
+}}, "~B");
+Clazz_defineMethod (c$, "removeGappedColumnMenuItem_actionPerformed", 
+function () {
+var start = 0;
+var end = this.viewport.getAlignment ().getWidth () - 1;
+var seqs;
+if (this.viewport.getSelectionGroup () != null) {
+seqs = this.viewport.getSelectionGroup ().getSequencesAsArray (this.viewport.getHiddenRepSequences ());
+start = this.viewport.getSelectionGroup ().getStartRes ();
+end = this.viewport.getSelectionGroup ().getEndRes ();
+} else {
+seqs = this.viewport.getAlignment ().getSequencesArray ();
+}var removeGapCols =  new jalview.commands.RemoveGapColCommand ("Remove Gapped Columns", seqs, start, end, this.viewport.getAlignment ());
+this.addHistoryItem (removeGapCols);
+this.setStatus (jalview.util.MessageManager.formatMessage ("label.removed_empty_columns",  Clazz_newArray (-1, [Integer.$valueOf (removeGapCols.getSize ()).toString ()])));
+var seq = this.viewport.getAlignment ().getSequenceAt (0);
+var startRes = seq.findPosition (this.viewport.startRes);
+this.viewport.setStartRes (seq.findIndex (startRes) - 1);
+this.viewport.firePropertyChange ("alignment", null, this.viewport.getAlignment ().getSequences ());
+});
+Clazz_defineMethod (c$, "removeAllGapsMenuItem_actionPerformed", 
+function () {
+var start = 0;
+var end = this.viewport.getAlignment ().getWidth () - 1;
+var seqs;
+if (this.viewport.getSelectionGroup () != null) {
+seqs = this.viewport.getSelectionGroup ().getSequencesAsArray (this.viewport.getHiddenRepSequences ());
+start = this.viewport.getSelectionGroup ().getStartRes ();
+end = this.viewport.getSelectionGroup ().getEndRes ();
+} else {
+seqs = this.viewport.getAlignment ().getSequencesArray ();
+}var seq = this.viewport.getAlignment ().getSequenceAt (0);
+var startRes = seq.findPosition (this.viewport.startRes);
+this.addHistoryItem ( new jalview.commands.RemoveGapsCommand ("Remove Gaps", seqs, start, end, this.viewport.getAlignment ()));
+this.viewport.setStartRes (seq.findIndex (startRes) - 1);
+this.viewport.firePropertyChange ("alignment", null, this.viewport.getAlignment ().getSequences ());
+});
+Clazz_defineMethod (c$, "findMenuItem_actionPerformed", 
+function () {
+ new jalview.appletgui.Finder (this.alignPanel);
+});
+Clazz_defineMethod (c$, "newView", 
+function (viewtitle) {
+var newal;
+if (this.viewport.hasHiddenRows ()) {
+newal =  new jalview.datamodel.Alignment (this.viewport.getAlignment ().getHiddenSequences ().getFullAlignment ().getSequencesArray ());
+} else {
+newal =  new jalview.datamodel.Alignment (this.viewport.getAlignment ().getSequencesArray ());
+}if (this.viewport.getAlignment ().getAlignmentAnnotation () != null) {
+for (var i = 0; i < this.viewport.getAlignment ().getAlignmentAnnotation ().length; i++) {
+if (!this.viewport.getAlignment ().getAlignmentAnnotation ()[i].autoCalculated) {
+newal.addAnnotation (this.viewport.getAlignment ().getAlignmentAnnotation ()[i]);
+}}
+}var newaf =  new jalview.appletgui.AlignFrame (newal, this.viewport.applet, "", false);
+newaf.viewport.setSequenceSetId (this.alignPanel.av.getSequenceSetId ());
+jalview.appletgui.PaintRefresher.Register (this.alignPanel, this.alignPanel.av.getSequenceSetId ());
+jalview.appletgui.PaintRefresher.Register (newaf.alignPanel, newaf.alignPanel.av.getSequenceSetId ());
+jalview.appletgui.PaintRefresher.Register (newaf.alignPanel.idPanel.idCanvas, newaf.alignPanel.av.getSequenceSetId ());
+jalview.appletgui.PaintRefresher.Register (newaf.alignPanel.seqPanel.seqCanvas, newaf.alignPanel.av.getSequenceSetId ());
+var comps = jalview.appletgui.PaintRefresher.components.get (this.viewport.getSequenceSetId ());
+var viewSize = -1;
+for (var i = 0; i < comps.size (); i++) {
+if (Clazz_instanceOf (comps.elementAt (i), jalview.appletgui.AlignmentPanel)) {
+viewSize++;
+}}
+var title =  String.instantialize (this.getTitle ());
+if (viewtitle != null) {
+title = viewtitle + " ( " + title + ")";
+} else {
+if (title.indexOf ("(View") > -1) {
+title = title.substring (0, title.indexOf ("(View"));
+}title += "(View " + viewSize + ")";
+}newaf.setTitle (title.toString ());
+newaf.viewport.setHistoryList (this.viewport.getHistoryList ());
+newaf.viewport.setRedoList (this.viewport.getRedoList ());
+return newaf;
+}, "~S");
+Clazz_defineMethod (c$, "getFeatureGroups", 
+function () {
+var fr = null;
+if (this.alignPanel != null && (fr = this.alignPanel.getFeatureRenderer ()) != null) {
+var gps = fr.getFeatureGroups ();
+var _gps = gps.toArray ( new Array (gps.size ()));
+return _gps;
+}return null;
+});
+Clazz_defineMethod (c$, "getFeatureGroupsOfState", 
+function (visible) {
+var fr = null;
+if (this.alignPanel != null && (fr = this.alignPanel.getFeatureRenderer ()) != null) {
+var gps = fr.getGroups (visible);
+var _gps = gps.toArray ( new Array (gps.size ()));
+return _gps;
+}return null;
+}, "~B");
+Clazz_defineMethod (c$, "setFeatureGroupState", 
+function (groups, state) {
+var fr = null;
+this.sequenceFeatures.setState (true);
+this.viewport.setShowSequenceFeatures (true);
+if (this.alignPanel != null && (fr = this.alignPanel.getFeatureRenderer ()) != null) {
+fr.setGroupVisibility (java.util.Arrays.asList (groups), state);
+this.alignPanel.seqPanel.seqCanvas.repaint ();
+if (this.alignPanel.overviewPanel != null) {
+this.alignPanel.overviewPanel.updateOverviewImage ();
+}}}, "~A,~B");
+Clazz_defineMethod (c$, "seqLimits_itemStateChanged", 
+function () {
+this.viewport.setShowJVSuffix (this.seqLimits.getState ());
+this.alignPanel.fontChanged ();
+this.alignPanel.paintAlignment (true);
+});
+Clazz_defineMethod (c$, "colourTextMenuItem_actionPerformed", 
+function () {
+this.viewport.setColourText (this.colourTextMenuItem.getState ());
+this.alignPanel.paintAlignment (true);
+});
+Clazz_defineMethod (c$, "displayNonconservedMenuItem_actionPerformed", 
+function () {
+this.viewport.setShowUnconserved (this.displayNonconservedMenuItem.getState ());
+this.alignPanel.paintAlignment (true);
+});
+Clazz_defineMethod (c$, "wrapMenuItem_actionPerformed", 
+function () {
+this.viewport.setWrapAlignment (this.wrapMenuItem.getState ());
+this.alignPanel.setWrapAlignment (this.wrapMenuItem.getState ());
+this.scaleAbove.setEnabled (this.wrapMenuItem.getState ());
+this.scaleLeft.setEnabled (this.wrapMenuItem.getState ());
+this.scaleRight.setEnabled (this.wrapMenuItem.getState ());
+this.alignPanel.paintAlignment (true);
+});
+Clazz_defineMethod (c$, "overviewMenuItem_actionPerformed", 
+function () {
+if (this.alignPanel.overviewPanel != null) {
+return;
+}var frame =  new awt2swing.Frame ();
+var overview =  new jalview.appletgui.OverviewPanel (this.alignPanel);
+frame.add (overview);
+jalview.bin.JalviewLite.addFrame (frame, jalview.util.MessageManager.formatMessage ("label.overview_params",  Clazz_newArray (-1, [this.getTitle ()])), overview.getPreferredSize ().width, overview.getPreferredSize ().height + 50);
+frame.pack ();
+var ap = this.alignPanel;
+frame.addWindowListener (((Clazz_isClassDefined ("jalview.appletgui.AlignFrame$1") ? 0 : jalview.appletgui.AlignFrame.$AlignFrame$1$ ()), Clazz_innerTypeInstance (jalview.appletgui.AlignFrame$1, this, Clazz_cloneFinals ("ap", ap))));
+this.alignPanel.setOverviewPanel (overview);
+});
+Clazz_overrideMethod (c$, "changeColour", 
+function (cs) {
+var threshold = 0;
+if (cs != null) {
+if (this.viewport.getAbovePIDThreshold ()) {
+this.viewport.setThreshold (jalview.appletgui.SliderPanel.setPIDSliderSource (this.alignPanel, cs, "Background"));
+}if (this.viewport.getConservationSelected ()) {
+cs.setConservationApplied (true);
+this.viewport.setIncrement (jalview.appletgui.SliderPanel.setConservationSlider (this.alignPanel, cs, "Background"));
+} else {
+cs.setConservationApplied (false);
+}}this.viewport.setGlobalColourScheme (cs);
+if (this.alignPanel.getOverviewPanel () != null) {
+this.alignPanel.getOverviewPanel ().updateOverviewImage ();
+}jalview.structure.StructureSelectionManager.getStructureSelectionManager (this.viewport.applet).sequenceColoursChanged (this.alignPanel);
+this.alignPanel.paintAlignment (true);
+}, "jalview.schemes.ColourSchemeI");
+Clazz_defineMethod (c$, "modifyPID_actionPerformed", 
+function () {
+if (this.viewport.getAbovePIDThreshold () && this.viewport.getGlobalColourScheme () != null) {
+jalview.appletgui.SliderPanel.setPIDSliderSource (this.alignPanel, this.viewport.getGlobalColourScheme (), "Background");
+jalview.appletgui.SliderPanel.showPIDSlider ();
+}});
+Clazz_defineMethod (c$, "modifyConservation_actionPerformed", 
+function () {
+if (this.viewport.getConservationSelected () && this.viewport.getGlobalColourScheme () != null) {
+jalview.appletgui.SliderPanel.setConservationSlider (this.alignPanel, this.viewport.getGlobalColourScheme (), "Background");
+jalview.appletgui.SliderPanel.showConservationSlider ();
+}});
+Clazz_defineMethod (c$, "conservationMenuItem_actionPerformed", 
+function () {
+this.viewport.setConservationSelected (this.conservationMenuItem.getState ());
+this.viewport.setAbovePIDThreshold (false);
+this.abovePIDThreshold.setState (false);
+this.changeColour (this.viewport.getGlobalColourScheme ());
+this.modifyConservation_actionPerformed ();
+});
+Clazz_defineMethod (c$, "abovePIDThreshold_actionPerformed", 
+function () {
+this.viewport.setAbovePIDThreshold (this.abovePIDThreshold.getState ());
+this.conservationMenuItem.setState (false);
+this.viewport.setConservationSelected (false);
+this.changeColour (this.viewport.getGlobalColourScheme ());
+this.modifyPID_actionPerformed ();
+});
+Clazz_defineMethod (c$, "sortPairwiseMenuItem_actionPerformed", 
+function () {
+var oldOrder = this.viewport.getAlignment ().getSequencesArray ();
+jalview.analysis.AlignmentSorter.sortByPID (this.viewport.getAlignment (), this.viewport.getAlignment ().getSequenceAt (0), null);
+this.addHistoryItem ( new jalview.commands.OrderCommand ("Pairwise Sort", oldOrder, this.viewport.getAlignment ()));
+this.alignPanel.paintAlignment (true);
+});
+Clazz_defineMethod (c$, "sortIDMenuItem_actionPerformed", 
+function () {
+var oldOrder = this.viewport.getAlignment ().getSequencesArray ();
+jalview.analysis.AlignmentSorter.sortByID (this.viewport.getAlignment ());
+this.addHistoryItem ( new jalview.commands.OrderCommand ("ID Sort", oldOrder, this.viewport.getAlignment ()));
+this.alignPanel.paintAlignment (true);
+});
+Clazz_defineMethod (c$, "sortLengthMenuItem_actionPerformed", 
+function () {
+var oldOrder = this.viewport.getAlignment ().getSequencesArray ();
+jalview.analysis.AlignmentSorter.sortByLength (this.viewport.getAlignment ());
+this.addHistoryItem ( new jalview.commands.OrderCommand ("Length Sort", oldOrder, this.viewport.getAlignment ()));
+this.alignPanel.paintAlignment (true);
+});
+Clazz_defineMethod (c$, "sortGroupMenuItem_actionPerformed", 
+function () {
+var oldOrder = this.viewport.getAlignment ().getSequencesArray ();
+jalview.analysis.AlignmentSorter.sortByGroup (this.viewport.getAlignment ());
+this.addHistoryItem ( new jalview.commands.OrderCommand ("Group Sort", oldOrder, this.viewport.getAlignment ()));
+this.alignPanel.paintAlignment (true);
+});
+Clazz_defineMethod (c$, "removeRedundancyMenuItem_actionPerformed", 
+function () {
+ new jalview.appletgui.RedundancyPanel (this.alignPanel);
+});
+Clazz_defineMethod (c$, "pairwiseAlignmentMenuItem_actionPerformed", 
+function () {
+if (this.viewport.getSelectionGroup () != null && this.viewport.getSelectionGroup ().getSize () > 1) {
+var frame =  new awt2swing.Frame ();
+frame.add ( new jalview.appletgui.PairwiseAlignPanel (this.alignPanel));
+jalview.bin.JalviewLite.addFrame (frame, jalview.util.MessageManager.getString ("action.pairwise_alignment"), 600, 500);
+}});
+Clazz_defineMethod (c$, "PCAMenuItem_actionPerformed", 
+function () {
+if (!this.viewport.getAlignment ().isAligned (false)) {
+var current;
+var Width = this.viewport.getAlignment ().getWidth ();
+for (var i = 0; i < this.viewport.getAlignment ().getSequences ().size (); i++) {
+current = this.viewport.getAlignment ().getSequenceAt (i);
+if (current.getLength () < Width) {
+current.insertCharAt (Width - 1, this.viewport.getGapCharacter ());
+}}
+this.alignPanel.paintAlignment (true);
+}if ((this.viewport.getSelectionGroup () != null && this.viewport.getSelectionGroup ().getSize () < 4 && this.viewport.getSelectionGroup ().getSize () > 0) || this.viewport.getAlignment ().getHeight () < 4) {
+return;
+}try {
+ new jalview.appletgui.PCAPanel (this.viewport);
+} catch (ex) {
+if (Clazz_exceptionOf (ex, OutOfMemoryError)) {
+} else {
+throw ex;
+}
+}
+});
+Clazz_defineMethod (c$, "averageDistanceTreeMenuItem_actionPerformed", 
+function () {
+this.NewTreePanel ("AV", "PID", "Average distance tree using PID");
+});
+Clazz_defineMethod (c$, "neighbourTreeMenuItem_actionPerformed", 
+function () {
+this.NewTreePanel ("NJ", "PID", "Neighbour joining tree using PID");
+});
+Clazz_defineMethod (c$, "njTreeBlosumMenuItem_actionPerformed", 
+function () {
+this.NewTreePanel ("NJ", "BL", "Neighbour joining tree using BLOSUM62");
+});
+Clazz_defineMethod (c$, "avTreeBlosumMenuItem_actionPerformed", 
+function () {
+this.NewTreePanel ("AV", "BL", "Average distance tree using BLOSUM62");
+});
+Clazz_defineMethod (c$, "NewTreePanel", 
+function (type, pwType, title) {
+if (!this.viewport.getAlignment ().isAligned (false)) {
+var current;
+var Width = this.viewport.getAlignment ().getWidth ();
+for (var i = 0; i < this.viewport.getAlignment ().getSequences ().size (); i++) {
+current = this.viewport.getAlignment ().getSequenceAt (i);
+if (current.getLength () < Width) {
+current.insertCharAt (Width - 1, this.viewport.getGapCharacter ());
+}}
+this.alignPanel.paintAlignment (true);
+}if ((this.viewport.getSelectionGroup () != null && this.viewport.getSelectionGroup ().getSize () > 1) || (this.viewport.getAlignment ().getHeight () > 1)) {
+var tp =  new jalview.appletgui.TreePanel (this.alignPanel, type, pwType);
+this.addTreeMenuItem (tp, title);
+jalview.bin.JalviewLite.addFrame (tp, title, 600, 500);
+}}, "~S,~S,~S");
+Clazz_defineMethod (c$, "loadTree_actionPerformed", 
+function () {
+var cap =  new jalview.appletgui.CutAndPasteTransfer (true, this);
+cap.setText (jalview.util.MessageManager.getString ("label.paste_newick_tree_file"));
+cap.setTreeImport ();
+var frame =  new awt2swing.Frame ();
+frame.add (cap);
+jalview.bin.JalviewLite.addFrame (frame, jalview.util.MessageManager.getString ("label.paste_newick_file"), 400, 300);
+});
+Clazz_defineMethod (c$, "loadTree", 
+function (tree, treeFile) {
+var tp =  new jalview.appletgui.TreePanel (this.alignPanel, treeFile, jalview.util.MessageManager.getString ("label.load_tree_from_file"), tree);
+jalview.bin.JalviewLite.addFrame (tp, treeFile, 600, 500);
+this.addTreeMenuItem (tp, treeFile);
+}, "jalview.io.NewickFile,~S");
+Clazz_defineMethod (c$, "sortByTree", 
+function (treePanel, title) {
+var oldOrder = this.viewport.getAlignment ().getSequencesArray ();
+jalview.analysis.AlignmentSorter.sortByTree (this.viewport.getAlignment (), treePanel.getTree ());
+this.addHistoryItem ( new jalview.commands.OrderCommand (jalview.util.MessageManager.formatMessage ("label.order_by_params",  Clazz_newArray (-1, [title])), oldOrder, this.viewport.getAlignment ()));
+this.alignPanel.paintAlignment (true);
+}, "jalview.appletgui.TreePanel,~S");
+Clazz_defineMethod (c$, "addTreeMenuItem", 
+function (treePanel, title) {
+var item =  new awt2swing.MenuItem (title);
+this.sortByTreeMenu.add (item);
+item.addActionListener (((Clazz_isClassDefined ("jalview.appletgui.AlignFrame$2") ? 0 : jalview.appletgui.AlignFrame.$AlignFrame$2$ ()), Clazz_innerTypeInstance (jalview.appletgui.AlignFrame$2, this, Clazz_cloneFinals ("treePanel", treePanel, "title", title))));
+treePanel.addWindowListener (((Clazz_isClassDefined ("jalview.appletgui.AlignFrame$3") ? 0 : jalview.appletgui.AlignFrame.$AlignFrame$3$ ()), Clazz_innerTypeInstance (jalview.appletgui.AlignFrame$3, this, Clazz_cloneFinals ("treePanel", treePanel, "title", title, "item", item))));
+}, "jalview.appletgui.TreePanel,~S");
+Clazz_defineMethod (c$, "sortBy", 
+function (alorder, undoname) {
+var oldOrder = this.viewport.getAlignment ().getSequencesArray ();
+if ((this.viewport.applet, jalview.bin.JalviewLite).debug) {
+System.err.println ("Sorting " + alorder.getOrder ().size () + " in alignment '" + this.getTitle () + "'");
+}jalview.analysis.AlignmentSorter.sortBy (this.viewport.getAlignment (), alorder);
+if (undoname != null) {
+this.addHistoryItem ( new jalview.commands.OrderCommand (undoname, oldOrder, this.viewport.getAlignment ()));
+}this.alignPanel.paintAlignment (true);
+return true;
+}, "jalview.datamodel.AlignmentOrder,~S");
+Clazz_defineMethod (c$, "documentation_actionPerformed", 
+function () {
+this.alignPanel.av.applet.openJalviewHelpUrl ();
+});
+Clazz_defineMethod (c$, "about_actionPerformed", 
+function () {
+if (!Clazz_isClassDefined ("jalview.appletgui.AlignFrame$1AboutPanel")) {
+jalview.appletgui.AlignFrame.$AlignFrame$1AboutPanel$ ();
+}
+var frame =  new awt2swing.Frame ();
+frame.add (Clazz_innerTypeInstance (jalview.appletgui.AlignFrame$1AboutPanel, this, null, jalview.bin.JalviewLite.getVersion (), jalview.bin.JalviewLite.getBuildDate ()));
+jalview.bin.JalviewLite.addFrame (frame, jalview.util.MessageManager.getString ("label.jalview"), 580, 220);
+});
+Clazz_defineMethod (c$, "showURL", 
+function (url, target) {
+if (this.viewport.applet == null) {
+System.out.println ("Not running as applet - no browser available.");
+} else {
+this.viewport.applet.showURL (url, target);
+}}, "~S,~S");
+Clazz_defineMethod (c$, "jbInit", 
+ function () {
+this.setMenuBar (this.alignFrameMenuBar);
+this.inputText.setLabel (jalview.util.MessageManager.getString ("label.input_from_textbox"));
+this.inputText.addActionListener (this);
+var outputTextboxMenu =  new awt2swing.Menu (jalview.util.MessageManager.getString ("label.out_to_textbox"));
+for (var i = 0; i < jalview.io.AppletFormatAdapter.WRITEABLE_FORMATS.length; i++) {
+var item =  new awt2swing.MenuItem (jalview.io.AppletFormatAdapter.WRITEABLE_FORMATS[i]);
+item.addActionListener (((Clazz_isClassDefined ("jalview.appletgui.AlignFrame$4") ? 0 : jalview.appletgui.AlignFrame.$AlignFrame$4$ ()), Clazz_innerTypeInstance (jalview.appletgui.AlignFrame$4, this, null)));
+outputTextboxMenu.add (item);
+}
+this.closeMenuItem.addActionListener (this);
+this.loadApplication.addActionListener (this);
+this.$loadTree.addActionListener (this);
+this.$loadAnnotations.addActionListener (this);
+this.$outputFeatures.addActionListener (this);
+this.$outputAnnotations.addActionListener (this);
+this.undoMenuItem.setEnabled (false);
+this.undoMenuItem.setLabel (jalview.util.MessageManager.getString ("action.undo"));
+this.undoMenuItem.addActionListener (this);
+this.redoMenuItem.setEnabled (false);
+this.redoMenuItem.setLabel (jalview.util.MessageManager.getString ("action.redo"));
+this.redoMenuItem.addActionListener (this);
+this.copy.setLabel (jalview.util.MessageManager.getString ("action.copy"));
+this.copy.addActionListener (this);
+this.cut.setLabel (jalview.util.MessageManager.getString ("action.cut"));
+this.cut.addActionListener (this);
+this.$delete.setLabel (jalview.util.MessageManager.getString ("action.delete"));
+this.$delete.addActionListener (this);
+this.pasteMenu.setLabel (jalview.util.MessageManager.getString ("action.paste"));
+this.pasteNew.setLabel (jalview.util.MessageManager.getString ("label.to_new_alignment"));
+this.pasteNew.addActionListener (this);
+this.pasteThis.setLabel (jalview.util.MessageManager.getString ("label.to_this_alignment"));
+this.pasteThis.addActionListener (this);
+this.remove2LeftMenuItem.setLabel (jalview.util.MessageManager.getString ("action.remove_left"));
+this.remove2LeftMenuItem.addActionListener (this);
+this.remove2RightMenuItem.setLabel (jalview.util.MessageManager.getString ("action.remove_right"));
+this.remove2RightMenuItem.addActionListener (this);
+this.removeGappedColumnMenuItem.setLabel (jalview.util.MessageManager.getString ("action.remove_empty_columns"));
+this.removeGappedColumnMenuItem.addActionListener (this);
+this.removeAllGapsMenuItem.setLabel (jalview.util.MessageManager.getString ("action.remove_all_gaps"));
+this.removeAllGapsMenuItem.addActionListener (this);
+this.removeRedundancyMenuItem.setLabel (jalview.util.MessageManager.getString ("action.remove_redundancy").concat ("..."));
+this.removeRedundancyMenuItem.addActionListener (this);
+this.findMenuItem.setLabel (jalview.util.MessageManager.getString ("action.find"));
+this.findMenuItem.addActionListener (this);
+this.selectAllSequenceMenuItem.addActionListener (this);
+this.deselectAllSequenceMenuItem.addActionListener (this);
+this.invertSequenceMenuItem.setLabel (jalview.util.MessageManager.getString ("action.invert_sequence_selection"));
+this.invertSequenceMenuItem.addActionListener (this);
+this.invertColSel.setLabel (jalview.util.MessageManager.getString ("action.invert_column_selection"));
+this.invertColSel.addActionListener (this);
+this.deleteGroups.setLabel (jalview.util.MessageManager.getString ("action.undefine_groups"));
+this.deleteGroups.addActionListener (this);
+this.grpsFromSelection.setLabel (jalview.util.MessageManager.getString ("action.make_groups_selection"));
+this.grpsFromSelection.addActionListener (this);
+this.createGroup.setLabel (jalview.util.MessageManager.getString ("action.create_group"));
+this.unGroup.setLabel (jalview.util.MessageManager.getString ("action.remove_group"));
+this.annotationColumnSelection.setLabel ("Select by Annotation");
+this.annotationColumnSelection.addActionListener (this);
+this.$newView.setLabel (jalview.util.MessageManager.getString ("action.new_view"));
+this.$newView.addActionListener (this);
+var showMenu =  new awt2swing.Menu (jalview.util.MessageManager.getString ("action.show"));
+this.showColumns.setLabel (jalview.util.MessageManager.getString ("label.all_columns"));
+this.showSeqs.setLabel (jalview.util.MessageManager.getString ("label.all_sequences"));
+var hideMenu =  new awt2swing.Menu (jalview.util.MessageManager.getString ("action.hide"));
+this.hideColumns.setLabel (jalview.util.MessageManager.getString ("label.selected_columns"));
+this.hideSequences.setLabel (jalview.util.MessageManager.getString ("label.selected_sequences"));
+this.hideAllButSelection.setLabel (jalview.util.MessageManager.getString ("label.all_but_selected_region"));
+this.hideAllSelection.setLabel (jalview.util.MessageManager.getString ("label.selected_region"));
+this.showAllHidden.setLabel (jalview.util.MessageManager.getString ("label.all_sequences_columns"));
+this.showColumns.addActionListener (this);
+this.showSeqs.addActionListener (this);
+this.hideColumns.addActionListener (this);
+this.hideSequences.addActionListener (this);
+this.hideAllButSelection.addActionListener (this);
+this.hideAllSelection.addActionListener (this);
+this.showAllHidden.addActionListener (this);
+this.featureSettings.setLabel (jalview.util.MessageManager.getString ("label.feature_settings"));
+this.featureSettings.addActionListener (this);
+this.sequenceFeatures.setLabel (jalview.util.MessageManager.getString ("label.show_sequence_features"));
+this.sequenceFeatures.addItemListener (this);
+this.sequenceFeatures.setState (false);
+this.followMouseOverFlag.setLabel (jalview.util.MessageManager.getString ("label.automatic_scrolling"));
+this.followMouseOverFlag.addItemListener (this);
+this.alProperties.addActionListener (this);
+this.overviewMenuItem.setLabel (jalview.util.MessageManager.getString ("label.overview_window"));
+this.overviewMenuItem.addActionListener (this);
+this.annotationPanelMenuItem.setLabel (jalview.util.MessageManager.getString ("label.show_annotations"));
+this.annotationPanelMenuItem.addItemListener (this);
+this.showGroupConsensus.setLabel (jalview.util.MessageManager.getString ("label.group_consensus"));
+this.showGroupConservation.setLabel (jalview.util.MessageManager.getString ("label.group_conservation"));
+this.showConsensusHistogram.setLabel (jalview.util.MessageManager.getString ("label.show_consensus_histogram"));
+this.showSequenceLogo.setLabel (jalview.util.MessageManager.getString ("label.show_consensus_logo"));
+this.normSequenceLogo.setLabel (jalview.util.MessageManager.getString ("label.norm_consensus_logo"));
+this.applyAutoAnnotationSettings.setLabel (jalview.util.MessageManager.getString ("label.apply_all_groups"));
+this.applyAutoAnnotationSettings.setState (true);
+var autoAnnMenu =  new awt2swing.Menu (jalview.util.MessageManager.getString ("label.autocalculated_annotation"));
+this.showGroupConsensus.addItemListener (this);
+this.showGroupConservation.addItemListener (this);
+this.showConsensusHistogram.addItemListener (this);
+this.showSequenceLogo.addItemListener (this);
+this.normSequenceLogo.addItemListener (this);
+this.applyAutoAnnotationSettings.addItemListener (this);
+this.showAlignmentAnnotations =  new awt2swing.CheckboxMenuItem (jalview.util.MessageManager.getString ("label.show_all_al_annotations"));
+this.showSequenceAnnotations =  new awt2swing.CheckboxMenuItem (jalview.util.MessageManager.getString ("label.show_all_seq_annotations"));
+this.sortAnnBySequence =  new awt2swing.CheckboxMenuItem (jalview.util.MessageManager.getString ("label.sort_annotations_by_sequence"));
+this.sortAnnByLabel =  new awt2swing.CheckboxMenuItem (jalview.util.MessageManager.getString ("label.sort_annotations_by_label"));
+this.showAutoFirst =  new awt2swing.CheckboxMenuItem (jalview.util.MessageManager.getString ("label.show_first"));
+this.showAutoLast =  new awt2swing.CheckboxMenuItem (jalview.util.MessageManager.getString ("label.show_last"));
+this.showAlignmentAnnotations.addItemListener (this);
+this.showSequenceAnnotations.addItemListener (this);
+this.sortAnnBySequence.addItemListener (this);
+this.sortAnnByLabel.addItemListener (this);
+this.showAutoFirst.addItemListener (this);
+this.showAutoLast.addItemListener (this);
+this.$font.setLabel (jalview.util.MessageManager.getString ("action.font"));
+this.$font.addActionListener (this);
+this.scaleAbove.setLabel (jalview.util.MessageManager.getString ("action.scale_above"));
+this.scaleAbove.setState (true);
+this.scaleAbove.setEnabled (false);
+this.scaleAbove.addItemListener (this);
+this.scaleLeft.setEnabled (false);
+this.scaleLeft.setState (true);
+this.scaleLeft.setLabel (jalview.util.MessageManager.getString ("action.scale_left"));
+this.scaleLeft.addItemListener (this);
+this.scaleRight.setEnabled (false);
+this.scaleRight.setState (true);
+this.scaleRight.setLabel (jalview.util.MessageManager.getString ("action.scale_right"));
+this.scaleRight.addItemListener (this);
+this.viewBoxesMenuItem.setLabel (jalview.util.MessageManager.getString ("action.boxes"));
+this.viewBoxesMenuItem.setState (true);
+this.viewBoxesMenuItem.addItemListener (this);
+this.viewTextMenuItem.setLabel (jalview.util.MessageManager.getString ("action.text"));
+this.viewTextMenuItem.setState (true);
+this.viewTextMenuItem.addItemListener (this);
+this.colourTextMenuItem.setLabel (jalview.util.MessageManager.getString ("label.colour_text"));
+this.colourTextMenuItem.addItemListener (this);
+this.displayNonconservedMenuItem.setLabel (jalview.util.MessageManager.getString ("label.show_non_conversed"));
+this.displayNonconservedMenuItem.addItemListener (this);
+this.wrapMenuItem.setLabel (jalview.util.MessageManager.getString ("action.wrap"));
+this.wrapMenuItem.addItemListener (this);
+this.renderGapsMenuItem.setLabel (jalview.util.MessageManager.getString ("action.show_gaps"));
+this.renderGapsMenuItem.setState (true);
+this.renderGapsMenuItem.addItemListener (this);
+this.centreColumnLabelFlag.setLabel (jalview.util.MessageManager.getString ("label.centre_column_labels"));
+this.centreColumnLabelFlag.addItemListener (this);
+this.seqLimits.setState (true);
+this.seqLimits.setLabel (jalview.util.MessageManager.getString ("label.show_sequence_limits"));
+this.seqLimits.addItemListener (this);
+this.applyToAllGroups.setLabel (jalview.util.MessageManager.getString ("label.apply_colour_to_all_groups"));
+this.applyToAllGroups.setState (true);
+this.applyToAllGroups.addItemListener (this);
+this.clustalColour.setLabel (jalview.util.MessageManager.getString ("label.clustalx"));
+this.clustalColour.addActionListener (this);
+this.zappoColour.setLabel (jalview.util.MessageManager.getString ("label.zappo"));
+this.zappoColour.addActionListener (this);
+this.taylorColour.setLabel (jalview.util.MessageManager.getString ("label.taylor"));
+this.taylorColour.addActionListener (this);
+this.hydrophobicityColour.setLabel (jalview.util.MessageManager.getString ("label.hydrophobicity"));
+this.hydrophobicityColour.addActionListener (this);
+this.helixColour.setLabel (jalview.util.MessageManager.getString ("label.helix_propensity"));
+this.helixColour.addActionListener (this);
+this.strandColour.setLabel (jalview.util.MessageManager.getString ("label.strand_propensity"));
+this.strandColour.addActionListener (this);
+this.turnColour.setLabel (jalview.util.MessageManager.getString ("label.turn_propensity"));
+this.turnColour.addActionListener (this);
+this.buriedColour.setLabel (jalview.util.MessageManager.getString ("label.buried_index"));
+this.buriedColour.addActionListener (this);
+this.purinePyrimidineColour.setLabel (jalview.util.MessageManager.getString ("label.purine_pyrimidine"));
+this.purinePyrimidineColour.addActionListener (this);
+this.RNAInteractionColour.setLabel (jalview.util.MessageManager.getString ("label.rna_interaction"));
+this.RNAInteractionColour.addActionListener (this);
+this.RNAHelixColour.setLabel (jalview.util.MessageManager.getString ("action.by_rna_helixes"));
+this.RNAHelixColour.addActionListener (this);
+this.userDefinedColour.setLabel (jalview.util.MessageManager.getString ("action.user_defined"));
+this.userDefinedColour.addActionListener (this);
+this.PIDColour.setLabel (jalview.util.MessageManager.getString ("label.percentage_identity"));
+this.PIDColour.addActionListener (this);
+this.BLOSUM62Colour.setLabel (jalview.util.MessageManager.getString ("label.blosum62_score"));
+this.BLOSUM62Colour.addActionListener (this);
+this.tcoffeeColour.setLabel (jalview.util.MessageManager.getString ("label.tcoffee_scores"));
+this.tcoffeeColour.setEnabled (false);
+this.tcoffeeColour.addActionListener (this);
+this.conservationMenuItem.setLabel (jalview.util.MessageManager.getString ("action.by_conservation"));
+this.conservationMenuItem.addItemListener (this);
+this.noColourmenuItem.setLabel (jalview.util.MessageManager.getString ("label.none"));
+this.noColourmenuItem.addActionListener (this);
+this.abovePIDThreshold.setLabel (jalview.util.MessageManager.getString ("label.above_identity_threshold"));
+this.abovePIDThreshold.addItemListener (this);
+this.nucleotideColour.setLabel (jalview.util.MessageManager.getString ("label.nucleotide"));
+this.nucleotideColour.addActionListener (this);
+this.modifyPID.setLabel (jalview.util.MessageManager.getString ("label.modify_identity_thereshold"));
+this.modifyPID.addActionListener (this);
+this.modifyConservation.setLabel (jalview.util.MessageManager.getString ("label.modify_conservation_thereshold"));
+this.modifyConservation.addActionListener (this);
+this.annotationColour.setLabel (jalview.util.MessageManager.getString ("action.by_annotation"));
+this.annotationColour.addActionListener (this);
+this.sortPairwiseMenuItem.setLabel (jalview.util.MessageManager.getString ("action.by_pairwise_id"));
+this.sortPairwiseMenuItem.addActionListener (this);
+this.sortIDMenuItem.setLabel (jalview.util.MessageManager.getString ("action.by_id"));
+this.sortIDMenuItem.addActionListener (this);
+this.sortLengthMenuItem.setLabel (jalview.util.MessageManager.getString ("action.by_length"));
+this.sortLengthMenuItem.addActionListener (this);
+this.sortGroupMenuItem.setLabel (jalview.util.MessageManager.getString ("action.by_group"));
+this.sortGroupMenuItem.addActionListener (this);
+this.pairwiseAlignmentMenuItem.setLabel (jalview.util.MessageManager.getString ("action.pairwise_alignment"));
+this.pairwiseAlignmentMenuItem.addActionListener (this);
+this.PCAMenuItem.setLabel (jalview.util.MessageManager.getString ("label.principal_component_analysis"));
+this.PCAMenuItem.addActionListener (this);
+this.autoCalculate =  new awt2swing.CheckboxMenuItem (jalview.util.MessageManager.getString ("label.autocalculate_consensus"), true);
+this.averageDistanceTreeMenuItem.setLabel (jalview.util.MessageManager.getString ("label.average_distance_identity"));
+this.averageDistanceTreeMenuItem.addActionListener (this);
+this.neighbourTreeMenuItem.setLabel (jalview.util.MessageManager.getString ("label.neighbour_joining_identity"));
+this.neighbourTreeMenuItem.addActionListener (this);
+this.avDistanceTreeBlosumMenuItem.setLabel (jalview.util.MessageManager.getString ("label.average_distance_bloslum62"));
+this.avDistanceTreeBlosumMenuItem.addActionListener (this);
+this.njTreeBlosumMenuItem.setLabel (jalview.util.MessageManager.getString ("label.neighbour_blosum62"));
+this.njTreeBlosumMenuItem.addActionListener (this);
+this.sortByTreeMenu.setLabel (jalview.util.MessageManager.getString ("action.by_tree_order"));
+var sortMenu =  new awt2swing.Menu (jalview.util.MessageManager.getString ("action.sort"));
+var calculateTreeMenu =  new awt2swing.Menu (jalview.util.MessageManager.getString ("action.calculate_tree"));
+this.autoCalculate.addItemListener (this);
+this.$sortByTree.addItemListener (this);
+var helpMenu =  new awt2swing.Menu (jalview.util.MessageManager.getString ("action.help"));
+this.documentation.setLabel (jalview.util.MessageManager.getString ("label.documentation"));
+this.documentation.addActionListener (this);
+this.about.setLabel (jalview.util.MessageManager.getString ("label.about"));
+this.about.addActionListener (this);
+this.alignFrameMenuBar.add (this.fileMenu);
+var editMenu =  new awt2swing.Menu (jalview.util.MessageManager.getString ("action.edit"));
+this.alignFrameMenuBar.add (editMenu);
+var selectMenu =  new awt2swing.Menu (jalview.util.MessageManager.getString ("action.select"));
+this.alignFrameMenuBar.add (selectMenu);
+var viewMenu =  new awt2swing.Menu (jalview.util.MessageManager.getString ("action.view"));
+this.alignFrameMenuBar.add (viewMenu);
+var annotationsMenu =  new awt2swing.Menu (jalview.util.MessageManager.getString ("action.annotations"));
+this.alignFrameMenuBar.add (annotationsMenu);
+var formatMenu =  new awt2swing.Menu (jalview.util.MessageManager.getString ("action.format"));
+this.alignFrameMenuBar.add (formatMenu);
+var colourMenu =  new awt2swing.Menu (jalview.util.MessageManager.getString ("action.colour"));
+this.alignFrameMenuBar.add (colourMenu);
+var calculateMenu =  new awt2swing.Menu (jalview.util.MessageManager.getString ("action.calculate"));
+this.alignFrameMenuBar.add (calculateMenu);
+this.alignFrameMenuBar.add (helpMenu);
+this.fileMenu.add (this.inputText);
+this.fileMenu.add (this.$loadTree);
+this.fileMenu.add (this.$loadAnnotations);
+this.fileMenu.addSeparator ();
+this.fileMenu.add (outputTextboxMenu);
+this.fileMenu.add (this.$outputFeatures);
+this.fileMenu.add (this.$outputAnnotations);
+if (this.jalviewServletURL != null) {
+this.fileMenu.add (this.loadApplication);
+}this.fileMenu.addSeparator ();
+this.fileMenu.add (this.closeMenuItem);
+editMenu.add (this.undoMenuItem);
+editMenu.add (this.redoMenuItem);
+editMenu.add (this.cut);
+editMenu.add (this.copy);
+this.pasteMenu.add (this.pasteNew);
+this.pasteMenu.add (this.pasteThis);
+editMenu.add (this.pasteMenu);
+editMenu.add (this.$delete);
+editMenu.addSeparator ();
+editMenu.add (this.remove2LeftMenuItem);
+editMenu.add (this.remove2RightMenuItem);
+editMenu.add (this.removeGappedColumnMenuItem);
+editMenu.add (this.removeAllGapsMenuItem);
+editMenu.add (this.removeRedundancyMenuItem);
+selectMenu.add (this.findMenuItem);
+selectMenu.addSeparator ();
+selectMenu.add (this.selectAllSequenceMenuItem);
+selectMenu.add (this.deselectAllSequenceMenuItem);
+selectMenu.add (this.invertSequenceMenuItem);
+selectMenu.add (this.invertColSel);
+selectMenu.add (this.createGroup);
+selectMenu.add (this.unGroup);
+selectMenu.add (this.grpsFromSelection);
+selectMenu.add (this.deleteGroups);
+selectMenu.add (this.annotationColumnSelection);
+viewMenu.add (this.$newView);
+viewMenu.addSeparator ();
+showMenu.add (this.showColumns);
+showMenu.add (this.showSeqs);
+showMenu.add (this.showAllHidden);
+viewMenu.add (showMenu);
+hideMenu.add (this.hideColumns);
+hideMenu.add (this.hideSequences);
+hideMenu.add (this.hideAllSelection);
+hideMenu.add (this.hideAllButSelection);
+viewMenu.add (hideMenu);
+viewMenu.addSeparator ();
+viewMenu.add (this.followMouseOverFlag);
+viewMenu.addSeparator ();
+viewMenu.add (this.sequenceFeatures);
+viewMenu.add (this.featureSettings);
+viewMenu.addSeparator ();
+viewMenu.add (this.alProperties);
+viewMenu.addSeparator ();
+viewMenu.add (this.overviewMenuItem);
+annotationsMenu.add (this.annotationPanelMenuItem);
+annotationsMenu.addSeparator ();
+annotationsMenu.add (this.showAlignmentAnnotations);
+annotationsMenu.add (this.showSequenceAnnotations);
+annotationsMenu.add (this.sortAnnBySequence);
+annotationsMenu.add (this.sortAnnByLabel);
+annotationsMenu.addSeparator ();
+autoAnnMenu.add (this.showAutoFirst);
+autoAnnMenu.add (this.showAutoLast);
+autoAnnMenu.addSeparator ();
+autoAnnMenu.add (this.applyAutoAnnotationSettings);
+autoAnnMenu.add (this.showConsensusHistogram);
+autoAnnMenu.add (this.showSequenceLogo);
+autoAnnMenu.add (this.normSequenceLogo);
+autoAnnMenu.addSeparator ();
+autoAnnMenu.add (this.showGroupConservation);
+autoAnnMenu.add (this.showGroupConsensus);
+annotationsMenu.add (autoAnnMenu);
+formatMenu.add (this.$font);
+formatMenu.add (this.seqLimits);
+formatMenu.add (this.wrapMenuItem);
+formatMenu.add (this.scaleAbove);
+formatMenu.add (this.scaleLeft);
+formatMenu.add (this.scaleRight);
+formatMenu.add (this.viewBoxesMenuItem);
+formatMenu.add (this.viewTextMenuItem);
+formatMenu.add (this.colourTextMenuItem);
+formatMenu.add (this.displayNonconservedMenuItem);
+formatMenu.add (this.renderGapsMenuItem);
+formatMenu.add (this.centreColumnLabelFlag);
+colourMenu.add (this.applyToAllGroups);
+colourMenu.addSeparator ();
+colourMenu.add (this.noColourmenuItem);
+colourMenu.add (this.clustalColour);
+colourMenu.add (this.BLOSUM62Colour);
+colourMenu.add (this.PIDColour);
+colourMenu.add (this.zappoColour);
+colourMenu.add (this.taylorColour);
+colourMenu.add (this.hydrophobicityColour);
+colourMenu.add (this.helixColour);
+colourMenu.add (this.strandColour);
+colourMenu.add (this.turnColour);
+colourMenu.add (this.buriedColour);
+colourMenu.add (this.nucleotideColour);
+colourMenu.add (this.purinePyrimidineColour);
+colourMenu.add (this.tcoffeeColour);
+colourMenu.add (this.userDefinedColour);
+colourMenu.addSeparator ();
+colourMenu.add (this.conservationMenuItem);
+colourMenu.add (this.modifyConservation);
+colourMenu.add (this.abovePIDThreshold);
+colourMenu.add (this.modifyPID);
+colourMenu.add (this.annotationColour);
+colourMenu.add (this.RNAHelixColour);
+sortMenu.add (this.sortIDMenuItem);
+sortMenu.add (this.sortLengthMenuItem);
+sortMenu.add (this.sortByTreeMenu);
+sortMenu.add (this.sortGroupMenuItem);
+sortMenu.add (this.sortPairwiseMenuItem);
+calculateMenu.add (sortMenu);
+calculateTreeMenu.add (this.averageDistanceTreeMenuItem);
+calculateTreeMenu.add (this.neighbourTreeMenuItem);
+calculateTreeMenu.add (this.avDistanceTreeBlosumMenuItem);
+calculateTreeMenu.add (this.njTreeBlosumMenuItem);
+calculateMenu.add (calculateTreeMenu);
+calculateMenu.addSeparator ();
+calculateMenu.add (this.pairwiseAlignmentMenuItem);
+calculateMenu.add (this.PCAMenuItem);
+calculateMenu.add (this.autoCalculate);
+calculateMenu.add (this.$sortByTree);
+helpMenu.add (this.documentation);
+helpMenu.add (this.about);
+this.statusBar.setBackground (java.awt.Color.white);
+this.statusBar.setFont ( new java.awt.Font ("Verdana", 0, 11));
+this.setStatus (jalview.util.MessageManager.getString ("label.status_bar"));
+this.add (this.statusBar, "South");
+});
+Clazz_overrideMethod (c$, "setStatus", 
+function (string) {
+this.statusBar.setText (string);
+}, "~S");
+Clazz_defineMethod (c$, "createAlignFrameWindow", 
+function (reallyEmbedded) {
+if (reallyEmbedded) {
+this.embedAlignFrameInApplet (this.viewport.applet);
+} else {
+if (this.embedMenuIfNeeded (this.alignPanel)) {
+this.alignPanel.setSize (this.getSize ().width, this.getSize ().height - this.statusBar.getHeight ());
+}this.add (this.statusBar, "South");
+this.add (this.alignPanel, "Center");
+jalview.bin.JalviewLite.addFrame (this, this.getTitle (), this.frameWidth, this.frameHeight);
+}}, "~B");
+Clazz_defineMethod (c$, "embedAlignFrameInApplet", 
+function (theApplet) {
+this.fileMenu.remove (this.closeMenuItem);
+this.fileMenu.remove (3);
+this.embeddedMenu = this.makeEmbeddedPopupMenu (this.alignFrameMenuBar, false, false);
+theApplet.setLayout ( new java.awt.BorderLayout ());
+theApplet.add (this.embeddedMenu, "North");
+theApplet.add (this.statusBar, "South");
+this.alignPanel.setSize (theApplet.getSize ().width, theApplet.getSize ().height - this.embeddedMenu.getHeight () - this.statusBar.getHeight ());
+theApplet.add (this.alignPanel, "Center");
+var me = this;
+theApplet.addFocusListener (((Clazz_isClassDefined ("jalview.appletgui.AlignFrame$5") ? 0 : jalview.appletgui.AlignFrame.$AlignFrame$5$ ()), Clazz_innerTypeInstance (jalview.appletgui.AlignFrame$5, this, Clazz_cloneFinals ("theApplet", theApplet, "me", me))));
+theApplet.validate ();
+}, "jalview.bin.JalviewLite");
+Clazz_defineMethod (c$, "addStructureViewInstance", 
+function (jmolviewer, sequenceIds) {
+return null;
+}, "~O,~A");
+Clazz_defineMethod (c$, "addPdbFile", 
+function (sequenceId, pdbEntryString, pdbFile) {
+var toaddpdb = this.viewport.getAlignment ().findName (sequenceId);
+var needtoadd = false;
+if (toaddpdb != null) {
+var pdbe = toaddpdb.getPDBId ();
+var pdbentry = null;
+if (pdbe != null && pdbe.size () > 0) {
+for (var pe = 0, peSize = pdbe.size (); pe < peSize; pe++) {
+pdbentry = pdbe.elementAt (pe);
+if (!pdbentry.getId ().equals (pdbEntryString) && !pdbentry.getFile ().equals (pdbFile)) {
+pdbentry = null;
+} else {
+continue;
+}}
+}if (pdbentry == null) {
+pdbentry =  new jalview.datamodel.PDBEntry ();
+pdbentry.setId (pdbEntryString);
+pdbentry.setFile (pdbFile);
+needtoadd = true;
+}var protocol = jalview.io.AppletFormatAdapter.resolveProtocol (pdbFile, "PDB");
+if (protocol == null) {
+return false;
+}if (needtoadd) {
+if (pdbentry.getProperty () == null) {
+pdbentry.setProperty ( new java.util.Hashtable ());
+}pdbentry.getProperty ().put ("protocol", protocol);
+toaddpdb.addPDBId (pdbentry);
+this.alignPanel.getStructureSelectionManager ().registerPDBEntry (pdbentry);
+}}return true;
+}, "~S,~S,~S");
+Clazz_defineMethod (c$, "cleanSeqChainArrays", 
+ function (seqs, chains) {
+if (seqs != null) {
+var sequences =  new java.util.Vector ();
+for (var i = 0; i < seqs.length; i++) {
+if (seqs[i] != null) {
+sequences.addElement ( Clazz_newArray (-1, [seqs[i], (chains != null) ? chains[i] : null]));
+}}
+seqs =  new Array (sequences.size ());
+chains =  new Array (sequences.size ());
+for (var i = 0, isize = sequences.size (); i < isize; i++) {
+var oj = sequences.elementAt (i);
+seqs[i] = oj[0];
+chains[i] = oj[1];
+}
+}return  Clazz_newArray (-1, [seqs, chains]);
+}, "~A,~A");
+Clazz_defineMethod (c$, "newStructureView", 
+function (applet, pdb, seqs, chains, protocol) {
+var sqch = this.cleanSeqChainArrays (seqs, chains);
+seqs = sqch[0];
+chains = sqch[1];
+if (seqs == null || seqs.length == 0) {
+System.err.println ("JalviewLite.AlignFrame:newStructureView: No sequence to bind structure to.");
+}if (protocol == null || protocol.trim ().length == 0 || protocol.equals ("null")) {
+protocol = pdb.getProperty ().get ("protocol");
+if (protocol == null) {
+System.err.println ("Couldn't work out protocol to open structure: " + pdb.getId ());
+return;
+}}if (applet.useXtrnalSviewer) {
+if (jalview.structure.StructureSelectionManager.getStructureSelectionManager (applet).setMapping (seqs, chains, pdb.getFile (), protocol) == null) {
+System.err.println ("Failed to map " + pdb.getFile () + " (" + protocol + ") to any sequences");
+}return;
+}if (applet.isAlignPdbStructures () && applet.jmolAvailable) {
+var ajm = null;
+var tajm;
+var jmols = applet.getAppletWindow (jalview.appletgui.AppletJmol);
+for (var i = 0, iSize = jmols.size (); i < iSize; i++) {
+tajm = jmols.elementAt (i);
+if (tajm.ap.alignFrame === this) {
+ajm = tajm;
+break;
+}}
+if (ajm != null) {
+System.err.println ("Incremental adding and aligning structure to existing Jmol view not yet implemented.");
+ajm = null;
+}} new jalview.appletgui.AppletJmol (pdb, seqs, chains, this.alignPanel, protocol);
+jalview.bin.JalviewLite.lastFrameX += 40;
+jalview.bin.JalviewLite.lastFrameY += 40;
+}, "jalview.bin.JalviewLite,jalview.datamodel.PDBEntry,~A,~A,~S");
+Clazz_defineMethod (c$, "alignedStructureView", 
+function (applet, pdb, seqs, chains, protocols) {
+System.err.println ("Aligned Structure View: Not yet implemented.");
+}, "jalview.bin.JalviewLite,~A,~A,~A,~A");
+Clazz_defineMethod (c$, "select", 
+function (sel, csel) {
+this.alignPanel.seqPanel.selection (sel, csel, null);
+}, "jalview.datamodel.SequenceGroup,jalview.datamodel.ColumnSelection");
+Clazz_defineMethod (c$, "scrollTo", 
+function (row, column) {
+this.alignPanel.seqPanel.scrollTo (row, column);
+}, "~N,~N");
+Clazz_defineMethod (c$, "scrollToRow", 
+function (row) {
+this.alignPanel.seqPanel.scrollToRow (row);
+}, "~N");
+Clazz_defineMethod (c$, "scrollToColumn", 
+function (column) {
+this.alignPanel.seqPanel.scrollToColumn (column);
+}, "~N");
+Clazz_defineMethod (c$, "getSequenceSetId", 
+function () {
+return this.viewport.getSequenceSetId ();
+});
+Clazz_defineMethod (c$, "loadScoreFile", 
+function (inFile) {
+var file = jalview.jsdev.GenericFileAdapter.getFile ("TCoffeeScoreFile", [inFile, jalview.io.AppletFormatAdapter.checkProtocol (inFile)]);
+if (!file.isValid ()) {
+System.err.println ("Problems parsing T-Coffee scores: " + file.getWarningMessage ());
+System.err.println ("Origin was:\n" + inFile);
+return false;
+}var aln;
+if ((aln = this.viewport.getAlignment ()) != null && (aln.getHeight () != file.getHeight () || aln.getWidth () != file.getWidth ())) {
+System.err.println ("The scores matrix does not match the alignment dimensions");
+}if (file.annotateAlignment (this.alignPanel.getAlignment (), false)) {
+this.alignPanel.fontChanged ();
+this.tcoffeeColour.setEnabled (true);
+this.changeColour ( new jalview.schemes.TCoffeeColourScheme (this.alignPanel.getAlignment ()));
+return true;
+} else {
+System.err.println ("Problems resolving T-Coffee scores:");
+if (file.getWarningMessage () != null) {
+System.err.println (file.getWarningMessage ());
+}}return false;
+}, "~S");
+Clazz_defineMethod (c$, "getSplitFrame", 
+function () {
+return this.splitFrame;
+});
+Clazz_defineMethod (c$, "setSplitFrame", 
+function (sf) {
+this.splitFrame = sf;
+}, "jalview.appletgui.SplitFrame");
+Clazz_overrideMethod (c$, "setShowSeqFeatures", 
+function (b) {
+this.viewport.setShowSequenceFeatures (b);
+}, "~B");
+Clazz_overrideMethod (c$, "setMenusForViewport", 
+function () {
+});
+Clazz_overrideMethod (c$, "refreshFeatureUI", 
+function (enableIfNecessary) {
+if (enableIfNecessary) {
+this.sequenceFeatures.setState (true);
+this.alignPanel.av.setShowSequenceFeatures (true);
+}}, "~B");
+Clazz_overrideMethod (c$, "getFeatureSettingsUI", 
+function () {
+return this.alignPanel.av.featureSettings;
+});
+c$.$AlignFrame$1$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_declareAnonymous (jalview.appletgui, "AlignFrame$1", java.awt.event.WindowAdapter);
+Clazz_overrideMethod (c$, "windowClosing", 
+function (e) {
+if (this.f$.ap != null) {
+this.f$.ap.setOverviewPanel (null);
+}}, "java.awt.event.WindowEvent");
+c$ = Clazz_p0p ();
+};
+c$.$AlignFrame$2$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_declareAnonymous (jalview.appletgui, "AlignFrame$2", null, java.awt.event.ActionListener);
+Clazz_overrideMethod (c$, "actionPerformed", 
+function (evt) {
+this.b$["jalview.appletgui.AlignFrame"].sortByTree (this.f$.treePanel, this.f$.title);
+}, "java.awt.event.ActionEvent");
+c$ = Clazz_p0p ();
+};
+c$.$AlignFrame$3$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_declareAnonymous (jalview.appletgui, "AlignFrame$3", java.awt.event.WindowAdapter);
+Clazz_defineMethod (c$, "windowOpened", 
+function (e) {
+if (this.b$["jalview.appletgui.AlignFrame"].viewport.sortByTree) {
+this.b$["jalview.appletgui.AlignFrame"].sortByTree (this.f$.treePanel, this.f$.title);
+}Clazz_superCall (this, jalview.appletgui.AlignFrame$3, "windowOpened", [e]);
+}, "java.awt.event.WindowEvent");
+Clazz_overrideMethod (c$, "windowClosing", 
+function (e) {
+this.b$["jalview.appletgui.AlignFrame"].sortByTreeMenu.remove (this.f$.item);
+}, "java.awt.event.WindowEvent");
+c$ = Clazz_p0p ();
+};
+c$.$AlignFrame$1AboutPanel$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_decorateAsClass (function () {
+Clazz_prepareCallback (this, arguments);
+this.version = null;
+this.builddate = null;
+Clazz_instantialize (this, arguments);
+}, jalview.appletgui, "AlignFrame$1AboutPanel", awt2swing.Canvas);
+Clazz_makeConstructor (c$, 
+function (a, b) {
+Clazz_superConstructor (this, jalview.appletgui.AlignFrame$1AboutPanel, []);
+this.version = a;
+this.builddate = b;
+}, "~S,~S");
+Clazz_overrideMethod (c$, "paintComponent", 
+function (a) {
+a.setColor (java.awt.Color.white);
+a.fillRect (0, 0, this.getSize ().width, this.getSize ().height);
+a.setFont ( new java.awt.Font ("Helvetica", 0, 12));
+var b = a.getFontMetrics ();
+var c = b.getHeight ();
+var d = 5;
+var e = 7;
+a.setColor (java.awt.Color.black);
+a.setFont ( new java.awt.Font ("Helvetica", 1, 14));
+awt2swing.Util.drawString (a, jalview.util.MessageManager.formatMessage ("label.jalviewLite_release",  Clazz_newArray (-1, [this.version])), e, d += c);
+a.setFont ( new java.awt.Font ("Helvetica", 1, 12));
+awt2swing.Util.drawString (a, jalview.util.MessageManager.formatMessage ("label.jaview_build_date",  Clazz_newArray (-1, [this.builddate])), e, d += c);
+a.setFont ( new java.awt.Font ("Helvetica", 0, 12));
+awt2swing.Util.drawString (a, jalview.util.MessageManager.getString ("label.jalview_authors_1"), e, d += c * 1.5);
+awt2swing.Util.drawString (a, jalview.util.MessageManager.getString ("label.jalview_authors_2"), e + 50, d += c + 8);
+awt2swing.Util.drawString (a, jalview.util.MessageManager.getString ("label.jalview_dev_managers"), e, d += c);
+awt2swing.Util.drawString (a, jalview.util.MessageManager.getString ("label.jalview_distribution_lists"), e, d += c);
+awt2swing.Util.drawString (a, jalview.util.MessageManager.getString ("label.jalview_please_cite"), e, d += c + 8);
+awt2swing.Util.drawString (a, jalview.util.MessageManager.getString ("label.jalview_cite_1_authors"), e, d += c);
+awt2swing.Util.drawString (a, jalview.util.MessageManager.getString ("label.jalview_cite_1_title"), e, d += c);
+awt2swing.Util.drawString (a, jalview.util.MessageManager.getString ("label.jalview_cite_1_ref"), e, d += c);
+}, "java.awt.Graphics");
+c$ = Clazz_p0p ();
+};
+c$.$AlignFrame$4$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_declareAnonymous (jalview.appletgui, "AlignFrame$4", null, java.awt.event.ActionListener);
+Clazz_overrideMethod (c$, "actionPerformed", 
+function (e) {
+this.b$["jalview.appletgui.AlignFrame"].outputText_actionPerformed (e);
+}, "java.awt.event.ActionEvent");
+c$ = Clazz_p0p ();
+};
+c$.$AlignFrame$5$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_declareAnonymous (jalview.appletgui, "AlignFrame$5", null, java.awt.event.FocusListener);
+Clazz_overrideMethod (c$, "focusLost", 
+function (e) {
+if (this.f$.theApplet.currentAlignFrame === this.f$.me) {
+this.f$.theApplet.currentAlignFrame = null;
+}}, "java.awt.event.FocusEvent");
+Clazz_overrideMethod (c$, "focusGained", 
+function (e) {
+this.f$.theApplet.currentAlignFrame = this.f$.me;
+}, "java.awt.event.FocusEvent");
+c$ = Clazz_p0p ();
+};
+Clazz_defineStatics (c$,
+"copiedSequences", null,
+"copiedHiddenColumns", null);
+});
+Clazz_declarePackage ("awt2swing");
+Clazz_load (["awt2swing.Panel"], "awt2swing.Canvas", null, function () {
+c$ = Clazz_declareType (awt2swing, "Canvas", awt2swing.Panel);
+});
+Clazz_declarePackage ("awt2swing");
+Clazz_load (["javax.swing.JPanel"], "awt2swing.Panel", null, function () {
+c$ = Clazz_declareType (awt2swing, "Panel", javax.swing.JPanel);
+Clazz_defineMethod (c$, "setName", 
+function (name) {
+System.out.println (name);
+Clazz_superCall (this, awt2swing.Panel, "setName", [name]);
+}, "~S");
+});
+Clazz_declarePackage ("jalview.api");
+Clazz_declareInterface (jalview.api, "AlignViewControllerGuiI");
+Clazz_declarePackage ("jalview.appletgui");
+Clazz_load (["awt2swing.Frame", "java.awt.event.MouseListener", "java.awt.Font", "java.util.HashMap"], "jalview.appletgui.EmbmenuFrame", ["awt2swing.Label", "$.Panel", "$.PopupMenu", "jalview.util.Platform", "java.awt.Color", "$.FlowLayout"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.embeddedPopup = null;
+this.embeddedMenu = null;
+Clazz_instantialize (this, arguments);
+}, jalview.appletgui, "EmbmenuFrame", awt2swing.Frame, java.awt.event.MouseListener);
+Clazz_prepareFields (c$, function () {
+this.embeddedPopup =  new java.util.HashMap ();
+});
+Clazz_defineMethod (c$, "embedMenuIfNeeded", 
+function (tobeAdjusted) {
+var topMenuBar = this.getJMenuBar ();
+if (topMenuBar == null) {
+return false;
+}if (jalview.util.Platform.isAMac ()) {
+this.embeddedMenu = this.makeEmbeddedPopupMenu (topMenuBar, true, false);
+this.unsetMenuBar ();
+this.add (this.embeddedMenu, "North");
+tobeAdjusted.setSize (this.getSize ().width, this.getSize ().height - this.embeddedMenu.getHeight ());
+return true;
+}return false;
+}, "awt2swing.Panel");
+Clazz_defineMethod (c$, "makeEmbeddedPopupMenu", 
+function (menuBar, overrideFonts, append) {
+if (!append) {
+this.embeddedPopup.clear ();
+if (this.embeddedMenu != null) {
+this.embeddedMenu.removeAll ();
+}}this.embeddedMenu = this.makeEmbeddedPopupMenu (menuBar, jalview.appletgui.EmbmenuFrame.DEFAULT_MENU_FONT, overrideFonts,  new awt2swing.Panel (), this);
+return this.embeddedMenu;
+}, "awt2swing.MenuBar,~B,~B");
+Clazz_defineMethod (c$, "makeEmbeddedPopupMenu", 
+function (menuBar, font, overrideFonts, embeddedMenu, clickHandler) {
+if (overrideFonts) {
+var mbf = menuBar.getFont ();
+if (mbf != null) {
+font = mbf;
+}}if (embeddedMenu == null) {
+embeddedMenu =  new awt2swing.Panel ();
+}var flowLayout1 =  new java.awt.FlowLayout ();
+embeddedMenu.setBackground (java.awt.Color.lightGray);
+embeddedMenu.setLayout (flowLayout1);
+for (var mbi = 0, nMbi = menuBar.getMenuCount (); mbi < nMbi; mbi++) {
+var mi = menuBar.getMenu (mbi);
+var elab =  new awt2swing.Label (mi.getLabel ());
+elab.setFont (font);
+var popup =  new awt2swing.PopupMenu ();
+var m;
+var mSize = mi.getItemCount ();
+for (m = 0; m < mSize; m++) {
+if (mi.getItem (m) == null) popup.addSeparator ();
+ else popup.add (mi.getItem (m));
+mSize--;
+m--;
+}
+this.embeddedPopup.put (elab, popup);
+embeddedMenu.add (elab);
+elab.addMouseListener (clickHandler);
+}
+flowLayout1.setAlignment (0);
+flowLayout1.setHgap (2);
+flowLayout1.setVgap (0);
+return embeddedMenu;
+}, "awt2swing.MenuBar,java.awt.Font,~B,awt2swing.Panel,java.awt.event.MouseListener");
+Clazz_overrideMethod (c$, "mousePressed", 
+function (evt) {
+var popup = null;
+var source = evt.getSource ();
+popup = this.getPopupMenu (source);
+if (popup != null) {
+this.embeddedMenu.add (popup);
+popup.show (this.embeddedMenu, source.getBounds ().x, source.getBounds ().y + source.getBounds ().getSize ().height);
+}}, "java.awt.event.MouseEvent");
+Clazz_defineMethod (c$, "getPopupMenu", 
+function (source) {
+return this.embeddedPopup.get (source);
+}, "awt2swing.Label");
+Clazz_overrideMethod (c$, "mouseClicked", 
+function (evt) {
+}, "java.awt.event.MouseEvent");
+Clazz_overrideMethod (c$, "mouseReleased", 
+function (evt) {
+}, "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_defineMethod (c$, "destroyMenus", 
+function () {
+if (this.embeddedPopup != null) {
+for (var lb, $lb = this.embeddedPopup.keySet ().iterator (); $lb.hasNext () && ((lb = $lb.next ()) || true);) {
+lb.removeMouseListener (this);
+}
+this.embeddedPopup.clear ();
+}if (this.embeddedMenu != null) {
+this.embeddedMenu.removeAll ();
+}});
+Clazz_defineMethod (c$, "finalize", 
+function () {
+this.destroyMenus ();
+this.embeddedPopup = null;
+this.embeddedMenu = null;
+Clazz_superCall (this, jalview.appletgui.EmbmenuFrame, "finalize", []);
+});
+c$.FONT_ARIAL_PLAIN_11 = c$.prototype.FONT_ARIAL_PLAIN_11 =  new java.awt.Font ("Arial", 0, 11);
+c$.DEFAULT_MENU_FONT = c$.prototype.DEFAULT_MENU_FONT = jalview.appletgui.EmbmenuFrame.FONT_ARIAL_PLAIN_11;
+});
+Clazz_declarePackage ("awt2swing");
+Clazz_load (["javax.swing.JFrame"], "awt2swing.Frame", null, function () {
+c$ = Clazz_declareType (awt2swing, "Frame", javax.swing.JFrame);
+Clazz_defineMethod (c$, "remove", 
+function (i) {
+{
+this.removeInt(i);
+}}, "~N");
+Clazz_defineMethod (c$, "setMenuBar", 
+function (m) {
+this.setJMenuBar (m);
+}, "awt2swing.MenuBar");
+Clazz_defineMethod (c$, "unsetMenuBar", 
+function () {
+this.setJMenuBar (null);
+});
+Clazz_defineMethod (c$, "getMenubar", 
+function () {
+return this.getJMenuBar ();
+});
+});
+Clazz_declarePackage ("awt2swing");
+Clazz_load (["javax.swing.JLabel"], "awt2swing.Label", null, function () {
+c$ = Clazz_declareType (awt2swing, "Label", javax.swing.JLabel);
+Clazz_defineMethod (c$, "setAlignment", 
+function (alignment) {
+this.setAlignmentX (alignment);
+}, "~N");
+});
+Clazz_declarePackage ("awt2swing");
+Clazz_load (["javax.swing.JPopupMenu"], "awt2swing.PopupMenu", null, function () {
+c$ = Clazz_declareType (awt2swing, "PopupMenu", javax.swing.JPopupMenu);
+});
+Clazz_declarePackage ("jalview.util");
+Clazz_load (null, "jalview.util.Platform", ["java.lang.StringBuffer"], function () {
+c$ = Clazz_declareType (jalview.util, "Platform");
+c$.isAMac = Clazz_defineMethod (c$, "isAMac", 
+function () {
+return java.lang.System.getProperty ("os.name").indexOf ("Mac") > -1;
+});
+c$.isHeadless = Clazz_defineMethod (c$, "isHeadless", 
+function () {
+var hdls = java.lang.System.getProperty ("java.awt.headless");
+return hdls != null && hdls.equals ("true");
+});
+c$.getMaxCommandLineLength = Clazz_defineMethod (c$, "getMaxCommandLineLength", 
+function () {
+return 2046;
+});
+c$.escapeString = Clazz_defineMethod (c$, "escapeString", 
+function (file) {
+var f =  new StringBuffer ();
+var p = 0;
+var lastp = 0;
+while ((p = file.indexOf ('\\', lastp)) > -1) {
+f.append (file.subSequence (lastp, p));
+f.append ("\\\\");
+lastp = p + 1;
+}
+f.append (file.substring (lastp));
+return f.toString ();
+}, "~S");
+});
+Clazz_declarePackage ("awt2swing");
+Clazz_load (["javax.swing.JCheckBoxMenuItem"], "awt2swing.CheckboxMenuItem", null, function () {
+c$ = Clazz_declareType (awt2swing, "CheckboxMenuItem", javax.swing.JCheckBoxMenuItem);
+Clazz_makeConstructor (c$, 
+function () {
+Clazz_superConstructor (this, awt2swing.CheckboxMenuItem, []);
+});
+Clazz_overrideMethod (c$, "getState", 
+function () {
+return this.isSelected ();
+});
+Clazz_overrideMethod (c$, "setState", 
+function (tf) {
+this.setSelected (tf);
+}, "~B");
+});
+Clazz_declarePackage ("awt2swing");
+Clazz_load (["javax.swing.JMenu"], "awt2swing.Menu", null, function () {
+c$ = Clazz_declareType (awt2swing, "Menu", javax.swing.JMenu);
+Clazz_makeConstructor (c$, 
+function (title) {
+Clazz_superConstructor (this, awt2swing.Menu, [title]);
+title = null;
+}, "~S");
+Clazz_makeConstructor (c$, 
+function () {
+Clazz_superConstructor (this, awt2swing.Menu);
+var s = null;
+});
+});
+Clazz_declarePackage ("awt2swing");
+Clazz_load (["javax.swing.JMenuBar"], "awt2swing.MenuBar", null, function () {
+c$ = Clazz_declareType (awt2swing, "MenuBar", javax.swing.JMenuBar);
+});
+Clazz_declarePackage ("awt2swing");
+Clazz_load (["javax.swing.JMenuItem"], "awt2swing.MenuItem", null, function () {
+c$ = Clazz_declareType (awt2swing, "MenuItem", javax.swing.JMenuItem);
+});
+Clazz_declarePackage ("jalview.analysis");
+Clazz_load (null, "jalview.analysis.AlignmentSorter", ["jalview.datamodel.SequenceI", "jalview.util.Comparison", "$.MessageManager", "$.QuickSort", "java.lang.Error", "$.Float", "$.StringBuffer", "java.util.ArrayList"], function () {
+c$ = Clazz_declareType (jalview.analysis, "AlignmentSorter");
+c$.sortByPID = Clazz_defineMethod (c$, "sortByPID", 
+function (align, s, tosort) {
+jalview.analysis.AlignmentSorter.sortByPID (align, s, tosort, 0, -1);
+}, "jalview.datamodel.AlignmentI,jalview.datamodel.SequenceI,~A");
+c$.sortByPID = Clazz_defineMethod (c$, "sortByPID", 
+function (align, s, tosort, start, end) {
+var nSeq = align.getHeight ();
+var scores =  Clazz_newFloatArray (nSeq, 0);
+var seqs =  new Array (nSeq);
+for (var i = 0; i < nSeq; i++) {
+scores[i] = jalview.util.Comparison.PID (align.getSequenceAt (i).getSequenceAsString (), s.getSequenceAsString ());
+seqs[i] = align.getSequenceAt (i);
+}
+jalview.util.QuickSort.sortFloatObject (scores, seqs);
+jalview.analysis.AlignmentSorter.setReverseOrder (align, seqs);
+}, "jalview.datamodel.AlignmentI,jalview.datamodel.SequenceI,~A,~N,~N");
+c$.setReverseOrder = Clazz_defineMethod (c$, "setReverseOrder", 
+ function (align, seqs) {
+var nSeq = seqs.length;
+var len = 0;
+if ((nSeq % 2) == 0) {
+len = Clazz_doubleToInt (nSeq / 2);
+} else {
+len = Clazz_doubleToInt ((nSeq + 1) / 2);
+}var asq;
+{
+for (var i = 0; i < len; i++) {
+asq.set (i, seqs[nSeq - i - 1]);
+asq.set (nSeq - i - 1, seqs[i]);
+}
+}}, "jalview.datamodel.AlignmentI,~A");
+c$.setOrder = Clazz_defineMethod (c$, "setOrder", 
+ function (align, tmp) {
+jalview.analysis.AlignmentSorter.setOrder (align, jalview.analysis.AlignmentSorter.vectorSubsetToArray (tmp, align.getSequences ()));
+}, "jalview.datamodel.AlignmentI,java.util.List");
+c$.setOrder = Clazz_defineMethod (c$, "setOrder", 
+function (align, seqs) {
+var algn;
+{
+var tmp =  new java.util.ArrayList ();
+for (var i = 0; i < seqs.length; i++) {
+if (algn.contains (seqs[i])) {
+tmp.add (seqs[i]);
+}}
+algn.clear ();
+for (var i = 0; i < tmp.size (); i++) {
+algn.add (tmp.get (i));
+}
+}}, "jalview.datamodel.AlignmentI,~A");
+c$.sortByID = Clazz_defineMethod (c$, "sortByID", 
+function (align) {
+var nSeq = align.getHeight ();
+var ids =  new Array (nSeq);
+var seqs =  new Array (nSeq);
+for (var i = 0; i < nSeq; i++) {
+ids[i] = align.getSequenceAt (i).getName ();
+seqs[i] = align.getSequenceAt (i);
+}
+jalview.util.QuickSort.sort (ids, seqs);
+if (jalview.analysis.AlignmentSorter.sortIdAscending) {
+jalview.analysis.AlignmentSorter.setReverseOrder (align, seqs);
+} else {
+jalview.analysis.AlignmentSorter.setOrder (align, seqs);
+}jalview.analysis.AlignmentSorter.sortIdAscending = !jalview.analysis.AlignmentSorter.sortIdAscending;
+}, "jalview.datamodel.AlignmentI");
+c$.sortByLength = Clazz_defineMethod (c$, "sortByLength", 
+function (align) {
+var nSeq = align.getHeight ();
+var length =  Clazz_newFloatArray (nSeq, 0);
+var seqs =  new Array (nSeq);
+for (var i = 0; i < nSeq; i++) {
+seqs[i] = align.getSequenceAt (i);
+length[i] = (seqs[i].getEnd () - seqs[i].getStart ());
+}
+jalview.util.QuickSort.sortFloatObject (length, seqs);
+if (jalview.analysis.AlignmentSorter.sortLengthAscending) {
+jalview.analysis.AlignmentSorter.setReverseOrder (align, seqs);
+} else {
+jalview.analysis.AlignmentSorter.setOrder (align, seqs);
+}jalview.analysis.AlignmentSorter.sortLengthAscending = !jalview.analysis.AlignmentSorter.sortLengthAscending;
+}, "jalview.datamodel.AlignmentI");
+c$.sortByGroup = Clazz_defineMethod (c$, "sortByGroup", 
+function (align) {
+var groups =  new java.util.ArrayList ();
+if (groups.hashCode () != jalview.analysis.AlignmentSorter.lastGroupHash) {
+jalview.analysis.AlignmentSorter.sortGroupAscending = true;
+jalview.analysis.AlignmentSorter.lastGroupHash = groups.hashCode ();
+} else {
+jalview.analysis.AlignmentSorter.sortGroupAscending = !jalview.analysis.AlignmentSorter.sortGroupAscending;
+}for (var sg, $sg = align.getGroups ().iterator (); $sg.hasNext () && ((sg = $sg.next ()) || true);) {
+for (var j = 0; j < groups.size (); j++) {
+var sg2 = groups.get (j);
+if (sg.getSize () > sg2.getSize ()) {
+groups.add (j, sg);
+break;
+}}
+if (!groups.contains (sg)) {
+groups.add (sg);
+}}
+var seqs =  new java.util.ArrayList ();
+for (var i = 0; i < groups.size (); i++) {
+var sg = groups.get (i);
+var orderedseqs = sg.getSequencesInOrder (align);
+for (var j = 0; j < orderedseqs.length; j++) {
+seqs.add (orderedseqs[j]);
+}
+}
+if (jalview.analysis.AlignmentSorter.sortGroupAscending) {
+jalview.analysis.AlignmentSorter.setOrder (align, seqs);
+} else {
+jalview.analysis.AlignmentSorter.setReverseOrder (align, jalview.analysis.AlignmentSorter.vectorSubsetToArray (seqs, align.getSequences ()));
+}}, "jalview.datamodel.AlignmentI");
+c$.vectorSubsetToArray = Clazz_defineMethod (c$, "vectorSubsetToArray", 
+ function (tmp, mask) {
+var seqs =  new java.util.ArrayList ();
+var i;
+var idx;
+var tmask =  Clazz_newBooleanArray (mask.size (), false);
+for (i = 0; i < mask.size (); i++) {
+tmask[i] = true;
+}
+for (i = 0; i < tmp.size (); i++) {
+var sq = tmp.get (i);
+idx = mask.indexOf (sq);
+if (idx > -1 && tmask[idx]) {
+tmask[idx] = false;
+seqs.add (sq);
+}}
+for (i = 0; i < tmask.length; i++) {
+if (tmask[i]) {
+seqs.add (mask.get (i));
+}}
+return seqs.toArray ( new Array (seqs.size ()));
+}, "java.util.List,java.util.List");
+c$.sortBy = Clazz_defineMethod (c$, "sortBy", 
+function (align, order) {
+var tmp = order.getOrder ();
+if (jalview.analysis.AlignmentSorter.lastOrder === order) {
+jalview.analysis.AlignmentSorter.sortOrderAscending = !jalview.analysis.AlignmentSorter.sortOrderAscending;
+} else {
+jalview.analysis.AlignmentSorter.sortOrderAscending = true;
+}if (jalview.analysis.AlignmentSorter.sortOrderAscending) {
+jalview.analysis.AlignmentSorter.setOrder (align, tmp);
+} else {
+jalview.analysis.AlignmentSorter.setReverseOrder (align, jalview.analysis.AlignmentSorter.vectorSubsetToArray (tmp, align.getSequences ()));
+}}, "jalview.datamodel.AlignmentI,jalview.datamodel.AlignmentOrder");
+c$.getOrderByTree = Clazz_defineMethod (c$, "getOrderByTree", 
+ function (align, tree) {
+var nSeq = align.getHeight ();
+var tmp =  new java.util.ArrayList ();
+tmp = jalview.analysis.AlignmentSorter._sortByTree (tree.getTopNode (), tmp, align.getSequences ());
+if (tmp.size () != nSeq) {
+if (tmp.size () != nSeq) {
+jalview.analysis.AlignmentSorter.addStrays (align, tmp);
+}if (tmp.size () != nSeq) {
+System.err.println ("WARNING: tmp.size()=" + tmp.size () + " != nseq=" + nSeq + " in getOrderByTree - tree contains sequences not in alignment");
+}}return tmp;
+}, "jalview.datamodel.AlignmentI,jalview.analysis.NJTree");
+c$.sortByTree = Clazz_defineMethod (c$, "sortByTree", 
+function (align, tree) {
+var tmp = jalview.analysis.AlignmentSorter.getOrderByTree (align, tree);
+if (jalview.analysis.AlignmentSorter.lastTree !== tree) {
+jalview.analysis.AlignmentSorter.sortTreeAscending = true;
+jalview.analysis.AlignmentSorter.lastTree = tree;
+} else {
+jalview.analysis.AlignmentSorter.sortTreeAscending = !jalview.analysis.AlignmentSorter.sortTreeAscending;
+}if (jalview.analysis.AlignmentSorter.sortTreeAscending) {
+jalview.analysis.AlignmentSorter.setOrder (align, tmp);
+} else {
+jalview.analysis.AlignmentSorter.setReverseOrder (align, jalview.analysis.AlignmentSorter.vectorSubsetToArray (tmp, align.getSequences ()));
+}}, "jalview.datamodel.AlignmentI,jalview.analysis.NJTree");
+c$.addStrays = Clazz_defineMethod (c$, "addStrays", 
+ function (align, tmp) {
+var nSeq = align.getHeight ();
+for (var i = 0; i < nSeq; i++) {
+if (!tmp.contains (align.getSequenceAt (i))) {
+tmp.add (align.getSequenceAt (i));
+}}
+if (nSeq != tmp.size ()) {
+System.err.println ("ERROR: Size still not right even after addStrays");
+}}, "jalview.datamodel.AlignmentI,java.util.List");
+c$._sortByTree = Clazz_defineMethod (c$, "_sortByTree", 
+ function (node, tmp, seqset) {
+if (node == null) {
+return tmp;
+}var left = node.left ();
+var right = node.right ();
+if ((left == null) && (right == null)) {
+if (!node.isPlaceholder () && (node.element () != null)) {
+if (Clazz_instanceOf (node.element (), jalview.datamodel.SequenceI)) {
+if (!tmp.contains (node.element ())) {
+tmp.add (node.element ());
+}}}return tmp;
+} else {
+jalview.analysis.AlignmentSorter._sortByTree (left, tmp, seqset);
+jalview.analysis.AlignmentSorter._sortByTree (right, tmp, seqset);
+}return tmp;
+}, "jalview.datamodel.SequenceNode,java.util.List,java.util.List");
+c$.recoverOrder = Clazz_defineMethod (c$, "recoverOrder", 
+function (alignment) {
+var ids =  Clazz_newFloatArray (alignment.length, 0);
+for (var i = 0; i < alignment.length; i++) {
+ids[i] = ( new Float (alignment[i].getName ().substring (8))).floatValue ();
+}
+jalview.util.QuickSort.sortFloatObject (ids, alignment);
+}, "~A");
+c$.sortByAnnotationScore = Clazz_defineMethod (c$, "sortByAnnotationScore", 
+function (scoreLabel, alignment) {
+var seqs = alignment.getSequencesArray ();
+var hasScore =  Clazz_newBooleanArray (seqs.length, false);
+var hasScores = 0;
+var scores =  Clazz_newDoubleArray (seqs.length, 0);
+var min = 0;
+var max = 0;
+for (var i = 0; i < seqs.length; i++) {
+var scoreAnn = seqs[i].getAnnotation (scoreLabel);
+if (scoreAnn != null) {
+hasScores++;
+hasScore[i] = true;
+scores[i] = scoreAnn[0].getScore ();
+if (hasScores == 1) {
+max = min = scores[i];
+} else {
+if (max < scores[i]) {
+max = scores[i];
+}if (min > scores[i]) {
+min = scores[i];
+}}} else {
+hasScore[i] = false;
+}}
+if (hasScores == 0) {
+return;
+}if (hasScores < seqs.length) {
+for (var i = 0; i < seqs.length; i++) {
+if (!hasScore[i]) {
+scores[i] = (max + i + 1.0);
+}}
+}jalview.util.QuickSort.sortDouble (scores, seqs);
+if (jalview.analysis.AlignmentSorter.lastSortByScore !== scoreLabel) {
+jalview.analysis.AlignmentSorter.lastSortByScore = scoreLabel;
+jalview.analysis.AlignmentSorter.setOrder (alignment, seqs);
+} else {
+jalview.analysis.AlignmentSorter.setReverseOrder (alignment, seqs);
+}}, "~S,jalview.datamodel.AlignmentI");
+c$.sortByFeature = Clazz_defineMethod (c$, "sortByFeature", 
+function (featureLabel, groupLabel, start, stop, alignment, method) {
+jalview.analysis.AlignmentSorter.sortByFeature (featureLabel == null ? null :  Clazz_newArray (-1, [featureLabel]), groupLabel == null ? null :  Clazz_newArray (-1, [groupLabel]), start, stop, alignment, method);
+}, "~S,~S,~N,~N,jalview.datamodel.AlignmentI,~S");
+c$.containsIgnoreCase = Clazz_defineMethod (c$, "containsIgnoreCase", 
+ function (lab, labs) {
+if (labs == null) {
+return true;
+}if (lab == null) {
+return false;
+}for (var q = 0; q < labs.length; q++) {
+if (labs[q] != null && lab.equalsIgnoreCase (labs[q])) {
+return true;
+}}
+return false;
+}, "~S,~A");
+c$.sortByFeature = Clazz_defineMethod (c$, "sortByFeature", 
+function (featureLabels, groupLabels, start, stop, alignment, method) {
+if (method !== jalview.analysis.AlignmentSorter.FEATURE_SCORE && method !== jalview.analysis.AlignmentSorter.FEATURE_LABEL && method !== jalview.analysis.AlignmentSorter.FEATURE_DENSITY) {
+throw  new Error (jalview.util.MessageManager.getString ("error.implementation_error_sortbyfeature"));
+}var ignoreScore = method !== jalview.analysis.AlignmentSorter.FEATURE_SCORE;
+var scoreLabel =  new StringBuffer ();
+scoreLabel.append (start + stop + method);
+for (var i = 0; featureLabels != null && i < featureLabels.length; i++) {
+scoreLabel.append (featureLabels[i] == null ? "null" : featureLabels[i]);
+}
+for (var i = 0; groupLabels != null && i < groupLabels.length; i++) {
+scoreLabel.append (groupLabels[i] == null ? "null" : groupLabels[i]);
+}
+var seqs = alignment.getSequencesArray ();
+var hasScore =  Clazz_newBooleanArray (seqs.length, false);
+var hasScores = 0;
+var scores =  Clazz_newDoubleArray (seqs.length, 0);
+var seqScores =  Clazz_newIntArray (seqs.length, 0);
+var feats =  new Array (seqs.length);
+var min = 0;
+var max = 0;
+for (var i = 0; i < seqs.length; i++) {
+var sf = seqs[i].getSequenceFeatures ();
+if (sf == null) {
+sf =  new Array (0);
+} else {
+var tmp =  new Array (sf.length);
+for (var s = 0; s < tmp.length; s++) {
+tmp[s] = sf[s];
+}
+sf = tmp;
+}var sstart = (start == -1) ? start : seqs[i].findPosition (start);
+var sstop = (stop == -1) ? stop : seqs[i].findPosition (stop);
+seqScores[i] = 0;
+scores[i] = 0.0;
+var n = sf.length;
+for (var f = 0; f < sf.length; f++) {
+if ((sf[f].end < sstart || sf[f].begin > sstop) || (featureLabels != null && !jalview.analysis.AlignmentSorter.containsIgnoreCase (sf[f].type, featureLabels)) || (groupLabels != null && (sf[f].getFeatureGroup () != null && !jalview.analysis.AlignmentSorter.containsIgnoreCase (sf[f].getFeatureGroup (), groupLabels)))) {
+sf[f] = null;
+n--;
+} else {
+if (!ignoreScore && !Float.isNaN (sf[f].getScore ())) {
+if (seqScores[i] == 0) {
+hasScores++;
+}seqScores[i]++;
+hasScore[i] = true;
+scores[i] += sf[f].getScore ();
+}}}
+var fs;
+feats[i] = fs =  new Array (n);
+if (n > 0) {
+n = 0;
+for (var f = 0; f < sf.length; f++) {
+if (sf[f] != null) {
+(feats[i])[n++] = sf[f];
+}}
+if (method === jalview.analysis.AlignmentSorter.FEATURE_LABEL) {
+var labs =  new Array (fs.length);
+for (var l = 0; l < labs.length; l++) {
+labs[l] = (fs[l].getDescription () != null ? fs[l].getDescription () : fs[l].getType ());
+}
+jalview.util.QuickSort.sort (labs, (feats[i]));
+}}if (hasScore[i]) {
+scores[i] /= seqScores[i];
+if (hasScores == 1) {
+max = min = scores[i];
+} else {
+if (max < scores[i]) {
+max = scores[i];
+}if (min > scores[i]) {
+min = scores[i];
+}}}}
+if (method === jalview.analysis.AlignmentSorter.FEATURE_SCORE) {
+if (hasScores == 0) {
+return;
+}if (hasScores < seqs.length) {
+for (var i = 0; i < seqs.length; i++) {
+if (!hasScore[i]) {
+scores[i] = (max + 1 + i);
+} else {
+var nf = (feats[i] == null) ? 0 : (feats[i]).length;
+}}
+}jalview.util.QuickSort.sortDouble (scores, seqs);
+} else if (method === jalview.analysis.AlignmentSorter.FEATURE_DENSITY) {
+var fr = 0.9 / (1.0 * seqs.length);
+for (var i = 0; i < seqs.length; i++) {
+var nf;
+scores[i] = (0.05 + fr * i) + (nf = ((feats[i] == null) ? 0.0 : 1.0 * (feats[i]).length));
+}
+jalview.util.QuickSort.sortDouble (scores, seqs);
+} else {
+if (method === jalview.analysis.AlignmentSorter.FEATURE_LABEL) {
+throw  new Error (jalview.util.MessageManager.getString ("error.not_yet_implemented"));
+}}if (jalview.analysis.AlignmentSorter.lastSortByFeatureScore == null || !scoreLabel.toString ().equals (jalview.analysis.AlignmentSorter.lastSortByFeatureScore)) {
+jalview.analysis.AlignmentSorter.sortByFeatureScoreAscending = true;
+} else {
+jalview.analysis.AlignmentSorter.sortByFeatureScoreAscending = !jalview.analysis.AlignmentSorter.sortByFeatureScoreAscending;
+}if (jalview.analysis.AlignmentSorter.sortByFeatureScoreAscending) {
+jalview.analysis.AlignmentSorter.setOrder (alignment, seqs);
+} else {
+jalview.analysis.AlignmentSorter.setReverseOrder (alignment, seqs);
+}jalview.analysis.AlignmentSorter.lastSortByFeatureScore = scoreLabel.toString ();
+}, "~A,~A,~N,~N,jalview.datamodel.AlignmentI,~S");
+Clazz_defineStatics (c$,
+"sortIdAscending", true,
+"lastGroupHash", 0,
+"sortGroupAscending", true,
+"lastOrder", null,
+"sortOrderAscending", true,
+"lastTree", null,
+"sortTreeAscending", true,
+"lastSortByScore", null,
+"sortByScoreAscending", true,
+"lastSortByFeatureScore", null,
+"sortByFeatureScoreAscending", true,
+"sortLengthAscending", false,
+"FEATURE_SCORE", "average_score",
+"FEATURE_LABEL", "text",
+"FEATURE_DENSITY", "density");
+});
+Clazz_declarePackage ("jalview.datamodel");
+Clazz_load (["jalview.datamodel.ASequenceI"], "jalview.datamodel.SequenceI", null, function () {
+Clazz_declareInterface (jalview.datamodel, "SequenceI", jalview.datamodel.ASequenceI);
+});
+Clazz_declarePackage ("jalview.datamodel");
+Clazz_declareInterface (jalview.datamodel, "ASequenceI");
+Clazz_declarePackage ("jalview.util");
+Clazz_load (null, "jalview.util.Comparison", ["java.util.ArrayList"], function () {
+c$ = Clazz_declareType (jalview.util, "Comparison");
+c$.compare = Clazz_defineMethod (c$, "compare", 
+function (ii, jj) {
+return jalview.util.Comparison.compare (ii, jj, 0, ii.getLength () - 1);
+}, "jalview.datamodel.SequenceI,jalview.datamodel.SequenceI");
+c$.compare = Clazz_defineMethod (c$, "compare", 
+function (ii, jj, start, end) {
+var si = ii.getSequenceAsString ();
+var sj = jj.getSequenceAsString ();
+var ilen = si.length - 1;
+var jlen = sj.length - 1;
+while (jalview.util.Comparison.isGap (si.charAt (start + ilen))) {
+ilen--;
+}
+while (jalview.util.Comparison.isGap (sj.charAt (start + jlen))) {
+jlen--;
+}
+var count = 0;
+var match = 0;
+var pid = -1;
+if (ilen > jlen) {
+for (var j = 0; j < jlen; j++) {
+if (si.substring (start + j, start + j + 1).equals (sj.substring (start + j, start + j + 1))) {
+match++;
+}count++;
+}
+pid = match / ilen * 100;
+} else {
+for (var j = 0; j < jlen; j++) {
+if (si.substring (start + j, start + j + 1).equals (sj.substring (start + j, start + j + 1))) {
+match++;
+}count++;
+}
+pid = match / jlen * 100;
+}return pid;
+}, "jalview.datamodel.SequenceI,jalview.datamodel.SequenceI,~N,~N");
+c$.PID = Clazz_defineMethod (c$, "PID", 
+function (seq1, seq2) {
+return jalview.util.Comparison.PID (seq1, seq2, 0, seq1.length);
+}, "~S,~S");
+c$.PID = Clazz_defineMethod (c$, "PID", 
+function (seq1, seq2, start, end) {
+return jalview.util.Comparison.PID (seq1, seq2, start, end, true, false);
+}, "~S,~S,~N,~N");
+c$.PID = Clazz_defineMethod (c$, "PID", 
+function (seq1, seq2, start, end, wcGaps, ungappedOnly) {
+var s1len = seq1.length;
+var s2len = seq2.length;
+var len = Math.min (s1len, s2len);
+if (end < len) {
+len = end;
+}if (len < start) {
+start = len - 1;
+}var elen = len - start;
+var bad = 0;
+var chr1;
+var chr2;
+var agap;
+for (var i = start; i < len; i++) {
+chr1 = seq1.charAt (i);
+chr2 = seq2.charAt (i);
+agap = jalview.util.Comparison.isGap (chr1) || jalview.util.Comparison.isGap (chr2);
+if ('a' <= chr1 && chr1 <= 'z') {
+chr1 = String.fromCharCode (chr1.charCodeAt (0) - 32);
+}if ('a' <= chr2 && chr2 <= 'z') {
+chr2 = String.fromCharCode (chr2.charCodeAt (0) - 32);
+}if (chr1 != chr2) {
+if (agap) {
+if (ungappedOnly) {
+elen--;
+} else if (!wcGaps) {
+bad++;
+}} else {
+bad++;
+}}}
+if (elen < 1) {
+return 0;
+}return (100 * (elen - bad)) / elen;
+}, "~S,~S,~N,~N,~B,~B");
+c$.isGap = Clazz_defineMethod (c$, "isGap", 
+function (c) {
+return (c == '-' || c == '.' || c == ' ') ? true : false;
+}, "~S");
+c$.isNucleotide = Clazz_defineMethod (c$, "isNucleotide", 
+function (seqs) {
+if (seqs == null) {
+return false;
+}var ntCount = 0;
+var aaCount = 0;
+for (var seq, $seq = 0, $$seq = seqs; $seq < $$seq.length && ((seq = $$seq[$seq]) || true); $seq++) {
+if (seq == null) {
+continue;
+}for (var c, $c = 0, $$c = seq.getSequence (); $c < $$c.length && ((c = $$c[$c]) || true); $c++) {
+if ('a' <= c && c <= 'z') {
+c = String.fromCharCode (c.charCodeAt (0) - 32);
+}if (c == 'A' || c == 'G' || c == 'C' || c == 'T' || c == 'U') {
+ntCount++;
+} else if (!jalview.util.Comparison.isGap (c)) {
+aaCount++;
+}}
+}
+if (ntCount * 100 > 85 * (ntCount + aaCount)) {
+return true;
+} else {
+return false;
+}}, "~A");
+c$.isNucleotide2 = Clazz_defineMethod (c$, "isNucleotide2", 
+function (seqs) {
+if (seqs == null) {
+return false;
+}var flattened =  new java.util.ArrayList ();
+for (var ss, $ss = 0, $$ss = seqs; $ss < $$ss.length && ((ss = $$ss[$ss]) || true); $ss++) {
+for (var s, $s = 0, $$s = ss; $s < $$s.length && ((s = $$s[$s]) || true); $s++) {
+flattened.add (s);
+}
+}
+var oneDArray = flattened.toArray ( new Array (flattened.size ()));
+return jalview.util.Comparison.isNucleotide (oneDArray);
+}, "~A");
+Clazz_defineStatics (c$,
+"EIGHTY_FIVE", 85,
+"TO_UPPER_CASE", 32,
+"GAP_SPACE", ' ',
+"GAP_DOT", '.',
+"GAP_DASH", '-');
+c$.GapChars = c$.prototype.GapChars =  String.instantialize ( Clazz_newCharArray (-1, [' ', '.', '-']));
+Clazz_defineStatics (c$,
+"caseShift", 32);
+});
+Clazz_declarePackage ("jalview.util");
+Clazz_load (null, "jalview.util.QuickSort", ["java.lang.Float", "java.util.Arrays"], function () {
+c$ = Clazz_declareType (jalview.util, "QuickSort");
+c$.sortInt = Clazz_defineMethod (c$, "sortInt", 
+function (arr, s) {
+jalview.util.QuickSort.sortInt (arr, 0, arr.length - 1, s);
+}, "~A,~A");
+c$.sortFloatObject = Clazz_defineMethod (c$, "sortFloatObject", 
+function (arr, s) {
+jalview.util.QuickSort.sortFloat (arr, 0, arr.length - 1, s);
+}, "~A,~A");
+c$.sortDouble = Clazz_defineMethod (c$, "sortDouble", 
+function (arr, s) {
+jalview.util.QuickSort.sortDouble (arr, 0, arr.length - 1, s);
+}, "~A,~A");
+c$.sort = Clazz_defineMethod (c$, "sort", 
+function (arr, s) {
+jalview.util.QuickSort.stringSort (arr, 0, arr.length - 1, s);
+}, "~A,~A");
+c$.stringSort = Clazz_defineMethod (c$, "stringSort", 
+ function (arr, p, r, s) {
+var q;
+if (p < r) {
+q = jalview.util.QuickSort.stringPartition (arr, p, r, s);
+jalview.util.QuickSort.stringSort (arr, p, q, s);
+jalview.util.QuickSort.stringSort (arr, q + 1, r, s);
+}}, "~A,~N,~N,~A");
+c$.sortFloat = Clazz_defineMethod (c$, "sortFloat", 
+ function (arr, p, r, s) {
+var q;
+if (p < r) {
+q = jalview.util.QuickSort.partitionFloat (arr, p, r, s);
+jalview.util.QuickSort.sortFloat (arr, p, q, s);
+jalview.util.QuickSort.sortFloat (arr, q + 1, r, s);
+}}, "~A,~N,~N,~A");
+c$.sortInt = Clazz_defineMethod (c$, "sortInt", 
+ function (arr, p, r, s) {
+var q;
+if (p < r) {
+q = jalview.util.QuickSort.partitionInt (arr, p, r, s);
+jalview.util.QuickSort.sortInt (arr, p, q, s);
+jalview.util.QuickSort.sortInt (arr, q + 1, r, s);
+}}, "~A,~N,~N,~A");
+c$.partitionFloat = Clazz_defineMethod (c$, "partitionFloat", 
+ function (arr, p, r, s) {
+var x = arr[p];
+var i = p - 1;
+var j = r + 1;
+while (true) {
+do {
+j = j - 1;
+} while (arr[j] > x);
+do {
+i = i + 1;
+} while (arr[i] < x);
+if (i < j) {
+var tmp = arr[i];
+arr[i] = arr[j];
+arr[j] = tmp;
+var tmp2 = s[i];
+s[i] = s[j];
+s[j] = tmp2;
+} else {
+return j;
+}}
+}, "~A,~N,~N,~A");
+c$.partitionInt = Clazz_defineMethod (c$, "partitionInt", 
+ function (arr, p, r, s) {
+var x = arr[p];
+var i = p - 1;
+var j = r + 1;
+while (true) {
+do {
+j = j - 1;
+} while (arr[j] > x);
+do {
+i = i + 1;
+} while (arr[i] < x);
+if (i < j) {
+var tmp = arr[i];
+arr[i] = arr[j];
+arr[j] = tmp;
+var tmp2 = s[i];
+s[i] = s[j];
+s[j] = tmp2;
+} else {
+return j;
+}}
+}, "~A,~N,~N,~A");
+c$.stringPartition = Clazz_defineMethod (c$, "stringPartition", 
+ function (arr, p, r, s) {
+var x = arr[p];
+var i = p - 1;
+var j = r + 1;
+while (true) {
+do {
+j = j - 1;
+} while (arr[j].compareTo (x) < 0);
+do {
+i = i + 1;
+} while (arr[i].compareTo (x) > 0);
+if (i < j) {
+var tmp = arr[i];
+arr[i] = arr[j];
+arr[j] = tmp;
+var tmp2 = s[i];
+s[i] = s[j];
+s[j] = tmp2;
+} else {
+return j;
+}}
+}, "~A,~N,~N,~A");
+c$.sortFloatChar = Clazz_defineMethod (c$, "sortFloatChar", 
+function (arr, s) {
+var f1 =  Clazz_newFloatArray (arr.length, 0);
+var s1 =  Clazz_newCharArray (s.length, '\0');
+var nextZeroValue = 0;
+var nextNonZeroValue = arr.length - 1;
+for (var i = 0; i < arr.length; i++) {
+var val = arr[i];
+if (val > 0) {
+f1[nextNonZeroValue] = val;
+s1[nextNonZeroValue] = s[i];
+nextNonZeroValue--;
+} else {
+f1[nextZeroValue] = val;
+s1[nextZeroValue] = s[i];
+nextZeroValue++;
+}}
+System.arraycopy (f1, 0, arr, 0, nextZeroValue);
+System.arraycopy (s1, 0, s, 0, nextZeroValue);
+if (nextZeroValue == arr.length) {
+return;
+}var nonZeroFloats = java.util.Arrays.copyOfRange (f1, nextZeroValue, f1.length);
+var nonZeroChars = java.util.Arrays.copyOfRange (s1, nextZeroValue, s1.length);
+jalview.util.QuickSort.externalSortFloat (nonZeroFloats, nonZeroChars);
+System.arraycopy (nonZeroFloats, 0, arr, nextZeroValue, nonZeroFloats.length);
+System.arraycopy (nonZeroChars, 0, s, nextZeroValue, nonZeroChars.length);
+}, "~A,~A");
+c$.externalSortFloat = Clazz_defineMethod (c$, "externalSortFloat", 
+ function (arr, s) {
+var length = arr.length;
+var indices = jalview.util.QuickSort.makeIndexArray (length);
+java.util.Arrays.sort (indices,  new jalview.util.QuickSort.FloatComparator (arr));
+var sortedFloats =  Clazz_newFloatArray (length, 0);
+var sortedChars =  Clazz_newCharArray (s.length, '\0');
+for (var i = 0; i < length; i++) {
+sortedFloats[i] = arr[indices[i]];
+sortedChars[i] = s[indices[i]];
+}
+System.arraycopy (sortedFloats, 0, arr, 0, length);
+System.arraycopy (sortedChars, 0, s, 0, s.length);
+}, "~A,~A");
+c$.makeIndexArray = Clazz_defineMethod (c$, "makeIndexArray", 
+ function (length) {
+var indices =  new Array (length);
+for (var i = 0; i < length; i++) {
+indices[i] = new Integer (i);
+}
+return indices;
+}, "~N");
+c$.sortIntChar = Clazz_defineMethod (c$, "sortIntChar", 
+function (arr, s) {
+var f1 =  Clazz_newIntArray (arr.length, 0);
+var s1 =  Clazz_newCharArray (s.length, '\0');
+var nextZeroValue = 0;
+var nextNonZeroValue = arr.length - 1;
+for (var i = 0; i < arr.length; i++) {
+var val = arr[i];
+if (val > 0) {
+f1[nextNonZeroValue] = val;
+s1[nextNonZeroValue] = s[i];
+nextNonZeroValue--;
+} else {
+f1[nextZeroValue] = val;
+s1[nextZeroValue] = s[i];
+nextZeroValue++;
+}}
+System.arraycopy (f1, 0, arr, 0, nextZeroValue);
+System.arraycopy (s1, 0, s, 0, nextZeroValue);
+if (nextZeroValue == arr.length) {
+return;
+}var nonZeroInts = java.util.Arrays.copyOfRange (f1, nextZeroValue, f1.length);
+var nonZeroChars = java.util.Arrays.copyOfRange (s1, nextZeroValue, s1.length);
+jalview.util.QuickSort.externalSortInt (nonZeroInts, nonZeroChars);
+System.arraycopy (nonZeroInts, 0, arr, nextZeroValue, nonZeroInts.length);
+System.arraycopy (nonZeroChars, 0, s, nextZeroValue, nonZeroChars.length);
+}, "~A,~A");
+c$.externalSortInt = Clazz_defineMethod (c$, "externalSortInt", 
+ function (arr, s) {
+var length = arr.length;
+var indices = jalview.util.QuickSort.makeIndexArray (length);
+java.util.Arrays.sort (indices,  new jalview.util.QuickSort.IntComparator (arr));
+var sortedInts =  Clazz_newIntArray (length, 0);
+var sortedChars =  Clazz_newCharArray (s.length, '\0');
+for (var i = 0; i < length; i++) {
+sortedInts[i] = arr[indices[i]];
+sortedChars[i] = s[indices[i]];
+}
+System.arraycopy (sortedInts, 0, arr, 0, length);
+System.arraycopy (sortedChars, 0, s, 0, s.length);
+}, "~A,~A");
+Clazz_pu$h(self.c$);
+c$ = Clazz_decorateAsClass (function () {
+this.values = null;
+Clazz_instantialize (this, arguments);
+}, jalview.util.QuickSort, "FloatComparator", null, java.util.Comparator);
+Clazz_makeConstructor (c$, 
+function (a) {
+this.values = a;
+}, "~A");
+Clazz_overrideMethod (c$, "compare", 
+function (a, b) {
+return Float.compare (this.values[a.intValue ()], this.values[b]);
+}, "Integer,Integer");
+c$ = Clazz_p0p ();
+Clazz_pu$h(self.c$);
+c$ = Clazz_decorateAsClass (function () {
+this.values = null;
+Clazz_instantialize (this, arguments);
+}, jalview.util.QuickSort, "IntComparator", null, java.util.Comparator);
+Clazz_makeConstructor (c$, 
+function (a) {
+this.values = a;
+}, "~A");
+Clazz_overrideMethod (c$, "compare", 
+function (a, b) {
+return Integer.compare (this.values[a], this.values[b]);
+}, "Integer,Integer");
+c$ = Clazz_p0p ();
+});
+Clazz_declarePackage ("jalview.analysis");
+Clazz_load (["java.lang.Enum", "java.util.HashMap"], "jalview.analysis.AnnotationSorter", ["jalview.analysis.AlignmentUtils", "java.lang.UnsupportedOperationException", "java.util.Arrays"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.alignment = null;
+this.showAutocalcAbove = false;
+this.sequenceIndices = null;
+this.bySequenceAndLabel = null;
+this.byLabelAndSequence = null;
+this.noSort = null;
+Clazz_instantialize (this, arguments);
+}, jalview.analysis, "AnnotationSorter");
+Clazz_prepareFields (c$, function () {
+this.sequenceIndices =  new java.util.HashMap ();
+this.bySequenceAndLabel = ((Clazz_isClassDefined ("jalview.analysis.AnnotationSorter$1") ? 0 : jalview.analysis.AnnotationSorter.$AnnotationSorter$1$ ()), Clazz_innerTypeInstance (jalview.analysis.AnnotationSorter$1, this, null));
+this.byLabelAndSequence = ((Clazz_isClassDefined ("jalview.analysis.AnnotationSorter$2") ? 0 : jalview.analysis.AnnotationSorter.$AnnotationSorter$2$ ()), Clazz_innerTypeInstance (jalview.analysis.AnnotationSorter$2, this, null));
+this.noSort = ((Clazz_isClassDefined ("jalview.analysis.AnnotationSorter$3") ? 0 : jalview.analysis.AnnotationSorter.$AnnotationSorter$3$ ()), Clazz_innerTypeInstance (jalview.analysis.AnnotationSorter$3, this, null));
+});
+Clazz_makeConstructor (c$, 
+function (alignmentI, showAutocalculatedAbove) {
+this.alignment = alignmentI;
+this.showAutocalcAbove = showAutocalculatedAbove;
+}, "jalview.datamodel.AlignmentI,~B");
+Clazz_defineMethod (c$, "sort", 
+function (alignmentAnnotations, order) {
+if (alignmentAnnotations == null) {
+return;
+}this.saveSequenceIndices (alignmentAnnotations);
+var comparator = this.getComparator (order);
+if (alignmentAnnotations != null) {
+{
+java.util.Arrays.sort (alignmentAnnotations, comparator);
+}}}, "~A,jalview.analysis.AnnotationSorter.SequenceAnnotationOrder");
+Clazz_defineMethod (c$, "saveSequenceIndices", 
+ function (alignmentAnnotations) {
+this.sequenceIndices.clear ();
+for (var ann, $ann = 0, $$ann = alignmentAnnotations; $ann < $$ann.length && ((ann = $$ann[$ann]) || true); $ann++) {
+var seq = ann.sequenceRef;
+if (seq != null) {
+var index = jalview.analysis.AlignmentUtils.getSequenceIndex (this.alignment, seq);
+this.sequenceIndices.put (seq, new Integer (index));
+}}
+}, "~A");
+Clazz_defineMethod (c$, "getComparator", 
+ function (order) {
+if (order == null) {
+return this.noSort;
+}switch (order) {
+case jalview.analysis.AnnotationSorter.SequenceAnnotationOrder.NONE:
+return this.noSort;
+case jalview.analysis.AnnotationSorter.SequenceAnnotationOrder.SEQUENCE_AND_LABEL:
+return this.bySequenceAndLabel;
+case jalview.analysis.AnnotationSorter.SequenceAnnotationOrder.LABEL_AND_SEQUENCE:
+return this.byLabelAndSequence;
+default:
+throw  new UnsupportedOperationException (order.toString ());
+}
+}, "jalview.analysis.AnnotationSorter.SequenceAnnotationOrder");
+Clazz_defineMethod (c$, "compareLabels", 
+ function (o1, o2) {
+if (o1 == null || o2 == null) {
+return 0;
+}var label1 = o1.label;
+var label2 = o2.label;
+if (label1 == null && label2 == null) {
+return 0;
+}if (label1 == null) {
+return -1;
+}if (label2 == null) {
+return 1;
+}return label1.toUpperCase ().compareTo (label2.toUpperCase ());
+}, "jalview.datamodel.AlignmentAnnotation,jalview.datamodel.AlignmentAnnotation");
+Clazz_defineMethod (c$, "compareSequences", 
+ function (o1, o2) {
+var seq1 = o1.sequenceRef;
+var seq2 = o2.sequenceRef;
+if (seq1 == null && seq2 == null) {
+return 0;
+}if (seq1 == null) {
+return this.showAutocalcAbove ? -1 : 1;
+}if (seq2 == null) {
+return this.showAutocalcAbove ? 1 : -1;
+}var index1 = (this.sequenceIndices.get (seq1)).intValue ();
+var index2 = (this.sequenceIndices.get (seq2)).intValue ();
+if (index1 == index2) {
+return 0;
+}if (index1 == -1) {
+return -1;
+}if (index2 == -1) {
+return 1;
+}return Integer.compare (index1, index2);
+}, "jalview.datamodel.AlignmentAnnotation,jalview.datamodel.AlignmentAnnotation");
+c$.$AnnotationSorter$1$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_declareAnonymous (jalview.analysis, "AnnotationSorter$1", null, java.util.Comparator);
+Clazz_overrideMethod (c$, "compare", 
+function (o1, o2) {
+if (o1 == null && o2 == null) {
+return 0;
+}if (o1 == null) {
+return -1;
+}if (o2 == null) {
+return 1;
+}if (o1.sequenceRef == null && o2.sequenceRef == null) {
+return 0;
+}var sequenceOrder = this.b$["jalview.analysis.AnnotationSorter"].compareSequences (o1, o2);
+return sequenceOrder == 0 ? this.b$["jalview.analysis.AnnotationSorter"].compareLabels (o1, o2) : sequenceOrder;
+}, "jalview.datamodel.AlignmentAnnotation,jalview.datamodel.AlignmentAnnotation");
+c$ = Clazz_p0p ();
+};
+c$.$AnnotationSorter$2$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_declareAnonymous (jalview.analysis, "AnnotationSorter$2", null, java.util.Comparator);
+Clazz_overrideMethod (c$, "compare", 
+function (o1, o2) {
+if (o1 == null && o2 == null) {
+return 0;
+}if (o1 == null) {
+return -1;
+}if (o2 == null) {
+return 1;
+}if (o1.sequenceRef == null && o2.sequenceRef == null) {
+return 0;
+}if (o1.sequenceRef == null) {
+return this.b$["jalview.analysis.AnnotationSorter"].showAutocalcAbove ? -1 : 1;
+}if (o2.sequenceRef == null) {
+return this.b$["jalview.analysis.AnnotationSorter"].showAutocalcAbove ? 1 : -1;
+}var labelOrder = this.b$["jalview.analysis.AnnotationSorter"].compareLabels (o1, o2);
+return labelOrder == 0 ? this.b$["jalview.analysis.AnnotationSorter"].compareSequences (o1, o2) : labelOrder;
+}, "jalview.datamodel.AlignmentAnnotation,jalview.datamodel.AlignmentAnnotation");
+c$ = Clazz_p0p ();
+};
+c$.$AnnotationSorter$3$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_declareAnonymous (jalview.analysis, "AnnotationSorter$3", null, java.util.Comparator);
+Clazz_overrideMethod (c$, "compare", 
+function (o1, o2) {
+if (o1 != null && o2 != null) {
+if (o1.sequenceRef == null && o2.sequenceRef != null) {
+return this.b$["jalview.analysis.AnnotationSorter"].showAutocalcAbove ? -1 : 1;
+}if (o1.sequenceRef != null && o2.sequenceRef == null) {
+return this.b$["jalview.analysis.AnnotationSorter"].showAutocalcAbove ? 1 : -1;
+}}return 0;
+}, "jalview.datamodel.AlignmentAnnotation,jalview.datamodel.AlignmentAnnotation");
+c$ = Clazz_p0p ();
+};
+Clazz_pu$h(self.c$);
+c$ = Clazz_decorateAsClass (function () {
+this.description = null;
+Clazz_instantialize (this, arguments);
+}, jalview.analysis.AnnotationSorter, "SequenceAnnotationOrder", Enum);
+Clazz_makeConstructor (c$, 
+ function (a) {
+this.description = a;
+}, "~S");
+Clazz_overrideMethod (c$, "toString", 
+function () {
+return this.description;
+});
+c$.forDescription = Clazz_defineMethod (c$, "forDescription", 
+function (a) {
+for (var order, $order = 0, $$order = jalview.analysis.AnnotationSorter.SequenceAnnotationOrder.values (); $order < $$order.length && ((order = $$order[$order]) || true); $order++) {
+if (order.toString ().equals (a)) {
+return order;
+}}
+return null;
+}, "~S");
+Clazz_defineEnumConstant (c$, "SEQUENCE_AND_LABEL", 0, ["Sequence"]);
+Clazz_defineEnumConstant (c$, "LABEL_AND_SEQUENCE", 1, ["Label"]);
+Clazz_defineEnumConstant (c$, "NONE", 2, ["No sort"]);
+c$ = Clazz_p0p ();
+});
+Clazz_declarePackage ("jalview.analysis");
+Clazz_load (null, "jalview.analysis.AlignmentUtils", ["jalview.analysis.CodonComparator", "jalview.datamodel.AlignedCodonFrame", "$.Alignment", "$.AlignmentAnnotation", "$.DBRefEntry", "$.DBRefSource", "$.FeatureProperties", "$.SearchResults", "$.Sequence", "jalview.schemes.ResidueProperties", "jalview.util.DBRefUtils", "$.MapList", "$.MappingUtils", "java.lang.StringBuilder", "java.util.ArrayList", "$.Arrays", "$.HashMap", "$.HashSet", "$.LinkedHashMap", "$.LinkedHashSet", "$.TreeMap"], function () {
+c$ = Clazz_declareType (jalview.analysis, "AlignmentUtils");
+c$.expandContext = Clazz_defineMethod (c$, "expandContext", 
+function (core, flankSize) {
+var sq =  new java.util.ArrayList ();
+var maxoffset = 0;
+for (var s, $s = core.getSequences ().iterator (); $s.hasNext () && ((s = $s.next ()) || true);) {
+var newSeq = s.deriveSequence ();
+var newSeqStart = newSeq.getStart () - 1;
+if (newSeqStart > maxoffset && newSeq.getDatasetSequence ().getStart () < s.getStart ()) {
+maxoffset = newSeqStart;
+}sq.add (newSeq);
+}
+if (flankSize > -1) {
+maxoffset = Math.min (maxoffset, flankSize);
+}for (var s, $s = sq.iterator (); $s.hasNext () && ((s = $s.next ()) || true);) {
+var ds = s;
+while (ds.getDatasetSequence () != null) {
+ds = ds.getDatasetSequence ();
+}
+var s_end = s.findPosition (s.getStart () + s.getLength ());
+var ustream_ds = s.getStart () - ds.getStart ();
+var dstream_ds = ds.getEnd () - s_end;
+var offset = maxoffset - ustream_ds;
+if (flankSize >= 0) {
+if (flankSize < ustream_ds) {
+offset = maxoffset - flankSize;
+ustream_ds = flankSize;
+}if (flankSize <= dstream_ds) {
+dstream_ds = flankSize - 1;
+}}var upstream =  String.instantialize (ds.getSequence (s.getStart () - 1 - ustream_ds, s.getStart () - 1)).toLowerCase ().toCharArray ();
+var downstream =  String.instantialize (ds.getSequence (s_end - 1, s_end + dstream_ds)).toLowerCase ().toCharArray ();
+var coreseq = s.getSequence ();
+var nseq =  Clazz_newCharArray (offset + upstream.length + downstream.length + coreseq.length, '\0');
+var c = core.getGapCharacter ();
+var p = 0;
+for (; p < offset; p++) {
+nseq[p] = c;
+}
+System.arraycopy (upstream, 0, nseq, p, upstream.length);
+System.arraycopy (coreseq, 0, nseq, p + upstream.length, coreseq.length);
+System.arraycopy (downstream, 0, nseq, p + coreseq.length + upstream.length, downstream.length);
+s.setSequence ( String.instantialize (nseq));
+s.setStart (s.getStart () - ustream_ds);
+s.setEnd (s_end + downstream.length);
+}
+var newAl =  new jalview.datamodel.Alignment (sq.toArray ( new Array (0)));
+for (var s, $s = sq.iterator (); $s.hasNext () && ((s = $s.next ()) || true);) {
+if (s.getAnnotation () != null) {
+for (var aa, $aa = 0, $$aa = s.getAnnotation (); $aa < $$aa.length && ((aa = $$aa[$aa]) || true); $aa++) {
+aa.adjustForAlignment ();
+newAl.addAnnotation (aa);
+}
+}}
+newAl.setDataset (core.getDataset ());
+return newAl;
+}, "jalview.datamodel.AlignmentI,~N");
+c$.getSequenceIndex = Clazz_defineMethod (c$, "getSequenceIndex", 
+function (al, seq) {
+var result = -1;
+var pos = 0;
+for (var alSeq, $alSeq = al.getSequences ().iterator (); $alSeq.hasNext () && ((alSeq = $alSeq.next ()) || true);) {
+if (alSeq === seq) {
+result = pos;
+break;
+}pos++;
+}
+return result;
+}, "jalview.datamodel.AlignmentI,jalview.datamodel.SequenceI");
+c$.getSequencesByName = Clazz_defineMethod (c$, "getSequencesByName", 
+function (al) {
+var theMap =  new java.util.LinkedHashMap ();
+for (var seq, $seq = al.getSequences ().iterator (); $seq.hasNext () && ((seq = $seq.next ()) || true);) {
+var name = seq.getName ();
+if (name != null) {
+var seqs = theMap.get (name);
+if (seqs == null) {
+seqs =  new java.util.ArrayList ();
+theMap.put (name, seqs);
+}seqs.add (seq);
+}}
+return theMap;
+}, "jalview.datamodel.AlignmentI");
+c$.mapProteinToCdna = Clazz_defineMethod (c$, "mapProteinToCdna", 
+function (proteinAlignment, cdnaAlignment) {
+if (proteinAlignment == null || cdnaAlignment == null) {
+return false;
+}var mappedDna =  new java.util.HashSet ();
+var mappedProtein =  new java.util.HashSet ();
+var mappingPerformed = jalview.analysis.AlignmentUtils.mapProteinToCdna (proteinAlignment, cdnaAlignment, mappedDna, mappedProtein, true);
+mappingPerformed = new Boolean (mappingPerformed | jalview.analysis.AlignmentUtils.mapProteinToCdna (proteinAlignment, cdnaAlignment, mappedDna, mappedProtein, false)).valueOf ();
+return mappingPerformed;
+}, "jalview.datamodel.AlignmentI,jalview.datamodel.AlignmentI");
+c$.mapProteinToCdna = Clazz_defineMethod (c$, "mapProteinToCdna", 
+function (proteinAlignment, cdnaAlignment, mappedDna, mappedProtein, xrefsOnly) {
+var mappingPerformed = false;
+var thisSeqs = proteinAlignment.getSequences ();
+for (var aaSeq, $aaSeq = thisSeqs.iterator (); $aaSeq.hasNext () && ((aaSeq = $aaSeq.next ()) || true);) {
+var proteinMapped = false;
+var acf =  new jalview.datamodel.AlignedCodonFrame ();
+for (var cdnaSeq, $cdnaSeq = cdnaAlignment.getSequences ().iterator (); $cdnaSeq.hasNext () && ((cdnaSeq = $cdnaSeq.next ()) || true);) {
+if (xrefsOnly && !jalview.analysis.AlignmentUtils.haveCrossRef (aaSeq, cdnaSeq)) {
+continue;
+}if (!xrefsOnly && (mappedProtein.contains (aaSeq) || mappedDna.contains (cdnaSeq))) {
+continue;
+}if (!jalview.analysis.AlignmentUtils.mappingExists (proteinAlignment.getCodonFrames (), aaSeq.getDatasetSequence (), cdnaSeq.getDatasetSequence ())) {
+var map = jalview.analysis.AlignmentUtils.mapProteinToCdna (aaSeq, cdnaSeq);
+if (map != null) {
+acf.addMap (cdnaSeq, aaSeq, map);
+mappingPerformed = true;
+proteinMapped = true;
+mappedDna.add (cdnaSeq);
+mappedProtein.add (aaSeq);
+}}}
+if (proteinMapped) {
+proteinAlignment.addCodonFrame (acf);
+}}
+return mappingPerformed;
+}, "jalview.datamodel.AlignmentI,jalview.datamodel.AlignmentI,java.util.Set,java.util.Set,~B");
+c$.mappingExists = Clazz_defineMethod (c$, "mappingExists", 
+function (set, aaSeq, cdnaSeq) {
+if (set != null) {
+for (var acf, $acf = set.iterator (); $acf.hasNext () && ((acf = $acf.next ()) || true);) {
+if (cdnaSeq === acf.getDnaForAaSeq (aaSeq)) {
+return true;
+}}
+}return false;
+}, "java.util.Set,jalview.datamodel.SequenceI,jalview.datamodel.SequenceI");
+c$.mapProteinToCdna = Clazz_defineMethod (c$, "mapProteinToCdna", 
+function (proteinSeq, cdnaSeq) {
+var proteinDataset = proteinSeq.getDatasetSequence ();
+var aaSeqChars = proteinDataset != null ? proteinDataset.getSequence () : proteinSeq.getSequence ();
+var cdnaDataset = cdnaSeq.getDatasetSequence ();
+var cdnaSeqChars = cdnaDataset != null ? cdnaDataset.getSequence () : cdnaSeq.getSequence ();
+if (aaSeqChars == null || cdnaSeqChars == null) {
+return null;
+}var mappedLength = 3 * aaSeqChars.length;
+var cdnaLength = cdnaSeqChars.length;
+var cdnaStart = 1;
+var cdnaEnd = cdnaLength;
+var proteinStart = 1;
+var proteinEnd = aaSeqChars.length;
+if (cdnaLength != mappedLength && cdnaLength > 2) {
+var lastCodon = String.valueOf (cdnaSeqChars, cdnaLength - 3, 3).toUpperCase ();
+for (var stop, $stop = jalview.schemes.ResidueProperties.STOP.iterator (); $stop.hasNext () && ((stop = $stop.next ()) || true);) {
+if (lastCodon.equals (stop)) {
+cdnaEnd -= 3;
+cdnaLength -= 3;
+break;
+}}
+}if (cdnaLength != mappedLength && cdnaLength > 2 && String.valueOf (cdnaSeqChars, 0, 3).toUpperCase ().equals (jalview.schemes.ResidueProperties.START)) {
+cdnaStart += 3;
+cdnaLength -= 3;
+}if (cdnaLength != mappedLength) {
+return null;
+}if (!jalview.analysis.AlignmentUtils.translatesAs (cdnaSeqChars, cdnaStart - 1, aaSeqChars)) {
+return null;
+}var map =  new jalview.util.MapList ( Clazz_newIntArray (-1, [cdnaStart, cdnaEnd]),  Clazz_newIntArray (-1, [1, proteinEnd]), 3, 1);
+return map;
+}, "jalview.datamodel.SequenceI,jalview.datamodel.SequenceI");
+c$.translatesAs = Clazz_defineMethod (c$, "translatesAs", 
+function (cdnaSeqChars, cdnaStart, aaSeqChars) {
+var aaResidue = 0;
+for (var i = cdnaStart; i < cdnaSeqChars.length - 2 && aaResidue < aaSeqChars.length; i += 3, aaResidue++) {
+var codon = String.valueOf (cdnaSeqChars, i, 3);
+var translated = jalview.schemes.ResidueProperties.codonTranslate (codon);
+var aaRes = aaSeqChars[aaResidue];
+if ((translated == null || "STOP".equals (translated)) && aaRes == 'X') {
+continue;
+}if (translated == null || !(aaRes == translated.charAt (0))) {
+return false;
+}}
+return (aaResidue == aaSeqChars.length);
+}, "~A,~N,~A");
+c$.alignSequenceAs = Clazz_defineMethod (c$, "alignSequenceAs", 
+function (seq, al, gap, preserveMappedGaps, preserveUnmappedGaps) {
+var mappings = al.getCodonFrame (seq);
+if (mappings == null || mappings.isEmpty ()) {
+return false;
+}var alignFrom = null;
+var mapping = null;
+for (var mp, $mp = mappings.iterator (); $mp.hasNext () && ((mp = $mp.next ()) || true);) {
+alignFrom = mp.findAlignedSequence (seq.getDatasetSequence (), al);
+if (alignFrom != null) {
+mapping = mp;
+break;
+}}
+if (alignFrom == null) {
+return false;
+}jalview.analysis.AlignmentUtils.alignSequenceAs (seq, alignFrom, mapping, gap, al.getGapCharacter (), preserveMappedGaps, preserveUnmappedGaps);
+return true;
+}, "jalview.datamodel.SequenceI,jalview.datamodel.AlignmentI,~S,~B,~B");
+c$.alignSequenceAs = Clazz_defineMethod (c$, "alignSequenceAs", 
+function (alignTo, alignFrom, mapping, myGap, sourceGap, preserveMappedGaps, preserveUnmappedGaps) {
+var thisSeq = alignTo.getSequence ();
+var thatAligned = alignFrom.getSequence ();
+var thisAligned =  new StringBuilder (2 * thisSeq.length);
+var thisSeqPos = 0;
+var sourceDsPos = 0;
+var basesWritten = 0;
+var myGapChar = myGap.charAt (0);
+var ratio = myGap.length;
+var sourceGapMappedLength = 0;
+var inExon = false;
+for (var sourceChar, $sourceChar = 0, $$sourceChar = thatAligned; $sourceChar < $$sourceChar.length && ((sourceChar = $$sourceChar[$sourceChar]) || true); $sourceChar++) {
+if (sourceChar == sourceGap) {
+sourceGapMappedLength += ratio;
+continue;
+}sourceDsPos++;
+var mappedPos = mapping.getMappedRegion (alignTo, alignFrom, sourceDsPos);
+if (mappedPos == null) {
+System.err.println ("Can't align: no codon mapping to residue " + sourceDsPos + "(" + sourceChar + ")");
+return;
+}var mappedCodonStart = mappedPos[0];
+var mappedCodonEnd = mappedPos[mappedPos.length - 1];
+var trailingCopiedGap =  new StringBuilder ();
+var intronLength = 0;
+while (basesWritten < mappedCodonEnd && thisSeqPos < thisSeq.length) {
+var c = thisSeq[thisSeqPos++];
+if (c != myGapChar) {
+basesWritten++;
+if (basesWritten < mappedCodonStart) {
+if (preserveUnmappedGaps && trailingCopiedGap.length () > 0) {
+thisAligned.append (trailingCopiedGap.toString ());
+intronLength += trailingCopiedGap.length ();
+trailingCopiedGap =  new StringBuilder ();
+}intronLength++;
+inExon = false;
+} else {
+var startOfCodon = basesWritten == mappedCodonStart;
+var gapsToAdd = jalview.analysis.AlignmentUtils.calculateGapsToInsert (preserveMappedGaps, preserveUnmappedGaps, sourceGapMappedLength, inExon, trailingCopiedGap.length (), intronLength, startOfCodon);
+for (var i = 0; i < gapsToAdd; i++) {
+thisAligned.append (myGapChar);
+}
+sourceGapMappedLength = 0;
+inExon = true;
+}thisAligned.append (c);
+trailingCopiedGap =  new StringBuilder ();
+} else {
+if (inExon && preserveMappedGaps) {
+trailingCopiedGap.append (myGapChar);
+} else if (!inExon && preserveUnmappedGaps) {
+trailingCopiedGap.append (myGapChar);
+}}}
+}
+while (thisSeqPos < thisSeq.length) {
+var c = thisSeq[thisSeqPos++];
+if (c != myGapChar || preserveUnmappedGaps) {
+thisAligned.append (c);
+}}
+alignTo.setSequence ( String.instantialize (thisAligned));
+}, "jalview.datamodel.SequenceI,jalview.datamodel.SequenceI,jalview.datamodel.AlignedCodonFrame,~S,~S,~B,~B");
+c$.calculateGapsToInsert = Clazz_defineMethod (c$, "calculateGapsToInsert", 
+function (preserveMappedGaps, preserveUnmappedGaps, sourceGapMappedLength, inExon, trailingGapLength, intronLength, startOfCodon) {
+var gapsToAdd = 0;
+if (startOfCodon) {
+if (inExon && !preserveMappedGaps) {
+trailingGapLength = 0;
+}if (!inExon && !(preserveMappedGaps && preserveUnmappedGaps)) {
+trailingGapLength = 0;
+}if (inExon) {
+gapsToAdd = Math.max (sourceGapMappedLength, trailingGapLength);
+} else {
+if (intronLength + trailingGapLength <= sourceGapMappedLength) {
+gapsToAdd = sourceGapMappedLength - intronLength;
+} else {
+gapsToAdd = Math.min (intronLength + trailingGapLength - sourceGapMappedLength, trailingGapLength);
+}}} else {
+if (!preserveMappedGaps) {
+trailingGapLength = 0;
+}gapsToAdd = Math.max (sourceGapMappedLength, trailingGapLength);
+}return gapsToAdd;
+}, "~B,~B,~N,~B,~N,~N,~B");
+c$.getAlignedTranslation = Clazz_defineMethod (c$, "getAlignedTranslation", 
+function (sequences, gapCharacter, mappings) {
+var alignedSeqs =  new java.util.ArrayList ();
+for (var seq, $seq = sequences.iterator (); $seq.hasNext () && ((seq = $seq.next ()) || true);) {
+var mapped = jalview.analysis.AlignmentUtils.getAlignedTranslation (seq, gapCharacter, mappings);
+alignedSeqs.addAll (mapped);
+}
+return alignedSeqs;
+}, "java.util.List,~S,java.util.Set");
+c$.getAlignedTranslation = Clazz_defineMethod (c$, "getAlignedTranslation", 
+function (seq, gapCharacter, mappings) {
+var result =  new java.util.ArrayList ();
+for (var mapping, $mapping = mappings.iterator (); $mapping.hasNext () && ((mapping = $mapping.next ()) || true);) {
+if (mapping.involvesSequence (seq)) {
+var mapped = jalview.analysis.AlignmentUtils.getAlignedTranslation (seq, gapCharacter, mapping);
+if (mapped != null) {
+result.add (mapped);
+}}}
+return result;
+}, "jalview.datamodel.SequenceI,~S,java.util.Set");
+c$.getAlignedTranslation = Clazz_defineMethod (c$, "getAlignedTranslation", 
+function (seq, gapCharacter, mapping) {
+var gap = String.valueOf (gapCharacter);
+var toDna = false;
+var fromRatio = 1;
+var mapTo = mapping.getDnaForAaSeq (seq);
+if (mapTo != null) {
+toDna = true;
+gap = String.valueOf ( Clazz_newCharArray (-1, [gapCharacter, gapCharacter, gapCharacter]));
+} else {
+mapTo = mapping.getAaForDnaSeq (seq);
+fromRatio = 3;
+}var newseq =  new StringBuilder (seq.getLength () * (toDna ? 3 : 1));
+var residueNo = 0;
+var phrase =  Clazz_newIntArray (fromRatio, 0);
+var phraseOffset = 0;
+var gapWidth = 0;
+var first = true;
+var alignedSeq =  new jalview.datamodel.Sequence ("", "");
+for (var c, $c = 0, $$c = seq.getSequence (); $c < $$c.length && ((c = $$c[$c]) || true); $c++) {
+if (c == gapCharacter) {
+gapWidth++;
+if (gapWidth >= fromRatio) {
+newseq.append (gap);
+gapWidth = 0;
+}} else {
+phrase[phraseOffset++] = residueNo + 1;
+if (phraseOffset == fromRatio) {
+var sr =  new jalview.datamodel.SearchResults ();
+for (var pos, $pos = 0, $$pos = phrase; $pos < $$pos.length && ((pos = $$pos[$pos]) || true); $pos++) {
+mapping.markMappedRegion (seq, pos, sr);
+}
+newseq.append (sr.toString ());
+if (first) {
+first = false;
+var mappedTo = sr.getResultSequence (0);
+alignedSeq.setName (mappedTo.getName ());
+alignedSeq.setDescription (mappedTo.getDescription ());
+alignedSeq.setDatasetSequence (mappedTo);
+}phraseOffset = 0;
+}residueNo++;
+}}
+alignedSeq.setSequence (newseq.toString ());
+return alignedSeq;
+}, "jalview.datamodel.SequenceI,~S,jalview.datamodel.AlignedCodonFrame");
+c$.alignProteinAsDna = Clazz_defineMethod (c$, "alignProteinAsDna", 
+function (protein, dna) {
+var mappings = protein.getCodonFrames ();
+var alignedCodons =  new java.util.TreeMap ( new jalview.analysis.CodonComparator ());
+for (var dnaSeq, $dnaSeq = dna.getSequences ().iterator (); $dnaSeq.hasNext () && ((dnaSeq = $dnaSeq.next ()) || true);) {
+for (var mapping, $mapping = mappings.iterator (); $mapping.hasNext () && ((mapping = $mapping.next ()) || true);) {
+var seqMap = mapping.getMappingForSequence (dnaSeq);
+var prot = mapping.findAlignedSequence (dnaSeq.getDatasetSequence (), protein);
+if (prot != null) {
+jalview.analysis.AlignmentUtils.addCodonPositions (dnaSeq, prot, protein.getGapCharacter (), seqMap, alignedCodons);
+}}
+}
+return jalview.analysis.AlignmentUtils.alignProteinAs (protein, alignedCodons);
+}, "jalview.datamodel.AlignmentI,jalview.datamodel.AlignmentI");
+c$.alignProteinAs = Clazz_defineMethod (c$, "alignProteinAs", 
+function (protein, alignedCodons) {
+var alignedWidth = alignedCodons.size ();
+var gaps =  Clazz_newCharArray (alignedWidth, '\0');
+java.util.Arrays.fill (gaps, protein.getGapCharacter ());
+var allGaps = String.valueOf (gaps);
+for (var seq, $seq = protein.getSequences ().iterator (); $seq.hasNext () && ((seq = $seq.next ()) || true);) {
+seq.setSequence (allGaps);
+}
+var column = 0;
+for (var codon, $codon = alignedCodons.keySet ().iterator (); $codon.hasNext () && ((codon = $codon.next ()) || true);) {
+var columnResidues = alignedCodons.get (codon);
+for (var entry, $entry = columnResidues.entrySet ().iterator (); $entry.hasNext () && ((entry = $entry.next ()) || true);) {
+entry.getKey ().getSequence ()[column] = entry.getValue ().charAt (0);
+}
+column++;
+}
+return 0;
+}, "jalview.datamodel.AlignmentI,java.util.Map");
+c$.addCodonPositions = Clazz_defineMethod (c$, "addCodonPositions", 
+function (dna, protein, gapChar, seqMap, alignedCodons) {
+var codons = seqMap.getCodonIterator (dna, gapChar);
+while (codons.hasNext ()) {
+var codon = codons.next ();
+var seqProduct = alignedCodons.get (codon);
+if (seqProduct == null) {
+seqProduct =  new java.util.HashMap ();
+alignedCodons.put (codon, seqProduct);
+}seqProduct.put (protein, codon.product);
+}
+}, "jalview.datamodel.SequenceI,jalview.datamodel.SequenceI,~S,jalview.datamodel.Mapping,java.util.Map");
+c$.isMappable = Clazz_defineMethod (c$, "isMappable", 
+function (al1, al2) {
+if (al1.isNucleotide () == al2.isNucleotide ()) {
+return false;
+}var dna = al1.isNucleotide () ? al1 : al2;
+var protein = dna === al1 ? al2 : al1;
+var mappings = protein.getCodonFrames ();
+for (var dnaSeq, $dnaSeq = dna.getSequences ().iterator (); $dnaSeq.hasNext () && ((dnaSeq = $dnaSeq.next ()) || true);) {
+for (var proteinSeq, $proteinSeq = protein.getSequences ().iterator (); $proteinSeq.hasNext () && ((proteinSeq = $proteinSeq.next ()) || true);) {
+if (jalview.analysis.AlignmentUtils.isMappable (dnaSeq, proteinSeq, mappings)) {
+return true;
+}}
+}
+return false;
+}, "jalview.datamodel.AlignmentI,jalview.datamodel.AlignmentI");
+c$.isMappable = Clazz_defineMethod (c$, "isMappable", 
+function (dnaSeq, proteinSeq, mappings) {
+var dnaDs = dnaSeq.getDatasetSequence () == null ? dnaSeq : dnaSeq.getDatasetSequence ();
+var proteinDs = proteinSeq.getDatasetSequence () == null ? proteinSeq : proteinSeq.getDatasetSequence ();
+for (var mapping, $mapping = mappings.iterator (); $mapping.hasNext () && ((mapping = $mapping.next ()) || true);) {
+if (proteinDs === mapping.getAaForDnaSeq (dnaDs)) {
+return true;
+}}
+return jalview.analysis.AlignmentUtils.mapProteinToCdna (proteinDs, dnaDs) != null;
+}, "jalview.datamodel.SequenceI,jalview.datamodel.SequenceI,java.util.Set");
+c$.findAddableReferenceAnnotations = Clazz_defineMethod (c$, "findAddableReferenceAnnotations", 
+function (sequenceScope, labelForCalcId, candidates, al) {
+if (sequenceScope == null) {
+return;
+}for (var seq, $seq = sequenceScope.iterator (); $seq.hasNext () && ((seq = $seq.next ()) || true);) {
+var dataset = seq.getDatasetSequence ();
+if (dataset == null) {
+continue;
+}var datasetAnnotations = dataset.getAnnotation ();
+if (datasetAnnotations == null) {
+continue;
+}var result =  new java.util.ArrayList ();
+for (var dsann, $dsann = 0, $$dsann = datasetAnnotations; $dsann < $$dsann.length && ((dsann = $$dsann[$dsann]) || true); $dsann++) {
+var matchedAlignmentAnnotations = al.findAnnotations (seq, dsann.getCalcId (), dsann.label);
+if (!matchedAlignmentAnnotations.iterator ().hasNext ()) {
+result.add (dsann);
+if (labelForCalcId != null) {
+labelForCalcId.put (dsann.getCalcId (), dsann.label);
+}}}
+if (!result.isEmpty ()) {
+candidates.put (seq, result);
+}}
+}, "java.util.List,java.util.Map,java.util.Map,jalview.datamodel.AlignmentI");
+c$.addReferenceAnnotations = Clazz_defineMethod (c$, "addReferenceAnnotations", 
+function (annotations, alignment, selectionGroup) {
+for (var seq, $seq = annotations.keySet ().iterator (); $seq.hasNext () && ((seq = $seq.next ()) || true);) {
+for (var ann, $ann = annotations.get (seq).iterator (); $ann.hasNext () && ((ann = $ann.next ()) || true);) {
+var copyAnn =  new jalview.datamodel.AlignmentAnnotation (ann);
+var startRes = 0;
+var endRes = ann.annotations.length;
+if (selectionGroup != null) {
+startRes = selectionGroup.getStartRes ();
+endRes = selectionGroup.getEndRes ();
+}copyAnn.restrict (startRes, endRes);
+if (!seq.hasAnnotation (ann)) {
+seq.addAlignmentAnnotation (copyAnn);
+}copyAnn.adjustForAlignment ();
+alignment.addAnnotation (copyAnn);
+copyAnn.visible = true;
+}
+}
+}, "java.util.Map,jalview.datamodel.AlignmentI,jalview.datamodel.SequenceGroup");
+c$.showOrHideSequenceAnnotations = Clazz_defineMethod (c$, "showOrHideSequenceAnnotations", 
+function (al, types, forSequences, anyType, doShow) {
+for (var aa, $aa = 0, $$aa = al.getAlignmentAnnotation (); $aa < $$aa.length && ((aa = $$aa[$aa]) || true); $aa++) {
+if (anyType || types.contains (aa.label)) {
+if ((aa.sequenceRef != null) && (forSequences == null || forSequences.contains (aa.sequenceRef))) {
+aa.visible = doShow;
+}}}
+}, "jalview.datamodel.AlignmentI,java.util.Collection,java.util.List,~B,~B");
+c$.haveCrossRef = Clazz_defineMethod (c$, "haveCrossRef", 
+function (seq1, seq2) {
+return jalview.analysis.AlignmentUtils.hasCrossRef (seq1, seq2) || jalview.analysis.AlignmentUtils.hasCrossRef (seq2, seq1);
+}, "jalview.datamodel.SequenceI,jalview.datamodel.SequenceI");
+c$.hasCrossRef = Clazz_defineMethod (c$, "hasCrossRef", 
+function (seq1, seq2) {
+if (seq1 == null || seq2 == null) {
+return false;
+}var name = seq2.getName ();
+var xrefs = seq1.getDBRef ();
+if (xrefs != null) {
+for (var xref, $xref = 0, $$xref = xrefs; $xref < $$xref.length && ((xref = $$xref[$xref]) || true); $xref++) {
+var xrefName = xref.getSource () + "|" + xref.getAccessionId ();
+if (xrefName.equalsIgnoreCase (name)) {
+return true;
+}}
+}return false;
+}, "jalview.datamodel.SequenceI,jalview.datamodel.SequenceI");
+c$.makeExonAlignment = Clazz_defineMethod (c$, "makeExonAlignment", 
+function (dna, mappings) {
+var newMappings =  new java.util.LinkedHashSet ();
+var exonSequences =  new java.util.ArrayList ();
+for (var dnaSeq, $dnaSeq = 0, $$dnaSeq = dna; $dnaSeq < $$dnaSeq.length && ((dnaSeq = $$dnaSeq[$dnaSeq]) || true); $dnaSeq++) {
+var ds = dnaSeq.getDatasetSequence ();
+var seqMappings = jalview.util.MappingUtils.findMappingsForSequence (ds, mappings);
+for (var acf, $acf = seqMappings.iterator (); $acf.hasNext () && ((acf = $acf.next ()) || true);) {
+var newMapping =  new jalview.datamodel.AlignedCodonFrame ();
+var mappedExons = jalview.analysis.AlignmentUtils.makeExonSequences (ds, acf, newMapping);
+if (!mappedExons.isEmpty ()) {
+exonSequences.addAll (mappedExons);
+newMappings.add (newMapping);
+}}
+}
+var al =  new jalview.datamodel.Alignment (exonSequences.toArray ( new Array (exonSequences.size ())));
+al.setDataset (null);
+mappings.clear ();
+mappings.addAll (newMappings);
+return al;
+}, "~A,java.util.Set");
+c$.makeExonSequences = Clazz_defineMethod (c$, "makeExonSequences", 
+function (dnaSeq, mapping, newMapping) {
+var exonSequences =  new java.util.ArrayList ();
+var seqMappings = mapping.getMappingsForSequence (dnaSeq);
+var dna = dnaSeq.getSequence ();
+for (var seqMapping, $seqMapping = seqMappings.iterator (); $seqMapping.hasNext () && ((seqMapping = $seqMapping.next ()) || true);) {
+var newSequence =  new StringBuilder (dnaSeq.getLength ());
+var dnaExonRanges = seqMapping.getMap ().getFromRanges ();
+for (var range, $range = dnaExonRanges.iterator (); $range.hasNext () && ((range = $range.next ()) || true);) {
+for (var pos = range[0]; pos <= range[1]; pos++) {
+newSequence.append (dna[pos - 1]);
+}
+}
+var exon =  new jalview.datamodel.Sequence (dnaSeq.getName (), newSequence.toString ());
+var cdsAccId = jalview.datamodel.FeatureProperties.getCodingFeature (jalview.datamodel.DBRefSource.EMBL);
+var cdsRefs = jalview.util.DBRefUtils.selectRefs (seqMapping.getTo ().getDBRef (), jalview.datamodel.DBRefSource.CODINGDBS);
+if (cdsRefs != null) {
+for (var cdsRef, $cdsRef = 0, $$cdsRef = cdsRefs; $cdsRef < $$cdsRef.length && ((cdsRef = $$cdsRef[$cdsRef]) || true); $cdsRef++) {
+exon.addDBRef ( new jalview.datamodel.DBRefEntry (cdsRef));
+cdsAccId = cdsRef.getAccessionId ();
+}
+}exon.setName (exon.getName () + "|" + cdsAccId);
+exon.createDatasetSequence ();
+var exonRange =  new java.util.ArrayList ();
+exonRange.add ( Clazz_newIntArray (-1, [1, newSequence.length ()]));
+var map =  new jalview.util.MapList (exonRange, seqMapping.getMap ().getToRanges (), 3, 1);
+newMapping.addMap (exon.getDatasetSequence (), seqMapping.getTo (), map);
+var cdsToDnaMap =  new jalview.util.MapList (dnaExonRanges, exonRange, 1, 1);
+newMapping.addMap (dnaSeq, exon.getDatasetSequence (), cdsToDnaMap);
+exonSequences.add (exon);
+}
+return exonSequences;
+}, "jalview.datamodel.SequenceI,jalview.datamodel.AlignedCodonFrame,jalview.datamodel.AlignedCodonFrame");
+});
+Clazz_declarePackage ("jalview.analysis");
+c$ = Clazz_declareType (jalview.analysis, "CodonComparator", null, java.util.Comparator);
+Clazz_overrideMethod (c$, "compare", 
+function (ac1, ac2) {
+if (ac1 == null || ac2 == null || ac1.equals (ac2)) {
+return 0;
+}if (ac1.pos1 < ac2.pos1 && ac1.pos3 <= ac2.pos3) {
+return -1;
+}if (ac2.pos1 < ac1.pos1 && ac2.pos3 <= ac1.pos3) {
+return 1;
+}if (ac1.pos3 > ac2.pos3 && ac1.pos1 >= ac2.pos1) {
+return 1;
+}if (ac2.pos3 > ac1.pos3 && ac2.pos1 >= ac1.pos1) {
+return -1;
+}if (ac1.pos1 == ac2.pos1 && ac1.pos3 == ac2.pos3) {
+return Integer.compare (ac1.pos2, ac2.pos2);
+}var compareMiddles = Integer.compare (ac1.pos2, ac2.pos2);
+if (compareMiddles != 0) {
+return compareMiddles;
+}return Integer.compare (ac1.pos1, ac2.pos1);
+}, "jalview.datamodel.AlignedCodon,jalview.datamodel.AlignedCodon");
+Clazz_declarePackage ("jalview.datamodel");
+Clazz_load (null, "jalview.datamodel.AlignedCodonFrame", ["jalview.datamodel.Mapping", "jalview.util.MappingUtils", "java.util.ArrayList"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.dnaSeqs = null;
+this.dnaToProt = null;
+Clazz_instantialize (this, arguments);
+}, jalview.datamodel, "AlignedCodonFrame");
+Clazz_makeConstructor (c$, 
+function () {
+});
+Clazz_defineMethod (c$, "addMap", 
+function (dnaseq, aaseq, map) {
+var nlen = 1;
+if (this.dnaSeqs != null) {
+nlen = this.dnaSeqs.length + 1;
+}var ndna =  new Array (nlen);
+var ndtp =  new Array (nlen);
+if (this.dnaSeqs != null) {
+System.arraycopy (this.dnaSeqs, 0, ndna, 0, this.dnaSeqs.length);
+System.arraycopy (this.dnaToProt, 0, ndtp, 0, this.dnaSeqs.length);
+}this.dnaSeqs = ndna;
+this.dnaToProt = ndtp;
+nlen--;
+this.dnaSeqs[nlen] = (dnaseq.getDatasetSequence () == null) ? dnaseq : dnaseq.getDatasetSequence ();
+var mp =  new jalview.datamodel.Mapping (map);
+mp.to = (aaseq.getDatasetSequence () == null) ? aaseq : aaseq.getDatasetSequence ();
+this.dnaToProt[nlen] = mp;
+}, "jalview.datamodel.SequenceI,jalview.datamodel.SequenceI,jalview.util.MapList");
+Clazz_defineMethod (c$, "getdnaSeqs", 
+function () {
+return this.dnaSeqs;
+});
+Clazz_defineMethod (c$, "getAaSeqs", 
+function () {
+if (this.dnaToProt == null) {
+return null;
+}var sqs =  new Array (this.dnaToProt.length);
+for (var sz = 0; sz < this.dnaToProt.length; sz++) {
+sqs[sz] = this.dnaToProt[sz].to;
+}
+return sqs;
+});
+Clazz_defineMethod (c$, "getdnaToProt", 
+function () {
+if (this.dnaToProt == null) {
+return null;
+}var sqs =  new Array (this.dnaToProt.length);
+for (var sz = 0; sz < this.dnaToProt.length; sz++) {
+sqs[sz] = this.dnaToProt[sz].map;
+}
+return sqs;
+});
+Clazz_defineMethod (c$, "getProtMappings", 
+function () {
+return this.dnaToProt;
+});
+Clazz_defineMethod (c$, "getMappingForSequence", 
+function (seq) {
+if (this.dnaSeqs == null) {
+return null;
+}var seqDs = seq.getDatasetSequence ();
+seqDs = seqDs != null ? seqDs : seq;
+for (var ds = 0; ds < this.dnaSeqs.length; ds++) {
+if (this.dnaSeqs[ds] === seqDs || this.dnaToProt[ds].to === seqDs) {
+return this.dnaToProt[ds];
+}}
+return null;
+}, "jalview.datamodel.SequenceI");
+Clazz_defineMethod (c$, "getAaForDnaSeq", 
+function (dnaSeqRef) {
+if (this.dnaSeqs == null) {
+return null;
+}var dnads = dnaSeqRef.getDatasetSequence ();
+for (var ds = 0; ds < this.dnaSeqs.length; ds++) {
+if (this.dnaSeqs[ds] === dnaSeqRef || this.dnaSeqs[ds] === dnads) {
+return this.dnaToProt[ds].to;
+}}
+return null;
+}, "jalview.datamodel.SequenceI");
+Clazz_defineMethod (c$, "getDnaForAaSeq", 
+function (aaSeqRef) {
+if (this.dnaToProt == null) {
+return null;
+}var aads = aaSeqRef.getDatasetSequence ();
+for (var as = 0; as < this.dnaToProt.length; as++) {
+if (this.dnaToProt[as].to === aaSeqRef || this.dnaToProt[as].to === aads) {
+return this.dnaSeqs[as];
+}}
+return null;
+}, "jalview.datamodel.SequenceI");
+Clazz_defineMethod (c$, "involvesSequence", 
+function (seq) {
+return this.getAaForDnaSeq (seq) != null || this.getDnaForAaSeq (seq) != null;
+}, "jalview.datamodel.SequenceI");
+Clazz_defineMethod (c$, "markMappedRegion", 
+function (seq, index, results) {
+if (this.dnaToProt == null) {
+return;
+}var codon;
+var ds = seq.getDatasetSequence ();
+for (var mi = 0; mi < this.dnaToProt.length; mi++) {
+if (this.dnaSeqs[mi] === seq || this.dnaSeqs[mi] === ds) {
+codon = this.dnaToProt[mi].map.locateInTo (index, index);
+if (codon != null) {
+for (var i = 0; i < codon.length; i += 2) {
+results.addResult (this.dnaToProt[mi].to, codon[i], codon[i + 1]);
+}
+}} else if (this.dnaToProt[mi].to === seq || this.dnaToProt[mi].to === ds) {
+{
+codon = this.dnaToProt[mi].map.locateInFrom (index, index);
+if (codon != null) {
+for (var i = 0; i < codon.length; i += 2) {
+results.addResult (this.dnaSeqs[mi], codon[i], codon[i + 1]);
+}
+}}}}
+}, "jalview.datamodel.SequenceI,~N,jalview.datamodel.SearchResults");
+Clazz_defineMethod (c$, "getDnaPosition", 
+function (seq, aaPos) {
+var ml = null;
+for (var i = 0; i < this.dnaToProt.length; i++) {
+if (this.dnaSeqs[i] === seq) {
+ml = this.getdnaToProt ()[i];
+break;
+}}
+return ml == null ? null : ml.locateInFrom (aaPos, aaPos);
+}, "jalview.datamodel.SequenceI,~N");
+Clazz_defineMethod (c$, "findAlignedSequence", 
+function (seq, al) {
+if (this.dnaToProt != null) {
+for (var i = 0; i < this.dnaToProt.length; i++) {
+if (this.dnaSeqs[i] === seq) {
+for (var sourceAligned, $sourceAligned = al.getSequences ().iterator (); $sourceAligned.hasNext () && ((sourceAligned = $sourceAligned.next ()) || true);) {
+if (this.dnaToProt[i].to === sourceAligned.getDatasetSequence ()) {
+return sourceAligned;
+}}
+}}
+}if (this.dnaToProt != null) {
+for (var i = 0; i < this.dnaToProt.length; i++) {
+if (this.dnaToProt[i].to === seq) {
+for (var sourceAligned, $sourceAligned = al.getSequences ().iterator (); $sourceAligned.hasNext () && ((sourceAligned = $sourceAligned.next ()) || true);) {
+if (this.dnaSeqs[i] === sourceAligned.getDatasetSequence ()) {
+return sourceAligned;
+}}
+}}
+}return null;
+}, "jalview.datamodel.SequenceI,jalview.datamodel.AlignmentI");
+Clazz_defineMethod (c$, "getMappedRegion", 
+function (mappedFrom, mappedTo, pos) {
+var targetDs = mappedFrom.getDatasetSequence () == null ? mappedFrom : mappedFrom.getDatasetSequence ();
+var sourceDs = mappedTo.getDatasetSequence () == null ? mappedTo : mappedTo.getDatasetSequence ();
+if (targetDs == null || sourceDs == null || this.dnaToProt == null) {
+return null;
+}for (var mi = 0; mi < this.dnaToProt.length; mi++) {
+if (this.dnaSeqs[mi] === targetDs && this.dnaToProt[mi].to === sourceDs) {
+var codon = this.dnaToProt[mi].map.locateInFrom (pos, pos);
+if (codon != null) {
+return codon;
+}}}
+return null;
+}, "jalview.datamodel.SequenceI,jalview.datamodel.SequenceI,~N");
+Clazz_defineMethod (c$, "getMappedCodon", 
+function (protein, aaPos) {
+if (this.dnaToProt == null) {
+return null;
+}var ml = null;
+var dnaSeq = null;
+for (var i = 0; i < this.dnaToProt.length; i++) {
+if (this.dnaToProt[i].to === protein) {
+ml = this.getdnaToProt ()[i];
+dnaSeq = this.dnaSeqs[i].getSequence ();
+break;
+}}
+if (ml == null) {
+return null;
+}var codonPos = ml.locateInFrom (aaPos, aaPos);
+if (codonPos == null) {
+return null;
+}codonPos = jalview.util.MappingUtils.flattenRanges (codonPos);
+return  Clazz_newCharArray (-1, [dnaSeq[codonPos[0] - 1], dnaSeq[codonPos[1] - 1], dnaSeq[codonPos[2] - 1]]);
+}, "jalview.datamodel.SequenceI,~N");
+Clazz_defineMethod (c$, "getMappingsForSequence", 
+function (seq) {
+var result =  new java.util.ArrayList ();
+if (this.dnaSeqs == null) {
+return result;
+}var related =  new java.util.ArrayList ();
+var seqDs = seq.getDatasetSequence ();
+seqDs = seqDs != null ? seqDs : seq;
+for (var ds = 0; ds < this.dnaSeqs.length; ds++) {
+var mapping = this.dnaToProt[ds];
+if (this.dnaSeqs[ds] === seqDs || mapping.to === seqDs) {
+if (!related.contains (mapping.to)) {
+result.add (mapping);
+related.add (mapping.to);
+}}}
+return result;
+}, "jalview.datamodel.SequenceI");
+});
+Clazz_declarePackage ("jalview.datamodel");
+Clazz_load (["java.util.Iterator"], "jalview.datamodel.Mapping", ["jalview.datamodel.AlignedCodon", "$.IncompleteCodonException", "$.SequenceFeature", "jalview.util.MapList", "java.util.NoSuchElementException", "$.Vector"], function () {
+c$ = Clazz_decorateAsClass (function () {
+if (!Clazz_isClassDefined ("jalview.datamodel.Mapping.AlignedCodonIterator")) {
+jalview.datamodel.Mapping.$Mapping$AlignedCodonIterator$ ();
+}
+this.map = null;
+this.to = null;
+Clazz_instantialize (this, arguments);
+}, jalview.datamodel, "Mapping");
+Clazz_makeConstructor (c$, 
+function (map) {
+this.map = map;
+}, "jalview.util.MapList");
+Clazz_makeConstructor (c$, 
+function (to, map) {
+this.construct (map);
+this.to = to;
+}, "jalview.datamodel.SequenceI,jalview.util.MapList");
+Clazz_makeConstructor (c$, 
+function (to, exon, is, i, j) {
+this.construct (to,  new jalview.util.MapList (exon, is, i, j));
+}, "jalview.datamodel.SequenceI,~A,~A,~N,~N");
+Clazz_makeConstructor (c$, 
+function (map2) {
+if (map2 !== this && map2 != null) {
+if (map2.map != null) {
+this.map =  new jalview.util.MapList (map2.map);
+}this.to = map2.to;
+}}, "jalview.datamodel.Mapping");
+Clazz_defineMethod (c$, "getMap", 
+function () {
+return this.map;
+});
+Clazz_defineMethod (c$, "setMap", 
+function (map) {
+this.map = map;
+}, "jalview.util.MapList");
+Clazz_overrideMethod (c$, "equals", 
+function (o) {
+if (o == null || !(Clazz_instanceOf (o, jalview.datamodel.Mapping))) {
+return false;
+}var other = o;
+if (other === this) {
+return true;
+}if (other.to !== this.to) {
+return false;
+}if ((this.map != null && other.map == null) || (this.map == null && other.map != null)) {
+return false;
+}if ((this.map == null && other.map == null) || this.map.equals (other.map)) {
+return true;
+}return false;
+}, "~O");
+Clazz_defineMethod (c$, "getPosition", 
+function (mpos) {
+if (this.map != null) {
+var mp = this.map.shiftTo (mpos);
+if (mp != null) {
+return mp[0];
+}}return mpos;
+}, "~N");
+Clazz_defineMethod (c$, "getWord", 
+function (mpos) {
+if (this.map != null) {
+return this.map.getToWord (mpos);
+}return null;
+}, "~N");
+Clazz_defineMethod (c$, "getWidth", 
+function () {
+if (this.map != null) {
+return this.map.getFromRatio ();
+}return 1;
+});
+Clazz_defineMethod (c$, "getMappedWidth", 
+function () {
+if (this.map != null) {
+return this.map.getToRatio ();
+}return 1;
+});
+Clazz_defineMethod (c$, "getMappedPosition", 
+function (pos) {
+if (this.map != null) {
+var mp = this.map.shiftFrom (pos);
+if (mp != null) {
+return mp[0];
+}}return pos;
+}, "~N");
+Clazz_defineMethod (c$, "getMappedWord", 
+function (pos) {
+if (this.map != null) {
+var mp = this.map.shiftFrom (pos);
+if (mp != null) {
+return  Clazz_newIntArray (-1, [mp[0], mp[0] + mp[2] * (this.map.getToRatio () - 1)]);
+}}return null;
+}, "~N");
+Clazz_defineMethod (c$, "locateFeature", 
+function (f) {
+if (true) {
+if (this.map != null) {
+var frange = this.map.locateInFrom (f.getBegin (), f.getEnd ());
+if (frange == null) {
+return null;
+}var vf =  new Array (Clazz_doubleToInt (frange.length / 2));
+for (var i = 0, v = 0; i < frange.length; i += 2, v++) {
+vf[v] =  new jalview.datamodel.SequenceFeature (f);
+vf[v].setBegin (frange[i]);
+vf[v].setEnd (frange[i + 1]);
+if (frange.length > 2) {
+vf[v].setDescription (f.getDescription () + "\nPart " + (v + 1));
+}}
+return vf;
+}}if (false) {
+var word = this.getWord (f.getBegin ());
+if (word[0] < word[1]) {
+f.setBegin (word[0]);
+} else {
+f.setBegin (word[1]);
+}word = this.getWord (f.getEnd ());
+if (word[0] > word[1]) {
+f.setEnd (word[0]);
+} else {
+f.setEnd (word[1]);
+}}return  Clazz_newArray (-1, [f]);
+}, "jalview.datamodel.SequenceFeature");
+Clazz_defineMethod (c$, "locateRange", 
+function (from, to) {
+if (this.map != null) {
+if (from <= to) {
+from = (this.map.getToLowest () < from) ? from : this.map.getToLowest ();
+to = (this.map.getToHighest () > to) ? to : this.map.getToHighest ();
+if (from > to) {
+return null;
+}} else {
+from = (this.map.getToHighest () > from) ? from : this.map.getToHighest ();
+to = (this.map.getToLowest () < to) ? to : this.map.getToLowest ();
+if (from < to) {
+return null;
+}}return this.map.locateInFrom (from, to);
+}return  Clazz_newIntArray (-1, [from, to]);
+}, "~N,~N");
+Clazz_defineMethod (c$, "locateMappedRange", 
+function (from, to) {
+if (this.map != null) {
+if (from <= to) {
+from = (this.map.getFromLowest () < from) ? from : this.map.getFromLowest ();
+to = (this.map.getFromHighest () > to) ? to : this.map.getFromHighest ();
+if (from > to) {
+return null;
+}} else {
+from = (this.map.getFromHighest () > from) ? from : this.map.getFromHighest ();
+to = (this.map.getFromLowest () < to) ? to : this.map.getFromLowest ();
+if (from < to) {
+return null;
+}}return this.map.locateInTo (from, to);
+}return  Clazz_newIntArray (-1, [from, to]);
+}, "~N,~N");
+Clazz_defineMethod (c$, "intersectVisContigs", 
+function (viscontigs) {
+var copy =  new jalview.datamodel.Mapping (this);
+if (this.map != null) {
+var vpos = 0;
+var apos = 0;
+var toRange =  new java.util.Vector ();
+var fromRange =  new java.util.Vector ();
+for (var vc = 0; vc < viscontigs.length; vc += 2) {
+var mpr = this.locateMappedRange (1 + viscontigs[vc], viscontigs[vc + 1] - 1);
+if (mpr != null) {
+for (var m = 0; m < mpr.length; m += 2) {
+toRange.addElement ( Clazz_newIntArray (-1, [mpr[m], mpr[m + 1]]));
+var xpos = this.locateRange (mpr[m], mpr[m + 1]);
+for (var x = 0; x < xpos.length; x += 2) {
+fromRange.addElement ( Clazz_newIntArray (-1, [xpos[x], xpos[x + 1]]));
+}
+}
+}}
+var from =  Clazz_newIntArray (fromRange.size () * 2, 0);
+var to =  Clazz_newIntArray (toRange.size () * 2, 0);
+var r;
+for (var f = 0, fSize = fromRange.size (); f < fSize; f++) {
+r = fromRange.elementAt (f);
+from[f * 2] = r[0];
+from[f * 2 + 1] = r[1];
+}
+for (var f = 0, fSize = toRange.size (); f < fSize; f++) {
+r = toRange.elementAt (f);
+to[f * 2] = r[0];
+to[f * 2 + 1] = r[1];
+}
+copy.setMap ( new jalview.util.MapList (from, to, this.map.getFromRatio (), this.map.getToRatio ()));
+}return copy;
+}, "~A");
+Clazz_defineMethod (c$, "getTo", 
+function () {
+return this.to;
+});
+Clazz_defineMethod (c$, "setTo", 
+function (tto) {
+this.to = tto;
+}, "jalview.datamodel.SequenceI");
+Clazz_defineMethod (c$, "finalize", 
+function () {
+this.map = null;
+this.to = null;
+Clazz_superCall (this, jalview.datamodel.Mapping, "finalize", []);
+});
+Clazz_defineMethod (c$, "getCodonIterator", 
+function (seq, gapChar) {
+return Clazz_innerTypeInstance (jalview.datamodel.Mapping.AlignedCodonIterator, this, null, seq.getSequence (), gapChar);
+}, "jalview.datamodel.SequenceI,~S");
+c$.$Mapping$AlignedCodonIterator$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_decorateAsClass (function () {
+Clazz_prepareCallback (this, arguments);
+this.gap = '\0';
+this.alignedSeq = null;
+this.alignedColumn = 0;
+this.alignedBases = 0;
+this.fromRanges = null;
+this.toRanges = null;
+this.currentFromRange = null;
+this.currentToRange = null;
+this.fromPosition = 0;
+this.toPosition = 0;
+Clazz_instantialize (this, arguments);
+}, jalview.datamodel.Mapping, "AlignedCodonIterator", null, java.util.Iterator);
+Clazz_makeConstructor (c$, 
+function (a, b) {
+this.alignedSeq = a;
+this.gap = b;
+this.fromRanges = this.b$["jalview.datamodel.Mapping"].map.getFromRanges ().iterator ();
+this.toRanges = this.b$["jalview.datamodel.Mapping"].map.getToRanges ().iterator ();
+if (this.fromRanges.hasNext ()) {
+this.currentFromRange = this.fromRanges.next ();
+this.fromPosition = this.currentFromRange[0];
+}if (this.toRanges.hasNext ()) {
+this.currentToRange = this.toRanges.next ();
+this.toPosition = this.currentToRange[0];
+}}, "~A,~S");
+Clazz_defineMethod (c$, "hasNext", 
+function () {
+if (this.fromRanges.hasNext ()) {
+return true;
+}if (this.currentFromRange == null || this.fromPosition >= this.currentFromRange[1]) {
+return false;
+}return true;
+});
+Clazz_overrideMethod (c$, "next", 
+function () {
+if (!this.hasNext ()) {
+throw  new java.util.NoSuchElementException ();
+}var a = this.getNextCodon ();
+var b = this.getAlignedCodon (a);
+var c = this.getPeptide ();
+return  new jalview.datamodel.AlignedCodon (b[0], b[1], b[2], c);
+});
+Clazz_defineMethod (c$, "getPeptide", 
+ function () {
+if (this.toPosition <= this.currentToRange[1]) {
+var a = this.b$["jalview.datamodel.Mapping"].to.getSequence ()[this.toPosition - 1];
+this.toPosition++;
+return String.valueOf (a);
+}if (!this.toRanges.hasNext ()) {
+throw  new java.util.NoSuchElementException ("Ran out of peptide at position " + this.toPosition);
+}this.currentToRange = this.toRanges.next ();
+this.toPosition = this.currentToRange[0];
+return this.getPeptide ();
+});
+Clazz_defineMethod (c$, "getNextCodon", 
+ function () {
+var a =  Clazz_newIntArray (3, 0);
+var b = 0;
+while (b < 3) {
+if (this.fromPosition <= this.currentFromRange[1]) {
+a[b++] = this.fromPosition++;
+} else {
+if (!this.fromRanges.hasNext ()) {
+throw  new jalview.datamodel.IncompleteCodonException ();
+}this.currentFromRange = this.fromRanges.next ();
+this.fromPosition = this.currentFromRange[0];
+}}
+return a;
+});
+Clazz_defineMethod (c$, "getAlignedCodon", 
+ function (a) {
+var b =  Clazz_newIntArray (a.length, 0);
+for (var c = 0; c < a.length; c++) {
+b[c] = this.getAlignedColumn (a[c]);
+}
+return b;
+}, "~A");
+Clazz_defineMethod (c$, "getAlignedColumn", 
+ function (a) {
+while (this.alignedBases < a && this.alignedColumn < this.alignedSeq.length) {
+if (this.alignedSeq[this.alignedColumn++] != this.gap) {
+this.alignedBases++;
+}}
+return this.alignedColumn - 1;
+}, "~N");
+Clazz_overrideMethod (c$, "remove", 
+function () {
+});
+c$ = Clazz_p0p ();
+};
+});
+Clazz_declarePackage ("jalview.datamodel");
+Clazz_load (null, "jalview.datamodel.AlignedCodon", ["java.lang.IllegalArgumentException", "$.StringBuilder"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.pos1 = 0;
+this.pos2 = 0;
+this.pos3 = 0;
+this.product = null;
+Clazz_instantialize (this, arguments);
+}, jalview.datamodel, "AlignedCodon");
+Clazz_makeConstructor (c$, 
+function (i, j, k) {
+this.construct (i, j, k, null);
+}, "~N,~N,~N");
+Clazz_makeConstructor (c$, 
+function (i, j, k, prod) {
+this.pos1 = i;
+this.pos2 = j;
+this.pos3 = k;
+this.product = prod;
+}, "~N,~N,~N,~S");
+Clazz_defineMethod (c$, "getBaseColumn", 
+function (base) {
+if (base < 1 || base > 3) {
+throw  new IllegalArgumentException (Integer.toString (base));
+}return base == 1 ? this.pos1 : (base == 2 ? this.pos2 : this.pos3);
+}, "~N");
+Clazz_overrideMethod (c$, "equals", 
+function (o) {
+if (o == null) {
+return true;
+}if (!(Clazz_instanceOf (o, jalview.datamodel.AlignedCodon))) {
+return false;
+}var ac = o;
+return (this.pos1 == ac.pos1 && this.pos2 == ac.pos2 && this.pos3 == ac.pos3);
+}, "~O");
+Clazz_overrideMethod (c$, "toString", 
+function () {
+var sb =  new StringBuilder ();
+sb.append ("[").append (this.pos1).append (", ").append (this.pos2).append (", ").append (this.pos3).append ("]");
+return sb.toString ();
+});
+});
+Clazz_declarePackage ("jalview.datamodel");
+Clazz_load (["java.lang.RuntimeException"], "jalview.datamodel.IncompleteCodonException", null, function () {
+c$ = Clazz_declareType (jalview.datamodel, "IncompleteCodonException", RuntimeException);
+});
+Clazz_declarePackage ("jalview.datamodel");
+Clazz_load (null, "jalview.datamodel.SequenceFeature", ["java.util.Hashtable", "$.Vector"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.begin = 0;
+this.end = 0;
+this.score = 0;
+this.type = null;
+this.description = null;
+this.otherDetails = null;
+this.links = null;
+this.featureGroup = null;
+Clazz_instantialize (this, arguments);
+}, jalview.datamodel, "SequenceFeature");
+Clazz_makeConstructor (c$, 
+function () {
+});
+Clazz_makeConstructor (c$, 
+function (cpy) {
+if (cpy != null) {
+this.begin = cpy.begin;
+this.end = cpy.end;
+this.score = cpy.score;
+if (cpy.type != null) {
+this.type =  String.instantialize (cpy.type);
+}if (cpy.description != null) {
+this.description =  String.instantialize (cpy.description);
+}if (cpy.featureGroup != null) {
+this.featureGroup =  String.instantialize (cpy.featureGroup);
+}if (cpy.otherDetails != null) {
+try {
+this.otherDetails = cpy.otherDetails.clone ();
+} catch (e) {
+if (Clazz_exceptionOf (e, Exception)) {
+} else {
+throw e;
+}
+}
+}if (cpy.links != null && cpy.links.size () > 0) {
+this.links =  new java.util.Vector ();
+for (var i = 0, iSize = cpy.links.size (); i < iSize; i++) {
+this.links.addElement (cpy.links.elementAt (i));
+}
+}}}, "jalview.datamodel.SequenceFeature");
+Clazz_makeConstructor (c$, 
+function (type, desc, status, begin, end, featureGroup) {
+this.type = type;
+this.description = desc;
+this.setValue ("status", status);
+this.begin = begin;
+this.end = end;
+this.featureGroup = featureGroup;
+}, "~S,~S,~S,~N,~N,~S");
+Clazz_makeConstructor (c$, 
+function (type, desc, begin, end, score, featureGroup) {
+this.type = type;
+this.description = desc;
+this.begin = begin;
+this.end = end;
+this.score = score;
+this.featureGroup = featureGroup;
+}, "~S,~S,~N,~N,~N,~S");
+Clazz_defineMethod (c$, "equals", 
+function (sf) {
+if (this.begin != sf.begin || this.end != sf.end || this.score != sf.score) {
+return false;
+}if (!(this.type + this.description + this.featureGroup).equals (sf.type + sf.description + sf.featureGroup)) {
+return false;
+}return true;
+}, "jalview.datamodel.SequenceFeature");
+Clazz_defineMethod (c$, "getBegin", 
+function () {
+return this.begin;
+});
+Clazz_defineMethod (c$, "setBegin", 
+function (start) {
+this.begin = start;
+}, "~N");
+Clazz_defineMethod (c$, "getEnd", 
+function () {
+return this.end;
+});
+Clazz_defineMethod (c$, "setEnd", 
+function (end) {
+this.end = end;
+}, "~N");
+Clazz_defineMethod (c$, "getType", 
+function () {
+return this.type;
+});
+Clazz_defineMethod (c$, "setType", 
+function (type) {
+this.type = type;
+}, "~S");
+Clazz_defineMethod (c$, "getDescription", 
+function () {
+return this.description;
+});
+Clazz_defineMethod (c$, "setDescription", 
+function (desc) {
+this.description = desc;
+}, "~S");
+Clazz_defineMethod (c$, "getFeatureGroup", 
+function () {
+return this.featureGroup;
+});
+Clazz_defineMethod (c$, "setFeatureGroup", 
+function (featureGroup) {
+this.featureGroup = featureGroup;
+}, "~S");
+Clazz_defineMethod (c$, "addLink", 
+function (labelLink) {
+if (this.links == null) {
+this.links =  new java.util.Vector ();
+}this.links.insertElementAt (labelLink, 0);
+}, "~S");
+Clazz_defineMethod (c$, "getScore", 
+function () {
+return this.score;
+});
+Clazz_defineMethod (c$, "setScore", 
+function (value) {
+this.score = value;
+}, "~N");
+Clazz_defineMethod (c$, "getValue", 
+function (key) {
+if (this.otherDetails == null) {
+return null;
+} else {
+return this.otherDetails.get (key);
+}}, "~S");
+Clazz_defineMethod (c$, "setValue", 
+function (key, value) {
+if (value != null) {
+if (this.otherDetails == null) {
+this.otherDetails =  new java.util.Hashtable ();
+}this.otherDetails.put (key, value);
+}}, "~S,~O");
+Clazz_defineMethod (c$, "setStatus", 
+function (status) {
+this.setValue ("status", status);
+}, "~S");
+Clazz_defineMethod (c$, "getStatus", 
+function () {
+if (this.otherDetails != null) {
+var stat = this.otherDetails.get ("status");
+if (stat != null) {
+return  String.instantialize (stat);
+}}return null;
+});
+Clazz_defineMethod (c$, "setPosition", 
+function (pos) {
+this.begin = pos;
+this.end = pos;
+}, "~N");
+Clazz_defineMethod (c$, "getPosition", 
+function () {
+return this.begin;
+});
+Clazz_defineMethod (c$, "getStrand", 
+function () {
+var str;
+if (this.otherDetails == null || (str = this.otherDetails.get ("STRAND").toString ()) == null) {
+return 0;
+}if (str.equals ("-")) {
+return -1;
+}if (str.equals ("+")) {
+return 1;
+}return 0;
+});
+});
+Clazz_declarePackage ("jalview.util");
+Clazz_load (["java.util.ArrayList"], "jalview.util.MapList", ["java.lang.StringBuilder", "java.util.Arrays"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.fromShifts = null;
+this.toShifts = null;
+this.fromRatio = 0;
+this.toRatio = 0;
+this.fromLowest = 0;
+this.fromHighest = 0;
+this.toLowest = 0;
+this.toHighest = 0;
+Clazz_instantialize (this, arguments);
+}, jalview.util, "MapList");
+Clazz_prepareFields (c$, function () {
+this.fromShifts =  new java.util.ArrayList ();
+this.toShifts =  new java.util.ArrayList ();
+});
+Clazz_overrideMethod (c$, "equals", 
+function (o) {
+if (o == null || !(Clazz_instanceOf (o, jalview.util.MapList))) {
+return false;
+}var obj = o;
+if (obj === this) {
+return true;
+}if (obj.fromRatio != this.fromRatio || obj.toRatio != this.toRatio || obj.fromShifts == null || obj.toShifts == null) {
+return false;
+}return java.util.Arrays.deepEquals (this.fromShifts.toArray (), obj.fromShifts.toArray ()) && java.util.Arrays.deepEquals (this.toShifts.toArray (), obj.toShifts.toArray ());
+}, "~O");
+Clazz_defineMethod (c$, "getFromRanges", 
+function () {
+return this.fromShifts;
+});
+Clazz_defineMethod (c$, "getToRanges", 
+function () {
+return this.toShifts;
+});
+c$.getRanges = Clazz_defineMethod (c$, "getRanges", 
+function (shifts) {
+var rnges =  Clazz_newIntArray (2 * shifts.size (), 0);
+var i = 0;
+for (var r, $r = shifts.iterator (); $r.hasNext () && ((r = $r.next ()) || true);) {
+rnges[i++] = r[0];
+rnges[i++] = r[1];
+}
+return rnges;
+}, "java.util.List");
+Clazz_defineMethod (c$, "getFromRatio", 
+function () {
+return this.fromRatio;
+});
+Clazz_defineMethod (c$, "getToRatio", 
+function () {
+return this.toRatio;
+});
+Clazz_defineMethod (c$, "getFromLowest", 
+function () {
+return this.fromLowest;
+});
+Clazz_defineMethod (c$, "getFromHighest", 
+function () {
+return this.fromHighest;
+});
+Clazz_defineMethod (c$, "getToLowest", 
+function () {
+return this.toLowest;
+});
+Clazz_defineMethod (c$, "getToHighest", 
+function () {
+return this.toHighest;
+});
+Clazz_makeConstructor (c$, 
+function (from, to, fromRatio, toRatio) {
+this.fromRatio = fromRatio;
+this.toRatio = toRatio;
+this.fromLowest = from[0];
+this.fromHighest = from[1];
+for (var i = 0; i < from.length; i += 2) {
+this.fromLowest = Math.min (this.fromLowest, from[i]);
+this.fromHighest = Math.max (this.fromHighest, from[i + 1]);
+this.fromShifts.add ( Clazz_newIntArray (-1, [from[i], from[i + 1]]));
+}
+this.toLowest = to[0];
+this.toHighest = to[1];
+for (var i = 0; i < to.length; i += 2) {
+this.toLowest = Math.min (this.toLowest, to[i]);
+this.toHighest = Math.max (this.toHighest, to[i + 1]);
+this.toShifts.add ( Clazz_newIntArray (-1, [to[i], to[i + 1]]));
+}
+}, "~A,~A,~N,~N");
+Clazz_makeConstructor (c$, 
+function (map) {
+this.fromLowest = map.fromLowest;
+this.fromHighest = map.fromHighest;
+this.toLowest = map.toLowest;
+this.toHighest = map.toHighest;
+this.fromRatio = map.fromRatio;
+this.toRatio = map.toRatio;
+if (map.fromShifts != null) {
+for (var r, $r = map.fromShifts.iterator (); $r.hasNext () && ((r = $r.next ()) || true);) {
+this.fromShifts.add ( Clazz_newIntArray (-1, [r[0], r[1]]));
+}
+}if (map.toShifts != null) {
+for (var r, $r = map.toShifts.iterator (); $r.hasNext () && ((r = $r.next ()) || true);) {
+this.toShifts.add ( Clazz_newIntArray (-1, [r[0], r[1]]));
+}
+}}, "jalview.util.MapList");
+Clazz_makeConstructor (c$, 
+function (fromRange, toRange, fromRatio, toRatio) {
+this.fromShifts = fromRange;
+this.toShifts = toRange;
+this.fromRatio = fromRatio;
+this.toRatio = toRatio;
+this.fromLowest = 2147483647;
+this.fromHighest = 0;
+for (var range, $range = fromRange.iterator (); $range.hasNext () && ((range = $range.next ()) || true);) {
+this.fromLowest = Math.min (this.fromLowest, range[0]);
+this.fromHighest = Math.max (this.fromHighest, range[1]);
+}
+this.toLowest = 2147483647;
+this.toHighest = 0;
+for (var range, $range = toRange.iterator (); $range.hasNext () && ((range = $range.next ()) || true);) {
+this.toLowest = Math.min (this.toLowest, range[0]);
+this.toHighest = Math.max (this.toHighest, range[1]);
+}
+}, "java.util.List,java.util.List,~N,~N");
+Clazz_defineMethod (c$, "makeFromMap", 
+function () {
+return this.posMap (this.fromShifts, this.fromRatio, this.toShifts, this.toRatio);
+});
+Clazz_defineMethod (c$, "makeToMap", 
+function () {
+return this.posMap (this.toShifts, this.toRatio, this.fromShifts, this.fromRatio);
+});
+Clazz_defineMethod (c$, "posMap", 
+ function (shiftTo, ratio, shiftFrom, toRatio) {
+var iv = 0;
+var ivSize = shiftTo.size ();
+if (iv >= ivSize) {
+return null;
+}var intv = shiftTo.get (iv++);
+var from = intv[0];
+var to = intv[1];
+if (from > to) {
+from = intv[1];
+to = intv[0];
+}while (iv < ivSize) {
+intv = shiftTo.get (iv++);
+if (intv[0] < from) {
+from = intv[0];
+}if (intv[1] < from) {
+from = intv[1];
+}if (intv[0] > to) {
+to = intv[0];
+}if (intv[1] > to) {
+to = intv[1];
+}}
+var tF = 0;
+var tT = 0;
+var mp =  Clazz_newIntArray (to - from + 2, 0);
+for (var i = 0; i < mp.length; i++) {
+var m = jalview.util.MapList.shift (i + from, shiftTo, ratio, shiftFrom, toRatio);
+if (m != null) {
+if (i == 0) {
+tF = tT = m[0];
+} else {
+if (m[0] < tF) {
+tF = m[0];
+}if (m[0] > tT) {
+tT = m[0];
+}}}mp[i] = m;
+}
+var map =  Clazz_newArray (-1, [ Clazz_newIntArray (-1, [from, to, tF, tT]),  Clazz_newIntArray (to - from + 2, 0)]);
+map[0][2] = tF;
+map[0][3] = tT;
+for (var i = 0; i < mp.length; i++) {
+if (mp[i] != null) {
+map[1][i] = mp[i][0] - tF;
+} else {
+map[1][i] = -1;
+}}
+return map;
+}, "java.util.List,~N,java.util.List,~N");
+Clazz_defineMethod (c$, "shiftFrom", 
+function (pos) {
+return jalview.util.MapList.shift (pos, this.fromShifts, this.fromRatio, this.toShifts, this.toRatio);
+}, "~N");
+Clazz_defineMethod (c$, "shiftTo", 
+function (pos) {
+return jalview.util.MapList.shift (pos, this.toShifts, this.toRatio, this.fromShifts, this.fromRatio);
+}, "~N");
+c$.shift = Clazz_defineMethod (c$, "shift", 
+function (pos, shiftTo, fromRatio, shiftFrom, toRatio) {
+var fromCount = jalview.util.MapList.countPos (shiftTo, pos);
+if (fromCount == null) {
+return null;
+}var fromRemainder = (fromCount[0] - 1) % fromRatio;
+var toCount = 1 + ((Clazz_doubleToInt ((fromCount[0] - 1) / fromRatio)) * toRatio);
+var toPos = jalview.util.MapList.countToPos (shiftFrom, toCount);
+if (toPos == null) {
+return null;
+}return  Clazz_newIntArray (-1, [toPos[0], fromRemainder, toPos[1]]);
+}, "~N,java.util.List,~N,java.util.List,~N");
+c$.countPos = Clazz_defineMethod (c$, "countPos", 
+function (shiftTo, pos) {
+var count = 0;
+var intv;
+var iv = 0;
+var ivSize = shiftTo.size ();
+while (iv < ivSize) {
+intv = shiftTo.get (iv++);
+if (intv[0] <= intv[1]) {
+if (pos >= intv[0] && pos <= intv[1]) {
+return  Clazz_newIntArray (-1, [count + pos - intv[0] + 1, 1]);
+} else {
+count += intv[1] - intv[0] + 1;
+}} else {
+if (pos >= intv[1] && pos <= intv[0]) {
+return  Clazz_newIntArray (-1, [count + intv[0] - pos + 1, -1]);
+} else {
+count += intv[0] - intv[1] + 1;
+}}}
+return null;
+}, "java.util.List,~N");
+c$.countToPos = Clazz_defineMethod (c$, "countToPos", 
+function (shiftFrom, pos) {
+var count = 0;
+var diff = 0;
+var iv = 0;
+var ivSize = shiftFrom.size ();
+var intv =  Clazz_newIntArray (-1, [0, 0]);
+while (iv < ivSize) {
+intv = shiftFrom.get (iv++);
+diff = intv[1] - intv[0];
+if (diff >= 0) {
+if (pos <= count + 1 + diff) {
+return  Clazz_newIntArray (-1, [pos - count - 1 + intv[0], 1]);
+} else {
+count += 1 + diff;
+}} else {
+if (pos <= count + 1 - diff) {
+return  Clazz_newIntArray (-1, [intv[0] - (pos - count - 1), -1]);
+} else {
+count += 1 - diff;
+}}}
+return null;
+}, "java.util.List,~N");
+Clazz_defineMethod (c$, "locateInFrom", 
+function (start, end) {
+var fromStart = this.shiftTo (start);
+var fromEnd = this.shiftTo (end);
+return jalview.util.MapList.getIntervals (this.fromShifts, fromStart, fromEnd, this.fromRatio);
+}, "~N,~N");
+Clazz_defineMethod (c$, "locateInTo", 
+function (start, end) {
+var toStart = this.shiftFrom (start);
+var toEnd = this.shiftFrom (end);
+return jalview.util.MapList.getIntervals (this.toShifts, toStart, toEnd, this.toRatio);
+}, "~N,~N");
+c$.getIntervals = Clazz_defineMethod (c$, "getIntervals", 
+function (shiftFrom, fromStart, fromEnd, fromRatio2) {
+if (fromStart == null || fromEnd == null) {
+return null;
+}var startpos;
+var endpos;
+startpos = fromStart[0];
+endpos = fromEnd[0];
+var endindx = (fromRatio2 - 1);
+var intv = 0;
+var intvSize = shiftFrom.size ();
+var iv;
+var i = 0;
+var fs = -1;
+var fe_s = -1;
+var fe = -1;
+while (intv < intvSize && (fs == -1 || fe == -1)) {
+iv = shiftFrom.get (intv++);
+if (fe_s > -1) {
+endpos = iv[0];
+endindx--;
+}if (iv[0] <= iv[1]) {
+if (fs == -1 && startpos >= iv[0] && startpos <= iv[1]) {
+fs = i;
+}if (endpos >= iv[0] && endpos <= iv[1]) {
+if (fe_s == -1) {
+fe_s = i;
+}if (fe_s != -1) {
+if (endpos + endindx <= iv[1]) {
+fe = i;
+endpos = endpos + endindx;
+} else {
+endindx -= iv[1] - endpos;
+}}}} else {
+if (fs == -1 && startpos <= iv[0] && startpos >= iv[1]) {
+fs = i;
+}if (endpos <= iv[0] && endpos >= iv[1]) {
+if (fe_s == -1) {
+fe_s = i;
+}if (fe_s != -1) {
+if (endpos - endindx >= iv[1]) {
+fe = i;
+endpos = endpos - endindx;
+} else {
+endindx -= endpos - iv[1];
+}}}}i++;
+}
+if (fs == fe && fe == -1) {
+return null;
+}var ranges =  new java.util.ArrayList ();
+if (fs <= fe) {
+intv = fs;
+i = fs;
+iv = shiftFrom.get (intv++);
+iv =  Clazz_newIntArray (-1, [iv[0], iv[1]]);
+if (i == fs) {
+iv[0] = startpos;
+}while (i != fe) {
+ranges.add (iv);
+iv = shiftFrom.get (intv++);
+iv =  Clazz_newIntArray (-1, [iv[0], iv[1]]);
+i++;
+}
+if (i == fe) {
+iv[1] = endpos;
+}ranges.add (iv);
+} else {
+i = shiftFrom.size () - 1;
+while (i > fs) {
+i--;
+}
+iv = shiftFrom.get (i);
+iv =  Clazz_newIntArray (-1, [iv[1], iv[0]]);
+if (i == fs) {
+iv[0] = startpos;
+}while (--i != fe) {
+ranges.add (iv);
+iv = shiftFrom.get (i);
+iv =  Clazz_newIntArray (-1, [iv[1], iv[0]]);
+}
+if (i == fe) {
+iv[1] = endpos;
+}ranges.add (iv);
+}var range = null;
+if (ranges != null && ranges.size () > 0) {
+range =  Clazz_newIntArray (ranges.size () * 2, 0);
+intv = 0;
+intvSize = ranges.size ();
+i = 0;
+while (intv < intvSize) {
+iv = ranges.get (intv);
+range[i++] = iv[0];
+range[i++] = iv[1];
+ranges.set (intv++, null);
+}
+}return range;
+}, "java.util.List,~A,~A,~N");
+Clazz_defineMethod (c$, "getToPosition", 
+function (mpos) {
+var mp = this.shiftTo (mpos);
+if (mp != null) {
+return mp[0];
+}return mpos;
+}, "~N");
+Clazz_defineMethod (c$, "getToWord", 
+function (mpos) {
+var mp = this.shiftTo (mpos);
+if (mp != null) {
+return  Clazz_newIntArray (-1, [mp[0], mp[0] + mp[2] * (this.getFromRatio () - 1)]);
+}return null;
+}, "~N");
+Clazz_defineMethod (c$, "getMappedPosition", 
+function (pos) {
+var mp = this.shiftFrom (pos);
+if (mp != null) {
+return mp[0];
+}return pos;
+}, "~N");
+Clazz_defineMethod (c$, "getMappedWord", 
+function (pos) {
+var mp = this.shiftFrom (pos);
+if (mp != null) {
+return  Clazz_newIntArray (-1, [mp[0], mp[0] + mp[2] * (this.getToRatio () - 1)]);
+}return null;
+}, "~N");
+Clazz_defineMethod (c$, "getInverse", 
+function () {
+return  new jalview.util.MapList (this.getToRanges (), this.getFromRanges (), this.getToRatio (), this.getFromRatio ());
+});
+Clazz_defineMethod (c$, "containsEither", 
+function (local, map) {
+if (local) {
+return ((this.getFromLowest () >= map.getFromLowest () && this.getFromHighest () <= map.getFromHighest ()) || (this.getFromLowest () <= map.getFromLowest () && this.getFromHighest () >= map.getFromHighest ()));
+} else {
+return ((this.getToLowest () >= map.getToLowest () && this.getToHighest () <= map.getToHighest ()) || (this.getToLowest () <= map.getToLowest () && this.getToHighest () >= map.getToHighest ()));
+}}, "~B,jalview.util.MapList");
+Clazz_overrideMethod (c$, "toString", 
+function () {
+var sb =  new StringBuilder (64);
+sb.append ("From (").append (this.fromRatio).append (":").append (this.toRatio).append (") [");
+for (var shift, $shift = this.fromShifts.iterator (); $shift.hasNext () && ((shift = $shift.next ()) || true);) {
+sb.append (" ").append (java.util.Arrays.toString (shift));
+}
+sb.append (" ] To [");
+for (var shift, $shift = this.toShifts.iterator (); $shift.hasNext () && ((shift = $shift.next ()) || true);) {
+sb.append (" ").append (java.util.Arrays.toString (shift));
+}
+sb.append (" ]");
+return sb.toString ();
+});
+});
+Clazz_declarePackage ("jalview.util");
+Clazz_load (null, "jalview.util.MappingUtils", ["jalview.analysis.AlignmentSorter", "jalview.commands.EditCommand", "$.OrderCommand", "jalview.datamodel.AlignmentOrder", "$.ColumnSelection", "$.SearchResults", "$.Sequence", "$.SequenceGroup", "jalview.util.Comparison", "$.StringUtils", "java.util.ArrayList", "$.Collections", "$.HashMap"], function () {
+c$ = Clazz_declareType (jalview.util, "MappingUtils");
+c$.mapCutOrPaste = Clazz_defineMethod (c$, "mapCutOrPaste", 
+function (edit, undo, targetSeqs, result, mappings) {
+var action = edit.getAction ();
+if (undo) {
+action = action.getUndoAction ();
+}System.err.println ("MappingUtils.mapCutOrPaste not yet implemented");
+}, "jalview.commands.EditCommand.Edit,~B,java.util.List,jalview.commands.EditCommand,java.util.Set");
+c$.mapEditCommand = Clazz_defineMethod (c$, "mapEditCommand", 
+function (command, undo, mapTo, gapChar, mappings) {
+if (!mapTo.isNucleotide ()) {
+return null;
+}var targetCopies =  new java.util.HashMap ();
+for (var seq, $seq = mapTo.getSequences ().iterator (); $seq.hasNext () && ((seq = $seq.next ()) || true);) {
+var ds = seq.getDatasetSequence ();
+if (ds != null) {
+var copy =  new jalview.datamodel.Sequence (seq);
+copy.setDatasetSequence (ds);
+targetCopies.put (ds, copy);
+}}
+var originalSequences = command.priorState (undo);
+var result =  new jalview.commands.EditCommand ();
+var edits = command.getEditIterator (!undo);
+while (edits.hasNext ()) {
+var edit = edits.next ();
+if (edit.getAction () === jalview.commands.EditCommand.Action.CUT || edit.getAction () === jalview.commands.EditCommand.Action.PASTE) {
+jalview.util.MappingUtils.mapCutOrPaste (edit, undo, mapTo.getSequences (), result, mappings);
+} else if (edit.getAction () === jalview.commands.EditCommand.Action.INSERT_GAP || edit.getAction () === jalview.commands.EditCommand.Action.DELETE_GAP) {
+jalview.util.MappingUtils.mapInsertOrDelete (edit, undo, originalSequences, mapTo.getSequences (), targetCopies, gapChar, result, mappings);
+}}
+return result.getSize () > 0 ? result : null;
+}, "jalview.commands.EditCommand,~B,jalview.datamodel.AlignmentI,~S,java.util.Set");
+c$.mapInsertOrDelete = Clazz_defineMethod (c$, "mapInsertOrDelete", 
+function (edit, undo, originalSequences, targetSeqs, targetCopies, gapChar, result, mappings) {
+var action = edit.getAction ();
+if (undo) {
+action = action.getUndoAction ();
+}var count = edit.getNumber ();
+var editPos = edit.getPosition ();
+for (var seq, $seq = 0, $$seq = edit.getSequences (); $seq < $$seq.length && ((seq = $$seq[$seq]) || true); $seq++) {
+var ds = seq.getDatasetSequence ();
+if (ds == null) {
+continue;
+}var actedOn = originalSequences.get (ds);
+var seqpos = actedOn.findPosition (editPos);
+var sr = jalview.util.MappingUtils.buildSearchResults (seq, seqpos, mappings);
+if (!sr.isEmpty ()) {
+for (var targetSeq, $targetSeq = targetSeqs.iterator (); $targetSeq.hasNext () && ((targetSeq = $targetSeq.next ()) || true);) {
+ds = targetSeq.getDatasetSequence ();
+if (ds == null) {
+continue;
+}var copyTarget = targetCopies.get (ds);
+var match = sr.getResults (copyTarget, 0, copyTarget.getLength ());
+if (match != null) {
+var ratio = 3;
+var mappedCount = count * 3;
+var mappedEditPos = action === jalview.commands.EditCommand.Action.DELETE_GAP ? match[0] - mappedCount : match[0];
+var e = resultClazz_innerTypeInstance (jalview.commands.EditCommand.Edit, this, null, action,  Clazz_newArray (-1, [targetSeq]), mappedEditPos, mappedCount, gapChar);
+result.addEdit (e);
+if (action === jalview.commands.EditCommand.Action.INSERT_GAP) {
+copyTarget.setSequence ( String.instantialize (jalview.util.StringUtils.insertCharAt (copyTarget.getSequence (), mappedEditPos, mappedCount, gapChar)));
+} else if (action === jalview.commands.EditCommand.Action.DELETE_GAP) {
+copyTarget.setSequence ( String.instantialize (jalview.util.StringUtils.deleteChars (copyTarget.getSequence (), mappedEditPos, mappedEditPos + mappedCount)));
+}}}
+}if (action === jalview.commands.EditCommand.Action.INSERT_GAP) {
+actedOn.setSequence ( String.instantialize (jalview.util.StringUtils.insertCharAt (actedOn.getSequence (), editPos, count, gapChar)));
+} else if (action === jalview.commands.EditCommand.Action.DELETE_GAP) {
+actedOn.setSequence ( String.instantialize (jalview.util.StringUtils.deleteChars (actedOn.getSequence (), editPos, editPos + count)));
+}}
+}, "jalview.commands.EditCommand.Edit,~B,java.util.Map,java.util.List,java.util.Map,~S,jalview.commands.EditCommand,java.util.Set");
+c$.buildSearchResults = Clazz_defineMethod (c$, "buildSearchResults", 
+function (seq, index, seqmappings) {
+var results =  new jalview.datamodel.SearchResults ();
+jalview.util.MappingUtils.addSearchResults (results, seq, index, seqmappings);
+return results;
+}, "jalview.datamodel.SequenceI,~N,java.util.Set");
+c$.addSearchResults = Clazz_defineMethod (c$, "addSearchResults", 
+function (results, seq, index, seqmappings) {
+if (index >= seq.getStart () && index <= seq.getEnd ()) {
+for (var acf, $acf = seqmappings.iterator (); $acf.hasNext () && ((acf = $acf.next ()) || true);) {
+acf.markMappedRegion (seq, index, results);
+}
+}}, "jalview.datamodel.SearchResults,jalview.datamodel.SequenceI,~N,java.util.Set");
+c$.mapSequenceGroup = Clazz_defineMethod (c$, "mapSequenceGroup", 
+function (sg, mapFrom, mapTo) {
+var targetIsNucleotide = mapTo.isNucleotide ();
+var protein = targetIsNucleotide ? mapFrom : mapTo;
+var codonFrames = protein.getAlignment ().getCodonFrames ();
+var mappedGroup =  new jalview.datamodel.SequenceGroup (sg);
+mappedGroup.cs = mapTo.getGlobalColourScheme ();
+mappedGroup.clear ();
+var minStartCol = -1;
+var maxEndCol = -1;
+var selectionStartRes = sg.getStartRes ();
+var selectionEndRes = sg.getEndRes ();
+for (var selected, $selected = sg.getSequences ().iterator (); $selected.hasNext () && ((selected = $selected.next ()) || true);) {
+var firstUngappedPos = selectionStartRes;
+while (firstUngappedPos <= selectionEndRes && jalview.util.Comparison.isGap (selected.getCharAt (firstUngappedPos))) {
+firstUngappedPos++;
+}
+if (firstUngappedPos > selectionEndRes) {
+continue;
+}var lastUngappedPos = selectionEndRes;
+while (lastUngappedPos >= selectionStartRes && jalview.util.Comparison.isGap (selected.getCharAt (lastUngappedPos))) {
+lastUngappedPos--;
+}
+var startResiduePos = selected.findPosition (firstUngappedPos);
+var endResiduePos = selected.findPosition (lastUngappedPos);
+for (var acf, $acf = codonFrames.iterator (); $acf.hasNext () && ((acf = $acf.next ()) || true);) {
+var mappedSequence = targetIsNucleotide ? acf.getDnaForAaSeq (selected) : acf.getAaForDnaSeq (selected);
+if (mappedSequence != null) {
+for (var seq, $seq = mapTo.getAlignment ().getSequences ().iterator (); $seq.hasNext () && ((seq = $seq.next ()) || true);) {
+var mappedStartResidue = 0;
+var mappedEndResidue = 0;
+if (seq.getDatasetSequence () === mappedSequence) {
+var sr = jalview.util.MappingUtils.buildSearchResults (selected, startResiduePos, java.util.Collections.singleton (acf));
+for (var m, $m = sr.getResults ().iterator (); $m.hasNext () && ((m = $m.next ()) || true);) {
+mappedStartResidue = m.getStart ();
+mappedEndResidue = m.getEnd ();
+}
+sr = jalview.util.MappingUtils.buildSearchResults (selected, endResiduePos, java.util.Collections.singleton (acf));
+for (var m, $m = sr.getResults ().iterator (); $m.hasNext () && ((m = $m.next ()) || true);) {
+mappedStartResidue = Math.min (mappedStartResidue, m.getStart ());
+mappedEndResidue = Math.max (mappedEndResidue, m.getEnd ());
+}
+var mappedStartCol = seq.findIndex (mappedStartResidue) - 1;
+minStartCol = minStartCol == -1 ? mappedStartCol : Math.min (minStartCol, mappedStartCol);
+var mappedEndCol = seq.findIndex (mappedEndResidue) - 1;
+maxEndCol = maxEndCol == -1 ? mappedEndCol : Math.max (maxEndCol, mappedEndCol);
+mappedGroup.addSequence (seq, false);
+break;
+}}
+}}
+}
+mappedGroup.setStartRes (minStartCol < 0 ? 0 : minStartCol);
+mappedGroup.setEndRes (maxEndCol < 0 ? 0 : maxEndCol);
+return mappedGroup;
+}, "jalview.datamodel.SequenceGroup,jalview.api.AlignViewportI,jalview.api.AlignViewportI");
+c$.mapOrderCommand = Clazz_defineMethod (c$, "mapOrderCommand", 
+function (command, undo, mapTo, mappings) {
+var sortOrder = command.getSequenceOrder (undo);
+var mappedOrder =  new java.util.ArrayList ();
+var j = 0;
+var mappingToNucleotide = mapTo.isNucleotide ();
+for (var seq, $seq = 0, $$seq = sortOrder; $seq < $$seq.length && ((seq = $$seq[$seq]) || true); $seq++) {
+for (var acf, $acf = mappings.iterator (); $acf.hasNext () && ((acf = $acf.next ()) || true);) {
+var mappedSeq = mappingToNucleotide ? acf.getDnaForAaSeq (seq) : acf.getAaForDnaSeq (seq);
+if (mappedSeq != null) {
+for (var seq2, $seq2 = mapTo.getSequences ().iterator (); $seq2.hasNext () && ((seq2 = $seq2.next ()) || true);) {
+if (seq2.getDatasetSequence () === mappedSeq) {
+mappedOrder.add (seq2);
+j++;
+break;
+}}
+}}
+}
+if (j == 0) {
+return null;
+}if (j < mapTo.getHeight ()) {
+for (var seq, $seq = mapTo.getSequences ().iterator (); $seq.hasNext () && ((seq = $seq.next ()) || true);) {
+if (!mappedOrder.contains (seq)) {
+mappedOrder.add (seq);
+}}
+}var mappedOrderArray = mappedOrder.toArray ( new Array (mappedOrder.size ()));
+var oldOrder = mapTo.getSequencesArray ();
+jalview.analysis.AlignmentSorter.sortBy (mapTo,  new jalview.datamodel.AlignmentOrder (mappedOrderArray));
+var result =  new jalview.commands.OrderCommand (command.getDescription (), oldOrder, mapTo);
+return result;
+}, "jalview.commands.OrderCommand,~B,jalview.datamodel.AlignmentI,java.util.Set");
+c$.mapColumnSelection = Clazz_defineMethod (c$, "mapColumnSelection", 
+function (colsel, mapFrom, mapTo) {
+var targetIsNucleotide = mapTo.isNucleotide ();
+var protein = targetIsNucleotide ? mapFrom : mapTo;
+var codonFrames = protein.getAlignment ().getCodonFrames ();
+var mappedColumns =  new jalview.datamodel.ColumnSelection ();
+if (colsel == null) {
+return mappedColumns;
+}var fromGapChar = mapFrom.getAlignment ().getGapCharacter ();
+for (var obj, $obj = colsel.getSelected ().iterator (); $obj.hasNext () && ((obj = $obj.next ()) || true);) {
+var col = (obj).intValue ();
+var mappedToMin = 2147483647;
+var mappedToMax = -2147483648;
+for (var fromSeq, $fromSeq = mapFrom.getAlignment ().getSequences ().iterator (); $fromSeq.hasNext () && ((fromSeq = $fromSeq.next ()) || true);) {
+if (fromSeq.getCharAt (col) == fromGapChar) {
+continue;
+}var residuePos = fromSeq.findPosition (col);
+var sr = jalview.util.MappingUtils.buildSearchResults (fromSeq, residuePos, codonFrames);
+for (var m, $m = sr.getResults ().iterator (); $m.hasNext () && ((m = $m.next ()) || true);) {
+var mappedStartResidue = m.getStart ();
+var mappedEndResidue = m.getEnd ();
+var mappedSeq = m.getSequence ();
+for (var toSeq, $toSeq = mapTo.getAlignment ().getSequences ().iterator (); $toSeq.hasNext () && ((toSeq = $toSeq.next ()) || true);) {
+if (toSeq.getDatasetSequence () === mappedSeq) {
+var mappedStartCol = toSeq.findIndex (mappedStartResidue);
+var mappedEndCol = toSeq.findIndex (mappedEndResidue);
+mappedToMin = Math.min (mappedToMin, mappedStartCol);
+mappedToMax = Math.max (mappedToMax, mappedEndCol);
+break;
+}}
+}
+}
+for (var i = mappedToMin; i <= mappedToMax; i++) {
+mappedColumns.addElement (i - 1);
+}
+}
+return mappedColumns;
+}, "jalview.datamodel.ColumnSelection,jalview.api.AlignViewportI,jalview.api.AlignViewportI");
+c$.findCodonFor = Clazz_defineMethod (c$, "findCodonFor", 
+function (seq, col, mappings) {
+var dsPos = seq.findPosition (col);
+for (var mapping, $mapping = mappings.iterator (); $mapping.hasNext () && ((mapping = $mapping.next ()) || true);) {
+if (mapping.involvesSequence (seq)) {
+return mapping.getMappedCodon (seq.getDatasetSequence (), dsPos);
+}}
+return null;
+}, "jalview.datamodel.SequenceI,~N,java.util.Set");
+c$.flattenRanges = Clazz_defineMethod (c$, "flattenRanges", 
+function (ranges) {
+var count = 0;
+for (var i = 0; i < ranges.length - 1; i += 2) {
+count += ranges[i + 1] - ranges[i] + 1;
+}
+var result =  Clazz_newIntArray (count, 0);
+var k = 0;
+for (var i = 0; i < ranges.length - 1; i += 2) {
+for (var j = ranges[i]; j <= ranges[i + 1]; j++) {
+result[k++] = j;
+}
+}
+return result;
+}, "~A");
+c$.findMappingsForSequence = Clazz_defineMethod (c$, "findMappingsForSequence", 
+function (sequence, mappings) {
+var result =  new java.util.ArrayList ();
+if (sequence == null || mappings == null) {
+return result;
+}for (var mapping, $mapping = mappings.iterator (); $mapping.hasNext () && ((mapping = $mapping.next ()) || true);) {
+if (mapping.involvesSequence (sequence)) {
+result.add (mapping);
+}}
+return result;
+}, "jalview.datamodel.SequenceI,java.util.Set");
+});
+Clazz_declarePackage ("jalview.commands");
+Clazz_load (["jalview.commands.CommandI", "java.lang.Enum", "java.util.ArrayList"], "jalview.commands.EditCommand", ["jalview.analysis.AlignSeq", "jalview.datamodel.AlignmentAnnotation", "$.Annotation", "$.Sequence", "$.SequenceFeature", "jalview.schemes.ResidueProperties", "jalview.util.Comparison", "$.ReverseListIterator", "$.StringUtils", "java.lang.StringBuffer", "java.util.HashMap", "$.Hashtable"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.edits = null;
+this.description = null;
+if (!Clazz_isClassDefined ("jalview.commands.EditCommand.Edit")) {
+jalview.commands.EditCommand.$EditCommand$Edit$ ();
+}
+Clazz_instantialize (this, arguments);
+}, jalview.commands, "EditCommand", null, jalview.commands.CommandI);
+Clazz_prepareFields (c$, function () {
+this.edits =  new java.util.ArrayList ();
+});
+Clazz_makeConstructor (c$, 
+function () {
+});
+Clazz_makeConstructor (c$, 
+function (description) {
+this.description = description;
+}, "~S");
+Clazz_makeConstructor (c$, 
+function (description, command, seqs, position, number, al) {
+this.description = description;
+if (command === jalview.commands.EditCommand.Action.CUT || command === jalview.commands.EditCommand.Action.PASTE) {
+this.setEdit (Clazz_innerTypeInstance (jalview.commands.EditCommand.Edit, this, null, command, seqs, position, number, al));
+}this.performEdit (0, null);
+}, "~S,jalview.commands.EditCommand.Action,~A,~N,~N,jalview.datamodel.AlignmentI");
+Clazz_makeConstructor (c$, 
+function (description, command, replace, seqs, position, number, al) {
+this.description = description;
+if (command === jalview.commands.EditCommand.Action.REPLACE) {
+this.setEdit (Clazz_innerTypeInstance (jalview.commands.EditCommand.Edit, this, null, command, seqs, position, number, al, replace));
+}this.performEdit (0, null);
+}, "~S,jalview.commands.EditCommand.Action,~S,~A,~N,~N,jalview.datamodel.AlignmentI");
+Clazz_defineMethod (c$, "setEdit", 
+function (e) {
+this.edits.clear ();
+this.edits.add (e);
+}, "jalview.commands.EditCommand.Edit");
+Clazz_defineMethod (c$, "addEdit", 
+function (e) {
+if (!jalview.commands.EditCommand.expandEdit (this.edits, e)) {
+this.edits.add (e);
+}}, "jalview.commands.EditCommand.Edit");
+c$.expandEdit = Clazz_defineMethod (c$, "expandEdit", 
+function (edits, e) {
+if (edits == null || edits.isEmpty ()) {
+return false;
+}var lastEdit = edits.get (edits.size () - 1);
+var action = e.command;
+if (lastEdit.command !== action) {
+return false;
+}if (lastEdit.seqs.length != e.seqs.length) {
+return false;
+}for (var i = 0; i < e.seqs.length; i++) {
+if (lastEdit.seqs[i].getDatasetSequence () !== e.seqs[i].getDatasetSequence ()) {
+return false;
+}}
+var contiguous = (action === jalview.commands.EditCommand.Action.INSERT_GAP && e.position == lastEdit.position + lastEdit.number) || (action === jalview.commands.EditCommand.Action.DELETE_GAP && e.position + e.number == lastEdit.position);
+if (contiguous) {
+lastEdit.number += e.number;
+lastEdit.seqs = e.seqs;
+if (action === jalview.commands.EditCommand.Action.DELETE_GAP) {
+lastEdit.position--;
+}return true;
+}return false;
+}, "java.util.List,jalview.commands.EditCommand.Edit");
+Clazz_defineMethod (c$, "clearEdits", 
+function () {
+this.edits.clear ();
+});
+Clazz_defineMethod (c$, "getEdit", 
+function (i) {
+if (i >= 0 && i < this.edits.size ()) {
+return this.edits.get (i);
+}return null;
+}, "~N");
+Clazz_overrideMethod (c$, "getDescription", 
+function () {
+return this.description;
+});
+Clazz_overrideMethod (c$, "getSize", 
+function () {
+return this.edits.size ();
+});
+Clazz_defineMethod (c$, "getAlignment", 
+function () {
+return (this.edits.isEmpty () ? null : this.edits.get (0).al);
+});
+Clazz_defineMethod (c$, "appendEdit", 
+function (command, seqs, position, number, al, performEdit) {
+this.appendEdit (command, seqs, position, number, al, performEdit, null);
+}, "jalview.commands.EditCommand.Action,~A,~N,~N,jalview.datamodel.AlignmentI,~B");
+Clazz_defineMethod (c$, "appendEdit", 
+function (command, seqs, position, number, al, performEdit, views) {
+var edit = Clazz_innerTypeInstance (jalview.commands.EditCommand.Edit, this, null, command, seqs, position, number, al.getGapCharacter ());
+if (al.getHeight () == seqs.length) {
+edit.al = al;
+edit.fullAlignmentHeight = true;
+}this.addEdit (edit);
+if (performEdit) {
+jalview.commands.EditCommand.performEdit (edit, views);
+}}, "jalview.commands.EditCommand.Action,~A,~N,~N,jalview.datamodel.AlignmentI,~B,~A");
+Clazz_defineMethod (c$, "appendEdit", 
+function (edit, al, performEdit, views) {
+if (al.getHeight () == edit.seqs.length) {
+edit.al = al;
+edit.fullAlignmentHeight = true;
+}this.addEdit (edit);
+if (performEdit) {
+jalview.commands.EditCommand.performEdit (edit, views);
+}}, "jalview.commands.EditCommand.Edit,jalview.datamodel.AlignmentI,~B,~A");
+Clazz_defineMethod (c$, "performEdit", 
+function (commandIndex, views) {
+var iterator = this.edits.listIterator (commandIndex);
+while (iterator.hasNext ()) {
+var edit = iterator.next ();
+jalview.commands.EditCommand.performEdit (edit, views);
+}
+}, "~N,~A");
+c$.performEdit = Clazz_defineMethod (c$, "performEdit", 
+function (edit, views) {
+switch (edit.command) {
+case jalview.commands.EditCommand.Action.INSERT_GAP:
+jalview.commands.EditCommand.insertGap (edit);
+break;
+case jalview.commands.EditCommand.Action.DELETE_GAP:
+jalview.commands.EditCommand.deleteGap (edit);
+break;
+case jalview.commands.EditCommand.Action.CUT:
+jalview.commands.EditCommand.cut (edit, views);
+break;
+case jalview.commands.EditCommand.Action.PASTE:
+jalview.commands.EditCommand.paste (edit, views);
+break;
+case jalview.commands.EditCommand.Action.REPLACE:
+jalview.commands.EditCommand.replace (edit);
+break;
+case jalview.commands.EditCommand.Action.INSERT_NUC:
+break;
+default:
+break;
+}
+}, "jalview.commands.EditCommand.Edit,~A");
+Clazz_overrideMethod (c$, "doCommand", 
+function (views) {
+this.performEdit (0, views);
+}, "~A");
+Clazz_overrideMethod (c$, "undoCommand", 
+function (views) {
+var iterator = this.edits.listIterator (this.edits.size ());
+while (iterator.hasPrevious ()) {
+var e = iterator.previous ();
+switch (e.command) {
+case jalview.commands.EditCommand.Action.INSERT_GAP:
+jalview.commands.EditCommand.deleteGap (e);
+break;
+case jalview.commands.EditCommand.Action.DELETE_GAP:
+jalview.commands.EditCommand.insertGap (e);
+break;
+case jalview.commands.EditCommand.Action.CUT:
+jalview.commands.EditCommand.paste (e, views);
+break;
+case jalview.commands.EditCommand.Action.PASTE:
+jalview.commands.EditCommand.cut (e, views);
+break;
+case jalview.commands.EditCommand.Action.REPLACE:
+jalview.commands.EditCommand.replace (e);
+break;
+case jalview.commands.EditCommand.Action.INSERT_NUC:
+break;
+default:
+break;
+}
+}
+}, "~A");
+c$.insertGap = Clazz_defineMethod (c$, "insertGap", 
+ function (command) {
+for (var s = 0; s < command.seqs.length; s++) {
+command.seqs[s].insertCharAt (command.position, command.number, command.gapChar);
+}
+jalview.commands.EditCommand.adjustAnnotations (command, true, false, null);
+}, "jalview.commands.EditCommand.Edit");
+c$.deleteGap = Clazz_defineMethod (c$, "deleteGap", 
+ function (command) {
+for (var s = 0; s < command.seqs.length; s++) {
+command.seqs[s].deleteChars (command.position, command.position + command.number);
+}
+jalview.commands.EditCommand.adjustAnnotations (command, false, false, null);
+}, "jalview.commands.EditCommand.Edit");
+c$.cut = Clazz_defineMethod (c$, "cut", 
+function (command, views) {
+var seqDeleted = false;
+command.string =  Clazz_newCharArray (command.seqs.length, '\0');
+for (var i = 0; i < command.seqs.length; i++) {
+var sequence = command.seqs[i];
+if (sequence.getLength () > command.position) {
+command.string[i] = sequence.getSequence (command.position, command.position + command.number);
+var oldds = sequence.getDatasetSequence ();
+if (command.oldds != null && command.oldds[i] != null) {
+sequence.setDatasetSequence (null);
+}sequence.deleteChars (command.position, command.position + command.number);
+if (command.oldds != null && command.oldds[i] != null) {
+sequence.setDatasetSequence (command.oldds[i]);
+command.oldds[i] = oldds;
+} else {
+if (oldds !== sequence.getDatasetSequence () || sequence.getSequenceFeatures () != null) {
+if (command.oldds == null) {
+command.oldds =  new Array (command.seqs.length);
+}command.oldds[i] = oldds;
+jalview.commands.EditCommand.adjustFeatures (command, i, sequence.findPosition (command.position), sequence.findPosition (command.position + command.number), false);
+}}}if (sequence.getLength () < 1) {
+command.al.deleteSequence (sequence);
+seqDeleted = true;
+}}
+jalview.commands.EditCommand.adjustAnnotations (command, false, seqDeleted, views);
+}, "jalview.commands.EditCommand.Edit,~A");
+c$.paste = Clazz_defineMethod (c$, "paste", 
+function (command, views) {
+var tmp;
+var newDSNeeded;
+var newDSWasNeeded;
+var newstart;
+var newend;
+var seqWasDeleted = false;
+var start = 0;
+var end = 0;
+for (var i = 0; i < command.seqs.length; i++) {
+newDSNeeded = false;
+newDSWasNeeded = command.oldds != null && command.oldds[i] != null;
+if (command.seqs[i].getLength () < 1) {
+if (command.alIndex[i] < command.al.getHeight ()) {
+var sequences;
+{
+if (!(command.alIndex[i] < 0)) {
+sequences.add (command.alIndex[i], command.seqs[i]);
+}}} else {
+command.al.addSequence (command.seqs[i]);
+}seqWasDeleted = true;
+}newstart = command.seqs[i].getStart ();
+newend = command.seqs[i].getEnd ();
+tmp =  new StringBuffer ();
+tmp.append (command.seqs[i].getSequence ());
+if (command.string != null && command.string[i] != null) {
+if (command.position >= tmp.length ()) {
+var length = command.position - tmp.length ();
+while (length > 0) {
+tmp.append (command.gapChar);
+length--;
+}
+}tmp.insert (command.position, command.string[i]);
+for (var s = 0; s < command.string[i].length; s++) {
+if (jalview.schemes.ResidueProperties.aaIndex[command.string[i][s].charCodeAt (0)] != 23) {
+if (!newDSNeeded) {
+newDSNeeded = true;
+start = command.seqs[i].findPosition (command.position);
+end = command.seqs[i].findPosition (command.position + command.number);
+}if (command.seqs[i].getStart () == start) {
+newstart--;
+} else {
+newend++;
+}}}
+command.string[i] = null;
+}command.seqs[i].setSequence (tmp.toString ());
+command.seqs[i].setStart (newstart);
+command.seqs[i].setEnd (newend);
+if (newDSNeeded) {
+if (command.seqs[i].getDatasetSequence () != null) {
+var ds;
+if (newDSWasNeeded) {
+ds = command.oldds[i];
+} else {
+ds =  new jalview.datamodel.Sequence (command.seqs[i].getName (), jalview.analysis.AlignSeq.extractGaps (jalview.util.Comparison.GapChars, command.seqs[i].getSequenceAsString ()), command.seqs[i].getStart (), command.seqs[i].getEnd ());
+ds.setDescription (command.seqs[i].getDescription ());
+}if (command.oldds == null) {
+command.oldds =  new Array (command.seqs.length);
+}command.oldds[i] = command.seqs[i].getDatasetSequence ();
+command.seqs[i].setDatasetSequence (ds);
+}jalview.commands.EditCommand.adjustFeatures (command, i, start, end, true);
+}}
+jalview.commands.EditCommand.adjustAnnotations (command, true, seqWasDeleted, views);
+command.string = null;
+}, "jalview.commands.EditCommand.Edit,~A");
+c$.replace = Clazz_defineMethod (c$, "replace", 
+function (command) {
+var tmp;
+var oldstring;
+var start = command.position;
+var end = command.number;
+command.number = start + command.string[0].length;
+for (var i = 0; i < command.seqs.length; i++) {
+var newDSWasNeeded = command.oldds != null && command.oldds[i] != null;
+oldstring = command.seqs[i].getSequenceAsString ();
+tmp =  new StringBuffer (oldstring.substring (0, start));
+tmp.append (command.string[i]);
+var nogaprep = jalview.analysis.AlignSeq.extractGaps (jalview.util.Comparison.GapChars,  String.instantialize (command.string[i]));
+var ipos = command.seqs[i].findPosition (start) - command.seqs[i].getStart ();
+tmp.append (oldstring.substring (end));
+command.seqs[i].setSequence (tmp.toString ());
+command.string[i] = oldstring.substring (start, end).toCharArray ();
+var nogapold = jalview.analysis.AlignSeq.extractGaps (jalview.util.Comparison.GapChars,  String.instantialize (command.string[i]));
+if (!nogaprep.toLowerCase ().equals (nogapold.toLowerCase ())) {
+if (newDSWasNeeded) {
+var oldds = command.seqs[i].getDatasetSequence ();
+command.seqs[i].setDatasetSequence (command.oldds[i]);
+command.oldds[i] = oldds;
+} else {
+if (command.oldds == null) {
+command.oldds =  new Array (command.seqs.length);
+}command.oldds[i] = command.seqs[i].getDatasetSequence ();
+var newds =  new jalview.datamodel.Sequence (command.seqs[i].getDatasetSequence ());
+var fullseq;
+var osp = newds.getSequenceAsString ();
+fullseq = osp.substring (0, ipos) + nogaprep + osp.substring (ipos + nogaprep.length);
+newds.setSequence (fullseq.toUpperCase ());
+command.seqs[i].setDatasetSequence (newds);
+}}tmp = null;
+oldstring = null;
+}
+}, "jalview.commands.EditCommand.Edit");
+c$.adjustAnnotations = Clazz_defineMethod (c$, "adjustAnnotations", 
+function (command, insert, modifyVisibility, views) {
+var annotations = null;
+if (modifyVisibility && !insert) {
+command.deletedAnnotationRows =  new java.util.Hashtable ();
+}if (command.fullAlignmentHeight) {
+annotations = command.al.getAlignmentAnnotation ();
+} else {
+var aSize = 0;
+var tmp;
+for (var s = 0; s < command.seqs.length; s++) {
+if (modifyVisibility) {
+if (!insert) {
+tmp = command.seqs[s].getAnnotation ();
+if (tmp != null) {
+var alen = tmp.length;
+for (var aa = 0; aa < tmp.length; aa++) {
+if (!command.al.deleteAnnotation (tmp[aa])) {
+tmp[aa] = null;
+alen--;
+}}
+command.seqs[s].setAlignmentAnnotation (null);
+if (alen != tmp.length) {
+var saved =  new Array (alen);
+for (var aa = 0, aapos = 0; aa < tmp.length; aa++) {
+if (tmp[aa] != null) {
+saved[aapos++] = tmp[aa];
+tmp[aa] = null;
+}}
+tmp = saved;
+command.deletedAnnotationRows.put (command.seqs[s], saved);
+for (var alview = 0; views != null && alview < views.length; alview++) {
+if (views[alview] !== command.al) {
+var toremove = views[alview].getAlignmentAnnotation ();
+if (toremove == null || toremove.length == 0) {
+continue;
+}for (var aa = 0; aa < toremove.length; aa++) {
+if (toremove[aa].sequenceRef === command.seqs[s]) {
+views[alview].deleteAnnotation (toremove[aa]);
+}}
+}}
+} else {
+command.deletedAnnotationRows.put (command.seqs[s], tmp);
+}}} else {
+if (command.deletedAnnotationRows != null && command.deletedAnnotationRows.containsKey (command.seqs[s])) {
+var revealed = command.deletedAnnotationRows.get (command.seqs[s]);
+command.seqs[s].setAlignmentAnnotation (revealed);
+if (revealed != null) {
+for (var aa = 0; aa < revealed.length; aa++) {
+command.al.addAnnotation (revealed[aa]);
+}
+for (var aa = 0; aa < revealed.length; aa++) {
+command.al.setAnnotationIndex (revealed[aa], aa);
+}
+for (var vnum = 0; views != null && vnum < views.length; vnum++) {
+if (views[vnum] !== command.al) {
+var avwidth = views[vnum].getWidth () + 1;
+for (var a = 0; a < revealed.length; a++) {
+var newann =  new jalview.datamodel.AlignmentAnnotation (revealed[a]);
+command.seqs[s].addAlignmentAnnotation (newann);
+newann.padAnnotation (avwidth);
+views[vnum].addAnnotation (newann);
+views[vnum].setAnnotationIndex (newann, a);
+}
+}}
+}}}continue;
+}if (command.seqs[s].getAnnotation () == null) {
+continue;
+}if (aSize == 0) {
+annotations = command.seqs[s].getAnnotation ();
+} else {
+tmp =  new Array (aSize + command.seqs[s].getAnnotation ().length);
+System.arraycopy (annotations, 0, tmp, 0, aSize);
+System.arraycopy (command.seqs[s].getAnnotation (), 0, tmp, aSize, command.seqs[s].getAnnotation ().length);
+annotations = tmp;
+}aSize = annotations.length;
+}
+}if (annotations == null) {
+return;
+}if (!insert) {
+command.deletedAnnotations =  new java.util.Hashtable ();
+}var aSize;
+var temp;
+for (var a = 0; a < annotations.length; a++) {
+if (annotations[a].autoCalculated || annotations[a].annotations == null) {
+continue;
+}var tSize = 0;
+aSize = annotations[a].annotations.length;
+if (insert) {
+temp =  new Array (aSize + command.number);
+if (annotations[a].padGaps) {
+for (var aa = 0; aa < temp.length; aa++) {
+temp[aa] =  new jalview.datamodel.Annotation (command.gapChar + "", null, ' ', 0);
+}
+}} else {
+if (command.position < aSize) {
+if (command.position + command.number >= aSize) {
+tSize = aSize;
+} else {
+tSize = aSize - command.number;
+}} else {
+tSize = aSize;
+}if (tSize < 0) {
+tSize = aSize;
+}temp =  new Array (tSize);
+}if (insert) {
+if (command.position < annotations[a].annotations.length) {
+System.arraycopy (annotations[a].annotations, 0, temp, 0, command.position);
+if (command.deletedAnnotations != null && command.deletedAnnotations.containsKey (annotations[a].annotationId)) {
+var restore = command.deletedAnnotations.get (annotations[a].annotationId);
+System.arraycopy (restore, 0, temp, command.position, command.number);
+}System.arraycopy (annotations[a].annotations, command.position, temp, command.position + command.number, aSize - command.position);
+} else {
+if (command.deletedAnnotations != null && command.deletedAnnotations.containsKey (annotations[a].annotationId)) {
+var restore = command.deletedAnnotations.get (annotations[a].annotationId);
+temp =  new Array (annotations[a].annotations.length + restore.length);
+System.arraycopy (annotations[a].annotations, 0, temp, 0, annotations[a].annotations.length);
+System.arraycopy (restore, 0, temp, annotations[a].annotations.length, restore.length);
+} else {
+temp = annotations[a].annotations;
+}}} else {
+if (tSize != aSize || command.position < 2) {
+var copylen = Math.min (command.position, annotations[a].annotations.length);
+if (copylen > 0) {
+System.arraycopy (annotations[a].annotations, 0, temp, 0, copylen);
+}var deleted =  new Array (command.number);
+if (copylen >= command.position) {
+copylen = Math.min (command.number, annotations[a].annotations.length - command.position);
+if (copylen > 0) {
+System.arraycopy (annotations[a].annotations, command.position, deleted, 0, copylen);
+}}command.deletedAnnotations.put (annotations[a].annotationId, deleted);
+if (annotations[a].annotations.length > command.position + command.number) {
+System.arraycopy (annotations[a].annotations, command.position + command.number, temp, command.position, annotations[a].annotations.length - command.position - command.number);
+}} else {
+var dSize = aSize - command.position;
+if (dSize > 0) {
+var deleted =  new Array (command.number);
+System.arraycopy (annotations[a].annotations, command.position, deleted, 0, dSize);
+command.deletedAnnotations.put (annotations[a].annotationId, deleted);
+tSize = Math.min (annotations[a].annotations.length, command.position);
+temp =  new Array (tSize);
+System.arraycopy (annotations[a].annotations, 0, temp, 0, tSize);
+} else {
+temp = annotations[a].annotations;
+}}}annotations[a].annotations = temp;
+}
+}, "jalview.commands.EditCommand.Edit,~B,~B,~A");
+c$.adjustFeatures = Clazz_defineMethod (c$, "adjustFeatures", 
+function (command, index, i, j, insert) {
+var seq = command.seqs[index];
+var sequence = seq.getDatasetSequence ();
+if (sequence == null) {
+sequence = seq;
+}if (insert) {
+if (command.editedFeatures != null && command.editedFeatures.containsKey (seq)) {
+sequence.setSequenceFeatures (command.editedFeatures.get (seq));
+}return;
+}var sf = sequence.getSequenceFeatures ();
+if (sf == null) {
+return;
+}var oldsf =  new Array (sf.length);
+var cSize = j - i;
+for (var s = 0; s < sf.length; s++) {
+var copy =  new jalview.datamodel.SequenceFeature (sf[s]);
+oldsf[s] = copy;
+if (sf[s].getEnd () < i) {
+continue;
+}if (sf[s].getBegin () > j) {
+sf[s].setBegin (copy.getBegin () - cSize);
+sf[s].setEnd (copy.getEnd () - cSize);
+continue;
+}if (sf[s].getBegin () >= i) {
+sf[s].setBegin (i);
+}if (sf[s].getEnd () < j) {
+sf[s].setEnd (j - 1);
+}sf[s].setEnd (sf[s].getEnd () - (cSize));
+if (sf[s].getBegin () > sf[s].getEnd ()) {
+sequence.deleteFeature (sf[s]);
+}}
+if (command.editedFeatures == null) {
+command.editedFeatures =  new java.util.Hashtable ();
+}command.editedFeatures.put (seq, oldsf);
+}, "jalview.commands.EditCommand.Edit,~N,~N,~N,~B");
+Clazz_defineMethod (c$, "getEdits", 
+function () {
+return this.edits;
+});
+Clazz_defineMethod (c$, "priorState", 
+function (forUndo) {
+var result =  new java.util.HashMap ();
+if (this.getEdits () == null) {
+return result;
+}if (forUndo) {
+for (var e, $e = this.getEdits ().iterator (); $e.hasNext () && ((e = $e.next ()) || true);) {
+for (var seq, $seq = 0, $$seq = e.getSequences (); $seq < $$seq.length && ((seq = $$seq[$seq]) || true); $seq++) {
+var ds = seq.getDatasetSequence ();
+var preEdit = result.get (ds);
+if (preEdit == null) {
+preEdit =  new jalview.datamodel.Sequence ("", seq.getSequenceAsString ());
+preEdit.setDatasetSequence (ds);
+result.put (ds, preEdit);
+}}
+}
+return result;
+}var edits =  new jalview.util.ReverseListIterator (this.getEdits ());
+while (edits.hasNext ()) {
+var oldEdit = edits.next ();
+var action = oldEdit.getAction ();
+var position = oldEdit.getPosition ();
+var number = oldEdit.getNumber ();
+var gap = oldEdit.getGapCharacter ();
+for (var seq, $seq = 0, $$seq = oldEdit.getSequences (); $seq < $$seq.length && ((seq = $$seq[$seq]) || true); $seq++) {
+var ds = seq.getDatasetSequence ();
+var preEdit = result.get (ds);
+if (preEdit == null) {
+preEdit =  new jalview.datamodel.Sequence ("", seq.getSequenceAsString ());
+preEdit.setDatasetSequence (ds);
+result.put (ds, preEdit);
+}if (ds != null) {
+if (action === jalview.commands.EditCommand.Action.DELETE_GAP) {
+preEdit.setSequence ( String.instantialize (jalview.util.StringUtils.insertCharAt (preEdit.getSequence (), position, number, gap)));
+} else if (action === jalview.commands.EditCommand.Action.INSERT_GAP) {
+preEdit.setSequence ( String.instantialize (jalview.util.StringUtils.deleteChars (preEdit.getSequence (), position, position + number)));
+} else {
+System.err.println ("Can't undo edit action " + action);
+}}}
+}
+return result;
+}, "~B");
+Clazz_defineMethod (c$, "getEditIterator", 
+function (forwards) {
+if (forwards) {
+return this.getEdits ().iterator ();
+} else {
+return  new jalview.util.ReverseListIterator (this.getEdits ());
+}}, "~B");
+c$.$EditCommand$Edit$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_decorateAsClass (function () {
+Clazz_prepareCallback (this, arguments);
+this.oldds = null;
+this.fullAlignmentHeight = false;
+this.deletedAnnotationRows = null;
+this.deletedAnnotations = null;
+this.editedFeatures = null;
+this.al = null;
+this.command = null;
+this.string = null;
+this.seqs = null;
+this.alIndex = null;
+this.position = 0;
+this.number = 0;
+this.gapChar = '\0';
+Clazz_instantialize (this, arguments);
+}, jalview.commands.EditCommand, "Edit");
+Clazz_makeConstructor (c$, 
+function (a, b, c, d, e) {
+this.command = a;
+this.seqs = b;
+this.position = c;
+this.number = d;
+this.gapChar = e;
+}, "jalview.commands.EditCommand.Action,~A,~N,~N,~S");
+Clazz_makeConstructor (c$, 
+function (a, b, c, d, e) {
+this.gapChar = e.getGapCharacter ();
+this.command = a;
+this.seqs = b;
+this.position = c;
+this.number = d;
+this.al = e;
+this.alIndex =  Clazz_newIntArray (b.length, 0);
+for (var f = 0; f < b.length; f++) {
+this.alIndex[f] = e.findIndex (b[f]);
+}
+this.fullAlignmentHeight = (e.getHeight () == b.length);
+}, "jalview.commands.EditCommand.Action,~A,~N,~N,jalview.datamodel.AlignmentI");
+Clazz_makeConstructor (c$, 
+function (a, b, c, d, e, f) {
+this.command = a;
+this.seqs = b;
+this.position = c;
+this.number = d;
+this.al = e;
+this.gapChar = e.getGapCharacter ();
+this.string =  Clazz_newCharArray (b.length, '\0');
+for (var g = 0; g < b.length; g++) {
+this.string[g] = f.toCharArray ();
+}
+this.fullAlignmentHeight = (e.getHeight () == b.length);
+}, "jalview.commands.EditCommand.Action,~A,~N,~N,jalview.datamodel.AlignmentI,~S");
+Clazz_defineMethod (c$, "getSequences", 
+function () {
+return this.seqs;
+});
+Clazz_defineMethod (c$, "getPosition", 
+function () {
+return this.position;
+});
+Clazz_defineMethod (c$, "getAction", 
+function () {
+return this.command;
+});
+Clazz_defineMethod (c$, "getNumber", 
+function () {
+return this.number;
+});
+Clazz_defineMethod (c$, "getGapCharacter", 
+function () {
+return this.gapChar;
+});
+c$ = Clazz_p0p ();
+};
+Clazz_pu$h(self.c$);
+c$ = Clazz_declareType (jalview.commands.EditCommand, "Action", Enum);
+Clazz_defineMethod (c$, "getUndoAction", 
+function () {
+switch (this) {
+case jalview.commands.EditCommand.Action.INSERT_GAP:
+return jalview.commands.EditCommand.Action.DELETE_GAP;
+case jalview.commands.EditCommand.Action.CUT:
+return jalview.commands.EditCommand.Action.PASTE;
+case jalview.commands.EditCommand.Action.DELETE_GAP:
+return jalview.commands.EditCommand.Action.INSERT_GAP;
+case jalview.commands.EditCommand.Action.INSERT_NUC:
+return null;
+case jalview.commands.EditCommand.Action.PASTE:
+return jalview.commands.EditCommand.Action.CUT;
+case jalview.commands.EditCommand.Action.REPLACE:
+return jalview.commands.EditCommand.Action.REPLACE;
+}
+return null;
+});
+Clazz_defineEnumConstant (c$, "INSERT_GAP", 0, []);
+Clazz_defineEnumConstant (c$, "DELETE_GAP", 1, []);
+Clazz_defineEnumConstant (c$, "CUT", 2, []);
+Clazz_defineEnumConstant (c$, "PASTE", 3, []);
+Clazz_defineEnumConstant (c$, "REPLACE", 4, []);
+Clazz_defineEnumConstant (c$, "INSERT_NUC", 5, []);
+c$ = Clazz_p0p ();
+});
+Clazz_declarePackage ("jalview.commands");
+Clazz_declareInterface (jalview.commands, "CommandI");
+Clazz_declarePackage ("jalview.analysis");
+Clazz_load (["jalview.schemes.ResidueProperties", "java.lang.StringBuffer"], "jalview.analysis.AlignSeq", ["jalview.datamodel.Mapping", "$.Sequence", "jalview.util.Comparison", "$.Format", "$.MapList", "$.MessageManager", "java.awt.Color", "java.lang.Error", "$.StringBuilder", "java.util.ArrayList", "$.Arrays", "$.StringTokenizer"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.score = null;
+this.E = null;
+this.F = null;
+this.traceback = null;
+this.seq1 = null;
+this.seq2 = null;
+this.s1 = null;
+this.s2 = null;
+this.s1str = null;
+this.s2str = null;
+this.maxi = 0;
+this.maxj = 0;
+this.aseq1 = null;
+this.aseq2 = null;
+this.astr1 = "";
+this.astr2 = "";
+this.seq1start = 0;
+this.seq1end = 0;
+this.seq2start = 0;
+this.seq2end = 0;
+this.count = 0;
+this.maxscore = 0;
+this.pid = 0;
+this.prev = 0;
+this.gapOpen = 120;
+this.gapExtend = 20;
+this.lookup = null;
+this.intToStr = null;
+this.defInt = 23;
+this.output = null;
+this.type = null;
+this.charToInt = null;
+Clazz_instantialize (this, arguments);
+}, jalview.analysis, "AlignSeq");
+Clazz_prepareFields (c$, function () {
+this.lookup = jalview.schemes.ResidueProperties.getBLOSUM62 ();
+this.intToStr = jalview.analysis.AlignSeq.pep;
+this.output =  new StringBuffer ();
+});
+Clazz_makeConstructor (c$, 
+function (s1, s2, type) {
+this.SeqInit (s1, s1.getSequenceAsString (), s2, s2.getSequenceAsString (), type);
+}, "jalview.datamodel.SequenceI,jalview.datamodel.SequenceI,~S");
+Clazz_makeConstructor (c$, 
+function (s1, string1, s2, string2, type) {
+this.SeqInit (s1, string1.toUpperCase (), s2, string2.toUpperCase (), type);
+}, "jalview.datamodel.SequenceI,~S,jalview.datamodel.SequenceI,~S,~S");
+Clazz_defineMethod (c$, "getMaxScore", 
+function () {
+return this.maxscore;
+});
+Clazz_defineMethod (c$, "getSeq2Start", 
+function () {
+return this.seq2start;
+});
+Clazz_defineMethod (c$, "getSeq2End", 
+function () {
+return this.seq2end;
+});
+Clazz_defineMethod (c$, "getSeq1Start", 
+function () {
+return this.seq1start;
+});
+Clazz_defineMethod (c$, "getSeq1End", 
+function () {
+return this.seq1end;
+});
+Clazz_defineMethod (c$, "getOutput", 
+function () {
+return this.output.toString ();
+});
+Clazz_defineMethod (c$, "getAStr1", 
+function () {
+return this.astr1;
+});
+Clazz_defineMethod (c$, "getAStr2", 
+function () {
+return this.astr2;
+});
+Clazz_defineMethod (c$, "getASeq1", 
+function () {
+return this.aseq1;
+});
+Clazz_defineMethod (c$, "getASeq2", 
+function () {
+return this.aseq2;
+});
+Clazz_defineMethod (c$, "getS1", 
+function () {
+return this.s1;
+});
+Clazz_defineMethod (c$, "getS2", 
+function () {
+return this.s2;
+});
+Clazz_defineMethod (c$, "getAlignedSeq1", 
+function () {
+var alSeq1 =  new jalview.datamodel.Sequence (this.s1.getName (), this.getAStr1 ());
+alSeq1.setStart (this.s1.getStart () + this.getSeq1Start () - 1);
+alSeq1.setEnd (this.s1.getStart () + this.getSeq1End () - 1);
+alSeq1.setDatasetSequence (this.s1.getDatasetSequence () == null ? this.s1 : this.s1.getDatasetSequence ());
+return alSeq1;
+});
+Clazz_defineMethod (c$, "getAlignedSeq2", 
+function () {
+var alSeq2 =  new jalview.datamodel.Sequence (this.s2.getName (), this.getAStr2 ());
+alSeq2.setStart (this.s2.getStart () + this.getSeq2Start () - 1);
+alSeq2.setEnd (this.s2.getStart () + this.getSeq2End () - 1);
+alSeq2.setDatasetSequence (this.s2.getDatasetSequence () == null ? this.s2 : this.s2.getDatasetSequence ());
+return alSeq2;
+});
+Clazz_defineMethod (c$, "SeqInit", 
+function (s1, string1, s2, string2, type) {
+this.s1 = s1;
+this.s2 = s2;
+this.setDefaultParams (type);
+this.SeqInit (string1, string2);
+}, "jalview.datamodel.SequenceI,~S,jalview.datamodel.SequenceI,~S,~S");
+Clazz_defineMethod (c$, "SeqInit", 
+function (s1, string1, s2, string2, scoreMatrix) {
+this.s1 = s1;
+this.s2 = s2;
+this.setType (scoreMatrix.isDNA () ? "dna" : "pep");
+this.lookup = scoreMatrix.getMatrix ();
+}, "jalview.datamodel.SequenceI,~S,jalview.datamodel.SequenceI,~S,jalview.schemes.ScoreMatrix");
+Clazz_defineMethod (c$, "SeqInit", 
+ function (string1, string2) {
+this.s1str = jalview.analysis.AlignSeq.extractGaps (jalview.util.Comparison.GapChars, string1);
+this.s2str = jalview.analysis.AlignSeq.extractGaps (jalview.util.Comparison.GapChars, string2);
+if (this.s1str.length == 0 || this.s2str.length == 0) {
+this.output.append ("ALL GAPS: " + (this.s1str.length == 0 ? this.s1.getName () : " ") + (this.s2str.length == 0 ? this.s2.getName () : ""));
+return;
+}this.seq1 =  Clazz_newIntArray (this.s1str.length, 0);
+this.seq2 =  Clazz_newIntArray (this.s2str.length, 0);
+this.score =  Clazz_newIntArray (this.s1str.length, this.s2str.length, 0);
+this.E =  Clazz_newIntArray (this.s1str.length, this.s2str.length, 0);
+this.F =  Clazz_newIntArray (this.s1str.length, this.s2str.length, 0);
+this.traceback =  Clazz_newIntArray (this.s1str.length, this.s2str.length, 0);
+this.seq1 = this.stringToInt (this.s1str, this.type);
+this.seq2 = this.stringToInt (this.s2str, this.type);
+}, "~S,~S");
+Clazz_defineMethod (c$, "setDefaultParams", 
+ function (type) {
+this.setType (type);
+if (type.equals ("pep")) {
+this.lookup = jalview.schemes.ResidueProperties.getDefaultPeptideMatrix ();
+} else if (type.equals ("dna")) {
+this.lookup = jalview.schemes.ResidueProperties.getDefaultDnaMatrix ();
+}}, "~S");
+Clazz_defineMethod (c$, "setType", 
+ function (type2) {
+this.type = type2;
+if (this.type.equals ("pep")) {
+this.intToStr = jalview.analysis.AlignSeq.pep;
+this.charToInt = jalview.schemes.ResidueProperties.aaIndex;
+this.defInt = 23;
+} else if (this.type.equals ("dna")) {
+this.intToStr = jalview.analysis.AlignSeq.dna;
+this.charToInt = jalview.schemes.ResidueProperties.nucleotideIndex;
+this.defInt = 10;
+} else {
+this.output.append ("Wrong type = dna or pep only");
+throw  new Error (jalview.util.MessageManager.formatMessage ("error.unknown_type_dna_or_pep",  Clazz_newArray (-1, [type2])));
+}}, "~S");
+Clazz_defineMethod (c$, "traceAlignment", 
+function () {
+var max = -9999;
+for (var i = 0; i < this.seq1.length; i++) {
+if (this.score[i][this.seq2.length - 1] > max) {
+max = this.score[i][this.seq2.length - 1];
+this.maxi = i;
+this.maxj = this.seq2.length - 1;
+}}
+for (var j = 0; j < this.seq2.length; j++) {
+if (this.score[this.seq1.length - 1][j] > max) {
+max = this.score[this.seq1.length - 1][j];
+this.maxi = this.seq1.length - 1;
+this.maxj = j;
+}}
+var i = this.maxi;
+var j = this.maxj;
+var trace;
+this.maxscore = Clazz_doubleToInt (this.score[i][j] / 10);
+this.seq1end = this.maxi + 1;
+this.seq2end = this.maxj + 1;
+this.aseq1 =  Clazz_newIntArray (this.seq1.length + this.seq2.length, 0);
+this.aseq2 =  Clazz_newIntArray (this.seq1.length + this.seq2.length, 0);
+this.count = (this.seq1.length + this.seq2.length) - 1;
+while ((i > 0) && (j > 0)) {
+if ((this.aseq1[this.count] != this.defInt) && (i >= 0)) {
+this.aseq1[this.count] = this.seq1[i];
+this.astr1 = this.s1str.charAt (i) + this.astr1;
+}if ((this.aseq2[this.count] != this.defInt) && (j > 0)) {
+this.aseq2[this.count] = this.seq2[j];
+this.astr2 = this.s2str.charAt (j) + this.astr2;
+}trace = this.findTrace (i, j);
+if (trace == 0) {
+i--;
+j--;
+} else if (trace == 1) {
+j--;
+this.aseq1[this.count] = this.defInt;
+this.astr1 = "-" + this.astr1.substring (1);
+} else if (trace == -1) {
+i--;
+this.aseq2[this.count] = this.defInt;
+this.astr2 = "-" + this.astr2.substring (1);
+}this.count--;
+}
+this.seq1start = i + 1;
+this.seq2start = j + 1;
+if (this.aseq1[this.count] != this.defInt) {
+this.aseq1[this.count] = this.seq1[i];
+this.astr1 = this.s1str.charAt (i) + this.astr1;
+}if (this.aseq2[this.count] != this.defInt) {
+this.aseq2[this.count] = this.seq2[j];
+this.astr2 = this.s2str.charAt (j) + this.astr2;
+}});
+Clazz_defineMethod (c$, "printAlignment", 
+function (os) {
+var s1id = this.s1.getName ();
+var s2id = this.s2.getName ();
+var maxid = this.s1.getName ().length;
+if (this.s2.getName ().length > maxid) {
+maxid = this.s2.getName ().length;
+}if (maxid > 30) {
+maxid = 30;
+if (this.s1.getName ().length > maxid) {
+s1id = this.s1.getName ().substring (0, 30);
+}if (this.s2.getName ().length > maxid) {
+s2id = this.s2.getName ().substring (0, 30);
+}}var len = 72 - maxid - 1;
+var nochunks = (Clazz_doubleToInt ((this.aseq1.length - this.count) / len)) + 1;
+this.pid = 0;
+this.output.append ("Score = ").append ("" + this.score[this.maxi][this.maxj]).append (jalview.analysis.AlignSeq.NEWLINE);
+this.output.append ("Length of alignment = ").append (String.valueOf (this.aseq1.length - this.count)).append (jalview.analysis.AlignSeq.NEWLINE);
+this.output.append ("Sequence ");
+this.output.append ( new jalview.util.Format ("%" + maxid + "s").form (this.s1.getName ()));
+this.output.append (" :  ").append (String.valueOf (this.s1.getStart ())).append (" - ").append (String.valueOf (this.s1.getEnd ()));
+this.output.append (" (Sequence length = ").append (String.valueOf (this.s1str.length)).append (")").append (jalview.analysis.AlignSeq.NEWLINE);
+this.output.append ("Sequence ");
+this.output.append ( new jalview.util.Format ("%" + maxid + "s").form (this.s2.getName ()));
+this.output.append (" :  ").append (String.valueOf (this.s2.getStart ())).append (" - ").append (String.valueOf (this.s2.getEnd ()));
+this.output.append (" (Sequence length = ").append (String.valueOf (this.s2str.length)).append (")").append (jalview.analysis.AlignSeq.NEWLINE).append (jalview.analysis.AlignSeq.NEWLINE);
+for (var j = 0; j < nochunks; j++) {
+this.output.append ( new jalview.util.Format ("%" + (maxid) + "s").form (s1id)).append (" ");
+for (var i = 0; i < len; i++) {
+if ((i + (j * len)) < this.astr1.length) {
+this.output.append (this.astr1.charAt (i + (j * len)));
+}}
+this.output.append (jalview.analysis.AlignSeq.NEWLINE);
+this.output.append ( new jalview.util.Format ("%" + (maxid) + "s").form (" ")).append (" ");
+for (var i = 0; i < len; i++) {
+if ((i + (j * len)) < this.astr1.length) {
+if (this.astr1.charAt (i + (j * len)) == this.astr2.charAt (i + (j * len)) && !jalview.util.Comparison.isGap (this.astr1.charAt (i + (j * len)))) {
+this.pid++;
+this.output.append ("|");
+} else if (this.type.equals ("pep")) {
+if (jalview.schemes.ResidueProperties.getPAM250 (this.astr1.charAt (i + (j * len)), this.astr2.charAt (i + (j * len))) > 0) {
+this.output.append (".");
+} else {
+this.output.append (" ");
+}} else {
+this.output.append (" ");
+}}}
+this.output = this.output.append (jalview.analysis.AlignSeq.NEWLINE);
+this.output = this.output.append ( new jalview.util.Format ("%" + (maxid) + "s").form (s2id)).append (" ");
+for (var i = 0; i < len; i++) {
+if ((i + (j * len)) < this.astr2.length) {
+this.output.append (this.astr2.charAt (i + (j * len)));
+}}
+this.output.append (jalview.analysis.AlignSeq.NEWLINE).append (jalview.analysis.AlignSeq.NEWLINE);
+}
+this.pid = this.pid / (this.aseq1.length - this.count) * 100;
+this.output = this.output.append ( new jalview.util.Format ("Percentage ID = %2.2f\n\n").formDouble (this.pid));
+try {
+os.print (this.output.toString ());
+} catch (ex) {
+if (Clazz_exceptionOf (ex, Exception)) {
+} else {
+throw ex;
+}
+}
+}, "java.io.PrintStream");
+Clazz_defineMethod (c$, "printScoreMatrix", 
+function (mat) {
+var n = this.seq1.length;
+var m = this.seq2.length;
+for (var i = 0; i < n; i++) {
+if (i == 0) {
+jalview.util.Format.print (System.out, "%8s", this.s2str.substring (0, 1));
+for (var jj = 1; jj < m; jj++) {
+jalview.util.Format.print (System.out, "%5s", this.s2str.substring (jj, jj + 1));
+}
+System.out.println ();
+}for (var j = 0; j < m; j++) {
+if (j == 0) {
+jalview.util.Format.print (System.out, "%3s", this.s1str.substring (i, i + 1));
+}jalview.util.Format.printLong (System.out, "%3d ", Clazz_doubleToInt (mat[i][j] / 10));
+}
+System.out.println ();
+}
+}, "~A");
+Clazz_defineMethod (c$, "findTrace", 
+function (i, j) {
+var t = 0;
+var max = this.score[i - 1][j - 1] + (this.lookup[this.seq1[i]][this.seq2[j]] * 10);
+if (this.F[i][j] > max) {
+max = this.F[i][j];
+t = -1;
+} else if (this.F[i][j] == max) {
+if (this.prev == -1) {
+max = this.F[i][j];
+t = -1;
+}}if (this.E[i][j] >= max) {
+max = this.E[i][j];
+t = 1;
+} else if (this.E[i][j] == max) {
+if (this.prev == 1) {
+max = this.E[i][j];
+t = 1;
+}}this.prev = t;
+return t;
+}, "~N,~N");
+Clazz_defineMethod (c$, "calcScoreMatrix", 
+function () {
+var n = this.seq1.length;
+var m = this.seq2.length;
+this.score[0][0] = this.lookup[this.seq1[0]][this.seq2[0]] * 10;
+this.E[0][0] = -this.gapExtend;
+this.F[0][0] = 0;
+for (var j = 1; j < m; j++) {
+this.E[0][j] = this.max (this.score[0][j - 1] - this.gapOpen, this.E[0][j - 1] - this.gapExtend);
+this.F[0][j] = -this.gapExtend;
+this.score[0][j] = this.max (this.lookup[this.seq1[0]][this.seq2[j]] * 10, -this.gapOpen, -this.gapExtend);
+this.traceback[0][j] = 1;
+}
+for (var i = 1; i < n; i++) {
+this.E[i][0] = -this.gapOpen;
+this.F[i][0] = this.max (this.score[i - 1][0] - this.gapOpen, this.F[i - 1][0] - this.gapExtend);
+this.score[i][0] = this.max (this.lookup[this.seq1[i]][this.seq2[0]] * 10, this.E[i][0], this.F[i][0]);
+this.traceback[i][0] = -1;
+}
+for (var i = 1; i < n; i++) {
+for (var j = 1; j < m; j++) {
+this.E[i][j] = this.max (this.score[i][j - 1] - this.gapOpen, this.E[i][j - 1] - this.gapExtend);
+this.F[i][j] = this.max (this.score[i - 1][j] - this.gapOpen, this.F[i - 1][j] - this.gapExtend);
+this.score[i][j] = this.max (this.score[i - 1][j - 1] + (this.lookup[this.seq1[i]][this.seq2[j]] * 10), this.E[i][j], this.F[i][j]);
+this.traceback[i][j] = this.findTrace (i, j);
+}
+}
+});
+c$.extractGaps = Clazz_defineMethod (c$, "extractGaps", 
+function (gapChars, seq) {
+if (gapChars == null || seq == null) {
+return null;
+}var str =  new java.util.StringTokenizer (seq, gapChars);
+var newString =  new StringBuilder (seq.length);
+while (str.hasMoreTokens ()) {
+newString.append (str.nextToken ());
+}
+return newString.toString ();
+}, "~S,~S");
+Clazz_defineMethod (c$, "max", 
+function (i1, i2, i3) {
+var max = i1;
+if (i2 > i1) {
+max = i2;
+}if (i3 > max) {
+max = i3;
+}return max;
+}, "~N,~N,~N");
+Clazz_defineMethod (c$, "max", 
+function (i1, i2) {
+var max = i1;
+if (i2 > i1) {
+max = i2;
+}return max;
+}, "~N,~N");
+Clazz_defineMethod (c$, "stringToInt", 
+function (s, type) {
+var seq1 =  Clazz_newIntArray (s.length, 0);
+for (var i = 0; i < s.length; i++) {
+var c = s.charAt (i);
+if ('a' <= c && c <= 'z') {
+c = String.fromCharCode (c.charCodeAt (0) - (32));
+}try {
+seq1[i] = this.charToInt[c.charCodeAt (0)];
+if (seq1[i] < 0 || seq1[i] > this.defInt) {
+seq1[i] = this.defInt;
+}} catch (e) {
+if (Clazz_exceptionOf (e, Exception)) {
+seq1[i] = this.defInt;
+} else {
+throw e;
+}
+}
+}
+return seq1;
+}, "~S,~S");
+c$.displayMatrix = Clazz_defineMethod (c$, "displayMatrix", 
+function (g, mat, n, m, psize) {
+var max = -1000;
+var min = 1000;
+for (var i = 0; i < n; i++) {
+for (var j = 0; j < m; j++) {
+if (mat[i][j] >= max) {
+max = mat[i][j];
+}if (mat[i][j] <= min) {
+min = mat[i][j];
+}}
+}
+System.out.println (max + " " + min);
+for (var i = 0; i < n; i++) {
+for (var j = 0; j < m; j++) {
+var x = psize * i;
+var y = psize * j;
+var score = (mat[i][j] - min) / (max - min);
+g.setColor ( new java.awt.Color (score, 0, 0));
+g.fillRect (x, y, psize, psize);
+}
+}
+}, "java.awt.Graphics,~A,~N,~N,~N");
+c$.doGlobalNWAlignment = Clazz_defineMethod (c$, "doGlobalNWAlignment", 
+function (s1, s2, type) {
+var as =  new jalview.analysis.AlignSeq (s1, s2, type);
+as.calcScoreMatrix ();
+as.traceAlignment ();
+return as;
+}, "jalview.datamodel.SequenceI,jalview.datamodel.SequenceI,~S");
+Clazz_defineMethod (c$, "getMappingFromS1", 
+function (allowmismatch) {
+var as1 =  new java.util.ArrayList ();
+var as2 =  new java.util.ArrayList ();
+var pdbpos = this.s2.getStart () + this.getSeq2Start () - 2;
+var alignpos = this.s1.getStart () + this.getSeq1Start () - 2;
+var lp2 = pdbpos - 3;
+var lp1 = alignpos - 3;
+var lastmatch = false;
+for (var i = 0; i < this.astr1.length; i++) {
+var c1 = this.astr1.charAt (i);
+var c2 = this.astr2.charAt (i);
+if (c1 != '-') {
+alignpos++;
+}if (c2 != '-') {
+pdbpos++;
+}if (allowmismatch || c1 == c2) {
+if (lp1 + 1 != alignpos || lp2 + 1 != pdbpos) {
+as1.add (Integer.$valueOf (alignpos));
+as2.add (Integer.$valueOf (pdbpos));
+}lastmatch = true;
+lp1 = alignpos;
+lp2 = pdbpos;
+} else {
+if (lastmatch) {
+as1.add (Integer.$valueOf (lp1));
+as2.add (Integer.$valueOf (lp2));
+}lastmatch = false;
+}}
+var mapseq1 =  Clazz_newIntArray (as1.size () + (lastmatch ? 1 : 0), 0);
+var mapseq2 =  Clazz_newIntArray (as2.size () + (lastmatch ? 1 : 0), 0);
+var i = 0;
+for (var ip, $ip = as1.iterator (); $ip.hasNext () && ((ip = $ip.next ()) || true);) {
+mapseq1[i++] = (ip).intValue ();
+}
+;i = 0;
+for (var ip, $ip = as2.iterator (); $ip.hasNext () && ((ip = $ip.next ()) || true);) {
+mapseq2[i++] = (ip).intValue ();
+}
+;if (lastmatch) {
+mapseq1[mapseq1.length - 1] = alignpos;
+mapseq2[mapseq2.length - 1] = pdbpos;
+}var map =  new jalview.util.MapList (mapseq1, mapseq2, 1, 1);
+var mapping =  new jalview.datamodel.Mapping (map);
+mapping.setTo (this.s2);
+return mapping;
+}, "~B");
+c$.replaceMatchingSeqsWith = Clazz_defineMethod (c$, "replaceMatchingSeqsWith", 
+function (seqs, annotations, ochains, al, dnaOrProtein, removeOldAnnots) {
+var orig =  new java.util.ArrayList ();
+var repl =  new java.util.ArrayList ();
+var aligs =  new java.util.ArrayList ();
+if (al != null && al.getHeight () > 0) {
+var matches =  new java.util.ArrayList ();
+var aligns =  new java.util.ArrayList ();
+for (var sq, $sq = ochains.iterator (); $sq.hasNext () && ((sq = $sq.next ()) || true);) {
+var bestm = null;
+var bestaseq = null;
+var bestscore = 0;
+for (var msq, $msq = al.getSequences ().iterator (); $msq.hasNext () && ((msq = $msq.next ()) || true);) {
+var aseq = jalview.analysis.AlignSeq.doGlobalNWAlignment (msq, sq, dnaOrProtein);
+if (bestm == null || aseq.getMaxScore () > bestscore) {
+bestscore = aseq.getMaxScore ();
+bestaseq = aseq;
+bestm = msq;
+}}
+System.out.println ("Best Score for " + (matches.size () + 1) + " :" + bestscore);
+matches.add (bestm);
+aligns.add (bestaseq);
+al.deleteSequence (bestm);
+}
+for (var p = 0, pSize = seqs.size (); p < pSize; p++) {
+var sq;
+var sp = seqs.get (p);
+var q;
+if ((q = ochains.indexOf (sp)) > -1) {
+seqs.set (p, sq = matches.get (q));
+orig.add (sp);
+repl.add (sq);
+sq.setName (sp.getName ());
+sq.setDescription (sp.getDescription ());
+var sp2sq;
+sq.transferAnnotation (sp, sp2sq = aligns.get (q).getMappingFromS1 (false));
+aligs.add (aligns.get (q));
+var inspos = -1;
+for (var ap = 0; ap < annotations.size (); ) {
+if (annotations.get (ap).sequenceRef === sp) {
+if (inspos == -1) {
+inspos = ap;
+}if (removeOldAnnots) {
+annotations.remove (ap);
+} else {
+var alan = annotations.remove (ap);
+alan.liftOver (sq, sp2sq);
+alan.setSequenceRef (sq);
+sq.addAlignmentAnnotation (alan);
+}} else {
+ap++;
+}}
+if (sq.getAnnotation () != null && sq.getAnnotation ().length > 0) {
+annotations.addAll (inspos == -1 ? annotations.size () : inspos, java.util.Arrays.asList (sq.getAnnotation ()));
+}}}
+}return java.util.Arrays.asList ([orig, repl, aligs]);
+}, "java.util.List,java.util.List,java.util.List,jalview.datamodel.AlignmentI,~S,~B");
+c$.computeRedundancyMatrix = Clazz_defineMethod (c$, "computeRedundancyMatrix", 
+function (originalSequences, omitHidden, start, end, ungapped) {
+var height = originalSequences.length;
+var redundancy =  Clazz_newFloatArray (height, 0);
+var lngth =  Clazz_newIntArray (height, 0);
+for (var i = 0; i < height; i++) {
+redundancy[i] = 0;
+lngth[i] = -1;
+}
+var pid;
+var seqi;
+var seqj;
+for (var i = 0; i < height; i++) {
+for (var j = 0; j < i; j++) {
+if (i == j) {
+continue;
+}if (omitHidden == null) {
+seqi = originalSequences[i].getSequenceAsString (start, end);
+seqj = originalSequences[j].getSequenceAsString (start, end);
+} else {
+seqi = omitHidden[i];
+seqj = omitHidden[j];
+}if (lngth[i] == -1) {
+var ug = jalview.analysis.AlignSeq.extractGaps (jalview.util.Comparison.GapChars, seqi);
+lngth[i] = ug.length;
+if (ungapped) {
+seqi = ug;
+}}if (lngth[j] == -1) {
+var ug = jalview.analysis.AlignSeq.extractGaps (jalview.util.Comparison.GapChars, seqj);
+lngth[j] = ug.length;
+if (ungapped) {
+seqj = ug;
+}}pid = jalview.util.Comparison.PID (seqi, seqj);
+if (lngth[j] < lngth[i]) {
+redundancy[j] = Math.max (pid, redundancy[j]);
+} else {
+redundancy[i] = Math.max (pid, redundancy[i]);
+}}
+}
+return redundancy;
+}, "~A,~A,~N,~N,~B");
+Clazz_defineStatics (c$,
+"PEP", "pep",
+"DNA", "dna");
+c$.NEWLINE = c$.prototype.NEWLINE = System.lineSeparator ();
+Clazz_defineStatics (c$,
+"dna",  Clazz_newArray (-1, ["A", "C", "G", "T", "-"]),
+"pep",  Clazz_newArray (-1, ["A", "R", "N", "D", "C", "Q", "E", "G", "H", "I", "L", "K", "M", "F", "P", "S", "T", "W", "Y", "V", "B", "Z", "X", "-"]));
+});
+Clazz_declarePackage ("jalview.schemes");
+Clazz_load (["jalview.analysis.scoremodels.FeatureScoreModel", "$.PIDScoreModel", "jalview.schemes.ScoreMatrix", "java.awt.Color", "java.util.ArrayList", "$.HashMap", "$.Hashtable", "$.Vector"], "jalview.schemes.ResidueProperties", ["java.lang.StringBuffer"], function () {
+c$ = Clazz_declareType (jalview.schemes, "ResidueProperties");
+c$.buildAmbiguityCodonSet = Clazz_defineMethod (c$, "buildAmbiguityCodonSet", 
+function () {
+if (jalview.schemes.ResidueProperties._ambiguityCodes.size () > 0) {
+System.err.println ("Ignoring multiple calls to buildAmbiguityCodonSet");
+return;
+}for (var acode, $acode = jalview.schemes.ResidueProperties.ambiguityCodes.entrySet ().iterator (); $acode.hasNext () && ((acode = $acode.next ()) || true);) {
+for (var r, $r = 0, $$r = acode.getValue (); $r < $$r.length && ((r = $$r[$r]) || true); $r++) {
+var codesfor = jalview.schemes.ResidueProperties._ambiguityCodes.get (r);
+if (codesfor == null) {
+jalview.schemes.ResidueProperties._ambiguityCodes.put (r, codesfor =  new java.util.ArrayList ());
+}if (!codesfor.contains (acode.getKey ())) {
+codesfor.add (acode.getKey ());
+} else {
+System.err.println ("Inconsistency in the IUBMB ambiguity code nomenclature table: collision for " + acode.getKey () + " in residue " + r);
+}}
+}
+var unambcodons = jalview.schemes.ResidueProperties.codonHash2.keySet ().toArray ( new Array (jalview.schemes.ResidueProperties.codonHash2.size ()));
+for (var codon, $codon = 0, $$codon = unambcodons; $codon < $$codon.length && ((codon = $$codon[$codon]) || true); $codon++) {
+var residue = jalview.schemes.ResidueProperties.codonHash2.get (codon);
+var acodon =  new Array (codon.length);
+for (var i = 0, iSize = codon.length; i < iSize; i++) {
+var _ac = "" + codon.charAt (i);
+var acodes = jalview.schemes.ResidueProperties._ambiguityCodes.get (_ac);
+if (acodes != null) {
+acodon[i] = acodes.toArray ( new Array (acodes.size ()));
+} else {
+acodon[i] =  Clazz_newArray (-1, []);
+}}
+var tpos =  Clazz_newIntArray (codon.length, 0);
+var cpos =  Clazz_newIntArray (codon.length, 0);
+for (var i = 0; i < tpos.length; i++) {
+tpos[i] = -1;
+}
+tpos[acodon.length - 1] = 0;
+var ipos;
+var j;
+while (tpos[0] < acodon[0].length) {
+var allres =  Clazz_newCharArray (tpos.length, '\0');
+var _acodon = "";
+var _anuc;
+for (ipos = 0; ipos < tpos.length; ipos++) {
+if (acodon[ipos].length == 0 || tpos[ipos] < 0) {
+_acodon += codon.charAt (ipos);
+allres[ipos] =  Clazz_newCharArray (-1, [codon.charAt (ipos)]);
+} else {
+_acodon += acodon[ipos][tpos[ipos]];
+var altbase = jalview.schemes.ResidueProperties.ambiguityCodes.get (acodon[ipos][tpos[ipos]]);
+allres[ipos] =  Clazz_newCharArray (altbase.length, '\0');
+j = 0;
+for (var ab, $ab = 0, $$ab = altbase; $ab < $$ab.length && ((ab = $$ab[$ab]) || true); $ab++) {
+allres[ipos][j++] = ab.charAt (0);
+}
+}}
+for (ipos = 0; ipos < cpos.length; ipos++) {
+cpos[ipos] = 0;
+}
+var valid = true;
+do {
+var _codon = "";
+for (j = 0; j < cpos.length; j++) {
+_codon += allres[j][cpos[j]];
+}
+var tr = jalview.schemes.ResidueProperties.codonHash2.get (_codon);
+if (valid = (tr != null && tr.equals (residue))) {
+ipos = acodon.length - 1;
+while (++cpos[ipos] >= allres[ipos].length && ipos > 0) {
+cpos[ipos] = 0;
+ipos--;
+}
+}} while (valid && cpos[0] < allres[0].length);
+if (valid) {
+jalview.schemes.ResidueProperties.codonHash2.put (_acodon, residue);
+} else {
+}ipos = acodon.length - 1;
+while (++tpos[ipos] >= acodon[ipos].length && ipos > 0) {
+tpos[ipos] = -1;
+ipos--;
+}
+}
+}
+});
+c$.getHydmax = Clazz_defineMethod (c$, "getHydmax", 
+function () {
+return 4.5;
+});
+c$.getHydmin = Clazz_defineMethod (c$, "getHydmin", 
+function () {
+return -3.9;
+});
+c$.getHyd = Clazz_defineMethod (c$, "getHyd", 
+function () {
+return jalview.schemes.ResidueProperties.hyd;
+});
+c$.getAA3Hash = Clazz_defineMethod (c$, "getAA3Hash", 
+function () {
+return jalview.schemes.ResidueProperties.aa3Hash;
+});
+c$.getDNA = Clazz_defineMethod (c$, "getDNA", 
+function () {
+return jalview.schemes.ResidueProperties.DNA;
+});
+c$.getBLOSUM62 = Clazz_defineMethod (c$, "getBLOSUM62", 
+function () {
+return jalview.schemes.ResidueProperties.BLOSUM62;
+});
+c$.getPAM250 = Clazz_defineMethod (c$, "getPAM250", 
+function (A1, A2) {
+return jalview.schemes.ResidueProperties.getPAM250 (A1.charAt (0), A2.charAt (0));
+}, "~S,~S");
+c$.getBLOSUM62 = Clazz_defineMethod (c$, "getBLOSUM62", 
+function (c1, c2) {
+var pog = 0;
+try {
+var a = jalview.schemes.ResidueProperties.aaIndex[c1.charCodeAt (0)];
+var b = jalview.schemes.ResidueProperties.aaIndex[c2.charCodeAt (0)];
+pog = jalview.schemes.ResidueProperties.BLOSUM62[a][b];
+} catch (e) {
+if (Clazz_exceptionOf (e, Exception)) {
+} else {
+throw e;
+}
+}
+return pog;
+}, "~S,~S");
+c$.getCodons = Clazz_defineMethod (c$, "getCodons", 
+function (res) {
+if (jalview.schemes.ResidueProperties.codonHash.containsKey (res)) {
+return jalview.schemes.ResidueProperties.codonHash.get (res);
+}return null;
+}, "~S");
+c$.codonTranslate = Clazz_defineMethod (c$, "codonTranslate", 
+function (lccodon) {
+if (false) {
+return jalview.schemes.ResidueProperties._codonTranslate (lccodon);
+}var cdn = jalview.schemes.ResidueProperties.codonHash2.get (lccodon.toUpperCase ());
+if (cdn != null && cdn.equals ("*")) {
+return "STOP";
+}return cdn;
+}, "~S");
+c$._codonTranslate = Clazz_defineMethod (c$, "_codonTranslate", 
+function (lccodon) {
+var codon = lccodon.toUpperCase ();
+if (codon.indexOf ('X') > -1 || codon.indexOf ('N') > -1) {
+return "X";
+}for (var key, $key = jalview.schemes.ResidueProperties.codonHash.keySet ().iterator (); $key.hasNext () && ((key = $key.next ()) || true);) {
+if (jalview.schemes.ResidueProperties.codonHash.get (key).contains (codon)) {
+return key;
+}}
+return null;
+}, "~S");
+c$.getDefaultPeptideMatrix = Clazz_defineMethod (c$, "getDefaultPeptideMatrix", 
+function () {
+return jalview.schemes.ResidueProperties.getBLOSUM62 ();
+});
+c$.getDefaultDnaMatrix = Clazz_defineMethod (c$, "getDefaultDnaMatrix", 
+function () {
+return jalview.schemes.ResidueProperties.getDNA ();
+});
+c$.getScoreMatrix = Clazz_defineMethod (c$, "getScoreMatrix", 
+function (pwtype) {
+var val = jalview.schemes.ResidueProperties.scoreMatrices.get (pwtype);
+if (val != null && Clazz_instanceOf (val, jalview.schemes.ScoreMatrix)) {
+return val;
+}return null;
+}, "~S");
+c$.getScoreModel = Clazz_defineMethod (c$, "getScoreModel", 
+function (pwtype) {
+return jalview.schemes.ResidueProperties.scoreMatrices.get (pwtype);
+}, "~S");
+c$.getPAM250 = Clazz_defineMethod (c$, "getPAM250", 
+function (c, d) {
+var a = jalview.schemes.ResidueProperties.aaIndex[c.charCodeAt (0)];
+var b = jalview.schemes.ResidueProperties.aaIndex[d.charCodeAt (0)];
+var pog = jalview.schemes.ResidueProperties.PAM250[a][b];
+return pog;
+}, "~S,~S");
+c$.getDssp3state = Clazz_defineMethod (c$, "getDssp3state", 
+function (ssstring) {
+if (ssstring == null) {
+return null;
+}var ss =  new StringBuffer ();
+for (var i = 0; i < ssstring.length; i++) {
+var ssc = ssstring.substring (i, i + 1);
+if (jalview.schemes.ResidueProperties.toDssp3State.containsKey (ssc)) {
+ss.append (jalview.schemes.ResidueProperties.toDssp3State.get (ssc));
+} else {
+ss.append (" ");
+}}
+return ss.toString ();
+}, "~S");
+c$.getRNASecStrucState = Clazz_defineMethod (c$, "getRNASecStrucState", 
+function (ssstring) {
+if (ssstring == null) {
+return null;
+}var ss =  new StringBuffer ();
+for (var i = 0; i < ssstring.length; i++) {
+var ssc = ssstring.substring (i, i + 1);
+if (jalview.schemes.ResidueProperties.toRNAssState.containsKey (ssc)) {
+ss.append (ssc);
+} else {
+ss.append (" ");
+}}
+return ss.toString ();
+}, "~S");
+c$.isCloseParenRNA = Clazz_defineMethod (c$, "isCloseParenRNA", 
+function (dc) {
+return jalview.schemes.ResidueProperties.RNAcloseParen[dc.charCodeAt (0)];
+}, "~S");
+c$.getResidues = Clazz_defineMethod (c$, "getResidues", 
+function (nucleotide, includeAmbiguous) {
+var result =  new java.util.ArrayList ();
+if (nucleotide) {
+for (var nuc, $nuc = jalview.schemes.ResidueProperties.nucleotideName.keySet ().iterator (); $nuc.hasNext () && ((nuc = $nuc.next ()) || true);) {
+var val = jalview.schemes.ResidueProperties.nucleotideIndex[nuc.charCodeAt (0)];
+if ((!includeAmbiguous && val > 4) || (val >= 10)) {
+continue;
+}nuc = nuc.toUpperCase ();
+if (!result.contains (nuc)) {
+result.add (nuc);
+}}
+} else {
+for (var res, $res = jalview.schemes.ResidueProperties.aa3Hash.keySet ().iterator (); $res.hasNext () && ((res = $res.next ()) || true);) {
+var index = jalview.schemes.ResidueProperties.aa3Hash.get (res).intValue ();
+if ((!includeAmbiguous && index >= 20) || index >= 23) {
+continue;
+}res = res.toUpperCase ();
+if (!result.contains (res)) {
+result.add (res);
+}}
+}return result;
+}, "~B,~B");
+c$.scoreMatrices = c$.prototype.scoreMatrices =  new java.util.Hashtable ();
+Clazz_defineStatics (c$,
+"aaIndex", null,
+"nucleotideIndex", null,
+"purinepyrimidineIndex", null);
+c$.aa3Hash = c$.prototype.aa3Hash =  new java.util.HashMap ();
+c$.aa2Triplet = c$.prototype.aa2Triplet =  new java.util.HashMap ();
+c$.nucleotideName = c$.prototype.nucleotideName =  new java.util.HashMap ();
+{
+jalview.schemes.ResidueProperties.aaIndex =  Clazz_newIntArray (255, 0);
+for (var i = 0; i < 255; i++) {
+jalview.schemes.ResidueProperties.aaIndex[i] = 23;
+}
+jalview.schemes.ResidueProperties.aaIndex['A'.charCodeAt (0)] = 0;
+jalview.schemes.ResidueProperties.aaIndex['R'.charCodeAt (0)] = 1;
+jalview.schemes.ResidueProperties.aaIndex['N'.charCodeAt (0)] = 2;
+jalview.schemes.ResidueProperties.aaIndex['D'.charCodeAt (0)] = 3;
+jalview.schemes.ResidueProperties.aaIndex['C'.charCodeAt (0)] = 4;
+jalview.schemes.ResidueProperties.aaIndex['Q'.charCodeAt (0)] = 5;
+jalview.schemes.ResidueProperties.aaIndex['E'.charCodeAt (0)] = 6;
+jalview.schemes.ResidueProperties.aaIndex['G'.charCodeAt (0)] = 7;
+jalview.schemes.ResidueProperties.aaIndex['H'.charCodeAt (0)] = 8;
+jalview.schemes.ResidueProperties.aaIndex['I'.charCodeAt (0)] = 9;
+jalview.schemes.ResidueProperties.aaIndex['L'.charCodeAt (0)] = 10;
+jalview.schemes.ResidueProperties.aaIndex['K'.charCodeAt (0)] = 11;
+jalview.schemes.ResidueProperties.aaIndex['M'.charCodeAt (0)] = 12;
+jalview.schemes.ResidueProperties.aaIndex['F'.charCodeAt (0)] = 13;
+jalview.schemes.ResidueProperties.aaIndex['P'.charCodeAt (0)] = 14;
+jalview.schemes.ResidueProperties.aaIndex['S'.charCodeAt (0)] = 15;
+jalview.schemes.ResidueProperties.aaIndex['T'.charCodeAt (0)] = 16;
+jalview.schemes.ResidueProperties.aaIndex['W'.charCodeAt (0)] = 17;
+jalview.schemes.ResidueProperties.aaIndex['Y'.charCodeAt (0)] = 18;
+jalview.schemes.ResidueProperties.aaIndex['V'.charCodeAt (0)] = 19;
+jalview.schemes.ResidueProperties.aaIndex['B'.charCodeAt (0)] = 20;
+jalview.schemes.ResidueProperties.aaIndex['Z'.charCodeAt (0)] = 21;
+jalview.schemes.ResidueProperties.aaIndex['X'.charCodeAt (0)] = 22;
+jalview.schemes.ResidueProperties.aaIndex['U'.charCodeAt (0)] = 22;
+jalview.schemes.ResidueProperties.aaIndex['a'.charCodeAt (0)] = 0;
+jalview.schemes.ResidueProperties.aaIndex['r'.charCodeAt (0)] = 1;
+jalview.schemes.ResidueProperties.aaIndex['n'.charCodeAt (0)] = 2;
+jalview.schemes.ResidueProperties.aaIndex['d'.charCodeAt (0)] = 3;
+jalview.schemes.ResidueProperties.aaIndex['c'.charCodeAt (0)] = 4;
+jalview.schemes.ResidueProperties.aaIndex['q'.charCodeAt (0)] = 5;
+jalview.schemes.ResidueProperties.aaIndex['e'.charCodeAt (0)] = 6;
+jalview.schemes.ResidueProperties.aaIndex['g'.charCodeAt (0)] = 7;
+jalview.schemes.ResidueProperties.aaIndex['h'.charCodeAt (0)] = 8;
+jalview.schemes.ResidueProperties.aaIndex['i'.charCodeAt (0)] = 9;
+jalview.schemes.ResidueProperties.aaIndex['l'.charCodeAt (0)] = 10;
+jalview.schemes.ResidueProperties.aaIndex['k'.charCodeAt (0)] = 11;
+jalview.schemes.ResidueProperties.aaIndex['m'.charCodeAt (0)] = 12;
+jalview.schemes.ResidueProperties.aaIndex['f'.charCodeAt (0)] = 13;
+jalview.schemes.ResidueProperties.aaIndex['p'.charCodeAt (0)] = 14;
+jalview.schemes.ResidueProperties.aaIndex['s'.charCodeAt (0)] = 15;
+jalview.schemes.ResidueProperties.aaIndex['t'.charCodeAt (0)] = 16;
+jalview.schemes.ResidueProperties.aaIndex['w'.charCodeAt (0)] = 17;
+jalview.schemes.ResidueProperties.aaIndex['y'.charCodeAt (0)] = 18;
+jalview.schemes.ResidueProperties.aaIndex['v'.charCodeAt (0)] = 19;
+jalview.schemes.ResidueProperties.aaIndex['b'.charCodeAt (0)] = 20;
+jalview.schemes.ResidueProperties.aaIndex['z'.charCodeAt (0)] = 21;
+jalview.schemes.ResidueProperties.aaIndex['x'.charCodeAt (0)] = 22;
+jalview.schemes.ResidueProperties.aaIndex['u'.charCodeAt (0)] = 22;
+}Clazz_defineStatics (c$,
+"maxProteinIndex", 23,
+"maxNucleotideIndex", 10);
+{
+jalview.schemes.ResidueProperties.nucleotideIndex =  Clazz_newIntArray (255, 0);
+for (var i = 0; i < 255; i++) {
+jalview.schemes.ResidueProperties.nucleotideIndex[i] = 10;
+}
+jalview.schemes.ResidueProperties.nucleotideIndex['A'.charCodeAt (0)] = 0;
+jalview.schemes.ResidueProperties.nucleotideIndex['a'.charCodeAt (0)] = 0;
+jalview.schemes.ResidueProperties.nucleotideIndex['C'.charCodeAt (0)] = 1;
+jalview.schemes.ResidueProperties.nucleotideIndex['c'.charCodeAt (0)] = 1;
+jalview.schemes.ResidueProperties.nucleotideIndex['G'.charCodeAt (0)] = 2;
+jalview.schemes.ResidueProperties.nucleotideIndex['g'.charCodeAt (0)] = 2;
+jalview.schemes.ResidueProperties.nucleotideIndex['T'.charCodeAt (0)] = 3;
+jalview.schemes.ResidueProperties.nucleotideIndex['t'.charCodeAt (0)] = 3;
+jalview.schemes.ResidueProperties.nucleotideIndex['U'.charCodeAt (0)] = 4;
+jalview.schemes.ResidueProperties.nucleotideIndex['u'.charCodeAt (0)] = 4;
+jalview.schemes.ResidueProperties.nucleotideIndex['I'.charCodeAt (0)] = 5;
+jalview.schemes.ResidueProperties.nucleotideIndex['i'.charCodeAt (0)] = 5;
+jalview.schemes.ResidueProperties.nucleotideIndex['X'.charCodeAt (0)] = 6;
+jalview.schemes.ResidueProperties.nucleotideIndex['x'.charCodeAt (0)] = 6;
+jalview.schemes.ResidueProperties.nucleotideIndex['R'.charCodeAt (0)] = 7;
+jalview.schemes.ResidueProperties.nucleotideIndex['r'.charCodeAt (0)] = 7;
+jalview.schemes.ResidueProperties.nucleotideIndex['Y'.charCodeAt (0)] = 8;
+jalview.schemes.ResidueProperties.nucleotideIndex['y'.charCodeAt (0)] = 8;
+jalview.schemes.ResidueProperties.nucleotideIndex['N'.charCodeAt (0)] = 9;
+jalview.schemes.ResidueProperties.nucleotideIndex['n'.charCodeAt (0)] = 9;
+jalview.schemes.ResidueProperties.nucleotideName.put ("A", "Adenine");
+jalview.schemes.ResidueProperties.nucleotideName.put ("a", "Adenine");
+jalview.schemes.ResidueProperties.nucleotideName.put ("G", "Guanine");
+jalview.schemes.ResidueProperties.nucleotideName.put ("g", "Guanine");
+jalview.schemes.ResidueProperties.nucleotideName.put ("C", "Cytosine");
+jalview.schemes.ResidueProperties.nucleotideName.put ("c", "Cytosine");
+jalview.schemes.ResidueProperties.nucleotideName.put ("T", "Thymine");
+jalview.schemes.ResidueProperties.nucleotideName.put ("t", "Thymine");
+jalview.schemes.ResidueProperties.nucleotideName.put ("U", "Uracil");
+jalview.schemes.ResidueProperties.nucleotideName.put ("u", "Uracil");
+jalview.schemes.ResidueProperties.nucleotideName.put ("I", "Inosine");
+jalview.schemes.ResidueProperties.nucleotideName.put ("i", "Inosine");
+jalview.schemes.ResidueProperties.nucleotideName.put ("X", "Xanthine");
+jalview.schemes.ResidueProperties.nucleotideName.put ("x", "Xanthine");
+jalview.schemes.ResidueProperties.nucleotideName.put ("R", "Unknown Purine");
+jalview.schemes.ResidueProperties.nucleotideName.put ("r", "Unknown Purine");
+jalview.schemes.ResidueProperties.nucleotideName.put ("Y", "Unknown Pyrimidine");
+jalview.schemes.ResidueProperties.nucleotideName.put ("y", "Unknown Pyrimidine");
+jalview.schemes.ResidueProperties.nucleotideName.put ("N", "Unknown");
+jalview.schemes.ResidueProperties.nucleotideName.put ("n", "Unknown");
+jalview.schemes.ResidueProperties.nucleotideName.put ("W", "Weak nucleotide (A or T)");
+jalview.schemes.ResidueProperties.nucleotideName.put ("w", "Weak nucleotide (A or T)");
+jalview.schemes.ResidueProperties.nucleotideName.put ("S", "Strong nucleotide (G or C)");
+jalview.schemes.ResidueProperties.nucleotideName.put ("s", "Strong nucleotide (G or C)");
+jalview.schemes.ResidueProperties.nucleotideName.put ("M", "Amino (A or C)");
+jalview.schemes.ResidueProperties.nucleotideName.put ("m", "Amino (A or C)");
+jalview.schemes.ResidueProperties.nucleotideName.put ("K", "Keto (G or T)");
+jalview.schemes.ResidueProperties.nucleotideName.put ("k", "Keto (G or T)");
+jalview.schemes.ResidueProperties.nucleotideName.put ("B", "Not A (G or C or T)");
+jalview.schemes.ResidueProperties.nucleotideName.put ("b", "Not A (G or C or T)");
+jalview.schemes.ResidueProperties.nucleotideName.put ("H", "Not G (A or C or T)");
+jalview.schemes.ResidueProperties.nucleotideName.put ("h", "Not G (A or C or T)");
+jalview.schemes.ResidueProperties.nucleotideName.put ("D", "Not C (A or G or T)");
+jalview.schemes.ResidueProperties.nucleotideName.put ("d", "Not C (A or G or T)");
+jalview.schemes.ResidueProperties.nucleotideName.put ("V", "Not T (A or G or C");
+jalview.schemes.ResidueProperties.nucleotideName.put ("v", "Not T (A or G or C");
+}{
+jalview.schemes.ResidueProperties.purinepyrimidineIndex =  Clazz_newIntArray (255, 0);
+for (var i = 0; i < 255; i++) {
+jalview.schemes.ResidueProperties.purinepyrimidineIndex[i] = 3;
+}
+jalview.schemes.ResidueProperties.purinepyrimidineIndex['A'.charCodeAt (0)] = 0;
+jalview.schemes.ResidueProperties.purinepyrimidineIndex['a'.charCodeAt (0)] = 0;
+jalview.schemes.ResidueProperties.purinepyrimidineIndex['C'.charCodeAt (0)] = 1;
+jalview.schemes.ResidueProperties.purinepyrimidineIndex['c'.charCodeAt (0)] = 1;
+jalview.schemes.ResidueProperties.purinepyrimidineIndex['G'.charCodeAt (0)] = 0;
+jalview.schemes.ResidueProperties.purinepyrimidineIndex['g'.charCodeAt (0)] = 0;
+jalview.schemes.ResidueProperties.purinepyrimidineIndex['T'.charCodeAt (0)] = 1;
+jalview.schemes.ResidueProperties.purinepyrimidineIndex['t'.charCodeAt (0)] = 1;
+jalview.schemes.ResidueProperties.purinepyrimidineIndex['U'.charCodeAt (0)] = 1;
+jalview.schemes.ResidueProperties.purinepyrimidineIndex['u'.charCodeAt (0)] = 1;
+jalview.schemes.ResidueProperties.purinepyrimidineIndex['I'.charCodeAt (0)] = 2;
+jalview.schemes.ResidueProperties.purinepyrimidineIndex['i'.charCodeAt (0)] = 2;
+jalview.schemes.ResidueProperties.purinepyrimidineIndex['X'.charCodeAt (0)] = 2;
+jalview.schemes.ResidueProperties.purinepyrimidineIndex['x'.charCodeAt (0)] = 2;
+jalview.schemes.ResidueProperties.purinepyrimidineIndex['R'.charCodeAt (0)] = 0;
+jalview.schemes.ResidueProperties.purinepyrimidineIndex['r'.charCodeAt (0)] = 0;
+jalview.schemes.ResidueProperties.purinepyrimidineIndex['Y'.charCodeAt (0)] = 1;
+jalview.schemes.ResidueProperties.purinepyrimidineIndex['y'.charCodeAt (0)] = 1;
+jalview.schemes.ResidueProperties.purinepyrimidineIndex['N'.charCodeAt (0)] = 2;
+jalview.schemes.ResidueProperties.purinepyrimidineIndex['n'.charCodeAt (0)] = 2;
+}{
+jalview.schemes.ResidueProperties.aa3Hash.put ("ALA",  new Integer (0));
+jalview.schemes.ResidueProperties.aa3Hash.put ("ARG",  new Integer (1));
+jalview.schemes.ResidueProperties.aa3Hash.put ("ASN",  new Integer (2));
+jalview.schemes.ResidueProperties.aa3Hash.put ("ASP",  new Integer (3));
+jalview.schemes.ResidueProperties.aa3Hash.put ("CYS",  new Integer (4));
+jalview.schemes.ResidueProperties.aa3Hash.put ("GLN",  new Integer (5));
+jalview.schemes.ResidueProperties.aa3Hash.put ("GLU",  new Integer (6));
+jalview.schemes.ResidueProperties.aa3Hash.put ("GLY",  new Integer (7));
+jalview.schemes.ResidueProperties.aa3Hash.put ("HIS",  new Integer (8));
+jalview.schemes.ResidueProperties.aa3Hash.put ("ILE",  new Integer (9));
+jalview.schemes.ResidueProperties.aa3Hash.put ("LEU",  new Integer (10));
+jalview.schemes.ResidueProperties.aa3Hash.put ("LYS",  new Integer (11));
+jalview.schemes.ResidueProperties.aa3Hash.put ("MET",  new Integer (12));
+jalview.schemes.ResidueProperties.aa3Hash.put ("PHE",  new Integer (13));
+jalview.schemes.ResidueProperties.aa3Hash.put ("PRO",  new Integer (14));
+jalview.schemes.ResidueProperties.aa3Hash.put ("SER",  new Integer (15));
+jalview.schemes.ResidueProperties.aa3Hash.put ("THR",  new Integer (16));
+jalview.schemes.ResidueProperties.aa3Hash.put ("TRP",  new Integer (17));
+jalview.schemes.ResidueProperties.aa3Hash.put ("TYR",  new Integer (18));
+jalview.schemes.ResidueProperties.aa3Hash.put ("VAL",  new Integer (19));
+jalview.schemes.ResidueProperties.aa3Hash.put ("ASX",  new Integer (20));
+jalview.schemes.ResidueProperties.aa3Hash.put ("GLX",  new Integer (21));
+jalview.schemes.ResidueProperties.aa3Hash.put ("XAA",  new Integer (22));
+jalview.schemes.ResidueProperties.aa3Hash.put ("-",  new Integer (23));
+jalview.schemes.ResidueProperties.aa3Hash.put ("*",  new Integer (23));
+jalview.schemes.ResidueProperties.aa3Hash.put (".",  new Integer (23));
+jalview.schemes.ResidueProperties.aa3Hash.put (" ",  new Integer (23));
+jalview.schemes.ResidueProperties.aa3Hash.put ("Gap",  new Integer (23));
+}{
+jalview.schemes.ResidueProperties.aa2Triplet.put ("A", "ALA");
+jalview.schemes.ResidueProperties.aa2Triplet.put ("a", "ALA");
+jalview.schemes.ResidueProperties.aa2Triplet.put ("R", "ARG");
+jalview.schemes.ResidueProperties.aa2Triplet.put ("r", "ARG");
+jalview.schemes.ResidueProperties.aa2Triplet.put ("N", "ASN");
+jalview.schemes.ResidueProperties.aa2Triplet.put ("n", "ASN");
+jalview.schemes.ResidueProperties.aa2Triplet.put ("D", "ASP");
+jalview.schemes.ResidueProperties.aa2Triplet.put ("d", "ASP");
+jalview.schemes.ResidueProperties.aa2Triplet.put ("C", "CYS");
+jalview.schemes.ResidueProperties.aa2Triplet.put ("c", "CYS");
+jalview.schemes.ResidueProperties.aa2Triplet.put ("Q", "GLN");
+jalview.schemes.ResidueProperties.aa2Triplet.put ("q", "GLN");
+jalview.schemes.ResidueProperties.aa2Triplet.put ("E", "GLU");
+jalview.schemes.ResidueProperties.aa2Triplet.put ("e", "GLU");
+jalview.schemes.ResidueProperties.aa2Triplet.put ("G", "GLY");
+jalview.schemes.ResidueProperties.aa2Triplet.put ("g", "GLY");
+jalview.schemes.ResidueProperties.aa2Triplet.put ("H", "HIS");
+jalview.schemes.ResidueProperties.aa2Triplet.put ("h", "HIS");
+jalview.schemes.ResidueProperties.aa2Triplet.put ("I", "ILE");
+jalview.schemes.ResidueProperties.aa2Triplet.put ("i", "ILE");
+jalview.schemes.ResidueProperties.aa2Triplet.put ("L", "LEU");
+jalview.schemes.ResidueProperties.aa2Triplet.put ("l", "LEU");
+jalview.schemes.ResidueProperties.aa2Triplet.put ("K", "LYS");
+jalview.schemes.ResidueProperties.aa2Triplet.put ("k", "LYS");
+jalview.schemes.ResidueProperties.aa2Triplet.put ("M", "MET");
+jalview.schemes.ResidueProperties.aa2Triplet.put ("m", "MET");
+jalview.schemes.ResidueProperties.aa2Triplet.put ("F", "PHE");
+jalview.schemes.ResidueProperties.aa2Triplet.put ("f", "PHE");
+jalview.schemes.ResidueProperties.aa2Triplet.put ("P", "PRO");
+jalview.schemes.ResidueProperties.aa2Triplet.put ("p", "PRO");
+jalview.schemes.ResidueProperties.aa2Triplet.put ("S", "SER");
+jalview.schemes.ResidueProperties.aa2Triplet.put ("s", "SER");
+jalview.schemes.ResidueProperties.aa2Triplet.put ("T", "THR");
+jalview.schemes.ResidueProperties.aa2Triplet.put ("t", "THR");
+jalview.schemes.ResidueProperties.aa2Triplet.put ("W", "TRP");
+jalview.schemes.ResidueProperties.aa2Triplet.put ("w", "TRP");
+jalview.schemes.ResidueProperties.aa2Triplet.put ("Y", "TYR");
+jalview.schemes.ResidueProperties.aa2Triplet.put ("y", "TYR");
+jalview.schemes.ResidueProperties.aa2Triplet.put ("V", "VAL");
+jalview.schemes.ResidueProperties.aa2Triplet.put ("v", "VAL");
+}Clazz_defineStatics (c$,
+"aa",  Clazz_newArray (-1, ["A", "R", "N", "D", "C", "Q", "E", "G", "H", "I", "L", "K", "M", "F", "P", "S", "T", "W", "Y", "V", "B", "Z", "X", "_", "*", ".", " "]));
+c$.midBlue = c$.prototype.midBlue =  new java.awt.Color (100, 100, 255);
+c$.scaleColours = c$.prototype.scaleColours =  new java.util.Vector ();
+{
+jalview.schemes.ResidueProperties.scaleColours.addElement ( new java.awt.Color (114, 0, 147));
+jalview.schemes.ResidueProperties.scaleColours.addElement ( new java.awt.Color (156, 0, 98));
+jalview.schemes.ResidueProperties.scaleColours.addElement ( new java.awt.Color (190, 0, 0));
+jalview.schemes.ResidueProperties.scaleColours.addElement (java.awt.Color.red);
+jalview.schemes.ResidueProperties.scaleColours.addElement ( new java.awt.Color (255, 125, 0));
+jalview.schemes.ResidueProperties.scaleColours.addElement (java.awt.Color.orange);
+jalview.schemes.ResidueProperties.scaleColours.addElement ( new java.awt.Color (255, 194, 85));
+jalview.schemes.ResidueProperties.scaleColours.addElement (java.awt.Color.yellow);
+jalview.schemes.ResidueProperties.scaleColours.addElement ( new java.awt.Color (255, 255, 181));
+jalview.schemes.ResidueProperties.scaleColours.addElement (java.awt.Color.white);
+}c$.taylor = c$.prototype.taylor =  Clazz_newArray (-1, [ new java.awt.Color (204, 255, 0),  new java.awt.Color (0, 0, 255),  new java.awt.Color (204, 0, 255),  new java.awt.Color (255, 0, 0),  new java.awt.Color (255, 255, 0),  new java.awt.Color (255, 0, 204),  new java.awt.Color (255, 0, 102),  new java.awt.Color (255, 153, 0),  new java.awt.Color (0, 102, 255),  new java.awt.Color (102, 255, 0),  new java.awt.Color (51, 255, 0),  new java.awt.Color (102, 0, 255),  new java.awt.Color (0, 255, 0),  new java.awt.Color (0, 255, 102),  new java.awt.Color (255, 204, 0),  new java.awt.Color (255, 51, 0),  new java.awt.Color (255, 102, 0),  new java.awt.Color (0, 204, 255),  new java.awt.Color (0, 255, 204),  new java.awt.Color (153, 255, 0), java.awt.Color.white, java.awt.Color.white, java.awt.Color.white, java.awt.Color.white, java.awt.Color.white, java.awt.Color.white]);
+c$.nucleotide = c$.prototype.nucleotide =  Clazz_newArray (-1, [ new java.awt.Color (100, 247, 63),  new java.awt.Color (255, 179, 64),  new java.awt.Color (235, 65, 60),  new java.awt.Color (60, 136, 238),  new java.awt.Color (60, 136, 238), java.awt.Color.white, java.awt.Color.white, java.awt.Color.white, java.awt.Color.white, java.awt.Color.white, java.awt.Color.white]);
+c$.purinepyrimidine = c$.prototype.purinepyrimidine =  Clazz_newArray (-1, [ new java.awt.Color (255, 131, 250),  new java.awt.Color (64, 224, 208), java.awt.Color.white, java.awt.Color.white]);
+c$.zappo = c$.prototype.zappo =  Clazz_newArray (-1, [java.awt.Color.pink, jalview.schemes.ResidueProperties.midBlue, java.awt.Color.green, java.awt.Color.red, java.awt.Color.yellow, java.awt.Color.green, java.awt.Color.red, java.awt.Color.magenta, jalview.schemes.ResidueProperties.midBlue, java.awt.Color.pink, java.awt.Color.pink, jalview.schemes.ResidueProperties.midBlue, java.awt.Color.pink, java.awt.Color.orange, java.awt.Color.magenta, java.awt.Color.green, java.awt.Color.green, java.awt.Color.orange, java.awt.Color.orange, java.awt.Color.pink, java.awt.Color.white, java.awt.Color.white, java.awt.Color.white, java.awt.Color.white, java.awt.Color.white, java.awt.Color.white, java.awt.Color.white]);
+Clazz_defineStatics (c$,
+"hyd2",  Clazz_newDoubleArray (-1, [0.62, 0.29, -0.9, -0.74, 1.19, 0.48, -0.4, 1.38, -1.5, 1.06, 0.64, -0.78, 0.12, -0.85, -2.53, -0.18, -0.05, 1.08, 0.81, 0.0, 0.26, 0.0, 0.0]),
+"helix",  Clazz_newDoubleArray (-1, [1.42, 0.98, 0.67, 1.01, 0.70, 1.11, 1.51, 0.57, 1.00, 1.08, 1.21, 1.16, 1.45, 1.13, 0.57, 0.77, 0.83, 1.08, 0.69, 1.06, 0.84, 1.31, 1.00, 0.0]),
+"helixmin", 0.57,
+"helixmax", 1.51,
+"strand",  Clazz_newDoubleArray (-1, [0.83, 0.93, 0.89, 0.54, 1.19, 1.10, 0.37, 0.75, 0.87, 1.60, 1.30, 0.74, 1.05, 1.38, 0.55, 0.75, 1.19, 1.37, 1.47, 1.70, 0.72, 0.74, 1.0, 0.0]),
+"strandmin", 0.37,
+"strandmax", 1.7,
+"turn",  Clazz_newDoubleArray (-1, [0.66, 0.95, 1.56, 1.46, 1.19, 0.98, 0.74, 1.56, 0.95, 0.47, 0.59, 1.01, 0.60, 0.60, 1.52, 1.43, 0.96, 0.96, 1.14, 0.50, 1.51, 0.86, 1.00, 0, 0]),
+"turnmin", 0.47,
+"turnmax", 1.56,
+"buried",  Clazz_newDoubleArray (-1, [1.7, 0.1, 0.4, 0.4, 4.6, 0.3, 0.3, 1.8, 0.8, 3.1, 2.4, 0.05, 1.9, 2.2, 0.6, 0.8, 0.7, 1.6, 0.5, 2.9, 0.4, 0.3, 1.358, 0.00]),
+"buriedmin", 0.05,
+"buriedmax", 4.6,
+"hyd",  Clazz_newDoubleArray (-1, [1.8, -4.5, -3.5, -3.5, 2.5, -3.5, -3.5, -0.4, -3.2, 4.5, 3.8, -3.9, 1.9, 2.8, -1.6, -0.8, -0.7, -0.9, -1.3, 4.2, -3.5, -3.5, -0.49, 0.0]),
+"hydmax", 4.5,
+"hydmin", -3.9,
+"BLOSUM62",  Clazz_newArray (-1, [ Clazz_newIntArray (-1, [4, -1, -2, -2, 0, -1, -1, 0, -2, -1, -1, -1, -1, -2, -1, 1, 0, -3, -2, 0, -2, -1, 0, -4]),  Clazz_newIntArray (-1, [-1, 5, 0, -2, -3, 1, 0, -2, 0, -3, -2, 2, -1, -3, -2, -1, -1, -3, -2, -3, -1, 0, -1, -4]),  Clazz_newIntArray (-1, [-2, 0, 6, 1, -3, 0, 0, 0, 1, -3, -3, 0, -2, -3, -2, 1, 0, -4, -2, -3, 3, 0, -1, -4]),  Clazz_newIntArray (-1, [-2, -2, 1, 6, -3, 0, 2, -1, -1, -3, -4, -1, -3, -3, -1, 0, -1, -4, -3, -3, 4, 1, -1, -4]),  Clazz_newIntArray (-1, [0, 3, -3, -3, 9, -3, -4, -3, -3, -1, -1, -3, -1, -2, -3, -1, -1, -2, -2, -1, -3, -3, -2, -4]),  Clazz_newIntArray (-1, [-1, 1, 0, 0, -3, 5, 2, -2, 0, -3, -2, 1, 0, -3, -1, 0, -1, -2, -1, -2, 0, 3, -1, -4]),  Clazz_newIntArray (-1, [-1, 0, 0, 2, -4, 2, 5, -2, 0, -3, -3, 1, -2, -3, -1, 0, -1, -3, -2, -2, 1, 4, -1, -4]),  Clazz_newIntArray (-1, [0, -2, 0, -1, -3, -2, -2, 6, -2, -4, -4, -2, -3, -3, -2, 0, -2, -2, -3, -3, -1, -2, -1, -4]),  Clazz_newIntArray (-1, [-2, 0, 1, -1, -3, 0, 0, -2, 8, -3, -3, -1, -2, -1, -2, -1, -2, -2, 2, -3, 0, 0, -1, -4]),  Clazz_newIntArray (-1, [-1, -3, -3, -3, -1, -3, -3, -4, -3, 4, 2, -3, 1, 0, -3, -2, -1, -3, -1, 3, -3, -3, -1, -4]),  Clazz_newIntArray (-1, [-1, -2, -3, -4, -1, -2, -3, -4, -3, 2, 4, -2, 2, 0, -3, -2, -1, -2, -1, 1, -4, -3, -1, -4]),  Clazz_newIntArray (-1, [-1, 2, 0, -1, -3, 1, 1, -2, -1, -3, -2, 5, -1, -3, -1, 0, -1, -3, -2, -2, 0, 1, -1, -4]),  Clazz_newIntArray (-1, [-1, -1, -2, -3, -1, 0, -2, -3, -2, 1, 2, -1, 5, 0, -2, -1, -1, -1, -1, 1, -3, -1, -1, -4]),  Clazz_newIntArray (-1, [-2, -3, -3, -3, -2, -3, -3, -3, -1, 0, 0, -3, 0, 6, -4, -2, -2, 1, 3, -1, -3, -3, -1, -4]),  Clazz_newIntArray (-1, [-1, -2, -2, -1, -3, -1, -1, -2, -2, -3, -3, -1, -2, -4, 7, -1, -1, -4, -3, -2, -2, -1, -2, -4]),  Clazz_newIntArray (-1, [1, -1, 1, 0, -1, 0, 0, 0, -1, -2, -2, 0, -1, -2, -1, 4, 1, -3, -2, -2, 0, 0, 0, -4]),  Clazz_newIntArray (-1, [0, -1, 0, -1, -1, -1, -1, -2, -2, -1, -1, -1, -1, -2, -1, 1, 5, -2, -2, 0, -1, -1, 0, -4]),  Clazz_newIntArray (-1, [-3, -3, -4, -4, -2, -2, -3, -2, -2, -3, -2, -3, -1, 1, -4, -3, -2, 11, 2, -3, -4, -3, -2, -4]),  Clazz_newIntArray (-1, [-2, -2, -2, -3, -2, -1, -2, -3, 2, -1, -1, -2, -1, 3, -3, -2, -2, 2, 7, -1, -3, -2, -1, -4]),  Clazz_newIntArray (-1, [0, -3, -3, -3, -1, -2, -2, -3, -3, 3, 1, -2, 1, -1, -2, -2, 0, -3, -1, 4, -3, -2, -1, -4]),  Clazz_newIntArray (-1, [-2, -1, 3, 4, -3, 0, 1, -1, 0, -3, -4, 0, -3, -3, -2, 0, -1, -4, -3, -3, 4, 1, -1, -4]),  Clazz_newIntArray (-1, [-1, 0, 0, 1, -3, 3, 4, -2, 0, -3, -3, 1, -1, -3, -1, 0, -1, -3, -2, -2, 1, 4, -1, -4]),  Clazz_newIntArray (-1, [0, -1, -1, -1, -2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -2, 0, 0, -2, -1, -1, -1, -1, -1, -4]),  Clazz_newIntArray (-1, [-4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, 1])]),
+"PAM250",  Clazz_newArray (-1, [ Clazz_newIntArray (-1, [2, -2, 0, 0, -2, 0, 0, 1, -1, -1, -2, -1, -1, -3, 1, 1, 1, -6, -3, 0, 0, 0, 0, -8]),  Clazz_newIntArray (-1, [-2, 6, 0, -1, -4, 1, -1, -3, 2, -2, -3, 3, 0, -4, 0, 0, -1, 2, -4, -2, -1, 0, -1, -8]),  Clazz_newIntArray (-1, [0, 0, 2, 2, -4, 1, 1, 0, 2, -2, -3, 1, -2, -3, 0, 1, 0, -4, -2, -2, 2, 1, 0, -8]),  Clazz_newIntArray (-1, [0, -1, 2, 4, -5, 2, 3, 1, 1, -2, -4, 0, -3, -6, -1, 0, 0, -7, -4, -2, 3, 3, -1, -8]),  Clazz_newIntArray (-1, [-2, -4, -4, -5, 12, -5, -5, -3, -3, -2, -6, -5, -5, -4, -3, 0, -2, -8, 0, -2, -4, -5, -3, -8]),  Clazz_newIntArray (-1, [0, 1, 1, 2, -5, 4, 2, -1, 3, -2, -2, 1, -1, -5, 0, -1, -1, -5, -4, -2, 1, 3, -1, -8]),  Clazz_newIntArray (-1, [0, -1, 1, 3, -5, 2, 4, 0, 1, -2, -3, 0, -2, -5, -1, 0, 0, -7, -4, -2, 3, 3, -1, -8]),  Clazz_newIntArray (-1, [1, -3, 0, 1, -3, -1, 0, 5, -2, -3, -4, -2, -3, -5, 0, 1, 0, -7, -5, -1, 0, 0, -1, -8]),  Clazz_newIntArray (-1, [-1, 2, 2, 1, -3, 3, 1, -2, 6, -2, -2, 0, -2, -2, 0, -1, -1, -3, 0, -2, 1, 2, -1, -8]),  Clazz_newIntArray (-1, [-1, -2, -2, -2, -2, -2, -2, -3, -2, 5, 2, -2, 2, 1, -2, -1, 0, -5, -1, 4, -2, -2, -1, -8]),  Clazz_newIntArray (-1, [-2, -3, -3, -4, -6, -2, -3, -4, -2, 2, 6, -3, 4, 2, -3, -3, -2, -2, -1, 2, -3, -3, -1, -8]),  Clazz_newIntArray (-1, [-1, 3, 1, 0, -5, 1, 0, -2, 0, -2, -3, 5, 0, -5, -1, 0, 0, -3, -4, -2, 1, 0, -1, -8]),  Clazz_newIntArray (-1, [-1, 0, -2, -3, -5, -1, -2, -3, -2, 2, 4, 0, 6, 0, -2, -2, -1, -4, -2, 2, -2, -2, -1, -8]),  Clazz_newIntArray (-1, [-3, -4, -3, -6, -4, -5, -5, -5, -2, 1, 2, -5, 0, 9, -5, -3, -3, 0, 7, -1, -4, -5, -2, -8]),  Clazz_newIntArray (-1, [1, 0, 0, -1, -3, 0, -1, 0, 0, -2, -3, -1, -2, -5, 6, 1, 0, -6, -5, -1, -1, 0, -1, -8]),  Clazz_newIntArray (-1, [1, 0, 1, 0, 0, -1, 0, 1, -1, -1, -3, 0, -2, -3, 1, 2, 1, -2, -3, -1, 0, 0, 0, -8]),  Clazz_newIntArray (-1, [1, -1, 0, 0, -2, -1, 0, 0, -1, 0, -2, 0, -1, -3, 0, 1, 3, -5, -3, 0, 0, -1, 0, -8]),  Clazz_newIntArray (-1, [-6, 2, -4, -7, -8, -5, -7, -7, -3, -5, -2, -3, -4, 0, -6, -2, -5, 17, 0, -6, -5, -6, -4, -8]),  Clazz_newIntArray (-1, [-3, -4, -2, -4, 0, -4, -4, -5, 0, -1, -1, -4, -2, 7, -5, -3, -3, 0, 10, -2, -3, -4, -2, -8]),  Clazz_newIntArray (-1, [0, -2, -2, -2, -2, -2, -2, -1, -2, 4, 2, -2, 2, -1, -1, -1, 0, -6, -2, 4, -2, -2, -1, -8]),  Clazz_newIntArray (-1, [0, -1, 2, 3, -4, 1, 3, 0, 1, -2, -3, 1, -2, -4, -1, 0, 0, -5, -3, -2, 3, 2, -1, -8]),  Clazz_newIntArray (-1, [0, 0, 1, 3, -5, 3, 3, 0, 2, -2, -3, 0, -2, -5, 0, 0, -1, -6, -4, -2, 2, 3, -1, -8]),  Clazz_newIntArray (-1, [0, -1, 0, -1, -3, -1, -1, -1, -1, -1, -1, -1, -1, -2, -1, 0, 0, -4, -2, -1, -1, -1, -1, -8]),  Clazz_newIntArray (-1, [-8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, 1])]));
+c$.ssHash = c$.prototype.ssHash =  new java.util.Hashtable ();
+{
+jalview.schemes.ResidueProperties.ssHash.put ("H", java.awt.Color.magenta);
+jalview.schemes.ResidueProperties.ssHash.put ("E", java.awt.Color.yellow);
+jalview.schemes.ResidueProperties.ssHash.put ("-", java.awt.Color.white);
+jalview.schemes.ResidueProperties.ssHash.put (".", java.awt.Color.white);
+jalview.schemes.ResidueProperties.ssHash.put ("S", java.awt.Color.cyan);
+jalview.schemes.ResidueProperties.ssHash.put ("T", java.awt.Color.blue);
+jalview.schemes.ResidueProperties.ssHash.put ("G", java.awt.Color.pink);
+jalview.schemes.ResidueProperties.ssHash.put ("I", java.awt.Color.pink);
+jalview.schemes.ResidueProperties.ssHash.put ("B", java.awt.Color.yellow);
+}Clazz_defineStatics (c$,
+"DNA",  Clazz_newArray (-1, [ Clazz_newIntArray (-1, [10, -8, -8, -8, -8, 1, 1, 1, -8, 1, 1]),  Clazz_newIntArray (-1, [-8, 10, -8, -8, -8, 1, 1, -8, 1, 1, 1]),  Clazz_newIntArray (-1, [-8, -8, 10, -8, -8, 1, 1, 1, -8, 1, 1]),  Clazz_newIntArray (-1, [-8, -8, -8, 10, 10, 1, 1, -8, 1, 1, 1]),  Clazz_newIntArray (-1, [-8, -8, -8, 10, 10, 1, 1, -8, 1, 1, 1]),  Clazz_newIntArray (-1, [1, 1, 1, 1, 1, 10, 0, 0, 0, 1, 1]),  Clazz_newIntArray (-1, [1, 1, 1, 1, 1, 0, 10, 0, 0, 1, 1]),  Clazz_newIntArray (-1, [1, -8, 1, -8, -8, 0, 0, 10, -8, 1, 1]),  Clazz_newIntArray (-1, [-8, 1, -8, 1, 1, 0, 0, -8, 10, 1, 1]),  Clazz_newIntArray (-1, [1, 1, 1, 1, 1, 1, 1, 1, 1, 10, 1]),  Clazz_newIntArray (-1, [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1])]));
+{
+jalview.schemes.ResidueProperties.scoreMatrices.put ("BLOSUM62",  new jalview.schemes.ScoreMatrix ("BLOSUM62", jalview.schemes.ResidueProperties.BLOSUM62, 0));
+jalview.schemes.ResidueProperties.scoreMatrices.put ("PAM250",  new jalview.schemes.ScoreMatrix ("PAM250", jalview.schemes.ResidueProperties.PAM250, 0));
+jalview.schemes.ResidueProperties.scoreMatrices.put ("DNA",  new jalview.schemes.ScoreMatrix ("DNA", jalview.schemes.ResidueProperties.DNA, 1));
+}c$.pidColours = c$.prototype.pidColours =  Clazz_newArray (-1, [jalview.schemes.ResidueProperties.midBlue,  new java.awt.Color (153, 153, 255),  new java.awt.Color (204, 204, 255)]);
+Clazz_defineStatics (c$,
+"pidThresholds",  Clazz_newFloatArray (-1, [80, 60, 40]));
+c$.codonHash = c$.prototype.codonHash =  new java.util.HashMap ();
+c$.Lys = c$.prototype.Lys =  new java.util.ArrayList ();
+c$.Asn = c$.prototype.Asn =  new java.util.ArrayList ();
+c$.Gln = c$.prototype.Gln =  new java.util.ArrayList ();
+c$.His = c$.prototype.His =  new java.util.ArrayList ();
+c$.Glu = c$.prototype.Glu =  new java.util.ArrayList ();
+c$.Asp = c$.prototype.Asp =  new java.util.ArrayList ();
+c$.Tyr = c$.prototype.Tyr =  new java.util.ArrayList ();
+c$.Thr = c$.prototype.Thr =  new java.util.ArrayList ();
+c$.Pro = c$.prototype.Pro =  new java.util.ArrayList ();
+c$.Ala = c$.prototype.Ala =  new java.util.ArrayList ();
+c$.Ser = c$.prototype.Ser =  new java.util.ArrayList ();
+c$.Arg = c$.prototype.Arg =  new java.util.ArrayList ();
+c$.Gly = c$.prototype.Gly =  new java.util.ArrayList ();
+c$.Trp = c$.prototype.Trp =  new java.util.ArrayList ();
+c$.Cys = c$.prototype.Cys =  new java.util.ArrayList ();
+c$.Ile = c$.prototype.Ile =  new java.util.ArrayList ();
+c$.Met = c$.prototype.Met =  new java.util.ArrayList ();
+c$.Leu = c$.prototype.Leu =  new java.util.ArrayList ();
+c$.Val = c$.prototype.Val =  new java.util.ArrayList ();
+c$.Phe = c$.prototype.Phe =  new java.util.ArrayList ();
+c$.STOP = c$.prototype.STOP =  new java.util.ArrayList ();
+Clazz_defineStatics (c$,
+"START", "ATG");
+{
+jalview.schemes.ResidueProperties.codonHash.put ("K", jalview.schemes.ResidueProperties.Lys);
+jalview.schemes.ResidueProperties.codonHash.put ("N", jalview.schemes.ResidueProperties.Asn);
+jalview.schemes.ResidueProperties.codonHash.put ("Q", jalview.schemes.ResidueProperties.Gln);
+jalview.schemes.ResidueProperties.codonHash.put ("H", jalview.schemes.ResidueProperties.His);
+jalview.schemes.ResidueProperties.codonHash.put ("E", jalview.schemes.ResidueProperties.Glu);
+jalview.schemes.ResidueProperties.codonHash.put ("D", jalview.schemes.ResidueProperties.Asp);
+jalview.schemes.ResidueProperties.codonHash.put ("Y", jalview.schemes.ResidueProperties.Tyr);
+jalview.schemes.ResidueProperties.codonHash.put ("T", jalview.schemes.ResidueProperties.Thr);
+jalview.schemes.ResidueProperties.codonHash.put ("P", jalview.schemes.ResidueProperties.Pro);
+jalview.schemes.ResidueProperties.codonHash.put ("A", jalview.schemes.ResidueProperties.Ala);
+jalview.schemes.ResidueProperties.codonHash.put ("S", jalview.schemes.ResidueProperties.Ser);
+jalview.schemes.ResidueProperties.codonHash.put ("R", jalview.schemes.ResidueProperties.Arg);
+jalview.schemes.ResidueProperties.codonHash.put ("G", jalview.schemes.ResidueProperties.Gly);
+jalview.schemes.ResidueProperties.codonHash.put ("W", jalview.schemes.ResidueProperties.Trp);
+jalview.schemes.ResidueProperties.codonHash.put ("C", jalview.schemes.ResidueProperties.Cys);
+jalview.schemes.ResidueProperties.codonHash.put ("I", jalview.schemes.ResidueProperties.Ile);
+jalview.schemes.ResidueProperties.codonHash.put ("M", jalview.schemes.ResidueProperties.Met);
+jalview.schemes.ResidueProperties.codonHash.put ("L", jalview.schemes.ResidueProperties.Leu);
+jalview.schemes.ResidueProperties.codonHash.put ("V", jalview.schemes.ResidueProperties.Val);
+jalview.schemes.ResidueProperties.codonHash.put ("F", jalview.schemes.ResidueProperties.Phe);
+jalview.schemes.ResidueProperties.codonHash.put ("STOP", jalview.schemes.ResidueProperties.STOP);
+}c$.ambiguityCodes = c$.prototype.ambiguityCodes =  new java.util.Hashtable ();
+c$.codonHash2 = c$.prototype.codonHash2 =  new java.util.Hashtable ();
+c$._ambiguityCodes = c$.prototype._ambiguityCodes =  new java.util.Hashtable ();
+{
+jalview.schemes.ResidueProperties.ambiguityCodes.put ("R",  Clazz_newArray (-1, ["A", "G"]));
+jalview.schemes.ResidueProperties.ambiguityCodes.put ("Y",  Clazz_newArray (-1, ["T", "C"]));
+jalview.schemes.ResidueProperties.ambiguityCodes.put ("W",  Clazz_newArray (-1, ["A", "T"]));
+jalview.schemes.ResidueProperties.ambiguityCodes.put ("S",  Clazz_newArray (-1, ["G", "C"]));
+jalview.schemes.ResidueProperties.ambiguityCodes.put ("M",  Clazz_newArray (-1, ["A", "C"]));
+jalview.schemes.ResidueProperties.ambiguityCodes.put ("K",  Clazz_newArray (-1, ["G", "T"]));
+jalview.schemes.ResidueProperties.ambiguityCodes.put ("H",  Clazz_newArray (-1, ["A", "T", "C"]));
+jalview.schemes.ResidueProperties.ambiguityCodes.put ("B",  Clazz_newArray (-1, ["G", "T", "C"]));
+jalview.schemes.ResidueProperties.ambiguityCodes.put ("V",  Clazz_newArray (-1, ["G", "A", "C"]));
+jalview.schemes.ResidueProperties.ambiguityCodes.put ("D",  Clazz_newArray (-1, ["G", "A", "T"]));
+jalview.schemes.ResidueProperties.ambiguityCodes.put ("N",  Clazz_newArray (-1, ["G", "A", "T", "C"]));
+jalview.schemes.ResidueProperties.codonHash2.put ("AAA", "K");
+jalview.schemes.ResidueProperties.codonHash2.put ("AAG", "K");
+jalview.schemes.ResidueProperties.codonHash2.put ("AAC", "N");
+jalview.schemes.ResidueProperties.codonHash2.put ("AAT", "N");
+jalview.schemes.ResidueProperties.codonHash2.put ("CAA", "Q");
+jalview.schemes.ResidueProperties.codonHash2.put ("CAG", "Q");
+jalview.schemes.ResidueProperties.codonHash2.put ("CAC", "H");
+jalview.schemes.ResidueProperties.codonHash2.put ("CAT", "H");
+jalview.schemes.ResidueProperties.codonHash2.put ("GAA", "E");
+jalview.schemes.ResidueProperties.codonHash2.put ("GAG", "E");
+jalview.schemes.ResidueProperties.codonHash2.put ("GAC", "D");
+jalview.schemes.ResidueProperties.codonHash2.put ("GAT", "D");
+jalview.schemes.ResidueProperties.codonHash2.put ("TAC", "Y");
+jalview.schemes.ResidueProperties.codonHash2.put ("TAT", "Y");
+jalview.schemes.ResidueProperties.codonHash2.put ("ACA", "T");
+jalview.schemes.ResidueProperties.codonHash2.put ("ACC", "T");
+jalview.schemes.ResidueProperties.codonHash2.put ("ACT", "T");
+jalview.schemes.ResidueProperties.codonHash2.put ("ACG", "T");
+jalview.schemes.ResidueProperties.codonHash2.put ("CCA", "P");
+jalview.schemes.ResidueProperties.codonHash2.put ("CCG", "P");
+jalview.schemes.ResidueProperties.codonHash2.put ("CCC", "P");
+jalview.schemes.ResidueProperties.codonHash2.put ("CCT", "P");
+jalview.schemes.ResidueProperties.codonHash2.put ("GCA", "A");
+jalview.schemes.ResidueProperties.codonHash2.put ("GCG", "A");
+jalview.schemes.ResidueProperties.codonHash2.put ("GCC", "A");
+jalview.schemes.ResidueProperties.codonHash2.put ("GCT", "A");
+jalview.schemes.ResidueProperties.codonHash2.put ("TCA", "S");
+jalview.schemes.ResidueProperties.codonHash2.put ("TCG", "S");
+jalview.schemes.ResidueProperties.codonHash2.put ("TCC", "S");
+jalview.schemes.ResidueProperties.codonHash2.put ("TCT", "S");
+jalview.schemes.ResidueProperties.codonHash2.put ("AGC", "S");
+jalview.schemes.ResidueProperties.codonHash2.put ("AGT", "S");
+jalview.schemes.ResidueProperties.codonHash2.put ("AGA", "R");
+jalview.schemes.ResidueProperties.codonHash2.put ("AGG", "R");
+jalview.schemes.ResidueProperties.codonHash2.put ("CGA", "R");
+jalview.schemes.ResidueProperties.codonHash2.put ("CGG", "R");
+jalview.schemes.ResidueProperties.codonHash2.put ("CGC", "R");
+jalview.schemes.ResidueProperties.codonHash2.put ("CGT", "R");
+jalview.schemes.ResidueProperties.codonHash2.put ("GGA", "G");
+jalview.schemes.ResidueProperties.codonHash2.put ("GGG", "G");
+jalview.schemes.ResidueProperties.codonHash2.put ("GGC", "G");
+jalview.schemes.ResidueProperties.codonHash2.put ("GGT", "G");
+jalview.schemes.ResidueProperties.codonHash2.put ("TGA", "*");
+jalview.schemes.ResidueProperties.codonHash2.put ("TAA", "*");
+jalview.schemes.ResidueProperties.codonHash2.put ("TAG", "*");
+jalview.schemes.ResidueProperties.codonHash2.put ("TGG", "W");
+jalview.schemes.ResidueProperties.codonHash2.put ("TGC", "C");
+jalview.schemes.ResidueProperties.codonHash2.put ("TGT", "C");
+jalview.schemes.ResidueProperties.codonHash2.put ("ATA", "I");
+jalview.schemes.ResidueProperties.codonHash2.put ("ATC", "I");
+jalview.schemes.ResidueProperties.codonHash2.put ("ATT", "I");
+jalview.schemes.ResidueProperties.codonHash2.put ("ATG", "M");
+jalview.schemes.ResidueProperties.codonHash2.put ("CTA", "L");
+jalview.schemes.ResidueProperties.codonHash2.put ("CTG", "L");
+jalview.schemes.ResidueProperties.codonHash2.put ("CTC", "L");
+jalview.schemes.ResidueProperties.codonHash2.put ("CTT", "L");
+jalview.schemes.ResidueProperties.codonHash2.put ("TTA", "L");
+jalview.schemes.ResidueProperties.codonHash2.put ("TTG", "L");
+jalview.schemes.ResidueProperties.codonHash2.put ("GTA", "V");
+jalview.schemes.ResidueProperties.codonHash2.put ("GTG", "V");
+jalview.schemes.ResidueProperties.codonHash2.put ("GTC", "V");
+jalview.schemes.ResidueProperties.codonHash2.put ("GTT", "V");
+jalview.schemes.ResidueProperties.codonHash2.put ("TTC", "F");
+jalview.schemes.ResidueProperties.codonHash2.put ("TTT", "F");
+jalview.schemes.ResidueProperties.buildAmbiguityCodonSet ();
+}{
+jalview.schemes.ResidueProperties.Lys.add ("AAA");
+jalview.schemes.ResidueProperties.Lys.add ("AAG");
+jalview.schemes.ResidueProperties.Asn.add ("AAC");
+jalview.schemes.ResidueProperties.Asn.add ("AAT");
+jalview.schemes.ResidueProperties.Gln.add ("CAA");
+jalview.schemes.ResidueProperties.Gln.add ("CAG");
+jalview.schemes.ResidueProperties.His.add ("CAC");
+jalview.schemes.ResidueProperties.His.add ("CAT");
+jalview.schemes.ResidueProperties.Glu.add ("GAA");
+jalview.schemes.ResidueProperties.Glu.add ("GAG");
+jalview.schemes.ResidueProperties.Asp.add ("GAC");
+jalview.schemes.ResidueProperties.Asp.add ("GAT");
+jalview.schemes.ResidueProperties.Tyr.add ("TAC");
+jalview.schemes.ResidueProperties.Tyr.add ("TAT");
+jalview.schemes.ResidueProperties.Thr.add ("ACA");
+jalview.schemes.ResidueProperties.Thr.add ("ACG");
+jalview.schemes.ResidueProperties.Thr.add ("ACC");
+jalview.schemes.ResidueProperties.Thr.add ("ACT");
+jalview.schemes.ResidueProperties.Pro.add ("CCA");
+jalview.schemes.ResidueProperties.Pro.add ("CCG");
+jalview.schemes.ResidueProperties.Pro.add ("CCC");
+jalview.schemes.ResidueProperties.Pro.add ("CCT");
+jalview.schemes.ResidueProperties.Ala.add ("GCA");
+jalview.schemes.ResidueProperties.Ala.add ("GCG");
+jalview.schemes.ResidueProperties.Ala.add ("GCC");
+jalview.schemes.ResidueProperties.Ala.add ("GCT");
+jalview.schemes.ResidueProperties.Ser.add ("TCA");
+jalview.schemes.ResidueProperties.Ser.add ("TCG");
+jalview.schemes.ResidueProperties.Ser.add ("TCC");
+jalview.schemes.ResidueProperties.Ser.add ("TCT");
+jalview.schemes.ResidueProperties.Ser.add ("AGC");
+jalview.schemes.ResidueProperties.Ser.add ("AGT");
+jalview.schemes.ResidueProperties.Arg.add ("AGA");
+jalview.schemes.ResidueProperties.Arg.add ("AGG");
+jalview.schemes.ResidueProperties.Arg.add ("CGA");
+jalview.schemes.ResidueProperties.Arg.add ("CGG");
+jalview.schemes.ResidueProperties.Arg.add ("CGC");
+jalview.schemes.ResidueProperties.Arg.add ("CGT");
+jalview.schemes.ResidueProperties.Gly.add ("GGA");
+jalview.schemes.ResidueProperties.Gly.add ("GGG");
+jalview.schemes.ResidueProperties.Gly.add ("GGC");
+jalview.schemes.ResidueProperties.Gly.add ("GGT");
+jalview.schemes.ResidueProperties.STOP.add ("TGA");
+jalview.schemes.ResidueProperties.STOP.add ("TAA");
+jalview.schemes.ResidueProperties.STOP.add ("TAG");
+jalview.schemes.ResidueProperties.Trp.add ("TGG");
+jalview.schemes.ResidueProperties.Cys.add ("TGC");
+jalview.schemes.ResidueProperties.Cys.add ("TGT");
+jalview.schemes.ResidueProperties.Ile.add ("ATA");
+jalview.schemes.ResidueProperties.Ile.add ("ATC");
+jalview.schemes.ResidueProperties.Ile.add ("ATT");
+jalview.schemes.ResidueProperties.Met.add ("ATG");
+jalview.schemes.ResidueProperties.Leu.add ("CTA");
+jalview.schemes.ResidueProperties.Leu.add ("CTG");
+jalview.schemes.ResidueProperties.Leu.add ("CTC");
+jalview.schemes.ResidueProperties.Leu.add ("CTT");
+jalview.schemes.ResidueProperties.Leu.add ("TTA");
+jalview.schemes.ResidueProperties.Leu.add ("TTG");
+jalview.schemes.ResidueProperties.Val.add ("GTA");
+jalview.schemes.ResidueProperties.Val.add ("GTG");
+jalview.schemes.ResidueProperties.Val.add ("GTC");
+jalview.schemes.ResidueProperties.Val.add ("GTT");
+jalview.schemes.ResidueProperties.Phe.add ("TTC");
+jalview.schemes.ResidueProperties.Phe.add ("TTT");
+}c$.propHash = c$.prototype.propHash =  new java.util.Hashtable ();
+c$.hydrophobic = c$.prototype.hydrophobic =  new java.util.Hashtable ();
+c$.polar = c$.prototype.polar =  new java.util.Hashtable ();
+c$.small = c$.prototype.small =  new java.util.Hashtable ();
+c$.positive = c$.prototype.positive =  new java.util.Hashtable ();
+c$.negative = c$.prototype.negative =  new java.util.Hashtable ();
+c$.charged = c$.prototype.charged =  new java.util.Hashtable ();
+c$.aromatic = c$.prototype.aromatic =  new java.util.Hashtable ();
+c$.aliphatic = c$.prototype.aliphatic =  new java.util.Hashtable ();
+c$.tiny = c$.prototype.tiny =  new java.util.Hashtable ();
+c$.proline = c$.prototype.proline =  new java.util.Hashtable ();
+{
+jalview.schemes.ResidueProperties.hydrophobic.put ("I",  new Integer (1));
+jalview.schemes.ResidueProperties.hydrophobic.put ("L",  new Integer (1));
+jalview.schemes.ResidueProperties.hydrophobic.put ("V",  new Integer (1));
+jalview.schemes.ResidueProperties.hydrophobic.put ("C",  new Integer (1));
+jalview.schemes.ResidueProperties.hydrophobic.put ("A",  new Integer (1));
+jalview.schemes.ResidueProperties.hydrophobic.put ("G",  new Integer (1));
+jalview.schemes.ResidueProperties.hydrophobic.put ("M",  new Integer (1));
+jalview.schemes.ResidueProperties.hydrophobic.put ("F",  new Integer (1));
+jalview.schemes.ResidueProperties.hydrophobic.put ("Y",  new Integer (1));
+jalview.schemes.ResidueProperties.hydrophobic.put ("W",  new Integer (1));
+jalview.schemes.ResidueProperties.hydrophobic.put ("H",  new Integer (1));
+jalview.schemes.ResidueProperties.hydrophobic.put ("K",  new Integer (1));
+jalview.schemes.ResidueProperties.hydrophobic.put ("X",  new Integer (1));
+jalview.schemes.ResidueProperties.hydrophobic.put ("-",  new Integer (1));
+jalview.schemes.ResidueProperties.hydrophobic.put ("*",  new Integer (1));
+jalview.schemes.ResidueProperties.hydrophobic.put ("R",  new Integer (0));
+jalview.schemes.ResidueProperties.hydrophobic.put ("E",  new Integer (0));
+jalview.schemes.ResidueProperties.hydrophobic.put ("Q",  new Integer (0));
+jalview.schemes.ResidueProperties.hydrophobic.put ("D",  new Integer (0));
+jalview.schemes.ResidueProperties.hydrophobic.put ("N",  new Integer (0));
+jalview.schemes.ResidueProperties.hydrophobic.put ("S",  new Integer (0));
+jalview.schemes.ResidueProperties.hydrophobic.put ("T",  new Integer (0));
+jalview.schemes.ResidueProperties.hydrophobic.put ("P",  new Integer (0));
+}{
+jalview.schemes.ResidueProperties.polar.put ("Y",  new Integer (1));
+jalview.schemes.ResidueProperties.polar.put ("W",  new Integer (1));
+jalview.schemes.ResidueProperties.polar.put ("H",  new Integer (1));
+jalview.schemes.ResidueProperties.polar.put ("K",  new Integer (1));
+jalview.schemes.ResidueProperties.polar.put ("R",  new Integer (1));
+jalview.schemes.ResidueProperties.polar.put ("E",  new Integer (1));
+jalview.schemes.ResidueProperties.polar.put ("Q",  new Integer (1));
+jalview.schemes.ResidueProperties.polar.put ("D",  new Integer (1));
+jalview.schemes.ResidueProperties.polar.put ("N",  new Integer (1));
+jalview.schemes.ResidueProperties.polar.put ("S",  new Integer (1));
+jalview.schemes.ResidueProperties.polar.put ("T",  new Integer (1));
+jalview.schemes.ResidueProperties.polar.put ("X",  new Integer (1));
+jalview.schemes.ResidueProperties.polar.put ("-",  new Integer (1));
+jalview.schemes.ResidueProperties.polar.put ("*",  new Integer (1));
+jalview.schemes.ResidueProperties.polar.put ("I",  new Integer (0));
+jalview.schemes.ResidueProperties.polar.put ("L",  new Integer (0));
+jalview.schemes.ResidueProperties.polar.put ("V",  new Integer (0));
+jalview.schemes.ResidueProperties.polar.put ("C",  new Integer (0));
+jalview.schemes.ResidueProperties.polar.put ("A",  new Integer (0));
+jalview.schemes.ResidueProperties.polar.put ("G",  new Integer (0));
+jalview.schemes.ResidueProperties.polar.put ("M",  new Integer (0));
+jalview.schemes.ResidueProperties.polar.put ("F",  new Integer (0));
+jalview.schemes.ResidueProperties.polar.put ("P",  new Integer (0));
+}{
+jalview.schemes.ResidueProperties.small.put ("I",  new Integer (0));
+jalview.schemes.ResidueProperties.small.put ("L",  new Integer (0));
+jalview.schemes.ResidueProperties.small.put ("V",  new Integer (1));
+jalview.schemes.ResidueProperties.small.put ("C",  new Integer (1));
+jalview.schemes.ResidueProperties.small.put ("A",  new Integer (1));
+jalview.schemes.ResidueProperties.small.put ("G",  new Integer (1));
+jalview.schemes.ResidueProperties.small.put ("M",  new Integer (0));
+jalview.schemes.ResidueProperties.small.put ("F",  new Integer (0));
+jalview.schemes.ResidueProperties.small.put ("Y",  new Integer (0));
+jalview.schemes.ResidueProperties.small.put ("W",  new Integer (0));
+jalview.schemes.ResidueProperties.small.put ("H",  new Integer (0));
+jalview.schemes.ResidueProperties.small.put ("K",  new Integer (0));
+jalview.schemes.ResidueProperties.small.put ("R",  new Integer (0));
+jalview.schemes.ResidueProperties.small.put ("E",  new Integer (0));
+jalview.schemes.ResidueProperties.small.put ("Q",  new Integer (0));
+jalview.schemes.ResidueProperties.small.put ("D",  new Integer (1));
+jalview.schemes.ResidueProperties.small.put ("N",  new Integer (1));
+jalview.schemes.ResidueProperties.small.put ("S",  new Integer (1));
+jalview.schemes.ResidueProperties.small.put ("T",  new Integer (1));
+jalview.schemes.ResidueProperties.small.put ("P",  new Integer (1));
+jalview.schemes.ResidueProperties.small.put ("-",  new Integer (1));
+jalview.schemes.ResidueProperties.small.put ("*",  new Integer (1));
+}{
+jalview.schemes.ResidueProperties.positive.put ("I",  new Integer (0));
+jalview.schemes.ResidueProperties.positive.put ("L",  new Integer (0));
+jalview.schemes.ResidueProperties.positive.put ("V",  new Integer (0));
+jalview.schemes.ResidueProperties.positive.put ("C",  new Integer (0));
+jalview.schemes.ResidueProperties.positive.put ("A",  new Integer (0));
+jalview.schemes.ResidueProperties.positive.put ("G",  new Integer (0));
+jalview.schemes.ResidueProperties.positive.put ("M",  new Integer (0));
+jalview.schemes.ResidueProperties.positive.put ("F",  new Integer (0));
+jalview.schemes.ResidueProperties.positive.put ("Y",  new Integer (0));
+jalview.schemes.ResidueProperties.positive.put ("W",  new Integer (0));
+jalview.schemes.ResidueProperties.positive.put ("H",  new Integer (1));
+jalview.schemes.ResidueProperties.positive.put ("K",  new Integer (1));
+jalview.schemes.ResidueProperties.positive.put ("R",  new Integer (1));
+jalview.schemes.ResidueProperties.positive.put ("E",  new Integer (0));
+jalview.schemes.ResidueProperties.positive.put ("Q",  new Integer (0));
+jalview.schemes.ResidueProperties.positive.put ("D",  new Integer (0));
+jalview.schemes.ResidueProperties.positive.put ("N",  new Integer (0));
+jalview.schemes.ResidueProperties.positive.put ("S",  new Integer (0));
+jalview.schemes.ResidueProperties.positive.put ("T",  new Integer (0));
+jalview.schemes.ResidueProperties.positive.put ("P",  new Integer (0));
+jalview.schemes.ResidueProperties.positive.put ("-",  new Integer (1));
+jalview.schemes.ResidueProperties.positive.put ("*",  new Integer (1));
+}{
+jalview.schemes.ResidueProperties.negative.put ("I",  new Integer (0));
+jalview.schemes.ResidueProperties.negative.put ("L",  new Integer (0));
+jalview.schemes.ResidueProperties.negative.put ("V",  new Integer (0));
+jalview.schemes.ResidueProperties.negative.put ("C",  new Integer (0));
+jalview.schemes.ResidueProperties.negative.put ("A",  new Integer (0));
+jalview.schemes.ResidueProperties.negative.put ("G",  new Integer (0));
+jalview.schemes.ResidueProperties.negative.put ("M",  new Integer (0));
+jalview.schemes.ResidueProperties.negative.put ("F",  new Integer (0));
+jalview.schemes.ResidueProperties.negative.put ("Y",  new Integer (0));
+jalview.schemes.ResidueProperties.negative.put ("W",  new Integer (0));
+jalview.schemes.ResidueProperties.negative.put ("H",  new Integer (0));
+jalview.schemes.ResidueProperties.negative.put ("K",  new Integer (0));
+jalview.schemes.ResidueProperties.negative.put ("R",  new Integer (0));
+jalview.schemes.ResidueProperties.negative.put ("E",  new Integer (1));
+jalview.schemes.ResidueProperties.negative.put ("Q",  new Integer (0));
+jalview.schemes.ResidueProperties.negative.put ("D",  new Integer (1));
+jalview.schemes.ResidueProperties.negative.put ("N",  new Integer (0));
+jalview.schemes.ResidueProperties.negative.put ("S",  new Integer (0));
+jalview.schemes.ResidueProperties.negative.put ("T",  new Integer (0));
+jalview.schemes.ResidueProperties.negative.put ("P",  new Integer (0));
+jalview.schemes.ResidueProperties.negative.put ("-",  new Integer (1));
+jalview.schemes.ResidueProperties.negative.put ("*",  new Integer (1));
+}{
+jalview.schemes.ResidueProperties.charged.put ("I",  new Integer (0));
+jalview.schemes.ResidueProperties.charged.put ("L",  new Integer (0));
+jalview.schemes.ResidueProperties.charged.put ("V",  new Integer (0));
+jalview.schemes.ResidueProperties.charged.put ("C",  new Integer (0));
+jalview.schemes.ResidueProperties.charged.put ("A",  new Integer (0));
+jalview.schemes.ResidueProperties.charged.put ("G",  new Integer (0));
+jalview.schemes.ResidueProperties.charged.put ("M",  new Integer (0));
+jalview.schemes.ResidueProperties.charged.put ("F",  new Integer (0));
+jalview.schemes.ResidueProperties.charged.put ("Y",  new Integer (0));
+jalview.schemes.ResidueProperties.charged.put ("W",  new Integer (0));
+jalview.schemes.ResidueProperties.charged.put ("H",  new Integer (1));
+jalview.schemes.ResidueProperties.charged.put ("K",  new Integer (1));
+jalview.schemes.ResidueProperties.charged.put ("R",  new Integer (1));
+jalview.schemes.ResidueProperties.charged.put ("E",  new Integer (1));
+jalview.schemes.ResidueProperties.charged.put ("Q",  new Integer (0));
+jalview.schemes.ResidueProperties.charged.put ("D",  new Integer (1));
+jalview.schemes.ResidueProperties.charged.put ("N",  new Integer (0));
+jalview.schemes.ResidueProperties.charged.put ("S",  new Integer (0));
+jalview.schemes.ResidueProperties.charged.put ("T",  new Integer (0));
+jalview.schemes.ResidueProperties.charged.put ("P",  new Integer (0));
+jalview.schemes.ResidueProperties.charged.put ("-",  new Integer (1));
+jalview.schemes.ResidueProperties.charged.put ("*",  new Integer (1));
+}{
+jalview.schemes.ResidueProperties.aromatic.put ("I",  new Integer (0));
+jalview.schemes.ResidueProperties.aromatic.put ("L",  new Integer (0));
+jalview.schemes.ResidueProperties.aromatic.put ("V",  new Integer (0));
+jalview.schemes.ResidueProperties.aromatic.put ("C",  new Integer (0));
+jalview.schemes.ResidueProperties.aromatic.put ("A",  new Integer (0));
+jalview.schemes.ResidueProperties.aromatic.put ("G",  new Integer (0));
+jalview.schemes.ResidueProperties.aromatic.put ("M",  new Integer (0));
+jalview.schemes.ResidueProperties.aromatic.put ("F",  new Integer (1));
+jalview.schemes.ResidueProperties.aromatic.put ("Y",  new Integer (1));
+jalview.schemes.ResidueProperties.aromatic.put ("W",  new Integer (1));
+jalview.schemes.ResidueProperties.aromatic.put ("H",  new Integer (1));
+jalview.schemes.ResidueProperties.aromatic.put ("K",  new Integer (0));
+jalview.schemes.ResidueProperties.aromatic.put ("R",  new Integer (0));
+jalview.schemes.ResidueProperties.aromatic.put ("E",  new Integer (0));
+jalview.schemes.ResidueProperties.aromatic.put ("Q",  new Integer (0));
+jalview.schemes.ResidueProperties.aromatic.put ("D",  new Integer (0));
+jalview.schemes.ResidueProperties.aromatic.put ("N",  new Integer (0));
+jalview.schemes.ResidueProperties.aromatic.put ("S",  new Integer (0));
+jalview.schemes.ResidueProperties.aromatic.put ("T",  new Integer (0));
+jalview.schemes.ResidueProperties.aromatic.put ("P",  new Integer (0));
+jalview.schemes.ResidueProperties.aromatic.put ("-",  new Integer (1));
+jalview.schemes.ResidueProperties.aromatic.put ("*",  new Integer (1));
+}{
+jalview.schemes.ResidueProperties.aliphatic.put ("I",  new Integer (1));
+jalview.schemes.ResidueProperties.aliphatic.put ("L",  new Integer (1));
+jalview.schemes.ResidueProperties.aliphatic.put ("V",  new Integer (1));
+jalview.schemes.ResidueProperties.aliphatic.put ("C",  new Integer (0));
+jalview.schemes.ResidueProperties.aliphatic.put ("A",  new Integer (0));
+jalview.schemes.ResidueProperties.aliphatic.put ("G",  new Integer (0));
+jalview.schemes.ResidueProperties.aliphatic.put ("M",  new Integer (0));
+jalview.schemes.ResidueProperties.aliphatic.put ("F",  new Integer (0));
+jalview.schemes.ResidueProperties.aliphatic.put ("Y",  new Integer (0));
+jalview.schemes.ResidueProperties.aliphatic.put ("W",  new Integer (0));
+jalview.schemes.ResidueProperties.aliphatic.put ("H",  new Integer (0));
+jalview.schemes.ResidueProperties.aliphatic.put ("K",  new Integer (0));
+jalview.schemes.ResidueProperties.aliphatic.put ("R",  new Integer (0));
+jalview.schemes.ResidueProperties.aliphatic.put ("E",  new Integer (0));
+jalview.schemes.ResidueProperties.aliphatic.put ("Q",  new Integer (0));
+jalview.schemes.ResidueProperties.aliphatic.put ("D",  new Integer (0));
+jalview.schemes.ResidueProperties.aliphatic.put ("N",  new Integer (0));
+jalview.schemes.ResidueProperties.aliphatic.put ("S",  new Integer (0));
+jalview.schemes.ResidueProperties.aliphatic.put ("T",  new Integer (0));
+jalview.schemes.ResidueProperties.aliphatic.put ("P",  new Integer (0));
+jalview.schemes.ResidueProperties.aliphatic.put ("-",  new Integer (1));
+jalview.schemes.ResidueProperties.aliphatic.put ("*",  new Integer (1));
+}{
+jalview.schemes.ResidueProperties.tiny.put ("I",  new Integer (0));
+jalview.schemes.ResidueProperties.tiny.put ("L",  new Integer (0));
+jalview.schemes.ResidueProperties.tiny.put ("V",  new Integer (0));
+jalview.schemes.ResidueProperties.tiny.put ("C",  new Integer (0));
+jalview.schemes.ResidueProperties.tiny.put ("A",  new Integer (1));
+jalview.schemes.ResidueProperties.tiny.put ("G",  new Integer (1));
+jalview.schemes.ResidueProperties.tiny.put ("M",  new Integer (0));
+jalview.schemes.ResidueProperties.tiny.put ("F",  new Integer (0));
+jalview.schemes.ResidueProperties.tiny.put ("Y",  new Integer (0));
+jalview.schemes.ResidueProperties.tiny.put ("W",  new Integer (0));
+jalview.schemes.ResidueProperties.tiny.put ("H",  new Integer (0));
+jalview.schemes.ResidueProperties.tiny.put ("K",  new Integer (0));
+jalview.schemes.ResidueProperties.tiny.put ("R",  new Integer (0));
+jalview.schemes.ResidueProperties.tiny.put ("E",  new Integer (0));
+jalview.schemes.ResidueProperties.tiny.put ("Q",  new Integer (0));
+jalview.schemes.ResidueProperties.tiny.put ("D",  new Integer (0));
+jalview.schemes.ResidueProperties.tiny.put ("N",  new Integer (0));
+jalview.schemes.ResidueProperties.tiny.put ("S",  new Integer (1));
+jalview.schemes.ResidueProperties.tiny.put ("T",  new Integer (0));
+jalview.schemes.ResidueProperties.tiny.put ("P",  new Integer (0));
+jalview.schemes.ResidueProperties.tiny.put ("-",  new Integer (1));
+jalview.schemes.ResidueProperties.tiny.put ("*",  new Integer (1));
+}{
+jalview.schemes.ResidueProperties.proline.put ("I",  new Integer (0));
+jalview.schemes.ResidueProperties.proline.put ("L",  new Integer (0));
+jalview.schemes.ResidueProperties.proline.put ("V",  new Integer (0));
+jalview.schemes.ResidueProperties.proline.put ("C",  new Integer (0));
+jalview.schemes.ResidueProperties.proline.put ("A",  new Integer (0));
+jalview.schemes.ResidueProperties.proline.put ("G",  new Integer (0));
+jalview.schemes.ResidueProperties.proline.put ("M",  new Integer (0));
+jalview.schemes.ResidueProperties.proline.put ("F",  new Integer (0));
+jalview.schemes.ResidueProperties.proline.put ("Y",  new Integer (0));
+jalview.schemes.ResidueProperties.proline.put ("W",  new Integer (0));
+jalview.schemes.ResidueProperties.proline.put ("H",  new Integer (0));
+jalview.schemes.ResidueProperties.proline.put ("K",  new Integer (0));
+jalview.schemes.ResidueProperties.proline.put ("R",  new Integer (0));
+jalview.schemes.ResidueProperties.proline.put ("E",  new Integer (0));
+jalview.schemes.ResidueProperties.proline.put ("Q",  new Integer (0));
+jalview.schemes.ResidueProperties.proline.put ("D",  new Integer (0));
+jalview.schemes.ResidueProperties.proline.put ("N",  new Integer (0));
+jalview.schemes.ResidueProperties.proline.put ("S",  new Integer (0));
+jalview.schemes.ResidueProperties.proline.put ("T",  new Integer (0));
+jalview.schemes.ResidueProperties.proline.put ("P",  new Integer (1));
+jalview.schemes.ResidueProperties.proline.put ("-",  new Integer (1));
+jalview.schemes.ResidueProperties.proline.put ("*",  new Integer (1));
+}{
+jalview.schemes.ResidueProperties.propHash.put ("hydrophobic", jalview.schemes.ResidueProperties.hydrophobic);
+jalview.schemes.ResidueProperties.propHash.put ("small", jalview.schemes.ResidueProperties.small);
+jalview.schemes.ResidueProperties.propHash.put ("positive", jalview.schemes.ResidueProperties.positive);
+jalview.schemes.ResidueProperties.propHash.put ("negative", jalview.schemes.ResidueProperties.negative);
+jalview.schemes.ResidueProperties.propHash.put ("charged", jalview.schemes.ResidueProperties.charged);
+jalview.schemes.ResidueProperties.propHash.put ("aromatic", jalview.schemes.ResidueProperties.aromatic);
+jalview.schemes.ResidueProperties.propHash.put ("aliphatic", jalview.schemes.ResidueProperties.aliphatic);
+jalview.schemes.ResidueProperties.propHash.put ("tiny", jalview.schemes.ResidueProperties.tiny);
+jalview.schemes.ResidueProperties.propHash.put ("proline", jalview.schemes.ResidueProperties.proline);
+jalview.schemes.ResidueProperties.propHash.put ("polar", jalview.schemes.ResidueProperties.polar);
+}{
+var propMatrixF =  Clazz_newIntArray (23, 23, 0);
+var propMatrixPos =  Clazz_newIntArray (23, 23, 0);
+var propMatrixEpos =  Clazz_newIntArray (23, 23, 0);
+for (var i = 0; i < 23; i++) {
+var maxF = 0;
+var maxP = 0;
+var maxEP = 0;
+var ic = "";
+if (jalview.schemes.ResidueProperties.aa.length > i) {
+ic += jalview.schemes.ResidueProperties.aa[i];
+} else {
+ic = "-";
+}for (var j = i + 1; j < 23; j++) {
+var jc = "";
+if (jalview.schemes.ResidueProperties.aa.length > j) {
+jc += jalview.schemes.ResidueProperties.aa[j];
+} else {
+jc = "-";
+}propMatrixF[i][j] = 0;
+propMatrixPos[i][j] = 0;
+propMatrixEpos[i][j] = 0;
+for (var en = jalview.schemes.ResidueProperties.propHash.keys (); en.hasMoreElements (); ) {
+var ph = en.nextElement ();
+var pph = jalview.schemes.ResidueProperties.propHash.get (ph);
+if (pph.get (ic) != null && pph.get (jc) != null) {
+var icp = pph.get (ic).intValue ();
+var jcp = pph.get (jc).intValue ();
+propMatrixPos[i][j] += icp == jcp && icp > 0 ? 2 : 0;
+propMatrixPos[j][i] += icp == jcp && icp > 0 ? 2 : 0;
+propMatrixF[i][j] += icp == jcp ? 2 : 0;
+propMatrixF[j][i] += icp == jcp ? 2 : 0;
+propMatrixEpos[i][j] += icp == jcp ? (1 + icp * 2) : 0;
+propMatrixEpos[j][i] += icp == jcp ? (1 + icp * 2) : 0;
+}}
+if (maxF < propMatrixF[i][j]) {
+maxF = propMatrixF[i][j];
+}if (maxP < propMatrixPos[i][j]) {
+maxP = propMatrixPos[i][j];
+}if (maxEP < propMatrixEpos[i][j]) {
+maxEP = propMatrixEpos[i][j];
+}}
+propMatrixF[i][i] = maxF;
+propMatrixPos[i][i] = maxP;
+propMatrixEpos[i][i] = maxEP;
+}
+jalview.schemes.ResidueProperties.scoreMatrices.put ("PID",  new jalview.analysis.scoremodels.PIDScoreModel ());
+jalview.schemes.ResidueProperties.scoreMatrices.put ("Displayed Features",  new jalview.analysis.scoremodels.FeatureScoreModel ());
+}Clazz_defineStatics (c$,
+"toDssp3State", null);
+{
+jalview.schemes.ResidueProperties.toDssp3State =  new java.util.Hashtable ();
+jalview.schemes.ResidueProperties.toDssp3State.put ("H", "H");
+jalview.schemes.ResidueProperties.toDssp3State.put ("E", "E");
+jalview.schemes.ResidueProperties.toDssp3State.put ("C", " ");
+jalview.schemes.ResidueProperties.toDssp3State.put (" ", " ");
+jalview.schemes.ResidueProperties.toDssp3State.put ("T", " ");
+jalview.schemes.ResidueProperties.toDssp3State.put ("B", "E");
+jalview.schemes.ResidueProperties.toDssp3State.put ("G", "H");
+jalview.schemes.ResidueProperties.toDssp3State.put ("I", "H");
+jalview.schemes.ResidueProperties.toDssp3State.put ("X", " ");
+}Clazz_defineStatics (c$,
+"toRNAssState", null,
+"RNAcloseParen",  Clazz_newBooleanArray (255, false));
+{
+jalview.schemes.ResidueProperties.toRNAssState =  new java.util.Hashtable ();
+jalview.schemes.ResidueProperties.toRNAssState.put (")", "(");
+jalview.schemes.ResidueProperties.toRNAssState.put ("(", "(");
+jalview.schemes.ResidueProperties.toRNAssState.put ("]", "[");
+jalview.schemes.ResidueProperties.toRNAssState.put ("[", "[");
+jalview.schemes.ResidueProperties.toRNAssState.put ("{", "{");
+jalview.schemes.ResidueProperties.toRNAssState.put ("}", "{");
+jalview.schemes.ResidueProperties.toRNAssState.put (">", ">");
+jalview.schemes.ResidueProperties.toRNAssState.put ("<", ">");
+jalview.schemes.ResidueProperties.toRNAssState.put ("A", "A");
+jalview.schemes.ResidueProperties.toRNAssState.put ("a", "A");
+jalview.schemes.ResidueProperties.toRNAssState.put ("B", "B");
+jalview.schemes.ResidueProperties.toRNAssState.put ("b", "B");
+jalview.schemes.ResidueProperties.toRNAssState.put ("C", "C");
+jalview.schemes.ResidueProperties.toRNAssState.put ("c", "C");
+jalview.schemes.ResidueProperties.toRNAssState.put ("D", "D");
+jalview.schemes.ResidueProperties.toRNAssState.put ("d", "D");
+jalview.schemes.ResidueProperties.toRNAssState.put ("E", "E");
+jalview.schemes.ResidueProperties.toRNAssState.put ("e", "E");
+jalview.schemes.ResidueProperties.toRNAssState.put ("F", "F");
+jalview.schemes.ResidueProperties.toRNAssState.put ("f", "F");
+jalview.schemes.ResidueProperties.toRNAssState.put ("G", "G");
+jalview.schemes.ResidueProperties.toRNAssState.put ("g", "G");
+jalview.schemes.ResidueProperties.toRNAssState.put ("H", "H");
+jalview.schemes.ResidueProperties.toRNAssState.put ("h", "H");
+jalview.schemes.ResidueProperties.toRNAssState.put ("I", "I");
+jalview.schemes.ResidueProperties.toRNAssState.put ("i", "I");
+jalview.schemes.ResidueProperties.toRNAssState.put ("J", "J");
+jalview.schemes.ResidueProperties.toRNAssState.put ("j", "J");
+jalview.schemes.ResidueProperties.toRNAssState.put ("K", "K");
+jalview.schemes.ResidueProperties.toRNAssState.put ("k", "K");
+jalview.schemes.ResidueProperties.toRNAssState.put ("L", "L");
+jalview.schemes.ResidueProperties.toRNAssState.put ("l", "L");
+jalview.schemes.ResidueProperties.toRNAssState.put ("M", "M");
+jalview.schemes.ResidueProperties.toRNAssState.put ("m", "M");
+jalview.schemes.ResidueProperties.toRNAssState.put ("N", "N");
+jalview.schemes.ResidueProperties.toRNAssState.put ("n", "N");
+jalview.schemes.ResidueProperties.toRNAssState.put ("O", "O");
+jalview.schemes.ResidueProperties.toRNAssState.put ("o", "O");
+jalview.schemes.ResidueProperties.toRNAssState.put ("P", "P");
+jalview.schemes.ResidueProperties.toRNAssState.put ("p", "P");
+jalview.schemes.ResidueProperties.toRNAssState.put ("Q", "Q");
+jalview.schemes.ResidueProperties.toRNAssState.put ("q", "Q");
+jalview.schemes.ResidueProperties.toRNAssState.put ("R", "R");
+jalview.schemes.ResidueProperties.toRNAssState.put ("r", "R");
+jalview.schemes.ResidueProperties.toRNAssState.put ("S", "S");
+jalview.schemes.ResidueProperties.toRNAssState.put ("s", "S");
+jalview.schemes.ResidueProperties.toRNAssState.put ("T", "T");
+jalview.schemes.ResidueProperties.toRNAssState.put ("t", "T");
+jalview.schemes.ResidueProperties.toRNAssState.put ("U", "U");
+jalview.schemes.ResidueProperties.toRNAssState.put ("u", "U");
+jalview.schemes.ResidueProperties.toRNAssState.put ("V", "V");
+jalview.schemes.ResidueProperties.toRNAssState.put ("v", "V");
+jalview.schemes.ResidueProperties.toRNAssState.put ("W", "W");
+jalview.schemes.ResidueProperties.toRNAssState.put ("w", "W");
+jalview.schemes.ResidueProperties.toRNAssState.put ("X", "X");
+jalview.schemes.ResidueProperties.toRNAssState.put ("x", "X");
+jalview.schemes.ResidueProperties.toRNAssState.put ("Y", "Y");
+jalview.schemes.ResidueProperties.toRNAssState.put ("y", "Y");
+jalview.schemes.ResidueProperties.toRNAssState.put ("Z", "Z");
+jalview.schemes.ResidueProperties.toRNAssState.put ("z", "Z");
+for (var p = 0; p < jalview.schemes.ResidueProperties.RNAcloseParen.length; p++) {
+jalview.schemes.ResidueProperties.RNAcloseParen[p] = false;
+}
+for (var k, $k = jalview.schemes.ResidueProperties.toRNAssState.keySet ().iterator (); $k.hasNext () && ((k = $k.next ()) || true);) {
+jalview.schemes.ResidueProperties.RNAcloseParen[k.charCodeAt (0)] = k.charAt (0) != jalview.schemes.ResidueProperties.toRNAssState.get (k).charAt (0);
+}
+}});
+Clazz_declarePackage ("jalview.analysis.scoremodels");
+Clazz_load (["jalview.api.analysis.ScoreModelI", "$.ViewBasedAnalysisI"], "jalview.analysis.scoremodels.FeatureScoreModel", ["jalview.util.Comparison", "java.util.ArrayList", "$.Arrays", "$.Hashtable"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.fr = null;
+Clazz_instantialize (this, arguments);
+}, jalview.analysis.scoremodels, "FeatureScoreModel", null, [jalview.api.analysis.ScoreModelI, jalview.api.analysis.ViewBasedAnalysisI]);
+Clazz_overrideMethod (c$, "configureFromAlignmentView", 
+function (view) {
+this.fr = view.cloneFeatureRenderer ();
+return true;
+}, "jalview.api.AlignmentViewPanel");
+Clazz_overrideMethod (c$, "findDistances", 
+function (seqData) {
+var nofeats = 0;
+var dft = java.util.Arrays.asList (this.fr.getDisplayedFeatureTypes ());
+if (dft != null) {
+nofeats = dft.size ();
+}var sequenceString = seqData.getVisibleAlignment (jalview.util.Comparison.GapChars.charAt (0)).getSequencesArray ();
+var noseqs = sequenceString.length;
+var cpwidth = seqData.getWidth ();
+var distance =  Clazz_newFloatArray (noseqs, noseqs, 0);
+if (nofeats == 0) {
+for (var d, $d = 0, $$d = distance; $d < $$d.length && ((d = $$d[$d]) || true); $d++) {
+for (var i = 0; i < d.length; d[i++] = 0) {
+;}
+}
+return distance;
+}var max = 0;
+for (var cpos = 0; cpos < cpwidth; cpos++) {
+var sfap =  new java.util.ArrayList ();
+for (var i = 0; i < noseqs; i++) {
+var types =  new java.util.Hashtable ();
+var sfs = this.fr.findFeaturesAtRes (sequenceString[i], sequenceString[i].findPosition (cpos));
+for (var sf, $sf = sfs.iterator (); $sf.hasNext () && ((sf = $sf.next ()) || true);) {
+types.put (sf.getType (), sf);
+}
+sfap.add (types);
+}
+for (var i = 0; i < (noseqs - 1); i++) {
+if (cpos == 0) {
+distance[i][i] = 0;
+}for (var j = i + 1; j < noseqs; j++) {
+var sfcommon = 0;
+var fi = sfap.get (i);
+var fk;
+var fj = sfap.get (j);
+if (fi.size () > fj.size ()) {
+fk = fj;
+} else {
+fk = fi;
+fi = fj;
+}for (var k, $k = fi.keySet ().iterator (); $k.hasNext () && ((k = $k.next ()) || true);) {
+var sfj = fk.get (k);
+if (sfj != null) {
+sfcommon++;
+}}
+distance[i][j] += (fi.size () + fk.size () - 2 * sfcommon);
+distance[j][i] += distance[i][j];
+}
+}
+}
+for (var i = 0; i < noseqs; i++) {
+for (var j = i + 1; j < noseqs; j++) {
+distance[i][j] /= cpwidth;
+distance[j][i] = distance[i][j];
+}
+}
+return distance;
+}, "jalview.datamodel.AlignmentView");
+Clazz_overrideMethod (c$, "getName", 
+function () {
+return "Sequence Feature Similarity";
+});
+Clazz_overrideMethod (c$, "isDNA", 
+function () {
+return true;
+});
+Clazz_overrideMethod (c$, "isProtein", 
+function () {
+return true;
+});
+Clazz_overrideMethod (c$, "toString", 
+function () {
+return "Score between sequences based on hamming distance between binary vectors marking features displayed at each column";
+});
+});
+Clazz_declarePackage ("jalview.api.analysis");
+Clazz_declareInterface (jalview.api.analysis, "ScoreModelI");
+Clazz_declarePackage ("jalview.api.analysis");
+Clazz_declareInterface (jalview.api.analysis, "ViewBasedAnalysisI");
+Clazz_declarePackage ("jalview.analysis.scoremodels");
+Clazz_load (["jalview.api.analysis.ScoreModelI"], "jalview.analysis.scoremodels.PIDScoreModel", ["jalview.util.Comparison"], function () {
+c$ = Clazz_declareType (jalview.analysis.scoremodels, "PIDScoreModel", null, jalview.api.analysis.ScoreModelI);
+Clazz_overrideMethod (c$, "findDistances", 
+function (seqData) {
+var sequenceString = seqData.getSequenceStrings (jalview.util.Comparison.GapChars.charAt (0));
+var noseqs = sequenceString.length;
+var distance =  Clazz_newFloatArray (noseqs, noseqs, 0);
+for (var i = 0; i < (noseqs - 1); i++) {
+for (var j = i; j < noseqs; j++) {
+if (j == i) {
+distance[i][i] = 0;
+} else {
+distance[i][j] = 100 - jalview.util.Comparison.PID (sequenceString[i], sequenceString[j]);
+distance[j][i] = distance[i][j];
+}}
+}
+return distance;
+}, "jalview.datamodel.AlignmentView");
+Clazz_overrideMethod (c$, "getName", 
+function () {
+return "PID";
+});
+Clazz_overrideMethod (c$, "isDNA", 
+function () {
+return true;
+});
+Clazz_overrideMethod (c$, "isProtein", 
+function () {
+return true;
+});
+});
+Clazz_declarePackage ("jalview.schemes");
+Clazz_load (["jalview.analysis.scoremodels.PairwiseSeqScoreModel", "jalview.api.analysis.ScoreModelI"], "jalview.schemes.ScoreMatrix", ["jalview.schemes.ResidueProperties", "java.lang.StringBuffer"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.name = null;
+this.matrix = null;
+this.type = 0;
+Clazz_instantialize (this, arguments);
+}, jalview.schemes, "ScoreMatrix", jalview.analysis.scoremodels.PairwiseSeqScoreModel, jalview.api.analysis.ScoreModelI);
+Clazz_overrideMethod (c$, "getName", 
+function () {
+return this.name;
+});
+Clazz_makeConstructor (c$, 
+function (name, matrix, type) {
+Clazz_superConstructor (this, jalview.schemes.ScoreMatrix, []);
+this.matrix = matrix;
+this.type = type;
+this.name = name;
+}, "~S,~A,~N");
+Clazz_overrideMethod (c$, "isDNA", 
+function () {
+return this.type == 1;
+});
+Clazz_overrideMethod (c$, "isProtein", 
+function () {
+return this.type == 0;
+});
+Clazz_overrideMethod (c$, "getMatrix", 
+function () {
+return this.matrix;
+});
+Clazz_defineMethod (c$, "getPairwiseScore", 
+function (A1, A2) {
+return this.getPairwiseScore (A1.charAt (0), A2.charAt (0));
+}, "~S,~S");
+Clazz_defineMethod (c$, "getPairwiseScore", 
+function (c, d) {
+var pog = 0;
+try {
+var a = (this.type == 0) ? jalview.schemes.ResidueProperties.aaIndex[c.charCodeAt (0)] : jalview.schemes.ResidueProperties.nucleotideIndex[c.charCodeAt (0)];
+var b = (this.type == 0) ? jalview.schemes.ResidueProperties.aaIndex[d.charCodeAt (0)] : jalview.schemes.ResidueProperties.nucleotideIndex[d.charCodeAt (0)];
+pog = this.matrix[a][b];
+} catch (e) {
+if (Clazz_exceptionOf (e, Exception)) {
+} else {
+throw e;
+}
+}
+return pog;
+}, "~S,~S");
+Clazz_overrideMethod (c$, "toString", 
+function () {
+return this.outputMatrix (false);
+});
+Clazz_defineMethod (c$, "outputMatrix", 
+function (html) {
+var sb =  new StringBuffer ();
+var symbols = (this.type == 0) ? jalview.schemes.ResidueProperties.aaIndex : jalview.schemes.ResidueProperties.nucleotideIndex;
+var symMax = (this.type == 0) ? 23 : 10;
+var header = true;
+if (html) {
+sb.append ("<table border=\"1\">");
+}for (var sym = 'A'; sym <= 'Z'; sym = String.fromCharCode (sym.charCodeAt (0) + 1)) {
+if (symbols[sym.charCodeAt (0)] >= 0 && symbols[sym.charCodeAt (0)] < symMax) {
+if (header) {
+sb.append (html ? "<tr><td></td>" : "");
+for (var sym2 = 'A'; sym2 <= 'Z'; sym2 = String.fromCharCode (sym2.charCodeAt (0) + 1)) {
+if (symbols[sym2.charCodeAt (0)] >= 0 && symbols[sym2.charCodeAt (0)] < symMax) {
+sb.append ((html ? "<td>&nbsp;" : "\t") + sym2 + (html ? "&nbsp;</td>" : ""));
+}}
+header = false;
+sb.append (html ? "</tr>\n" : "\n");
+}if (html) {
+sb.append ("<tr>");
+}sb.append ((html ? "<td>" : "") + sym + (html ? "</td>" : ""));
+for (var sym2 = 'A'; sym2 <= 'Z'; sym2 = String.fromCharCode (sym2.charCodeAt (0) + 1)) {
+if (symbols[sym2.charCodeAt (0)] >= 0 && symbols[sym2.charCodeAt (0)] < symMax) {
+sb.append ((html ? "<td>" : "\t") + this.matrix[symbols[sym.charCodeAt (0)]][symbols[sym2.charCodeAt (0)]] + (html ? "</td>" : ""));
+}}
+sb.append (html ? "</tr>\n" : "\n");
+}}
+if (html) {
+sb.append ("</table>");
+}return sb.toString ();
+}, "~B");
+});
+Clazz_declarePackage ("jalview.analysis.scoremodels");
+Clazz_load (["jalview.api.analysis.ScoreModelI"], "jalview.analysis.scoremodels.PairwiseSeqScoreModel", ["jalview.util.Comparison"], function () {
+c$ = Clazz_declareType (jalview.analysis.scoremodels, "PairwiseSeqScoreModel", null, jalview.api.analysis.ScoreModelI);
+Clazz_overrideMethod (c$, "findDistances", 
+function (seqData) {
+var sequenceString = seqData.getSequenceStrings (jalview.util.Comparison.GapChars.charAt (0));
+var noseqs = sequenceString.length;
+var distance =  Clazz_newFloatArray (noseqs, noseqs, 0);
+var maxscore = 0;
+var end = sequenceString[0].length;
+for (var i = 0; i < (noseqs - 1); i++) {
+for (var j = i; j < noseqs; j++) {
+var score = 0;
+for (var k = 0; k < end; k++) {
+try {
+score += this.getPairwiseScore (sequenceString[i].charAt (k), sequenceString[j].charAt (k));
+} catch (ex) {
+if (Clazz_exceptionOf (ex, Exception)) {
+System.err.println ("err creating " + this.getName () + " tree");
+ex.printStackTrace ();
+} else {
+throw ex;
+}
+}
+}
+distance[i][j] = score;
+if (score > maxscore) {
+maxscore = score;
+}}
+}
+for (var i = 0; i < (noseqs - 1); i++) {
+for (var j = i; j < noseqs; j++) {
+distance[i][j] = maxscore - distance[i][j];
+distance[j][i] = distance[i][j];
+}
+}
+return distance;
+}, "jalview.datamodel.AlignmentView");
+});
+Clazz_declarePackage ("jalview.datamodel");
+Clazz_load (["jalview.datamodel.ASequence", "$.SequenceI", "jalview.jsdev.RegExp"], "jalview.datamodel.Sequence", ["jalview.analysis.AlignSeq", "jalview.datamodel.AlignmentAnnotation", "$.DBRefEntry", "$.DBRefSource", "$.PDBEntry", "$.SequenceFeature", "jalview.schemes.ResidueProperties", "jalview.util.Comparison", "$.StringUtils", "java.lang.StringBuffer", "java.util.ArrayList", "$.Vector"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.datasetSequence = null;
+this.name = null;
+this.sequence = null;
+this.description = null;
+this.start = 0;
+this.end = 0;
+this.pdbIds = null;
+this.vamsasId = null;
+this.dbrefs = null;
+this.rna = null;
+this.annotation = null;
+this.index = -1;
+this.sequenceFeatures = null;
+this.limitrx = null;
+this.endrx = null;
+Clazz_instantialize (this, arguments);
+}, jalview.datamodel, "Sequence", jalview.datamodel.ASequence, jalview.datamodel.SequenceI);
+Clazz_prepareFields (c$, function () {
+this.limitrx = jalview.jsdev.RegExp.newRegex (["[/][0-9]{1,}[-][0-9]{1,}$"]);
+this.endrx = jalview.jsdev.RegExp.newRegex (["[0-9]{1,}$"]);
+});
+Clazz_makeConstructor (c$, 
+function (name, sequence, start, end) {
+Clazz_superConstructor (this, jalview.datamodel.Sequence, []);
+this.initSeqAndName (name, sequence.toCharArray (), start, end);
+}, "~S,~S,~N,~N");
+Clazz_makeConstructor (c$, 
+function (name, sequence, start, end) {
+Clazz_superConstructor (this, jalview.datamodel.Sequence, []);
+this.initSeqAndName (name, sequence, start, end);
+}, "~S,~A,~N,~N");
+Clazz_defineMethod (c$, "initSeqAndName", 
+function (name2, sequence2, start2, end2) {
+this.name = name2;
+this.sequence = sequence2;
+this.start = start2;
+this.end = end2;
+this.parseId ();
+this.checkValidRange ();
+}, "~S,~A,~N,~N");
+Clazz_defineMethod (c$, "parseId", 
+function () {
+if (this.name == null) {
+System.err.println ("POSSIBLE IMPLEMENTATION ERROR: null sequence name passed to constructor.");
+this.name = "";
+}if (this.limitrx.search (this.name)) {
+this.name = this.limitrx.left ();
+this.endrx.search (this.limitrx.stringMatched ());
+this.setStart (Integer.parseInt (this.limitrx.stringMatched ().substring (1, this.endrx.matchedFrom () - 1)));
+this.setEnd (Integer.parseInt (this.endrx.stringMatched ()));
+}});
+Clazz_defineMethod (c$, "checkValidRange", 
+function () {
+{
+var endRes = 0;
+for (var j = 0; j < this.sequence.length; j++) {
+if (!jalview.util.Comparison.isGap (this.sequence[j])) {
+endRes++;
+}}
+if (endRes > 0) {
+endRes += this.start - 1;
+}if (this.end < endRes) {
+this.end = endRes;
+}}});
+Clazz_makeConstructor (c$, 
+function (name, sequence) {
+this.construct (name, sequence, 1, -1);
+}, "~S,~S");
+Clazz_makeConstructor (c$, 
+function (seq) {
+this.construct (seq, seq.getAnnotation ());
+}, "jalview.datamodel.SequenceI");
+Clazz_makeConstructor (c$, 
+function (seq, alAnnotation) {
+Clazz_superConstructor (this, jalview.datamodel.Sequence, []);
+this.initSeqFrom (seq, alAnnotation);
+}, "jalview.datamodel.SequenceI,~A");
+Clazz_defineMethod (c$, "initSeqFrom", 
+function (seq, alAnnotation) {
+this.initSeqAndName (seq.getName (), seq.getSequence (), seq.getStart (), seq.getEnd ());
+this.description = seq.getDescription ();
+if (seq.getSequenceFeatures () != null) {
+var sf = seq.getSequenceFeatures ();
+for (var i = 0; i < sf.length; i++) {
+this.addSequenceFeature ( new jalview.datamodel.SequenceFeature (sf[i]));
+}
+}this.setDatasetSequence (seq.getDatasetSequence ());
+if (this.datasetSequence == null && seq.getDBRef () != null) {
+var dbr = seq.getDBRef ();
+for (var i = 0; i < dbr.length; i++) {
+this.addDBRef ( new jalview.datamodel.DBRefEntry (dbr[i]));
+}
+}if (seq.getAnnotation () != null) {
+var sqann = seq.getAnnotation ();
+for (var i = 0; i < sqann.length; i++) {
+if (sqann[i] == null) {
+continue;
+}var found = (alAnnotation == null);
+if (!found) {
+for (var apos = 0; !found && apos < alAnnotation.length; apos++) {
+found = (alAnnotation[apos] === sqann[i]);
+}
+}if (found) {
+var newann =  new jalview.datamodel.AlignmentAnnotation (sqann[i]);
+this.addAlignmentAnnotation (newann);
+}}
+}if (seq.getPDBId () != null) {
+var ids = seq.getPDBId ();
+var e = ids.elements ();
+while (e.hasMoreElements ()) {
+this.addPDBId ( new jalview.datamodel.PDBEntry (e.nextElement ()));
+}
+}}, "jalview.datamodel.SequenceI,~A");
+Clazz_defineMethod (c$, "setSequenceFeatures", 
+function (features) {
+this.sequenceFeatures = features;
+}, "~A");
+Clazz_overrideMethod (c$, "addSequenceFeature", 
+function (sf) {
+if (this.sequenceFeatures == null) {
+this.sequenceFeatures =  new Array (0);
+}for (var i = 0; i < this.sequenceFeatures.length; i++) {
+if (this.sequenceFeatures[i].equals (sf)) {
+return;
+}}
+var temp =  new Array (this.sequenceFeatures.length + 1);
+System.arraycopy (this.sequenceFeatures, 0, temp, 0, this.sequenceFeatures.length);
+temp[this.sequenceFeatures.length] = sf;
+this.sequenceFeatures = temp;
+}, "jalview.datamodel.SequenceFeature");
+Clazz_overrideMethod (c$, "deleteFeature", 
+function (sf) {
+if (this.sequenceFeatures == null) {
+return;
+}var index = 0;
+for (index = 0; index < this.sequenceFeatures.length; index++) {
+if (this.sequenceFeatures[index].equals (sf)) {
+break;
+}}
+if (index == this.sequenceFeatures.length) {
+return;
+}var sfLength = this.sequenceFeatures.length;
+if (sfLength < 2) {
+this.sequenceFeatures = null;
+} else {
+var temp =  new Array (sfLength - 1);
+System.arraycopy (this.sequenceFeatures, 0, temp, 0, index);
+if (index < sfLength) {
+System.arraycopy (this.sequenceFeatures, index + 1, temp, index, this.sequenceFeatures.length - index - 1);
+}this.sequenceFeatures = temp;
+}}, "jalview.datamodel.SequenceFeature");
+Clazz_defineMethod (c$, "getSequenceFeatures", 
+function () {
+var features = this.sequenceFeatures;
+var seq = this;
+var count = 0;
+while (features == null && seq.getDatasetSequence () != null && count++ < 10) {
+seq = seq.getDatasetSequence ();
+features = (seq).sequenceFeatures;
+}
+return features;
+});
+Clazz_overrideMethod (c$, "addPDBId", 
+function (entry) {
+if (this.pdbIds == null) {
+this.pdbIds =  new java.util.Vector ();
+}if (this.pdbIds.contains (entry)) {
+jalview.datamodel.Sequence.updatePDBEntry (this.pdbIds.get (this.pdbIds.indexOf (entry)), entry);
+} else {
+this.pdbIds.addElement (entry);
+}}, "jalview.datamodel.PDBEntry");
+c$.updatePDBEntry = Clazz_defineMethod (c$, "updatePDBEntry", 
+ function (oldEntry, newEntry) {
+if (newEntry.getFile () != null) {
+oldEntry.setFile (newEntry.getFile ());
+}}, "jalview.datamodel.PDBEntry,jalview.datamodel.PDBEntry");
+Clazz_defineMethod (c$, "setPDBId", 
+function (id) {
+this.pdbIds = id;
+}, "java.util.Vector");
+Clazz_defineMethod (c$, "getPDBId", 
+function () {
+return this.pdbIds;
+});
+Clazz_overrideMethod (c$, "getDisplayId", 
+function (jvsuffix) {
+var result =  new StringBuffer (this.name);
+if (jvsuffix) {
+result.append ("/" + this.start + "-" + this.end);
+}return result.toString ();
+}, "~B");
+Clazz_overrideMethod (c$, "setName", 
+function (name) {
+this.name = name;
+this.parseId ();
+}, "~S");
+Clazz_defineMethod (c$, "getName", 
+function () {
+return this.name;
+});
+Clazz_overrideMethod (c$, "setStart", 
+function (start) {
+this.start = start;
+}, "~N");
+Clazz_defineMethod (c$, "getStart", 
+function () {
+return this.start;
+});
+Clazz_overrideMethod (c$, "setEnd", 
+function (end) {
+this.end = end;
+}, "~N");
+Clazz_defineMethod (c$, "getEnd", 
+function () {
+return this.end;
+});
+Clazz_overrideMethod (c$, "getLength", 
+function () {
+return this.sequence.length;
+});
+Clazz_defineMethod (c$, "setSequence", 
+function (seq) {
+this.sequence = seq.toCharArray ();
+this.checkValidRange ();
+}, "~S");
+Clazz_defineMethod (c$, "getSequenceAsString", 
+function () {
+return  String.instantialize (this.sequence);
+});
+Clazz_defineMethod (c$, "getSequenceAsString", 
+function (start, end) {
+return  String.instantialize (this.getSequence (start, end));
+}, "~N,~N");
+Clazz_defineMethod (c$, "getSequence", 
+function () {
+return this.sequence;
+});
+Clazz_defineMethod (c$, "getSequence", 
+function (start, end) {
+if (start < 0) {
+start = 0;
+}if (start >= this.sequence.length) {
+return  Clazz_newCharArray (0, '\0');
+}if (end >= this.sequence.length) {
+end = this.sequence.length;
+}var reply =  Clazz_newCharArray (end - start, '\0');
+System.arraycopy (this.sequence, start, reply, 0, end - start);
+return reply;
+}, "~N,~N");
+Clazz_overrideMethod (c$, "getSubSequence", 
+function (start, end) {
+if (start < 0) {
+start = 0;
+}var seq = this.getSequence (start, end);
+if (seq.length == 0) {
+return null;
+}var nstart = this.findPosition (start);
+var nend = this.findPosition (end) - 1;
+var nseq =  new jalview.datamodel.Sequence (this.getName (), seq, nstart, nend);
+nseq.setDescription (this.description);
+if (this.datasetSequence != null) {
+nseq.setDatasetSequence (this.datasetSequence);
+} else {
+nseq.setDatasetSequence (this);
+}return nseq;
+}, "~N,~N");
+Clazz_overrideMethod (c$, "getCharAt", 
+function (i) {
+if (i < this.sequence.length) {
+return this.sequence[i];
+} else {
+return ' ';
+}}, "~N");
+Clazz_defineMethod (c$, "setDescription", 
+function (desc) {
+this.description = desc;
+}, "~S");
+Clazz_defineMethod (c$, "getDescription", 
+function () {
+return this.description;
+});
+Clazz_overrideMethod (c$, "findIndex", 
+function (pos) {
+var j = this.start;
+var i = 0;
+while ((i < this.sequence.length) && (j <= this.end) && (j <= pos)) {
+if (!jalview.util.Comparison.isGap (this.sequence[i])) {
+j++;
+}i++;
+}
+if ((j == this.end) && (j < pos)) {
+return this.end + 1;
+} else {
+return i;
+}}, "~N");
+Clazz_overrideMethod (c$, "findPosition", 
+function (i) {
+var j = 0;
+var pos = this.start;
+var seqlen = this.sequence.length;
+while ((j < i) && (j < seqlen)) {
+if (!jalview.util.Comparison.isGap (this.sequence[j])) {
+pos++;
+}j++;
+}
+return pos;
+}, "~N");
+Clazz_overrideMethod (c$, "gapMap", 
+function () {
+var seq = jalview.analysis.AlignSeq.extractGaps (jalview.util.Comparison.GapChars,  String.instantialize (this.sequence));
+var map =  Clazz_newIntArray (seq.length, 0);
+var j = 0;
+var p = 0;
+while (j < this.sequence.length) {
+if (!jalview.util.Comparison.isGap (this.sequence[j])) {
+map[p++] = j;
+}j++;
+}
+return map;
+});
+Clazz_overrideMethod (c$, "findPositionMap", 
+function () {
+var map =  Clazz_newIntArray (this.sequence.length, 0);
+var j = 0;
+var pos = this.start;
+var seqlen = this.sequence.length;
+while ((j < seqlen)) {
+map[j] = pos;
+if (!jalview.util.Comparison.isGap (this.sequence[j])) {
+pos++;
+}j++;
+}
+return map;
+});
+Clazz_overrideMethod (c$, "getInsertions", 
+function () {
+var map =  new java.util.ArrayList ();
+var lastj = -1;
+var j = 0;
+var pos = this.start;
+var seqlen = this.sequence.length;
+while ((j < seqlen)) {
+if (jalview.util.Comparison.isGap (this.sequence[j])) {
+if (lastj == -1) {
+lastj = j;
+}} else {
+if (lastj != -1) {
+map.add ( Clazz_newIntArray (-1, [lastj, j - 1]));
+lastj = -1;
+}}j++;
+}
+if (lastj != -1) {
+map.add ( Clazz_newIntArray (-1, [lastj, j - 1]));
+lastj = -1;
+}return map;
+});
+Clazz_overrideMethod (c$, "deleteChars", 
+function (i, j) {
+var newstart = this.start;
+var newend = this.end;
+if (i >= this.sequence.length || i < 0) {
+return;
+}var tmp = jalview.util.StringUtils.deleteChars (this.sequence, i, j);
+var createNewDs = false;
+var eindex = -1;
+var sindex = -1;
+var ecalc = false;
+var scalc = false;
+for (var s = i; s < j; s++) {
+if (jalview.schemes.ResidueProperties.aaIndex[this.sequence[s].charCodeAt (0)] != 23) {
+if (createNewDs) {
+newend--;
+} else {
+if (!scalc) {
+sindex = this.findIndex (this.start) - 1;
+scalc = true;
+}if (sindex == s) {
+newstart = this.findPosition (j);
+break;
+} else {
+if (!ecalc) {
+eindex = this.findIndex (this.end) - 1;
+ecalc = true;
+}if (eindex < j) {
+newend = this.findPosition (i - 1);
+break;
+} else {
+createNewDs = true;
+newend--;
+}}}}}
+if (createNewDs && this.datasetSequence != null) {
+var ds =  new jalview.datamodel.Sequence (this.datasetSequence);
+ds.deleteChars (i, j);
+this.datasetSequence = ds;
+}this.start = newstart;
+this.end = newend;
+this.sequence = tmp;
+}, "~N,~N");
+Clazz_defineMethod (c$, "insertCharAt", 
+function (i, length, c) {
+var tmp =  Clazz_newCharArray (this.sequence.length + length, '\0');
+if (i >= this.sequence.length) {
+System.arraycopy (this.sequence, 0, tmp, 0, this.sequence.length);
+i = this.sequence.length;
+} else {
+System.arraycopy (this.sequence, 0, tmp, 0, i);
+}var index = i;
+while (length > 0) {
+tmp[index++] = c;
+length--;
+}
+if (i < this.sequence.length) {
+System.arraycopy (this.sequence, i, tmp, index, this.sequence.length - i);
+}this.sequence = tmp;
+}, "~N,~N,~S");
+Clazz_defineMethod (c$, "insertCharAt", 
+function (i, c) {
+this.insertCharAt (i, 1, c);
+}, "~N,~S");
+Clazz_overrideMethod (c$, "getVamsasId", 
+function () {
+return this.vamsasId;
+});
+Clazz_overrideMethod (c$, "setVamsasId", 
+function (id) {
+this.vamsasId = id;
+}, "~S");
+Clazz_defineMethod (c$, "setDBRef", 
+function (dbref) {
+this.dbrefs = dbref;
+}, "~A");
+Clazz_defineMethod (c$, "getDBRef", 
+function () {
+if (this.dbrefs == null && this.datasetSequence != null && this !== this.datasetSequence) {
+return this.datasetSequence.getDBRef ();
+}return this.dbrefs;
+});
+Clazz_overrideMethod (c$, "addDBRef", 
+function (entry) {
+if (this.dbrefs == null) {
+this.dbrefs =  new Array (0);
+}var i;
+var iSize = this.dbrefs.length;
+for (i = 0; i < iSize; i++) {
+if (this.dbrefs[i].equalRef (entry)) {
+if (entry.getMap () != null) {
+if (this.dbrefs[i].getMap () == null) {
+this.dbrefs[i] = entry;
+}}return;
+}}
+var temp =  new Array (iSize + 1);
+System.arraycopy (this.dbrefs, 0, temp, 0, iSize);
+temp[temp.length - 1] = entry;
+this.dbrefs = temp;
+}, "jalview.datamodel.DBRefEntry");
+Clazz_defineMethod (c$, "setDatasetSequence", 
+function (seq) {
+this.datasetSequence = seq;
+}, "jalview.datamodel.SequenceI");
+Clazz_defineMethod (c$, "getDatasetSequence", 
+function () {
+return this.datasetSequence;
+});
+Clazz_defineMethod (c$, "getAnnotation", 
+function () {
+return this.annotation == null ? null : this.annotation.toArray ( new Array (this.annotation.size ()));
+});
+Clazz_overrideMethod (c$, "hasAnnotation", 
+function (ann) {
+return this.annotation == null ? false : this.annotation.contains (ann);
+}, "jalview.datamodel.AlignmentAnnotation");
+Clazz_defineMethod (c$, "addAlignmentAnnotation", 
+function (annotation) {
+if (this.annotation == null) {
+this.annotation =  new java.util.Vector ();
+}if (!this.annotation.contains (annotation)) {
+this.annotation.addElement (annotation);
+}annotation.setSequenceRef (this);
+}, "jalview.datamodel.AlignmentAnnotation");
+Clazz_overrideMethod (c$, "removeAlignmentAnnotation", 
+function (annotation) {
+if (this.annotation != null) {
+this.annotation.removeElement (annotation);
+if (this.annotation.size () == 0) {
+this.annotation = null;
+}}}, "jalview.datamodel.AlignmentAnnotation");
+Clazz_defineMethod (c$, "isValidDatasetSequence", 
+ function () {
+if (this.datasetSequence != null) {
+return false;
+}for (var i = 0; i < this.sequence.length; i++) {
+if (jalview.util.Comparison.isGap (this.sequence[i])) {
+return false;
+}}
+return true;
+});
+Clazz_overrideMethod (c$, "deriveSequence", 
+function () {
+var seq =  new jalview.datamodel.Sequence (this);
+if (this.datasetSequence != null) {
+seq.setDatasetSequence (this.datasetSequence);
+} else {
+if (this.isValidDatasetSequence ()) {
+seq.setDatasetSequence (this);
+} else {
+var ds = seq;
+ds.setSequence (jalview.analysis.AlignSeq.extractGaps (jalview.util.Comparison.GapChars,  String.instantialize (this.sequence)));
+this.setDatasetSequence (ds);
+ds.setSequenceFeatures (this.getSequenceFeatures ());
+seq = this;
+}}return seq;
+});
+Clazz_overrideMethod (c$, "createDatasetSequence", 
+function () {
+if (this.datasetSequence == null) {
+this.datasetSequence =  new jalview.datamodel.Sequence (this.getName (), jalview.analysis.AlignSeq.extractGaps (jalview.util.Comparison.GapChars, this.getSequenceAsString ()), this.getStart (), this.getEnd ());
+this.datasetSequence.setSequenceFeatures (this.getSequenceFeatures ());
+this.datasetSequence.setDescription (this.getDescription ());
+this.setSequenceFeatures (null);
+this.datasetSequence.setDBRef (this.getDBRef ());
+this.setDBRef (null);
+this.datasetSequence.setPDBId (this.getPDBId ());
+this.setPDBId (null);
+this.datasetSequence.updatePDBIds ();
+if (this.annotation != null) {
+for (var aa, $aa = this.annotation.iterator (); $aa.hasNext () && ((aa = $aa.next ()) || true);) {
+var _aa =  new jalview.datamodel.AlignmentAnnotation (aa);
+_aa.sequenceRef = this.datasetSequence;
+_aa.adjustForAlignment ();
+this.datasetSequence.addAlignmentAnnotation (_aa);
+}
+}}return this.datasetSequence;
+});
+Clazz_overrideMethod (c$, "setAlignmentAnnotation", 
+function (annotations) {
+if (this.annotation != null) {
+this.annotation.removeAllElements ();
+}if (annotations != null) {
+for (var i = 0; i < annotations.length; i++) {
+if (annotations[i] != null) {
+this.addAlignmentAnnotation (annotations[i]);
+}}
+}}, "~A");
+Clazz_defineMethod (c$, "getAnnotation", 
+function (label) {
+if (this.annotation == null || this.annotation.size () == 0) {
+return null;
+}var subset =  new java.util.Vector ();
+var e = this.annotation.elements ();
+while (e.hasMoreElements ()) {
+var ann = e.nextElement ();
+if (ann.label != null && ann.label.equals (label)) {
+subset.addElement (ann);
+}}
+if (subset.size () == 0) {
+return null;
+}var anns =  new Array (subset.size ());
+var i = 0;
+e = subset.elements ();
+while (e.hasMoreElements ()) {
+anns[i++] = e.nextElement ();
+}
+subset.removeAllElements ();
+return anns;
+}, "~S");
+Clazz_defineMethod (c$, "updatePDBIds", 
+function () {
+if (this.datasetSequence != null) {
+return this.datasetSequence.updatePDBIds ();
+}if (this.dbrefs == null || this.dbrefs.length == 0) {
+return false;
+}var newpdb =  new java.util.Vector ();
+for (var i = 0; i < this.dbrefs.length; i++) {
+if (jalview.datamodel.DBRefSource.PDB.equals (this.dbrefs[i].getSource ())) {
+var pdbe =  new jalview.datamodel.PDBEntry ();
+pdbe.setId (this.dbrefs[i].getAccessionId ());
+if (this.pdbIds == null || this.pdbIds.size () == 0) {
+newpdb.addElement (pdbe);
+} else {
+var en = this.pdbIds.elements ();
+var matched = false;
+while (!matched && en.hasMoreElements ()) {
+var anentry = en.nextElement ();
+if (anentry.getId ().equals (pdbe.getId ())) {
+matched = true;
+}}
+if (!matched) {
+newpdb.addElement (pdbe);
+}}}}
+if (newpdb.size () > 0) {
+var en = newpdb.elements ();
+while (en.hasMoreElements ()) {
+this.addPDBId (en.nextElement ());
+}
+return true;
+}return false;
+});
+Clazz_defineMethod (c$, "transferAnnotation", 
+function (entry, mp) {
+if (this.datasetSequence != null) {
+this.datasetSequence.transferAnnotation (entry, mp);
+return;
+}if (entry.getDatasetSequence () != null) {
+this.transferAnnotation (entry.getDatasetSequence (), mp);
+return;
+}if (entry.getSequenceFeatures () != null) {
+var sfs = entry.getSequenceFeatures ();
+for (var si = 0; si < sfs.length; si++) {
+var sf = (mp != null) ? mp.locateFeature (sfs[si]) :  Clazz_newArray (-1, [ new jalview.datamodel.SequenceFeature (sfs[si])]);
+if (sf != null && sf.length > 0) {
+for (var sfi = 0; sfi < sf.length; sfi++) {
+this.addSequenceFeature (sf[sfi]);
+}
+}}
+}if (entry.getPDBId () != null) {
+var e = entry.getPDBId ().elements ();
+while (e.hasMoreElements ()) {
+var pdb = e.nextElement ();
+this.addPDBId (pdb);
+}
+}var entryRefs = entry.getDBRef ();
+if (entryRefs != null) {
+for (var r = 0; r < entryRefs.length; r++) {
+var newref =  new jalview.datamodel.DBRefEntry (entryRefs[r]);
+if (newref.getMap () != null && mp != null) {
+}this.addDBRef (newref);
+}
+}}, "jalview.datamodel.SequenceI,jalview.datamodel.Mapping");
+Clazz_overrideMethod (c$, "getIndex", 
+function () {
+return this.index;
+});
+Clazz_overrideMethod (c$, "setIndex", 
+function (value) {
+this.index = value;
+}, "~N");
+Clazz_overrideMethod (c$, "setRNA", 
+function (r) {
+this.rna = r;
+}, "jalview.jsdev.api.VarnaRNA");
+Clazz_overrideMethod (c$, "getRNA", 
+function () {
+return this.rna;
+});
+Clazz_overrideMethod (c$, "getAlignmentAnnotations", 
+function (calcId, label) {
+var result =  new java.util.ArrayList ();
+if (this.annotation != null) {
+for (var ann, $ann = this.annotation.iterator (); $ann.hasNext () && ((ann = $ann.next ()) || true);) {
+if (ann.calcId != null && ann.calcId.equals (calcId) && ann.label != null && ann.label.equals (label)) {
+result.add (ann);
+}}
+}return result;
+}, "~S,~S");
+});
+Clazz_declarePackage ("jalview.datamodel");
+Clazz_load (["jalview.datamodel.ASequenceI"], "jalview.datamodel.ASequence", null, function () {
+c$ = Clazz_declareType (jalview.datamodel, "ASequence", null, jalview.datamodel.ASequenceI);
+});
+Clazz_declarePackage ("jalview.jsdev");
+Clazz_load (null, "jalview.jsdev.RegExp", ["com.stevesoft.pat.Regex"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.rg = null;
+Clazz_instantialize (this, arguments);
+}, jalview.jsdev, "RegExp");
+c$.newRegex = Clazz_defineMethod (c$, "newRegex", 
+function (params) {
+return  new com.stevesoft.pat.Regex (params.length < 1 ? null : params[0], params.length < 2 ? "" : params[1]);
+}, "~A");
+c$.perlCode = Clazz_defineMethod (c$, "perlCode", 
+function (s) {
+return com.stevesoft.pat.Regex.perlCode (s);
+}, "~S");
+});
+Clazz_declarePackage ("com.stevesoft.pat");
+Clazz_load (["com.stevesoft.pat.RegRes", "$.UniValidator", "jalview.jsdev.api.RegExpInterface", "com.stevesoft.pat.NoPattern", "$.Pthings", "$.patInt", "java.util.Hashtable"], ["com.stevesoft.pat.UnicodeW", "$.UnicodeCurrency", "$.UnicodeAlpha", "$.UnicodeUpper", "$.NUnicodeCurrency", "$.NUnicodeW", "$.NUnicodeAlpha", "$.UnicodeMath", "$.UnicodeWhite", "$.UnicodeDigit", "$.NUnicodeMath", "$.Regex", "$.NUnicodeDigit", "$.NUnicodeWhite", "$.NUnicodePunct", "$.UnicodePunct", "$.UnicodeLower"], ["com.stevesoft.pat.Any", "$.BackG", "$.BackMatch", "$.Backup", "$.Boundary", "$.Bracket", "$.CaseMgr", "$.Ctrl", "$.Custom", "$.CustomEndpoint", "$.DotMulti", "$.End", "$.FastMulti", "$.Group", "$.MessageManager", "$.Multi", "$.NullPattern", "$.Or", "$.OrMark", "$.Prop", "$.Range", "$.RegOpt", "$.RegSyntax", "$.RegSyntaxError", "$.ReplaceRule", "$.Replacer", "$.Rthings", "$.Skip", "$.Skipped", "$.Start", "$.StrPos", "$.lookAhead", "$.oneChar", "$.parsePerl", "$.patInf", "com.stevesoft.pat.wrap.StringWrap", "java.lang.NullPointerException", "$.StringBuffer", "java.util.BitSet"], function () {
+c$ = Clazz_declareType (com.stevesoft.pat, "UnicodePunct", com.stevesoft.pat.UniValidator);
+Clazz_overrideMethod (c$, "validate", 
+function (s, from, to) {
+return from < s.length () && com.stevesoft.pat.Prop.isPunct (s.charAt (from)) ? to : -1;
+}, "com.stevesoft.pat.StringLike,~N,~N");
+c$ = Clazz_declareType (com.stevesoft.pat, "UnicodeWhite", com.stevesoft.pat.UniValidator);
+Clazz_overrideMethod (c$, "validate", 
+function (s, from, to) {
+return from < s.length () && com.stevesoft.pat.Prop.isWhite (s.charAt (from)) ? to : -1;
+}, "com.stevesoft.pat.StringLike,~N,~N");
+c$ = Clazz_declareType (com.stevesoft.pat, "NUnicodePunct", com.stevesoft.pat.UniValidator);
+Clazz_overrideMethod (c$, "validate", 
+function (s, from, to) {
+return from < s.length () && !com.stevesoft.pat.Prop.isPunct (s.charAt (from)) ? to : -1;
+}, "com.stevesoft.pat.StringLike,~N,~N");
+c$ = Clazz_declareType (com.stevesoft.pat, "NUnicodeWhite", com.stevesoft.pat.UniValidator);
+Clazz_overrideMethod (c$, "validate", 
+function (s, from, to) {
+return from < s.length () && !com.stevesoft.pat.Prop.isWhite (s.charAt (from)) ? to : -1;
+}, "com.stevesoft.pat.StringLike,~N,~N");
+c$ = Clazz_declareType (com.stevesoft.pat, "UnicodeW", com.stevesoft.pat.UniValidator);
+Clazz_overrideMethod (c$, "validate", 
+function (s, from, to) {
+if (from >= s.length ()) {
+return -1;
+}var c = s.charAt (from);
+return (com.stevesoft.pat.Prop.isAlphabetic (c) || com.stevesoft.pat.Prop.isDecimalDigit (c) || c == '_') ? to : -1;
+}, "com.stevesoft.pat.StringLike,~N,~N");
+c$ = Clazz_declareType (com.stevesoft.pat, "NUnicodeW", com.stevesoft.pat.UniValidator);
+Clazz_overrideMethod (c$, "validate", 
+function (s, from, to) {
+if (from >= s.length ()) {
+return -1;
+}var c = s.charAt (from);
+return !(com.stevesoft.pat.Prop.isAlphabetic (c) || com.stevesoft.pat.Prop.isDecimalDigit (c) || c == '_') ? to : -1;
+}, "com.stevesoft.pat.StringLike,~N,~N");
+c$ = Clazz_declareType (com.stevesoft.pat, "UnicodeDigit", com.stevesoft.pat.UniValidator);
+Clazz_overrideMethod (c$, "validate", 
+function (s, from, to) {
+return from < s.length () && com.stevesoft.pat.Prop.isDecimalDigit (s.charAt (from)) ? to : -1;
+}, "com.stevesoft.pat.StringLike,~N,~N");
+c$ = Clazz_declareType (com.stevesoft.pat, "NUnicodeDigit", com.stevesoft.pat.UniValidator);
+Clazz_overrideMethod (c$, "validate", 
+function (s, from, to) {
+return from < s.length () && !com.stevesoft.pat.Prop.isDecimalDigit (s.charAt (from)) ? to : -1;
+}, "com.stevesoft.pat.StringLike,~N,~N");
+c$ = Clazz_declareType (com.stevesoft.pat, "UnicodeMath", com.stevesoft.pat.UniValidator);
+Clazz_overrideMethod (c$, "validate", 
+function (s, from, to) {
+return from < s.length () && com.stevesoft.pat.Prop.isMath (s.charAt (from)) ? to : -1;
+}, "com.stevesoft.pat.StringLike,~N,~N");
+c$ = Clazz_declareType (com.stevesoft.pat, "NUnicodeMath", com.stevesoft.pat.UniValidator);
+Clazz_overrideMethod (c$, "validate", 
+function (s, from, to) {
+return from < s.length () && !com.stevesoft.pat.Prop.isMath (s.charAt (from)) ? to : -1;
+}, "com.stevesoft.pat.StringLike,~N,~N");
+c$ = Clazz_declareType (com.stevesoft.pat, "UnicodeCurrency", com.stevesoft.pat.UniValidator);
+Clazz_overrideMethod (c$, "validate", 
+function (s, from, to) {
+return from < s.length () && com.stevesoft.pat.Prop.isCurrency (s.charAt (from)) ? to : -1;
+}, "com.stevesoft.pat.StringLike,~N,~N");
+c$ = Clazz_declareType (com.stevesoft.pat, "NUnicodeCurrency", com.stevesoft.pat.UniValidator);
+Clazz_overrideMethod (c$, "validate", 
+function (s, from, to) {
+return from < s.length () && !com.stevesoft.pat.Prop.isCurrency (s.charAt (from)) ? to : -1;
+}, "com.stevesoft.pat.StringLike,~N,~N");
+c$ = Clazz_declareType (com.stevesoft.pat, "UnicodeAlpha", com.stevesoft.pat.UniValidator);
+Clazz_overrideMethod (c$, "validate", 
+function (s, from, to) {
+return from < s.length () && com.stevesoft.pat.Prop.isAlphabetic (s.charAt (from)) ? to : -1;
+}, "com.stevesoft.pat.StringLike,~N,~N");
+c$ = Clazz_declareType (com.stevesoft.pat, "NUnicodeAlpha", com.stevesoft.pat.UniValidator);
+Clazz_overrideMethod (c$, "validate", 
+function (s, from, to) {
+return from < s.length () && !com.stevesoft.pat.Prop.isAlphabetic (s.charAt (from)) ? to : -1;
+}, "com.stevesoft.pat.StringLike,~N,~N");
+c$ = Clazz_declareType (com.stevesoft.pat, "UnicodeUpper", com.stevesoft.pat.UniValidator);
+Clazz_overrideMethod (c$, "validate", 
+function (s, from, to) {
+return from < s.length () && this.isUpper (s.charAt (from)) ? to : -1;
+}, "com.stevesoft.pat.StringLike,~N,~N");
+Clazz_defineMethod (c$, "isUpper", 
+function (c) {
+return c == com.stevesoft.pat.CaseMgr.toUpperCaseC (c) && c != com.stevesoft.pat.CaseMgr.toLowerCaseC (c);
+}, "~S");
+c$ = Clazz_declareType (com.stevesoft.pat, "UnicodeLower", com.stevesoft.pat.UniValidator);
+Clazz_overrideMethod (c$, "validate", 
+function (s, from, to) {
+return from < s.length () && this.isLower (s.charAt (from)) ? to : -1;
+}, "com.stevesoft.pat.StringLike,~N,~N");
+Clazz_defineMethod (c$, "isLower", 
+function (c) {
+return c != com.stevesoft.pat.CaseMgr.toUpperCaseC (c) && c == com.stevesoft.pat.CaseMgr.toLowerCaseC (c);
+}, "~S");
+c$ = Clazz_decorateAsClass (function () {
+this.thePattern = null;
+this.minMatch = null;
+this.rep = null;
+this.dontMatchInQuotes = false;
+this.ignoreCase = false;
+this.repr = null;
+this.esc = '\\';
+this.pt = null;
+this.gFlags = null;
+this.gFlagto = 0;
+this.gFlag = false;
+this.sFlag = false;
+this.mFlag = false;
+this.p = null;
+this.or = null;
+this.skipper = null;
+Clazz_instantialize (this, arguments);
+}, com.stevesoft.pat, "Regex", com.stevesoft.pat.RegRes, [jalview.jsdev.api.RegExpInterface, Cloneable]);
+Clazz_prepareFields (c$, function () {
+this.thePattern = com.stevesoft.pat.Regex.none;
+this.minMatch =  new com.stevesoft.pat.patInt (0);
+this.pt =  new com.stevesoft.pat.Pthings ();
+});
+Clazz_makeConstructor (c$, 
+function (s, strRp) {
+Clazz_superConstructor (this, com.stevesoft.pat.Regex, []);
+try {
+if (s != null) this.compile (s);
+if (strRp.length > 0) this.rep = com.stevesoft.pat.ReplaceRule.perlCode (strRp);
+} catch (rs) {
+if (Clazz_exceptionOf (rs, com.stevesoft.pat.RegSyntax)) {
+} else {
+throw rs;
+}
+}
+}, "~S,~S");
+Clazz_overrideMethod (c$, "clone", 
+function () {
+return  new com.stevesoft.pat.Regex (null, "").cloneFrom (this);
+});
+Clazz_defineMethod (c$, "cloneFrom", 
+function (r) {
+this.copyOutOf (r);
+this.dontMatchInQuotes = r.dontMatchInQuotes;
+this.esc = r.esc;
+this.ignoreCase = r.ignoreCase;
+this.gFlag = r.gFlag;
+if (r.rep == null) {
+this.rep = null;
+} else {
+this.rep = r.rep.clone ();
+}this.thePattern = r.thePattern.clone ( new java.util.Hashtable ());
+this.minMatch = r.minMatch;
+this.skipper = r.skipper;
+return this;
+}, "com.stevesoft.pat.Regex");
+Clazz_defineMethod (c$, "setDontMatchInQuotes", 
+function (b) {
+this.dontMatchInQuotes = b;
+}, "~B");
+Clazz_defineMethod (c$, "getDontMatchInQuotes", 
+function () {
+return this.dontMatchInQuotes;
+});
+Clazz_overrideMethod (c$, "setIgnoreCase", 
+function (b) {
+this.ignoreCase = b;
+}, "~B");
+Clazz_defineMethod (c$, "getIgnoreCase", 
+function () {
+return this.ignoreCase;
+});
+c$.setDefaultMFlag = Clazz_defineMethod (c$, "setDefaultMFlag", 
+function (mFlag) {
+com.stevesoft.pat.Regex.defaultMFlag = mFlag;
+}, "~B");
+c$.getDefaultMFlag = Clazz_defineMethod (c$, "getDefaultMFlag", 
+function () {
+return com.stevesoft.pat.Regex.defaultMFlag;
+});
+Clazz_defineMethod (c$, "setReplaceRuleStr", 
+function (rp) {
+this.rep = com.stevesoft.pat.ReplaceRule.perlCode (rp);
+this.repr = null;
+}, "~S");
+Clazz_defineMethod (c$, "setReplaceRule", 
+function (rp) {
+this.rep = rp;
+}, "com.stevesoft.pat.ReplaceRule");
+c$.isDefined = Clazz_defineMethod (c$, "isDefined", 
+function (nm) {
+return com.stevesoft.pat.Regex.validators.get (nm) != null;
+}, "~S");
+c$.undefine = Clazz_defineMethod (c$, "undefine", 
+function (nm) {
+com.stevesoft.pat.Regex.validators.remove (nm);
+}, "~S");
+c$.defineV = Clazz_defineMethod (c$, "defineV", 
+function (nm, pat, v) {
+v.pattern = pat;
+com.stevesoft.pat.Regex.validators.put (nm, v);
+}, "~S,~S,com.stevesoft.pat.Validator");
+c$.define = Clazz_defineMethod (c$, "define", 
+function (nm, pat) {
+com.stevesoft.pat.Regex.validators.put (nm, pat);
+}, "~S,~S");
+Clazz_defineMethod (c$, "getReplaceRule", 
+function () {
+return this.rep;
+});
+Clazz_defineMethod (c$, "_getReplacer", 
+function () {
+return this.repr == null ? this.repr =  new com.stevesoft.pat.Replacer () : this.repr;
+});
+Clazz_defineMethod (c$, "getReplacer", 
+function () {
+if (this.repr == null) {
+this.repr =  new com.stevesoft.pat.Replacer ();
+}this.repr.rh.me = this;
+this.repr.rh.prev = null;
+return this.repr;
+});
+Clazz_defineMethod (c$, "replaceFirst", 
+function (s) {
+return this._getReplacer ().replaceFirstRegion (s, this, 0, s.length).toString ();
+}, "~S");
+Clazz_defineMethod (c$, "replaceFirstFrom", 
+function (s, pos) {
+return this._getReplacer ().replaceFirstRegion (s, this, pos, s.length).toString ();
+}, "~S,~N");
+Clazz_defineMethod (c$, "replaceFirstRegion", 
+function (s, start, end) {
+return this._getReplacer ().replaceFirstRegion (s, this, start, end).toString ();
+}, "~S,~N,~N");
+Clazz_overrideMethod (c$, "replaceAll", 
+function (s) {
+return this._getReplacer ().replaceAllRegion (s, this, 0, s.length).toString ();
+}, "~S");
+Clazz_defineMethod (c$, "replaceAllLike", 
+function (s) {
+return this._getReplacer ().replaceAllRegion (s, this, 0, s.length ());
+}, "com.stevesoft.pat.StringLike");
+Clazz_defineMethod (c$, "replaceAllFrom", 
+function (s, pos) {
+return this._getReplacer ().replaceAllRegion (s, this, pos, s.length).toString ();
+}, "~S,~N");
+Clazz_defineMethod (c$, "replaceAllRegion", 
+function (s, start, end) {
+return this._getReplacer ().replaceAllRegion (s, this, start, end).toString ();
+}, "~S,~N,~N");
+Clazz_defineMethod (c$, "compile", 
+function (prepat) {
+var postpat = com.stevesoft.pat.parsePerl.codify (prepat, true);
+var pat = postpat == null ? prepat : postpat;
+this.minMatch = null;
+this.ignoreCase = false;
+this.dontMatchInQuotes = false;
+var mk =  new com.stevesoft.pat.Rthings (this);
+var offset = mk.val;
+var newpat = pat;
+this.thePattern = com.stevesoft.pat.Regex.none;
+this.p = null;
+this.or = null;
+this.minMatch =  new com.stevesoft.pat.patInt (0);
+var sp =  new com.stevesoft.pat.StrPos (pat, 0);
+if (sp.incMatch ("(?e=")) {
+var newEsc = sp.c;
+sp.inc ();
+if (sp.match (')')) {
+newpat = com.stevesoft.pat.Regex.reEscape (pat.substring (6), newEsc, '\\');
+}} else if (this.esc != '\\') {
+newpat = com.stevesoft.pat.Regex.reEscape (pat, this.esc, '\\');
+}this.thePattern = this._compile (newpat, mk);
+this.numSubs_ = mk.val - offset;
+mk.set (this);
+}, "~S");
+Clazz_defineMethod (c$, "equals", 
+function (o) {
+if (Clazz_instanceOf (o, com.stevesoft.pat.Regex)) {
+if (this.toString ().equals (o.toString ())) {
+return Clazz_superCall (this, com.stevesoft.pat.Regex, "equals", [o]);
+} else {
+return false;
+}} else {
+return Clazz_superCall (this, com.stevesoft.pat.Regex, "equals", [o]);
+}}, "~O");
+Clazz_defineMethod (c$, "prep", 
+function (s) {
+this.pt.lastPos = this.matchedTo ();
+if (this.pt.lastPos < 0) {
+this.pt.lastPos = 0;
+}if ((s == null ? null : s.unwrap ()) !== (this.src == null ? null : s.unwrap ())) {
+this.pt.lastPos = 0;
+}this.src = s;
+this.pt.dotDoesntMatchCR = com.stevesoft.pat.Regex.dotDoesntMatchCR && (!this.sFlag);
+this.pt.mFlag = ( new Boolean (this.mFlag | com.stevesoft.pat.Regex.defaultMFlag).valueOf ());
+this.pt.ignoreCase = this.ignoreCase;
+this.pt.no_check = false;
+if (this.pt.marks != null) {
+for (var i = 0; i < this.pt.marks.length; i++) {
+this.pt.marks[i] = -1;
+}
+}this.pt.marks = null;
+this.pt.nMarks = this.numSubs_;
+this.pt.src = s;
+if (this.dontMatchInQuotes) {
+com.stevesoft.pat.Regex.setCbits (s, this.pt);
+} else {
+this.pt.cbits = null;
+}return this.pt;
+}, "com.stevesoft.pat.StringLike");
+Clazz_defineMethod (c$, "matchAt", 
+function (s, start_pos) {
+return this._search (s, start_pos, start_pos);
+}, "~S,~N");
+Clazz_defineMethod (c$, "matchAtLike", 
+function (s, start_pos) {
+return this._searchLike (s, start_pos, start_pos);
+}, "com.stevesoft.pat.StringLike,~N");
+Clazz_overrideMethod (c$, "search", 
+function (s) {
+if (s == null) {
+throw  new NullPointerException (com.stevesoft.pat.MessageManager.getString ("exception.null_string_given_to_regex_search"));
+}return this._search (s, 0, s.length);
+}, "~S");
+Clazz_defineMethod (c$, "searchLike", 
+function (sl) {
+if (sl == null) {
+throw  new NullPointerException (com.stevesoft.pat.MessageManager.getString ("exception.null_string_like_given_to_regex_search"));
+}return this._searchLike (sl, 0, sl.length ());
+}, "com.stevesoft.pat.StringLike");
+Clazz_defineMethod (c$, "reverseSearch", 
+function (s) {
+if (s == null) {
+throw  new NullPointerException (com.stevesoft.pat.MessageManager.getString ("exception.null_string_given_to_regex_reverse_search"));
+}return this._reverseSearch (s, 0, s.length);
+}, "~S");
+Clazz_defineMethod (c$, "reverseSearchLike", 
+function (sl) {
+if (sl == null) {
+throw  new NullPointerException (com.stevesoft.pat.MessageManager.getString ("exception.null_string_like_given_to_regex_reverse_search"));
+}return this._reverseSearchLike (sl, 0, sl.length ());
+}, "com.stevesoft.pat.StringLike");
+Clazz_overrideMethod (c$, "searchFrom", 
+function (s, start) {
+if (s == null) {
+throw  new NullPointerException (com.stevesoft.pat.MessageManager.getString ("exception.null_string_like_given_to_regex_search_from"));
+}return this._search (s, start, s.length);
+}, "~S,~N");
+Clazz_defineMethod (c$, "searchFromLike", 
+function (s, start) {
+if (s == null) {
+throw  new NullPointerException (com.stevesoft.pat.MessageManager.getString ("exception.null_string_like_given_to_regex_search_from"));
+}return this._searchLike (s, start, s.length ());
+}, "com.stevesoft.pat.StringLike,~N");
+Clazz_defineMethod (c$, "searchRegion", 
+function (s, start, end) {
+if (s == null) {
+throw  new NullPointerException (com.stevesoft.pat.MessageManager.getString ("exception.null_string_like_given_to_regex_search_region"));
+}return this._search (s, start, end);
+}, "~S,~N,~N");
+Clazz_defineMethod (c$, "setGFlag", 
+function (b) {
+this.gFlag = b;
+}, "~B");
+Clazz_defineMethod (c$, "getGFlag", 
+function () {
+return this.gFlag;
+});
+Clazz_defineMethod (c$, "getSFlag", 
+function () {
+return this.sFlag;
+});
+Clazz_defineMethod (c$, "getMFlag", 
+function () {
+return this.mFlag;
+});
+Clazz_defineMethod (c$, "_search", 
+function (s, start, end) {
+return this._searchLike ( new com.stevesoft.pat.wrap.StringWrap (s), start, end);
+}, "~S,~N,~N");
+Clazz_defineMethod (c$, "_searchLike", 
+function (s, start, end) {
+if (this.gFlag && this.gFlagto > 0 && this.gFlags != null && s.unwrap () === this.gFlags.unwrap ()) {
+start = this.gFlagto;
+}this.gFlags = null;
+var pt = this.prep (s);
+var up = (this.minMatch == null ? end : end - this.minMatch.i);
+if (up < start && end >= start) {
+up = start;
+}if (this.skipper == null) {
+for (var i = start; i <= up; i++) {
+this.charsMatched_ = this.thePattern.matchAt (s, i, pt);
+if (this.charsMatched_ >= 0) {
+this.matchFrom_ = this.thePattern.mfrom;
+this.marks = pt.marks;
+this.gFlagto = this.matchFrom_ + this.charsMatched_;
+this.gFlags = s;
+return this.didMatch_ = true;
+}}
+} else {
+pt.no_check = true;
+for (var i = start; i <= up; i++) {
+i = this.skipper.find (this.src, i, up);
+if (i < 0) {
+this.charsMatched_ = this.matchFrom_ = -1;
+return this.didMatch_ = false;
+}this.charsMatched_ = this.thePattern.matchAt (s, i, pt);
+if (this.charsMatched_ >= 0) {
+this.matchFrom_ = this.thePattern.mfrom;
+this.marks = pt.marks;
+this.gFlagto = this.matchFrom_ + this.charsMatched_;
+this.gFlags = s;
+return this.didMatch_ = true;
+}}
+}return this.didMatch_ = false;
+}, "com.stevesoft.pat.StringLike,~N,~N");
+Clazz_defineMethod (c$, "_reverseSearch", 
+function (s, start, end) {
+return this._reverseSearchLike ( new com.stevesoft.pat.wrap.StringWrap (s), start, end);
+}, "~S,~N,~N");
+Clazz_defineMethod (c$, "_reverseSearchLike", 
+function (s, start, end) {
+if (this.gFlag && this.gFlagto > 0 && s.unwrap () === this.gFlags.unwrap ()) {
+end = this.gFlagto;
+}this.gFlags = null;
+var pt = this.prep (s);
+for (var i = end; i >= start; i--) {
+this.charsMatched_ = this.thePattern.matchAt (s, i, pt);
+if (this.charsMatched_ >= 0) {
+this.matchFrom_ = this.thePattern.mfrom;
+this.marks = pt.marks;
+this.gFlagto = this.matchFrom_ - 1;
+this.gFlags = s;
+return this.didMatch_ = true;
+}}
+return this.didMatch_ = false;
+}, "com.stevesoft.pat.StringLike,~N,~N");
+c$.setCbits = Clazz_defineMethod (c$, "setCbits", 
+function (s, pt) {
+if (s === com.stevesoft.pat.Regex.lasts) {
+pt.cbits = com.stevesoft.pat.Regex.lastbs;
+return;
+}var bs =  new java.util.BitSet (s.length ());
+var qc = ' ';
+var setBit = false;
+for (var i = 0; i < s.length (); i++) {
+if (setBit) {
+bs.set (i);
+}var c = s.charAt (i);
+if (!setBit && c == '"') {
+qc = c;
+setBit = true;
+bs.set (i);
+} else if (!setBit && c == '\'') {
+qc = c;
+setBit = true;
+bs.set (i);
+} else if (setBit && c == qc) {
+setBit = false;
+} else if (setBit && c == '\\' && i + 1 < s.length ()) {
+i++;
+if (setBit) {
+bs.set (i);
+}}}
+pt.cbits = com.stevesoft.pat.Regex.lastbs = bs;
+com.stevesoft.pat.Regex.lasts = s;
+}, "com.stevesoft.pat.StringLike,com.stevesoft.pat.Pthings");
+Clazz_defineMethod (c$, "add", 
+function (p2) {
+if (this.p == null) {
+this.p = p2;
+} else {
+this.p.add (p2);
+p2 = this.p;
+}}, "com.stevesoft.pat.Pattern");
+Clazz_defineMethod (c$, "compileSP", 
+function (sp, mk) {
+if (sp.match ('[')) {
+sp.inc ();
+this.add (this.matchBracket (sp));
+} else if (sp.match ('|')) {
+if (this.or == null) {
+this.or =  new com.stevesoft.pat.Or ();
+}if (this.p == null) {
+this.p =  new com.stevesoft.pat.NullPattern ();
+}this.or.addOr (this.p);
+this.p = null;
+} else if (sp.incMatch ("(?<")) {
+var i = sp.getPatInt ();
+if (i == null) {
+com.stevesoft.pat.RegSyntaxError.endItAll ("No int after (?<");
+}this.add ( new com.stevesoft.pat.Backup (i.intValue ()));
+if (!sp.match (')')) {
+com.stevesoft.pat.RegSyntaxError.endItAll ("No ) after (?<");
+}} else if (sp.incMatch ("(?>")) {
+var i = sp.getPatInt ();
+if (i == null) {
+com.stevesoft.pat.RegSyntaxError.endItAll ("No int after (?>");
+}this.add ( new com.stevesoft.pat.Backup (-i.intValue ()));
+if (!sp.match (')')) {
+com.stevesoft.pat.RegSyntaxError.endItAll ("No ) after (?<");
+}} else if (sp.incMatch ("(?@")) {
+var op = sp.c;
+sp.inc ();
+var cl = sp.c;
+sp.inc ();
+if (!sp.match (')')) {
+com.stevesoft.pat.RegSyntaxError.endItAll ("(?@ does not have closing paren");
+}this.add ( new com.stevesoft.pat.Group (op, cl));
+} else if (sp.incMatch ("(?#")) {
+while (!sp.match (')')) {
+sp.inc ();
+}
+} else if (sp.dontMatch && sp.c == 'w') {
+var b =  new com.stevesoft.pat.Bracket (false);
+b.addOr ( new com.stevesoft.pat.Range ('a', 'z'));
+b.addOr ( new com.stevesoft.pat.Range ('A', 'Z'));
+b.addOr ( new com.stevesoft.pat.Range ('0', '9'));
+b.addOr ( new com.stevesoft.pat.oneChar ('_'));
+this.add (b);
+} else if (sp.dontMatch && sp.c == 'G') {
+this.add ( new com.stevesoft.pat.BackG ());
+} else if (sp.dontMatch && sp.c == 's') {
+var b =  new com.stevesoft.pat.Bracket (false);
+b.addOr ( new com.stevesoft.pat.oneChar (String.fromCharCode (32)));
+b.addOr ( new com.stevesoft.pat.Range (String.fromCharCode (8), String.fromCharCode (10)));
+b.addOr ( new com.stevesoft.pat.oneChar (String.fromCharCode (13)));
+this.add (b);
+} else if (sp.dontMatch && sp.c == 'd') {
+var digit =  new com.stevesoft.pat.Range ('0', '9');
+digit.printBrackets = true;
+this.add (digit);
+} else if (sp.dontMatch && sp.c == 'W') {
+var b =  new com.stevesoft.pat.Bracket (true);
+b.addOr ( new com.stevesoft.pat.Range ('a', 'z'));
+b.addOr ( new com.stevesoft.pat.Range ('A', 'Z'));
+b.addOr ( new com.stevesoft.pat.Range ('0', '9'));
+b.addOr ( new com.stevesoft.pat.oneChar ('_'));
+this.add (b);
+} else if (sp.dontMatch && sp.c == 'S') {
+var b =  new com.stevesoft.pat.Bracket (true);
+b.addOr ( new com.stevesoft.pat.oneChar (String.fromCharCode (32)));
+b.addOr ( new com.stevesoft.pat.Range (String.fromCharCode (8), String.fromCharCode (10)));
+b.addOr ( new com.stevesoft.pat.oneChar (String.fromCharCode (13)));
+this.add (b);
+} else if (sp.dontMatch && sp.c == 'D') {
+var b =  new com.stevesoft.pat.Bracket (true);
+b.addOr ( new com.stevesoft.pat.Range ('0', '9'));
+this.add (b);
+} else if (sp.dontMatch && sp.c == 'B') {
+var r =  new com.stevesoft.pat.Regex (null, "");
+r._compile ("(?!\\b)", mk);
+this.add (r.thePattern);
+} else if (this.isOctalString (sp)) {
+var d = sp.c.charCodeAt (0) - 48;
+sp.inc ();
+d = 8 * d + sp.c.charCodeAt (0) - 48;
+var sp2 =  new com.stevesoft.pat.StrPos (sp);
+sp2.inc ();
+if (this.isOctalDigit (sp2, false)) {
+sp.inc ();
+d = 8 * d + sp.c.charCodeAt (0) - 48;
+}this.add ( new com.stevesoft.pat.oneChar (String.fromCharCode (d)));
+} else if (sp.dontMatch && sp.c >= '1' && sp.c <= '9') {
+var iv = sp.c.charCodeAt (0) - 48;
+var s2 =  new com.stevesoft.pat.StrPos (sp);
+s2.inc ();
+if (!s2.dontMatch && s2.c >= '0' && s2.c <= '9') {
+iv = 10 * iv + (s2.c.charCodeAt (0) - 48);
+sp.inc ();
+}this.add ( new com.stevesoft.pat.BackMatch (iv));
+} else if (sp.dontMatch && sp.c == 'b') {
+this.add ( new com.stevesoft.pat.Boundary ());
+} else if (sp.match ('\b')) {
+this.add ( new com.stevesoft.pat.Boundary ());
+} else if (sp.match ('$')) {
+this.add ( new com.stevesoft.pat.End (true));
+} else if (sp.dontMatch && sp.c == 'Z') {
+this.add ( new com.stevesoft.pat.End (false));
+} else if (sp.match ('.')) {
+this.add ( new com.stevesoft.pat.Any ());
+} else if (sp.incMatch ("(??")) {
+var sb =  new StringBuffer ();
+var sb2 =  new StringBuffer ();
+while (!sp.match (')') && !sp.match (':')) {
+sb.append (sp.c);
+sp.inc ();
+}
+if (sp.incMatch (":")) {
+while (!sp.match (')')) {
+sb2.append (sp.c);
+sp.inc ();
+}
+}var sbs = sb.toString ();
+if (Clazz_instanceOf (com.stevesoft.pat.Regex.validators.get (sbs), String)) {
+var pat = com.stevesoft.pat.Regex.validators.get (sbs);
+var r =  new com.stevesoft.pat.Regex (null, "");
+var rth =  new com.stevesoft.pat.Rthings (this);
+rth.noBackRefs = true;
+r._compile (pat, rth);
+this.add (r.thePattern);
+} else {
+var cm =  new com.stevesoft.pat.Custom (sb.toString ());
+if (cm.v != null) {
+var v2 = cm.v.arg (sb2.toString ());
+if (v2 != null) {
+v2.argsave = sb2.toString ();
+var p = cm.v.pattern;
+cm.v = v2;
+v2.pattern = p;
+}var r =  new com.stevesoft.pat.Regex (null, "");
+var rth =  new com.stevesoft.pat.Rthings (this);
+rth.noBackRefs = true;
+r._compile (cm.v.pattern, rth);
+cm.sub = r.thePattern;
+cm.sub.add ( new com.stevesoft.pat.CustomEndpoint (cm));
+cm.sub.setParent (cm);
+this.add (cm);
+}}} else if (sp.match ('(')) {
+mk.parenLevel++;
+var r =  new com.stevesoft.pat.Regex (null, "");
+sp.inc ();
+if (sp.incMatch ("?:")) {
+r.or =  new com.stevesoft.pat.Or ();
+} else if (sp.incMatch ("?=")) {
+r.or =  new com.stevesoft.pat.lookAhead (false);
+} else if (sp.incMatch ("?!")) {
+r.or =  new com.stevesoft.pat.lookAhead (true);
+} else if (sp.match ('?')) {
+sp.inc ();
+do {
+if (sp.c == 'i') {
+mk.ignoreCase = true;
+}if (sp.c == 'Q') {
+mk.dontMatchInQuotes = true;
+}if (sp.c == 'o') {
+mk.optimizeMe = true;
+}if (sp.c == 'g') {
+mk.gFlag = true;
+}if (sp.c == 's') {
+mk.sFlag = true;
+}if (sp.c == 'm') {
+mk.mFlag = true;
+}sp.inc ();
+} while (!sp.match (')') && !sp.$eos);
+r = null;
+mk.parenLevel--;
+if (sp.$eos) {
+com.stevesoft.pat.RegSyntaxError.endItAll ("Unclosed ()");
+}} else {
+r.or = mk.noBackRefs ?  new com.stevesoft.pat.Or () :  new com.stevesoft.pat.OrMark (mk.val++);
+}if (r != null) {
+this.add (r._compileSP (sp, mk));
+}} else if (sp.match ('^')) {
+this.add ( new com.stevesoft.pat.Start (true));
+} else if (sp.dontMatch && sp.c == 'A') {
+this.add ( new com.stevesoft.pat.Start (false));
+} else if (sp.match ('*')) {
+this.addMulti ( new com.stevesoft.pat.patInt (0),  new com.stevesoft.pat.patInf ());
+} else if (sp.match ('+')) {
+this.addMulti ( new com.stevesoft.pat.patInt (1),  new com.stevesoft.pat.patInf ());
+} else if (sp.match ('?')) {
+this.addMulti ( new com.stevesoft.pat.patInt (0),  new com.stevesoft.pat.patInt (1));
+} else if (sp.match ('{')) {
+var bad = false;
+var sp2 =  new com.stevesoft.pat.StrPos (sp);
+sp.inc ();
+var i1 = sp.getPatInt ();
+var i2 = null;
+if (sp.match ('}')) {
+i2 = i1;
+} else {
+if (!sp.match (',')) {
+bad = true;
+}sp.inc ();
+if (sp.match ('}')) {
+i2 =  new com.stevesoft.pat.patInf ();
+} else {
+i2 = sp.getPatInt ();
+}}if (i1 == null || i2 == null) {
+bad = true;
+}if (bad) {
+sp.dup (sp2);
+this.add ( new com.stevesoft.pat.oneChar (sp.c));
+} else {
+this.addMulti (i1, i2);
+}} else if (sp.escMatch ('x') && this.next2Hex (sp)) {
+sp.inc ();
+var d = this.getHexDigit (sp);
+sp.inc ();
+d = 16 * d + this.getHexDigit (sp);
+this.add ( new com.stevesoft.pat.oneChar (String.fromCharCode (d)));
+} else if (sp.escMatch ('c')) {
+sp.inc ();
+if (sp.c.charCodeAt (0) < com.stevesoft.pat.Ctrl.cmap.length) {
+this.add ( new com.stevesoft.pat.oneChar (com.stevesoft.pat.Ctrl.cmap[sp.c.charCodeAt (0)]));
+} else {
+this.add ( new com.stevesoft.pat.oneChar (sp.c));
+}} else if (sp.escMatch ('f')) {
+this.add ( new com.stevesoft.pat.oneChar (String.fromCharCode (12)));
+} else if (sp.escMatch ('a')) {
+this.add ( new com.stevesoft.pat.oneChar (String.fromCharCode (7)));
+} else if (sp.escMatch ('t')) {
+this.add ( new com.stevesoft.pat.oneChar ('\t'));
+} else if (sp.escMatch ('n')) {
+this.add ( new com.stevesoft.pat.oneChar ('\n'));
+} else if (sp.escMatch ('r')) {
+this.add ( new com.stevesoft.pat.oneChar ('\r'));
+} else if (sp.escMatch ('b')) {
+this.add ( new com.stevesoft.pat.oneChar ('\b'));
+} else if (sp.escMatch ('e')) {
+this.add ( new com.stevesoft.pat.oneChar (String.fromCharCode (27)));
+} else {
+this.add ( new com.stevesoft.pat.oneChar (sp.c));
+if (sp.match (')')) {
+com.stevesoft.pat.RegSyntaxError.endItAll ("Unmatched right paren in pattern");
+}}}, "com.stevesoft.pat.StrPos,com.stevesoft.pat.Rthings");
+Clazz_defineMethod (c$, "_compile", 
+ function (pat, mk) {
+this.minMatch = null;
+this.sFlag = this.mFlag = this.ignoreCase = this.gFlag = false;
+var sp =  new com.stevesoft.pat.StrPos (pat, 0);
+this.thePattern = this._compileSP (sp, mk);
+this.pt.marks = null;
+return this.thePattern;
+}, "~S,com.stevesoft.pat.Rthings");
+Clazz_defineMethod (c$, "_compileSP", 
+function (sp, mk) {
+while (!(sp.$eos || (this.or != null && sp.match (')')))) {
+this.compileSP (sp, mk);
+sp.inc ();
+}
+if (sp.match (')')) {
+mk.parenLevel--;
+} else if (sp.$eos && mk.parenLevel != 0) {
+com.stevesoft.pat.RegSyntaxError.endItAll ("Unclosed Parenthesis! lvl=" + mk.parenLevel);
+}if (this.or != null) {
+if (this.p == null) {
+this.p =  new com.stevesoft.pat.NullPattern ();
+}this.or.addOr (this.p);
+return this.or;
+}return this.p == null ?  new com.stevesoft.pat.NullPattern () : this.p;
+}, "com.stevesoft.pat.StrPos,com.stevesoft.pat.Rthings");
+Clazz_defineMethod (c$, "addMulti", 
+function (i1, i2) {
+var last;
+var last2;
+for (last = this.p; last != null && last.next != null; last = last.next) {
+;}
+if (last == null || last === this.p) {
+last2 = null;
+} else {
+for (last2 = this.p; last2.next !== last; last2 = last2.next) {
+;}
+}if (Clazz_instanceOf (last, com.stevesoft.pat.Multi) && i1.intValue () == 0 && i2.intValue () == 1) {
+(last).matchFewest = true;
+} else if (Clazz_instanceOf (last, com.stevesoft.pat.FastMulti) && i1.intValue () == 0 && i2.intValue () == 1) {
+(last).matchFewest = true;
+} else if (Clazz_instanceOf (last, com.stevesoft.pat.DotMulti) && i1.intValue () == 0 && i2.intValue () == 1) {
+(last).matchFewest = true;
+} else if (Clazz_instanceOf (last, com.stevesoft.pat.Multi) || Clazz_instanceOf (last, com.stevesoft.pat.DotMulti) || Clazz_instanceOf (last, com.stevesoft.pat.FastMulti)) {
+throw  new com.stevesoft.pat.RegSyntax ("Syntax error.");
+} else if (last2 == null) {
+this.p = com.stevesoft.pat.Regex.mkMulti (i1, i2, this.p);
+} else {
+last2.next = com.stevesoft.pat.Regex.mkMulti (i1, i2, last);
+}}, "com.stevesoft.pat.patInt,com.stevesoft.pat.patInt");
+c$.mkMulti = Clazz_defineMethod (c$, "mkMulti", 
+function (lo, hi, p) {
+if (Clazz_instanceOf (p, com.stevesoft.pat.Any) && p.next == null) {
+return  new com.stevesoft.pat.DotMulti (lo, hi);
+}return com.stevesoft.pat.RegOpt.safe4fm (p) ?  new com.stevesoft.pat.FastMulti (lo, hi, p) :  new com.stevesoft.pat.Multi (lo, hi, p);
+}, "com.stevesoft.pat.patInt,com.stevesoft.pat.patInt,com.stevesoft.pat.Pattern");
+Clazz_defineMethod (c$, "matchBracket", 
+function (sp) {
+var ret;
+if (sp.match ('^')) {
+ret =  new com.stevesoft.pat.Bracket (true);
+sp.inc ();
+} else {
+ret =  new com.stevesoft.pat.Bracket (false);
+}if (sp.match (']')) {
+com.stevesoft.pat.RegSyntaxError.endItAll ("Unmatched []");
+}while (!sp.$eos && !sp.match (']')) {
+var s1 =  new com.stevesoft.pat.StrPos (sp);
+s1.inc ();
+var s1_ =  new com.stevesoft.pat.StrPos (s1);
+s1_.inc ();
+if (s1.match ('-') && !s1_.match (']')) {
+var s2 =  new com.stevesoft.pat.StrPos (s1);
+s2.inc ();
+if (!s2.$eos) {
+ret.addOr ( new com.stevesoft.pat.Range (sp.c, s2.c));
+}sp.inc ();
+sp.inc ();
+} else if (sp.escMatch ('Q')) {
+sp.inc ();
+while (!sp.escMatch ('E')) {
+ret.addOr ( new com.stevesoft.pat.oneChar (sp.c));
+sp.inc ();
+}
+} else if (sp.escMatch ('d')) {
+ret.addOr ( new com.stevesoft.pat.Range ('0', '9'));
+} else if (sp.escMatch ('s')) {
+ret.addOr ( new com.stevesoft.pat.oneChar (String.fromCharCode (32)));
+ret.addOr ( new com.stevesoft.pat.Range (String.fromCharCode (8), String.fromCharCode (10)));
+ret.addOr ( new com.stevesoft.pat.oneChar (String.fromCharCode (13)));
+} else if (sp.escMatch ('w')) {
+ret.addOr ( new com.stevesoft.pat.Range ('a', 'z'));
+ret.addOr ( new com.stevesoft.pat.Range ('A', 'Z'));
+ret.addOr ( new com.stevesoft.pat.Range ('0', '9'));
+ret.addOr ( new com.stevesoft.pat.oneChar ('_'));
+} else if (sp.escMatch ('D')) {
+ret.addOr ( new com.stevesoft.pat.Range (String.fromCharCode (0), String.fromCharCode (47)));
+ret.addOr ( new com.stevesoft.pat.Range (String.fromCharCode (58), String.fromCharCode (65535)));
+} else if (sp.escMatch ('S')) {
+ret.addOr ( new com.stevesoft.pat.Range (String.fromCharCode (0), String.fromCharCode (7)));
+ret.addOr ( new com.stevesoft.pat.Range (String.fromCharCode (11), String.fromCharCode (12)));
+ret.addOr ( new com.stevesoft.pat.Range (String.fromCharCode (14), String.fromCharCode (31)));
+ret.addOr ( new com.stevesoft.pat.Range (String.fromCharCode (33), String.fromCharCode (65535)));
+} else if (sp.escMatch ('W')) {
+ret.addOr ( new com.stevesoft.pat.Range (String.fromCharCode (0), String.fromCharCode (64)));
+ret.addOr ( new com.stevesoft.pat.Range (String.fromCharCode (91), String.fromCharCode (94)));
+ret.addOr ( new com.stevesoft.pat.oneChar (String.fromCharCode (96)));
+ret.addOr ( new com.stevesoft.pat.Range (String.fromCharCode (123), String.fromCharCode (65535)));
+} else if (sp.escMatch ('x') && this.next2Hex (sp)) {
+sp.inc ();
+var d = this.getHexDigit (sp);
+sp.inc ();
+d = 16 * d + this.getHexDigit (sp);
+ret.addOr ( new com.stevesoft.pat.oneChar (String.fromCharCode (d)));
+} else if (sp.escMatch ('a')) {
+ret.addOr ( new com.stevesoft.pat.oneChar (String.fromCharCode (7)));
+} else if (sp.escMatch ('f')) {
+ret.addOr ( new com.stevesoft.pat.oneChar (String.fromCharCode (12)));
+} else if (sp.escMatch ('e')) {
+ret.addOr ( new com.stevesoft.pat.oneChar (String.fromCharCode (27)));
+} else if (sp.escMatch ('n')) {
+ret.addOr ( new com.stevesoft.pat.oneChar ('\n'));
+} else if (sp.escMatch ('t')) {
+ret.addOr ( new com.stevesoft.pat.oneChar ('\t'));
+} else if (sp.escMatch ('r')) {
+ret.addOr ( new com.stevesoft.pat.oneChar ('\r'));
+} else if (sp.escMatch ('c')) {
+sp.inc ();
+if (sp.c.charCodeAt (0) < com.stevesoft.pat.Ctrl.cmap.length) {
+ret.addOr ( new com.stevesoft.pat.oneChar (com.stevesoft.pat.Ctrl.cmap[sp.c.charCodeAt (0)]));
+} else {
+ret.addOr ( new com.stevesoft.pat.oneChar (sp.c));
+}} else if (this.isOctalString (sp)) {
+var d = sp.c.charCodeAt (0) - 48;
+sp.inc ();
+d = 8 * d + sp.c.charCodeAt (0) - 48;
+var sp2 =  new com.stevesoft.pat.StrPos (sp);
+sp2.inc ();
+if (this.isOctalDigit (sp2, false)) {
+sp.inc ();
+d = 8 * d + sp.c.charCodeAt (0) - 48;
+}ret.addOr ( new com.stevesoft.pat.oneChar (String.fromCharCode (d)));
+} else {
+ret.addOr ( new com.stevesoft.pat.oneChar (sp.c));
+}sp.inc ();
+}
+return ret;
+}, "com.stevesoft.pat.StrPos");
+Clazz_overrideMethod (c$, "toString", 
+function () {
+{
+var sb =  new StringBuffer ();
+if (this.esc != '\\') {
+sb.append ("(?e=");
+sb.append (this.esc);
+sb.append (")");
+}if (this.gFlag || this.mFlag || !com.stevesoft.pat.Regex.dotDoesntMatchCR || this.sFlag || this.ignoreCase || this.dontMatchInQuotes || this.optimized ()) {
+sb.append ("(?");
+if (this.ignoreCase) {
+sb.append ("i");
+}if (this.mFlag) {
+sb.append ("m");
+}if (this.sFlag || !com.stevesoft.pat.Regex.dotDoesntMatchCR) {
+sb.append ("s");
+}if (this.dontMatchInQuotes) {
+sb.append ("Q");
+}if (this.optimized ()) {
+sb.append ("o");
+}if (this.gFlag) {
+sb.append ("g");
+}sb.append (")");
+}var patstr = this.thePattern.toString ();
+if (this.esc != '\\') {
+patstr = com.stevesoft.pat.Regex.reEscape (patstr, '\\', this.esc);
+}sb.append (patstr);
+return sb.toString ();
+}});
+c$.reEscape = Clazz_defineMethod (c$, "reEscape", 
+function (s, oldEsc, newEsc) {
+if (oldEsc == newEsc) {
+return s;
+}var i;
+var sb =  new StringBuffer ();
+for (i = 0; i < s.length; i++) {
+if (s.charAt (i) == oldEsc && i + 1 < s.length) {
+if (s.charAt (i + 1) == oldEsc) {
+sb.append (oldEsc);
+} else {
+sb.append (newEsc);
+sb.append (s.charAt (i + 1));
+}i++;
+} else if (s.charAt (i) == newEsc) {
+sb.append (newEsc);
+sb.append (newEsc);
+} else {
+sb.append (s.charAt (i));
+}}
+return sb.toString ();
+}, "~S,~S,~S");
+Clazz_defineMethod (c$, "accept", 
+function (dir, s) {
+return this.search (s);
+}, "java.io.File,~S");
+c$.version = Clazz_defineMethod (c$, "version", 
+function () {
+return "lgpl release 1.5.3";
+});
+Clazz_defineMethod (c$, "optimize", 
+function () {
+if (this.optimized () || this.thePattern == null) {
+return;
+}this.minMatch =  new com.stevesoft.pat.patInt (0);
+this.thePattern = com.stevesoft.pat.RegOpt.opt (this.thePattern, this.ignoreCase, this.dontMatchInQuotes);
+this.skipper = com.stevesoft.pat.Skip.findSkipRegex (this);
+return;
+});
+Clazz_defineMethod (c$, "optimized", 
+function () {
+return this.minMatch != null;
+});
+c$.perlCode = Clazz_defineMethod (c$, "perlCode", 
+function (s) {
+return com.stevesoft.pat.parsePerl.parse (s);
+}, "~S");
+Clazz_defineMethod (c$, "isLiteral", 
+function () {
+var x = this.thePattern;
+while (x != null) {
+if (Clazz_instanceOf (x, com.stevesoft.pat.oneChar)) {
+;} else if (Clazz_instanceOf (x, com.stevesoft.pat.Skipped)) {
+;} else {
+return false;
+}x = x.next;
+}
+return true;
+});
+Clazz_defineMethod (c$, "countMinChars", 
+function () {
+return this.thePattern.countMinChars ();
+});
+Clazz_defineMethod (c$, "countMaxChars", 
+function () {
+return this.thePattern.countMaxChars ();
+});
+Clazz_defineMethod (c$, "isHexDigit", 
+function (sp) {
+var r = !sp.$eos && !sp.dontMatch && ((sp.c >= '0' && sp.c <= '9') || (sp.c >= 'a' && sp.c <= 'f') || (sp.c >= 'A' && sp.c <= 'F'));
+return r;
+}, "com.stevesoft.pat.StrPos");
+Clazz_defineMethod (c$, "isOctalDigit", 
+function (sp, first) {
+var r = !sp.$eos && !( new Boolean (first ^ sp.dontMatch).valueOf ()) && sp.c >= '0' && sp.c <= '7';
+return r;
+}, "com.stevesoft.pat.StrPos,~B");
+Clazz_defineMethod (c$, "getHexDigit", 
+function (sp) {
+if (sp.c >= '0' && sp.c <= '9') {
+return sp.c.charCodeAt (0) - 48;
+}if (sp.c >= 'a' && sp.c <= 'f') {
+return sp.c.charCodeAt (0) - 97 + 10;
+}return sp.c.charCodeAt (0) - 65 + 10;
+}, "com.stevesoft.pat.StrPos");
+Clazz_defineMethod (c$, "next2Hex", 
+function (sp) {
+var sp2 =  new com.stevesoft.pat.StrPos (sp);
+sp2.inc ();
+if (!this.isHexDigit (sp2)) {
+return false;
+}sp2.inc ();
+if (!this.isHexDigit (sp2)) {
+return false;
+}return true;
+}, "com.stevesoft.pat.StrPos");
+Clazz_defineMethod (c$, "isOctalString", 
+function (sp) {
+if (!this.isOctalDigit (sp, true)) {
+return false;
+}var sp2 =  new com.stevesoft.pat.StrPos (sp);
+sp2.inc ();
+if (!this.isOctalDigit (sp2, false)) {
+return false;
+}return true;
+}, "com.stevesoft.pat.StrPos");
+Clazz_defineStatics (c$,
+"BackRefOffset", 1);
+c$.none = c$.prototype.none =  new com.stevesoft.pat.NoPattern ();
+c$.validators = c$.prototype.validators =  new java.util.Hashtable ();
+{
+com.stevesoft.pat.Regex.defineV ("p", "(?>1)",  new com.stevesoft.pat.UnicodePunct ());
+com.stevesoft.pat.Regex.defineV ("P", "(?>1)",  new com.stevesoft.pat.NUnicodePunct ());
+com.stevesoft.pat.Regex.defineV ("s", "(?>1)",  new com.stevesoft.pat.UnicodeWhite ());
+com.stevesoft.pat.Regex.defineV ("S", "(?>1)",  new com.stevesoft.pat.NUnicodeWhite ());
+com.stevesoft.pat.Regex.defineV ("w", "(?>1)",  new com.stevesoft.pat.UnicodeW ());
+com.stevesoft.pat.Regex.defineV ("W", "(?>1)",  new com.stevesoft.pat.NUnicodeW ());
+com.stevesoft.pat.Regex.defineV ("d", "(?>1)",  new com.stevesoft.pat.UnicodeDigit ());
+com.stevesoft.pat.Regex.defineV ("D", "(?>1)",  new com.stevesoft.pat.NUnicodeDigit ());
+com.stevesoft.pat.Regex.defineV ("m", "(?>1)",  new com.stevesoft.pat.UnicodeMath ());
+com.stevesoft.pat.Regex.defineV ("M", "(?>1)",  new com.stevesoft.pat.NUnicodeMath ());
+com.stevesoft.pat.Regex.defineV ("c", "(?>1)",  new com.stevesoft.pat.UnicodeCurrency ());
+com.stevesoft.pat.Regex.defineV ("C", "(?>1)",  new com.stevesoft.pat.NUnicodeCurrency ());
+com.stevesoft.pat.Regex.defineV ("a", "(?>1)",  new com.stevesoft.pat.UnicodeAlpha ());
+com.stevesoft.pat.Regex.defineV ("A", "(?>1)",  new com.stevesoft.pat.NUnicodeAlpha ());
+com.stevesoft.pat.Regex.defineV ("uc", "(?>1)",  new com.stevesoft.pat.UnicodeUpper ());
+com.stevesoft.pat.Regex.defineV ("lc", "(?>1)",  new com.stevesoft.pat.UnicodeLower ());
+}Clazz_defineStatics (c$,
+"defaultMFlag", false,
+"dotDoesntMatchCR", true,
+"lasts", null,
+"lastbs", null,
+"back_slash", '\\');
+});
+Clazz_declarePackage ("com.stevesoft.pat");
+Clazz_load (null, "com.stevesoft.pat.RegRes", ["java.lang.StringBuffer"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.marks = null;
+this.didMatch_ = false;
+this.src = null;
+this.charsMatched_ = 0;
+this.matchFrom_ = 0;
+this.numSubs_ = 0;
+Clazz_instantialize (this, arguments);
+}, com.stevesoft.pat, "RegRes");
+Clazz_defineMethod (c$, "getString", 
+function () {
+return this.src.toString ();
+});
+Clazz_defineMethod (c$, "getStringLike", 
+function () {
+return this.src;
+});
+Clazz_overrideMethod (c$, "toString", 
+function () {
+var sb =  new StringBuffer ();
+sb.append ("match=" + this.matchedFrom () + ":" + this.charsMatched ());
+if (!this.didMatch ()) {
+return sb.toString ();
+}for (var i = 0; i < this.numSubs (); i++) {
+var n = i + 1;
+sb.append (" sub(" + n + ")=" + this.matchedFromI (n) + ":" + this.charsMatchedI (n));
+}
+return sb.toString ();
+});
+Clazz_defineMethod (c$, "copyOutOf", 
+function (r) {
+if (r.marks == null) {
+this.marks = null;
+} else {
+try {
+this.marks =  Clazz_newIntArray (r.marks.length, 0);
+for (var i = 0; i < this.marks.length; i++) {
+this.marks[i] = r.marks[i];
+}
+} catch (t) {
+}
+}this.didMatch_ = r.didMatch_;
+this.src = r.src;
+this.charsMatched_ = r.charsMatched_;
+this.matchFrom_ = r.matchFrom_;
+this.numSubs_ = r.numSubs_;
+}, "com.stevesoft.pat.RegRes");
+Clazz_defineMethod (c$, "equals", 
+function (r) {
+if (this.charsMatched_ != r.charsMatched_ || this.matchFrom_ != r.matchFrom_ || this.didMatch_ != r.didMatch_ || this.numSubs_ != r.numSubs_ || !this.src.unwrap ().equals (r.src.unwrap ())) {
+return false;
+}if (this.marks == null && r.marks != null) {
+return false;
+}if (this.marks != null && r.marks == null) {
+return false;
+}for (var i = 1; i <= this.numSubs_; i++) {
+if (this.matchedFromI (i) != r.matchedFromI (i)) {
+return false;
+} else if (this.charsMatchedI (i) != r.charsMatchedI (i)) {
+return false;
+}}
+return true;
+}, "com.stevesoft.pat.RegRes");
+Clazz_defineMethod (c$, "stringMatched", 
+function () {
+var mf = this.matchedFrom ();
+var cm = this.charsMatched ();
+return !this.didMatch_ || mf < 0 || cm < 0 ? null : this.src.substring (mf, mf + cm);
+});
+Clazz_defineMethod (c$, "matchedFromI", 
+function (i) {
+if (this.marks == null || i > this.numSubs_) {
+return -1;
+}return this.marks[i];
+}, "~N");
+Clazz_defineMethod (c$, "charsMatchedI", 
+function (i) {
+if (this.marks == null || i > this.numSubs_ || !this.didMatch_) {
+return -1;
+}var mf = this.matchedFromI (i);
+return mf < 0 ? -1 : this.marks[i + this.numSubs_] - this.matchedFromI (i);
+}, "~N");
+Clazz_defineMethod (c$, "matchedToI", 
+function (i) {
+if (this.marks == null || i > this.numSubs_ || !this.didMatch_) {
+return -1;
+}return this.marks[i + this.numSubs_];
+}, "~N");
+Clazz_defineMethod (c$, "stringMatchedI", 
+function (i) {
+var mf = this.matchedFromI (i);
+var cm = this.charsMatchedI (i);
+return !this.didMatch_ || mf < 0 || cm < 0 ? null : this.src.substring (mf, mf + cm);
+}, "~N");
+Clazz_defineMethod (c$, "left", 
+function () {
+var mf = this.matchedFrom ();
+return !this.didMatch_ || (mf < 0) ? null : this.src.substring (0, mf);
+});
+Clazz_defineMethod (c$, "leftI", 
+function (i) {
+var mf = this.matchedFromI (i);
+return !this.didMatch_ || (mf < 0) ? null : this.src.substring (0, mf);
+}, "~N");
+Clazz_defineMethod (c$, "right", 
+function () {
+var mf = this.matchedFrom ();
+var cm = this.charsMatched ();
+return !this.didMatch_ || mf < 0 || cm < 0 ? null : this.src.substring (mf + cm, this.src.length ());
+});
+Clazz_defineMethod (c$, "rightI", 
+function (i) {
+var mf = this.matchedFromI (i);
+var cm = this.charsMatchedI (i);
+return !this.didMatch_ || mf < 0 || cm < 0 ? null : this.src.substring (mf + cm, this.src.length ());
+}, "~N");
+Clazz_defineMethod (c$, "matchedFrom", 
+function () {
+return !this.didMatch_ ? -1 : this.matchFrom_;
+});
+Clazz_defineMethod (c$, "charsMatched", 
+function () {
+return !this.didMatch_ || this.matchFrom_ < 0 ? -1 : this.charsMatched_;
+});
+Clazz_defineMethod (c$, "matchedTo", 
+function () {
+return !this.didMatch_ ? -1 : this.matchFrom_ + this.charsMatched_;
+});
+Clazz_defineMethod (c$, "numSubs", 
+function () {
+return this.numSubs_;
+});
+Clazz_defineMethod (c$, "didMatch", 
+function () {
+return this.didMatch_;
+});
+Clazz_defineMethod (c$, "matchFrom", 
+function () {
+return this.matchedFrom ();
+});
+Clazz_defineMethod (c$, "substring", 
+function () {
+return this.stringMatched ();
+});
+Clazz_defineMethod (c$, "matchFromI", 
+function (i) {
+return this.matchedFromI (i);
+}, "~N");
+Clazz_defineMethod (c$, "substringI", 
+function (i) {
+return this.stringMatchedI (i);
+}, "~N");
+});
+Clazz_declarePackage ("com.stevesoft.pat");
+Clazz_load (["com.stevesoft.pat.Validator"], "com.stevesoft.pat.UniValidator", ["com.stevesoft.pat.patInt"], function () {
+c$ = Clazz_declareType (com.stevesoft.pat, "UniValidator", com.stevesoft.pat.Validator);
+Clazz_overrideMethod (c$, "minChars", 
+function () {
+return  new com.stevesoft.pat.patInt (1);
+});
+Clazz_overrideMethod (c$, "maxChars", 
+function () {
+return  new com.stevesoft.pat.patInt (1);
+});
+});
+Clazz_declarePackage ("com.stevesoft.pat");
+Clazz_load (null, "com.stevesoft.pat.Validator", ["com.stevesoft.pat.patInf", "$.patInt"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.argsave = null;
+this.pattern = ".";
+Clazz_instantialize (this, arguments);
+}, com.stevesoft.pat, "Validator");
+Clazz_defineMethod (c$, "validate", 
+function (src, start, end) {
+return end;
+}, "com.stevesoft.pat.StringLike,~N,~N");
+Clazz_defineMethod (c$, "arg", 
+function (s) {
+return null;
+}, "~S");
+Clazz_defineMethod (c$, "minChars", 
+function () {
+return  new com.stevesoft.pat.patInt (0);
+});
+Clazz_defineMethod (c$, "maxChars", 
+function () {
+return  new com.stevesoft.pat.patInf ();
+});
+});
+Clazz_declarePackage ("com.stevesoft.pat");
+Clazz_load (["com.stevesoft.pat.patInt"], "com.stevesoft.pat.patInf", null, function () {
+c$ = Clazz_declareType (com.stevesoft.pat, "patInf", com.stevesoft.pat.patInt);
+Clazz_makeConstructor (c$, 
+function () {
+Clazz_superConstructor (this, com.stevesoft.pat.patInf, []);
+this.inf = true;
+});
+});
+Clazz_declarePackage ("com.stevesoft.pat");
+c$ = Clazz_decorateAsClass (function () {
+this.i = 0;
+this.inf = false;
+Clazz_instantialize (this, arguments);
+}, com.stevesoft.pat, "patInt");
+Clazz_makeConstructor (c$, 
+function () {
+this.i = 0;
+this.inf = false;
+});
+Clazz_makeConstructor (c$, 
+function (init) {
+this.i = init;
+this.inf = false;
+}, "~N");
+Clazz_makeConstructor (c$, 
+function (p) {
+this.i = p.i;
+this.inf = p.inf;
+}, "com.stevesoft.pat.patInt");
+Clazz_defineMethod (c$, "setInf", 
+function (b) {
+this.inf = b;
+if (b) {
+this.i = 2147483647;
+}}, "~B");
+Clazz_defineMethod (c$, "inc", 
+function () {
+if (!this.inf) {
+this.i++;
+}});
+Clazz_defineMethod (c$, "dec", 
+function () {
+if (!this.inf) {
+this.i--;
+}});
+Clazz_defineMethod (c$, "lessEq", 
+function (j) {
+return !this.inf && (j.inf || this.i <= j.i);
+}, "com.stevesoft.pat.patInt");
+Clazz_defineMethod (c$, "equals", 
+function (j) {
+return !j.inf && !this.inf && this.i == j.i;
+}, "com.stevesoft.pat.patInt");
+Clazz_overrideMethod (c$, "toString", 
+function () {
+if (this.inf) {
+return "";
+} else {
+return "" + this.i;
+}});
+Clazz_defineMethod (c$, "pluseq", 
+function (p) {
+if (this.inf || p.inf) {
+this.setInf (true);
+} else {
+this.i += p.i;
+}return this;
+}, "com.stevesoft.pat.patInt");
+Clazz_defineMethod (c$, "mul", 
+function (p) {
+if (this.inf || p.inf) {
+return  new com.stevesoft.pat.patInf ();
+}return  new com.stevesoft.pat.patInt (this.i * p.i);
+}, "com.stevesoft.pat.patInt");
+Clazz_defineMethod (c$, "mineq", 
+function (p) {
+if (p.inf) {
+return this;
+}if (this.inf) {
+this.i = p.i;
+} else if (p.i < this.i) {
+this.i = p.i;
+}this.setInf (false);
+return this;
+}, "com.stevesoft.pat.patInt");
+Clazz_defineMethod (c$, "maxeq", 
+function (p) {
+if (this.inf || p.inf) {
+this.setInf (true);
+return this;
+}if (p.i > this.i) {
+this.i = p.i;
+}return this;
+}, "com.stevesoft.pat.patInt");
+Clazz_defineMethod (c$, "finite", 
+function () {
+return !this.inf;
+});
+Clazz_defineMethod (c$, "intValue", 
+function () {
+return this.inf ? 2147483647 : this.i;
+});
+Clazz_declarePackage ("jalview.jsdev.api");
+Clazz_declareInterface (jalview.jsdev.api, "RegExpInterface");
+Clazz_declarePackage ("com.stevesoft.pat");
+Clazz_load (["com.stevesoft.pat.Pattern"], "com.stevesoft.pat.NoPattern", null, function () {
+c$ = Clazz_declareType (com.stevesoft.pat, "NoPattern", com.stevesoft.pat.Pattern);
+Clazz_overrideMethod (c$, "toString", 
+function () {
+return "(?e=#)[^#d#D]";
+});
+Clazz_overrideMethod (c$, "matchInternal", 
+function (i, p) {
+return -1;
+}, "~N,com.stevesoft.pat.Pthings");
+Clazz_overrideMethod (c$, "clone1", 
+function (h) {
+return  new com.stevesoft.pat.NoPattern ();
+}, "java.util.Hashtable");
+});
+Clazz_declarePackage ("com.stevesoft.pat");
+Clazz_load (null, "com.stevesoft.pat.Pattern", ["com.stevesoft.pat.MessageManager", "$.patInf", "$.patInt", "java.lang.Error", "$.StringBuffer"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.next = null;
+this.parent = null;
+this.mfrom = 0;
+Clazz_instantialize (this, arguments);
+}, com.stevesoft.pat, "Pattern");
+Clazz_defineMethod (c$, "getNext", 
+function () {
+return this.next != null ? this.next : (this.parent == null ? null : this.parent.getNext ());
+});
+Clazz_defineMethod (c$, "setParent", 
+function (p) {
+if (this.next != null) {
+this.next.setParent (p);
+} else {
+this.parent = p;
+}}, "com.stevesoft.pat.Pattern");
+Clazz_defineMethod (c$, "nextMatch", 
+function (i, pt) {
+var p = this.getNext ();
+return p == null ? i : p.matchInternal (i, pt);
+}, "~N,com.stevesoft.pat.Pthings");
+Clazz_defineMethod (c$, "nextString", 
+function () {
+if (this.next == null) {
+return "";
+}return this.next.toString ();
+});
+c$.inString = Clazz_defineMethod (c$, "inString", 
+function (c, s) {
+var i;
+for (i = 0; i < s.length; i++) {
+if (s.charAt (i) == c) {
+return true;
+}}
+return false;
+}, "~S,~S");
+c$.protect = Clazz_defineMethod (c$, "protect", 
+function (s, PROTECT_THESE, esc) {
+var i;
+var sb =  new StringBuffer ();
+var p = PROTECT_THESE + esc;
+for (i = 0; i < s.length; i++) {
+var c = s.charAt (i);
+if (com.stevesoft.pat.Pattern.inString (c, p)) {
+sb.append (esc);
+}sb.append (c);
+}
+return sb.toString ();
+}, "~S,~S,~S");
+Clazz_defineMethod (c$, "match", 
+function (s, pt) {
+return this.matchAt (s, 0, pt);
+}, "com.stevesoft.pat.StringLike,com.stevesoft.pat.Pthings");
+Clazz_defineMethod (c$, "matchAt", 
+function (s, i, pt) {
+pt.src = s;
+var r = this.matchInternal (i, pt);
+if (r < 0) {
+return -1;
+}this.mfrom = r < i ? r + 1 : i;
+return r < i ? i - r - 1 : r - i;
+}, "com.stevesoft.pat.StringLike,~N,com.stevesoft.pat.Pthings");
+Clazz_defineMethod (c$, "Masked", 
+function (i, pt) {
+return pt.cbits == null ? false : pt.cbits.get (i);
+}, "~N,com.stevesoft.pat.Pthings");
+Clazz_defineMethod (c$, "add", 
+function (p) {
+if (this.next == null) {
+if (p == null) {
+return this;
+}this.next = p;
+p.parent = this.parent;
+this.parent = null;
+} else {
+this.next.add (p);
+}return this;
+}, "com.stevesoft.pat.Pattern");
+Clazz_defineMethod (c$, "minChars", 
+function () {
+return  new com.stevesoft.pat.patInt (0);
+});
+Clazz_defineMethod (c$, "maxChars", 
+function () {
+return  new com.stevesoft.pat.patInf ();
+});
+Clazz_defineMethod (c$, "countMinChars", 
+function () {
+var p = this;
+var sum =  new com.stevesoft.pat.patInt (0);
+while (p != null) {
+sum.pluseq (p.minChars ());
+p = p.next;
+}
+return sum;
+});
+Clazz_defineMethod (c$, "countMaxChars", 
+function () {
+var p = this;
+var sum =  new com.stevesoft.pat.patInt (0);
+while (p != null) {
+sum.pluseq (p.maxChars ());
+p = p.next;
+}
+return sum;
+});
+Clazz_defineMethod (c$, "testMatch", 
+function (p, pos, pt) {
+var tab = null;
+if (pt.marks != null) {
+try {
+tab =  Clazz_newIntArray (pt.marks.length, 0);
+for (var i = 0; i < tab.length; i++) {
+tab[i] = pt.marks[i];
+}
+} catch (t) {
+}
+}var ret = p.matchInternal (pos, pt);
+if (ret < 0) {
+pt.marks = tab;
+}return ret;
+}, "com.stevesoft.pat.Pattern,~N,com.stevesoft.pat.Pthings");
+Clazz_defineMethod (c$, "clone1", 
+function (h) {
+throw  new Error (com.stevesoft.pat.MessageManager.formatMessage ("error.no_such_method_as_clone1_for",  Clazz_newArray (-1, [this.getClass ().getName ()])));
+}, "java.util.Hashtable");
+Clazz_defineMethod (c$, "clone", 
+function (h) {
+var p = h.get (this);
+if (p != null) {
+return p;
+}p = this.clone1 (h);
+if (p == null) {
+throw  new Error (com.stevesoft.pat.MessageManager.getString ("error.null_from_clone1"));
+}h.put (this, p);
+h.put (p, p);
+if (this.next != null) {
+p.next = this.next.clone (h);
+}if (this.parent != null) {
+p.parent = this.parent.clone (h);
+}return p;
+}, "java.util.Hashtable");
+Clazz_overrideMethod (c$, "equals", 
+function (o) {
+return o === this;
+}, "~O");
+Clazz_defineStatics (c$,
+"ESC", '\\',
+"PROTECT_THESE", "[]{}(),$,-\"^.");
+});
+Clazz_declarePackage ("com.stevesoft.pat");
+c$ = Clazz_declareType (com.stevesoft.pat, "MessageManager");
+c$.getString = Clazz_defineMethod (c$, "getString", 
+function (string) {
+return string;
+}, "~S");
+c$.formatMessage = Clazz_defineMethod (c$, "formatMessage", 
+function (s, fields) {
+for (var i = 0; i < fields.length; i++) s += " " + fields[i];
+
+return s;
+}, "~S,~A");
+Clazz_declarePackage ("com.stevesoft.pat");
+c$ = Clazz_decorateAsClass (function () {
+this.src = null;
+this.ignoreCase = false;
+this.mFlag = false;
+this.cbits = null;
+this.marks = null;
+this.nMarks = 0;
+this.dotDoesntMatchCR = false;
+this.no_check = false;
+this.lastPos = 0;
+Clazz_instantialize (this, arguments);
+}, com.stevesoft.pat, "Pthings");
+Clazz_declarePackage ("com.stevesoft.pat");
+Clazz_load (["com.stevesoft.pat.Pattern"], "com.stevesoft.pat.Any", ["com.stevesoft.pat.patInt"], function () {
+c$ = Clazz_declareType (com.stevesoft.pat, "Any", com.stevesoft.pat.Pattern);
+Clazz_overrideMethod (c$, "matchInternal", 
+function (pos, pt) {
+if (pos < pt.src.length ()) {
+if (pt.dotDoesntMatchCR) {
+if (pt.src.charAt (pos) != '\n') {
+return this.nextMatch (pos + 1, pt);
+}} else {
+return this.nextMatch (pos + 1, pt);
+}}return -1;
+}, "~N,com.stevesoft.pat.Pthings");
+Clazz_overrideMethod (c$, "toString", 
+function () {
+return "." + this.nextString ();
+});
+Clazz_overrideMethod (c$, "minChars", 
+function () {
+return  new com.stevesoft.pat.patInt (1);
+});
+Clazz_overrideMethod (c$, "maxChars", 
+function () {
+return  new com.stevesoft.pat.patInt (1);
+});
+Clazz_overrideMethod (c$, "clone1", 
+function (h) {
+return  new com.stevesoft.pat.Any ();
+}, "java.util.Hashtable");
+});
+Clazz_declarePackage ("com.stevesoft.pat");
+Clazz_load (["com.stevesoft.pat.Pattern"], "com.stevesoft.pat.BackG", ["com.stevesoft.pat.patInt"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.c = '\0';
+this.altc = '\0';
+this.altc2 = '\0';
+this.mask = 0;
+Clazz_instantialize (this, arguments);
+}, com.stevesoft.pat, "BackG", com.stevesoft.pat.Pattern);
+Clazz_makeConstructor (c$, 
+function () {
+Clazz_superConstructor (this, com.stevesoft.pat.BackG, []);
+});
+Clazz_overrideMethod (c$, "matchInternal", 
+function (pos, pt) {
+return pos == pt.lastPos ? this.nextMatch (pos, pt) : -1;
+}, "~N,com.stevesoft.pat.Pthings");
+Clazz_overrideMethod (c$, "toString", 
+function () {
+return "\\G" + this.nextString ();
+});
+Clazz_overrideMethod (c$, "minChars", 
+function () {
+return  new com.stevesoft.pat.patInt (1);
+});
+Clazz_overrideMethod (c$, "maxChars", 
+function () {
+return  new com.stevesoft.pat.patInt (1);
+});
+Clazz_overrideMethod (c$, "clone1", 
+function (h) {
+return  new com.stevesoft.pat.BackG ();
+}, "java.util.Hashtable");
+});
+Clazz_declarePackage ("com.stevesoft.pat");
+Clazz_load (["com.stevesoft.pat.Pattern"], "com.stevesoft.pat.BackMatch", null, function () {
+c$ = Clazz_decorateAsClass (function () {
+this.id = 0;
+Clazz_instantialize (this, arguments);
+}, com.stevesoft.pat, "BackMatch", com.stevesoft.pat.Pattern);
+Clazz_makeConstructor (c$, 
+function (id) {
+Clazz_superConstructor (this, com.stevesoft.pat.BackMatch, []);
+this.id = id;
+}, "~N");
+Clazz_overrideMethod (c$, "toString", 
+function () {
+return "\\" + (this.id) + this.nextString ();
+});
+Clazz_overrideMethod (c$, "matchInternal", 
+function (pos, p) {
+var i1 = p.marks[this.id];
+var i2 = p.marks[this.id + p.nMarks];
+var imax = i2 - i1;
+if (i1 < 0 || imax < 0 || pos + imax > p.src.length ()) {
+return -1;
+}var ns = p.src.length () - pos;
+if (imax < ns) {
+ns = imax;
+}for (var i = 0; i < ns; i++) {
+if (p.src.charAt (i + i1) != p.src.charAt (pos + i)) {
+return -1;
+}}
+return this.nextMatch (pos + imax, p);
+}, "~N,com.stevesoft.pat.Pthings");
+Clazz_overrideMethod (c$, "clone1", 
+function (h) {
+return  new com.stevesoft.pat.BackMatch (this.id);
+}, "java.util.Hashtable");
+});
+Clazz_declarePackage ("com.stevesoft.pat");
+Clazz_load (["com.stevesoft.pat.Pattern"], "com.stevesoft.pat.Backup", ["com.stevesoft.pat.patInt"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.bk = 0;
+Clazz_instantialize (this, arguments);
+}, com.stevesoft.pat, "Backup", com.stevesoft.pat.Pattern);
+Clazz_makeConstructor (c$, 
+function (ii) {
+Clazz_superConstructor (this, com.stevesoft.pat.Backup, []);
+this.bk = ii;
+}, "~N");
+Clazz_overrideMethod (c$, "toString", 
+function () {
+return "(?" + (this.bk < 0 ? ">" + (-this.bk) : "<" + this.bk) + ")" + this.nextString ();
+});
+Clazz_overrideMethod (c$, "matchInternal", 
+function (pos, pt) {
+if (pos < this.bk) {
+return -1;
+}return this.nextMatch (pos - this.bk, pt);
+}, "~N,com.stevesoft.pat.Pthings");
+Clazz_overrideMethod (c$, "minChars", 
+function () {
+return  new com.stevesoft.pat.patInt (-this.bk);
+});
+Clazz_overrideMethod (c$, "maxChars", 
+function () {
+return  new com.stevesoft.pat.patInt (-this.bk);
+});
+Clazz_overrideMethod (c$, "clone1", 
+function (h) {
+return  new com.stevesoft.pat.Backup (this.bk);
+}, "java.util.Hashtable");
+});
+Clazz_declarePackage ("com.stevesoft.pat");
+Clazz_load (["com.stevesoft.pat.Pattern"], "com.stevesoft.pat.Boundary", ["com.stevesoft.pat.patInt"], function () {
+c$ = Clazz_declareType (com.stevesoft.pat, "Boundary", com.stevesoft.pat.Pattern);
+Clazz_overrideMethod (c$, "toString", 
+function () {
+return "\\b" + this.nextString ();
+});
+Clazz_defineMethod (c$, "isAChar", 
+function (c) {
+if (c >= 'a' && c <= 'z') {
+return true;
+}if (c >= 'A' && c <= 'Z') {
+return true;
+}if (c >= '0' && c <= '9') {
+return true;
+}if (c == '_') {
+return true;
+}return false;
+}, "~S");
+Clazz_defineMethod (c$, "matchLeft", 
+function (pos, pt) {
+if (pos <= 0) {
+return true;
+}if (this.isAChar (pt.src.charAt (pos)) && this.isAChar (pt.src.charAt (pos - 1))) {
+return false;
+}return true;
+}, "~N,com.stevesoft.pat.Pthings");
+Clazz_defineMethod (c$, "matchRight", 
+function (pos, pt) {
+if (pos < 0) {
+return false;
+}if (pos + 1 >= pt.src.length ()) {
+return true;
+}if (this.isAChar (pt.src.charAt (pos)) && this.isAChar (pt.src.charAt (pos + 1))) {
+return false;
+}return true;
+}, "~N,com.stevesoft.pat.Pthings");
+Clazz_overrideMethod (c$, "matchInternal", 
+function (pos, pt) {
+if (this.matchRight (pos - 1, pt) || this.matchLeft (pos, pt)) {
+return this.nextMatch (pos, pt);
+}return -1;
+}, "~N,com.stevesoft.pat.Pthings");
+Clazz_overrideMethod (c$, "maxChars", 
+function () {
+return  new com.stevesoft.pat.patInt (0);
+});
+Clazz_overrideMethod (c$, "clone1", 
+function (h) {
+return  new com.stevesoft.pat.Boundary ();
+}, "java.util.Hashtable");
+});
+Clazz_declarePackage ("com.stevesoft.pat");
+Clazz_load (["com.stevesoft.pat.Or"], "com.stevesoft.pat.Bracket", ["com.stevesoft.pat.patInt", "java.util.Vector"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.neg = false;
+Clazz_instantialize (this, arguments);
+}, com.stevesoft.pat, "Bracket", com.stevesoft.pat.Or);
+Clazz_makeConstructor (c$, 
+function (n) {
+Clazz_superConstructor (this, com.stevesoft.pat.Bracket, []);
+this.neg = n;
+}, "~B");
+Clazz_overrideMethod (c$, "leftForm", 
+function () {
+if (this.neg) {
+return "[^";
+} else {
+return "[";
+}});
+Clazz_overrideMethod (c$, "rightForm", 
+function () {
+return "]";
+});
+Clazz_overrideMethod (c$, "sepForm", 
+function () {
+return "";
+});
+Clazz_defineMethod (c$, "matchInternal", 
+function (pos, pt) {
+if (pos >= pt.src.length ()) {
+return -1;
+}var r = Clazz_superCall (this, com.stevesoft.pat.Bracket, "matchInternal", [pos, pt]);
+if ((this.neg && r < 0) || (!this.neg && r >= 0)) {
+return this.nextMatch (pos + 1, pt);
+}return -1;
+}, "~N,com.stevesoft.pat.Pthings");
+Clazz_overrideMethod (c$, "minChars", 
+function () {
+return  new com.stevesoft.pat.patInt (1);
+});
+Clazz_overrideMethod (c$, "maxChars", 
+function () {
+return  new com.stevesoft.pat.patInt (1);
+});
+Clazz_overrideMethod (c$, "addOr", 
+function (p) {
+this.pv = null;
+this.v.addElement (p);
+p.setParent (null);
+return this;
+}, "com.stevesoft.pat.Pattern");
+Clazz_overrideMethod (c$, "clone1", 
+function (h) {
+var b =  new com.stevesoft.pat.Bracket (this.neg);
+b.v =  new java.util.Vector ();
+for (var i = 0; i < this.v.size (); i++) {
+b.v.addElement ((this.v.elementAt (i)).clone1 (h));
+}
+return b;
+}, "java.util.Hashtable");
+});
+Clazz_declarePackage ("com.stevesoft.pat");
+Clazz_load (["com.stevesoft.pat.Pattern"], "com.stevesoft.pat.Or", ["com.stevesoft.pat.patInt", "java.lang.StringBuffer", "java.util.Vector"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.v = null;
+this.pv = null;
+Clazz_instantialize (this, arguments);
+}, com.stevesoft.pat, "Or", com.stevesoft.pat.Pattern);
+Clazz_makeConstructor (c$, 
+function () {
+Clazz_superConstructor (this, com.stevesoft.pat.Or, []);
+this.v =  new java.util.Vector ();
+});
+Clazz_defineMethod (c$, "leftForm", 
+function () {
+return "(?:";
+});
+Clazz_defineMethod (c$, "rightForm", 
+function () {
+return ")";
+});
+Clazz_defineMethod (c$, "sepForm", 
+function () {
+return "|";
+});
+Clazz_defineMethod (c$, "addOr", 
+function (p) {
+this.pv = null;
+this.v.addElement (p);
+p.setParent (this);
+return this;
+}, "com.stevesoft.pat.Pattern");
+Clazz_defineMethod (c$, "toString", 
+function () {
+var i;
+var sb =  new StringBuffer ();
+sb.append (this.leftForm ());
+if (this.v.size () > 0) {
+sb.append ((this.v.elementAt (0)).toString ());
+}for (i = 1; i < this.v.size (); i++) {
+sb.append (this.sepForm ());
+sb.append ((this.v.elementAt (i)).toString ());
+}
+sb.append (this.rightForm ());
+sb.append (this.nextString ());
+return sb.toString ();
+});
+Clazz_defineMethod (c$, "matchInternal", 
+function (pos, pt) {
+if (this.pv == null) {
+this.pv =  new Array (this.v.size ());
+this.v.copyInto (this.pv);
+}for (var i = 0; i < this.v.size (); i++) {
+var p = this.pv[i];
+var r = p.matchInternal (pos, pt);
+if (r >= 0) {
+return r;
+}}
+return -1;
+}, "~N,com.stevesoft.pat.Pthings");
+Clazz_overrideMethod (c$, "minChars", 
+function () {
+if (this.v.size () == 0) {
+return  new com.stevesoft.pat.patInt (0);
+}var m = (this.v.elementAt (0)).countMinChars ();
+for (var i = 1; i < this.v.size (); i++) {
+var p = this.v.elementAt (i);
+m.mineq (p.countMinChars ());
+}
+return m;
+});
+Clazz_overrideMethod (c$, "maxChars", 
+function () {
+if (this.v.size () == 0) {
+return  new com.stevesoft.pat.patInt (0);
+}var m = (this.v.elementAt (0)).countMaxChars ();
+for (var i = 1; i < this.v.size (); i++) {
+var p = this.v.elementAt (i);
+m.maxeq (p.countMaxChars ());
+}
+return m;
+});
+Clazz_overrideMethod (c$, "clone1", 
+function (h) {
+var o =  new com.stevesoft.pat.Or ();
+h.put (this, o);
+h.put (o, o);
+for (var i = 0; i < this.v.size (); i++) {
+o.v.addElement ((this.v.elementAt (i)).clone (h));
+}
+return o;
+}, "java.util.Hashtable");
+});
+Clazz_declarePackage ("com.stevesoft.pat");
+Clazz_load (null, "com.stevesoft.pat.CaseMgr", ["java.lang.Character"], function () {
+c$ = Clazz_declareType (com.stevesoft.pat, "CaseMgr");
+c$.toUpperCaseC = Clazz_defineMethod (c$, "toUpperCaseC", 
+function (c) {
+return Character.toUpperCase (c);
+}, "~S");
+c$.toLowerCaseC = Clazz_defineMethod (c$, "toLowerCaseC", 
+function (c) {
+return Character.toLowerCase (c);
+}, "~S");
+c$.toUpperCase = Clazz_defineMethod (c$, "toUpperCase", 
+function (s) {
+return s.toUpperCase ();
+}, "~S");
+c$.toLowerCase = Clazz_defineMethod (c$, "toLowerCase", 
+function (s) {
+return s.toLowerCase ();
+}, "~S");
+c$.toTitleCaseC = Clazz_defineMethod (c$, "toTitleCaseC", 
+function (c) {
+return Character.toUpperCase (c);
+}, "~S");
+c$.regionMatchesLike = Clazz_defineMethod (c$, "regionMatchesLike", 
+function (s1, ign, i1, s2, i2, i3) {
+var itot = i2 + i3;
+if (itot > s2.length () || i1 + i3 > s1.length ()) {
+return false;
+}if (!ign) {
+for (var i = i2; i < itot; i++) {
+if (s2.charAt (i) != s1.charAt (i1++)) {
+return false;
+}}
+} else {
+for (var i = i2; i < itot; i++) {
+if (com.stevesoft.pat.CaseMgr.toLowerCaseC (s2.charAt (i)) != com.stevesoft.pat.CaseMgr.toLowerCaseC (s1.charAt (i1++))) {
+return false;
+}}
+}return true;
+}, "com.stevesoft.pat.StringLike,~B,~N,com.stevesoft.pat.StringLike,~N,~N");
+c$.regionMatches = Clazz_defineMethod (c$, "regionMatches", 
+function (s1, ign, i1, s2, i2, i3) {
+var itot = i2 + i3;
+if (itot > s2.length () || i1 + i3 > s1.length) {
+return false;
+}if (!ign) {
+for (var i = i2; i < itot; i++) {
+if (s2.charAt (i) != s1.charAt (i1++)) {
+return false;
+}}
+} else {
+for (var i = i2; i < itot; i++) {
+if (com.stevesoft.pat.CaseMgr.toLowerCaseC (s2.charAt (i)) != com.stevesoft.pat.CaseMgr.toLowerCaseC (s1.charAt (i1++))) {
+return false;
+}}
+}return true;
+}, "~S,~B,~N,com.stevesoft.pat.StringLike,~N,~N");
+c$.regionMatchesLike2 = Clazz_defineMethod (c$, "regionMatchesLike2", 
+function (s1, ign, i1, s2, i2, i3) {
+var itot = i2 + i3;
+if (itot > s2.length || i1 + i3 > s1.length ()) {
+return false;
+}if (!ign) {
+for (var i = i2; i < itot; i++) {
+if (s2.charAt (i) != s1.charAt (i1++)) {
+return false;
+}}
+} else {
+for (var i = i2; i < itot; i++) {
+if (com.stevesoft.pat.CaseMgr.toLowerCaseC (s2.charAt (i)) != com.stevesoft.pat.CaseMgr.toLowerCaseC (s1.charAt (i1++))) {
+return false;
+}}
+}return true;
+}, "com.stevesoft.pat.StringLike,~B,~N,~S,~N,~N");
+c$.regionMatches2 = Clazz_defineMethod (c$, "regionMatches2", 
+function (s1, ign, i1, s2, i2, i3) {
+var itot = i2 + i3;
+if (itot > s2.length || i1 + i3 > s1.length) {
+return false;
+}if (!ign) {
+for (var i = i2; i < itot; i++) {
+if (s2.charAt (i) != s1.charAt (i1++)) {
+return false;
+}}
+} else {
+for (var i = i2; i < itot; i++) {
+if (com.stevesoft.pat.CaseMgr.toLowerCaseC (s2.charAt (i)) != com.stevesoft.pat.CaseMgr.toLowerCaseC (s1.charAt (i1++))) {
+return false;
+}}
+}return true;
+}, "~S,~B,~N,~S,~N,~N");
+Clazz_defineStatics (c$,
+"java_1_0", false);
+});
+Clazz_declarePackage ("com.stevesoft.pat");
+c$ = Clazz_declareType (com.stevesoft.pat, "Ctrl");
+Clazz_defineStatics (c$,
+"cmap",  Clazz_newCharArray (-1, [String.fromCharCode (64), 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', String.fromCharCode (91), String.fromCharCode (92), String.fromCharCode (93), String.fromCharCode (94), String.fromCharCode (95), String.fromCharCode (96), 'a', 'a', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', String.fromCharCode (123), String.fromCharCode (124), String.fromCharCode (125), String.fromCharCode (126), String.fromCharCode (127), String.fromCharCode (0), String.fromCharCode (1), String.fromCharCode (2), String.fromCharCode (3), String.fromCharCode (4), String.fromCharCode (5), String.fromCharCode (6), String.fromCharCode (7), String.fromCharCode (8), String.fromCharCode (9), String.fromCharCode (10), String.fromCharCode (11), String.fromCharCode (12), String.fromCharCode (13), String.fromCharCode (14), String.fromCharCode (15), String.fromCharCode (16), String.fromCharCode (17), String.fromCharCode (18), String.fromCharCode (19), String.fromCharCode (20), String.fromCharCode (21), String.fromCharCode (22), String.fromCharCode (23), String.fromCharCode (24), String.fromCharCode (25), String.fromCharCode (26), String.fromCharCode (27), String.fromCharCode (27), String.fromCharCode (29), String.fromCharCode (30), String.fromCharCode (31), String.fromCharCode (32), String.fromCharCode (1), String.fromCharCode (2), String.fromCharCode (3), String.fromCharCode (4), String.fromCharCode (5), String.fromCharCode (6), String.fromCharCode (7), String.fromCharCode (8), String.fromCharCode (9), String.fromCharCode (10), String.fromCharCode (11), String.fromCharCode (12), String.fromCharCode (13), String.fromCharCode (14), String.fromCharCode (15), String.fromCharCode (16), String.fromCharCode (17), String.fromCharCode (18), String.fromCharCode (19), String.fromCharCode (20), String.fromCharCode (21), String.fromCharCode (22), String.fromCharCode (23), String.fromCharCode (24), String.fromCharCode (25), String.fromCharCode (26), String.fromCharCode (59), String.fromCharCode (60), String.fromCharCode (61), String.fromCharCode (62), String.fromCharCode (63), String.fromCharCode (192), String.fromCharCode (193), String.fromCharCode (194), String.fromCharCode (195), String.fromCharCode (196), String.fromCharCode (197), String.fromCharCode (198), String.fromCharCode (199), String.fromCharCode (200), String.fromCharCode (201), String.fromCharCode (202), String.fromCharCode (203), String.fromCharCode (204), String.fromCharCode (205), String.fromCharCode (206), String.fromCharCode (207), String.fromCharCode (208), String.fromCharCode (209), String.fromCharCode (210), String.fromCharCode (211), String.fromCharCode (212), String.fromCharCode (213), String.fromCharCode (214), String.fromCharCode (215), String.fromCharCode (216), String.fromCharCode (217), String.fromCharCode (218), String.fromCharCode (219), String.fromCharCode (220), String.fromCharCode (221), String.fromCharCode (222), String.fromCharCode (223), String.fromCharCode (224), String.fromCharCode (225), String.fromCharCode (226), String.fromCharCode (227), String.fromCharCode (228), String.fromCharCode (229), String.fromCharCode (230), String.fromCharCode (231), String.fromCharCode (232), String.fromCharCode (233), String.fromCharCode (234), String.fromCharCode (235), String.fromCharCode (236), String.fromCharCode (237), String.fromCharCode (238), String.fromCharCode (239), String.fromCharCode (240), String.fromCharCode (241), String.fromCharCode (242), String.fromCharCode (243), String.fromCharCode (244), String.fromCharCode (245), String.fromCharCode (246), String.fromCharCode (247), String.fromCharCode (248), String.fromCharCode (249), String.fromCharCode (250), String.fromCharCode (251), String.fromCharCode (252), String.fromCharCode (253), String.fromCharCode (254), String.fromCharCode (255), String.fromCharCode (128), String.fromCharCode (129), String.fromCharCode (130), String.fromCharCode (131), String.fromCharCode (132), String.fromCharCode (133), String.fromCharCode (134), String.fromCharCode (135), String.fromCharCode (136), String.fromCharCode (137), String.fromCharCode (138), String.fromCharCode (139), String.fromCharCode (140), String.fromCharCode (141), String.fromCharCode (142), String.fromCharCode (143), String.fromCharCode (144), String.fromCharCode (145), String.fromCharCode (146), String.fromCharCode (147), String.fromCharCode (148), String.fromCharCode (149), String.fromCharCode (150), String.fromCharCode (151), String.fromCharCode (152), String.fromCharCode (153), String.fromCharCode (154), String.fromCharCode (155), String.fromCharCode (156), String.fromCharCode (157), String.fromCharCode (158), String.fromCharCode (159), String.fromCharCode (160), String.fromCharCode (161), String.fromCharCode (162), String.fromCharCode (163), String.fromCharCode (164), String.fromCharCode (165), String.fromCharCode (166), String.fromCharCode (167), String.fromCharCode (168), String.fromCharCode (169), String.fromCharCode (170), String.fromCharCode (171), String.fromCharCode (172), String.fromCharCode (173), String.fromCharCode (174), String.fromCharCode (175), String.fromCharCode (176), String.fromCharCode (177), String.fromCharCode (178), String.fromCharCode (179), String.fromCharCode (180), String.fromCharCode (181), String.fromCharCode (182), String.fromCharCode (183), String.fromCharCode (184), String.fromCharCode (185), String.fromCharCode (186), String.fromCharCode (187), String.fromCharCode (188), String.fromCharCode (189), String.fromCharCode (190), String.fromCharCode (191)]));
+Clazz_declarePackage ("com.stevesoft.pat");
+Clazz_load (["com.stevesoft.pat.PatternSub"], "com.stevesoft.pat.Custom", ["com.stevesoft.pat.Regex"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.select = null;
+this.v = null;
+this.start = 0;
+Clazz_instantialize (this, arguments);
+}, com.stevesoft.pat, "Custom", com.stevesoft.pat.PatternSub);
+Clazz_makeConstructor (c$, 
+function (s) {
+Clazz_superConstructor (this, com.stevesoft.pat.Custom, []);
+this.select = s;
+this.v = com.stevesoft.pat.Regex.validators.get (s);
+}, "~S");
+Clazz_defineMethod (c$, "matchInternal", 
+function (pos, pt) {
+this.start = pos;
+return this.sub.matchInternal (pos, pt);
+}, "~N,com.stevesoft.pat.Pthings");
+Clazz_overrideMethod (c$, "toString", 
+function () {
+var a = this.v.argsave == null ? "" : ":" + this.v.argsave;
+return "(??" + this.select + a + ")" + this.nextString ();
+});
+Clazz_overrideMethod (c$, "minChars", 
+function () {
+return this.v.minChars ();
+});
+Clazz_overrideMethod (c$, "maxChars", 
+function () {
+return this.v.maxChars ();
+});
+Clazz_overrideMethod (c$, "clone1", 
+function (h) {
+var c =  new com.stevesoft.pat.Custom (this.select);
+h.put (c, c);
+h.put (this, c);
+c.sub = this.sub.clone (h);
+return c;
+}, "java.util.Hashtable");
+});
+Clazz_declarePackage ("com.stevesoft.pat");
+Clazz_load (["com.stevesoft.pat.Pattern"], "com.stevesoft.pat.PatternSub", null, function () {
+c$ = Clazz_decorateAsClass (function () {
+this.sub = null;
+Clazz_instantialize (this, arguments);
+}, com.stevesoft.pat, "PatternSub", com.stevesoft.pat.Pattern);
+});
+Clazz_declarePackage ("com.stevesoft.pat");
+Clazz_load (["com.stevesoft.pat.Pattern"], "com.stevesoft.pat.CustomEndpoint", null, function () {
+c$ = Clazz_decorateAsClass (function () {
+this.c = null;
+Clazz_instantialize (this, arguments);
+}, com.stevesoft.pat, "CustomEndpoint", com.stevesoft.pat.Pattern);
+Clazz_makeConstructor (c$, 
+function (cm) {
+Clazz_superConstructor (this, com.stevesoft.pat.CustomEndpoint, []);
+this.c = cm;
+}, "com.stevesoft.pat.Custom");
+Clazz_overrideMethod (c$, "matchInternal", 
+function (pos, pt) {
+var npos = this.c.v.validate (pt.src, this.c.start, pos);
+if (npos >= 0) {
+return this.nextMatch (npos, pt);
+}return -1;
+}, "~N,com.stevesoft.pat.Pthings");
+Clazz_overrideMethod (c$, "toString", 
+function () {
+return "";
+});
+Clazz_overrideMethod (c$, "clone1", 
+function (h) {
+return  new com.stevesoft.pat.CustomEndpoint (this.c.clone (h));
+}, "java.util.Hashtable");
+});
+Clazz_declarePackage ("com.stevesoft.pat");
+Clazz_load (["com.stevesoft.pat.PatternSub"], "com.stevesoft.pat.DotMulti", null, function () {
+c$ = Clazz_decorateAsClass (function () {
+this.fewestMatches = null;
+this.mostMatches = null;
+this.matchFewest = false;
+this.src = null;
+this.srclength = 0;
+this.dotDoesntMatchCR = true;
+Clazz_instantialize (this, arguments);
+}, com.stevesoft.pat, "DotMulti", com.stevesoft.pat.PatternSub);
+Clazz_overrideMethod (c$, "minChars", 
+function () {
+return this.fewestMatches;
+});
+Clazz_overrideMethod (c$, "maxChars", 
+function () {
+return this.mostMatches;
+});
+Clazz_makeConstructor (c$, 
+function (a, b) {
+Clazz_superConstructor (this, com.stevesoft.pat.DotMulti, []);
+this.fewestMatches = a;
+this.mostMatches = b;
+}, "com.stevesoft.pat.patInt,com.stevesoft.pat.patInt");
+Clazz_overrideMethod (c$, "toString", 
+function () {
+return ".{" + this.fewestMatches + "," + this.mostMatches + "}" + (this.matchFewest ? "?" : "") + "(?# <= dot multi)" + this.nextString ();
+});
+Clazz_defineMethod (c$, "submatchInternal", 
+function (pos, pt) {
+if (pos < this.srclength) {
+if (this.dotDoesntMatchCR) {
+if (this.src.charAt (pos) != '\n') {
+return 1 + pos;
+}} else {
+return 1 + pos;
+}}return -1;
+}, "~N,com.stevesoft.pat.Pthings");
+Clazz_overrideMethod (c$, "matchInternal", 
+function (pos, pt) {
+var m = -1;
+var i = pos;
+this.src = pt.src;
+this.srclength = this.src.length ();
+this.dotDoesntMatchCR = pt.dotDoesntMatchCR;
+if (this.matchFewest) {
+var nMatches = 0;
+while (this.fewestMatches.intValue () > nMatches) {
+i = this.submatchInternal (i, pt);
+if (i < 0) {
+return -1;
+}nMatches++;
+}
+if (i < 0) {
+return -1;
+}var ii = this.nextMatch (i, pt);
+if (ii >= 0) {
+return ii;
+}if (!this.mostMatches.finite ()) {
+while (i >= 0) {
+i = this.submatchInternal (i, pt);
+if (i < 0) {
+return -1;
+}ii = this.nextMatch (i, pt);
+if (ii >= 0) {
+return ii;
+}}
+} else {
+while (i > 0) {
+i = this.submatchInternal (i, pt);
+if (i < 0) {
+return -1;
+}nMatches++;
+if (nMatches > this.mostMatches.intValue ()) {
+return -1;
+}ii = this.nextMatch (i, pt);
+if (ii >= 0) {
+return ii;
+}}
+}return -1;
+}var nMatches = 0;
+while (this.fewestMatches.intValue () > nMatches) {
+i = this.submatchInternal (i, pt);
+if (i >= 0) {
+nMatches++;
+} else {
+return -1;
+}}
+m = i;
+if (this.mostMatches.finite ()) {
+while (nMatches < this.mostMatches.intValue ()) {
+i = this.submatchInternal (i, pt);
+if (i >= 0) {
+m = i;
+nMatches++;
+} else {
+break;
+}}
+} else {
+while (true) {
+i = this.submatchInternal (i, pt);
+if (i >= 0) {
+m = i;
+nMatches++;
+} else {
+break;
+}}
+}while (m >= pos) {
+var r = this.nextMatch (m, pt);
+if (r >= 0) {
+return r;
+}m -= 1;
+nMatches--;
+if (nMatches < this.fewestMatches.intValue ()) {
+return -1;
+}}
+return -1;
+}, "~N,com.stevesoft.pat.Pthings");
+Clazz_overrideMethod (c$, "clone1", 
+function (h) {
+var dm =  new com.stevesoft.pat.DotMulti (this.fewestMatches, this.mostMatches);
+dm.matchFewest = this.matchFewest;
+return dm;
+}, "java.util.Hashtable");
+Clazz_defineStatics (c$,
+"step", 1,
+"idcount", 1);
+});
+Clazz_declarePackage ("com.stevesoft.pat");
+Clazz_load (["com.stevesoft.pat.Pattern"], "com.stevesoft.pat.End", ["com.stevesoft.pat.patInt"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.retIsEnd = false;
+Clazz_instantialize (this, arguments);
+}, com.stevesoft.pat, "End", com.stevesoft.pat.Pattern);
+Clazz_makeConstructor (c$, 
+function (b) {
+Clazz_superConstructor (this, com.stevesoft.pat.End, []);
+this.retIsEnd = b;
+}, "~B");
+Clazz_overrideMethod (c$, "matchInternal", 
+function (pos, pt) {
+if (this.retIsEnd && pt.mFlag && pos < pt.src.length ()) {
+if (pt.src.charAt (pos) == '\n') {
+return this.nextMatch (pos, pt);
+}}if (pt.src.length () == pos) {
+return this.nextMatch (pos, pt);
+} else if (pos < pt.src.length ()) {
+pt.src.charAt (pos);
+}return -1;
+}, "~N,com.stevesoft.pat.Pthings");
+Clazz_overrideMethod (c$, "toString", 
+function () {
+if (this.retIsEnd) {
+return "$";
+} else {
+return "\\Z";
+}});
+Clazz_overrideMethod (c$, "maxChars", 
+function () {
+return  new com.stevesoft.pat.patInt (1);
+});
+Clazz_overrideMethod (c$, "clone1", 
+function (h) {
+return  new com.stevesoft.pat.End (this.retIsEnd);
+}, "java.util.Hashtable");
+});
+Clazz_declarePackage ("com.stevesoft.pat");
+Clazz_load (["com.stevesoft.pat.PatternSub"], "com.stevesoft.pat.FastMulti", ["com.stevesoft.pat.RegSyntaxError", "$.patInt"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.fewestMatches = null;
+this.mostMatches = null;
+this.matchFewest = false;
+this.step = -1;
+Clazz_instantialize (this, arguments);
+}, com.stevesoft.pat, "FastMulti", com.stevesoft.pat.PatternSub);
+Clazz_overrideMethod (c$, "minChars", 
+function () {
+return this.sub.countMinChars ().mul (this.fewestMatches);
+});
+Clazz_overrideMethod (c$, "maxChars", 
+function () {
+return this.sub.countMaxChars ().mul (this.mostMatches);
+});
+Clazz_makeConstructor (c$, 
+function (a, b, p) {
+Clazz_superConstructor (this, com.stevesoft.pat.FastMulti, []);
+if (p == null) {
+com.stevesoft.pat.RegSyntaxError.endItAll ("Null length pattern followed by *, +, or other Multi.");
+}this.fewestMatches = a;
+this.mostMatches = b;
+this.sub = p;
+this.step = p.countMinChars ().intValue ();
+this.sub.setParent (null);
+}, "com.stevesoft.pat.patInt,com.stevesoft.pat.patInt,com.stevesoft.pat.Pattern");
+Clazz_defineMethod (c$, "toString", 
+function () {
+return this.sub.toString () + "{" + this.fewestMatches + "," + this.mostMatches + "}" + (this.matchFewest ? "?" : "") + "(?# <= fast multi)" + this.nextString ();
+});
+Clazz_defineMethod (c$, "matchInternal", 
+function (pos, pt) {
+var m = -1;
+var i = pos;
+var endstr = pt.src.length () - this.step;
+var matches =  new com.stevesoft.pat.patInt (0);
+if (this.matchFewest) {
+if (this.fewestMatches.lessEq (matches)) {
+var ii = this.nextMatch (i, pt);
+if (ii >= 0) {
+return ii;
+}}while (i >= 0 && i <= endstr) {
+i = this.sub.matchInternal (i, pt);
+if (i >= 0) {
+matches.inc ();
+if (this.fewestMatches.lessEq (matches)) {
+var ii = this.nextMatch (i, pt);
+if (ii >= 0) {
+return ii;
+}}if (matches.equals (this.mostMatches)) {
+return -1;
+}}}
+return -1;
+}var nMatches = 0;
+while (this.fewestMatches.intValue () > nMatches) {
+i = this.sub.matchInternal (i, pt);
+if (i >= 0) {
+nMatches++;
+} else {
+return -1;
+}}
+m = i;
+if (this.mostMatches.finite ()) {
+while (nMatches < this.mostMatches.intValue ()) {
+i = this.sub.matchInternal (i, pt);
+if (i >= 0) {
+m = i;
+nMatches++;
+} else {
+break;
+}}
+} else {
+while (true) {
+i = this.sub.matchInternal (i, pt);
+if (i >= 0) {
+m = i;
+nMatches++;
+} else {
+break;
+}}
+}while (m >= pos) {
+var r = this.nextMatch (m, pt);
+if (r >= 0) {
+return r;
+}m -= this.step;
+nMatches--;
+if (nMatches < this.fewestMatches.intValue ()) {
+return -1;
+}}
+return -1;
+}, "~N,com.stevesoft.pat.Pthings");
+Clazz_overrideMethod (c$, "clone1", 
+function (h) {
+try {
+var fm =  new com.stevesoft.pat.FastMulti (this.fewestMatches, this.mostMatches, this.sub.clone (h));
+fm.matchFewest = this.matchFewest;
+return fm;
+} catch (rs) {
+if (Clazz_exceptionOf (rs, com.stevesoft.pat.RegSyntax)) {
+return null;
+} else {
+throw rs;
+}
+}
+}, "java.util.Hashtable");
+});
+Clazz_declarePackage ("com.stevesoft.pat");
+Clazz_load (["java.lang.Error"], "com.stevesoft.pat.RegSyntaxError", ["com.stevesoft.pat.RegSyntax"], function () {
+c$ = Clazz_declareType (com.stevesoft.pat, "RegSyntaxError", Error);
+Clazz_makeConstructor (c$, 
+function () {
+Clazz_superConstructor (this, com.stevesoft.pat.RegSyntaxError, []);
+});
+c$.endItAll = Clazz_defineMethod (c$, "endItAll", 
+function (s) {
+if (com.stevesoft.pat.RegSyntaxError.RegSyntaxErrorEnabled) {
+throw  new com.stevesoft.pat.RegSyntaxError (s);
+}throw  new com.stevesoft.pat.RegSyntax (s);
+}, "~S");
+Clazz_defineStatics (c$,
+"RegSyntaxErrorEnabled", false);
+});
+Clazz_declarePackage ("com.stevesoft.pat");
+Clazz_load (["java.lang.Exception"], "com.stevesoft.pat.RegSyntax", null, function () {
+c$ = Clazz_declareType (com.stevesoft.pat, "RegSyntax", Exception);
+Clazz_makeConstructor (c$, 
+function () {
+Clazz_superConstructor (this, com.stevesoft.pat.RegSyntax, []);
+});
+});
+Clazz_declarePackage ("com.stevesoft.pat");
+Clazz_load (["com.stevesoft.pat.Pattern"], "com.stevesoft.pat.Group", ["com.stevesoft.pat.patInt"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.op = '\0';
+this.cl = '\0';
+Clazz_instantialize (this, arguments);
+}, com.stevesoft.pat, "Group", com.stevesoft.pat.Pattern);
+Clazz_makeConstructor (c$, 
+function (opi, cli) {
+Clazz_superConstructor (this, com.stevesoft.pat.Group, []);
+this.op = opi;
+this.cl = cli;
+}, "~S,~S");
+Clazz_overrideMethod (c$, "matchInternal", 
+function (pos, pt) {
+var i;
+var count = 1;
+if (pos < pt.src.length ()) {
+if (!this.Masked (pos, pt) && pt.src.charAt (pos) != this.op) {
+return -1;
+}}for (i = pos + 1; i < pt.src.length (); i++) {
+var c = pt.src.charAt (i);
+var b = !this.Masked (i, pt);
+if (b && c == '\\') {
+i++;
+} else {
+if (b && c == this.cl) {
+count--;
+}if (count == 0) {
+return this.nextMatch (i + 1, pt);
+}if (b && c == this.op) {
+count++;
+}}}
+return -1;
+}, "~N,com.stevesoft.pat.Pthings");
+Clazz_overrideMethod (c$, "toString", 
+function () {
+return "(?@" + this.op + this.cl + ")" + this.nextString ();
+});
+Clazz_overrideMethod (c$, "minChars", 
+function () {
+return  new com.stevesoft.pat.patInt (2);
+});
+Clazz_overrideMethod (c$, "clone1", 
+function (h) {
+return  new com.stevesoft.pat.Group (this.op, this.cl);
+}, "java.util.Hashtable");
+});
+Clazz_declarePackage ("com.stevesoft.pat");
+Clazz_load (["com.stevesoft.pat.PatternSub"], "com.stevesoft.pat.Multi", ["com.stevesoft.pat.Multi_stage2"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.a = null;
+this.b = null;
+this.p = null;
+this.st2 = null;
+this.matchFewest = false;
+Clazz_instantialize (this, arguments);
+}, com.stevesoft.pat, "Multi", com.stevesoft.pat.PatternSub);
+Clazz_overrideMethod (c$, "minChars", 
+function () {
+return this.a.mul (this.p.countMinChars ());
+});
+Clazz_overrideMethod (c$, "maxChars", 
+function () {
+return this.b.mul (this.p.countMaxChars ());
+});
+Clazz_makeConstructor (c$, 
+function (a, b, p) {
+Clazz_superConstructor (this, com.stevesoft.pat.Multi, []);
+this.a = a;
+this.b = b;
+this.p = p;
+this.st2 =  new com.stevesoft.pat.Multi_stage2 (a, b, p);
+this.st2.parent = this;
+this.sub = this.st2.sub;
+}, "com.stevesoft.pat.patInt,com.stevesoft.pat.patInt,com.stevesoft.pat.Pattern");
+Clazz_overrideMethod (c$, "toString", 
+function () {
+this.st2.matchFewest = this.matchFewest;
+return this.st2.toString ();
+});
+Clazz_overrideMethod (c$, "matchInternal", 
+function (pos, pt) {
+try {
+this.st2 =  new com.stevesoft.pat.Multi_stage2 (this.a, this.b, this.p);
+} catch (r__) {
+if (Clazz_exceptionOf (r__, com.stevesoft.pat.RegSyntax)) {
+} else {
+throw r__;
+}
+}
+this.st2.matchFewest = this.matchFewest;
+this.st2.parent = this;
+return this.st2.matchInternal (pos, pt);
+}, "~N,com.stevesoft.pat.Pthings");
+Clazz_overrideMethod (c$, "clone1", 
+function (h) {
+try {
+var m =  new com.stevesoft.pat.Multi (this.a, this.b, (this.p).clone (h));
+m.matchFewest = this.matchFewest;
+return m;
+} catch (rs) {
+if (Clazz_exceptionOf (rs, com.stevesoft.pat.RegSyntax)) {
+return null;
+} else {
+throw rs;
+}
+}
+}, "java.util.Hashtable");
+});
+Clazz_declarePackage ("com.stevesoft.pat");
+Clazz_load (["com.stevesoft.pat.PatternSub"], "com.stevesoft.pat.Multi_stage2", ["com.stevesoft.pat.RegSyntaxError", "$.patInt"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.nextRet = null;
+this.count = null;
+this.matchMin = null;
+this.matchMax = null;
+this.matchFewest = false;
+this.pos_old = -1;
+Clazz_instantialize (this, arguments);
+}, com.stevesoft.pat, "Multi_stage2", com.stevesoft.pat.PatternSub);
+Clazz_defineMethod (c$, "toString", 
+function () {
+var ret = "";
+ret += this.sub.toString ();
+ret += "{" + this.matchMin + "," + this.matchMax + "}";
+if (this.matchFewest) {
+ret += "?";
+}ret += this.parent.nextString ();
+return ret;
+});
+Clazz_makeConstructor (c$, 
+function (a, b, p) {
+Clazz_superConstructor (this, com.stevesoft.pat.Multi_stage2, []);
+if (p == null) {
+com.stevesoft.pat.RegSyntaxError.endItAll ("Multiple match of Null pattern requested.");
+}this.sub = p;
+this.nextRet = this;
+this.sub.setParent (this);
+this.matchMin = a;
+this.matchMax = b;
+this.count =  new com.stevesoft.pat.patInt (0);
+if (!a.lessEq (b)) {
+com.stevesoft.pat.RegSyntaxError.endItAll ("Bad Multi Args: " + a + ">" + b);
+}var i =  new com.stevesoft.pat.patInt (-1);
+if (a.lessEq (i)) {
+com.stevesoft.pat.RegSyntaxError.endItAll ("Bad Multi Args: " + a + "< 0");
+}}, "com.stevesoft.pat.patInt,com.stevesoft.pat.patInt,com.stevesoft.pat.Pattern");
+Clazz_defineMethod (c$, "getNext", 
+function () {
+return this.nextRet;
+});
+Clazz_overrideMethod (c$, "matchInternal", 
+function (pos, pt) {
+this.sub.setParent (this);
+var canUse = -1;
+if (this.pos_old >= 0 && pos == this.pos_old) {
+return -1;
+}this.pos_old = pos;
+if (this.matchMin.lessEq (this.count)) {
+canUse = pos;
+}if (!this.count.lessEq (this.matchMax) || pos > pt.src.length ()) {
+return -1;
+}if ((this.matchFewest || this.count.equals (this.matchMax)) && canUse >= 0) {
+var n = Clazz_superCall (this, com.stevesoft.pat.Multi_stage2, "getNext", []);
+if (n == null) {
+return canUse;
+}var ret = this.testMatch (n, pos, pt);
+if (ret >= 0) {
+return ret;
+} else {
+canUse = -1;
+}}this.count.inc ();
+try {
+if (this.count.lessEq (this.matchMax)) {
+var r = this.testMatch (this.sub, pos, pt);
+if (r >= 0) {
+return r;
+}}} finally {
+this.count.dec ();
+}
+if (!this.matchFewest && canUse >= 0) {
+var n = Clazz_superCall (this, com.stevesoft.pat.Multi_stage2, "getNext", []);
+if (n == null) {
+return canUse;
+}var ret = this.testMatch (n, pos, pt);
+return ret;
+} else {
+return canUse;
+}}, "~N,com.stevesoft.pat.Pthings");
+Clazz_overrideMethod (c$, "clone1", 
+function (h) {
+try {
+var m =  new com.stevesoft.pat.Multi_stage2 (this.matchMin, this.matchMax, this.sub.clone (h));
+m.matchFewest = this.matchFewest;
+return m;
+} catch (rs) {
+if (Clazz_exceptionOf (rs, com.stevesoft.pat.RegSyntax)) {
+return null;
+} else {
+throw rs;
+}
+}
+}, "java.util.Hashtable");
+});
+Clazz_declarePackage ("com.stevesoft.pat");
+Clazz_load (["com.stevesoft.pat.Pattern"], "com.stevesoft.pat.NullPattern", ["com.stevesoft.pat.patInt"], function () {
+c$ = Clazz_declareType (com.stevesoft.pat, "NullPattern", com.stevesoft.pat.Pattern);
+Clazz_overrideMethod (c$, "toString", 
+function () {
+return this.nextString ();
+});
+Clazz_overrideMethod (c$, "matchInternal", 
+function (p, pt) {
+return this.nextMatch (p, pt);
+}, "~N,com.stevesoft.pat.Pthings");
+Clazz_overrideMethod (c$, "maxChars", 
+function () {
+return  new com.stevesoft.pat.patInt (0);
+});
+Clazz_overrideMethod (c$, "clone1", 
+function (h) {
+return  new com.stevesoft.pat.NullPattern ();
+}, "java.util.Hashtable");
+});
+Clazz_declarePackage ("com.stevesoft.pat");
+Clazz_load (["com.stevesoft.pat.Or", "$.SubMark"], "com.stevesoft.pat.OrMark", null, function () {
+c$ = Clazz_decorateAsClass (function () {
+this.sm = null;
+this.id = 0;
+Clazz_instantialize (this, arguments);
+}, com.stevesoft.pat, "OrMark", com.stevesoft.pat.Or);
+Clazz_prepareFields (c$, function () {
+this.sm =  new com.stevesoft.pat.SubMark ();
+});
+Clazz_makeConstructor (c$, 
+function (i) {
+Clazz_superConstructor (this, com.stevesoft.pat.OrMark, []);
+this.sm.om = this;
+this.id = i;
+}, "~N");
+Clazz_overrideMethod (c$, "leftForm", 
+function () {
+return "(";
+});
+Clazz_defineMethod (c$, "getNext", 
+function () {
+return this.sm;
+});
+Clazz_defineMethod (c$, "matchInternal", 
+function (pos, pt) {
+this.sm.next = Clazz_superCall (this, com.stevesoft.pat.OrMark, "getNext", []);
+if (pt.marks == null) {
+var n2 = 2 * pt.nMarks + 2;
+pt.marks =  Clazz_newIntArray (n2, 0);
+for (var i = 0; i < n2; i++) {
+pt.marks[i] = -1;
+}
+}pt.marks[this.id] = pos;
+var ret = Clazz_superCall (this, com.stevesoft.pat.OrMark, "matchInternal", [pos, pt]);
+if (ret < 0) {
+pt.marks[this.id] = -1;
+} else if (pt.marks[this.id] > pt.marks[this.id + pt.nMarks]) {
+var swap = pt.marks[this.id];
+pt.marks[this.id] = pt.marks[this.id + pt.nMarks] + 1;
+pt.marks[this.id + pt.nMarks] = swap + 1;
+}return ret;
+}, "~N,com.stevesoft.pat.Pthings");
+Clazz_overrideMethod (c$, "clone1", 
+function (h) {
+var om =  new com.stevesoft.pat.OrMark (this.id);
+h.put (om, om);
+h.put (this, om);
+for (var i = 0; i < this.v.size (); i++) {
+om.v.addElement ((this.v.elementAt (i)).clone (h));
+}
+return om;
+}, "java.util.Hashtable");
+});
+Clazz_declarePackage ("com.stevesoft.pat");
+Clazz_load (["com.stevesoft.pat.Pattern"], "com.stevesoft.pat.SubMark", null, function () {
+c$ = Clazz_decorateAsClass (function () {
+this.end_pos = 0;
+this.start_pos = 0;
+this.om = null;
+Clazz_instantialize (this, arguments);
+}, com.stevesoft.pat, "SubMark", com.stevesoft.pat.Pattern);
+Clazz_overrideMethod (c$, "toString", 
+function () {
+return "";
+});
+Clazz_overrideMethod (c$, "matchInternal", 
+function (i, pt) {
+pt.marks[this.om.id + pt.nMarks] = i;
+var ret = this.nextMatch (i, pt);
+if (ret < 0) {
+pt.marks[this.om.id + pt.nMarks] = -1;
+}return ret;
+}, "~N,com.stevesoft.pat.Pthings");
+});
+Clazz_declarePackage ("com.stevesoft.pat");
+Clazz_load (null, "com.stevesoft.pat.Prop", ["com.stevesoft.pat.Bits"], function () {
+c$ = Clazz_declareType (com.stevesoft.pat, "Prop");
+c$.isDecimalDigit = Clazz_defineMethod (c$, "isDecimalDigit", 
+function (c) {
+if (com.stevesoft.pat.Bits.decimal_digit == null) {
+com.stevesoft.pat.Bits.decimal_digit_f ();
+}return com.stevesoft.pat.Bits.decimal_digit.get (c.charCodeAt (0));
+}, "~S");
+c$.isAlphabetic = Clazz_defineMethod (c$, "isAlphabetic", 
+function (c) {
+if (com.stevesoft.pat.Bits.letter == null) {
+com.stevesoft.pat.Bits.letter_f ();
+}return com.stevesoft.pat.Bits.letter.get (c.charCodeAt (0));
+}, "~S");
+c$.isMath = Clazz_defineMethod (c$, "isMath", 
+function (c) {
+if (com.stevesoft.pat.Bits.math == null) {
+com.stevesoft.pat.Bits.math_f ();
+}return com.stevesoft.pat.Bits.math.get (c.charCodeAt (0));
+}, "~S");
+c$.isCurrency = Clazz_defineMethod (c$, "isCurrency", 
+function (c) {
+if (com.stevesoft.pat.Bits.currency == null) {
+com.stevesoft.pat.Bits.currency_f ();
+}return com.stevesoft.pat.Bits.currency.get (c.charCodeAt (0));
+}, "~S");
+c$.isWhite = Clazz_defineMethod (c$, "isWhite", 
+function (c) {
+if (com.stevesoft.pat.Bits.white == null) {
+com.stevesoft.pat.Bits.white_f ();
+}return com.stevesoft.pat.Bits.white.get (c.charCodeAt (0));
+}, "~S");
+c$.isPunct = Clazz_defineMethod (c$, "isPunct", 
+function (c) {
+if (com.stevesoft.pat.Bits.punct == null) {
+com.stevesoft.pat.Bits.punct_f ();
+}return com.stevesoft.pat.Bits.punct.get (c.charCodeAt (0));
+}, "~S");
+});
+Clazz_declarePackage ("com.stevesoft.pat");
+c$ = Clazz_decorateAsClass (function () {
+this.carray = null;
+Clazz_instantialize (this, arguments);
+}, com.stevesoft.pat, "Bits");
+Clazz_makeConstructor (c$, 
+function (carray) {
+this.carray = carray;
+}, "~A");
+Clazz_defineMethod (c$, "get", 
+function (i) {
+return ((this.carray[i >> 4]).charCodeAt (0) & (1 << (i & 15))) != 0;
+}, "~N");
+Clazz_defineMethod (c$, "set", 
+function (i, b) {
+if (b) {
+this.carray[i >> 4] = String.fromCharCode ((this.carray[i >> 4]).charCodeAt (0) | ((String.fromCharCode (1)).charCodeAt (0) << (i & 15)));
+} else {
+this.carray[i >> 4] = String.fromCharCode ((this.carray[i >> 4]).charCodeAt (0) & (String.fromCharCode (~(1 << (i & 15)))).charCodeAt (0));
+}}, "~N,~B");
+c$.upper_f = Clazz_defineMethod (c$, "upper_f", 
+function () {
+var data =  Clazz_newCharArray (4159, '\0');
+com.stevesoft.pat.Bits.upper =  new com.stevesoft.pat.Bits (data);
+data[4] = String.fromCharCode (0xfffe);
+data[5] = String.fromCharCode (0x07ff);
+data[12] = String.fromCharCode (0xffff);
+data[13] = String.fromCharCode (0x7f7f);
+data[16] = String.fromCharCode (0x5555);
+data[17] = String.fromCharCode (0x5555);
+data[18] = String.fromCharCode (0x5555);
+data[19] = String.fromCharCode (0xaa55);
+data[20] = String.fromCharCode (0x54aa);
+data[21] = String.fromCharCode (0x5555);
+data[22] = String.fromCharCode (0x5555);
+data[23] = String.fromCharCode (0x2b55);
+data[24] = String.fromCharCode (0xced6);
+data[25] = String.fromCharCode (0xb1db);
+data[26] = String.fromCharCode (0xd2d5);
+data[27] = String.fromCharCode (0x11ae);
+data[28] = String.fromCharCode (0xa490);
+data[29] = String.fromCharCode (0x4aaa);
+data[30] = String.fromCharCode (0x5555);
+data[31] = String.fromCharCode (0x5412);
+data[32] = String.fromCharCode (0x5555);
+data[33] = 'U';
+data[56] = String.fromCharCode (0xd740);
+data[57] = String.fromCharCode (0xfffe);
+data[58] = String.fromCharCode (0x0ffb);
+data[61] = String.fromCharCode (0x541c);
+data[62] = String.fromCharCode (0x5555);
+data[64] = String.fromCharCode (0xdffe);
+data[65] = String.fromCharCode (0xffff);
+data[66] = String.fromCharCode (0xffff);
+data[70] = String.fromCharCode (0x5555);
+data[71] = String.fromCharCode (0x5555);
+data[72] = String.fromCharCode (0x0001);
+data[73] = String.fromCharCode (0x5555);
+data[74] = String.fromCharCode (0x5555);
+data[75] = String.fromCharCode (0x5555);
+data[76] = String.fromCharCode (0x088a);
+data[77] = String.fromCharCode (0x5555);
+data[78] = String.fromCharCode (0x4555);
+data[79] = String.fromCharCode (0x0115);
+data[83] = String.fromCharCode (0xfffe);
+data[84] = String.fromCharCode (0xffff);
+data[85] = String.fromCharCode (0x007f);
+data[266] = String.fromCharCode (0xffff);
+data[267] = String.fromCharCode (0xffff);
+data[268] = String.fromCharCode (0x003f);
+data[480] = String.fromCharCode (0x5555);
+data[481] = String.fromCharCode (0x5555);
+data[482] = String.fromCharCode (0x5555);
+data[483] = String.fromCharCode (0x5555);
+data[484] = String.fromCharCode (0x5555);
+data[485] = String.fromCharCode (0x5555);
+data[486] = String.fromCharCode (0x5555);
+data[487] = String.fromCharCode (0x5555);
+data[488] = String.fromCharCode (0x5555);
+data[489] = String.fromCharCode (0x0015);
+data[490] = String.fromCharCode (0x5555);
+data[491] = String.fromCharCode (0x5555);
+data[492] = String.fromCharCode (0x5555);
+data[493] = String.fromCharCode (0x5555);
+data[494] = String.fromCharCode (0x5555);
+data[495] = String.fromCharCode (0x0155);
+data[496] = String.fromCharCode (0xff00);
+data[497] = String.fromCharCode (0x3f00);
+data[498] = String.fromCharCode (0xff00);
+data[499] = String.fromCharCode (0xff00);
+data[500] = String.fromCharCode (0x3f00);
+data[501] = String.fromCharCode (0xaa00);
+data[502] = String.fromCharCode (0xff00);
+data[504] = String.fromCharCode (0xff00);
+data[505] = String.fromCharCode (0xff00);
+data[506] = String.fromCharCode (0xff00);
+data[507] = String.fromCharCode (0x5f00);
+data[508] = String.fromCharCode (0x1f00);
+data[509] = String.fromCharCode (0x0f00);
+data[510] = String.fromCharCode (0x1f00);
+data[511] = String.fromCharCode (0x1f00);
+data[528] = String.fromCharCode (0x3884);
+data[529] = String.fromCharCode (0x3f27);
+data[530] = String.fromCharCode (0x3d50);
+data[531] = String.fromCharCode (0x000b);
+data[4082] = String.fromCharCode (0xfffe);
+data[4083] = String.fromCharCode (0x07ff);
+data[4100] = String.fromCharCode (0xfffe);
+data[4101] = String.fromCharCode (0x07ff);
+data[4108] = String.fromCharCode (0xffff);
+data[4109] = String.fromCharCode (0x7f7f);
+data[4112] = String.fromCharCode (0x5555);
+data[4113] = String.fromCharCode (0x5555);
+data[4114] = String.fromCharCode (0x5555);
+data[4115] = String.fromCharCode (0xaa55);
+data[4116] = String.fromCharCode (0x54aa);
+data[4117] = String.fromCharCode (0x5555);
+data[4118] = String.fromCharCode (0x5555);
+data[4119] = String.fromCharCode (0x2b55);
+data[4120] = String.fromCharCode (0xced6);
+data[4121] = String.fromCharCode (0xb1db);
+data[4122] = String.fromCharCode (0xd2d5);
+data[4123] = String.fromCharCode (0x11ae);
+data[4124] = String.fromCharCode (0xa490);
+data[4125] = String.fromCharCode (0x4aaa);
+data[4126] = String.fromCharCode (0x5555);
+data[4127] = String.fromCharCode (0x5412);
+data[4128] = String.fromCharCode (0x5555);
+data[4129] = 'U';
+data[4152] = String.fromCharCode (0xd740);
+data[4153] = String.fromCharCode (0xfffe);
+data[4154] = String.fromCharCode (0x0ffb);
+data[4157] = String.fromCharCode (0x541c);
+data[4158] = 'U';
+});
+c$.lower_f = Clazz_defineMethod (c$, "lower_f", 
+function () {
+var data =  Clazz_newCharArray (4159, '\0');
+com.stevesoft.pat.Bits.lower =  new com.stevesoft.pat.Bits (data);
+data[6] = String.fromCharCode (0xfffe);
+data[7] = String.fromCharCode (0x07ff);
+data[10] = String.fromCharCode (0x0400);
+data[11] = String.fromCharCode (0x0420);
+data[13] = String.fromCharCode (0x8000);
+data[14] = String.fromCharCode (0xffff);
+data[15] = String.fromCharCode (0xff7f);
+data[16] = String.fromCharCode (0xaaaa);
+data[17] = String.fromCharCode (0xaaaa);
+data[18] = String.fromCharCode (0xaaaa);
+data[19] = String.fromCharCode (0x55aa);
+data[20] = String.fromCharCode (0xab55);
+data[21] = String.fromCharCode (0xaaaa);
+data[22] = String.fromCharCode (0xaaaa);
+data[23] = String.fromCharCode (0xd4aa);
+data[24] = String.fromCharCode (0x3129);
+data[25] = String.fromCharCode (0x4e24);
+data[26] = String.fromCharCode (0x292a);
+data[27] = String.fromCharCode (0x2651);
+data[28] = String.fromCharCode (0x5240);
+data[29] = String.fromCharCode (0xb555);
+data[30] = String.fromCharCode (0xaaaa);
+data[31] = String.fromCharCode (0xa829);
+data[32] = String.fromCharCode (0xaaaa);
+data[33] = String.fromCharCode (0x00aa);
+data[37] = String.fromCharCode (0xffff);
+data[38] = String.fromCharCode (0xffff);
+data[39] = String.fromCharCode (0xffff);
+data[40] = String.fromCharCode (0xffff);
+data[41] = String.fromCharCode (0xffff);
+data[42] = String.fromCharCode (0x01ff);
+data[57] = String.fromCharCode (0x0001);
+data[58] = String.fromCharCode (0xf000);
+data[59] = String.fromCharCode (0xffff);
+data[60] = String.fromCharCode (0x7fff);
+data[61] = 'c';
+data[62] = String.fromCharCode (0xaaa8);
+data[63] = String.fromCharCode (0x0007);
+data[67] = String.fromCharCode (0xffff);
+data[68] = String.fromCharCode (0xffff);
+data[69] = String.fromCharCode (0xdffe);
+data[70] = String.fromCharCode (0xaaaa);
+data[71] = String.fromCharCode (0xaaaa);
+data[72] = String.fromCharCode (0x0002);
+data[73] = String.fromCharCode (0xaaaa);
+data[74] = String.fromCharCode (0xaaaa);
+data[75] = String.fromCharCode (0xaaaa);
+data[76] = String.fromCharCode (0x1114);
+data[77] = String.fromCharCode (0xaaaa);
+data[78] = String.fromCharCode (0x8aaa);
+data[79] = String.fromCharCode (0x022a);
+data[86] = String.fromCharCode (0xfffe);
+data[87] = String.fromCharCode (0xffff);
+data[88] = String.fromCharCode (0x00ff);
+data[269] = String.fromCharCode (0xffff);
+data[270] = String.fromCharCode (0xffff);
+data[271] = String.fromCharCode (0x007f);
+data[480] = String.fromCharCode (0xaaaa);
+data[481] = String.fromCharCode (0xaaaa);
+data[482] = String.fromCharCode (0xaaaa);
+data[483] = String.fromCharCode (0xaaaa);
+data[484] = String.fromCharCode (0xaaaa);
+data[485] = String.fromCharCode (0xaaaa);
+data[486] = String.fromCharCode (0xaaaa);
+data[487] = String.fromCharCode (0xaaaa);
+data[488] = String.fromCharCode (0xaaaa);
+data[489] = String.fromCharCode (0x0fea);
+data[490] = String.fromCharCode (0xaaaa);
+data[491] = String.fromCharCode (0xaaaa);
+data[492] = String.fromCharCode (0xaaaa);
+data[493] = String.fromCharCode (0xaaaa);
+data[494] = String.fromCharCode (0xaaaa);
+data[495] = String.fromCharCode (0x02aa);
+data[496] = String.fromCharCode (0x00ff);
+data[497] = String.fromCharCode (0x003f);
+data[498] = String.fromCharCode (0x00ff);
+data[499] = String.fromCharCode (0x00ff);
+data[500] = String.fromCharCode (0x003f);
+data[501] = String.fromCharCode (0x00ff);
+data[502] = String.fromCharCode (0x00ff);
+data[503] = String.fromCharCode (0x3fff);
+data[504] = String.fromCharCode (0x00ff);
+data[505] = String.fromCharCode (0x00ff);
+data[506] = String.fromCharCode (0x00ff);
+data[507] = String.fromCharCode (0x00df);
+data[508] = String.fromCharCode (0x00dc);
+data[509] = String.fromCharCode (0x00cf);
+data[510] = String.fromCharCode (0x00ff);
+data[511] = String.fromCharCode (0x00dc);
+data[519] = String.fromCharCode (0x8000);
+data[528] = String.fromCharCode (0xc400);
+data[529] = String.fromCharCode (0x0008);
+data[530] = String.fromCharCode (0xc000);
+data[531] = String.fromCharCode (0x0010);
+data[4016] = String.fromCharCode (0x007f);
+data[4017] = String.fromCharCode (0x00f8);
+data[4084] = String.fromCharCode (0xfffe);
+data[4085] = String.fromCharCode (0x07ff);
+data[4102] = String.fromCharCode (0xfffe);
+data[4103] = String.fromCharCode (0x07ff);
+data[4106] = String.fromCharCode (0x0400);
+data[4107] = String.fromCharCode (0x0420);
+data[4109] = String.fromCharCode (0x8000);
+data[4110] = String.fromCharCode (0xffff);
+data[4111] = String.fromCharCode (0xff7f);
+data[4112] = String.fromCharCode (0xaaaa);
+data[4113] = String.fromCharCode (0xaaaa);
+data[4114] = String.fromCharCode (0xaaaa);
+data[4115] = String.fromCharCode (0x55aa);
+data[4116] = String.fromCharCode (0xab55);
+data[4117] = String.fromCharCode (0xaaaa);
+data[4118] = String.fromCharCode (0xaaaa);
+data[4119] = String.fromCharCode (0xd4aa);
+data[4120] = String.fromCharCode (0x3129);
+data[4121] = String.fromCharCode (0x4e24);
+data[4122] = String.fromCharCode (0x292a);
+data[4123] = String.fromCharCode (0x2651);
+data[4124] = String.fromCharCode (0x5240);
+data[4125] = String.fromCharCode (0xb555);
+data[4126] = String.fromCharCode (0xaaaa);
+data[4127] = String.fromCharCode (0xa829);
+data[4128] = String.fromCharCode (0xaaaa);
+data[4129] = String.fromCharCode (0x00aa);
+data[4133] = String.fromCharCode (0xffff);
+data[4134] = String.fromCharCode (0xffff);
+data[4135] = String.fromCharCode (0xffff);
+data[4136] = String.fromCharCode (0xffff);
+data[4137] = String.fromCharCode (0xffff);
+data[4138] = String.fromCharCode (0x01ff);
+data[4153] = String.fromCharCode (0x0001);
+data[4154] = String.fromCharCode (0xf000);
+data[4155] = String.fromCharCode (0xffff);
+data[4156] = String.fromCharCode (0x7fff);
+data[4157] = 'c';
+data[4158] = String.fromCharCode (0x00a8);
+});
+c$.title_f = Clazz_defineMethod (c$, "title_f", 
+function () {
+var data =  Clazz_newCharArray (4159, '\0');
+com.stevesoft.pat.Bits.title =  new com.stevesoft.pat.Bits (data);
+data[6] = String.fromCharCode (0xfffe);
+data[7] = String.fromCharCode (0x07ff);
+data[10] = String.fromCharCode (0x0400);
+data[11] = String.fromCharCode (0x0420);
+data[13] = String.fromCharCode (0x8000);
+data[14] = String.fromCharCode (0xffff);
+data[15] = String.fromCharCode (0xff7f);
+data[16] = String.fromCharCode (0xaaaa);
+data[17] = String.fromCharCode (0xaaaa);
+data[18] = String.fromCharCode (0xaaaa);
+data[19] = String.fromCharCode (0x55aa);
+data[20] = String.fromCharCode (0xab55);
+data[21] = String.fromCharCode (0xaaaa);
+data[22] = String.fromCharCode (0xaaaa);
+data[23] = String.fromCharCode (0xd4aa);
+data[24] = String.fromCharCode (0x3129);
+data[25] = String.fromCharCode (0x4e24);
+data[26] = String.fromCharCode (0x292a);
+data[27] = String.fromCharCode (0x2651);
+data[28] = String.fromCharCode (0x5240);
+data[29] = String.fromCharCode (0xb555);
+data[30] = String.fromCharCode (0xaaaa);
+data[31] = String.fromCharCode (0xa829);
+data[32] = String.fromCharCode (0xaaaa);
+data[33] = String.fromCharCode (0x00aa);
+data[37] = String.fromCharCode (0xffff);
+data[38] = String.fromCharCode (0xffff);
+data[39] = String.fromCharCode (0xffff);
+data[40] = String.fromCharCode (0xffff);
+data[41] = String.fromCharCode (0xffff);
+data[42] = String.fromCharCode (0x01ff);
+data[57] = String.fromCharCode (0x0001);
+data[58] = String.fromCharCode (0xf000);
+data[59] = String.fromCharCode (0xffff);
+data[60] = String.fromCharCode (0x7fff);
+data[61] = 'c';
+data[62] = String.fromCharCode (0xaaa8);
+data[63] = String.fromCharCode (0x0007);
+data[67] = String.fromCharCode (0xffff);
+data[68] = String.fromCharCode (0xffff);
+data[69] = String.fromCharCode (0xdffe);
+data[70] = String.fromCharCode (0xaaaa);
+data[71] = String.fromCharCode (0xaaaa);
+data[72] = String.fromCharCode (0x0002);
+data[73] = String.fromCharCode (0xaaaa);
+data[74] = String.fromCharCode (0xaaaa);
+data[75] = String.fromCharCode (0xaaaa);
+data[76] = String.fromCharCode (0x1114);
+data[77] = String.fromCharCode (0xaaaa);
+data[78] = String.fromCharCode (0x8aaa);
+data[79] = String.fromCharCode (0x022a);
+data[86] = String.fromCharCode (0xfffe);
+data[87] = String.fromCharCode (0xffff);
+data[88] = String.fromCharCode (0x00ff);
+data[269] = String.fromCharCode (0xffff);
+data[270] = String.fromCharCode (0xffff);
+data[271] = String.fromCharCode (0x007f);
+data[480] = String.fromCharCode (0xaaaa);
+data[481] = String.fromCharCode (0xaaaa);
+data[482] = String.fromCharCode (0xaaaa);
+data[483] = String.fromCharCode (0xaaaa);
+data[484] = String.fromCharCode (0xaaaa);
+data[485] = String.fromCharCode (0xaaaa);
+data[486] = String.fromCharCode (0xaaaa);
+data[487] = String.fromCharCode (0xaaaa);
+data[488] = String.fromCharCode (0xaaaa);
+data[489] = String.fromCharCode (0x0fea);
+data[490] = String.fromCharCode (0xaaaa);
+data[491] = String.fromCharCode (0xaaaa);
+data[492] = String.fromCharCode (0xaaaa);
+data[493] = String.fromCharCode (0xaaaa);
+data[494] = String.fromCharCode (0xaaaa);
+data[495] = String.fromCharCode (0x02aa);
+data[496] = String.fromCharCode (0x00ff);
+data[497] = String.fromCharCode (0x003f);
+data[498] = String.fromCharCode (0x00ff);
+data[499] = String.fromCharCode (0x00ff);
+data[500] = String.fromCharCode (0x003f);
+data[501] = String.fromCharCode (0x00ff);
+data[502] = String.fromCharCode (0x00ff);
+data[503] = String.fromCharCode (0x3fff);
+data[504] = String.fromCharCode (0x00ff);
+data[505] = String.fromCharCode (0x00ff);
+data[506] = String.fromCharCode (0x00ff);
+data[507] = String.fromCharCode (0x00df);
+data[508] = String.fromCharCode (0x00dc);
+data[509] = String.fromCharCode (0x00cf);
+data[510] = String.fromCharCode (0x00ff);
+data[511] = String.fromCharCode (0x00dc);
+data[519] = String.fromCharCode (0x8000);
+data[528] = String.fromCharCode (0xc400);
+data[529] = String.fromCharCode (0x0008);
+data[530] = String.fromCharCode (0xc000);
+data[531] = String.fromCharCode (0x0010);
+data[4016] = String.fromCharCode (0x007f);
+data[4017] = String.fromCharCode (0x00f8);
+data[4084] = String.fromCharCode (0xfffe);
+data[4085] = String.fromCharCode (0x07ff);
+data[4102] = String.fromCharCode (0xfffe);
+data[4103] = String.fromCharCode (0x07ff);
+data[4106] = String.fromCharCode (0x0400);
+data[4107] = String.fromCharCode (0x0420);
+data[4109] = String.fromCharCode (0x8000);
+data[4110] = String.fromCharCode (0xffff);
+data[4111] = String.fromCharCode (0xff7f);
+data[4112] = String.fromCharCode (0xaaaa);
+data[4113] = String.fromCharCode (0xaaaa);
+data[4114] = String.fromCharCode (0xaaaa);
+data[4115] = String.fromCharCode (0x55aa);
+data[4116] = String.fromCharCode (0xab55);
+data[4117] = String.fromCharCode (0xaaaa);
+data[4118] = String.fromCharCode (0xaaaa);
+data[4119] = String.fromCharCode (0xd4aa);
+data[4120] = String.fromCharCode (0x3129);
+data[4121] = String.fromCharCode (0x4e24);
+data[4122] = String.fromCharCode (0x292a);
+data[4123] = String.fromCharCode (0x2651);
+data[4124] = String.fromCharCode (0x5240);
+data[4125] = String.fromCharCode (0xb555);
+data[4126] = String.fromCharCode (0xaaaa);
+data[4127] = String.fromCharCode (0xa829);
+data[4128] = String.fromCharCode (0xaaaa);
+data[4129] = String.fromCharCode (0x00aa);
+data[4133] = String.fromCharCode (0xffff);
+data[4134] = String.fromCharCode (0xffff);
+data[4135] = String.fromCharCode (0xffff);
+data[4136] = String.fromCharCode (0xffff);
+data[4137] = String.fromCharCode (0xffff);
+data[4138] = String.fromCharCode (0x01ff);
+data[4153] = String.fromCharCode (0x0001);
+data[4154] = String.fromCharCode (0xf000);
+data[4155] = String.fromCharCode (0xffff);
+data[4156] = String.fromCharCode (0x7fff);
+data[4157] = 'c';
+data[4158] = String.fromCharCode (0x00a8);
+});
+c$.currency_f = Clazz_defineMethod (c$, "currency_f", 
+function () {
+var data =  Clazz_newCharArray (4159, '\0');
+com.stevesoft.pat.Bits.currency =  new com.stevesoft.pat.Bits (data);
+data[2] = String.fromCharCode (0x0010);
+data[10] = String.fromCharCode (0x003c);
+data[159] = String.fromCharCode (0x000c);
+data[227] = String.fromCharCode (0x8000);
+data[522] = String.fromCharCode (0x1fff);
+data[4070] = String.fromCharCode (0x0200);
+data[4080] = String.fromCharCode (0x0010);
+data[4094] = 'c';
+data[4098] = String.fromCharCode (0x0010);
+data[4106] = String.fromCharCode (0x003c);
+});
+c$.decimal_digit_f = Clazz_defineMethod (c$, "decimal_digit_f", 
+function () {
+var data =  Clazz_newCharArray (4159, '\0');
+com.stevesoft.pat.Bits.decimal_digit =  new com.stevesoft.pat.Bits (data);
+data[3] = String.fromCharCode (0x03ff);
+data[102] = String.fromCharCode (0x03ff);
+data[111] = String.fromCharCode (0x03ff);
+data[150] = String.fromCharCode (0xffc0);
+data[158] = String.fromCharCode (0xffc0);
+data[166] = String.fromCharCode (0xffc0);
+data[174] = String.fromCharCode (0xffc0);
+data[182] = String.fromCharCode (0xffc0);
+data[190] = String.fromCharCode (0xff80);
+data[198] = String.fromCharCode (0xffc0);
+data[206] = String.fromCharCode (0xffc0);
+data[214] = String.fromCharCode (0xffc0);
+data[229] = String.fromCharCode (0x03ff);
+data[237] = String.fromCharCode (0x03ff);
+data[242] = String.fromCharCode (0x03ff);
+data[4081] = String.fromCharCode (0x03ff);
+data[4099] = String.fromCharCode (0x03ff);
+});
+c$.math_f = Clazz_defineMethod (c$, "math_f", 
+function () {
+var data =  Clazz_newCharArray (4159, '\0');
+com.stevesoft.pat.Bits.math =  new com.stevesoft.pat.Bits (data);
+data[2] = String.fromCharCode (0x0800);
+data[3] = String.fromCharCode (0x7000);
+data[7] = String.fromCharCode (0x5000);
+data[10] = String.fromCharCode (0x1000);
+data[11] = String.fromCharCode (0x0002);
+data[13] = String.fromCharCode (0x0080);
+data[15] = String.fromCharCode (0x0080);
+data[516] = String.fromCharCode (0x0010);
+data[519] = String.fromCharCode (0x1c00);
+data[520] = String.fromCharCode (0x1c00);
+data[537] = String.fromCharCode (0x001f);
+data[541] = String.fromCharCode (0x0014);
+data[544] = String.fromCharCode (0xffff);
+data[545] = String.fromCharCode (0xffff);
+data[546] = String.fromCharCode (0xffff);
+data[547] = String.fromCharCode (0xffff);
+data[548] = String.fromCharCode (0xffff);
+data[549] = String.fromCharCode (0xffff);
+data[550] = String.fromCharCode (0xffff);
+data[551] = String.fromCharCode (0xffff);
+data[552] = String.fromCharCode (0xffff);
+data[553] = String.fromCharCode (0xffff);
+data[554] = String.fromCharCode (0xffff);
+data[555] = String.fromCharCode (0xffff);
+data[556] = String.fromCharCode (0xffff);
+data[557] = String.fromCharCode (0xffff);
+data[558] = String.fromCharCode (0xffff);
+data[559] = String.fromCharCode (0x0003);
+data[560] = String.fromCharCode (0x0f00);
+data[562] = String.fromCharCode (0x0003);
+data[4018] = String.fromCharCode (0x0200);
+data[4070] = 't';
+data[4080] = String.fromCharCode (0x0800);
+data[4081] = String.fromCharCode (0x7000);
+data[4085] = String.fromCharCode (0x5000);
+data[4094] = String.fromCharCode (0x1f04);
+data[4098] = String.fromCharCode (0x0800);
+data[4099] = String.fromCharCode (0x7000);
+data[4103] = String.fromCharCode (0x5000);
+data[4106] = String.fromCharCode (0x1000);
+data[4107] = String.fromCharCode (0x0002);
+data[4109] = String.fromCharCode (0x0080);
+data[4111] = String.fromCharCode (0x0080);
+});
+c$.letter_f = Clazz_defineMethod (c$, "letter_f", 
+function () {
+var data =  Clazz_newCharArray (4159, '\0');
+com.stevesoft.pat.Bits.letter =  new com.stevesoft.pat.Bits (data);
+data[4] = String.fromCharCode (0xfffe);
+data[5] = String.fromCharCode (0x07ff);
+data[6] = String.fromCharCode (0xfffe);
+data[7] = String.fromCharCode (0x07ff);
+data[10] = String.fromCharCode (0x0400);
+data[11] = String.fromCharCode (0x0420);
+data[12] = String.fromCharCode (0xffff);
+data[13] = String.fromCharCode (0xff7f);
+data[14] = String.fromCharCode (0xffff);
+data[15] = String.fromCharCode (0xff7f);
+data[16] = String.fromCharCode (0xffff);
+data[17] = String.fromCharCode (0xffff);
+data[18] = String.fromCharCode (0xffff);
+data[19] = String.fromCharCode (0xffff);
+data[20] = String.fromCharCode (0xffff);
+data[21] = String.fromCharCode (0xffff);
+data[22] = String.fromCharCode (0xffff);
+data[23] = String.fromCharCode (0xffff);
+data[24] = String.fromCharCode (0xffff);
+data[25] = String.fromCharCode (0xffff);
+data[26] = String.fromCharCode (0xffff);
+data[27] = String.fromCharCode (0xffff);
+data[28] = String.fromCharCode (0xffff);
+data[29] = String.fromCharCode (0xffff);
+data[30] = String.fromCharCode (0xffff);
+data[31] = String.fromCharCode (0xfc3f);
+data[32] = String.fromCharCode (0xffff);
+data[33] = String.fromCharCode (0x00ff);
+data[37] = String.fromCharCode (0xffff);
+data[38] = String.fromCharCode (0xffff);
+data[39] = String.fromCharCode (0xffff);
+data[40] = String.fromCharCode (0xffff);
+data[41] = String.fromCharCode (0xffff);
+data[42] = String.fromCharCode (0x01ff);
+data[43] = String.fromCharCode (0xf9ff);
+data[44] = String.fromCharCode (0x0003);
+data[45] = String.fromCharCode (0x0003);
+data[46] = String.fromCharCode (0x001f);
+data[55] = String.fromCharCode (0x0400);
+data[56] = String.fromCharCode (0xd740);
+data[57] = String.fromCharCode (0xffff);
+data[58] = String.fromCharCode (0xfffb);
+data[59] = String.fromCharCode (0xffff);
+data[60] = String.fromCharCode (0x7fff);
+data[61] = String.fromCharCode (0x547f);
+data[62] = String.fromCharCode (0xfffd);
+data[63] = String.fromCharCode (0x000f);
+data[64] = String.fromCharCode (0xdffe);
+data[65] = String.fromCharCode (0xffff);
+data[66] = String.fromCharCode (0xffff);
+data[67] = String.fromCharCode (0xffff);
+data[68] = String.fromCharCode (0xffff);
+data[69] = String.fromCharCode (0xdffe);
+data[70] = String.fromCharCode (0xffff);
+data[71] = String.fromCharCode (0xffff);
+data[72] = String.fromCharCode (0x0003);
+data[73] = String.fromCharCode (0xffff);
+data[74] = String.fromCharCode (0xffff);
+data[75] = String.fromCharCode (0xffff);
+data[76] = String.fromCharCode (0x199f);
+data[77] = String.fromCharCode (0xffff);
+data[78] = String.fromCharCode (0xcfff);
+data[79] = String.fromCharCode (0x033f);
+data[83] = String.fromCharCode (0xfffe);
+data[84] = String.fromCharCode (0xffff);
+data[85] = String.fromCharCode (0x027f);
+data[86] = String.fromCharCode (0xfffe);
+data[87] = String.fromCharCode (0xffff);
+data[88] = String.fromCharCode (0x00ff);
+data[93] = String.fromCharCode (0xffff);
+data[94] = String.fromCharCode (0x07ff);
+data[95] = String.fromCharCode (0x0007);
+data[98] = String.fromCharCode (0xfffe);
+data[99] = String.fromCharCode (0x07ff);
+data[100] = String.fromCharCode (0x07ff);
+data[103] = String.fromCharCode (0xfffe);
+data[104] = String.fromCharCode (0xffff);
+data[105] = String.fromCharCode (0xffff);
+data[106] = String.fromCharCode (0xffff);
+data[107] = String.fromCharCode (0x7cff);
+data[108] = String.fromCharCode (0x7fff);
+data[109] = String.fromCharCode (0x002f);
+data[110] = String.fromCharCode (0x0060);
+data[144] = String.fromCharCode (0xffe0);
+data[145] = String.fromCharCode (0xffff);
+data[146] = String.fromCharCode (0xffff);
+data[147] = String.fromCharCode (0x23ff);
+data[149] = String.fromCharCode (0xff00);
+data[150] = String.fromCharCode (0x0003);
+data[152] = String.fromCharCode (0x9fe0);
+data[153] = String.fromCharCode (0xfff9);
+data[154] = String.fromCharCode (0xfdff);
+data[155] = String.fromCharCode (0x03c5);
+data[157] = String.fromCharCode (0xb000);
+data[158] = String.fromCharCode (0x0003);
+data[159] = String.fromCharCode (0x0003);
+data[160] = String.fromCharCode (0x87e0);
+data[161] = String.fromCharCode (0xfff9);
+data[162] = String.fromCharCode (0xfdff);
+data[163] = String.fromCharCode (0x036d);
+data[165] = String.fromCharCode (0x5e00);
+data[167] = String.fromCharCode (0x001c);
+data[168] = String.fromCharCode (0xafe0);
+data[169] = String.fromCharCode (0xfffb);
+data[170] = String.fromCharCode (0xfdff);
+data[171] = String.fromCharCode (0x23ed);
+data[174] = String.fromCharCode (0x0001);
+data[176] = String.fromCharCode (0x9fe0);
+data[177] = String.fromCharCode (0xfff9);
+data[178] = String.fromCharCode (0xfdff);
+data[179] = String.fromCharCode (0x23cd);
+data[181] = String.fromCharCode (0xb000);
+data[182] = String.fromCharCode (0x0003);
+data[184] = String.fromCharCode (0xc7e0);
+data[185] = String.fromCharCode (0xd63d);
+data[186] = String.fromCharCode (0xc718);
+data[187] = String.fromCharCode (0x03bf);
+data[192] = String.fromCharCode (0xdfe0);
+data[193] = String.fromCharCode (0xfffd);
+data[194] = String.fromCharCode (0xfdff);
+data[195] = String.fromCharCode (0x03ef);
+data[198] = String.fromCharCode (0x0003);
+data[200] = String.fromCharCode (0xdfe0);
+data[201] = String.fromCharCode (0xfffd);
+data[202] = String.fromCharCode (0xfdff);
+data[203] = String.fromCharCode (0x03ef);
+data[205] = String.fromCharCode (0x4000);
+data[206] = String.fromCharCode (0x0003);
+data[208] = String.fromCharCode (0xdfe0);
+data[209] = String.fromCharCode (0xfffd);
+data[210] = String.fromCharCode (0xfdff);
+data[211] = String.fromCharCode (0x03ff);
+data[214] = String.fromCharCode (0x0003);
+data[224] = String.fromCharCode (0xfffe);
+data[225] = String.fromCharCode (0xffff);
+data[226] = String.fromCharCode (0x7fff);
+data[227] = String.fromCharCode (0x000d);
+data[228] = String.fromCharCode (0x007f);
+data[232] = String.fromCharCode (0x2596);
+data[233] = String.fromCharCode (0xfef0);
+data[234] = String.fromCharCode (0x6cae);
+data[235] = String.fromCharCode (0x200d);
+data[236] = String.fromCharCode (0x005f);
+data[237] = String.fromCharCode (0x3000);
+data[244] = String.fromCharCode (0xfeff);
+data[245] = String.fromCharCode (0xffff);
+data[246] = String.fromCharCode (0x03ff);
+data[266] = String.fromCharCode (0xffff);
+data[267] = String.fromCharCode (0xffff);
+data[268] = String.fromCharCode (0x003f);
+data[269] = String.fromCharCode (0xffff);
+data[270] = String.fromCharCode (0xffff);
+data[271] = String.fromCharCode (0x007f);
+data[272] = String.fromCharCode (0xffff);
+data[273] = String.fromCharCode (0xffff);
+data[274] = String.fromCharCode (0xffff);
+data[275] = String.fromCharCode (0xffff);
+data[276] = String.fromCharCode (0xffff);
+data[277] = String.fromCharCode (0x83ff);
+data[278] = String.fromCharCode (0xffff);
+data[279] = String.fromCharCode (0xffff);
+data[280] = String.fromCharCode (0xffff);
+data[281] = String.fromCharCode (0xffff);
+data[282] = String.fromCharCode (0xff07);
+data[283] = String.fromCharCode (0xffff);
+data[284] = String.fromCharCode (0xffff);
+data[285] = String.fromCharCode (0xffff);
+data[286] = String.fromCharCode (0xffff);
+data[287] = String.fromCharCode (0x03ff);
+data[480] = String.fromCharCode (0xffff);
+data[481] = String.fromCharCode (0xffff);
+data[482] = String.fromCharCode (0xffff);
+data[483] = String.fromCharCode (0xffff);
+data[484] = String.fromCharCode (0xffff);
+data[485] = String.fromCharCode (0xffff);
+data[486] = String.fromCharCode (0xffff);
+data[487] = String.fromCharCode (0xffff);
+data[488] = String.fromCharCode (0xffff);
+data[489] = String.fromCharCode (0x0fff);
+data[490] = String.fromCharCode (0xffff);
+data[491] = String.fromCharCode (0xffff);
+data[492] = String.fromCharCode (0xffff);
+data[493] = String.fromCharCode (0xffff);
+data[494] = String.fromCharCode (0xffff);
+data[495] = String.fromCharCode (0x03ff);
+data[496] = String.fromCharCode (0xffff);
+data[497] = String.fromCharCode (0x3f3f);
+data[498] = String.fromCharCode (0xffff);
+data[499] = String.fromCharCode (0xffff);
+data[500] = String.fromCharCode (0x3f3f);
+data[501] = String.fromCharCode (0xaaff);
+data[502] = String.fromCharCode (0xffff);
+data[503] = String.fromCharCode (0x3fff);
+data[504] = String.fromCharCode (0xffff);
+data[505] = String.fromCharCode (0xffff);
+data[506] = String.fromCharCode (0xffff);
+data[507] = String.fromCharCode (0x5fdf);
+data[508] = String.fromCharCode (0x1fdc);
+data[509] = String.fromCharCode (0x0fcf);
+data[510] = String.fromCharCode (0x1fff);
+data[511] = String.fromCharCode (0x1fdc);
+data[519] = String.fromCharCode (0x8000);
+data[528] = String.fromCharCode (0xfc84);
+data[529] = String.fromCharCode (0x3f2f);
+data[530] = String.fromCharCode (0xfd50);
+data[531] = String.fromCharCode (0x01fb);
+data[768] = String.fromCharCode (0x0020);
+data[771] = String.fromCharCode (0x003e);
+data[772] = String.fromCharCode (0xfffe);
+data[773] = String.fromCharCode (0xffff);
+data[774] = String.fromCharCode (0xffff);
+data[775] = String.fromCharCode (0xffff);
+data[776] = String.fromCharCode (0xffff);
+data[777] = String.fromCharCode (0x781f);
+data[778] = String.fromCharCode (0xfffe);
+data[779] = String.fromCharCode (0xffff);
+data[780] = String.fromCharCode (0xffff);
+data[781] = String.fromCharCode (0xffff);
+data[782] = String.fromCharCode (0xffff);
+data[783] = String.fromCharCode (0x77ff);
+data[784] = String.fromCharCode (0xffe0);
+data[785] = String.fromCharCode (0xffff);
+data[786] = String.fromCharCode (0x1fff);
+data[787] = String.fromCharCode (0xfffe);
+data[788] = String.fromCharCode (0xffff);
+data[789] = String.fromCharCode (0xffff);
+data[790] = String.fromCharCode (0xffff);
+data[791] = String.fromCharCode (0xffff);
+data[792] = String.fromCharCode (0x7fff);
+data[1248] = String.fromCharCode (0xffff);
+data[1249] = String.fromCharCode (0xffff);
+data[1250] = String.fromCharCode (0xffff);
+data[1251] = String.fromCharCode (0xffff);
+data[1252] = String.fromCharCode (0xffff);
+data[1253] = String.fromCharCode (0xffff);
+data[1254] = String.fromCharCode (0xffff);
+data[1255] = String.fromCharCode (0xffff);
+data[1256] = String.fromCharCode (0xffff);
+data[1257] = String.fromCharCode (0xffff);
+data[1258] = String.fromCharCode (0xffff);
+data[1259] = String.fromCharCode (0xffff);
+data[1260] = String.fromCharCode (0xffff);
+data[1261] = String.fromCharCode (0xffff);
+data[1262] = String.fromCharCode (0xffff);
+data[1263] = String.fromCharCode (0xffff);
+data[1264] = String.fromCharCode (0xffff);
+data[1265] = String.fromCharCode (0xffff);
+data[1266] = String.fromCharCode (0xffff);
+data[1267] = String.fromCharCode (0xffff);
+data[1268] = String.fromCharCode (0xffff);
+data[1269] = String.fromCharCode (0xffff);
+data[1270] = String.fromCharCode (0xffff);
+data[1271] = String.fromCharCode (0xffff);
+data[1272] = String.fromCharCode (0xffff);
+data[1273] = String.fromCharCode (0xffff);
+data[1274] = String.fromCharCode (0xffff);
+data[1275] = String.fromCharCode (0xffff);
+data[1276] = String.fromCharCode (0xffff);
+data[1277] = String.fromCharCode (0xffff);
+data[1278] = String.fromCharCode (0xffff);
+data[1279] = String.fromCharCode (0xffff);
+data[1280] = String.fromCharCode (0xffff);
+data[1281] = String.fromCharCode (0xffff);
+data[1282] = String.fromCharCode (0xffff);
+data[1283] = String.fromCharCode (0xffff);
+data[1284] = String.fromCharCode (0xffff);
+data[1285] = String.fromCharCode (0xffff);
+data[1286] = String.fromCharCode (0xffff);
+data[1287] = String.fromCharCode (0xffff);
+data[1288] = String.fromCharCode (0xffff);
+data[1289] = String.fromCharCode (0xffff);
+data[1290] = String.fromCharCode (0xffff);
+data[1291] = String.fromCharCode (0xffff);
+data[1292] = String.fromCharCode (0xffff);
+data[1293] = String.fromCharCode (0xffff);
+data[1294] = String.fromCharCode (0xffff);
+data[1295] = String.fromCharCode (0xffff);
+data[1296] = String.fromCharCode (0xffff);
+data[1297] = String.fromCharCode (0xffff);
+data[1298] = String.fromCharCode (0xffff);
+data[1299] = String.fromCharCode (0xffff);
+data[1300] = String.fromCharCode (0xffff);
+data[1301] = String.fromCharCode (0xffff);
+data[1302] = String.fromCharCode (0xffff);
+data[1303] = String.fromCharCode (0xffff);
+data[1304] = String.fromCharCode (0xffff);
+data[1305] = String.fromCharCode (0xffff);
+data[1306] = String.fromCharCode (0xffff);
+data[1307] = String.fromCharCode (0xffff);
+data[1308] = String.fromCharCode (0xffff);
+data[1309] = String.fromCharCode (0xffff);
+data[1310] = String.fromCharCode (0xffff);
+data[1311] = String.fromCharCode (0xffff);
+data[1312] = String.fromCharCode (0xffff);
+data[1313] = String.fromCharCode (0xffff);
+data[1314] = String.fromCharCode (0xffff);
+data[1315] = String.fromCharCode (0xffff);
+data[1316] = String.fromCharCode (0xffff);
+data[1317] = String.fromCharCode (0xffff);
+data[1318] = String.fromCharCode (0xffff);
+data[1319] = String.fromCharCode (0xffff);
+data[1320] = String.fromCharCode (0xffff);
+data[1321] = String.fromCharCode (0xffff);
+data[1322] = String.fromCharCode (0xffff);
+data[1323] = String.fromCharCode (0xffff);
+data[1324] = String.fromCharCode (0xffff);
+data[1325] = String.fromCharCode (0xffff);
+data[1326] = String.fromCharCode (0xffff);
+data[1327] = String.fromCharCode (0xffff);
+data[1328] = String.fromCharCode (0xffff);
+data[1329] = String.fromCharCode (0xffff);
+data[1330] = String.fromCharCode (0xffff);
+data[1331] = String.fromCharCode (0xffff);
+data[1332] = String.fromCharCode (0xffff);
+data[1333] = String.fromCharCode (0xffff);
+data[1334] = String.fromCharCode (0xffff);
+data[1335] = String.fromCharCode (0xffff);
+data[1336] = String.fromCharCode (0xffff);
+data[1337] = String.fromCharCode (0xffff);
+data[1338] = String.fromCharCode (0xffff);
+data[1339] = String.fromCharCode (0xffff);
+data[1340] = String.fromCharCode (0xffff);
+data[1341] = String.fromCharCode (0xffff);
+data[1342] = String.fromCharCode (0xffff);
+data[1343] = String.fromCharCode (0xffff);
+data[1344] = String.fromCharCode (0xffff);
+data[1345] = String.fromCharCode (0xffff);
+data[1346] = String.fromCharCode (0xffff);
+data[1347] = String.fromCharCode (0xffff);
+data[1348] = String.fromCharCode (0xffff);
+data[1349] = String.fromCharCode (0xffff);
+data[1350] = String.fromCharCode (0xffff);
+data[1351] = String.fromCharCode (0xffff);
+data[1352] = String.fromCharCode (0xffff);
+data[1353] = String.fromCharCode (0xffff);
+data[1354] = String.fromCharCode (0xffff);
+data[1355] = String.fromCharCode (0xffff);
+data[1356] = String.fromCharCode (0xffff);
+data[1357] = String.fromCharCode (0xffff);
+data[1358] = String.fromCharCode (0xffff);
+data[1359] = String.fromCharCode (0xffff);
+data[1360] = String.fromCharCode (0xffff);
+data[1361] = String.fromCharCode (0xffff);
+data[1362] = String.fromCharCode (0xffff);
+data[1363] = String.fromCharCode (0xffff);
+data[1364] = String.fromCharCode (0xffff);
+data[1365] = String.fromCharCode (0xffff);
+data[1366] = String.fromCharCode (0xffff);
+data[1367] = String.fromCharCode (0xffff);
+data[1368] = String.fromCharCode (0xffff);
+data[1369] = String.fromCharCode (0xffff);
+data[1370] = String.fromCharCode (0xffff);
+data[1371] = String.fromCharCode (0xffff);
+data[1372] = String.fromCharCode (0xffff);
+data[1373] = String.fromCharCode (0xffff);
+data[1374] = String.fromCharCode (0xffff);
+data[1375] = String.fromCharCode (0xffff);
+data[1376] = String.fromCharCode (0xffff);
+data[1377] = String.fromCharCode (0xffff);
+data[1378] = String.fromCharCode (0xffff);
+data[1379] = String.fromCharCode (0xffff);
+data[1380] = String.fromCharCode (0xffff);
+data[1381] = String.fromCharCode (0xffff);
+data[1382] = String.fromCharCode (0xffff);
+data[1383] = String.fromCharCode (0xffff);
+data[1384] = String.fromCharCode (0xffff);
+data[1385] = String.fromCharCode (0xffff);
+data[1386] = String.fromCharCode (0xffff);
+data[1387] = String.fromCharCode (0xffff);
+data[1388] = String.fromCharCode (0xffff);
+data[1389] = String.fromCharCode (0xffff);
+data[1390] = String.fromCharCode (0xffff);
+data[1391] = String.fromCharCode (0xffff);
+data[1392] = String.fromCharCode (0xffff);
+data[1393] = String.fromCharCode (0xffff);
+data[1394] = String.fromCharCode (0xffff);
+data[1395] = String.fromCharCode (0xffff);
+data[1396] = String.fromCharCode (0xffff);
+data[1397] = String.fromCharCode (0xffff);
+data[1398] = String.fromCharCode (0xffff);
+data[1399] = String.fromCharCode (0xffff);
+data[1400] = String.fromCharCode (0xffff);
+data[1401] = String.fromCharCode (0xffff);
+data[1402] = String.fromCharCode (0xffff);
+data[1403] = String.fromCharCode (0xffff);
+data[1404] = String.fromCharCode (0xffff);
+data[1405] = String.fromCharCode (0xffff);
+data[1406] = String.fromCharCode (0xffff);
+data[1407] = String.fromCharCode (0xffff);
+data[1408] = String.fromCharCode (0xffff);
+data[1409] = String.fromCharCode (0xffff);
+data[1410] = String.fromCharCode (0xffff);
+data[1411] = String.fromCharCode (0xffff);
+data[1412] = String.fromCharCode (0xffff);
+data[1413] = String.fromCharCode (0xffff);
+data[1414] = String.fromCharCode (0xffff);
+data[1415] = String.fromCharCode (0xffff);
+data[1416] = String.fromCharCode (0xffff);
+data[1417] = String.fromCharCode (0xffff);
+data[1418] = String.fromCharCode (0xffff);
+data[1419] = String.fromCharCode (0xffff);
+data[1420] = String.fromCharCode (0xffff);
+data[1421] = String.fromCharCode (0xffff);
+data[1422] = String.fromCharCode (0xffff);
+data[1423] = String.fromCharCode (0xffff);
+data[1424] = String.fromCharCode (0xffff);
+data[1425] = String.fromCharCode (0xffff);
+data[1426] = String.fromCharCode (0xffff);
+data[1427] = String.fromCharCode (0xffff);
+data[1428] = String.fromCharCode (0xffff);
+data[1429] = String.fromCharCode (0xffff);
+data[1430] = String.fromCharCode (0xffff);
+data[1431] = String.fromCharCode (0xffff);
+data[1432] = String.fromCharCode (0xffff);
+data[1433] = String.fromCharCode (0xffff);
+data[1434] = String.fromCharCode (0xffff);
+data[1435] = String.fromCharCode (0xffff);
+data[1436] = String.fromCharCode (0xffff);
+data[1437] = String.fromCharCode (0xffff);
+data[1438] = String.fromCharCode (0xffff);
+data[1439] = String.fromCharCode (0xffff);
+data[1440] = String.fromCharCode (0xffff);
+data[1441] = String.fromCharCode (0xffff);
+data[1442] = String.fromCharCode (0xffff);
+data[1443] = String.fromCharCode (0xffff);
+data[1444] = String.fromCharCode (0xffff);
+data[1445] = String.fromCharCode (0xffff);
+data[1446] = String.fromCharCode (0xffff);
+data[1447] = String.fromCharCode (0xffff);
+data[1448] = String.fromCharCode (0xffff);
+data[1449] = String.fromCharCode (0xffff);
+data[1450] = String.fromCharCode (0xffff);
+data[1451] = String.fromCharCode (0xffff);
+data[1452] = String.fromCharCode (0xffff);
+data[1453] = String.fromCharCode (0xffff);
+data[1454] = String.fromCharCode (0xffff);
+data[1455] = String.fromCharCode (0xffff);
+data[1456] = String.fromCharCode (0xffff);
+data[1457] = String.fromCharCode (0xffff);
+data[1458] = String.fromCharCode (0xffff);
+data[1459] = String.fromCharCode (0xffff);
+data[1460] = String.fromCharCode (0xffff);
+data[1461] = String.fromCharCode (0xffff);
+data[1462] = String.fromCharCode (0xffff);
+data[1463] = String.fromCharCode (0xffff);
+data[1464] = String.fromCharCode (0xffff);
+data[1465] = String.fromCharCode (0xffff);
+data[1466] = String.fromCharCode (0xffff);
+data[1467] = String.fromCharCode (0xffff);
+data[1468] = String.fromCharCode (0xffff);
+data[1469] = String.fromCharCode (0xffff);
+data[1470] = String.fromCharCode (0xffff);
+data[1471] = String.fromCharCode (0xffff);
+data[1472] = String.fromCharCode (0xffff);
+data[1473] = String.fromCharCode (0xffff);
+data[1474] = String.fromCharCode (0xffff);
+data[1475] = String.fromCharCode (0xffff);
+data[1476] = String.fromCharCode (0xffff);
+data[1477] = String.fromCharCode (0xffff);
+data[1478] = String.fromCharCode (0xffff);
+data[1479] = String.fromCharCode (0xffff);
+data[1480] = String.fromCharCode (0xffff);
+data[1481] = String.fromCharCode (0xffff);
+data[1482] = String.fromCharCode (0xffff);
+data[1483] = String.fromCharCode (0xffff);
+data[1484] = String.fromCharCode (0xffff);
+data[1485] = String.fromCharCode (0xffff);
+data[1486] = String.fromCharCode (0xffff);
+data[1487] = String.fromCharCode (0xffff);
+data[1488] = String.fromCharCode (0xffff);
+data[1489] = String.fromCharCode (0xffff);
+data[1490] = String.fromCharCode (0xffff);
+data[1491] = String.fromCharCode (0xffff);
+data[1492] = String.fromCharCode (0xffff);
+data[1493] = String.fromCharCode (0xffff);
+data[1494] = String.fromCharCode (0xffff);
+data[1495] = String.fromCharCode (0xffff);
+data[1496] = String.fromCharCode (0xffff);
+data[1497] = String.fromCharCode (0xffff);
+data[1498] = String.fromCharCode (0xffff);
+data[1499] = String.fromCharCode (0xffff);
+data[1500] = String.fromCharCode (0xffff);
+data[1501] = String.fromCharCode (0xffff);
+data[1502] = String.fromCharCode (0xffff);
+data[1503] = String.fromCharCode (0xffff);
+data[1504] = String.fromCharCode (0xffff);
+data[1505] = String.fromCharCode (0xffff);
+data[1506] = String.fromCharCode (0xffff);
+data[1507] = String.fromCharCode (0xffff);
+data[1508] = String.fromCharCode (0xffff);
+data[1509] = String.fromCharCode (0xffff);
+data[1510] = String.fromCharCode (0xffff);
+data[1511] = String.fromCharCode (0xffff);
+data[1512] = String.fromCharCode (0xffff);
+data[1513] = String.fromCharCode (0xffff);
+data[1514] = String.fromCharCode (0xffff);
+data[1515] = String.fromCharCode (0xffff);
+data[1516] = String.fromCharCode (0xffff);
+data[1517] = String.fromCharCode (0xffff);
+data[1518] = String.fromCharCode (0xffff);
+data[1519] = String.fromCharCode (0xffff);
+data[1520] = String.fromCharCode (0xffff);
+data[1521] = String.fromCharCode (0xffff);
+data[1522] = String.fromCharCode (0xffff);
+data[1523] = String.fromCharCode (0xffff);
+data[1524] = String.fromCharCode (0xffff);
+data[1525] = String.fromCharCode (0xffff);
+data[1526] = String.fromCharCode (0xffff);
+data[1527] = String.fromCharCode (0xffff);
+data[1528] = String.fromCharCode (0xffff);
+data[1529] = String.fromCharCode (0xffff);
+data[1530] = String.fromCharCode (0xffff);
+data[1531] = String.fromCharCode (0xffff);
+data[1532] = String.fromCharCode (0xffff);
+data[1533] = String.fromCharCode (0xffff);
+data[1534] = String.fromCharCode (0xffff);
+data[1535] = String.fromCharCode (0xffff);
+data[1536] = String.fromCharCode (0xffff);
+data[1537] = String.fromCharCode (0xffff);
+data[1538] = String.fromCharCode (0xffff);
+data[1539] = String.fromCharCode (0xffff);
+data[1540] = String.fromCharCode (0xffff);
+data[1541] = String.fromCharCode (0xffff);
+data[1542] = String.fromCharCode (0xffff);
+data[1543] = String.fromCharCode (0xffff);
+data[1544] = String.fromCharCode (0xffff);
+data[1545] = String.fromCharCode (0xffff);
+data[1546] = String.fromCharCode (0xffff);
+data[1547] = String.fromCharCode (0xffff);
+data[1548] = String.fromCharCode (0xffff);
+data[1549] = String.fromCharCode (0xffff);
+data[1550] = String.fromCharCode (0xffff);
+data[1551] = String.fromCharCode (0xffff);
+data[1552] = String.fromCharCode (0xffff);
+data[1553] = String.fromCharCode (0xffff);
+data[1554] = String.fromCharCode (0xffff);
+data[1555] = String.fromCharCode (0xffff);
+data[1556] = String.fromCharCode (0xffff);
+data[1557] = String.fromCharCode (0xffff);
+data[1558] = String.fromCharCode (0xffff);
+data[1559] = String.fromCharCode (0xffff);
+data[1560] = String.fromCharCode (0xffff);
+data[1561] = String.fromCharCode (0xffff);
+data[1562] = String.fromCharCode (0xffff);
+data[1563] = String.fromCharCode (0xffff);
+data[1564] = String.fromCharCode (0xffff);
+data[1565] = String.fromCharCode (0xffff);
+data[1566] = String.fromCharCode (0xffff);
+data[1567] = String.fromCharCode (0xffff);
+data[1568] = String.fromCharCode (0xffff);
+data[1569] = String.fromCharCode (0xffff);
+data[1570] = String.fromCharCode (0xffff);
+data[1571] = String.fromCharCode (0xffff);
+data[1572] = String.fromCharCode (0xffff);
+data[1573] = String.fromCharCode (0xffff);
+data[1574] = String.fromCharCode (0xffff);
+data[1575] = String.fromCharCode (0xffff);
+data[1576] = String.fromCharCode (0xffff);
+data[1577] = String.fromCharCode (0xffff);
+data[1578] = String.fromCharCode (0xffff);
+data[1579] = String.fromCharCode (0xffff);
+data[1580] = String.fromCharCode (0xffff);
+data[1581] = String.fromCharCode (0xffff);
+data[1582] = String.fromCharCode (0xffff);
+data[1583] = String.fromCharCode (0xffff);
+data[1584] = String.fromCharCode (0xffff);
+data[1585] = String.fromCharCode (0xffff);
+data[1586] = String.fromCharCode (0xffff);
+data[1587] = String.fromCharCode (0xffff);
+data[1588] = String.fromCharCode (0xffff);
+data[1589] = String.fromCharCode (0xffff);
+data[1590] = String.fromCharCode (0xffff);
+data[1591] = String.fromCharCode (0xffff);
+data[1592] = String.fromCharCode (0xffff);
+data[1593] = String.fromCharCode (0xffff);
+data[1594] = String.fromCharCode (0xffff);
+data[1595] = String.fromCharCode (0xffff);
+data[1596] = String.fromCharCode (0xffff);
+data[1597] = String.fromCharCode (0xffff);
+data[1598] = String.fromCharCode (0xffff);
+data[1599] = String.fromCharCode (0xffff);
+data[1600] = String.fromCharCode (0xffff);
+data[1601] = String.fromCharCode (0xffff);
+data[1602] = String.fromCharCode (0xffff);
+data[1603] = String.fromCharCode (0xffff);
+data[1604] = String.fromCharCode (0xffff);
+data[1605] = String.fromCharCode (0xffff);
+data[1606] = String.fromCharCode (0xffff);
+data[1607] = String.fromCharCode (0xffff);
+data[1608] = String.fromCharCode (0xffff);
+data[1609] = String.fromCharCode (0xffff);
+data[1610] = String.fromCharCode (0xffff);
+data[1611] = String.fromCharCode (0xffff);
+data[1612] = String.fromCharCode (0xffff);
+data[1613] = String.fromCharCode (0xffff);
+data[1614] = String.fromCharCode (0xffff);
+data[1615] = String.fromCharCode (0xffff);
+data[1616] = String.fromCharCode (0xffff);
+data[1617] = String.fromCharCode (0xffff);
+data[1618] = String.fromCharCode (0xffff);
+data[1619] = String.fromCharCode (0xffff);
+data[1620] = String.fromCharCode (0xffff);
+data[1621] = String.fromCharCode (0xffff);
+data[1622] = String.fromCharCode (0xffff);
+data[1623] = String.fromCharCode (0xffff);
+data[1624] = String.fromCharCode (0xffff);
+data[1625] = String.fromCharCode (0xffff);
+data[1626] = String.fromCharCode (0xffff);
+data[1627] = String.fromCharCode (0xffff);
+data[1628] = String.fromCharCode (0xffff);
+data[1629] = String.fromCharCode (0xffff);
+data[1630] = String.fromCharCode (0xffff);
+data[1631] = String.fromCharCode (0xffff);
+data[1632] = String.fromCharCode (0xffff);
+data[1633] = String.fromCharCode (0xffff);
+data[1634] = String.fromCharCode (0xffff);
+data[1635] = String.fromCharCode (0xffff);
+data[1636] = String.fromCharCode (0xffff);
+data[1637] = String.fromCharCode (0xffff);
+data[1638] = String.fromCharCode (0xffff);
+data[1639] = String.fromCharCode (0xffff);
+data[1640] = String.fromCharCode (0xffff);
+data[1641] = String.fromCharCode (0xffff);
+data[1642] = String.fromCharCode (0xffff);
+data[1643] = String.fromCharCode (0xffff);
+data[1644] = String.fromCharCode (0xffff);
+data[1645] = String.fromCharCode (0xffff);
+data[1646] = String.fromCharCode (0xffff);
+data[1647] = String.fromCharCode (0xffff);
+data[1648] = String.fromCharCode (0xffff);
+data[1649] = String.fromCharCode (0xffff);
+data[1650] = String.fromCharCode (0xffff);
+data[1651] = String.fromCharCode (0xffff);
+data[1652] = String.fromCharCode (0xffff);
+data[1653] = String.fromCharCode (0xffff);
+data[1654] = String.fromCharCode (0xffff);
+data[1655] = String.fromCharCode (0xffff);
+data[1656] = String.fromCharCode (0xffff);
+data[1657] = String.fromCharCode (0xffff);
+data[1658] = String.fromCharCode (0xffff);
+data[1659] = String.fromCharCode (0xffff);
+data[1660] = String.fromCharCode (0xffff);
+data[1661] = String.fromCharCode (0xffff);
+data[1662] = String.fromCharCode (0xffff);
+data[1663] = String.fromCharCode (0xffff);
+data[1664] = String.fromCharCode (0xffff);
+data[1665] = String.fromCharCode (0xffff);
+data[1666] = String.fromCharCode (0xffff);
+data[1667] = String.fromCharCode (0xffff);
+data[1668] = String.fromCharCode (0xffff);
+data[1669] = String.fromCharCode (0xffff);
+data[1670] = String.fromCharCode (0xffff);
+data[1671] = String.fromCharCode (0xffff);
+data[1672] = String.fromCharCode (0xffff);
+data[1673] = String.fromCharCode (0xffff);
+data[1674] = String.fromCharCode (0xffff);
+data[1675] = String.fromCharCode (0xffff);
+data[1676] = String.fromCharCode (0xffff);
+data[1677] = String.fromCharCode (0xffff);
+data[1678] = String.fromCharCode (0xffff);
+data[1679] = String.fromCharCode (0xffff);
+data[1680] = String.fromCharCode (0xffff);
+data[1681] = String.fromCharCode (0xffff);
+data[1682] = String.fromCharCode (0xffff);
+data[1683] = String.fromCharCode (0xffff);
+data[1684] = String.fromCharCode (0xffff);
+data[1685] = String.fromCharCode (0xffff);
+data[1686] = String.fromCharCode (0xffff);
+data[1687] = String.fromCharCode (0xffff);
+data[1688] = String.fromCharCode (0xffff);
+data[1689] = String.fromCharCode (0xffff);
+data[1690] = String.fromCharCode (0xffff);
+data[1691] = String.fromCharCode (0xffff);
+data[1692] = String.fromCharCode (0xffff);
+data[1693] = String.fromCharCode (0xffff);
+data[1694] = String.fromCharCode (0xffff);
+data[1695] = String.fromCharCode (0xffff);
+data[1696] = String.fromCharCode (0xffff);
+data[1697] = String.fromCharCode (0xffff);
+data[1698] = String.fromCharCode (0xffff);
+data[1699] = String.fromCharCode (0xffff);
+data[1700] = String.fromCharCode (0xffff);
+data[1701] = String.fromCharCode (0xffff);
+data[1702] = String.fromCharCode (0xffff);
+data[1703] = String.fromCharCode (0xffff);
+data[1704] = String.fromCharCode (0xffff);
+data[1705] = String.fromCharCode (0xffff);
+data[1706] = String.fromCharCode (0xffff);
+data[1707] = String.fromCharCode (0xffff);
+data[1708] = String.fromCharCode (0xffff);
+data[1709] = String.fromCharCode (0xffff);
+data[1710] = String.fromCharCode (0xffff);
+data[1711] = String.fromCharCode (0xffff);
+data[1712] = String.fromCharCode (0xffff);
+data[1713] = String.fromCharCode (0xffff);
+data[1714] = String.fromCharCode (0xffff);
+data[1715] = String.fromCharCode (0xffff);
+data[1716] = String.fromCharCode (0xffff);
+data[1717] = String.fromCharCode (0xffff);
+data[1718] = String.fromCharCode (0xffff);
+data[1719] = String.fromCharCode (0xffff);
+data[1720] = String.fromCharCode (0xffff);
+data[1721] = String.fromCharCode (0xffff);
+data[1722] = String.fromCharCode (0xffff);
+data[1723] = String.fromCharCode (0xffff);
+data[1724] = String.fromCharCode (0xffff);
+data[1725] = String.fromCharCode (0xffff);
+data[1726] = String.fromCharCode (0xffff);
+data[1727] = String.fromCharCode (0xffff);
+data[1728] = String.fromCharCode (0xffff);
+data[1729] = String.fromCharCode (0xffff);
+data[1730] = String.fromCharCode (0xffff);
+data[1731] = String.fromCharCode (0xffff);
+data[1732] = String.fromCharCode (0xffff);
+data[1733] = String.fromCharCode (0xffff);
+data[1734] = String.fromCharCode (0xffff);
+data[1735] = String.fromCharCode (0xffff);
+data[1736] = String.fromCharCode (0xffff);
+data[1737] = String.fromCharCode (0xffff);
+data[1738] = String.fromCharCode (0xffff);
+data[1739] = String.fromCharCode (0xffff);
+data[1740] = String.fromCharCode (0xffff);
+data[1741] = String.fromCharCode (0xffff);
+data[1742] = String.fromCharCode (0xffff);
+data[1743] = String.fromCharCode (0xffff);
+data[1744] = String.fromCharCode (0xffff);
+data[1745] = String.fromCharCode (0xffff);
+data[1746] = String.fromCharCode (0xffff);
+data[1747] = String.fromCharCode (0xffff);
+data[1748] = String.fromCharCode (0xffff);
+data[1749] = String.fromCharCode (0xffff);
+data[1750] = String.fromCharCode (0xffff);
+data[1751] = String.fromCharCode (0xffff);
+data[1752] = String.fromCharCode (0xffff);
+data[1753] = String.fromCharCode (0xffff);
+data[1754] = String.fromCharCode (0xffff);
+data[1755] = String.fromCharCode (0xffff);
+data[1756] = String.fromCharCode (0xffff);
+data[1757] = String.fromCharCode (0xffff);
+data[1758] = String.fromCharCode (0xffff);
+data[1759] = String.fromCharCode (0xffff);
+data[1760] = String.fromCharCode (0xffff);
+data[1761] = String.fromCharCode (0xffff);
+data[1762] = String.fromCharCode (0xffff);
+data[1763] = String.fromCharCode (0xffff);
+data[1764] = String.fromCharCode (0xffff);
+data[1765] = String.fromCharCode (0xffff);
+data[1766] = String.fromCharCode (0xffff);
+data[1767] = String.fromCharCode (0xffff);
+data[1768] = String.fromCharCode (0xffff);
+data[1769] = String.fromCharCode (0xffff);
+data[1770] = String.fromCharCode (0xffff);
+data[1771] = String.fromCharCode (0xffff);
+data[1772] = String.fromCharCode (0xffff);
+data[1773] = String.fromCharCode (0xffff);
+data[1774] = String.fromCharCode (0xffff);
+data[1775] = String.fromCharCode (0xffff);
+data[1776] = String.fromCharCode (0xffff);
+data[1777] = String.fromCharCode (0xffff);
+data[1778] = String.fromCharCode (0xffff);
+data[1779] = String.fromCharCode (0xffff);
+data[1780] = String.fromCharCode (0xffff);
+data[1781] = String.fromCharCode (0xffff);
+data[1782] = String.fromCharCode (0xffff);
+data[1783] = String.fromCharCode (0xffff);
+data[1784] = String.fromCharCode (0xffff);
+data[1785] = String.fromCharCode (0xffff);
+data[1786] = String.fromCharCode (0xffff);
+data[1787] = String.fromCharCode (0xffff);
+data[1788] = String.fromCharCode (0xffff);
+data[1789] = String.fromCharCode (0xffff);
+data[1790] = String.fromCharCode (0xffff);
+data[1791] = String.fromCharCode (0xffff);
+data[1792] = String.fromCharCode (0xffff);
+data[1793] = String.fromCharCode (0xffff);
+data[1794] = String.fromCharCode (0xffff);
+data[1795] = String.fromCharCode (0xffff);
+data[1796] = String.fromCharCode (0xffff);
+data[1797] = String.fromCharCode (0xffff);
+data[1798] = String.fromCharCode (0xffff);
+data[1799] = String.fromCharCode (0xffff);
+data[1800] = String.fromCharCode (0xffff);
+data[1801] = String.fromCharCode (0xffff);
+data[1802] = String.fromCharCode (0xffff);
+data[1803] = String.fromCharCode (0xffff);
+data[1804] = String.fromCharCode (0xffff);
+data[1805] = String.fromCharCode (0xffff);
+data[1806] = String.fromCharCode (0xffff);
+data[1807] = String.fromCharCode (0xffff);
+data[1808] = String.fromCharCode (0xffff);
+data[1809] = String.fromCharCode (0xffff);
+data[1810] = String.fromCharCode (0xffff);
+data[1811] = String.fromCharCode (0xffff);
+data[1812] = String.fromCharCode (0xffff);
+data[1813] = String.fromCharCode (0xffff);
+data[1814] = String.fromCharCode (0xffff);
+data[1815] = String.fromCharCode (0xffff);
+data[1816] = String.fromCharCode (0xffff);
+data[1817] = String.fromCharCode (0xffff);
+data[1818] = String.fromCharCode (0xffff);
+data[1819] = String.fromCharCode (0xffff);
+data[1820] = String.fromCharCode (0xffff);
+data[1821] = String.fromCharCode (0xffff);
+data[1822] = String.fromCharCode (0xffff);
+data[1823] = String.fromCharCode (0xffff);
+data[1824] = String.fromCharCode (0xffff);
+data[1825] = String.fromCharCode (0xffff);
+data[1826] = String.fromCharCode (0xffff);
+data[1827] = String.fromCharCode (0xffff);
+data[1828] = String.fromCharCode (0xffff);
+data[1829] = String.fromCharCode (0xffff);
+data[1830] = String.fromCharCode (0xffff);
+data[1831] = String.fromCharCode (0xffff);
+data[1832] = String.fromCharCode (0xffff);
+data[1833] = String.fromCharCode (0xffff);
+data[1834] = String.fromCharCode (0xffff);
+data[1835] = String.fromCharCode (0xffff);
+data[1836] = String.fromCharCode (0xffff);
+data[1837] = String.fromCharCode (0xffff);
+data[1838] = String.fromCharCode (0xffff);
+data[1839] = String.fromCharCode (0xffff);
+data[1840] = String.fromCharCode (0xffff);
+data[1841] = String.fromCharCode (0xffff);
+data[1842] = String.fromCharCode (0xffff);
+data[1843] = String.fromCharCode (0xffff);
+data[1844] = String.fromCharCode (0xffff);
+data[1845] = String.fromCharCode (0xffff);
+data[1846] = String.fromCharCode (0xffff);
+data[1847] = String.fromCharCode (0xffff);
+data[1848] = String.fromCharCode (0xffff);
+data[1849] = String.fromCharCode (0xffff);
+data[1850] = String.fromCharCode (0xffff);
+data[1851] = String.fromCharCode (0xffff);
+data[1852] = String.fromCharCode (0xffff);
+data[1853] = String.fromCharCode (0xffff);
+data[1854] = String.fromCharCode (0xffff);
+data[1855] = String.fromCharCode (0xffff);
+data[1856] = String.fromCharCode (0xffff);
+data[1857] = String.fromCharCode (0xffff);
+data[1858] = String.fromCharCode (0xffff);
+data[1859] = String.fromCharCode (0xffff);
+data[1860] = String.fromCharCode (0xffff);
+data[1861] = String.fromCharCode (0xffff);
+data[1862] = String.fromCharCode (0xffff);
+data[1863] = String.fromCharCode (0xffff);
+data[1864] = String.fromCharCode (0xffff);
+data[1865] = String.fromCharCode (0xffff);
+data[1866] = String.fromCharCode (0xffff);
+data[1867] = String.fromCharCode (0xffff);
+data[1868] = String.fromCharCode (0xffff);
+data[1869] = String.fromCharCode (0xffff);
+data[1870] = String.fromCharCode (0xffff);
+data[1871] = String.fromCharCode (0xffff);
+data[1872] = String.fromCharCode (0xffff);
+data[1873] = String.fromCharCode (0xffff);
+data[1874] = String.fromCharCode (0xffff);
+data[1875] = String.fromCharCode (0xffff);
+data[1876] = String.fromCharCode (0xffff);
+data[1877] = String.fromCharCode (0xffff);
+data[1878] = String.fromCharCode (0xffff);
+data[1879] = String.fromCharCode (0xffff);
+data[1880] = String.fromCharCode (0xffff);
+data[1881] = String.fromCharCode (0xffff);
+data[1882] = String.fromCharCode (0xffff);
+data[1883] = String.fromCharCode (0xffff);
+data[1884] = String.fromCharCode (0xffff);
+data[1885] = String.fromCharCode (0xffff);
+data[1886] = String.fromCharCode (0xffff);
+data[1887] = String.fromCharCode (0xffff);
+data[1888] = String.fromCharCode (0xffff);
+data[1889] = String.fromCharCode (0xffff);
+data[1890] = String.fromCharCode (0xffff);
+data[1891] = String.fromCharCode (0xffff);
+data[1892] = String.fromCharCode (0xffff);
+data[1893] = String.fromCharCode (0xffff);
+data[1894] = String.fromCharCode (0xffff);
+data[1895] = String.fromCharCode (0xffff);
+data[1896] = String.fromCharCode (0xffff);
+data[1897] = String.fromCharCode (0xffff);
+data[1898] = String.fromCharCode (0xffff);
+data[1899] = String.fromCharCode (0xffff);
+data[1900] = String.fromCharCode (0xffff);
+data[1901] = String.fromCharCode (0xffff);
+data[1902] = String.fromCharCode (0xffff);
+data[1903] = String.fromCharCode (0xffff);
+data[1904] = String.fromCharCode (0xffff);
+data[1905] = String.fromCharCode (0xffff);
+data[1906] = String.fromCharCode (0xffff);
+data[1907] = String.fromCharCode (0xffff);
+data[1908] = String.fromCharCode (0xffff);
+data[1909] = String.fromCharCode (0xffff);
+data[1910] = String.fromCharCode (0xffff);
+data[1911] = String.fromCharCode (0xffff);
+data[1912] = String.fromCharCode (0xffff);
+data[1913] = String.fromCharCode (0xffff);
+data[1914] = String.fromCharCode (0xffff);
+data[1915] = String.fromCharCode (0xffff);
+data[1916] = String.fromCharCode (0xffff);
+data[1917] = String.fromCharCode (0xffff);
+data[1918] = String.fromCharCode (0xffff);
+data[1919] = String.fromCharCode (0xffff);
+data[1920] = String.fromCharCode (0xffff);
+data[1921] = String.fromCharCode (0xffff);
+data[1922] = String.fromCharCode (0xffff);
+data[1923] = String.fromCharCode (0xffff);
+data[1924] = String.fromCharCode (0xffff);
+data[1925] = String.fromCharCode (0xffff);
+data[1926] = String.fromCharCode (0xffff);
+data[1927] = String.fromCharCode (0xffff);
+data[1928] = String.fromCharCode (0xffff);
+data[1929] = String.fromCharCode (0xffff);
+data[1930] = String.fromCharCode (0xffff);
+data[1931] = String.fromCharCode (0xffff);
+data[1932] = String.fromCharCode (0xffff);
+data[1933] = String.fromCharCode (0xffff);
+data[1934] = String.fromCharCode (0xffff);
+data[1935] = String.fromCharCode (0xffff);
+data[1936] = String.fromCharCode (0xffff);
+data[1937] = String.fromCharCode (0xffff);
+data[1938] = String.fromCharCode (0xffff);
+data[1939] = String.fromCharCode (0xffff);
+data[1940] = String.fromCharCode (0xffff);
+data[1941] = String.fromCharCode (0xffff);
+data[1942] = String.fromCharCode (0xffff);
+data[1943] = String.fromCharCode (0xffff);
+data[1944] = String.fromCharCode (0xffff);
+data[1945] = String.fromCharCode (0xffff);
+data[1946] = String.fromCharCode (0xffff);
+data[1947] = String.fromCharCode (0xffff);
+data[1948] = String.fromCharCode (0xffff);
+data[1949] = String.fromCharCode (0xffff);
+data[1950] = String.fromCharCode (0xffff);
+data[1951] = String.fromCharCode (0xffff);
+data[1952] = String.fromCharCode (0xffff);
+data[1953] = String.fromCharCode (0xffff);
+data[1954] = String.fromCharCode (0xffff);
+data[1955] = String.fromCharCode (0xffff);
+data[1956] = String.fromCharCode (0xffff);
+data[1957] = String.fromCharCode (0xffff);
+data[1958] = String.fromCharCode (0xffff);
+data[1959] = String.fromCharCode (0xffff);
+data[1960] = String.fromCharCode (0xffff);
+data[1961] = String.fromCharCode (0xffff);
+data[1962] = String.fromCharCode (0xffff);
+data[1963] = String.fromCharCode (0xffff);
+data[1964] = String.fromCharCode (0xffff);
+data[1965] = String.fromCharCode (0xffff);
+data[1966] = String.fromCharCode (0xffff);
+data[1967] = String.fromCharCode (0xffff);
+data[1968] = String.fromCharCode (0xffff);
+data[1969] = String.fromCharCode (0xffff);
+data[1970] = String.fromCharCode (0xffff);
+data[1971] = String.fromCharCode (0xffff);
+data[1972] = String.fromCharCode (0xffff);
+data[1973] = String.fromCharCode (0xffff);
+data[1974] = String.fromCharCode (0xffff);
+data[1975] = String.fromCharCode (0xffff);
+data[1976] = String.fromCharCode (0xffff);
+data[1977] = String.fromCharCode (0xffff);
+data[1978] = String.fromCharCode (0xffff);
+data[1979] = String.fromCharCode (0xffff);
+data[1980] = String.fromCharCode (0xffff);
+data[1981] = String.fromCharCode (0xffff);
+data[1982] = String.fromCharCode (0xffff);
+data[1983] = String.fromCharCode (0xffff);
+data[1984] = String.fromCharCode (0xffff);
+data[1985] = String.fromCharCode (0xffff);
+data[1986] = String.fromCharCode (0xffff);
+data[1987] = String.fromCharCode (0xffff);
+data[1988] = String.fromCharCode (0xffff);
+data[1989] = String.fromCharCode (0xffff);
+data[1990] = String.fromCharCode (0xffff);
+data[1991] = String.fromCharCode (0xffff);
+data[1992] = String.fromCharCode (0xffff);
+data[1993] = String.fromCharCode (0xffff);
+data[1994] = String.fromCharCode (0xffff);
+data[1995] = String.fromCharCode (0xffff);
+data[1996] = String.fromCharCode (0xffff);
+data[1997] = String.fromCharCode (0xffff);
+data[1998] = String.fromCharCode (0xffff);
+data[1999] = String.fromCharCode (0xffff);
+data[2000] = String.fromCharCode (0xffff);
+data[2001] = String.fromCharCode (0xffff);
+data[2002] = String.fromCharCode (0xffff);
+data[2003] = String.fromCharCode (0xffff);
+data[2004] = String.fromCharCode (0xffff);
+data[2005] = String.fromCharCode (0xffff);
+data[2006] = String.fromCharCode (0xffff);
+data[2007] = String.fromCharCode (0xffff);
+data[2008] = String.fromCharCode (0xffff);
+data[2009] = String.fromCharCode (0xffff);
+data[2010] = String.fromCharCode (0xffff);
+data[2011] = String.fromCharCode (0xffff);
+data[2012] = String.fromCharCode (0xffff);
+data[2013] = String.fromCharCode (0xffff);
+data[2014] = String.fromCharCode (0xffff);
+data[2015] = String.fromCharCode (0xffff);
+data[2016] = String.fromCharCode (0xffff);
+data[2017] = String.fromCharCode (0xffff);
+data[2018] = String.fromCharCode (0xffff);
+data[2019] = String.fromCharCode (0xffff);
+data[2020] = String.fromCharCode (0xffff);
+data[2021] = String.fromCharCode (0xffff);
+data[2022] = String.fromCharCode (0xffff);
+data[2023] = String.fromCharCode (0xffff);
+data[2024] = String.fromCharCode (0xffff);
+data[2025] = String.fromCharCode (0xffff);
+data[2026] = String.fromCharCode (0xffff);
+data[2027] = String.fromCharCode (0xffff);
+data[2028] = String.fromCharCode (0xffff);
+data[2029] = String.fromCharCode (0xffff);
+data[2030] = String.fromCharCode (0xffff);
+data[2031] = String.fromCharCode (0xffff);
+data[2032] = String.fromCharCode (0xffff);
+data[2033] = String.fromCharCode (0xffff);
+data[2034] = String.fromCharCode (0xffff);
+data[2035] = String.fromCharCode (0xffff);
+data[2036] = String.fromCharCode (0xffff);
+data[2037] = String.fromCharCode (0xffff);
+data[2038] = String.fromCharCode (0xffff);
+data[2039] = String.fromCharCode (0xffff);
+data[2040] = String.fromCharCode (0xffff);
+data[2041] = String.fromCharCode (0xffff);
+data[2042] = String.fromCharCode (0xffff);
+data[2043] = String.fromCharCode (0xffff);
+data[2044] = String.fromCharCode (0xffff);
+data[2045] = String.fromCharCode (0xffff);
+data[2046] = String.fromCharCode (0xffff);
+data[2047] = String.fromCharCode (0xffff);
+data[2048] = String.fromCharCode (0xffff);
+data[2049] = String.fromCharCode (0xffff);
+data[2050] = String.fromCharCode (0xffff);
+data[2051] = String.fromCharCode (0xffff);
+data[2052] = String.fromCharCode (0xffff);
+data[2053] = String.fromCharCode (0xffff);
+data[2054] = String.fromCharCode (0xffff);
+data[2055] = String.fromCharCode (0xffff);
+data[2056] = String.fromCharCode (0xffff);
+data[2057] = String.fromCharCode (0xffff);
+data[2058] = String.fromCharCode (0xffff);
+data[2059] = String.fromCharCode (0xffff);
+data[2060] = String.fromCharCode (0xffff);
+data[2061] = String.fromCharCode (0xffff);
+data[2062] = String.fromCharCode (0xffff);
+data[2063] = String.fromCharCode (0xffff);
+data[2064] = String.fromCharCode (0xffff);
+data[2065] = String.fromCharCode (0xffff);
+data[2066] = String.fromCharCode (0xffff);
+data[2067] = String.fromCharCode (0xffff);
+data[2068] = String.fromCharCode (0xffff);
+data[2069] = String.fromCharCode (0xffff);
+data[2070] = String.fromCharCode (0xffff);
+data[2071] = String.fromCharCode (0xffff);
+data[2072] = String.fromCharCode (0xffff);
+data[2073] = String.fromCharCode (0xffff);
+data[2074] = String.fromCharCode (0xffff);
+data[2075] = String.fromCharCode (0xffff);
+data[2076] = String.fromCharCode (0xffff);
+data[2077] = String.fromCharCode (0xffff);
+data[2078] = String.fromCharCode (0xffff);
+data[2079] = String.fromCharCode (0xffff);
+data[2080] = String.fromCharCode (0xffff);
+data[2081] = String.fromCharCode (0xffff);
+data[2082] = String.fromCharCode (0xffff);
+data[2083] = String.fromCharCode (0xffff);
+data[2084] = String.fromCharCode (0xffff);
+data[2085] = String.fromCharCode (0xffff);
+data[2086] = String.fromCharCode (0xffff);
+data[2087] = String.fromCharCode (0xffff);
+data[2088] = String.fromCharCode (0xffff);
+data[2089] = String.fromCharCode (0xffff);
+data[2090] = String.fromCharCode (0xffff);
+data[2091] = String.fromCharCode (0xffff);
+data[2092] = String.fromCharCode (0xffff);
+data[2093] = String.fromCharCode (0xffff);
+data[2094] = String.fromCharCode (0xffff);
+data[2095] = String.fromCharCode (0xffff);
+data[2096] = String.fromCharCode (0xffff);
+data[2097] = String.fromCharCode (0xffff);
+data[2098] = String.fromCharCode (0xffff);
+data[2099] = String.fromCharCode (0xffff);
+data[2100] = String.fromCharCode (0xffff);
+data[2101] = String.fromCharCode (0xffff);
+data[2102] = String.fromCharCode (0xffff);
+data[2103] = String.fromCharCode (0xffff);
+data[2104] = String.fromCharCode (0xffff);
+data[2105] = String.fromCharCode (0xffff);
+data[2106] = String.fromCharCode (0xffff);
+data[2107] = String.fromCharCode (0xffff);
+data[2108] = String.fromCharCode (0xffff);
+data[2109] = String.fromCharCode (0xffff);
+data[2110] = String.fromCharCode (0xffff);
+data[2111] = String.fromCharCode (0xffff);
+data[2112] = String.fromCharCode (0xffff);
+data[2113] = String.fromCharCode (0xffff);
+data[2114] = String.fromCharCode (0xffff);
+data[2115] = String.fromCharCode (0xffff);
+data[2116] = String.fromCharCode (0xffff);
+data[2117] = String.fromCharCode (0xffff);
+data[2118] = String.fromCharCode (0xffff);
+data[2119] = String.fromCharCode (0xffff);
+data[2120] = String.fromCharCode (0xffff);
+data[2121] = String.fromCharCode (0xffff);
+data[2122] = String.fromCharCode (0xffff);
+data[2123] = String.fromCharCode (0xffff);
+data[2124] = String.fromCharCode (0xffff);
+data[2125] = String.fromCharCode (0xffff);
+data[2126] = String.fromCharCode (0xffff);
+data[2127] = String.fromCharCode (0xffff);
+data[2128] = String.fromCharCode (0xffff);
+data[2129] = String.fromCharCode (0xffff);
+data[2130] = String.fromCharCode (0xffff);
+data[2131] = String.fromCharCode (0xffff);
+data[2132] = String.fromCharCode (0xffff);
+data[2133] = String.fromCharCode (0xffff);
+data[2134] = String.fromCharCode (0xffff);
+data[2135] = String.fromCharCode (0xffff);
+data[2136] = String.fromCharCode (0xffff);
+data[2137] = String.fromCharCode (0xffff);
+data[2138] = String.fromCharCode (0xffff);
+data[2139] = String.fromCharCode (0xffff);
+data[2140] = String.fromCharCode (0xffff);
+data[2141] = String.fromCharCode (0xffff);
+data[2142] = String.fromCharCode (0xffff);
+data[2143] = String.fromCharCode (0xffff);
+data[2144] = String.fromCharCode (0xffff);
+data[2145] = String.fromCharCode (0xffff);
+data[2146] = String.fromCharCode (0xffff);
+data[2147] = String.fromCharCode (0xffff);
+data[2148] = String.fromCharCode (0xffff);
+data[2149] = String.fromCharCode (0xffff);
+data[2150] = String.fromCharCode (0xffff);
+data[2151] = String.fromCharCode (0xffff);
+data[2152] = String.fromCharCode (0xffff);
+data[2153] = String.fromCharCode (0xffff);
+data[2154] = String.fromCharCode (0xffff);
+data[2155] = String.fromCharCode (0xffff);
+data[2156] = String.fromCharCode (0xffff);
+data[2157] = String.fromCharCode (0xffff);
+data[2158] = String.fromCharCode (0xffff);
+data[2159] = String.fromCharCode (0xffff);
+data[2160] = String.fromCharCode (0xffff);
+data[2161] = String.fromCharCode (0xffff);
+data[2162] = String.fromCharCode (0xffff);
+data[2163] = String.fromCharCode (0xffff);
+data[2164] = String.fromCharCode (0xffff);
+data[2165] = String.fromCharCode (0xffff);
+data[2166] = String.fromCharCode (0xffff);
+data[2167] = String.fromCharCode (0xffff);
+data[2168] = String.fromCharCode (0xffff);
+data[2169] = String.fromCharCode (0xffff);
+data[2170] = String.fromCharCode (0xffff);
+data[2171] = String.fromCharCode (0xffff);
+data[2172] = String.fromCharCode (0xffff);
+data[2173] = String.fromCharCode (0xffff);
+data[2174] = String.fromCharCode (0xffff);
+data[2175] = String.fromCharCode (0xffff);
+data[2176] = String.fromCharCode (0xffff);
+data[2177] = String.fromCharCode (0xffff);
+data[2178] = String.fromCharCode (0xffff);
+data[2179] = String.fromCharCode (0xffff);
+data[2180] = String.fromCharCode (0xffff);
+data[2181] = String.fromCharCode (0xffff);
+data[2182] = String.fromCharCode (0xffff);
+data[2183] = String.fromCharCode (0xffff);
+data[2184] = String.fromCharCode (0xffff);
+data[2185] = String.fromCharCode (0xffff);
+data[2186] = String.fromCharCode (0xffff);
+data[2187] = String.fromCharCode (0xffff);
+data[2188] = String.fromCharCode (0xffff);
+data[2189] = String.fromCharCode (0xffff);
+data[2190] = String.fromCharCode (0xffff);
+data[2191] = String.fromCharCode (0xffff);
+data[2192] = String.fromCharCode (0xffff);
+data[2193] = String.fromCharCode (0xffff);
+data[2194] = String.fromCharCode (0xffff);
+data[2195] = String.fromCharCode (0xffff);
+data[2196] = String.fromCharCode (0xffff);
+data[2197] = String.fromCharCode (0xffff);
+data[2198] = String.fromCharCode (0xffff);
+data[2199] = String.fromCharCode (0xffff);
+data[2200] = String.fromCharCode (0xffff);
+data[2201] = String.fromCharCode (0xffff);
+data[2202] = String.fromCharCode (0xffff);
+data[2203] = String.fromCharCode (0xffff);
+data[2204] = String.fromCharCode (0xffff);
+data[2205] = String.fromCharCode (0xffff);
+data[2206] = String.fromCharCode (0xffff);
+data[2207] = String.fromCharCode (0xffff);
+data[2208] = String.fromCharCode (0xffff);
+data[2209] = String.fromCharCode (0xffff);
+data[2210] = String.fromCharCode (0xffff);
+data[2211] = String.fromCharCode (0xffff);
+data[2212] = String.fromCharCode (0xffff);
+data[2213] = String.fromCharCode (0xffff);
+data[2214] = String.fromCharCode (0xffff);
+data[2215] = String.fromCharCode (0xffff);
+data[2216] = String.fromCharCode (0xffff);
+data[2217] = String.fromCharCode (0xffff);
+data[2218] = String.fromCharCode (0xffff);
+data[2219] = String.fromCharCode (0xffff);
+data[2220] = String.fromCharCode (0xffff);
+data[2221] = String.fromCharCode (0xffff);
+data[2222] = String.fromCharCode (0xffff);
+data[2223] = String.fromCharCode (0xffff);
+data[2224] = String.fromCharCode (0xffff);
+data[2225] = String.fromCharCode (0xffff);
+data[2226] = String.fromCharCode (0xffff);
+data[2227] = String.fromCharCode (0xffff);
+data[2228] = String.fromCharCode (0xffff);
+data[2229] = String.fromCharCode (0xffff);
+data[2230] = String.fromCharCode (0xffff);
+data[2231] = String.fromCharCode (0xffff);
+data[2232] = String.fromCharCode (0xffff);
+data[2233] = String.fromCharCode (0xffff);
+data[2234] = String.fromCharCode (0xffff);
+data[2235] = String.fromCharCode (0xffff);
+data[2236] = String.fromCharCode (0xffff);
+data[2237] = String.fromCharCode (0xffff);
+data[2238] = String.fromCharCode (0xffff);
+data[2239] = String.fromCharCode (0xffff);
+data[2240] = String.fromCharCode (0xffff);
+data[2241] = String.fromCharCode (0xffff);
+data[2242] = String.fromCharCode (0xffff);
+data[2243] = String.fromCharCode (0xffff);
+data[2244] = String.fromCharCode (0xffff);
+data[2245] = String.fromCharCode (0xffff);
+data[2246] = String.fromCharCode (0xffff);
+data[2247] = String.fromCharCode (0xffff);
+data[2248] = String.fromCharCode (0xffff);
+data[2249] = String.fromCharCode (0xffff);
+data[2250] = String.fromCharCode (0xffff);
+data[2251] = String.fromCharCode (0xffff);
+data[2252] = String.fromCharCode (0xffff);
+data[2253] = String.fromCharCode (0xffff);
+data[2254] = String.fromCharCode (0xffff);
+data[2255] = String.fromCharCode (0xffff);
+data[2256] = String.fromCharCode (0xffff);
+data[2257] = String.fromCharCode (0xffff);
+data[2258] = String.fromCharCode (0xffff);
+data[2259] = String.fromCharCode (0xffff);
+data[2260] = String.fromCharCode (0xffff);
+data[2261] = String.fromCharCode (0xffff);
+data[2262] = String.fromCharCode (0xffff);
+data[2263] = String.fromCharCode (0xffff);
+data[2264] = String.fromCharCode (0xffff);
+data[2265] = String.fromCharCode (0xffff);
+data[2266] = String.fromCharCode (0xffff);
+data[2267] = String.fromCharCode (0xffff);
+data[2268] = String.fromCharCode (0xffff);
+data[2269] = String.fromCharCode (0xffff);
+data[2270] = String.fromCharCode (0xffff);
+data[2271] = String.fromCharCode (0xffff);
+data[2272] = String.fromCharCode (0xffff);
+data[2273] = String.fromCharCode (0xffff);
+data[2274] = String.fromCharCode (0xffff);
+data[2275] = String.fromCharCode (0xffff);
+data[2276] = String.fromCharCode (0xffff);
+data[2277] = String.fromCharCode (0xffff);
+data[2278] = String.fromCharCode (0xffff);
+data[2279] = String.fromCharCode (0xffff);
+data[2280] = String.fromCharCode (0xffff);
+data[2281] = String.fromCharCode (0xffff);
+data[2282] = String.fromCharCode (0xffff);
+data[2283] = String.fromCharCode (0xffff);
+data[2284] = String.fromCharCode (0xffff);
+data[2285] = String.fromCharCode (0xffff);
+data[2286] = String.fromCharCode (0xffff);
+data[2287] = String.fromCharCode (0xffff);
+data[2288] = String.fromCharCode (0xffff);
+data[2289] = String.fromCharCode (0xffff);
+data[2290] = String.fromCharCode (0xffff);
+data[2291] = String.fromCharCode (0xffff);
+data[2292] = String.fromCharCode (0xffff);
+data[2293] = String.fromCharCode (0xffff);
+data[2294] = String.fromCharCode (0xffff);
+data[2295] = String.fromCharCode (0xffff);
+data[2296] = String.fromCharCode (0xffff);
+data[2297] = String.fromCharCode (0xffff);
+data[2298] = String.fromCharCode (0xffff);
+data[2299] = String.fromCharCode (0xffff);
+data[2300] = String.fromCharCode (0xffff);
+data[2301] = String.fromCharCode (0xffff);
+data[2302] = String.fromCharCode (0xffff);
+data[2303] = String.fromCharCode (0xffff);
+data[2304] = String.fromCharCode (0xffff);
+data[2305] = String.fromCharCode (0xffff);
+data[2306] = String.fromCharCode (0xffff);
+data[2307] = String.fromCharCode (0xffff);
+data[2308] = String.fromCharCode (0xffff);
+data[2309] = String.fromCharCode (0xffff);
+data[2310] = String.fromCharCode (0xffff);
+data[2311] = String.fromCharCode (0xffff);
+data[2312] = String.fromCharCode (0xffff);
+data[2313] = String.fromCharCode (0xffff);
+data[2314] = String.fromCharCode (0xffff);
+data[2315] = String.fromCharCode (0xffff);
+data[2316] = String.fromCharCode (0xffff);
+data[2317] = String.fromCharCode (0xffff);
+data[2318] = String.fromCharCode (0xffff);
+data[2319] = String.fromCharCode (0xffff);
+data[2320] = String.fromCharCode (0xffff);
+data[2321] = String.fromCharCode (0xffff);
+data[2322] = String.fromCharCode (0xffff);
+data[2323] = String.fromCharCode (0xffff);
+data[2324] = String.fromCharCode (0xffff);
+data[2325] = String.fromCharCode (0xffff);
+data[2326] = String.fromCharCode (0xffff);
+data[2327] = String.fromCharCode (0xffff);
+data[2328] = String.fromCharCode (0xffff);
+data[2329] = String.fromCharCode (0xffff);
+data[2330] = String.fromCharCode (0xffff);
+data[2331] = String.fromCharCode (0xffff);
+data[2332] = String.fromCharCode (0xffff);
+data[2333] = String.fromCharCode (0xffff);
+data[2334] = String.fromCharCode (0xffff);
+data[2335] = String.fromCharCode (0xffff);
+data[2336] = String.fromCharCode (0xffff);
+data[2337] = String.fromCharCode (0xffff);
+data[2338] = String.fromCharCode (0xffff);
+data[2339] = String.fromCharCode (0xffff);
+data[2340] = String.fromCharCode (0xffff);
+data[2341] = String.fromCharCode (0xffff);
+data[2342] = String.fromCharCode (0xffff);
+data[2343] = String.fromCharCode (0xffff);
+data[2344] = String.fromCharCode (0xffff);
+data[2345] = String.fromCharCode (0xffff);
+data[2346] = String.fromCharCode (0xffff);
+data[2347] = String.fromCharCode (0xffff);
+data[2348] = String.fromCharCode (0xffff);
+data[2349] = String.fromCharCode (0xffff);
+data[2350] = String.fromCharCode (0xffff);
+data[2351] = String.fromCharCode (0xffff);
+data[2352] = String.fromCharCode (0xffff);
+data[2353] = String.fromCharCode (0xffff);
+data[2354] = String.fromCharCode (0xffff);
+data[2355] = String.fromCharCode (0xffff);
+data[2356] = String.fromCharCode (0xffff);
+data[2357] = String.fromCharCode (0xffff);
+data[2358] = String.fromCharCode (0xffff);
+data[2359] = String.fromCharCode (0xffff);
+data[2360] = String.fromCharCode (0xffff);
+data[2361] = String.fromCharCode (0xffff);
+data[2362] = String.fromCharCode (0xffff);
+data[2363] = String.fromCharCode (0xffff);
+data[2364] = String.fromCharCode (0xffff);
+data[2365] = String.fromCharCode (0xffff);
+data[2366] = String.fromCharCode (0xffff);
+data[2367] = String.fromCharCode (0xffff);
+data[2368] = String.fromCharCode (0xffff);
+data[2369] = String.fromCharCode (0xffff);
+data[2370] = String.fromCharCode (0xffff);
+data[2371] = String.fromCharCode (0xffff);
+data[2372] = String.fromCharCode (0xffff);
+data[2373] = String.fromCharCode (0xffff);
+data[2374] = String.fromCharCode (0xffff);
+data[2375] = String.fromCharCode (0xffff);
+data[2376] = String.fromCharCode (0xffff);
+data[2377] = String.fromCharCode (0xffff);
+data[2378] = String.fromCharCode (0xffff);
+data[2379] = String.fromCharCode (0xffff);
+data[2380] = String.fromCharCode (0xffff);
+data[2381] = String.fromCharCode (0xffff);
+data[2382] = String.fromCharCode (0xffff);
+data[2383] = String.fromCharCode (0xffff);
+data[2384] = String.fromCharCode (0xffff);
+data[2385] = String.fromCharCode (0xffff);
+data[2386] = String.fromCharCode (0xffff);
+data[2387] = String.fromCharCode (0xffff);
+data[2388] = String.fromCharCode (0xffff);
+data[2389] = String.fromCharCode (0xffff);
+data[2390] = String.fromCharCode (0xffff);
+data[2391] = String.fromCharCode (0xffff);
+data[2392] = String.fromCharCode (0xffff);
+data[2393] = String.fromCharCode (0xffff);
+data[2394] = String.fromCharCode (0xffff);
+data[2395] = String.fromCharCode (0xffff);
+data[2396] = String.fromCharCode (0xffff);
+data[2397] = String.fromCharCode (0xffff);
+data[2398] = String.fromCharCode (0xffff);
+data[2399] = String.fromCharCode (0xffff);
+data[2400] = String.fromCharCode (0xffff);
+data[2401] = String.fromCharCode (0xffff);
+data[2402] = String.fromCharCode (0xffff);
+data[2403] = String.fromCharCode (0xffff);
+data[2404] = String.fromCharCode (0xffff);
+data[2405] = String.fromCharCode (0xffff);
+data[2406] = String.fromCharCode (0xffff);
+data[2407] = String.fromCharCode (0xffff);
+data[2408] = String.fromCharCode (0xffff);
+data[2409] = String.fromCharCode (0xffff);
+data[2410] = String.fromCharCode (0xffff);
+data[2411] = String.fromCharCode (0xffff);
+data[2412] = String.fromCharCode (0xffff);
+data[2413] = String.fromCharCode (0xffff);
+data[2414] = String.fromCharCode (0xffff);
+data[2415] = String.fromCharCode (0xffff);
+data[2416] = String.fromCharCode (0xffff);
+data[2417] = String.fromCharCode (0xffff);
+data[2418] = String.fromCharCode (0xffff);
+data[2419] = String.fromCharCode (0xffff);
+data[2420] = String.fromCharCode (0xffff);
+data[2421] = String.fromCharCode (0xffff);
+data[2422] = String.fromCharCode (0xffff);
+data[2423] = String.fromCharCode (0xffff);
+data[2424] = String.fromCharCode (0xffff);
+data[2425] = String.fromCharCode (0xffff);
+data[2426] = String.fromCharCode (0xffff);
+data[2427] = String.fromCharCode (0xffff);
+data[2428] = String.fromCharCode (0xffff);
+data[2429] = String.fromCharCode (0xffff);
+data[2430] = String.fromCharCode (0xffff);
+data[2431] = String.fromCharCode (0xffff);
+data[2432] = String.fromCharCode (0xffff);
+data[2433] = String.fromCharCode (0xffff);
+data[2434] = String.fromCharCode (0xffff);
+data[2435] = String.fromCharCode (0xffff);
+data[2436] = String.fromCharCode (0xffff);
+data[2437] = String.fromCharCode (0xffff);
+data[2438] = String.fromCharCode (0xffff);
+data[2439] = String.fromCharCode (0xffff);
+data[2440] = String.fromCharCode (0xffff);
+data[2441] = String.fromCharCode (0xffff);
+data[2442] = String.fromCharCode (0xffff);
+data[2443] = String.fromCharCode (0xffff);
+data[2444] = String.fromCharCode (0xffff);
+data[2445] = String.fromCharCode (0xffff);
+data[2446] = String.fromCharCode (0xffff);
+data[2447] = String.fromCharCode (0xffff);
+data[2448] = String.fromCharCode (0xffff);
+data[2449] = String.fromCharCode (0xffff);
+data[2450] = String.fromCharCode (0xffff);
+data[2451] = String.fromCharCode (0xffff);
+data[2452] = String.fromCharCode (0xffff);
+data[2453] = String.fromCharCode (0xffff);
+data[2454] = String.fromCharCode (0xffff);
+data[2455] = String.fromCharCode (0xffff);
+data[2456] = String.fromCharCode (0xffff);
+data[2457] = String.fromCharCode (0xffff);
+data[2458] = String.fromCharCode (0xffff);
+data[2459] = String.fromCharCode (0xffff);
+data[2460] = String.fromCharCode (0xffff);
+data[2461] = String.fromCharCode (0xffff);
+data[2462] = String.fromCharCode (0xffff);
+data[2463] = String.fromCharCode (0xffff);
+data[2464] = String.fromCharCode (0xffff);
+data[2465] = String.fromCharCode (0xffff);
+data[2466] = String.fromCharCode (0xffff);
+data[2467] = String.fromCharCode (0xffff);
+data[2468] = String.fromCharCode (0xffff);
+data[2469] = String.fromCharCode (0xffff);
+data[2470] = String.fromCharCode (0xffff);
+data[2471] = String.fromCharCode (0xffff);
+data[2472] = String.fromCharCode (0xffff);
+data[2473] = String.fromCharCode (0xffff);
+data[2474] = String.fromCharCode (0xffff);
+data[2475] = String.fromCharCode (0xffff);
+data[2476] = String.fromCharCode (0xffff);
+data[2477] = String.fromCharCode (0xffff);
+data[2478] = String.fromCharCode (0xffff);
+data[2479] = String.fromCharCode (0xffff);
+data[2480] = String.fromCharCode (0xffff);
+data[2481] = String.fromCharCode (0xffff);
+data[2482] = String.fromCharCode (0xffff);
+data[2483] = String.fromCharCode (0xffff);
+data[2484] = String.fromCharCode (0xffff);
+data[2485] = String.fromCharCode (0xffff);
+data[2486] = String.fromCharCode (0xffff);
+data[2487] = String.fromCharCode (0xffff);
+data[2488] = String.fromCharCode (0xffff);
+data[2489] = String.fromCharCode (0xffff);
+data[2490] = String.fromCharCode (0xffff);
+data[2491] = String.fromCharCode (0xffff);
+data[2492] = String.fromCharCode (0xffff);
+data[2493] = String.fromCharCode (0xffff);
+data[2494] = String.fromCharCode (0xffff);
+data[2495] = String.fromCharCode (0xffff);
+data[2496] = String.fromCharCode (0xffff);
+data[2497] = String.fromCharCode (0xffff);
+data[2498] = String.fromCharCode (0xffff);
+data[2499] = String.fromCharCode (0xffff);
+data[2500] = String.fromCharCode (0xffff);
+data[2501] = String.fromCharCode (0xffff);
+data[2502] = String.fromCharCode (0xffff);
+data[2503] = String.fromCharCode (0xffff);
+data[2504] = String.fromCharCode (0xffff);
+data[2505] = String.fromCharCode (0xffff);
+data[2506] = String.fromCharCode (0xffff);
+data[2507] = String.fromCharCode (0xffff);
+data[2508] = String.fromCharCode (0xffff);
+data[2509] = String.fromCharCode (0xffff);
+data[2510] = String.fromCharCode (0xffff);
+data[2511] = String.fromCharCode (0xffff);
+data[2512] = String.fromCharCode (0xffff);
+data[2513] = String.fromCharCode (0xffff);
+data[2514] = String.fromCharCode (0xffff);
+data[2515] = String.fromCharCode (0xffff);
+data[2516] = String.fromCharCode (0xffff);
+data[2517] = String.fromCharCode (0xffff);
+data[2518] = String.fromCharCode (0xffff);
+data[2519] = String.fromCharCode (0xffff);
+data[2520] = String.fromCharCode (0xffff);
+data[2521] = String.fromCharCode (0xffff);
+data[2522] = String.fromCharCode (0xffff);
+data[2523] = String.fromCharCode (0xffff);
+data[2524] = String.fromCharCode (0xffff);
+data[2525] = String.fromCharCode (0xffff);
+data[2526] = String.fromCharCode (0xffff);
+data[2527] = String.fromCharCode (0xffff);
+data[2528] = String.fromCharCode (0xffff);
+data[2529] = String.fromCharCode (0xffff);
+data[2530] = String.fromCharCode (0xffff);
+data[2531] = String.fromCharCode (0xffff);
+data[2532] = String.fromCharCode (0xffff);
+data[2533] = String.fromCharCode (0xffff);
+data[2534] = String.fromCharCode (0xffff);
+data[2535] = String.fromCharCode (0xffff);
+data[2536] = String.fromCharCode (0xffff);
+data[2537] = String.fromCharCode (0xffff);
+data[2538] = String.fromCharCode (0xffff);
+data[2539] = String.fromCharCode (0xffff);
+data[2540] = String.fromCharCode (0xffff);
+data[2541] = String.fromCharCode (0xffff);
+data[2542] = String.fromCharCode (0xffff);
+data[2543] = String.fromCharCode (0xffff);
+data[2544] = String.fromCharCode (0xffff);
+data[2545] = String.fromCharCode (0xffff);
+data[2546] = String.fromCharCode (0xffff);
+data[2547] = String.fromCharCode (0xffff);
+data[2548] = String.fromCharCode (0xffff);
+data[2549] = String.fromCharCode (0xffff);
+data[2550] = String.fromCharCode (0xffff);
+data[2551] = String.fromCharCode (0xffff);
+data[2552] = String.fromCharCode (0xffff);
+data[2553] = String.fromCharCode (0xffff);
+data[2554] = String.fromCharCode (0x003f);
+data[2752] = String.fromCharCode (0xffff);
+data[2753] = String.fromCharCode (0xffff);
+data[2754] = String.fromCharCode (0xffff);
+data[2755] = String.fromCharCode (0xffff);
+data[2756] = String.fromCharCode (0xffff);
+data[2757] = String.fromCharCode (0xffff);
+data[2758] = String.fromCharCode (0xffff);
+data[2759] = String.fromCharCode (0xffff);
+data[2760] = String.fromCharCode (0xffff);
+data[2761] = String.fromCharCode (0xffff);
+data[2762] = String.fromCharCode (0xffff);
+data[2763] = String.fromCharCode (0xffff);
+data[2764] = String.fromCharCode (0xffff);
+data[2765] = String.fromCharCode (0xffff);
+data[2766] = String.fromCharCode (0xffff);
+data[2767] = String.fromCharCode (0xffff);
+data[2768] = String.fromCharCode (0xffff);
+data[2769] = String.fromCharCode (0xffff);
+data[2770] = String.fromCharCode (0xffff);
+data[2771] = String.fromCharCode (0xffff);
+data[2772] = String.fromCharCode (0xffff);
+data[2773] = String.fromCharCode (0xffff);
+data[2774] = String.fromCharCode (0xffff);
+data[2775] = String.fromCharCode (0xffff);
+data[2776] = String.fromCharCode (0xffff);
+data[2777] = String.fromCharCode (0xffff);
+data[2778] = String.fromCharCode (0xffff);
+data[2779] = String.fromCharCode (0xffff);
+data[2780] = String.fromCharCode (0xffff);
+data[2781] = String.fromCharCode (0xffff);
+data[2782] = String.fromCharCode (0xffff);
+data[2783] = String.fromCharCode (0xffff);
+data[2784] = String.fromCharCode (0xffff);
+data[2785] = String.fromCharCode (0xffff);
+data[2786] = String.fromCharCode (0xffff);
+data[2787] = String.fromCharCode (0xffff);
+data[2788] = String.fromCharCode (0xffff);
+data[2789] = String.fromCharCode (0xffff);
+data[2790] = String.fromCharCode (0xffff);
+data[2791] = String.fromCharCode (0xffff);
+data[2792] = String.fromCharCode (0xffff);
+data[2793] = String.fromCharCode (0xffff);
+data[2794] = String.fromCharCode (0xffff);
+data[2795] = String.fromCharCode (0xffff);
+data[2796] = String.fromCharCode (0xffff);
+data[2797] = String.fromCharCode (0xffff);
+data[2798] = String.fromCharCode (0xffff);
+data[2799] = String.fromCharCode (0xffff);
+data[2800] = String.fromCharCode (0xffff);
+data[2801] = String.fromCharCode (0xffff);
+data[2802] = String.fromCharCode (0xffff);
+data[2803] = String.fromCharCode (0xffff);
+data[2804] = String.fromCharCode (0xffff);
+data[2805] = String.fromCharCode (0xffff);
+data[2806] = String.fromCharCode (0xffff);
+data[2807] = String.fromCharCode (0xffff);
+data[2808] = String.fromCharCode (0xffff);
+data[2809] = String.fromCharCode (0xffff);
+data[2810] = String.fromCharCode (0xffff);
+data[2811] = String.fromCharCode (0xffff);
+data[2812] = String.fromCharCode (0xffff);
+data[2813] = String.fromCharCode (0xffff);
+data[2814] = String.fromCharCode (0xffff);
+data[2815] = String.fromCharCode (0xffff);
+data[2816] = String.fromCharCode (0xffff);
+data[2817] = String.fromCharCode (0xffff);
+data[2818] = String.fromCharCode (0xffff);
+data[2819] = String.fromCharCode (0xffff);
+data[2820] = String.fromCharCode (0xffff);
+data[2821] = String.fromCharCode (0xffff);
+data[2822] = String.fromCharCode (0xffff);
+data[2823] = String.fromCharCode (0xffff);
+data[2824] = String.fromCharCode (0xffff);
+data[2825] = String.fromCharCode (0xffff);
+data[2826] = String.fromCharCode (0xffff);
+data[2827] = String.fromCharCode (0xffff);
+data[2828] = String.fromCharCode (0xffff);
+data[2829] = String.fromCharCode (0xffff);
+data[2830] = String.fromCharCode (0xffff);
+data[2831] = String.fromCharCode (0xffff);
+data[2832] = String.fromCharCode (0xffff);
+data[2833] = String.fromCharCode (0xffff);
+data[2834] = String.fromCharCode (0xffff);
+data[2835] = String.fromCharCode (0xffff);
+data[2836] = String.fromCharCode (0xffff);
+data[2837] = String.fromCharCode (0xffff);
+data[2838] = String.fromCharCode (0xffff);
+data[2839] = String.fromCharCode (0xffff);
+data[2840] = String.fromCharCode (0xffff);
+data[2841] = String.fromCharCode (0xffff);
+data[2842] = String.fromCharCode (0xffff);
+data[2843] = String.fromCharCode (0xffff);
+data[2844] = String.fromCharCode (0xffff);
+data[2845] = String.fromCharCode (0xffff);
+data[2846] = String.fromCharCode (0xffff);
+data[2847] = String.fromCharCode (0xffff);
+data[2848] = String.fromCharCode (0xffff);
+data[2849] = String.fromCharCode (0xffff);
+data[2850] = String.fromCharCode (0xffff);
+data[2851] = String.fromCharCode (0xffff);
+data[2852] = String.fromCharCode (0xffff);
+data[2853] = String.fromCharCode (0xffff);
+data[2854] = String.fromCharCode (0xffff);
+data[2855] = String.fromCharCode (0xffff);
+data[2856] = String.fromCharCode (0xffff);
+data[2857] = String.fromCharCode (0xffff);
+data[2858] = String.fromCharCode (0xffff);
+data[2859] = String.fromCharCode (0xffff);
+data[2860] = String.fromCharCode (0xffff);
+data[2861] = String.fromCharCode (0xffff);
+data[2862] = String.fromCharCode (0xffff);
+data[2863] = String.fromCharCode (0xffff);
+data[2864] = String.fromCharCode (0xffff);
+data[2865] = String.fromCharCode (0xffff);
+data[2866] = String.fromCharCode (0xffff);
+data[2867] = String.fromCharCode (0xffff);
+data[2868] = String.fromCharCode (0xffff);
+data[2869] = String.fromCharCode (0xffff);
+data[2870] = String.fromCharCode (0xffff);
+data[2871] = String.fromCharCode (0xffff);
+data[2872] = String.fromCharCode (0xffff);
+data[2873] = String.fromCharCode (0xffff);
+data[2874] = String.fromCharCode (0xffff);
+data[2875] = String.fromCharCode (0xffff);
+data[2876] = String.fromCharCode (0xffff);
+data[2877] = String.fromCharCode (0xffff);
+data[2878] = String.fromCharCode (0xffff);
+data[2879] = String.fromCharCode (0xffff);
+data[2880] = String.fromCharCode (0xffff);
+data[2881] = String.fromCharCode (0xffff);
+data[2882] = String.fromCharCode (0xffff);
+data[2883] = String.fromCharCode (0xffff);
+data[2884] = String.fromCharCode (0xffff);
+data[2885] = String.fromCharCode (0xffff);
+data[2886] = String.fromCharCode (0xffff);
+data[2887] = String.fromCharCode (0xffff);
+data[2888] = String.fromCharCode (0xffff);
+data[2889] = String.fromCharCode (0xffff);
+data[2890] = String.fromCharCode (0xffff);
+data[2891] = String.fromCharCode (0xffff);
+data[2892] = String.fromCharCode (0xffff);
+data[2893] = String.fromCharCode (0xffff);
+data[2894] = String.fromCharCode (0xffff);
+data[2895] = String.fromCharCode (0xffff);
+data[2896] = String.fromCharCode (0xffff);
+data[2897] = String.fromCharCode (0xffff);
+data[2898] = String.fromCharCode (0xffff);
+data[2899] = String.fromCharCode (0xffff);
+data[2900] = String.fromCharCode (0xffff);
+data[2901] = String.fromCharCode (0xffff);
+data[2902] = String.fromCharCode (0xffff);
+data[2903] = String.fromCharCode (0xffff);
+data[2904] = String.fromCharCode (0xffff);
+data[2905] = String.fromCharCode (0xffff);
+data[2906] = String.fromCharCode (0xffff);
+data[2907] = String.fromCharCode (0xffff);
+data[2908] = String.fromCharCode (0xffff);
+data[2909] = String.fromCharCode (0xffff);
+data[2910] = String.fromCharCode (0xffff);
+data[2911] = String.fromCharCode (0xffff);
+data[2912] = String.fromCharCode (0xffff);
+data[2913] = String.fromCharCode (0xffff);
+data[2914] = String.fromCharCode (0xffff);
+data[2915] = String.fromCharCode (0xffff);
+data[2916] = String.fromCharCode (0xffff);
+data[2917] = String.fromCharCode (0xffff);
+data[2918] = String.fromCharCode (0xffff);
+data[2919] = String.fromCharCode (0xffff);
+data[2920] = String.fromCharCode (0xffff);
+data[2921] = String.fromCharCode (0xffff);
+data[2922] = String.fromCharCode (0xffff);
+data[2923] = String.fromCharCode (0xffff);
+data[2924] = String.fromCharCode (0xffff);
+data[2925] = String.fromCharCode (0xffff);
+data[2926] = String.fromCharCode (0xffff);
+data[2927] = String.fromCharCode (0xffff);
+data[2928] = String.fromCharCode (0xffff);
+data[2929] = String.fromCharCode (0xffff);
+data[2930] = String.fromCharCode (0xffff);
+data[2931] = String.fromCharCode (0xffff);
+data[2932] = String.fromCharCode (0xffff);
+data[2933] = String.fromCharCode (0xffff);
+data[2934] = String.fromCharCode (0xffff);
+data[2935] = String.fromCharCode (0xffff);
+data[2936] = String.fromCharCode (0xffff);
+data[2937] = String.fromCharCode (0xffff);
+data[2938] = String.fromCharCode (0xffff);
+data[2939] = String.fromCharCode (0xffff);
+data[2940] = String.fromCharCode (0xffff);
+data[2941] = String.fromCharCode (0xffff);
+data[2942] = String.fromCharCode (0xffff);
+data[2943] = String.fromCharCode (0xffff);
+data[2944] = String.fromCharCode (0xffff);
+data[2945] = String.fromCharCode (0xffff);
+data[2946] = String.fromCharCode (0xffff);
+data[2947] = String.fromCharCode (0xffff);
+data[2948] = String.fromCharCode (0xffff);
+data[2949] = String.fromCharCode (0xffff);
+data[2950] = String.fromCharCode (0xffff);
+data[2951] = String.fromCharCode (0xffff);
+data[2952] = String.fromCharCode (0xffff);
+data[2953] = String.fromCharCode (0xffff);
+data[2954] = String.fromCharCode (0xffff);
+data[2955] = String.fromCharCode (0xffff);
+data[2956] = String.fromCharCode (0xffff);
+data[2957] = String.fromCharCode (0xffff);
+data[2958] = String.fromCharCode (0xffff);
+data[2959] = String.fromCharCode (0xffff);
+data[2960] = String.fromCharCode (0xffff);
+data[2961] = String.fromCharCode (0xffff);
+data[2962] = String.fromCharCode (0xffff);
+data[2963] = String.fromCharCode (0xffff);
+data[2964] = String.fromCharCode (0xffff);
+data[2965] = String.fromCharCode (0xffff);
+data[2966] = String.fromCharCode (0xffff);
+data[2967] = String.fromCharCode (0xffff);
+data[2968] = String.fromCharCode (0xffff);
+data[2969] = String.fromCharCode (0xffff);
+data[2970] = String.fromCharCode (0xffff);
+data[2971] = String.fromCharCode (0xffff);
+data[2972] = String.fromCharCode (0xffff);
+data[2973] = String.fromCharCode (0xffff);
+data[2974] = String.fromCharCode (0xffff);
+data[2975] = String.fromCharCode (0xffff);
+data[2976] = String.fromCharCode (0xffff);
+data[2977] = String.fromCharCode (0xffff);
+data[2978] = String.fromCharCode (0xffff);
+data[2979] = String.fromCharCode (0xffff);
+data[2980] = String.fromCharCode (0xffff);
+data[2981] = String.fromCharCode (0xffff);
+data[2982] = String.fromCharCode (0xffff);
+data[2983] = String.fromCharCode (0xffff);
+data[2984] = String.fromCharCode (0xffff);
+data[2985] = String.fromCharCode (0xffff);
+data[2986] = String.fromCharCode (0xffff);
+data[2987] = String.fromCharCode (0xffff);
+data[2988] = String.fromCharCode (0xffff);
+data[2989] = String.fromCharCode (0xffff);
+data[2990] = String.fromCharCode (0xffff);
+data[2991] = String.fromCharCode (0xffff);
+data[2992] = String.fromCharCode (0xffff);
+data[2993] = String.fromCharCode (0xffff);
+data[2994] = String.fromCharCode (0xffff);
+data[2995] = String.fromCharCode (0xffff);
+data[2996] = String.fromCharCode (0xffff);
+data[2997] = String.fromCharCode (0xffff);
+data[2998] = String.fromCharCode (0xffff);
+data[2999] = String.fromCharCode (0xffff);
+data[3000] = String.fromCharCode (0xffff);
+data[3001] = String.fromCharCode (0xffff);
+data[3002] = String.fromCharCode (0xffff);
+data[3003] = String.fromCharCode (0xffff);
+data[3004] = String.fromCharCode (0xffff);
+data[3005] = String.fromCharCode (0xffff);
+data[3006] = String.fromCharCode (0xffff);
+data[3007] = String.fromCharCode (0xffff);
+data[3008] = String.fromCharCode (0xffff);
+data[3009] = String.fromCharCode (0xffff);
+data[3010] = String.fromCharCode (0xffff);
+data[3011] = String.fromCharCode (0xffff);
+data[3012] = String.fromCharCode (0xffff);
+data[3013] = String.fromCharCode (0xffff);
+data[3014] = String.fromCharCode (0xffff);
+data[3015] = String.fromCharCode (0xffff);
+data[3016] = String.fromCharCode (0xffff);
+data[3017] = String.fromCharCode (0xffff);
+data[3018] = String.fromCharCode (0xffff);
+data[3019] = String.fromCharCode (0xffff);
+data[3020] = String.fromCharCode (0xffff);
+data[3021] = String.fromCharCode (0xffff);
+data[3022] = String.fromCharCode (0xffff);
+data[3023] = String.fromCharCode (0xffff);
+data[3024] = String.fromCharCode (0xffff);
+data[3025] = String.fromCharCode (0xffff);
+data[3026] = String.fromCharCode (0xffff);
+data[3027] = String.fromCharCode (0xffff);
+data[3028] = String.fromCharCode (0xffff);
+data[3029] = String.fromCharCode (0xffff);
+data[3030] = String.fromCharCode (0xffff);
+data[3031] = String.fromCharCode (0xffff);
+data[3032] = String.fromCharCode (0xffff);
+data[3033] = String.fromCharCode (0xffff);
+data[3034] = String.fromCharCode (0xffff);
+data[3035] = String.fromCharCode (0xffff);
+data[3036] = String.fromCharCode (0xffff);
+data[3037] = String.fromCharCode (0xffff);
+data[3038] = String.fromCharCode (0xffff);
+data[3039] = String.fromCharCode (0xffff);
+data[3040] = String.fromCharCode (0xffff);
+data[3041] = String.fromCharCode (0xffff);
+data[3042] = String.fromCharCode (0xffff);
+data[3043] = String.fromCharCode (0xffff);
+data[3044] = String.fromCharCode (0xffff);
+data[3045] = String.fromCharCode (0xffff);
+data[3046] = String.fromCharCode (0xffff);
+data[3047] = String.fromCharCode (0xffff);
+data[3048] = String.fromCharCode (0xffff);
+data[3049] = String.fromCharCode (0xffff);
+data[3050] = String.fromCharCode (0xffff);
+data[3051] = String.fromCharCode (0xffff);
+data[3052] = String.fromCharCode (0xffff);
+data[3053] = String.fromCharCode (0xffff);
+data[3054] = String.fromCharCode (0xffff);
+data[3055] = String.fromCharCode (0xffff);
+data[3056] = String.fromCharCode (0xffff);
+data[3057] = String.fromCharCode (0xffff);
+data[3058] = String.fromCharCode (0xffff);
+data[3059] = String.fromCharCode (0xffff);
+data[3060] = String.fromCharCode (0xffff);
+data[3061] = String.fromCharCode (0xffff);
+data[3062] = String.fromCharCode (0xffff);
+data[3063] = String.fromCharCode (0xffff);
+data[3064] = String.fromCharCode (0xffff);
+data[3065] = String.fromCharCode (0xffff);
+data[3066] = String.fromCharCode (0xffff);
+data[3067] = String.fromCharCode (0xffff);
+data[3068] = String.fromCharCode (0xffff);
+data[3069] = String.fromCharCode (0xffff);
+data[3070] = String.fromCharCode (0xffff);
+data[3071] = String.fromCharCode (0xffff);
+data[3072] = String.fromCharCode (0xffff);
+data[3073] = String.fromCharCode (0xffff);
+data[3074] = String.fromCharCode (0xffff);
+data[3075] = String.fromCharCode (0xffff);
+data[3076] = String.fromCharCode (0xffff);
+data[3077] = String.fromCharCode (0xffff);
+data[3078] = String.fromCharCode (0xffff);
+data[3079] = String.fromCharCode (0xffff);
+data[3080] = String.fromCharCode (0xffff);
+data[3081] = String.fromCharCode (0xffff);
+data[3082] = String.fromCharCode (0xffff);
+data[3083] = String.fromCharCode (0xffff);
+data[3084] = String.fromCharCode (0xffff);
+data[3085] = String.fromCharCode (0xffff);
+data[3086] = String.fromCharCode (0xffff);
+data[3087] = String.fromCharCode (0xffff);
+data[3088] = String.fromCharCode (0xffff);
+data[3089] = String.fromCharCode (0xffff);
+data[3090] = String.fromCharCode (0xffff);
+data[3091] = String.fromCharCode (0xffff);
+data[3092] = String.fromCharCode (0xffff);
+data[3093] = String.fromCharCode (0xffff);
+data[3094] = String.fromCharCode (0xffff);
+data[3095] = String.fromCharCode (0xffff);
+data[3096] = String.fromCharCode (0xffff);
+data[3097] = String.fromCharCode (0xffff);
+data[3098] = String.fromCharCode (0xffff);
+data[3099] = String.fromCharCode (0xffff);
+data[3100] = String.fromCharCode (0xffff);
+data[3101] = String.fromCharCode (0xffff);
+data[3102] = String.fromCharCode (0xffff);
+data[3103] = String.fromCharCode (0xffff);
+data[3104] = String.fromCharCode (0xffff);
+data[3105] = String.fromCharCode (0xffff);
+data[3106] = String.fromCharCode (0xffff);
+data[3107] = String.fromCharCode (0xffff);
+data[3108] = String.fromCharCode (0xffff);
+data[3109] = String.fromCharCode (0xffff);
+data[3110] = String.fromCharCode (0xffff);
+data[3111] = String.fromCharCode (0xffff);
+data[3112] = String.fromCharCode (0xffff);
+data[3113] = String.fromCharCode (0xffff);
+data[3114] = String.fromCharCode (0xffff);
+data[3115] = String.fromCharCode (0xffff);
+data[3116] = String.fromCharCode (0xffff);
+data[3117] = String.fromCharCode (0xffff);
+data[3118] = String.fromCharCode (0xffff);
+data[3119] = String.fromCharCode (0xffff);
+data[3120] = String.fromCharCode (0xffff);
+data[3121] = String.fromCharCode (0xffff);
+data[3122] = String.fromCharCode (0xffff);
+data[3123] = String.fromCharCode (0xffff);
+data[3124] = String.fromCharCode (0xffff);
+data[3125] = String.fromCharCode (0xffff);
+data[3126] = String.fromCharCode (0xffff);
+data[3127] = String.fromCharCode (0xffff);
+data[3128] = String.fromCharCode (0xffff);
+data[3129] = String.fromCharCode (0xffff);
+data[3130] = String.fromCharCode (0xffff);
+data[3131] = String.fromCharCode (0xffff);
+data[3132] = String.fromCharCode (0xffff);
+data[3133] = String.fromCharCode (0xffff);
+data[3134] = String.fromCharCode (0xffff);
+data[3135] = String.fromCharCode (0xffff);
+data[3136] = String.fromCharCode (0xffff);
+data[3137] = String.fromCharCode (0xffff);
+data[3138] = String.fromCharCode (0xffff);
+data[3139] = String.fromCharCode (0xffff);
+data[3140] = String.fromCharCode (0xffff);
+data[3141] = String.fromCharCode (0xffff);
+data[3142] = String.fromCharCode (0xffff);
+data[3143] = String.fromCharCode (0xffff);
+data[3144] = String.fromCharCode (0xffff);
+data[3145] = String.fromCharCode (0xffff);
+data[3146] = String.fromCharCode (0xffff);
+data[3147] = String.fromCharCode (0xffff);
+data[3148] = String.fromCharCode (0xffff);
+data[3149] = String.fromCharCode (0xffff);
+data[3150] = String.fromCharCode (0xffff);
+data[3151] = String.fromCharCode (0xffff);
+data[3152] = String.fromCharCode (0xffff);
+data[3153] = String.fromCharCode (0xffff);
+data[3154] = String.fromCharCode (0xffff);
+data[3155] = String.fromCharCode (0xffff);
+data[3156] = String.fromCharCode (0xffff);
+data[3157] = String.fromCharCode (0xffff);
+data[3158] = String.fromCharCode (0xffff);
+data[3159] = String.fromCharCode (0xffff);
+data[3160] = String.fromCharCode (0xffff);
+data[3161] = String.fromCharCode (0xffff);
+data[3162] = String.fromCharCode (0xffff);
+data[3163] = String.fromCharCode (0xffff);
+data[3164] = String.fromCharCode (0xffff);
+data[3165] = String.fromCharCode (0xffff);
+data[3166] = String.fromCharCode (0xffff);
+data[3167] = String.fromCharCode (0xffff);
+data[3168] = String.fromCharCode (0xffff);
+data[3169] = String.fromCharCode (0xffff);
+data[3170] = String.fromCharCode (0xffff);
+data[3171] = String.fromCharCode (0xffff);
+data[3172] = String.fromCharCode (0xffff);
+data[3173] = String.fromCharCode (0xffff);
+data[3174] = String.fromCharCode (0xffff);
+data[3175] = String.fromCharCode (0xffff);
+data[3176] = String.fromCharCode (0xffff);
+data[3177] = String.fromCharCode (0xffff);
+data[3178] = String.fromCharCode (0xffff);
+data[3179] = String.fromCharCode (0xffff);
+data[3180] = String.fromCharCode (0xffff);
+data[3181] = String.fromCharCode (0xffff);
+data[3182] = String.fromCharCode (0xffff);
+data[3183] = String.fromCharCode (0xffff);
+data[3184] = String.fromCharCode (0xffff);
+data[3185] = String.fromCharCode (0xffff);
+data[3186] = String.fromCharCode (0xffff);
+data[3187] = String.fromCharCode (0xffff);
+data[3188] = String.fromCharCode (0xffff);
+data[3189] = String.fromCharCode (0xffff);
+data[3190] = String.fromCharCode (0xffff);
+data[3191] = String.fromCharCode (0xffff);
+data[3192] = String.fromCharCode (0xffff);
+data[3193] = String.fromCharCode (0xffff);
+data[3194] = String.fromCharCode (0xffff);
+data[3195] = String.fromCharCode (0xffff);
+data[3196] = String.fromCharCode (0xffff);
+data[3197] = String.fromCharCode (0xffff);
+data[3198] = String.fromCharCode (0xffff);
+data[3199] = String.fromCharCode (0xffff);
+data[3200] = String.fromCharCode (0xffff);
+data[3201] = String.fromCharCode (0xffff);
+data[3202] = String.fromCharCode (0xffff);
+data[3203] = String.fromCharCode (0xffff);
+data[3204] = String.fromCharCode (0xffff);
+data[3205] = String.fromCharCode (0xffff);
+data[3206] = String.fromCharCode (0xffff);
+data[3207] = String.fromCharCode (0xffff);
+data[3208] = String.fromCharCode (0xffff);
+data[3209] = String.fromCharCode (0xffff);
+data[3210] = String.fromCharCode (0xffff);
+data[3211] = String.fromCharCode (0xffff);
+data[3212] = String.fromCharCode (0xffff);
+data[3213] = String.fromCharCode (0xffff);
+data[3214] = String.fromCharCode (0xffff);
+data[3215] = String.fromCharCode (0xffff);
+data[3216] = String.fromCharCode (0xffff);
+data[3217] = String.fromCharCode (0xffff);
+data[3218] = String.fromCharCode (0xffff);
+data[3219] = String.fromCharCode (0xffff);
+data[3220] = String.fromCharCode (0xffff);
+data[3221] = String.fromCharCode (0xffff);
+data[3222] = String.fromCharCode (0xffff);
+data[3223] = String.fromCharCode (0xffff);
+data[3224] = String.fromCharCode (0xffff);
+data[3225] = String.fromCharCode (0xffff);
+data[3226] = String.fromCharCode (0xffff);
+data[3227] = String.fromCharCode (0xffff);
+data[3228] = String.fromCharCode (0xffff);
+data[3229] = String.fromCharCode (0xffff);
+data[3230] = String.fromCharCode (0xffff);
+data[3231] = String.fromCharCode (0xffff);
+data[3232] = String.fromCharCode (0xffff);
+data[3233] = String.fromCharCode (0xffff);
+data[3234] = String.fromCharCode (0xffff);
+data[3235] = String.fromCharCode (0xffff);
+data[3236] = String.fromCharCode (0xffff);
+data[3237] = String.fromCharCode (0xffff);
+data[3238] = String.fromCharCode (0xffff);
+data[3239] = String.fromCharCode (0xffff);
+data[3240] = String.fromCharCode (0xffff);
+data[3241] = String.fromCharCode (0xffff);
+data[3242] = String.fromCharCode (0xffff);
+data[3243] = String.fromCharCode (0xffff);
+data[3244] = String.fromCharCode (0xffff);
+data[3245] = String.fromCharCode (0xffff);
+data[3246] = String.fromCharCode (0xffff);
+data[3247] = String.fromCharCode (0xffff);
+data[3248] = String.fromCharCode (0xffff);
+data[3249] = String.fromCharCode (0xffff);
+data[3250] = String.fromCharCode (0xffff);
+data[3251] = String.fromCharCode (0xffff);
+data[3252] = String.fromCharCode (0xffff);
+data[3253] = String.fromCharCode (0xffff);
+data[3254] = String.fromCharCode (0xffff);
+data[3255] = String.fromCharCode (0xffff);
+data[3256] = String.fromCharCode (0xffff);
+data[3257] = String.fromCharCode (0xffff);
+data[3258] = String.fromCharCode (0xffff);
+data[3259] = String.fromCharCode (0xffff);
+data[3260] = String.fromCharCode (0xffff);
+data[3261] = String.fromCharCode (0xffff);
+data[3262] = String.fromCharCode (0xffff);
+data[3263] = String.fromCharCode (0xffff);
+data[3264] = String.fromCharCode (0xffff);
+data[3265] = String.fromCharCode (0xffff);
+data[3266] = String.fromCharCode (0xffff);
+data[3267] = String.fromCharCode (0xffff);
+data[3268] = String.fromCharCode (0xffff);
+data[3269] = String.fromCharCode (0xffff);
+data[3270] = String.fromCharCode (0xffff);
+data[3271] = String.fromCharCode (0xffff);
+data[3272] = String.fromCharCode (0xffff);
+data[3273] = String.fromCharCode (0xffff);
+data[3274] = String.fromCharCode (0xffff);
+data[3275] = String.fromCharCode (0xffff);
+data[3276] = String.fromCharCode (0xffff);
+data[3277] = String.fromCharCode (0xffff);
+data[3278] = String.fromCharCode (0xffff);
+data[3279] = String.fromCharCode (0xffff);
+data[3280] = String.fromCharCode (0xffff);
+data[3281] = String.fromCharCode (0xffff);
+data[3282] = String.fromCharCode (0xffff);
+data[3283] = String.fromCharCode (0xffff);
+data[3284] = String.fromCharCode (0xffff);
+data[3285] = String.fromCharCode (0xffff);
+data[3286] = String.fromCharCode (0xffff);
+data[3287] = String.fromCharCode (0xffff);
+data[3288] = String.fromCharCode (0xffff);
+data[3289] = String.fromCharCode (0xffff);
+data[3290] = String.fromCharCode (0xffff);
+data[3291] = String.fromCharCode (0xffff);
+data[3292] = String.fromCharCode (0xffff);
+data[3293] = String.fromCharCode (0xffff);
+data[3294] = String.fromCharCode (0xffff);
+data[3295] = String.fromCharCode (0xffff);
+data[3296] = String.fromCharCode (0xffff);
+data[3297] = String.fromCharCode (0xffff);
+data[3298] = String.fromCharCode (0xffff);
+data[3299] = String.fromCharCode (0xffff);
+data[3300] = String.fromCharCode (0xffff);
+data[3301] = String.fromCharCode (0xffff);
+data[3302] = String.fromCharCode (0xffff);
+data[3303] = String.fromCharCode (0xffff);
+data[3304] = String.fromCharCode (0xffff);
+data[3305] = String.fromCharCode (0xffff);
+data[3306] = String.fromCharCode (0xffff);
+data[3307] = String.fromCharCode (0xffff);
+data[3308] = String.fromCharCode (0xffff);
+data[3309] = String.fromCharCode (0xffff);
+data[3310] = String.fromCharCode (0xffff);
+data[3311] = String.fromCharCode (0xffff);
+data[3312] = String.fromCharCode (0xffff);
+data[3313] = String.fromCharCode (0xffff);
+data[3314] = String.fromCharCode (0xffff);
+data[3315] = String.fromCharCode (0xffff);
+data[3316] = String.fromCharCode (0xffff);
+data[3317] = String.fromCharCode (0xffff);
+data[3318] = String.fromCharCode (0xffff);
+data[3319] = String.fromCharCode (0xffff);
+data[3320] = String.fromCharCode (0xffff);
+data[3321] = String.fromCharCode (0xffff);
+data[3322] = String.fromCharCode (0xffff);
+data[3323] = String.fromCharCode (0xffff);
+data[3324] = String.fromCharCode (0xffff);
+data[3325] = String.fromCharCode (0xffff);
+data[3326] = String.fromCharCode (0xffff);
+data[3327] = String.fromCharCode (0xffff);
+data[3328] = String.fromCharCode (0xffff);
+data[3329] = String.fromCharCode (0xffff);
+data[3330] = String.fromCharCode (0xffff);
+data[3331] = String.fromCharCode (0xffff);
+data[3332] = String.fromCharCode (0xffff);
+data[3333] = String.fromCharCode (0xffff);
+data[3334] = String.fromCharCode (0xffff);
+data[3335] = String.fromCharCode (0xffff);
+data[3336] = String.fromCharCode (0xffff);
+data[3337] = String.fromCharCode (0xffff);
+data[3338] = String.fromCharCode (0xffff);
+data[3339] = String.fromCharCode (0xffff);
+data[3340] = String.fromCharCode (0xffff);
+data[3341] = String.fromCharCode (0xffff);
+data[3342] = String.fromCharCode (0xffff);
+data[3343] = String.fromCharCode (0xffff);
+data[3344] = String.fromCharCode (0xffff);
+data[3345] = String.fromCharCode (0xffff);
+data[3346] = String.fromCharCode (0xffff);
+data[3347] = String.fromCharCode (0xffff);
+data[3348] = String.fromCharCode (0xffff);
+data[3349] = String.fromCharCode (0xffff);
+data[3350] = String.fromCharCode (0xffff);
+data[3351] = String.fromCharCode (0xffff);
+data[3352] = String.fromCharCode (0xffff);
+data[3353] = String.fromCharCode (0xffff);
+data[3354] = String.fromCharCode (0xffff);
+data[3355] = String.fromCharCode (0xffff);
+data[3356] = String.fromCharCode (0xffff);
+data[3357] = String.fromCharCode (0xffff);
+data[3358] = String.fromCharCode (0xffff);
+data[3359] = String.fromCharCode (0xffff);
+data[3360] = String.fromCharCode (0xffff);
+data[3361] = String.fromCharCode (0xffff);
+data[3362] = String.fromCharCode (0xffff);
+data[3363] = String.fromCharCode (0xffff);
+data[3364] = String.fromCharCode (0xffff);
+data[3365] = String.fromCharCode (0xffff);
+data[3366] = String.fromCharCode (0xffff);
+data[3367] = String.fromCharCode (0xffff);
+data[3368] = String.fromCharCode (0xffff);
+data[3369] = String.fromCharCode (0xffff);
+data[3370] = String.fromCharCode (0xffff);
+data[3371] = String.fromCharCode (0xffff);
+data[3372] = String.fromCharCode (0xffff);
+data[3373] = String.fromCharCode (0xffff);
+data[3374] = String.fromCharCode (0xffff);
+data[3375] = String.fromCharCode (0xffff);
+data[3376] = String.fromCharCode (0xffff);
+data[3377] = String.fromCharCode (0xffff);
+data[3378] = String.fromCharCode (0xffff);
+data[3379] = String.fromCharCode (0xffff);
+data[3380] = String.fromCharCode (0xffff);
+data[3381] = String.fromCharCode (0xffff);
+data[3382] = String.fromCharCode (0xffff);
+data[3383] = String.fromCharCode (0xffff);
+data[3384] = String.fromCharCode (0xffff);
+data[3385] = String.fromCharCode (0xffff);
+data[3386] = String.fromCharCode (0xffff);
+data[3387] = String.fromCharCode (0xffff);
+data[3388] = String.fromCharCode (0xffff);
+data[3389] = String.fromCharCode (0xffff);
+data[3390] = String.fromCharCode (0xffff);
+data[3391] = String.fromCharCode (0xffff);
+data[3392] = String.fromCharCode (0xffff);
+data[3393] = String.fromCharCode (0xffff);
+data[3394] = String.fromCharCode (0xffff);
+data[3395] = String.fromCharCode (0xffff);
+data[3396] = String.fromCharCode (0xffff);
+data[3397] = String.fromCharCode (0xffff);
+data[3398] = String.fromCharCode (0xffff);
+data[3399] = String.fromCharCode (0xffff);
+data[3400] = String.fromCharCode (0xffff);
+data[3401] = String.fromCharCode (0xffff);
+data[3402] = String.fromCharCode (0xffff);
+data[3403] = String.fromCharCode (0xffff);
+data[3404] = String.fromCharCode (0xffff);
+data[3405] = String.fromCharCode (0xffff);
+data[3406] = String.fromCharCode (0xffff);
+data[3407] = String.fromCharCode (0xffff);
+data[3408] = String.fromCharCode (0xffff);
+data[3409] = String.fromCharCode (0xffff);
+data[3410] = String.fromCharCode (0xffff);
+data[3411] = String.fromCharCode (0xffff);
+data[3412] = String.fromCharCode (0xffff);
+data[3413] = String.fromCharCode (0xffff);
+data[3414] = String.fromCharCode (0xffff);
+data[3415] = String.fromCharCode (0xffff);
+data[3416] = String.fromCharCode (0xffff);
+data[3417] = String.fromCharCode (0xffff);
+data[3418] = String.fromCharCode (0xffff);
+data[3419] = String.fromCharCode (0xffff);
+data[3420] = String.fromCharCode (0xffff);
+data[3421] = String.fromCharCode (0xffff);
+data[3422] = String.fromCharCode (0xffff);
+data[3423] = String.fromCharCode (0xffff);
+data[3424] = String.fromCharCode (0xffff);
+data[3425] = String.fromCharCode (0xffff);
+data[3426] = String.fromCharCode (0xffff);
+data[3427] = String.fromCharCode (0xffff);
+data[3428] = String.fromCharCode (0xffff);
+data[3429] = String.fromCharCode (0xffff);
+data[3430] = String.fromCharCode (0xffff);
+data[3431] = String.fromCharCode (0xffff);
+data[3432] = String.fromCharCode (0xffff);
+data[3433] = String.fromCharCode (0xffff);
+data[3434] = String.fromCharCode (0xffff);
+data[3435] = String.fromCharCode (0xffff);
+data[3436] = String.fromCharCode (0xffff);
+data[3437] = String.fromCharCode (0xffff);
+data[3438] = String.fromCharCode (0xffff);
+data[3439] = String.fromCharCode (0xffff);
+data[3440] = String.fromCharCode (0xffff);
+data[3441] = String.fromCharCode (0xffff);
+data[3442] = String.fromCharCode (0xffff);
+data[3443] = String.fromCharCode (0xffff);
+data[3444] = String.fromCharCode (0xffff);
+data[3445] = String.fromCharCode (0xffff);
+data[3446] = String.fromCharCode (0xffff);
+data[3447] = String.fromCharCode (0xffff);
+data[3448] = String.fromCharCode (0xffff);
+data[3449] = String.fromCharCode (0xffff);
+data[3450] = String.fromCharCode (0x000f);
+data[3984] = String.fromCharCode (0xffff);
+data[3985] = String.fromCharCode (0xffff);
+data[3986] = String.fromCharCode (0xffff);
+data[3987] = String.fromCharCode (0xffff);
+data[3988] = String.fromCharCode (0xffff);
+data[3989] = String.fromCharCode (0xffff);
+data[3990] = String.fromCharCode (0xffff);
+data[3991] = String.fromCharCode (0xffff);
+data[3992] = String.fromCharCode (0xffff);
+data[3993] = String.fromCharCode (0xffff);
+data[3994] = String.fromCharCode (0xffff);
+data[3995] = String.fromCharCode (0xffff);
+data[3996] = String.fromCharCode (0xffff);
+data[3997] = String.fromCharCode (0xffff);
+data[3998] = String.fromCharCode (0xffff);
+data[3999] = String.fromCharCode (0xffff);
+data[4000] = String.fromCharCode (0xffff);
+data[4001] = String.fromCharCode (0xffff);
+data[4002] = String.fromCharCode (0x3fff);
+data[4016] = String.fromCharCode (0x007f);
+data[4017] = String.fromCharCode (0x80f8);
+data[4018] = String.fromCharCode (0xfdff);
+data[4019] = String.fromCharCode (0x5f7f);
+data[4020] = String.fromCharCode (0xffdb);
+data[4021] = String.fromCharCode (0xffff);
+data[4022] = String.fromCharCode (0xffff);
+data[4023] = String.fromCharCode (0xffff);
+data[4024] = String.fromCharCode (0xffff);
+data[4025] = String.fromCharCode (0xffff);
+data[4026] = String.fromCharCode (0xffff);
+data[4027] = String.fromCharCode (0x0003);
+data[4029] = String.fromCharCode (0xfff8);
+data[4030] = String.fromCharCode (0xffff);
+data[4031] = String.fromCharCode (0xffff);
+data[4032] = String.fromCharCode (0xffff);
+data[4033] = String.fromCharCode (0xffff);
+data[4034] = String.fromCharCode (0xffff);
+data[4035] = String.fromCharCode (0xffff);
+data[4036] = String.fromCharCode (0xffff);
+data[4037] = String.fromCharCode (0xffff);
+data[4038] = String.fromCharCode (0xffff);
+data[4039] = String.fromCharCode (0xffff);
+data[4040] = String.fromCharCode (0xffff);
+data[4041] = String.fromCharCode (0xffff);
+data[4042] = String.fromCharCode (0xffff);
+data[4043] = String.fromCharCode (0xffff);
+data[4044] = String.fromCharCode (0xffff);
+data[4045] = String.fromCharCode (0xffff);
+data[4046] = String.fromCharCode (0xffff);
+data[4047] = String.fromCharCode (0xffff);
+data[4048] = String.fromCharCode (0xffff);
+data[4049] = String.fromCharCode (0xffff);
+data[4050] = String.fromCharCode (0xffff);
+data[4051] = String.fromCharCode (0x3fff);
+data[4053] = String.fromCharCode (0xffff);
+data[4054] = String.fromCharCode (0xffff);
+data[4055] = String.fromCharCode (0xffff);
+data[4056] = String.fromCharCode (0xffff);
+data[4057] = String.fromCharCode (0xfffc);
+data[4058] = String.fromCharCode (0xffff);
+data[4059] = String.fromCharCode (0xffff);
+data[4060] = String.fromCharCode (0x00ff);
+data[4063] = String.fromCharCode (0x0fff);
+data[4071] = String.fromCharCode (0xffd7);
+data[4072] = String.fromCharCode (0xffff);
+data[4073] = String.fromCharCode (0xffff);
+data[4074] = String.fromCharCode (0xffff);
+data[4075] = String.fromCharCode (0xffff);
+data[4076] = String.fromCharCode (0xffff);
+data[4077] = String.fromCharCode (0xffff);
+data[4078] = String.fromCharCode (0xffff);
+data[4079] = String.fromCharCode (0x1fff);
+data[4082] = String.fromCharCode (0xfffe);
+data[4083] = String.fromCharCode (0x07ff);
+data[4084] = String.fromCharCode (0xfffe);
+data[4085] = String.fromCharCode (0x07ff);
+data[4086] = String.fromCharCode (0xffc0);
+data[4087] = String.fromCharCode (0xffff);
+data[4088] = String.fromCharCode (0xffff);
+data[4089] = String.fromCharCode (0xffff);
+data[4090] = String.fromCharCode (0xffff);
+data[4091] = String.fromCharCode (0x7fff);
+data[4092] = String.fromCharCode (0xfcfc);
+data[4093] = String.fromCharCode (0x1cfc);
+data[4100] = String.fromCharCode (0xfffe);
+data[4101] = String.fromCharCode (0x07ff);
+data[4102] = String.fromCharCode (0xfffe);
+data[4103] = String.fromCharCode (0x07ff);
+data[4106] = String.fromCharCode (0x0400);
+data[4107] = String.fromCharCode (0x0420);
+data[4108] = String.fromCharCode (0xffff);
+data[4109] = String.fromCharCode (0xff7f);
+data[4110] = String.fromCharCode (0xffff);
+data[4111] = String.fromCharCode (0xff7f);
+data[4112] = String.fromCharCode (0xffff);
+data[4113] = String.fromCharCode (0xffff);
+data[4114] = String.fromCharCode (0xffff);
+data[4115] = String.fromCharCode (0xffff);
+data[4116] = String.fromCharCode (0xffff);
+data[4117] = String.fromCharCode (0xffff);
+data[4118] = String.fromCharCode (0xffff);
+data[4119] = String.fromCharCode (0xffff);
+data[4120] = String.fromCharCode (0xffff);
+data[4121] = String.fromCharCode (0xffff);
+data[4122] = String.fromCharCode (0xffff);
+data[4123] = String.fromCharCode (0xffff);
+data[4124] = String.fromCharCode (0xffff);
+data[4125] = String.fromCharCode (0xffff);
+data[4126] = String.fromCharCode (0xffff);
+data[4127] = String.fromCharCode (0xfc3f);
+data[4128] = String.fromCharCode (0xffff);
+data[4129] = String.fromCharCode (0x00ff);
+data[4133] = String.fromCharCode (0xffff);
+data[4134] = String.fromCharCode (0xffff);
+data[4135] = String.fromCharCode (0xffff);
+data[4136] = String.fromCharCode (0xffff);
+data[4137] = String.fromCharCode (0xffff);
+data[4138] = String.fromCharCode (0x01ff);
+data[4139] = String.fromCharCode (0xf9ff);
+data[4140] = String.fromCharCode (0x0003);
+data[4141] = String.fromCharCode (0x0003);
+data[4142] = String.fromCharCode (0x001f);
+data[4151] = String.fromCharCode (0x0400);
+data[4152] = String.fromCharCode (0xd740);
+data[4153] = String.fromCharCode (0xffff);
+data[4154] = String.fromCharCode (0xfffb);
+data[4155] = String.fromCharCode (0xffff);
+data[4156] = String.fromCharCode (0x7fff);
+data[4157] = String.fromCharCode (0x547f);
+data[4158] = String.fromCharCode (0x00fd);
+});
+c$.white_f = Clazz_defineMethod (c$, "white_f", 
+function () {
+var data =  Clazz_newCharArray (4159, '\0');
+com.stevesoft.pat.Bits.white =  new com.stevesoft.pat.Bits (data);
+data[0] = String.fromCharCode (0x3e00);
+data[1] = String.fromCharCode (0xf000);
+data[2] = String.fromCharCode (0x0001);
+data[512] = String.fromCharCode (0x0fff);
+data[514] = String.fromCharCode (0x0300);
+data[768] = String.fromCharCode (0x0001);
+data[4096] = String.fromCharCode (0x3e00);
+data[4097] = String.fromCharCode (0xf000);
+data[4098] = String.fromCharCode (0x0001);
+});
+c$.punct_f = Clazz_defineMethod (c$, "punct_f", 
+function () {
+var data =  Clazz_newCharArray (4159, '\0');
+com.stevesoft.pat.Bits.punct =  new com.stevesoft.pat.Bits (data);
+data[2] = String.fromCharCode (0xf7ee);
+data[3] = String.fromCharCode (0x8c00);
+data[4] = String.fromCharCode (0x0001);
+data[5] = String.fromCharCode (0xb800);
+data[7] = String.fromCharCode (0x2800);
+data[10] = String.fromCharCode (0x2802);
+data[11] = String.fromCharCode (0x8880);
+data[55] = String.fromCharCode (0x4030);
+data[56] = String.fromCharCode (0x0080);
+data[85] = String.fromCharCode (0xfc00);
+data[88] = String.fromCharCode (0x0200);
+data[91] = String.fromCharCode (0x4000);
+data[92] = String.fromCharCode (0x0009);
+data[95] = String.fromCharCode (0x0018);
+data[96] = String.fromCharCode (0x1000);
+data[97] = String.fromCharCode (0x8800);
+data[102] = String.fromCharCode (0x3c00);
+data[109] = String.fromCharCode (0x0010);
+data[150] = '0';
+data[151] = String.fromCharCode (0x0001);
+data[226] = String.fromCharCode (0x8000);
+data[229] = String.fromCharCode (0x0c00);
+data[234] = String.fromCharCode (0x8000);
+data[240] = String.fromCharCode (0xfff0);
+data[241] = String.fromCharCode (0x0007);
+data[243] = String.fromCharCode (0x3c00);
+data[248] = String.fromCharCode (0x0020);
+data[271] = String.fromCharCode (0x0800);
+data[513] = String.fromCharCode (0xffff);
+data[514] = String.fromCharCode (0x00ff);
+data[515] = String.fromCharCode (0xffff);
+data[516] = 'o';
+data[519] = String.fromCharCode (0x6000);
+data[520] = String.fromCharCode (0x6000);
+data[562] = String.fromCharCode (0x0600);
+data[768] = String.fromCharCode (0xff4e);
+data[769] = String.fromCharCode (0xfff3);
+data[771] = String.fromCharCode (0x0001);
+data[783] = String.fromCharCode (0x0800);
+data[4051] = String.fromCharCode (0xc000);
+data[4067] = String.fromCharCode (0xffff);
+data[4068] = String.fromCharCode (0xfe1f);
+data[4069] = String.fromCharCode (0xfff7);
+data[4070] = String.fromCharCode (0x0d0b);
+data[4080] = String.fromCharCode (0xf7ee);
+data[4081] = String.fromCharCode (0x8c00);
+data[4082] = String.fromCharCode (0x0001);
+data[4083] = String.fromCharCode (0xb800);
+data[4085] = String.fromCharCode (0x2800);
+data[4086] = String.fromCharCode (0x003e);
+data[4098] = String.fromCharCode (0xf7ee);
+data[4099] = String.fromCharCode (0x8c00);
+data[4100] = String.fromCharCode (0x0001);
+data[4101] = String.fromCharCode (0xb800);
+data[4103] = String.fromCharCode (0x2800);
+data[4106] = String.fromCharCode (0x2802);
+data[4107] = String.fromCharCode (0x8880);
+data[4151] = String.fromCharCode (0x4030);
+data[4152] = String.fromCharCode (0x0080);
+});
+Clazz_defineStatics (c$,
+"upper", null,
+"lower", null,
+"title", null,
+"currency", null,
+"decimal_digit", null,
+"math", null,
+"letter", null,
+"white", null,
+"punct", null);
+Clazz_declarePackage ("com.stevesoft.pat");
+Clazz_load (["com.stevesoft.pat.Pattern", "$.RegSyntax"], ["com.stevesoft.pat.BadRangeArgs", "$.Range"], ["com.stevesoft.pat.RegSyntaxError", "$.oneChar", "$.patInt"], function () {
+c$ = Clazz_declareType (com.stevesoft.pat, "BadRangeArgs", com.stevesoft.pat.RegSyntax);
+c$ = Clazz_decorateAsClass (function () {
+this.lo = '\0';
+this.hi = '\0';
+this.altlo = '\0';
+this.althi = '\0';
+this.printBrackets = false;
+Clazz_instantialize (this, arguments);
+}, com.stevesoft.pat, "Range", com.stevesoft.pat.Pattern);
+Clazz_overrideMethod (c$, "toString", 
+function () {
+var s = com.stevesoft.pat.Pattern.protect ("" + this.lo, "[]{}(),$,-\"^.", '\\') + "-" + com.stevesoft.pat.Pattern.protect ("" + this.hi, "[]{}(),$,-\"^.", '\\');
+if (!this.printBrackets) {
+return s;
+}return "[" + s + "]";
+});
+Clazz_makeConstructor (c$, 
+function (loi, hii) {
+Clazz_superConstructor (this, com.stevesoft.pat.Range, []);
+this.lo = loi;
+this.hi = hii;
+var o = null;
+if (this.lo >= this.hi) {
+com.stevesoft.pat.RegSyntaxError.endItAll ("Badly formed []'s : " + this.lo + " >= " + this.hi);
+}o =  new com.stevesoft.pat.oneChar (this.lo);
+this.altlo = o.altc;
+o =  new com.stevesoft.pat.oneChar (this.hi);
+this.althi = o.altc;
+}, "~S,~S");
+Clazz_overrideMethod (c$, "matchInternal", 
+function (pos, pt) {
+if (pos >= pt.src.length ()) {
+return -1;
+}if (this.Masked (pos, pt)) {
+return -1;
+}var c = pt.src.charAt (pos);
+if (this.lo <= c && c <= this.hi || (pt.ignoreCase && (this.altlo <= c && c <= this.althi))) {
+return this.nextMatch (pos + 1, pt);
+}return -1;
+}, "~N,com.stevesoft.pat.Pthings");
+Clazz_overrideMethod (c$, "minChars", 
+function () {
+return  new com.stevesoft.pat.patInt (1);
+});
+Clazz_overrideMethod (c$, "maxChars", 
+function () {
+return  new com.stevesoft.pat.patInt (1);
+});
+Clazz_overrideMethod (c$, "clone1", 
+function (h) {
+try {
+var r =  new com.stevesoft.pat.Range (this.lo, this.hi);
+r.printBrackets = this.printBrackets;
+return r;
+} catch (rs) {
+if (Clazz_exceptionOf (rs, com.stevesoft.pat.RegSyntax)) {
+return null;
+} else {
+throw rs;
+}
+}
+}, "java.util.Hashtable");
+});
+Clazz_declarePackage ("com.stevesoft.pat");
+Clazz_load (["com.stevesoft.pat.Pattern"], "com.stevesoft.pat.oneChar", ["com.stevesoft.pat.CaseMgr", "$.patInt"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.c = '\0';
+this.altc = '\0';
+this.altc2 = '\0';
+this.mask = 0;
+Clazz_instantialize (this, arguments);
+}, com.stevesoft.pat, "oneChar", com.stevesoft.pat.Pattern);
+Clazz_makeConstructor (c$, 
+function (ci) {
+Clazz_superConstructor (this, com.stevesoft.pat.oneChar, []);
+this.c = ci;
+var cu;
+var cl;
+var ct;
+cu = com.stevesoft.pat.CaseMgr.toUpperCaseC (this.c);
+cl = com.stevesoft.pat.CaseMgr.toLowerCaseC (this.c);
+ct = com.stevesoft.pat.CaseMgr.toTitleCaseC (this.c);
+if (this.c == cu) {
+this.altc = cl;
+this.altc2 = ct;
+} else if (this.c == cl) {
+this.altc = cu;
+this.altc2 = ct;
+} else {
+this.altc = cl;
+this.altc2 = cu;
+}this.mask = this.c.charCodeAt (0) & this.altc.charCodeAt (0) & this.altc2.charCodeAt (0);
+}, "~S");
+Clazz_overrideMethod (c$, "matchInternal", 
+function (pos, pt) {
+var p;
+var ret = -1;
+if (pos < pt.src.length () && !this.Masked (pos, pt) && ((p = pt.src.charAt (pos)) == this.c || (pt.ignoreCase && (p == this.altc || p == this.altc2)))) {
+ret = this.nextMatch (pos + 1, pt);
+}return ret;
+}, "~N,com.stevesoft.pat.Pthings");
+Clazz_overrideMethod (c$, "toString", 
+function () {
+return com.stevesoft.pat.Pattern.protect ("" + this.c, "[]{}(),$,-\"^.", '\\') + this.nextString ();
+});
+Clazz_overrideMethod (c$, "minChars", 
+function () {
+return  new com.stevesoft.pat.patInt (1);
+});
+Clazz_overrideMethod (c$, "maxChars", 
+function () {
+return  new com.stevesoft.pat.patInt (1);
+});
+Clazz_overrideMethod (c$, "clone1", 
+function (h) {
+return  new com.stevesoft.pat.oneChar (this.c);
+}, "java.util.Hashtable");
+});
+Clazz_declarePackage ("com.stevesoft.pat");
+Clazz_load (["com.stevesoft.pat.Pattern", "$.oneChar", "java.util.Hashtable", "$.Vector"], ["com.stevesoft.pat.Branch", "$.RegOpt", "$.FastChar"], ["com.stevesoft.pat.Any", "$.Bracket", "$.Custom", "$.FastBracket", "$.FastMulti", "$.Multi", "$.NullPattern", "$.Or", "$.Range", "$.UniValidator", "$.patInt", "java.lang.Character", "$.StringBuffer"], function () {
+c$ = Clazz_declareType (com.stevesoft.pat, "FastChar", com.stevesoft.pat.oneChar);
+Clazz_overrideMethod (c$, "matchInternal", 
+function (p, pt) {
+return (p < pt.src.length () && pt.src.charAt (p) == this.c) ? this.nextMatch (p + 1, pt) : -1;
+}, "~N,com.stevesoft.pat.Pthings");
+Clazz_overrideMethod (c$, "clone1", 
+function (h) {
+return  new com.stevesoft.pat.FastChar (this.c);
+}, "java.util.Hashtable");
+c$ = Clazz_decorateAsClass (function () {
+this.h = null;
+this.keys = null;
+Clazz_instantialize (this, arguments);
+}, com.stevesoft.pat, "Branch", com.stevesoft.pat.Pattern);
+Clazz_prepareFields (c$, function () {
+this.h =  new java.util.Hashtable ();
+this.keys =  new java.util.Vector ();
+});
+Clazz_makeConstructor (c$, 
+function () {
+Clazz_superConstructor (this, com.stevesoft.pat.Branch, []);
+});
+Clazz_overrideMethod (c$, "clone1", 
+function (x) {
+var b =  new com.stevesoft.pat.Branch ();
+b.keys = this.keys.clone ();
+x.put (this, b);
+x.put (b, b);
+for (var i = 0; i < this.keys.size (); i++) {
+var p = this.h.get (this.keys.elementAt (i));
+b.h.put (this.keys.elementAt (i), p.clone (x));
+}
+return b;
+}, "java.util.Hashtable");
+Clazz_defineMethod (c$, "reduce", 
+function (ignoreCase, dontMinQ) {
+if (this.h.size () == 1) {
+var e = this.h.keys ();
+var c = e.nextElement ();
+var oc;
+if (ignoreCase || dontMinQ) {
+oc =  new com.stevesoft.pat.oneChar (c.charValue ());
+} else {
+oc =  new com.stevesoft.pat.FastChar (c.charValue ());
+}oc.next = this.h.get (c);
+oc.add (this.next);
+return oc;
+} else if (this.h.size () == 0) {
+return null;
+}return this;
+}, "~B,~B");
+Clazz_defineMethod (c$, "maxChars", 
+function () {
+var e = this.h.keys ();
+var count =  new com.stevesoft.pat.patInt (0);
+while (e.hasMoreElements ()) {
+var key = e.nextElement ();
+var pa = this.h.get (key);
+var pi = pa.maxChars ();
+pi.inc ();
+count.maxeq (pi);
+}
+return count;
+});
+Clazz_defineMethod (c$, "minChars", 
+function () {
+var e = this.h.keys ();
+var count =  new com.stevesoft.pat.patInt (0);
+while (e.hasMoreElements ()) {
+var key = e.nextElement ();
+var pa = this.h.get (key);
+var pi = pa.minChars ();
+pi.inc ();
+count.mineq (pi);
+}
+return count;
+});
+Clazz_defineMethod (c$, "addc", 
+function (o, ignoreCase, dontMinQ) {
+var n = o.next;
+if (n == null) {
+n =  new com.stevesoft.pat.NullPattern ();
+} else {
+n = com.stevesoft.pat.RegOpt.opt (n, ignoreCase, dontMinQ);
+}n.setParent (this);
+this.set ( new Character (o.c), n, ignoreCase, dontMinQ);
+if (ignoreCase) {
+if (o.c != o.altc) {
+this.set ( new Character (o.altc), n, ignoreCase, dontMinQ);
+}if (o.c != o.altc2 && o.altc != o.altc2) {
+this.set ( new Character (o.altc2), n, ignoreCase, dontMinQ);
+}}}, "com.stevesoft.pat.oneChar,~B,~B");
+Clazz_defineMethod (c$, "set", 
+function (c, n, igc, dontMinQ) {
+var p = this.h.get (c);
+this.next = null;
+if (p == null) {
+if (Clazz_instanceOf (n, com.stevesoft.pat.Or)) {
+var np =  new com.stevesoft.pat.NullPattern ();
+np.add (n);
+this.h.put (c, np);
+} else {
+this.h.put (c, n);
+}this.keys.addElement (c);
+} else if (Clazz_instanceOf (p, com.stevesoft.pat.Or)) {
+(p).addOr (n);
+} else if (Clazz_instanceOf (p, com.stevesoft.pat.oneChar) && Clazz_instanceOf (n, com.stevesoft.pat.oneChar) && (p).c != (n).c) {
+var b =  new com.stevesoft.pat.Branch ();
+b.addc (p, igc, dontMinQ);
+b.addc (n, igc, dontMinQ);
+this.h.put (c, b);
+b.setParent (this);
+} else if (Clazz_instanceOf (p, com.stevesoft.pat.Branch) && Clazz_instanceOf (n, com.stevesoft.pat.oneChar)) {
+(p).addc (n, igc, dontMinQ);
+n.setParent (p);
+} else {
+var o =  new com.stevesoft.pat.Or ();
+o.setParent (this);
+if (Clazz_instanceOf (p, com.stevesoft.pat.NullPattern) && p.parent == null && p.next != null) {
+o.addOr (p.next);
+} else {
+o.addOr (p);
+}o.addOr (n);
+var optpat = com.stevesoft.pat.RegOpt.opt (o, igc, dontMinQ);
+this.h.put (c, optpat);
+optpat.setParent (this);
+}}, "Character,com.stevesoft.pat.Pattern,~B,~B");
+Clazz_overrideMethod (c$, "toString", 
+function () {
+var sb =  new StringBuffer ();
+sb.append ("(?:(?#branch)");
+for (var i = 0; i < this.keys.size (); i++) {
+var c = this.keys.elementAt (i);
+sb.append (c);
+sb.append (this.h.get (c));
+if (i + 1 < this.keys.size ()) {
+sb.append ("|");
+}}
+sb.append (")");
+sb.append (this.nextString ());
+return sb.toString ();
+});
+Clazz_defineMethod (c$, "matchInternal", 
+function (pos, pt) {
+if (pos >= pt.src.length ()) {
+return -1;
+}var n = this.h.get ( new Character (pt.src.charAt (pos)));
+if (n == null) {
+return -1;
+}if (pt.cbits != null && pt.cbits.get (pos)) {
+return -1;
+}return n.matchInternal (pos + 1, pt);
+}, "~N,com.stevesoft.pat.Pthings");
+c$ = Clazz_declareType (com.stevesoft.pat, "RegOpt");
+c$.opt = Clazz_defineMethod (c$, "opt", 
+function (p, ignoreCase, dontMinQ) {
+if (p == null) {
+return p;
+}if (Clazz_instanceOf (p, com.stevesoft.pat.Bracket)) {
+var b = p;
+p = com.stevesoft.pat.FastBracket.process (b, ignoreCase);
+p.next = b.next;
+p.parent = b.parent;
+} else if (Clazz_instanceOf (p, com.stevesoft.pat.oneChar) && !ignoreCase && !dontMinQ) {
+var o = p;
+p =  new com.stevesoft.pat.FastChar (o.c);
+p.next = o.next;
+p.parent = o.parent;
+} else if (Clazz_instanceOf (p, com.stevesoft.pat.Or) && (p).leftForm ().equals ("(?:") && (p).v.size () == 1) {
+var o = p;
+p = o.v.elementAt (0);
+p.setParent (null);
+p = com.stevesoft.pat.RegOpt.opt (p, ignoreCase, dontMinQ);
+p.add (o.next);
+} else if (Clazz_instanceOf (p, com.stevesoft.pat.Or)) {
+var o = p;
+o.pv = null;
+var v = o.v;
+o.v =  new java.util.Vector ();
+var b =  new com.stevesoft.pat.Branch ();
+b.parent = o.parent;
+for (var i = 0; i < v.size (); i++) {
+var pp = v.elementAt (i);
+if (Clazz_instanceOf (pp, com.stevesoft.pat.oneChar) && (b.h.size () >= 1 || (i + 1 < v.size () && Clazz_instanceOf (v.elementAt (i + 1), com.stevesoft.pat.oneChar)))) {
+b.addc (pp, ignoreCase, dontMinQ);
+} else {
+if (b.keys.size () > 0) {
+var p2 = b.reduce (ignoreCase, dontMinQ);
+if (p2 != null) {
+o.addOr (p2);
+b =  new com.stevesoft.pat.Branch ();
+b.parent = o.parent;
+}}o.addOr (com.stevesoft.pat.RegOpt.opt (pp, ignoreCase, dontMinQ));
+}}
+if (b.keys.size () > 0) {
+var p2 = b.reduce (ignoreCase, dontMinQ);
+if (p2 != null) {
+o.addOr (p2);
+}}if (o.v.size () == 1 && o.leftForm ().equals ("(?:")) {
+p = o.v.elementAt (0);
+p.setParent (null);
+p = com.stevesoft.pat.RegOpt.opt (p, ignoreCase, dontMinQ);
+p.add (o.next);
+}} else if (Clazz_instanceOf (p, com.stevesoft.pat.FastMulti)) {
+var ps = p;
+ps.sub = com.stevesoft.pat.RegOpt.opt (ps.sub, ignoreCase, dontMinQ);
+} else if (Clazz_instanceOf (p, com.stevesoft.pat.Multi) && com.stevesoft.pat.RegOpt.safe4fm ((p).sub)) {
+var m = p;
+var fm = null;
+try {
+fm =  new com.stevesoft.pat.FastMulti (m.a, m.b, com.stevesoft.pat.RegOpt.opt (m.sub, ignoreCase, dontMinQ));
+} catch (rs) {
+if (Clazz_exceptionOf (rs, com.stevesoft.pat.RegSyntax)) {
+} else {
+throw rs;
+}
+}
+fm.parent = m.parent;
+fm.matchFewest = m.matchFewest;
+fm.next = m.next;
+p = fm;
+}if (p.next != null) {
+p.next = com.stevesoft.pat.RegOpt.opt (p.next, ignoreCase, dontMinQ);
+}return p;
+}, "com.stevesoft.pat.Pattern,~B,~B");
+c$.safe4fm = Clazz_defineMethod (c$, "safe4fm", 
+function (x) {
+while (x != null) {
+if (Clazz_instanceOf (x, com.stevesoft.pat.Bracket)) {
+;} else if (Clazz_instanceOf (x, com.stevesoft.pat.Range)) {
+;} else if (Clazz_instanceOf (x, com.stevesoft.pat.oneChar)) {
+;} else if (Clazz_instanceOf (x, com.stevesoft.pat.Any)) {
+;} else if (Clazz_instanceOf (x, com.stevesoft.pat.Custom) && Clazz_instanceOf ((x).v, com.stevesoft.pat.UniValidator)) {
+;} else if (Clazz_instanceOf (x, com.stevesoft.pat.Or)) {
+var o = x;
+if (!o.leftForm ().equals ("(?:")) {
+return false;
+}var lo = o.countMinChars ();
+var hi = o.countMaxChars ();
+if (!lo.equals (hi)) {
+return false;
+}for (var i = 0; i < o.v.size (); i++) {
+if (!com.stevesoft.pat.RegOpt.safe4fm (o.v.elementAt (i))) {
+return false;
+}}
+} else {
+return false;
+}x = x.next;
+}
+return true;
+}, "com.stevesoft.pat.Pattern");
+});
+Clazz_declarePackage ("com.stevesoft.pat");
+Clazz_load (["com.stevesoft.pat.Bracket"], "com.stevesoft.pat.FastBracket", ["com.stevesoft.pat.Range", "$.oneChar", "java.util.BitSet", "$.Vector"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.$min = 0;
+this.$max = 0;
+this.bs = null;
+Clazz_instantialize (this, arguments);
+}, com.stevesoft.pat, "FastBracket", com.stevesoft.pat.Bracket);
+c$.process = Clazz_defineMethod (c$, "process", 
+function (b, ignc) {
+var v = b.v;
+b.pv = null;
+try {
+var nv = v;
+if (ignc) {
+nv =  new java.util.Vector ();
+for (var i = 0; i < v.size (); i++) {
+var p = v.elementAt (i);
+nv.addElement (p);
+if (Clazz_instanceOf (p, com.stevesoft.pat.oneChar)) {
+var oc = p;
+nv.addElement ( new com.stevesoft.pat.oneChar (oc.altc));
+} else if (Clazz_instanceOf (p, com.stevesoft.pat.Range)) {
+var ra = p;
+nv.addElement ( new com.stevesoft.pat.Range (ra.altlo, ra.althi));
+}}
+}v = nv;
+for (var i = 0; i < v.size () - 1; i++) {
+for (var j = 0; j < v.size () - 1; j++) {
+var c1 = com.stevesoft.pat.FastBracket.getl (v.elementAt (j));
+var c2 = com.stevesoft.pat.FastBracket.getl (v.elementAt (j + 1));
+if (c2 < c1) {
+var o = v.elementAt (j);
+v.setElementAt (v.elementAt (j + 1), j);
+v.setElementAt (o, j + 1);
+}}
+}
+nv =  new java.util.Vector ();
+var p = v.elementAt (0);
+nv.addElement (p);
+for (var i = 1; i < v.size (); i++) {
+if ((com.stevesoft.pat.FastBracket.geth (p)).charCodeAt (0) + 1 >= (com.stevesoft.pat.FastBracket.getl (v.elementAt (i))).charCodeAt (0)) {
+var p2 = v.elementAt (i);
+var lo = com.stevesoft.pat.FastBracket.min (com.stevesoft.pat.FastBracket.getl (p), com.stevesoft.pat.FastBracket.getl (p2));
+var hi = com.stevesoft.pat.FastBracket.max (com.stevesoft.pat.FastBracket.geth (p), com.stevesoft.pat.FastBracket.geth (p2));
+nv.setElementAt (p = com.stevesoft.pat.FastBracket.mkelem (lo, hi), nv.size () - 1);
+} else {
+p = v.elementAt (i);
+nv.addElement (p);
+}}
+b.v = v = nv;
+} catch (e) {
+if (Clazz_exceptionOf (e, com.stevesoft.pat.RegSyntax)) {
+e.printStackTrace ();
+} else {
+throw e;
+}
+}
+var negv = com.stevesoft.pat.FastBracket.neg (v);
+if (v.size () == 1) {
+return b;
+}if (negv.size () == 1) {
+b.v = negv;
+b.neg = !b.neg;
+return b;
+}var fb = com.stevesoft.pat.FastBracket.newbrack (v, b.neg);
+if (fb == null) {
+fb = com.stevesoft.pat.FastBracket.newbrack (negv, !b.neg);
+}if (fb != null) {
+fb.parent = b.parent;
+fb.next = b.next;
+return fb;
+}return b;
+}, "com.stevesoft.pat.Bracket,~B");
+c$.newbrack = Clazz_defineMethod (c$, "newbrack", 
+function (v, neg) {
+var fb =  new com.stevesoft.pat.FastBracket (neg);
+fb.v = v;
+if (v.size () == 0) {
+return null;
+}fb.$min = (com.stevesoft.pat.FastBracket.getl (v.elementAt (0))).charCodeAt (0);
+fb.$max = (com.stevesoft.pat.FastBracket.geth (v.elementAt (v.size () - 1))).charCodeAt (0);
+if (fb.$max - fb.$min <= 256) {
+fb.bs =  new java.util.BitSet (fb.$max - fb.$min + 1);
+for (var i = 0; i < v.size (); i++) {
+var o = v.elementAt (i);
+var min0 = (com.stevesoft.pat.FastBracket.getl (o)).charCodeAt (0) - fb.$min;
+var max0 = (com.stevesoft.pat.FastBracket.geth (o)).charCodeAt (0) - fb.$min;
+for (var j = min0; j <= max0; j++) {
+fb.bs.set (j);
+}
+}
+return fb;
+}return null;
+}, "java.util.Vector,~B");
+c$.neg = Clazz_defineMethod (c$, "neg", 
+function (v) {
+try {
+var nv =  new java.util.Vector ();
+if (v.size () == 0) {
+nv.addElement ( new com.stevesoft.pat.Range (String.fromCharCode (0), String.fromCharCode (65535)));
+return nv;
+}var p0 = (com.stevesoft.pat.FastBracket.getl (v.elementAt (0))).charCodeAt (0);
+if (p0 != 0) {
+nv.addElement (com.stevesoft.pat.FastBracket.mkelem (String.fromCharCode (0), String.fromCharCode (p0 - 1)));
+}for (var i = 0; i < v.size () - 1; i++) {
+var hi = (com.stevesoft.pat.FastBracket.getl (v.elementAt (i + 1))).charCodeAt (0) - 1;
+var lo = (com.stevesoft.pat.FastBracket.geth (v.elementAt (i))).charCodeAt (0) + 1;
+nv.addElement (com.stevesoft.pat.FastBracket.mkelem (String.fromCharCode (lo), String.fromCharCode (hi)));
+}
+var pN = (com.stevesoft.pat.FastBracket.geth (v.lastElement ())).charCodeAt (0);
+if (pN != 65535) {
+nv.addElement (com.stevesoft.pat.FastBracket.mkelem (String.fromCharCode (pN + 1), String.fromCharCode (65535)));
+}return nv;
+} catch (rs) {
+if (Clazz_exceptionOf (rs, com.stevesoft.pat.RegSyntax)) {
+return null;
+} else {
+throw rs;
+}
+}
+}, "java.util.Vector");
+c$.mkelem = Clazz_defineMethod (c$, "mkelem", 
+function (lo, hi) {
+return lo == hi ? ( new com.stevesoft.pat.oneChar (lo)) : ( new com.stevesoft.pat.Range (lo, hi));
+}, "~S,~S");
+c$.min = Clazz_defineMethod (c$, "min", 
+function (a, b) {
+return a < b ? a : b;
+}, "~S,~S");
+c$.max = Clazz_defineMethod (c$, "max", 
+function (a, b) {
+return a > b ? a : b;
+}, "~S,~S");
+c$.getl = Clazz_defineMethod (c$, "getl", 
+function (o) {
+var p = o;
+if (Clazz_instanceOf (p, com.stevesoft.pat.Range)) {
+return (p).lo;
+}return (p).c;
+}, "~O");
+c$.geth = Clazz_defineMethod (c$, "geth", 
+function (o) {
+var p = o;
+if (Clazz_instanceOf (p, com.stevesoft.pat.Range)) {
+return (p).hi;
+}return (p).c;
+}, "~O");
+Clazz_overrideMethod (c$, "matchInternal", 
+function (pos, pt) {
+if (pos >= pt.src.length () || this.Masked (pos, pt)) {
+return -1;
+}var c = pt.src.charAt (pos);
+return ( new Boolean (this.neg ^ (c.charCodeAt (0) >= this.$min && c.charCodeAt (0) <= this.$max && this.bs.get (c.charCodeAt (0) - this.$min))).valueOf ()) ? this.nextMatch (pos + 1, pt) : -1;
+}, "~N,com.stevesoft.pat.Pthings");
+});
+\feffClazz_load (null, "java.util.BitSet", ["java.lang.IndexOutOfBoundsException", "$.NegativeArraySizeException", "$.StringBuffer", "java.util.Arrays"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.bits = null;
+Clazz_instantialize (this, arguments);
+}, java.util, "BitSet", null, [Cloneable, java.io.Serializable]);
+Clazz_makeConstructor (c$, 
+function () {
+this.construct (32);
+});
+Clazz_makeConstructor (c$, 
+function (nbits) {
+if (nbits < 0) throw  new NegativeArraySizeException ();
+var length = nbits >>> 5;
+if ((nbits & 4) != 0) ++length;
+this.bits =  Clazz_newArray (length, 0);
+}, "~N");
+Clazz_defineMethod (c$, "and", 
+function (bs) {
+var max = Math.min (this.bits.length, bs.bits.length);
+var i;
+for (i = 0; i < max; ++i) this.bits[i] &= bs.bits[i];
+
+while (i < this.bits.length) this.bits[i++] = 0;
+
+}, "java.util.BitSet");
+Clazz_defineMethod (c$, "andNot", 
+function (bs) {
+var i = Math.min (this.bits.length, bs.bits.length);
+while (--i >= 0) {
+this.bits[i] &= ~bs.bits[i];
+}
+}, "java.util.BitSet");
+Clazz_defineMethod (c$, "cardinality", 
+function () {
+var card = 0;
+for (var i = this.bits.length - 1; i >= 0; i--) {
+var a = this.bits[i];
+if (a == 0) continue ;if (a == -1) {
+card += 32;
+continue ;}a = ((a >> 1) & 0x55555555) + (a & 0x55555555);
+a = ((a >> 2) & 0x33333333) + (a & 0x33333333);
+a = ((a >> 4) & 0x0f0f0f0f) + (a & 0x0f0f0f0f);
+a = ((a >> 8) & 0x00ff00ff) + (a & 0x00ff00ff);
+card += ((a >> 16) & 0x0000ffff) + (a & 0x0000ffff);
+}
+return card;
+});
+Clazz_defineMethod (c$, "clear", 
+function () {
+java.util.Arrays.fill (this.bits, 0);
+});
+Clazz_defineMethod (c$, "clear", 
+function (pos) {
+var offset = pos >> 5;
+this.ensure (offset);
+this.bits[offset] &= ~(1 << pos);
+}, "~N");
+Clazz_defineMethod (c$, "clear", 
+function (from, to) {
+if (from < 0 || from > to) throw  new IndexOutOfBoundsException ();
+if (from == to) return ;
+var lo_offset = from >>> 5;
+var hi_offset = to >>> 5;
+this.ensure (hi_offset);
+if (lo_offset == hi_offset) {
+this.bits[hi_offset] &= ((1 << from) - 1) | (-1 << to);
+return ;
+}this.bits[lo_offset] &= (1 << from) - 1;
+this.bits[hi_offset] &= -1 << to;
+for (var i = lo_offset + 1; i < hi_offset; i++) this.bits[i] = 0;
+
+}, "~N,~N");
+Clazz_defineMethod (c$, "clone", 
+function () {
+try {
+var bs = Clazz_superCall (this, java.util.BitSet, "clone", []);
+bs.bits = this.bits.clone ();
+return bs;
+} catch (e) {
+if (Clazz_exceptionOf (e, CloneNotSupportedException)) {
+return null;
+} else {
+throw e;
+}
+}
+});
+Clazz_overrideMethod(c$, "equals", 
+function (obj) {
+if (!(Clazz_instanceOf (obj, java.util.BitSet))) return false;
+var bs = obj;
+var max = Math.min (this.bits.length, bs.bits.length);
+var i;
+for (i = 0; i < max; ++i) if (this.bits[i] != bs.bits[i]) return false;
+
+for (var j = i; j < this.bits.length; ++j) if (this.bits[j] != 0) return false;
+
+for (var j = i; j < bs.bits.length; ++j) if (bs.bits[j] != 0) return false;
+
+return true;
+}, "~O");
+Clazz_defineMethod (c$, "flip", 
+function (index) {
+var offset = index >> 5;
+this.ensure (offset);
+this.bits[offset] ^= 1 << index;
+}, "~N");
+Clazz_defineMethod (c$, "flip", 
+function (from, to) {
+if (from < 0 || from > to) throw  new IndexOutOfBoundsException ();
+if (from == to) return ;
+var lo_offset = from >>> 5;
+var hi_offset = to >>> 5;
+this.ensure (hi_offset);
+if (lo_offset == hi_offset) {
+this.bits[hi_offset] ^= (-1 << from) & ((1 << to) - 1);
+return ;
+}this.bits[lo_offset] ^= -1 << from;
+this.bits[hi_offset] ^= (1 << to) - 1;
+for (var i = lo_offset + 1; i < hi_offset; i++) this.bits[i] ^= -1;
+
+}, "~N,~N");
+Clazz_defineMethod (c$, "get", 
+function (pos) {
+var offset = pos >> 5;
+if (offset >= this.bits.length) return false;
+return (this.bits[offset] & (1 << pos)) != 0;
+}, "~N");
+Clazz_defineMethod (c$, "get", 
+function (from, to) {
+if (from < 0 || from > to) throw  new IndexOutOfBoundsException ();
+var bs =  new java.util.BitSet (to - from);
+var lo_offset = from >>> 5;
+if (lo_offset >= this.bits.length) return bs;
+var lo_bit = from & 4;
+var hi_offset = to >>> 5;
+if (lo_bit == 0) {
+var len = Math.min (hi_offset - lo_offset + 1, this.bits.length - lo_offset);
+System.arraycopy (this.bits, lo_offset, bs.bits, 0, len);
+if (hi_offset < this.bits.length) bs.bits[hi_offset - lo_offset] &= (1 << to) - 1;
+return bs;
+}var len = Math.min (hi_offset, this.bits.length - 1);
+var reverse = ~lo_bit;
+var i;
+for (i = 0; lo_offset < len; lo_offset++, i++) bs.bits[i] = ((this.bits[lo_offset] >>> lo_bit) | (this.bits[lo_offset + 1] << reverse));
+
+if ((to & 4) > lo_bit) bs.bits[i++] = this.bits[lo_offset] >>> lo_bit;
+if (hi_offset < this.bits.length) bs.bits[i - 1] &= (1 << (to - from)) - 1;
+return bs;
+}, "~N,~N");
+Clazz_overrideMethod(c$, "hashCode", 
+function () {
+var h = 1234;
+for (var i = this.bits.length; i > 0; ) h ^= i * this.bits[--i];
+
+return h;
+});
+Clazz_defineMethod (c$, "intersects", 
+function (set) {
+var i = Math.min (this.bits.length, set.bits.length);
+while (--i >= 0) if ((this.bits[i] & set.bits[i]) != 0) return true;
+
+return false;
+}, "java.util.BitSet");
+Clazz_defineMethod (c$, "isEmpty", 
+function () {
+for (var i = this.bits.length - 1; i >= 0; i--) if (this.bits[i] != 0) return false;
+
+return true;
+});
+Clazz_defineMethod (c$, "length", 
+function () {
+var i;
+for (i = this.bits.length - 1; i >= 0 && this.bits[i] == 0; --i) ;
+if (i < 0) return 0;
+var b = this.bits[i];
+var len = (i + 1) * 32;
+while ((b & 0x80000000) == 0) {
+--len;
+b <<= 1;
+}
+return len;
+});
+Clazz_defineMethod (c$, "nextClearBit", 
+function (from) {
+var offset = from >> 5;
+var mask = 1 << from;
+while (offset < this.bits.length) {
+var h = this.bits[offset];
+do {
+if ((h & mask) == 0) return from;
+mask <<= 1;
+from++;
+} while (mask != 0);
+mask = 1;
+offset++;
+}
+return from;
+}, "~N");
+Clazz_defineMethod (c$, "nextSetBit", 
+function (from) {
+var offset = from >> 5;
+var mask = 1 << from;
+while (offset < this.bits.length) {
+var h = this.bits[offset];
+do {
+if ((h & mask) != 0) return from;
+mask <<= 1;
+from++;
+} while (mask != 0);
+mask = 1;
+offset++;
+}
+return -1;
+}, "~N");
+Clazz_defineMethod (c$, "or", 
+function (bs) {
+this.ensure (bs.bits.length - 1);
+for (var i = bs.bits.length - 1; i >= 0; i--) this.bits[i] |= bs.bits[i];
+
+}, "java.util.BitSet");
+Clazz_defineMethod (c$, "set", 
+function (pos) {
+var offset = pos >> 5;
+this.ensure (offset);
+this.bits[offset] |= 1 << pos;
+}, "~N");
+Clazz_defineMethod (c$, "set", 
+function (index, value) {
+if (value) this.set (index);
+ else this.clear (index);
+}, "~N,~B");
+Clazz_defineMethod (c$, "set", 
+function (from, to) {
+if (from < 0 || from > to) throw  new IndexOutOfBoundsException ();
+if (from == to) return ;
+var lo_offset = from >>> 5;
+var hi_offset = to >>> 5;
+this.ensure (hi_offset);
+if (lo_offset == hi_offset) {
+this.bits[hi_offset] |= (-1 << from) & ((1 << to) - 1);
+return ;
+}this.bits[lo_offset] |= -1 << from;
+this.bits[hi_offset] |= (1 << to) - 1;
+for (var i = lo_offset + 1; i < hi_offset; i++) this.bits[i] = -1;
+
+}, "~N,~N");
+Clazz_defineMethod (c$, "set", 
+function (from, to, value) {
+if (value) this.set (from, to);
+ else this.clear (from, to);
+}, "~N,~N,~B");
+Clazz_defineMethod (c$, "size", 
+function () {
+return this.bits.length * 32;
+});
+Clazz_overrideMethod(c$, "toString", 
+function () {
+var r =  new StringBuffer ("{");
+var first = true;
+for (var i = 0; i < this.bits.length; ++i) {
+var bit = 1;
+var word = this.bits[i];
+if (word == 0) continue ;for (var j = 0; j < 32; ++j) {
+if ((word & bit) != 0) {
+if (!first) r.append (", ");
+r.append (32 * i + j);
+first = false;
+}bit <<= 1;
+}
+}
+return r.append ("}").toString ();
+});
+Clazz_defineMethod (c$, "xor", 
+function (bs) {
+this.ensure (bs.bits.length - 1);
+for (var i = bs.bits.length - 1; i >= 0; i--) this.bits[i] ^= bs.bits[i];
+
+}, "java.util.BitSet");
+Clazz_defineMethod (c$, "ensure", 
+ function (lastElt) {
+if (lastElt >= this.bits.length) {
+var nd =  Clazz_newArray (lastElt + 1, 0);
+System.arraycopy (this.bits, 0, nd, 0, this.bits.length);
+this.bits = nd;
+}}, "~N");
+Clazz_defineStatics (c$,
+"INT_MASK", 0x4);
+});
+Clazz_declarePackage ("com.stevesoft.pat");
+Clazz_load (["java.util.Hashtable"], "com.stevesoft.pat.ReplaceRule", ["com.stevesoft.pat.Ctrl", "$.Regex", "$.Transformer", "java.lang.StringBuffer"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.next = null;
+this.name = null;
+Clazz_instantialize (this, arguments);
+}, com.stevesoft.pat, "ReplaceRule");
+Clazz_prepareFields (c$, function () {
+this.name = this.getClass ().getName ();
+});
+Clazz_defineMethod (c$, "clone1", 
+function () {
+return  new com.stevesoft.pat.RuleHolder (this);
+});
+Clazz_overrideMethod (c$, "clone", 
+function () {
+var x = this.clone1 ();
+var xsav = x;
+var y = this;
+while (y.next != null) {
+x.next = y.next.clone1 ();
+x.name = y.name;
+x = x.next;
+y = y.next;
+}
+return xsav;
+});
+c$.add = Clazz_defineMethod (c$, "add", 
+function (head, adding) {
+if (head == null) {
+return head = adding;
+}head.addRule (adding);
+return head;
+}, "com.stevesoft.pat.ReplaceRule,com.stevesoft.pat.ReplaceRule");
+Clazz_defineMethod (c$, "add", 
+function (adding) {
+return com.stevesoft.pat.ReplaceRule.add (this, adding);
+}, "com.stevesoft.pat.ReplaceRule");
+Clazz_defineMethod (c$, "addRule", 
+function (r) {
+if (this.next == null) {
+this.next = r;
+} else {
+this.next.addRule (r);
+}}, "com.stevesoft.pat.ReplaceRule");
+c$.getv = Clazz_defineMethod (c$, "getv", 
+ function () {
+if (com.stevesoft.pat.ReplaceRule.getvar != null) {
+return com.stevesoft.pat.ReplaceRule.getvar.clone ();
+}com.stevesoft.pat.ReplaceRule.getvar =  new com.stevesoft.pat.Regex ("(?:\\\\(\\d+)|\\$(?:(\\d+)|(\\w+)|([&\'`])|\\{(?:(\\d+)|([^\n}\\\\]+))})|\\\\([nrbtaef])|\\\\c([\u0000-\uffff])|\\\\x([A-Fa-f0-9]{2})|\\\\([\u0000-\uffff]))", "");
+com.stevesoft.pat.ReplaceRule.getvar.optimize ();
+return com.stevesoft.pat.ReplaceRule.getvar;
+});
+c$.perlCode = Clazz_defineMethod (c$, "perlCode", 
+function (s) {
+try {
+var mf = 0;
+var mt = 0;
+var gv = com.stevesoft.pat.ReplaceRule.getv ();
+var head = null;
+var tmp = null;
+while (gv.searchFrom (s, mt)) {
+var off = com.stevesoft.pat.Regex.BackRefOffset - 1;
+mf = gv.matchedFrom ();
+if (mf > mt) {
+head = com.stevesoft.pat.ReplaceRule.add (head,  new com.stevesoft.pat.StringRule (s.substring (mt, mf)));
+}var $var = null;
+if (($var = gv.stringMatchedI (1 + off)) != null || ($var = gv.stringMatchedI (2 + off)) != null || ($var = gv.stringMatchedI (5 + off)) != null) {
+var d = 0;
+for (var i = 0; i < $var.length; i++) {
+d = 8 * d + ($var.charCodeAt (i) - 48);
+}
+if ($var.length == 1) {
+head = com.stevesoft.pat.ReplaceRule.add (head,  new com.stevesoft.pat.BackRefRule (d));
+} else {
+head =  new com.stevesoft.pat.StringRule ("" + String.fromCharCode (d));
+}} else if (($var = gv.stringMatchedI (10 + off)) != null) {
+if ("QELlUu".indexOf ($var) >= 0) {
+head = com.stevesoft.pat.ReplaceRule.add (head,  new com.stevesoft.pat.CodeRule ($var.charAt (0)));
+} else {
+head = com.stevesoft.pat.ReplaceRule.add (head,  new com.stevesoft.pat.StringRule ($var));
+}} else if (($var = gv.stringMatchedI (3 + off)) != null || ($var = gv.stringMatchedI (4 + off)) != null || ($var = gv.stringMatchedI (6 + off)) != null) {
+var arg = "";
+var pc;
+if ((pc = $var.indexOf (':')) > 0) {
+arg = $var.substring (pc + 1);
+$var = $var.substring (0, pc);
+}if ($var.equals ("&") || $var.equals ("MATCH")) {
+head = com.stevesoft.pat.ReplaceRule.add (head,  new com.stevesoft.pat.AmpersandRule ());
+} else if ($var.equals ("`") || $var.equals ("PREMATCH")) {
+head = com.stevesoft.pat.ReplaceRule.add (head,  new com.stevesoft.pat.LeftRule ());
+} else if ($var.equals ("'") || $var.equals ("POSTMATCH")) {
+head = com.stevesoft.pat.ReplaceRule.add (head,  new com.stevesoft.pat.RightRule ());
+} else if ($var.equals ("WANT_MORE_TEXT")) {
+head = com.stevesoft.pat.ReplaceRule.add (head,  new com.stevesoft.pat.WantMoreTextReplaceRule ());
+} else if ($var.equals ("POP")) {
+head = com.stevesoft.pat.ReplaceRule.add (head,  new com.stevesoft.pat.PopRule ());
+} else if ($var.startsWith ("+") && (tmp = com.stevesoft.pat.ReplaceRule.defs.get ($var.substring (1))) != null) {
+if (Clazz_instanceOf (tmp, com.stevesoft.pat.Regex)) {
+head = com.stevesoft.pat.ReplaceRule.add (head,  new com.stevesoft.pat.PushRule ($var.substring (1), tmp));
+} else if (Clazz_instanceOf (tmp, com.stevesoft.pat.Transformer)) {
+head = com.stevesoft.pat.ReplaceRule.add (head,  new com.stevesoft.pat.PushRule ($var.substring (1), tmp));
+} else {
+head = com.stevesoft.pat.ReplaceRule.add (head,  new com.stevesoft.pat.StringRule ("${" + $var + "}"));
+}} else if ($var.startsWith ("=") && (tmp = com.stevesoft.pat.ReplaceRule.defs.get ($var.substring (1))) != null) {
+if (Clazz_instanceOf (tmp, com.stevesoft.pat.Regex)) {
+head = com.stevesoft.pat.ReplaceRule.add (head,  new com.stevesoft.pat.ChangeRule ($var.substring (1), tmp));
+} else if (Clazz_instanceOf (tmp, com.stevesoft.pat.Transformer)) {
+head = com.stevesoft.pat.ReplaceRule.add (head,  new com.stevesoft.pat.ChangeRule ($var.substring (1), tmp));
+} else {
+head = com.stevesoft.pat.ReplaceRule.add (head,  new com.stevesoft.pat.StringRule ("${" + $var + "}"));
+}} else if ((tmp = com.stevesoft.pat.ReplaceRule.defs.get ($var)) != null) {
+if (Clazz_instanceOf (tmp, com.stevesoft.pat.ReplaceRule)) {
+var alt = (tmp).arg (arg);
+if (alt == null) {
+alt = (tmp);
+}head = com.stevesoft.pat.ReplaceRule.add (head, (alt.clone ()));
+}} else {
+head = com.stevesoft.pat.ReplaceRule.add (head,  new com.stevesoft.pat.StringRule ("${" + $var + "}"));
+}} else if (($var = gv.stringMatchedI (7 + off)) != null) {
+var c = $var.charAt (0);
+if (c == 'n') {
+head = com.stevesoft.pat.ReplaceRule.add (head,  new com.stevesoft.pat.StringRule ("\n"));
+} else if (c == 't') {
+head = com.stevesoft.pat.ReplaceRule.add (head,  new com.stevesoft.pat.StringRule ("\t"));
+} else if (c == 'r') {
+head = com.stevesoft.pat.ReplaceRule.add (head,  new com.stevesoft.pat.StringRule ("\r"));
+} else if (c == 'b') {
+head = com.stevesoft.pat.ReplaceRule.add (head,  new com.stevesoft.pat.StringRule ("\r"));
+} else if (c == 'a') {
+head = com.stevesoft.pat.ReplaceRule.add (head,  new com.stevesoft.pat.StringRule ("\u0007"));
+} else if (c == 'e') {
+head = com.stevesoft.pat.ReplaceRule.add (head,  new com.stevesoft.pat.StringRule ("\u001b"));
+} else if (c == 'f') {
+head = com.stevesoft.pat.ReplaceRule.add (head,  new com.stevesoft.pat.StringRule ("\f"));
+}} else if (($var = gv.stringMatchedI (8 + off)) != null) {
+var c = $var.charAt (0);
+if (c.charCodeAt (0) < com.stevesoft.pat.Ctrl.cmap.length) {
+c = com.stevesoft.pat.Ctrl.cmap[c.charCodeAt (0)];
+}head = com.stevesoft.pat.ReplaceRule.add (head,  new com.stevesoft.pat.StringRule ("" + c));
+} else if (($var = gv.stringMatchedI (9 + off)) != null) {
+var d = 16 * com.stevesoft.pat.ReplaceRule.getHexDigit ($var.charAt (0)) + com.stevesoft.pat.ReplaceRule.getHexDigit ($var.charAt (1));
+head = com.stevesoft.pat.ReplaceRule.add (head,  new com.stevesoft.pat.StringRule ("" + String.fromCharCode (d)));
+}mt = gv.matchedTo ();
+}
+if (mt <= s.length) {
+head = com.stevesoft.pat.ReplaceRule.add (head,  new com.stevesoft.pat.StringRule (s.substring (mt)));
+}return head;
+} finally {
+}
+}, "~S");
+c$.isDefined = Clazz_defineMethod (c$, "isDefined", 
+function (s) {
+return com.stevesoft.pat.ReplaceRule.defs.get (s) != null;
+}, "~S");
+c$.define = Clazz_defineMethod (c$, "define", 
+function (s, r) {
+com.stevesoft.pat.ReplaceRule.defs.put (s, r);
+}, "~S,com.stevesoft.pat.Regex");
+c$.define = Clazz_defineMethod (c$, "define", 
+function (s, r) {
+com.stevesoft.pat.ReplaceRule.defs.put (s, r);
+r.name = s;
+}, "~S,com.stevesoft.pat.ReplaceRule");
+c$.define = Clazz_defineMethod (c$, "define", 
+function (s, t) {
+com.stevesoft.pat.ReplaceRule.defs.put (s, t);
+}, "~S,com.stevesoft.pat.Transformer");
+c$.undefine = Clazz_defineMethod (c$, "undefine", 
+function (s) {
+com.stevesoft.pat.ReplaceRule.defs.remove (s);
+}, "~S");
+Clazz_defineMethod (c$, "toString1", 
+function () {
+return "${" + this.name + "}";
+});
+Clazz_overrideMethod (c$, "toString", 
+function () {
+var sb =  new StringBuffer ();
+sb.append (this.toString1 ());
+var rr = this.next;
+while (rr != null) {
+sb.append (rr.toString1 ());
+rr = rr.next;
+}
+return sb.toString ();
+});
+Clazz_defineMethod (c$, "arg", 
+function (s) {
+return null;
+}, "~S");
+c$.getHexDigit = Clazz_defineMethod (c$, "getHexDigit", 
+function (c) {
+if (c >= '0' && c <= '9') {
+return c.charCodeAt (0) - 48;
+}if (c >= 'a' && c <= 'f') {
+return c.charCodeAt (0) - 97 + 10;
+}return c.charCodeAt (0) - 65 + 10;
+}, "~S");
+Clazz_defineStatics (c$,
+"getvar", null);
+c$.defs = c$.prototype.defs =  new java.util.Hashtable ();
+});
+Clazz_declarePackage ("com.stevesoft.pat");
+Clazz_load (["com.stevesoft.pat.ReplaceRule", "$.Replacer"], ["com.stevesoft.pat.Transformer", "$.TransRepRule"], ["com.stevesoft.pat.MessageManager", "$.Regex", "$.TransPat", "com.stevesoft.pat.wrap.StringWrap", "java.lang.ArrayIndexOutOfBoundsException", "$.NullPointerException"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.t = null;
+Clazz_instantialize (this, arguments);
+}, com.stevesoft.pat, "TransRepRule", com.stevesoft.pat.ReplaceRule);
+Clazz_makeConstructor (c$, 
+function (t) {
+Clazz_superConstructor (this, com.stevesoft.pat.TransRepRule, []);
+this.t = t;
+}, "com.stevesoft.pat.Transformer");
+Clazz_overrideMethod (c$, "toString1", 
+function () {
+return "";
+});
+Clazz_overrideMethod (c$, "clone1", 
+function () {
+return  new com.stevesoft.pat.TransRepRule (this.t);
+});
+Clazz_overrideMethod (c$, "apply", 
+function (sb, rr) {
+this.next = this.t.tp.ra[this.t.tp.pn].getReplaceRule ();
+}, "com.stevesoft.pat.StringBufferLike,com.stevesoft.pat.RegRes");
+c$ = Clazz_decorateAsClass (function () {
+this.tp = null;
+this.rp = null;
+this.auto_optimize = false;
+this.repr = null;
+Clazz_instantialize (this, arguments);
+}, com.stevesoft.pat, "Transformer");
+Clazz_prepareFields (c$, function () {
+this.repr =  new com.stevesoft.pat.Replacer ();
+});
+Clazz_defineMethod (c$, "getReplacer", 
+function () {
+return this.rp.getReplacer ();
+});
+Clazz_makeConstructor (c$, 
+function (auto) {
+this.rp =  new com.stevesoft.pat.Regex (null, "");
+this.auto_optimize = auto;
+this.tp =  new com.stevesoft.pat.TransPat ();
+this.rp.setReplaceRule ( new com.stevesoft.pat.TransRepRule (this));
+this.rp.thePattern = this.tp;
+}, "~B");
+Clazz_defineMethod (c$, "add", 
+function (r) {
+if (this.auto_optimize) {
+r.optimize ();
+}this.tp.ra[this.tp.ra_len++] = r;
+if (this.tp.ra.length == this.tp.ra_len) {
+var ra2 =  new Array (this.tp.ra_len + 10);
+for (var i = 0; i < this.tp.ra_len; i++) {
+ra2[i] = this.tp.ra[i];
+}
+this.tp.ra = ra2;
+}this.rp.numSubs_ = r.numSubs_ > this.rp.numSubs_ ? r.numSubs_ : this.rp.numSubs_;
+}, "com.stevesoft.pat.Regex");
+Clazz_defineMethod (c$, "patterns", 
+function () {
+return this.tp.ra_len;
+});
+Clazz_defineMethod (c$, "getRegexAt", 
+function (i) {
+if (i >= this.tp.ra_len) {
+throw  new ArrayIndexOutOfBoundsException ("i=" + i + ">=" + this.patterns ());
+}if (i < 0) {
+throw  new ArrayIndexOutOfBoundsException ("i=" + i + "< 0");
+}return this.tp.ra[i];
+}, "~N");
+Clazz_defineMethod (c$, "setRegexAt", 
+function (rx, i) {
+if (i >= this.tp.ra_len) {
+throw  new ArrayIndexOutOfBoundsException ("i=" + i + ">=" + this.patterns ());
+}if (i < 0) {
+throw  new ArrayIndexOutOfBoundsException ("i=" + i + "< 0");
+}this.tp.ra[i] = rx;
+}, "com.stevesoft.pat.Regex,~N");
+Clazz_defineMethod (c$, "add", 
+function (rs) {
+var r = com.stevesoft.pat.Regex.perlCode (rs);
+if (r == null) {
+throw  new NullPointerException (com.stevesoft.pat.MessageManager.formatMessage ("exception.bad_pattern_to_regex_perl_code",  Clazz_newArray (-1, [rs])));
+}this.add (r);
+}, "~S");
+Clazz_defineMethod (c$, "add", 
+function (array) {
+for (var i = 0; i < array.length; i++) {
+this.add (array[i]);
+}
+}, "~A");
+Clazz_defineMethod (c$, "replaceAll", 
+function (s) {
+return this.dorep (s, 0, s.length);
+}, "~S");
+Clazz_defineMethod (c$, "replaceAll", 
+function (s) {
+return this.dorep (s, 0, s.length ());
+}, "com.stevesoft.pat.StringLike");
+Clazz_defineMethod (c$, "replaceAllFrom", 
+function (s, start) {
+return this.dorep (s, start, s.length);
+}, "~S,~N");
+Clazz_defineMethod (c$, "replaceAllRegion", 
+function (s, start, end) {
+return this.dorep (s, start, end);
+}, "~S,~N,~N");
+Clazz_defineMethod (c$, "dorep", 
+function (s, start, end) {
+var tfmd = this.repr.replaceAllRegion (s, this.rp, start, end);
+this.tp.lastMatchedTo = this.repr.$lastMatchedTo;
+return tfmd;
+}, "com.stevesoft.pat.StringLike,~N,~N");
+Clazz_defineMethod (c$, "dorep", 
+function (s, start, end) {
+return this.dorep ( new com.stevesoft.pat.wrap.StringWrap (s), start, end).toString ();
+}, "~S,~N,~N");
+Clazz_defineMethod (c$, "replaceFirst", 
+function (s) {
+return this.dorep (s, 0, s.length);
+}, "~S");
+Clazz_defineMethod (c$, "replaceFirstFrom", 
+function (s, start) {
+return this.dorep (s, start, s.length);
+}, "~S,~N");
+Clazz_defineMethod (c$, "replaceFirstRegion", 
+function (s, start, end) {
+return this.dorep (s, start, end);
+}, "~S,~N,~N");
+});
+Clazz_declarePackage ("com.stevesoft.pat");
+Clazz_load (null, ["com.stevesoft.pat.RegHolder", "$.Replacer", "$.CodeVal"], ["com.stevesoft.pat.AmpersandRule", "$.ChangeRule", "$.MessageManager", "$.PopRule", "$.PushRule", "$.RuleHolder", "$.SpecialRule", "$.StringBufferLike", "$.WantMoreTextReplaceRule", "com.stevesoft.pat.wrap.StringWrap", "java.lang.NullPointerException"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.me = null;
+this.prev = null;
+Clazz_instantialize (this, arguments);
+}, com.stevesoft.pat, "RegHolder");
+c$ = Clazz_decorateAsClass (function () {
+this.pos = 0;
+this.code = '\0';
+Clazz_instantialize (this, arguments);
+}, com.stevesoft.pat, "CodeVal");
+Clazz_makeConstructor (c$, 
+function (p, c) {
+this.pos = p;
+this.code = c;
+}, "~N,~S");
+Clazz_overrideMethod (c$, "toString", 
+function () {
+return "(" + this.pos + "," + this.code + ")";
+});
+c$ = Clazz_decorateAsClass (function () {
+this.first = false;
+this.rh = null;
+this.sb = null;
+this.src = null;
+this.pos = 0;
+this.want_more_text = false;
+this.want_more_text_enable = false;
+this.$lastMatchedTo = 0;
+Clazz_instantialize (this, arguments);
+}, com.stevesoft.pat, "Replacer");
+Clazz_prepareFields (c$, function () {
+this.rh =  new com.stevesoft.pat.RegHolder ();
+});
+Clazz_makeConstructor (c$, 
+function () {
+});
+Clazz_defineMethod (c$, "replaceFirstRegion", 
+function (s, r, start, end) {
+return this.replaceFirstRegion ( new com.stevesoft.pat.wrap.StringWrap (s), r, start, end);
+}, "~S,com.stevesoft.pat.Regex,~N,~N");
+Clazz_defineMethod (c$, "replaceFirstRegion", 
+function (s, r, start, end) {
+this.first = true;
+this.rh.me = r;
+this.rh.prev = null;
+return this.dorep (s, start, end);
+}, "com.stevesoft.pat.StringLike,com.stevesoft.pat.Regex,~N,~N");
+Clazz_defineMethod (c$, "replaceFirst", 
+function (s) {
+return this.replaceFirstRegion (s, 0, s.length ());
+}, "com.stevesoft.pat.StringLike");
+Clazz_defineMethod (c$, "replaceFirstFrom", 
+function (s, start) {
+return this.replaceFirstRegion (s, start, s.length ());
+}, "com.stevesoft.pat.StringLike,~N");
+Clazz_defineMethod (c$, "replaceFirstRegion", 
+function (s, start, end) {
+this.first = true;
+return this.dorep (s, start, end);
+}, "com.stevesoft.pat.StringLike,~N,~N");
+Clazz_defineMethod (c$, "replaceAllRegion", 
+function (s, r, start, end) {
+return this.replaceAllRegion ( new com.stevesoft.pat.wrap.StringWrap (s), r, start, end);
+}, "~S,com.stevesoft.pat.Regex,~N,~N");
+Clazz_defineMethod (c$, "replaceAllRegion", 
+function (s, r, start, end) {
+this.first = false;
+this.rh.me = r;
+this.rh.prev = null;
+return this.dorep (s, start, end);
+}, "com.stevesoft.pat.StringLike,com.stevesoft.pat.Regex,~N,~N");
+Clazz_defineMethod (c$, "replaceAll", 
+function (s) {
+return this.replaceAllRegion (s, 0, s.length ());
+}, "com.stevesoft.pat.StringLike");
+Clazz_defineMethod (c$, "replaceAllFrom", 
+function (s, start) {
+return this.replaceAllRegion (s, start, s.length ());
+}, "com.stevesoft.pat.StringLike,~N");
+Clazz_defineMethod (c$, "replaceAllRegion", 
+function (s, start, end) {
+this.first = false;
+return this.dorep (s, start, end);
+}, "com.stevesoft.pat.StringLike,~N,~N");
+Clazz_defineMethod (c$, "replaceAll", 
+function (s) {
+return this.replaceAllRegion ( new com.stevesoft.pat.wrap.StringWrap (s), 0, s.length).toString ();
+}, "~S");
+Clazz_defineMethod (c$, "replaceAllFrom", 
+function (s, start) {
+return this.replaceAllRegion ( new com.stevesoft.pat.wrap.StringWrap (s), start, s.length).toString ();
+}, "~S,~N");
+Clazz_defineMethod (c$, "replaceAllRegion", 
+function (s, start, end) {
+this.first = false;
+return this.dorep ( new com.stevesoft.pat.wrap.StringWrap (s), start, end).toString ();
+}, "~S,~N,~N");
+Clazz_defineMethod (c$, "isSpecial", 
+function (x) {
+while (x != null) {
+if (Clazz_instanceOf (x, com.stevesoft.pat.SpecialRule) || (Clazz_instanceOf (x, com.stevesoft.pat.RuleHolder) && Clazz_instanceOf ((x).held, com.stevesoft.pat.SpecialRule))) {
+return true;
+}x = x.next;
+}
+return false;
+}, "com.stevesoft.pat.ReplaceRule");
+Clazz_defineMethod (c$, "apply1", 
+function (rr) {
+rr.charsMatched_++;
+this.apply (rr, null);
+rr.charsMatched_--;
+}, "com.stevesoft.pat.RegRes");
+Clazz_defineMethod (c$, "dorep", 
+function (s, start, end) {
+var ret = s;
+this.want_more_text = false;
+this.$lastMatchedTo = 0;
+if (this.rh.me == null) {
+throw  new NullPointerException (com.stevesoft.pat.MessageManager.getString ("exception.replace_null_regex_pointer"));
+}if (this.rh.me._searchLike (s, start, end)) {
+var rmn = this.rh.me.matchedTo ();
+if (this.rh.me.charsMatched () == 0 && !this.isSpecial (this.rh.me.getReplaceRule ())) {
+this.apply1 (this.rh.me);
+rmn++;
+}this.apply (this.rh.me);
+if (!this.first) {
+for (var i = rmn; !this.want_more_text && this.rh.me._searchLike (s, i, end); i = rmn) {
+rmn = this.rh.me.matchedTo ();
+if (this.rh.me.charsMatched () == 0) {
+if (!this.isSpecial (this.rh.me.getReplaceRule ())) {
+this.apply1 (this.rh.me);
+}rmn++;
+}this.apply (this.rh.me);
+}
+}ret = this.finish ();
+ret = ret == null ? s : ret;
+}return ret;
+}, "com.stevesoft.pat.StringLike,~N,~N");
+Clazz_defineMethod (c$, "apply", 
+function (r, rp) {
+if (rp == null || (rp.next == null && Clazz_instanceOf (rp, com.stevesoft.pat.AmpersandRule))) {
+return;
+}if (r.didMatch ()) {
+if (this.src == null) {
+this.src = r.getStringLike ();
+}if (this.sb == null) {
+this.sb =  new com.stevesoft.pat.StringBufferLike (this.src.newStringBufferLike ());
+}var rmf = r.matchedFrom ();
+for (var ii = this.pos; ii < rmf; ii++) {
+this.sb.appendC (this.src.charAt (ii));
+}
+for (var x = rp; x != null; x = x.next) {
+x.apply (this.sb, r);
+if (Clazz_instanceOf (x, com.stevesoft.pat.SpecialRule)) {
+if (Clazz_instanceOf (x, com.stevesoft.pat.WantMoreTextReplaceRule) && this.want_more_text_enable) {
+this.want_more_text = true;
+} else if (Clazz_instanceOf (x, com.stevesoft.pat.PushRule)) {
+var rh2 =  new com.stevesoft.pat.RegHolder ();
+rh2.me = (x).NewRule;
+rh2.prev = this.rh;
+this.rh = rh2;
+} else if (Clazz_instanceOf (x, com.stevesoft.pat.PopRule)) {
+if (this.rh.prev != null) {
+this.rh = this.rh.prev;
+}} else if (Clazz_instanceOf (x, com.stevesoft.pat.ChangeRule)) {
+this.rh.me = (x).NewRule;
+}}}
+if (!this.want_more_text) {
+this.pos = r.matchedTo ();
+}}}, "com.stevesoft.pat.RegRes,com.stevesoft.pat.ReplaceRule");
+Clazz_defineMethod (c$, "WantMoreText", 
+function () {
+return this.want_more_text;
+});
+Clazz_defineMethod (c$, "apply", 
+function (r) {
+this.apply (r, r.getReplaceRule ());
+}, "com.stevesoft.pat.Regex");
+Clazz_defineMethod (c$, "finish", 
+function () {
+if (this.src == null) {
+return null;
+}var s_end = this.src.length ();
+for (var ii = this.pos; ii < s_end; ii++) {
+this.sb.appendC (this.src.charAt (ii));
+}
+this.src = null;
+this.$lastMatchedTo = this.pos;
+this.pos = 0;
+var retstr = this.sb.toStringLike ();
+this.sb = null;
+return retstr;
+});
+Clazz_overrideMethod (c$, "clone", 
+function () {
+var r =  new com.stevesoft.pat.Replacer ();
+r.first = this.first;
+r.src = this.src;
+r.sb = this.sb;
+r.pos = this.pos;
+r.$lastMatchedTo = this.$lastMatchedTo;
+r.want_more_text = this.want_more_text;
+r.want_more_text_enable = this.want_more_text_enable;
+r.rh.me = this.rh.me;
+r.rh.prev = this.rh.prev;
+return r;
+});
+Clazz_defineMethod (c$, "lastMatchedTo", 
+function () {
+return this.$lastMatchedTo;
+});
+Clazz_defineMethod (c$, "getRegex", 
+function () {
+return this.rh.me;
+});
+Clazz_defineMethod (c$, "setSource", 
+function (sl) {
+this.src = sl;
+}, "com.stevesoft.pat.StringLike");
+Clazz_defineMethod (c$, "setBuffer", 
+function (sbl) {
+this.sb = sbl;
+}, "com.stevesoft.pat.StringBufferLike");
+Clazz_defineMethod (c$, "setPos", 
+function (pos) {
+this.pos = pos;
+}, "~N");
+});
+Clazz_declarePackage ("com.stevesoft.pat");
+Clazz_load (["com.stevesoft.pat.ReplaceRule"], "com.stevesoft.pat.AmpersandRule", null, function () {
+c$ = Clazz_declareType (com.stevesoft.pat, "AmpersandRule", com.stevesoft.pat.ReplaceRule);
+Clazz_makeConstructor (c$, 
+function () {
+Clazz_superConstructor (this, com.stevesoft.pat.AmpersandRule, []);
+});
+Clazz_overrideMethod (c$, "apply", 
+function (sb, res) {
+sb.append (res.stringMatched ());
+}, "com.stevesoft.pat.StringBufferLike,com.stevesoft.pat.RegRes");
+Clazz_overrideMethod (c$, "toString1", 
+function () {
+return "$&";
+});
+});
+Clazz_declarePackage ("com.stevesoft.pat");
+Clazz_load (["com.stevesoft.pat.SpecialRule"], "com.stevesoft.pat.ChangeRule", null, function () {
+c$ = Clazz_decorateAsClass (function () {
+this.NewRule = null;
+Clazz_instantialize (this, arguments);
+}, com.stevesoft.pat, "ChangeRule", com.stevesoft.pat.SpecialRule);
+Clazz_makeConstructor (c$, 
+function (c) {
+Clazz_superConstructor (this, com.stevesoft.pat.ChangeRule, []);
+this.NewRule = c.NewRule;
+}, "com.stevesoft.pat.ChangeRule");
+Clazz_makeConstructor (c$, 
+function (nm, rr) {
+Clazz_superConstructor (this, com.stevesoft.pat.ChangeRule, []);
+this.name = nm;
+this.NewRule = rr;
+}, "~S,com.stevesoft.pat.Regex");
+Clazz_makeConstructor (c$, 
+function (nm, tr) {
+Clazz_superConstructor (this, com.stevesoft.pat.ChangeRule, []);
+this.name = nm;
+this.NewRule = tr.rp;
+}, "~S,com.stevesoft.pat.Transformer");
+Clazz_overrideMethod (c$, "clone1", 
+function () {
+return  new com.stevesoft.pat.ChangeRule (this);
+});
+Clazz_overrideMethod (c$, "toString1", 
+function () {
+return "${=" + this.name + "}";
+});
+Clazz_overrideMethod (c$, "apply", 
+function (sb, rr) {
+}, "com.stevesoft.pat.StringBufferLike,com.stevesoft.pat.RegRes");
+});
+Clazz_declarePackage ("com.stevesoft.pat");
+Clazz_load (["com.stevesoft.pat.ReplaceRule"], "com.stevesoft.pat.SpecialRule", null, function () {
+c$ = Clazz_declareType (com.stevesoft.pat, "SpecialRule", com.stevesoft.pat.ReplaceRule);
+Clazz_makeConstructor (c$, 
+function () {
+Clazz_superConstructor (this, com.stevesoft.pat.SpecialRule, []);
+});
+Clazz_overrideMethod (c$, "apply", 
+function (sb, rr) {
+}, "com.stevesoft.pat.StringBufferLike,com.stevesoft.pat.RegRes");
+});
+Clazz_declarePackage ("com.stevesoft.pat");
+Clazz_load (["com.stevesoft.pat.SpecialRule"], "com.stevesoft.pat.PopRule", null, function () {
+c$ = Clazz_declareType (com.stevesoft.pat, "PopRule", com.stevesoft.pat.SpecialRule);
+Clazz_makeConstructor (c$, 
+function () {
+Clazz_superConstructor (this, com.stevesoft.pat.PopRule, []);
+});
+Clazz_overrideMethod (c$, "toString1", 
+function () {
+return "${POP}";
+});
+});
+Clazz_declarePackage ("com.stevesoft.pat");
+Clazz_load (["com.stevesoft.pat.SpecialRule"], "com.stevesoft.pat.PushRule", null, function () {
+c$ = Clazz_decorateAsClass (function () {
+this.NewRule = null;
+Clazz_instantialize (this, arguments);
+}, com.stevesoft.pat, "PushRule", com.stevesoft.pat.SpecialRule);
+Clazz_makeConstructor (c$, 
+function (p) {
+Clazz_superConstructor (this, com.stevesoft.pat.PushRule, []);
+this.NewRule = p.NewRule;
+}, "com.stevesoft.pat.PushRule");
+Clazz_makeConstructor (c$, 
+function (nm, rr) {
+Clazz_superConstructor (this, com.stevesoft.pat.PushRule, []);
+this.name = nm;
+this.NewRule = rr;
+}, "~S,com.stevesoft.pat.Regex");
+Clazz_makeConstructor (c$, 
+function (nm, tr) {
+Clazz_superConstructor (this, com.stevesoft.pat.PushRule, []);
+this.name = nm;
+this.NewRule = tr.rp;
+}, "~S,com.stevesoft.pat.Transformer");
+Clazz_overrideMethod (c$, "clone1", 
+function () {
+return  new com.stevesoft.pat.PushRule (this);
+});
+Clazz_defineMethod (c$, "String1", 
+function () {
+return "${+" + this.name + "}";
+});
+Clazz_overrideMethod (c$, "apply", 
+function (sbl, rr) {
+}, "com.stevesoft.pat.StringBufferLike,com.stevesoft.pat.RegRes");
+});
+Clazz_declarePackage ("com.stevesoft.pat");
+Clazz_load (["com.stevesoft.pat.ReplaceRule"], "com.stevesoft.pat.RuleHolder", null, function () {
+c$ = Clazz_decorateAsClass (function () {
+this.held = null;
+Clazz_instantialize (this, arguments);
+}, com.stevesoft.pat, "RuleHolder", com.stevesoft.pat.ReplaceRule);
+Clazz_makeConstructor (c$, 
+function () {
+Clazz_superConstructor (this, com.stevesoft.pat.RuleHolder, []);
+});
+Clazz_makeConstructor (c$, 
+function (h) {
+Clazz_superConstructor (this, com.stevesoft.pat.RuleHolder, []);
+this.held = h;
+}, "com.stevesoft.pat.ReplaceRule");
+Clazz_overrideMethod (c$, "clone1", 
+function () {
+return  new com.stevesoft.pat.RuleHolder (this.held);
+});
+Clazz_defineMethod (c$, "toString1", 
+function () {
+return this.held.toString1 ();
+});
+Clazz_defineMethod (c$, "apply", 
+function (sb, rr) {
+this.held.apply (sb, rr);
+}, "com.stevesoft.pat.StringBufferLike,com.stevesoft.pat.RegRes");
+Clazz_defineMethod (c$, "arg", 
+function (s) {
+return  new com.stevesoft.pat.RuleHolder (this.held.arg (s));
+}, "~S");
+});
+Clazz_declarePackage ("com.stevesoft.pat");
+Clazz_load (["com.stevesoft.pat.BasicStringBufferLike"], "com.stevesoft.pat.StringBufferLike", ["com.stevesoft.pat.CaseMgr"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.sbl = null;
+this.mode = 'E';
+this.altMode = ' ';
+Clazz_instantialize (this, arguments);
+}, com.stevesoft.pat, "StringBufferLike", null, com.stevesoft.pat.BasicStringBufferLike);
+Clazz_makeConstructor (c$, 
+function (sbl) {
+this.sbl = sbl;
+}, "com.stevesoft.pat.BasicStringBufferLike");
+Clazz_defineMethod (c$, "toStringLike", 
+function () {
+return this.sbl.toStringLike ();
+});
+Clazz_defineMethod (c$, "toString", 
+function () {
+return this.sbl.toString ();
+});
+Clazz_defineMethod (c$, "appendC", 
+function (c) {
+switch (this.mode) {
+case 'u':
+this.mode = this.altMode;
+this.altMode = ' ';
+case 'U':
+this.sbl.appendC (com.stevesoft.pat.CaseMgr.toUpperCaseC (c));
+break;
+case 'l':
+this.mode = this.altMode;
+this.altMode = ' ';
+case 'L':
+this.sbl.appendC (com.stevesoft.pat.CaseMgr.toLowerCaseC (c));
+break;
+case 'Q':
+if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9')) {
+;} else {
+this.sbl.appendC ('\\');
+}default:
+this.sbl.appendC (c);
+break;
+}
+}, "~S");
+Clazz_overrideMethod (c$, "append", 
+function (s) {
+for (var i = 0; i < s.length; i++) {
+this.appendC (s.charAt (i));
+}
+}, "~S");
+Clazz_defineMethod (c$, "setMode", 
+function (c) {
+if (c == 'u' || c == 'l') {
+if (this.altMode == ' ') {
+this.altMode = this.mode;
+}}this.mode = c;
+}, "~S");
+Clazz_defineMethod (c$, "unwrap", 
+function () {
+return this.sbl.unwrap ();
+});
+});
+Clazz_declarePackage ("com.stevesoft.pat");
+Clazz_declareInterface (com.stevesoft.pat, "BasicStringBufferLike");
+Clazz_declarePackage ("com.stevesoft.pat");
+Clazz_load (["com.stevesoft.pat.SpecialRule"], "com.stevesoft.pat.WantMoreTextReplaceRule", null, function () {
+c$ = Clazz_declareType (com.stevesoft.pat, "WantMoreTextReplaceRule", com.stevesoft.pat.SpecialRule);
+Clazz_makeConstructor (c$, 
+function () {
+Clazz_superConstructor (this, com.stevesoft.pat.WantMoreTextReplaceRule, []);
+});
+Clazz_overrideMethod (c$, "apply", 
+function (sb, res) {
+}, "com.stevesoft.pat.StringBufferLike,com.stevesoft.pat.RegRes");
+Clazz_overrideMethod (c$, "toString1", 
+function () {
+return "${WANT_MORE_TEXT}";
+});
+});
+Clazz_declarePackage ("com.stevesoft.pat.wrap");
+Clazz_load (["com.stevesoft.pat.StringLike"], "com.stevesoft.pat.wrap.StringWrap", ["com.stevesoft.pat.wrap.StringBufferWrap"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.s = null;
+Clazz_instantialize (this, arguments);
+}, com.stevesoft.pat.wrap, "StringWrap", null, com.stevesoft.pat.StringLike);
+Clazz_makeConstructor (c$, 
+function (s) {
+this.s = s;
+}, "~S");
+Clazz_overrideMethod (c$, "toString", 
+function () {
+return this.s;
+});
+Clazz_overrideMethod (c$, "charAt", 
+function (i) {
+return this.s.charAt (i);
+}, "~N");
+Clazz_overrideMethod (c$, "length", 
+function () {
+return this.s.length;
+});
+Clazz_overrideMethod (c$, "substring", 
+function (i1, i2) {
+return this.s.substring (i1, i2);
+}, "~N,~N");
+Clazz_overrideMethod (c$, "unwrap", 
+function () {
+return this.s;
+});
+Clazz_overrideMethod (c$, "newStringBufferLike", 
+function () {
+return  new com.stevesoft.pat.wrap.StringBufferWrap ();
+});
+Clazz_overrideMethod (c$, "indexOf", 
+function (c) {
+return this.s.indexOf (c);
+}, "~S");
+});
+Clazz_declarePackage ("com.stevesoft.pat");
+Clazz_declareInterface (com.stevesoft.pat, "StringLike");
+Clazz_declarePackage ("com.stevesoft.pat.wrap");
+Clazz_load (["com.stevesoft.pat.BasicStringBufferLike", "java.lang.StringBuffer"], "com.stevesoft.pat.wrap.StringBufferWrap", ["com.stevesoft.pat.wrap.StringWrap"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.sb = null;
+Clazz_instantialize (this, arguments);
+}, com.stevesoft.pat.wrap, "StringBufferWrap", null, com.stevesoft.pat.BasicStringBufferLike);
+Clazz_prepareFields (c$, function () {
+this.sb =  new StringBuffer ();
+});
+Clazz_overrideMethod (c$, "appendC", 
+function (c) {
+this.sb.append (c);
+}, "~S");
+Clazz_overrideMethod (c$, "append", 
+function (s) {
+this.sb.append (s);
+}, "~S");
+Clazz_defineMethod (c$, "length", 
+function () {
+return this.sb.length ();
+});
+Clazz_overrideMethod (c$, "toString", 
+function () {
+return this.sb.toString ();
+});
+Clazz_overrideMethod (c$, "toStringLike", 
+function () {
+return  new com.stevesoft.pat.wrap.StringWrap (this.sb.toString ());
+});
+Clazz_overrideMethod (c$, "unwrap", 
+function () {
+return this.sb;
+});
+});
+Clazz_declarePackage ("com.stevesoft.pat");
+Clazz_load (["com.stevesoft.pat.Pattern"], "com.stevesoft.pat.TransPat", ["com.stevesoft.pat.Regex"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.ra = null;
+this.ra_len = 0;
+this.pn = -1;
+this.lastMatchedTo = -1;
+Clazz_instantialize (this, arguments);
+}, com.stevesoft.pat, "TransPat", com.stevesoft.pat.Pattern);
+Clazz_prepareFields (c$, function () {
+this.ra =  new Array (10);
+});
+Clazz_overrideMethod (c$, "toString", 
+function () {
+return "(?#TransPat)";
+});
+Clazz_makeConstructor (c$, 
+function () {
+Clazz_superConstructor (this, com.stevesoft.pat.TransPat, []);
+});
+Clazz_defineMethod (c$, "matchInternal", 
+function (pos, pt) {
+for (var i = 0; i < this.ra_len; i++) {
+pt.ignoreCase = this.ra[i].ignoreCase;
+pt.mFlag = this.ra[i].mFlag;
+pt.dotDoesntMatchCR = com.stevesoft.pat.Regex.dotDoesntMatchCR;
+var r = this.ra[i].thePattern.matchInternal (pos, pt);
+if (r >= 0) {
+this.pn = i;
+return r;
+}}
+this.pn = -1;
+return -1;
+}, "~N,com.stevesoft.pat.Pthings");
+});
+Clazz_declarePackage ("com.stevesoft.pat");
+Clazz_load (["com.stevesoft.pat.Regex"], "com.stevesoft.pat.Rthings", null, function () {
+c$ = Clazz_decorateAsClass (function () {
+this.val = 0;
+this.ignoreCase = false;
+this.dontMatchInQuotes = false;
+this.optimizeMe = false;
+this.noBackRefs = false;
+this.parenLevel = 0;
+this.gFlag = false;
+this.mFlag = false;
+this.sFlag = false;
+this.p = null;
+this.o = null;
+Clazz_instantialize (this, arguments);
+}, com.stevesoft.pat, "Rthings");
+Clazz_prepareFields (c$, function () {
+this.val = com.stevesoft.pat.Regex.BackRefOffset;
+});
+Clazz_makeConstructor (c$, 
+function (r) {
+this.ignoreCase = r.ignoreCase;
+this.dontMatchInQuotes = r.dontMatchInQuotes;
+}, "com.stevesoft.pat.Regex");
+Clazz_defineMethod (c$, "set", 
+function (r) {
+r.gFlag = this.gFlag;
+r.mFlag = this.mFlag;
+r.sFlag = this.sFlag;
+r.ignoreCase = this.ignoreCase;
+r.dontMatchInQuotes = this.dontMatchInQuotes;
+if (this.optimizeMe) {
+r.optimize ();
+}}, "com.stevesoft.pat.Regex");
+});
+Clazz_declarePackage ("com.stevesoft.pat");
+Clazz_load (null, "com.stevesoft.pat.Skip", ["com.stevesoft.pat.CaseMgr", "$.Or", "$.Skipped", "$.oneChar", "java.lang.StringBuffer"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.src = null;
+this.c = 0;
+this.mask = 0;
+this.$offset = 0;
+this.ign = false;
+this.m1 = false;
+Clazz_instantialize (this, arguments);
+}, com.stevesoft.pat, "Skip");
+c$.mkmask = Clazz_defineMethod (c$, "mkmask", 
+function (c) {
+var x = String.fromCharCode (c);
+return ~((com.stevesoft.pat.CaseMgr.toUpperCaseC (x)).charCodeAt (0) | (com.stevesoft.pat.CaseMgr.toLowerCaseC (x)).charCodeAt (0) | (com.stevesoft.pat.CaseMgr.toTitleCaseC (x)).charCodeAt (0));
+}, "~N");
+c$.string = Clazz_defineMethod (c$, "string", 
+function (r) {
+return r.skipper == null ? null : r.skipper.src;
+}, "com.stevesoft.pat.Regex");
+c$.offset = Clazz_defineMethod (c$, "offset", 
+function (r) {
+return r.skipper == null ? -1 : r.skipper.$offset;
+}, "com.stevesoft.pat.Regex");
+Clazz_makeConstructor (c$, 
+function (s, ign, o) {
+this.src = s;
+this.c = s.charCodeAt (0);
+if (ign) {
+this.mask = com.stevesoft.pat.Skip.mkmask (this.c);
+} else {
+this.mask = 0;
+}this.$offset = o;
+this.ign = ign;
+this.m1 = (s.length == 1);
+}, "~S,~B,~N");
+Clazz_defineMethod (c$, "find", 
+function (s) {
+return this.find (s, 0, s.length ());
+}, "com.stevesoft.pat.StringLike");
+c$.min = Clazz_defineMethod (c$, "min", 
+function (a, b) {
+return a < b ? a : b;
+}, "~N,~N");
+Clazz_defineMethod (c$, "find", 
+function (s, start, end) {
+if (start > end) {
+return -1;
+}start += this.$offset;
+var vend = com.stevesoft.pat.Skip.min (s.length () - 1, end + this.$offset);
+if (this.mask != this.c) {
+for (var i = start; i <= vend; i++) {
+if (0 == (s.charCodeAt (i) & this.mask)) {
+if (this.m1 || com.stevesoft.pat.CaseMgr.regionMatchesLike2 (s, this.ign, i, this.src, 0, this.src.length)) {
+return i - this.$offset;
+}}}
+} else {
+for (var i = start; i <= vend; i++) {
+if (this.c == s.charCodeAt (i)) {
+if (this.m1 || com.stevesoft.pat.CaseMgr.regionMatchesLike2 (s, this.ign, i, this.src, 0, this.src.length)) {
+return i - this.$offset;
+}}}
+}return -1;
+}, "com.stevesoft.pat.StringLike,~N,~N");
+c$.findSkipRegex = Clazz_defineMethod (c$, "findSkipRegex", 
+function (r) {
+return com.stevesoft.pat.Skip.findSkip (r.thePattern, r.ignoreCase, !r.dontMatchInQuotes);
+}, "com.stevesoft.pat.Regex");
+c$.findSkip = Clazz_defineMethod (c$, "findSkip", 
+function (p, ignoreCase, trnc) {
+var sb =  new StringBuffer ();
+var subsk = null;
+var offset = 0;
+var skipc = -1;
+var skipoff = 0;
+for (; p != null; p = p.next) {
+if (Clazz_instanceOf (p, com.stevesoft.pat.oneChar)) {
+skipc = ((p).c).charCodeAt (0);
+skipoff = offset;
+}if (Clazz_instanceOf (p, com.stevesoft.pat.oneChar) && Clazz_instanceOf (p.next, com.stevesoft.pat.oneChar)) {
+var psav = p;
+sb.append ((p).c);
+while (Clazz_instanceOf (p.next, com.stevesoft.pat.oneChar)) {
+sb.append ((p.next).c);
+p = p.next;
+}
+var st = sb.toString ();
+var sk = null;
+if (st.length > 2) {
+sk =  new com.stevesoft.pat.SkipBMH (st, ignoreCase, offset);
+} else {
+sk =  new com.stevesoft.pat.Skip2 (st, ignoreCase, offset);
+}if (trnc && st.length > 2) {
+psav.next =  new com.stevesoft.pat.Skipped (st.substring (1));
+psav.next.next = p.next;
+psav.next.parent = p.parent;
+}return sk;
+} else if (Clazz_instanceOf (p, com.stevesoft.pat.Or) && (p).v.size () == 1 && !(p).leftForm ().equals ("(?!") && null != (subsk = com.stevesoft.pat.Skip.findSkip ((p).v.elementAt (0), ignoreCase, trnc))) {
+subsk.$offset += offset;
+return subsk;
+} else if (p.minChars ().equals (p.maxChars ())) {
+offset += p.minChars ().intValue ();
+} else {
+return skipc < 0 ? null :  new com.stevesoft.pat.Skip ("" + String.fromCharCode (skipc), ignoreCase, skipoff);
+}}
+return null;
+}, "com.stevesoft.pat.Pattern,~B,~B");
+});
+Clazz_declarePackage ("com.stevesoft.pat");
+Clazz_load (["com.stevesoft.pat.Pattern"], "com.stevesoft.pat.Skipped", ["com.stevesoft.pat.CaseMgr", "$.patInt"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.s = null;
+Clazz_instantialize (this, arguments);
+}, com.stevesoft.pat, "Skipped", com.stevesoft.pat.Pattern);
+Clazz_makeConstructor (c$, 
+function (s) {
+Clazz_superConstructor (this, com.stevesoft.pat.Skipped, []);
+this.s = s;
+}, "~S");
+Clazz_overrideMethod (c$, "toString", 
+function () {
+return this.s + this.nextString ();
+});
+Clazz_overrideMethod (c$, "matchInternal", 
+function (pos, pt) {
+if (pt.no_check || com.stevesoft.pat.CaseMgr.regionMatches (this.s, pt.ignoreCase, 0, pt.src, pos, this.s.length)) {
+return this.nextMatch (pos + this.s.length, pt);
+}return -1;
+}, "~N,com.stevesoft.pat.Pthings");
+Clazz_overrideMethod (c$, "minChars", 
+function () {
+return  new com.stevesoft.pat.patInt (this.s.length);
+});
+Clazz_overrideMethod (c$, "maxChars", 
+function () {
+return  new com.stevesoft.pat.patInt (this.s.length);
+});
+Clazz_overrideMethod (c$, "clone1", 
+function (h) {
+return  new com.stevesoft.pat.Skipped (this.s);
+}, "java.util.Hashtable");
+});
+Clazz_declarePackage ("com.stevesoft.pat");
+Clazz_load (["com.stevesoft.pat.Pattern"], "com.stevesoft.pat.Start", ["com.stevesoft.pat.patInt"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.retIsStart = false;
+Clazz_instantialize (this, arguments);
+}, com.stevesoft.pat, "Start", com.stevesoft.pat.Pattern);
+Clazz_makeConstructor (c$, 
+function (b) {
+Clazz_superConstructor (this, com.stevesoft.pat.Start, []);
+this.retIsStart = b;
+}, "~B");
+Clazz_overrideMethod (c$, "matchInternal", 
+function (pos, pt) {
+if (this.retIsStart && pt.mFlag && pos > 0 && pt.src.charAt (pos - 1) == '\n') {
+return this.nextMatch (pos, pt);
+}if (pos == 0) {
+return this.nextMatch (pos, pt);
+}return -1;
+}, "~N,com.stevesoft.pat.Pthings");
+Clazz_overrideMethod (c$, "toString", 
+function () {
+if (this.retIsStart) {
+return "^" + this.nextString ();
+} else {
+return "\\A" + this.nextString ();
+}});
+Clazz_overrideMethod (c$, "maxChars", 
+function () {
+return  new com.stevesoft.pat.patInt (0);
+});
+Clazz_overrideMethod (c$, "clone1", 
+function (h) {
+return  new com.stevesoft.pat.Start (this.retIsStart);
+}, "java.util.Hashtable");
+});
+Clazz_declarePackage ("com.stevesoft.pat");
+Clazz_load (null, "com.stevesoft.pat.StrPos", ["com.stevesoft.pat.patInf", "$.patInt"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.s = null;
+this.$pos = 0;
+this.esc = '\\';
+this.c = '\0';
+this.dontMatch = false;
+this.$eos = false;
+Clazz_instantialize (this, arguments);
+}, com.stevesoft.pat, "StrPos");
+Clazz_defineMethod (c$, "pos", 
+function () {
+return this.$pos;
+});
+Clazz_defineMethod (c$, "thisChar", 
+function () {
+return this.c;
+});
+Clazz_defineMethod (c$, "eos", 
+function () {
+return this.$eos;
+});
+Clazz_makeConstructor (c$, 
+function (sp) {
+this.dup (sp);
+}, "com.stevesoft.pat.StrPos");
+Clazz_defineMethod (c$, "dup", 
+function (sp) {
+this.s = sp.s;
+this.$pos = sp.$pos;
+this.c = sp.c;
+this.dontMatch = sp.dontMatch;
+this.$eos = sp.$eos;
+}, "com.stevesoft.pat.StrPos");
+Clazz_makeConstructor (c$, 
+function (s, pos) {
+this.s = s;
+this.$pos = pos - 1;
+this.inc ();
+}, "~S,~N");
+Clazz_defineMethod (c$, "inc", 
+function () {
+this.$pos++;
+if (this.$pos >= this.s.length) {
+this.$eos = true;
+return this;
+}this.$eos = false;
+this.c = this.s.charAt (this.$pos);
+if (this.c == this.esc && this.$pos + 1 < this.s.length) {
+this.$pos++;
+this.c = this.s.charAt (this.$pos);
+if (this.c != this.esc) {
+this.dontMatch = true;
+} else {
+this.dontMatch = false;
+}} else {
+this.dontMatch = false;
+}return this;
+});
+Clazz_defineMethod (c$, "match", 
+function (ch) {
+if (this.dontMatch || this.$eos) {
+return false;
+}return this.c == ch;
+}, "~S");
+Clazz_defineMethod (c$, "escMatch", 
+function (ch) {
+if (!this.dontMatch || this.$eos) {
+return false;
+}return this.c == ch;
+}, "~S");
+Clazz_defineMethod (c$, "escaped", 
+function () {
+return this.dontMatch;
+});
+Clazz_defineMethod (c$, "incMatch", 
+function (st) {
+var sp =  new com.stevesoft.pat.StrPos (this);
+var i;
+for (i = 0; i < st.length; i++) {
+if (!sp.match (st.charAt (i))) {
+return false;
+}sp.inc ();
+}
+this.dup (sp);
+return true;
+}, "~S");
+Clazz_defineMethod (c$, "getPatInt", 
+function () {
+if (this.incMatch ("inf")) {
+return  new com.stevesoft.pat.patInf ();
+}var i;
+var cnt = 0;
+var sp =  new com.stevesoft.pat.StrPos (this);
+for (i = 0; !sp.$eos && sp.c >= '0' && sp.c <= '9'; i++) {
+cnt = 10 * cnt + sp.c.charCodeAt (0) - 48;
+sp.inc ();
+}
+if (i == 0) {
+return null;
+}this.dup (sp);
+return  new com.stevesoft.pat.patInt (cnt);
+});
+Clazz_defineMethod (c$, "getString", 
+function () {
+return this.s;
+});
+});
+Clazz_declarePackage ("com.stevesoft.pat");
+Clazz_load (["com.stevesoft.pat.Or"], "com.stevesoft.pat.lookAhead", ["com.stevesoft.pat.patInt"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.reverse = false;
+Clazz_instantialize (this, arguments);
+}, com.stevesoft.pat, "lookAhead", com.stevesoft.pat.Or);
+Clazz_makeConstructor (c$, 
+function (b) {
+Clazz_superConstructor (this, com.stevesoft.pat.lookAhead, []);
+this.reverse = b;
+}, "~B");
+Clazz_defineMethod (c$, "getNext", 
+function () {
+return null;
+});
+Clazz_overrideMethod (c$, "nextMatch", 
+function (pos, pt) {
+var p = Clazz_superCall (this, com.stevesoft.pat.lookAhead, "getNext", []);
+if (p != null) {
+return p.matchInternal (pos, pt);
+} else {
+return pos;
+}}, "~N,com.stevesoft.pat.Pthings");
+Clazz_defineMethod (c$, "matchInternal", 
+function (pos, pt) {
+if (Clazz_superCall (this, com.stevesoft.pat.lookAhead, "matchInternal", [pos, pt]) >= 0) {
+if (this.reverse) {
+return -1;
+} else {
+return this.nextMatch (pos, pt);
+}} else {
+if (this.reverse) {
+return this.nextMatch (pos, pt);
+} else {
+return -1;
+}}}, "~N,com.stevesoft.pat.Pthings");
+Clazz_overrideMethod (c$, "leftForm", 
+function () {
+if (this.reverse) {
+return "(?!";
+} else {
+return "(?=";
+}});
+Clazz_overrideMethod (c$, "minChars", 
+function () {
+return  new com.stevesoft.pat.patInt (0);
+});
+Clazz_overrideMethod (c$, "maxChars", 
+function () {
+return  new com.stevesoft.pat.patInt (0);
+});
+Clazz_overrideMethod (c$, "clone1", 
+function (h) {
+var la =  new com.stevesoft.pat.lookAhead (this.reverse);
+h.put (this, la);
+h.put (la, la);
+for (var i = 0; i < this.v.size (); i++) {
+la.v.addElement ((this.v.elementAt (i)).clone (h));
+}
+return la;
+}, "java.util.Hashtable");
+});
+Clazz_declarePackage ("com.stevesoft.pat");
+Clazz_load (null, "com.stevesoft.pat.parsePerl", ["com.stevesoft.pat.CaseMgr", "$.Prop", "$.RegSyntaxError", "$.Regex", "$.ReplaceRule", "$.StringRule", "java.lang.StringBuffer"], function () {
+c$ = Clazz_declareType (com.stevesoft.pat, "parsePerl");
+c$.close = Clazz_defineMethod (c$, "close", 
+function (c) {
+if (c == '<') {
+return '>';
+}if (c == '[') {
+return ']';
+}if (c == '(') {
+return ')';
+}if (c == '{') {
+return '}';
+}return c;
+}, "~S");
+c$.codify = Clazz_defineMethod (c$, "codify", 
+function (s, keepbs) {
+return com.stevesoft.pat.parsePerl.codifyRange (s, 0, s.length, keepbs);
+}, "~S,~B");
+c$.codifyRange = Clazz_defineMethod (c$, "codifyRange", 
+function (s, i0, iN, keepbs) {
+var sb =  new StringBuffer ();
+var ucmode = false;
+var lcmode = false;
+var litmode = false;
+var uc1 = false;
+var lc1 = false;
+var modified = false;
+for (var i = i0; i < iN; i++) {
+var c = s.charAt (i);
+var mf = true;
+var app = true;
+if (c == '\\') {
+app = false;
+i++;
+if (i < s.length) {
+var c2 = s.charAt (i);
+switch (c2) {
+case 'Q':
+litmode = true;
+break;
+case 'U':
+ucmode = true;
+break;
+case 'L':
+lcmode = true;
+break;
+case 'u':
+uc1 = true;
+break;
+case 'l':
+lc1 = true;
+break;
+case 'E':
+uc1 = lc1 = ucmode = lcmode = litmode = false;
+break;
+default:
+if (keepbs) {
+sb.append ('\\');
+}c = c2;
+if (keepbs) {
+mf = false;
+}app = true;
+break;
+}
+modified = new Boolean (modified | mf).valueOf ();
+}}if (app) {
+if (lc1) {
+c = com.stevesoft.pat.parsePerl.lc (c);
+lc1 = false;
+} else if (uc1) {
+c = com.stevesoft.pat.parsePerl.uc (c);
+uc1 = false;
+} else if (ucmode) {
+c = com.stevesoft.pat.parsePerl.uc (c);
+} else if (lcmode) {
+c = com.stevesoft.pat.parsePerl.lc (c);
+}if (litmode && com.stevesoft.pat.parsePerl.needbs (c)) {
+sb.append ('\\');
+}sb.append (c);
+}}
+return modified ? sb.toString () : s;
+}, "~S,~N,~N,~B");
+c$.uc = Clazz_defineMethod (c$, "uc", 
+function (c) {
+return com.stevesoft.pat.CaseMgr.toUpperCaseC (c);
+}, "~S");
+c$.lc = Clazz_defineMethod (c$, "lc", 
+function (c) {
+return com.stevesoft.pat.CaseMgr.toLowerCaseC (c);
+}, "~S");
+c$.needbs = Clazz_defineMethod (c$, "needbs", 
+function (c) {
+if (c >= 'a' && c <= 'z') {
+return false;
+}if (c >= 'A' && c <= 'Z') {
+return false;
+}if (c >= '0' && c <= '9') {
+return false;
+}if (c == '_') {
+return false;
+}return true;
+}, "~S");
+c$.parse = Clazz_defineMethod (c$, "parse", 
+function (s) {
+var igncase = false;
+var optim = false;
+var gFlag = false;
+var sFlag = false;
+var mFlag = false;
+var xFlag = false;
+var s1 =  new StringBuffer ();
+var s2 =  new StringBuffer ();
+var i = 0;
+var count = 0;
+var mode;
+var delim = '/';
+var cdelim = '/';
+if (s.length >= 3 && s.charAt (0) == 's') {
+mode = 's';
+delim = s.charAt (1);
+cdelim = com.stevesoft.pat.parsePerl.close (delim);
+i = 2;
+} else if (s.length >= 2 && s.charAt (0) == 'm') {
+mode = 'm';
+delim = s.charAt (1);
+cdelim = com.stevesoft.pat.parsePerl.close (delim);
+i = 2;
+} else if (s.length >= 1 && s.charAt (0) == '/') {
+mode = 'm';
+i = 1;
+} else {
+try {
+com.stevesoft.pat.RegSyntaxError.endItAll ("Regex.perlCode should be of the form s/// or m// or //");
+} catch (rs) {
+if (Clazz_exceptionOf (rs, com.stevesoft.pat.RegSyntax)) {
+} else {
+throw rs;
+}
+}
+return null;
+}for (; i < s.length; i++) {
+if (s.charAt (i) == '\\') {
+s1.append ('\\');
+i++;
+} else if (s.charAt (i) == cdelim && count == 0) {
+i++;
+break;
+} else if (s.charAt (i) == delim && cdelim != delim) {
+count++;
+} else if (s.charAt (i) == cdelim && cdelim != delim) {
+count--;
+}s1.append (s.charAt (i));
+}
+if (mode == 's' && cdelim != delim) {
+while (i < s.length && com.stevesoft.pat.Prop.isWhite (s.charAt (i))) {
+i++;
+}
+if (i >= s.length) {
+try {
+com.stevesoft.pat.RegSyntaxError.endItAll ("" + mode + delim + " needs " + cdelim);
+} catch (rs) {
+if (Clazz_exceptionOf (rs, com.stevesoft.pat.RegSyntax)) {
+} else {
+throw rs;
+}
+}
+return null;
+}cdelim = com.stevesoft.pat.parsePerl.close (delim = s.charAt (i));
+i++;
+}count = 0;
+if (mode == 's') {
+for (; i < s.length; i++) {
+if (s.charAt (i) == '\\') {
+s2.append ('\\');
+i++;
+} else if (s.charAt (i) == cdelim && count == 0) {
+i++;
+break;
+} else if (s.charAt (i) == delim && cdelim != delim) {
+count++;
+} else if (s.charAt (i) == cdelim && cdelim != delim) {
+count--;
+}s2.append (s.charAt (i));
+}
+}for (; i < s.length; i++) {
+var c = s.charAt (i);
+switch (c) {
+case 'x':
+xFlag = true;
+break;
+case 'i':
+igncase = true;
+break;
+case 'o':
+optim = true;
+break;
+case 's':
+sFlag = true;
+break;
+case 'm':
+mFlag = true;
+break;
+case 'g':
+gFlag = true;
+break;
+default:
+try {
+com.stevesoft.pat.RegSyntaxError.endItAll ("Illegal flag to pattern: " + c);
+} catch (rs) {
+if (Clazz_exceptionOf (rs, com.stevesoft.pat.RegSyntax)) {
+} else {
+throw rs;
+}
+}
+return null;
+}
+}
+var r =  new com.stevesoft.pat.Regex (null, "");
+try {
+var pat = s1.toString ();
+var reprul = s2.toString ();
+if (xFlag) {
+pat = com.stevesoft.pat.parsePerl.strip (pat);
+reprul = com.stevesoft.pat.parsePerl.strip (reprul);
+}r.compile (pat);
+r.ignoreCase = new Boolean (r.ignoreCase | igncase).valueOf ();
+r.gFlag = new Boolean (r.gFlag | gFlag).valueOf ();
+r.sFlag = new Boolean (r.sFlag | sFlag).valueOf ();
+r.mFlag = new Boolean (r.mFlag | mFlag).valueOf ();
+if (optim) {
+r.optimize ();
+}if (delim == '\'') {
+r.setReplaceRule ( new com.stevesoft.pat.StringRule (reprul));
+} else {
+r.setReplaceRule (com.stevesoft.pat.ReplaceRule.perlCode (reprul));
+}} catch (rs) {
+if (Clazz_exceptionOf (rs, com.stevesoft.pat.RegSyntax)) {
+r = null;
+} else {
+throw rs;
+}
+}
+return r;
+}, "~S");
+c$.strip = Clazz_defineMethod (c$, "strip", 
+function (s) {
+var sb =  new StringBuffer ();
+for (var i = 0; i < s.length; i++) {
+var c = s.charAt (i);
+if (com.stevesoft.pat.Prop.isWhite (c)) {
+;} else if (c == '#') {
+i++;
+while (i < s.length) {
+if (s.charAt (i) == '\n') {
+break;
+}i++;
+}
+} else if (c == '\\') {
+sb.append (c);
+sb.append (s.charAt (++i));
+} else {
+sb.append (c);
+}}
+return sb.toString ();
+}, "~S");
+});
+Clazz_declarePackage ("com.stevesoft.pat");
+Clazz_load (["com.stevesoft.pat.ReplaceRule"], "com.stevesoft.pat.StringRule", null, function () {
+c$ = Clazz_decorateAsClass (function () {
+this.s = null;
+Clazz_instantialize (this, arguments);
+}, com.stevesoft.pat, "StringRule", com.stevesoft.pat.ReplaceRule);
+Clazz_makeConstructor (c$, 
+function (s) {
+Clazz_superConstructor (this, com.stevesoft.pat.StringRule, []);
+this.s = s;
+}, "~S");
+Clazz_overrideMethod (c$, "apply", 
+function (sb, res) {
+sb.append (this.s);
+}, "com.stevesoft.pat.StringBufferLike,com.stevesoft.pat.RegRes");
+Clazz_overrideMethod (c$, "toString1", 
+function () {
+return this.s;
+});
+Clazz_overrideMethod (c$, "clone1", 
+function () {
+return  new com.stevesoft.pat.StringRule (this.s);
+});
+});
+Clazz_declarePackage ("jalview.datamodel");
+Clazz_load (["java.util.HashMap"], "jalview.datamodel.AlignmentAnnotation", ["jalview.analysis.Rna", "jalview.datamodel.Annotation", "$.GraphLine", "jalview.schemes.ResidueProperties", "java.lang.Double", "$.Error", "$.Long", "$.StringBuffer", "$.StringBuilder", "java.util.Collections"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.autoCalculated = false;
+this.annotationId = null;
+this.sequenceRef = null;
+this.label = null;
+this.description = null;
+this.annotations = null;
+this.bps = null;
+this._rnasecstr = null;
+this.invalidrnastruc = -2;
+this.sequenceMapping = null;
+this.graphMin = 0;
+this.graphMax = 0;
+this.score = NaN;
+this.$hasScore = false;
+this.threshold = null;
+this.editable = false;
+this.hasIcons = false;
+this.hasText = false;
+this.visible = true;
+this.graphGroup = -1;
+this.height = 0;
+this.graph = 0;
+this.graphHeight = 40;
+this.padGaps = false;
+this.belowAlignment = true;
+this.groupRef = null;
+this.showAllColLabels = false;
+this.scaleColLabel = false;
+this.centreColLabels = false;
+this.isrna = false;
+if (!Clazz_isClassDefined ("jalview.datamodel.AlignmentAnnotation.AnnotCharSequence")) {
+jalview.datamodel.AlignmentAnnotation.$AlignmentAnnotation$AnnotCharSequence$ ();
+}
+this._lastrnaannot = -1;
+this.calcId = "";
+this.properties = null;
+this._linecolour = null;
+Clazz_instantialize (this, arguments);
+}, jalview.datamodel, "AlignmentAnnotation");
+Clazz_prepareFields (c$, function () {
+this.properties =  new java.util.HashMap ();
+});
+Clazz_defineMethod (c$, "_updateRnaSecStr", 
+ function (RNAannot) {
+try {
+this._rnasecstr = jalview.analysis.Rna.GetBasePairs (RNAannot);
+this.bps = jalview.analysis.Rna.GetModeleBP (RNAannot);
+this.invalidrnastruc = -1;
+} catch (px) {
+if (Clazz_exceptionOf (px, jalview.analysis.WUSSParseException)) {
+this.invalidrnastruc = px.getProblemPos ();
+} else {
+throw px;
+}
+}
+if (this.invalidrnastruc > -1) {
+return;
+}jalview.analysis.Rna.HelixMap (this._rnasecstr);
+if (this._rnasecstr != null && this._rnasecstr.length > 0) {
+this.isrna = true;
+this.showAllColLabels = true;
+this.scaleColLabel = true;
+this._markRnaHelices ();
+}}, "CharSequence");
+Clazz_defineMethod (c$, "_markRnaHelices", 
+ function () {
+var mxval = 0;
+for (var x = 0; x < this._rnasecstr.length; x++) {
+var val = 0;
+try {
+val = (Integer.$valueOf (this._rnasecstr[x].getFeatureGroup ())).intValue ();
+if (mxval < val) {
+mxval = val;
+}} catch (q) {
+if (Clazz_exceptionOf (q, NumberFormatException)) {
+} else {
+throw q;
+}
+}
+;this.annotations[this._rnasecstr[x].getBegin ()].value = val;
+this.annotations[this._rnasecstr[x].getEnd ()].value = val;
+}
+this.setScore (mxval);
+});
+Clazz_defineMethod (c$, "finalize", 
+function () {
+this.sequenceRef = null;
+this.groupRef = null;
+Clazz_superCall (this, jalview.datamodel.AlignmentAnnotation, "finalize", []);
+});
+c$.getGraphValueFromString = Clazz_defineMethod (c$, "getGraphValueFromString", 
+function (string) {
+if (string.equalsIgnoreCase ("BAR_GRAPH")) {
+return 1;
+} else if (string.equalsIgnoreCase ("LINE_GRAPH")) {
+return 2;
+} else {
+return 0;
+}}, "~S");
+Clazz_defineMethod (c$, "ConcenStru", 
+function (RNAannot) {
+this.bps = jalview.analysis.Rna.GetModeleBP (RNAannot);
+}, "CharSequence");
+Clazz_makeConstructor (c$, 
+function (label, description, annotations) {
+this.setAnnotationId ();
+this.editable = true;
+this.label = label;
+this.description = description;
+this.annotations = annotations;
+this.validateRangeAndDisplay ();
+}, "~S,~S,~A");
+Clazz_defineMethod (c$, "areLabelsSecondaryStructure", 
+function () {
+var nonSSLabel = false;
+this.isrna = false;
+var rnastring =  new StringBuffer ();
+var firstChar = String.fromCharCode (0);
+for (var i = 0; i < this.annotations.length; i++) {
+if (this.annotations[i] == null) {
+continue;
+}if (this.annotations[i].secondaryStructure == 'H' || this.annotations[i].secondaryStructure == 'E') {
+this.hasIcons = new Boolean (this.hasIcons | true).valueOf ();
+} else {
+if (this.annotations[i].secondaryStructure == '(' || this.annotations[i].secondaryStructure == '[' || this.annotations[i].secondaryStructure == '<' || this.annotations[i].secondaryStructure == '{' || this.annotations[i].secondaryStructure == 'A' || this.annotations[i].secondaryStructure == 'B' || this.annotations[i].secondaryStructure == 'C' || this.annotations[i].secondaryStructure == 'D' || this.annotations[i].secondaryStructure == 'E' || this.annotations[i].secondaryStructure == 'F' || this.annotations[i].secondaryStructure == 'G' || this.annotations[i].secondaryStructure == 'H' || this.annotations[i].secondaryStructure == 'I' || this.annotations[i].secondaryStructure == 'J' || this.annotations[i].secondaryStructure == 'K' || this.annotations[i].secondaryStructure == 'L' || this.annotations[i].secondaryStructure == 'M' || this.annotations[i].secondaryStructure == 'N' || this.annotations[i].secondaryStructure == 'O' || this.annotations[i].secondaryStructure == 'P' || this.annotations[i].secondaryStructure == 'Q' || this.annotations[i].secondaryStructure == 'R' || this.annotations[i].secondaryStructure == 'S' || this.annotations[i].secondaryStructure == 'T' || this.annotations[i].secondaryStructure == 'U' || this.annotations[i].secondaryStructure == 'V' || this.annotations[i].secondaryStructure == 'W' || this.annotations[i].secondaryStructure == 'X' || this.annotations[i].secondaryStructure == 'Y' || this.annotations[i].secondaryStructure == 'Z') {
+this.hasIcons = new Boolean (this.hasIcons | true).valueOf ();
+this.isrna = new Boolean (this.isrna | true).valueOf ();
+}}if (this.annotations[i].displayCharacter == null || this.annotations[i].displayCharacter.length == 0) {
+rnastring.append ('.');
+continue;
+}if (this.annotations[i].displayCharacter.length == 1) {
+firstChar = this.annotations[i].displayCharacter.charAt (0);
+if (this.annotations[i].secondaryStructure != ' ' && !this.hasIcons && firstChar != ' ' && firstChar != '$' && firstChar.charCodeAt (0) != 0xCE && firstChar != '(' && firstChar != '[' && firstChar != '>' && firstChar != '{' && firstChar != 'A' && firstChar != 'B' && firstChar != 'C' && firstChar != 'D' && firstChar != 'E' && firstChar != 'F' && firstChar != 'G' && firstChar != 'H' && firstChar != 'I' && firstChar != 'J' && firstChar != 'K' && firstChar != 'L' && firstChar != 'M' && firstChar != 'N' && firstChar != 'O' && firstChar != 'P' && firstChar != 'Q' && firstChar != 'R' && firstChar != 'S' && firstChar != 'T' && firstChar != 'U' && firstChar != 'V' && firstChar != 'W' && firstChar != 'X' && firstChar != 'Y' && firstChar != 'Z' && firstChar != '-' && firstChar.charCodeAt (0) < jalview.schemes.ResidueProperties.aaIndex.length) {
+if (jalview.schemes.ResidueProperties.aaIndex[firstChar.charCodeAt (0)] < 23) {
+nonSSLabel = true;
+}}} else {
+rnastring.append (this.annotations[i].displayCharacter.charAt (1));
+}if (this.annotations[i].displayCharacter.length > 0) {
+this.hasText = true;
+}}
+if (nonSSLabel) {
+this.hasIcons = false;
+for (var j = 0; j < this.annotations.length; j++) {
+if (this.annotations[j] != null && this.annotations[j].secondaryStructure != ' ') {
+this.annotations[j].displayCharacter = String.valueOf (this.annotations[j].secondaryStructure);
+this.annotations[j].secondaryStructure = ' ';
+}}
+} else {
+if (this.isrna) {
+this._updateRnaSecStr (Clazz_innerTypeInstance (jalview.datamodel.AlignmentAnnotation.AnnotCharSequence, this, null));
+}}});
+Clazz_defineMethod (c$, "getRNAStruc", 
+function () {
+if (this.isrna) {
+var rnastruc = Clazz_innerTypeInstance (jalview.datamodel.AlignmentAnnotation.AnnotCharSequence, this, null).toString ();
+if (this._lastrnaannot != rnastruc.hashCode ()) {
+this._lastrnaannot = rnastruc.hashCode ();
+this._updateRnaSecStr (rnastruc);
+}return rnastruc;
+}return null;
+});
+Clazz_makeConstructor (c$, 
+function (label, description, annotations, min, max, graphType) {
+this.setAnnotationId ();
+this.editable = graphType == 0;
+this.label = label;
+this.description = description;
+this.annotations = annotations;
+this.graph = graphType;
+this.graphMin = min;
+this.graphMax = max;
+this.validateRangeAndDisplay ();
+}, "~S,~S,~A,~N,~N,~N");
+Clazz_defineMethod (c$, "validateRangeAndDisplay", 
+function () {
+if (this.annotations == null) {
+this.visible = false;
+return;
+}var graphType = this.graph;
+var min = this.graphMin;
+var max = this.graphMax;
+var drawValues = true;
+this._linecolour = null;
+if (min == max) {
+min = 999999999;
+for (var i = 0; i < this.annotations.length; i++) {
+if (this.annotations[i] == null) {
+continue;
+}if (drawValues && this.annotations[i].displayCharacter != null && this.annotations[i].displayCharacter.length > 1) {
+drawValues = false;
+}if (this.annotations[i].value > max) {
+max = this.annotations[i].value;
+}if (this.annotations[i].value < min) {
+min = this.annotations[i].value;
+}if (this._linecolour == null && this.annotations[i].colour != null) {
+this._linecolour = this.annotations[i].colour;
+}}
+if (min > 0) {
+min = 0;
+} else {
+if (max < 0) {
+max = 0;
+}}}this.graphMin = min;
+this.graphMax = max;
+this.areLabelsSecondaryStructure ();
+if (!drawValues && graphType != 0) {
+for (var i = 0; i < this.annotations.length; i++) {
+if (this.annotations[i] != null) {
+this.annotations[i].displayCharacter = "";
+}}
+}});
+Clazz_makeConstructor (c$, 
+function (annotation) {
+this.setAnnotationId ();
+this.label =  String.instantialize (annotation.label);
+if (annotation.description != null) {
+this.description =  String.instantialize (annotation.description);
+}this.graphMin = annotation.graphMin;
+this.graphMax = annotation.graphMax;
+this.graph = annotation.graph;
+this.graphHeight = annotation.graphHeight;
+this.graphGroup = annotation.graphGroup;
+this.groupRef = annotation.groupRef;
+this.editable = annotation.editable;
+this.autoCalculated = annotation.autoCalculated;
+this.hasIcons = annotation.hasIcons;
+this.hasText = annotation.hasText;
+this.height = annotation.height;
+this.label = annotation.label;
+this.padGaps = annotation.padGaps;
+this.visible = annotation.visible;
+this.centreColLabels = annotation.centreColLabels;
+this.scaleColLabel = annotation.scaleColLabel;
+this.showAllColLabels = annotation.showAllColLabels;
+this.calcId = annotation.calcId;
+if (annotation.properties != null) {
+this.properties =  new java.util.HashMap ();
+for (var val, $val = annotation.properties.entrySet ().iterator (); $val.hasNext () && ((val = $val.next ()) || true);) {
+this.properties.put (val.getKey (), val.getValue ());
+}
+}if (this.$hasScore = annotation.$hasScore) {
+this.score = annotation.score;
+}if (annotation.threshold != null) {
+this.threshold =  new jalview.datamodel.GraphLine (annotation.threshold);
+}var ann = annotation.annotations;
+if (annotation.annotations != null) {
+this.annotations =  new Array (ann.length);
+for (var i = 0; i < ann.length; i++) {
+if (ann[i] != null) {
+this.annotations[i] =  new jalview.datamodel.Annotation (ann[i]);
+if (this._linecolour != null) {
+this._linecolour = this.annotations[i].colour;
+}}}
+}if (annotation.sequenceRef != null) {
+this.sequenceRef = annotation.sequenceRef;
+if (annotation.sequenceMapping != null) {
+var p = null;
+this.sequenceMapping =  new java.util.HashMap ();
+var pos = annotation.sequenceMapping.keySet ().iterator ();
+while (pos.hasNext ()) {
+p = pos.next ();
+var a = annotation.sequenceMapping.get (p);
+if (a == null) {
+continue;
+}if (ann != null) {
+for (var i = 0; i < ann.length; i++) {
+if (ann[i] === a) {
+this.sequenceMapping.put (p, this.annotations[i]);
+}}
+}}
+} else {
+this.sequenceMapping = null;
+}}{
+}this.validateRangeAndDisplay ();
+}, "jalview.datamodel.AlignmentAnnotation");
+Clazz_defineMethod (c$, "restrict", 
+function (startRes, endRes) {
+if (this.annotations == null) {
+return;
+}if (startRes < 0) {
+startRes = 0;
+}if (startRes >= this.annotations.length) {
+startRes = this.annotations.length - 1;
+}if (endRes >= this.annotations.length) {
+endRes = this.annotations.length - 1;
+}if (this.annotations == null) {
+return;
+}var temp =  new Array (endRes - startRes + 1);
+if (startRes < this.annotations.length) {
+System.arraycopy (this.annotations, startRes, temp, 0, endRes - startRes + 1);
+}if (this.sequenceRef != null) {
+var spos = this.sequenceRef.findPosition (startRes);
+var epos = this.sequenceRef.findPosition (endRes);
+if (this.sequenceMapping != null) {
+var newmapping =  new java.util.HashMap ();
+var e = this.sequenceMapping.keySet ().iterator ();
+while (e.hasNext ()) {
+var pos = e.next ();
+if (pos.intValue () >= spos && pos.intValue () <= epos) {
+newmapping.put (pos, this.sequenceMapping.get (pos));
+}}
+this.sequenceMapping.clear ();
+this.sequenceMapping = newmapping;
+}}this.annotations = temp;
+}, "~N,~N");
+Clazz_defineMethod (c$, "padAnnotation", 
+function (length) {
+if (this.annotations == null) {
+return true;
+}if (this.annotations.length < length) {
+var na =  new Array (length);
+System.arraycopy (this.annotations, 0, na, 0, this.annotations.length);
+this.annotations = na;
+return true;
+}return this.annotations.length > length;
+}, "~N");
+Clazz_overrideMethod (c$, "toString", 
+function () {
+var buffer =  new StringBuilder (256);
+for (var i = 0; i < this.annotations.length; i++) {
+if (this.annotations[i] != null) {
+if (this.graph != 0) {
+buffer.append (this.annotations[i].value);
+} else if (this.hasIcons) {
+buffer.append (this.annotations[i].secondaryStructure);
+} else {
+buffer.append (this.annotations[i].displayCharacter);
+}}buffer.append (", ");
+}
+if (this.label.indexOf ("Consensus") == 0) {
+buffer.append ("\n");
+for (var i = 0; i < this.annotations.length; i++) {
+if (this.annotations[i] != null) {
+buffer.append (this.annotations[i].description);
+}buffer.append (", ");
+}
+}return buffer.toString ();
+});
+Clazz_defineMethod (c$, "setThreshold", 
+function (line) {
+this.threshold = line;
+}, "jalview.datamodel.GraphLine");
+Clazz_defineMethod (c$, "getThreshold", 
+function () {
+return this.threshold;
+});
+Clazz_defineMethod (c$, "createSequenceMapping", 
+function (seqRef, startRes, alreadyMapped) {
+if (seqRef == null) {
+return;
+}this.sequenceRef = seqRef;
+if (this.annotations == null) {
+return;
+}this.sequenceMapping =  new java.util.HashMap ();
+var seqPos;
+for (var i = 0; i < this.annotations.length; i++) {
+if (this.annotations[i] != null) {
+if (alreadyMapped) {
+seqPos = seqRef.findPosition (i);
+} else {
+seqPos = i + startRes;
+}this.sequenceMapping.put ( new Integer (seqPos), this.annotations[i]);
+}}
+}, "jalview.datamodel.SequenceI,~N,~B");
+Clazz_defineMethod (c$, "adjustForAlignment", 
+function () {
+if (this.sequenceRef == null) {
+return;
+}if (this.annotations == null) {
+return;
+}var a = 0;
+var aSize = this.sequenceRef.getLength ();
+if (aSize == 0) {
+return;
+}var position;
+var temp =  new Array (aSize);
+var index;
+for (a = this.sequenceRef.getStart (); a <= this.sequenceRef.getEnd (); a++) {
+index =  new Integer (a);
+if (this.sequenceMapping.containsKey (index)) {
+position = this.sequenceRef.findIndex (a) - 1;
+temp[position] = this.sequenceMapping.get (index);
+}}
+this.annotations = temp;
+});
+Clazz_defineMethod (c$, "compactAnnotationArray", 
+function () {
+var i = 0;
+var iSize = this.annotations.length;
+while (i < iSize) {
+if (this.annotations[i] == null) {
+if (i + 1 < iSize) {
+System.arraycopy (this.annotations, i + 1, this.annotations, i, iSize - i - 1);
+}iSize--;
+} else {
+i++;
+}}
+var ann = this.annotations;
+this.annotations =  new Array (i);
+System.arraycopy (ann, 0, this.annotations, 0, i);
+ann = null;
+return iSize;
+});
+Clazz_defineMethod (c$, "setSequenceRef", 
+function (sequenceI) {
+if (sequenceI != null) {
+if (this.sequenceRef != null) {
+var rIsDs = this.sequenceRef.getDatasetSequence () == null;
+var tIsDs = sequenceI.getDatasetSequence () == null;
+if (this.sequenceRef !== sequenceI && (rIsDs && !tIsDs && this.sequenceRef !== sequenceI.getDatasetSequence ()) && (!rIsDs && tIsDs && this.sequenceRef.getDatasetSequence () !== sequenceI) && (!rIsDs && !tIsDs && this.sequenceRef.getDatasetSequence () !== sequenceI.getDatasetSequence ()) && !this.sequenceRef.equals (sequenceI)) {
+this.sequenceRef = null;
+if (this.sequenceMapping != null) {
+this.sequenceMapping = null;
+}this.createSequenceMapping (sequenceI, 1, true);
+this.adjustForAlignment ();
+} else {
+this.sequenceRef = sequenceI;
+}} else {
+this.createSequenceMapping (sequenceI, 1, true);
+this.adjustForAlignment ();
+}} else {
+this.sequenceMapping = null;
+this.sequenceRef = null;
+}}, "jalview.datamodel.SequenceI");
+Clazz_defineMethod (c$, "getScore", 
+function () {
+return this.score;
+});
+Clazz_defineMethod (c$, "setScore", 
+function (score) {
+this.$hasScore = true;
+this.score = score;
+}, "~N");
+Clazz_defineMethod (c$, "hasScore", 
+function () {
+return this.$hasScore || !Double.isNaN (this.score);
+});
+Clazz_makeConstructor (c$, 
+function (label, description, score) {
+this.construct (label, description, null);
+this.setScore (score);
+}, "~S,~S,~N");
+Clazz_makeConstructor (c$, 
+function (alignmentAnnotation, colSel) {
+this.construct (alignmentAnnotation);
+if (this.annotations == null) {
+return;
+}colSel.makeVisibleAnnotation (this);
+}, "jalview.datamodel.AlignmentAnnotation,jalview.datamodel.ColumnSelection");
+Clazz_defineMethod (c$, "setPadGaps", 
+function (padgaps, gapchar) {
+this.padGaps = padgaps;
+if (padgaps) {
+this.hasText = true;
+for (var i = 0; i < this.annotations.length; i++) {
+if (this.annotations[i] == null) {
+this.annotations[i] =  new jalview.datamodel.Annotation (String.valueOf (gapchar), null, ' ', 0, null);
+} else if (this.annotations[i].displayCharacter == null || this.annotations[i].displayCharacter.equals (" ")) {
+this.annotations[i].displayCharacter = String.valueOf (gapchar);
+}}
+}}, "~B,~S");
+Clazz_defineMethod (c$, "getDescription", 
+function (seqname) {
+if (seqname && this.sequenceRef != null) {
+var i = this.description.toLowerCase ().indexOf ("<html>");
+if (i > -1) {
+return "<html>" + this.sequenceRef.getName () + " : " + this.description.substring (i + 6);
+}return this.sequenceRef.getName () + " : " + this.description;
+}return this.description;
+}, "~B");
+Clazz_defineMethod (c$, "isValidStruc", 
+function () {
+return this.invalidrnastruc == -1;
+});
+Clazz_defineMethod (c$, "getInvalidStrucPos", 
+function () {
+return this.invalidrnastruc;
+});
+Clazz_defineMethod (c$, "getCalcId", 
+function () {
+return this.calcId;
+});
+Clazz_defineMethod (c$, "setCalcId", 
+function (calcId) {
+this.calcId = calcId;
+}, "~S");
+Clazz_defineMethod (c$, "isRNA", 
+function () {
+return this.isrna;
+});
+Clazz_defineMethod (c$, "liftOver", 
+function (sq, sp2sq) {
+if (sp2sq.getMappedWidth () != sp2sq.getWidth ()) {
+throw  new Error ("liftOver currently not implemented for transfer of annotation between different types of seqeunce");
+}var mapIsTo = (sp2sq != null) ? (sp2sq.getTo () === sq || sp2sq.getTo () === sq.getDatasetSequence ()) : false;
+var mapForsq =  new java.util.HashMap ();
+if (this.sequenceMapping != null) {
+if (sp2sq != null) {
+for (var ie, $ie = this.sequenceMapping.entrySet ().iterator (); $ie.hasNext () && ((ie = $ie.next ()) || true);) {
+var mpos = Integer.$valueOf (mapIsTo ? sp2sq.getMappedPosition ((ie.getKey ()).intValue ()) : sp2sq.getPosition ((ie.getKey ()).intValue ()));
+if ((mpos).intValue () >= sq.getStart () && (mpos).intValue () <= sq.getEnd ()) {
+mapForsq.put (mpos, ie.getValue ());
+}}
+this.sequenceMapping = mapForsq;
+this.sequenceRef = sq;
+this.adjustForAlignment ();
+} else {
+}}}, "jalview.datamodel.SequenceI,jalview.datamodel.Mapping");
+Clazz_defineMethod (c$, "remap", 
+function (newref, mapping, from, to, idxoffset) {
+if (mapping != null) {
+var old = this.sequenceMapping;
+var remap =  new java.util.HashMap ();
+var index = -1;
+for (var mp, $mp = 0, $$mp = mapping; $mp < $$mp.length && ((mp = $$mp[$mp]) || true); $mp++) {
+if (index++ < 0) {
+continue;
+}var ann = null;
+if (from == -1) {
+ann = this.sequenceMapping.get (Integer.$valueOf (idxoffset + index));
+} else {
+if (mp != null && mp.length > from) {
+ann = this.sequenceMapping.get (Integer.$valueOf (mp[from]));
+}}if (ann != null) {
+if (to == -1) {
+remap.put (Integer.$valueOf (idxoffset + index), ann);
+} else {
+if (to > -1 && to < mp.length) {
+remap.put (Integer.$valueOf (mp[to]), ann);
+}}}}
+this.sequenceMapping = remap;
+old.clear ();
+if (newref != null) {
+this.sequenceRef = newref;
+}this.adjustForAlignment ();
+}}, "jalview.datamodel.SequenceI,~A,~N,~N,~N");
+Clazz_defineMethod (c$, "getProperty", 
+function (property) {
+if (this.properties == null) {
+return null;
+}return this.properties.get (property);
+}, "~S");
+Clazz_defineMethod (c$, "setProperty", 
+function (property, value) {
+if (this.properties == null) {
+this.properties =  new java.util.HashMap ();
+}this.properties.put (property, value);
+}, "~S,~S");
+Clazz_defineMethod (c$, "hasProperties", 
+function () {
+return this.properties != null && this.properties.size () > 0;
+});
+Clazz_defineMethod (c$, "getProperties", 
+function () {
+if (this.properties == null) {
+return java.util.Collections.emptyList ();
+}return this.properties.keySet ();
+});
+Clazz_defineMethod (c$, "getAnnotationForPosition", 
+function (position) {
+return this.sequenceMapping == null ? null : this.sequenceMapping.get (new Integer (position));
+}, "~N");
+Clazz_defineMethod (c$, "setAnnotationId", 
+function () {
+this.annotationId = "ann" + Long.toString (jalview.datamodel.AlignmentAnnotation.nextId ());
+});
+c$.nextId = Clazz_defineMethod (c$, "nextId", 
+function () {
+return jalview.datamodel.AlignmentAnnotation.counter++;
+});
+c$.$AlignmentAnnotation$AnnotCharSequence$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_decorateAsClass (function () {
+Clazz_prepareCallback (this, arguments);
+this.offset = 0;
+this.max = 0;
+Clazz_instantialize (this, arguments);
+}, jalview.datamodel.AlignmentAnnotation, "AnnotCharSequence", null, CharSequence);
+Clazz_makeConstructor (c$, 
+function () {
+this.construct (0, this.b$["jalview.datamodel.AlignmentAnnotation"].annotations.length);
+});
+Clazz_makeConstructor (c$, 
+function (a, b) {
+this.offset = a;
+this.max = b;
+}, "~N,~N");
+Clazz_overrideMethod (c$, "subSequence", 
+function (a, b) {
+return Clazz_innerTypeInstance (jalview.datamodel.AlignmentAnnotation.AnnotCharSequence, this, null, this.offset + a, this.offset + b);
+}, "~N,~N");
+Clazz_overrideMethod (c$, "length", 
+function () {
+return this.max - this.offset;
+});
+Clazz_overrideMethod (c$, "charAt", 
+function (a) {
+return ((a + this.offset < 0) || (a + this.offset) >= this.max || this.b$["jalview.datamodel.AlignmentAnnotation"].annotations[a + this.offset] == null || (this.b$["jalview.datamodel.AlignmentAnnotation"].annotations[a + this.offset].secondaryStructure <= ' ') ? ' ' : this.b$["jalview.datamodel.AlignmentAnnotation"].annotations[a + this.offset].displayCharacter == null || this.b$["jalview.datamodel.AlignmentAnnotation"].annotations[a + this.offset].displayCharacter.length == 0 ? this.b$["jalview.datamodel.AlignmentAnnotation"].annotations[a + this.offset].secondaryStructure : this.b$["jalview.datamodel.AlignmentAnnotation"].annotations[a + this.offset].displayCharacter.charAt (0));
+}, "~N");
+Clazz_overrideMethod (c$, "toString", 
+function () {
+var a =  Clazz_newCharArray (this.max - this.offset, '\0');
+var b = this.b$["jalview.datamodel.AlignmentAnnotation"].annotations.length;
+for (var c = this.offset; c < b; c++) {
+a[c] = (this.b$["jalview.datamodel.AlignmentAnnotation"].annotations[c] == null || ((this.b$["jalview.datamodel.AlignmentAnnotation"].annotations[c].secondaryStructure).charCodeAt (0) <= 32)) ? ' ' : (this.b$["jalview.datamodel.AlignmentAnnotation"].annotations[c].displayCharacter == null || this.b$["jalview.datamodel.AlignmentAnnotation"].annotations[c].displayCharacter.length == 0 ? this.b$["jalview.datamodel.AlignmentAnnotation"].annotations[c].secondaryStructure : this.b$["jalview.datamodel.AlignmentAnnotation"].annotations[c].displayCharacter.charAt (0));
+}
+return  String.instantialize (a);
+});
+c$ = Clazz_p0p ();
+};
+Clazz_defineStatics (c$,
+"ANNOTATION_ID_PREFIX", "ann",
+"SEQUENCE_PROFILE", 0,
+"STRUCTURE_PROFILE", 1,
+"CDNA_PROFILE", 2,
+"counter", 0,
+"NO_GRAPH", 0,
+"BAR_GRAPH", 1,
+"LINE_GRAPH", 2);
+});
+Clazz_declarePackage ("jalview.analysis");
+Clazz_load (["java.util.Arrays", "$.HashSet", "$.Hashtable"], "jalview.analysis.Rna", ["jalview.analysis.SecStrConsensus", "$.WUSSParseException", "jalview.datamodel.SequenceFeature", "jalview.util.MessageManager", "java.lang.StringBuffer", "java.util.ArrayList", "$.Stack", "$.Vector"], function () {
+c$ = Clazz_declareType (jalview.analysis, "Rna");
+c$.isOpeningParenthesis = Clazz_defineMethod (c$, "isOpeningParenthesis", 
+ function (c) {
+return jalview.analysis.Rna.openingParsSet.contains (new Character (c).charCodeAt (0));
+}, "~S");
+c$.isClosingParenthesis = Clazz_defineMethod (c$, "isClosingParenthesis", 
+ function (c) {
+return jalview.analysis.Rna.closingParsSet.contains (new Character (c).charCodeAt (0));
+}, "~S");
+c$.matchingOpeningParenthesis = Clazz_defineMethod (c$, "matchingOpeningParenthesis", 
+ function (closingParenthesis) {
+if (!jalview.analysis.Rna.isClosingParenthesis (closingParenthesis)) {
+throw  new jalview.analysis.WUSSParseException (jalview.util.MessageManager.formatMessage ("exception.querying_matching_opening_parenthesis_for_non_closing_parenthesis",  Clazz_newArray (-1, [ new StringBuffer (closingParenthesis.charCodeAt (0)).toString ()])), -1);
+}return String.fromCharCode (jalview.analysis.Rna.closingToOpening.get (new Character (closingParenthesis).charCodeAt (0)));
+}, "~S");
+c$.GetSimpleBPs = Clazz_defineMethod (c$, "GetSimpleBPs", 
+function (line) {
+var stacks =  new java.util.Hashtable ();
+var pairs =  new java.util.Vector ();
+var i = 0;
+while (i < line.length) {
+var base = line.charAt (i);
+if (jalview.analysis.Rna.isOpeningParenthesis (base)) {
+if (!stacks.containsKey (new Character (base).charCodeAt (0))) {
+stacks.put (new Character (base).charCodeAt (0),  new java.util.Stack ());
+}stacks.get (new Character (base).charCodeAt (0)).push (new Integer (i));
+} else if (jalview.analysis.Rna.isClosingParenthesis (base)) {
+var opening = jalview.analysis.Rna.matchingOpeningParenthesis (base);
+if (!stacks.containsKey (new Character (opening).charCodeAt (0))) {
+throw  new jalview.analysis.WUSSParseException (jalview.util.MessageManager.formatMessage ("exception.mismatched_unseen_closing_char",  Clazz_newArray (-1, [ new StringBuffer (base.charCodeAt (0)).toString ()])), i);
+}var stack = stacks.get (new Character (opening).charCodeAt (0));
+if (stack.isEmpty ()) {
+throw  new jalview.analysis.WUSSParseException (jalview.util.MessageManager.formatMessage ("exception.mismatched_closing_char",  Clazz_newArray (-1, [ new StringBuffer (base.charCodeAt (0)).toString ()])), i);
+}var temp = (stack.pop ()).intValue ();
+pairs.add ( new jalview.analysis.SecStrConsensus.SimpleBP (temp, i));
+}i++;
+}
+for (var opening, $opening = stacks.keySet ().iterator (); $opening.hasNext () && ((opening = $opening.next ()) || true);) {
+var stack = stacks.get (new Character (opening).charCodeAt (0));
+if (!stack.empty ()) {
+throw  new jalview.analysis.WUSSParseException (jalview.util.MessageManager.formatMessage ("exception.mismatched_opening_char",  Clazz_newArray (-1, [ new StringBuffer (opening.charCodeAt (0)).toString (), Integer.$valueOf ((stack.pop ()).intValue ()).toString ()])), i);
+}}
+return pairs;
+}, "CharSequence");
+c$.GetBasePairs = Clazz_defineMethod (c$, "GetBasePairs", 
+function (line) {
+var bps = jalview.analysis.Rna.GetSimpleBPs (line);
+var outPairs =  new Array (bps.size ());
+for (var p = 0; p < bps.size (); p++) {
+var bp = bps.elementAt (p);
+outPairs[p] =  new jalview.datamodel.SequenceFeature ("RNA helix", "", "", bp.getBP5 (), bp.getBP3 (), "");
+}
+return outPairs;
+}, "CharSequence");
+c$.GetModeleBP = Clazz_defineMethod (c$, "GetModeleBP", 
+function (line) {
+var bps = jalview.analysis.Rna.GetSimpleBPs (line);
+return  new java.util.ArrayList (bps);
+}, "CharSequence");
+c$.HelixMap = Clazz_defineMethod (c$, "HelixMap", 
+function (pairs) {
+var helix = 0;
+var lastopen = 0;
+var lastclose = 9999999;
+var i = pairs.length;
+var open;
+var close;
+var j;
+var helices =  new java.util.Hashtable ();
+for (i = 0; i < pairs.length; i++) {
+open = pairs[i].getBegin ();
+close = pairs[i].getEnd ();
+if (open > lastclose) {
+helix++;
+}j = pairs.length - 1;
+while (j >= 0) {
+var popen = pairs[j].getBegin ();
+if ((popen < lastopen) && (popen > open)) {
+if (helices.containsValue (new Integer (popen)) && (((helices.get (new Integer (popen)))).intValue () === helix)) {
+continue;
+} else {
+helix++;
+break;
+}}j -= 1;
+}
+helices.put (new Integer (open), new Integer (helix));
+helices.put (new Integer (close), new Integer (helix));
+pairs[i].setFeatureGroup (Integer.toString (helix));
+lastopen = open;
+lastclose = close;
+}
+}, "~A");
+c$.pairHash = c$.prototype.pairHash =  new java.util.Hashtable ();
+Clazz_defineStatics (c$,
+"openingPars",  Clazz_newArray (-1, [new Character ('('), new Character ('['), new Character ('{'), new Character ('<'), new Character ('A'), new Character ('B'), new Character ('C'), new Character ('D'), new Character ('E'), new Character ('F'), new Character ('G'), new Character ('H'), new Character ('I'), new Character ('J'), new Character ('K'), new Character ('L'), new Character ('M'), new Character ('N'), new Character ('O'), new Character ('P'), new Character ('Q'), new Character ('R'), new Character ('S'), new Character ('T'), new Character ('U'), new Character ('V'), new Character ('W'), new Character ('X'), new Character ('Y'), new Character ('Z')]),
+"closingPars",  Clazz_newArray (-1, [new Character (')'), new Character (']'), new Character ('}'), new Character ('>'), new Character ('a'), new Character ('b'), new Character ('c'), new Character ('d'), new Character ('e'), new Character ('f'), new Character ('g'), new Character ('h'), new Character ('i'), new Character ('j'), new Character ('k'), new Character ('l'), new Character ('m'), new Character ('n'), new Character ('o'), new Character ('p'), new Character ('q'), new Character ('r'), new Character ('s'), new Character ('t'), new Character ('u'), new Character ('v'), new Character ('w'), new Character ('x'), new Character ('y'), new Character ('z')]));
+c$.openingParsSet = c$.prototype.openingParsSet =  new java.util.HashSet (java.util.Arrays.asList (jalview.analysis.Rna.openingPars));
+c$.closingParsSet = c$.prototype.closingParsSet =  new java.util.HashSet (java.util.Arrays.asList (jalview.analysis.Rna.closingPars));
+c$.closingToOpening = c$.prototype.closingToOpening =  new java.util.Hashtable ();
+{
+for (var i = 0; i < jalview.analysis.Rna.openingPars.length; i++) {
+jalview.analysis.Rna.closingToOpening.put (jalview.analysis.Rna.closingPars[i], jalview.analysis.Rna.openingPars[i]);
+}
+}});
+Clazz_declarePackage ("jalview.analysis");
+Clazz_load (null, "jalview.analysis.SecStrConsensus", ["java.util.ArrayList", "$.Hashtable"], function () {
+c$ = Clazz_declareType (jalview.analysis, "SecStrConsensus");
+c$.extractConsensus = Clazz_defineMethod (c$, "extractConsensus", 
+function (bps) {
+var maxlength = 0;
+for (var strs, $strs = bps.iterator (); $strs.hasNext () && ((strs = $strs.next ()) || true);) {
+for (var bp, $bp = strs.iterator (); $bp.hasNext () && ((bp = $bp.next ()) || true);) {
+maxlength = Math.max (1 + Math.max (bp.bp5, bp.bp3), maxlength);
+}
+}
+var seq =  new java.util.ArrayList ();
+for (var i = 0; i < maxlength; i++) {
+seq.add ( new java.util.Hashtable ());
+}
+for (var strs, $strs = bps.iterator (); $strs.hasNext () && ((strs = $strs.next ()) || true);) {
+for (var bp, $bp = strs.iterator (); $bp.hasNext () && ((bp = $bp.next ()) || true);) {
+var i = bp.bp5;
+var j = bp.bp3;
+var h = seq.get (i);
+if (!h.containsKey (new Integer (j))) {
+h.put (new Integer (j), new Double (0.0));
+}h.put (new Integer (j), new Double ((h.get (new Integer (j))).doubleValue () + 1.));
+}
+}
+var mat = jalview.analysis.SecStrConsensus.fillMatrix (seq);
+var res = jalview.analysis.SecStrConsensus.backtrack (mat, seq);
+var finalres =  Clazz_newIntArray (seq.size (), 0);
+for (var i = 0; i < seq.size (); i++) {
+finalres[i] = -1;
+}
+for (var bp, $bp = res.iterator (); $bp.hasNext () && ((bp = $bp.next ()) || true);) {
+finalres[bp.bp5] = bp.bp3;
+finalres[bp.bp3] = bp.bp5;
+}
+return finalres;
+}, "java.util.ArrayList");
+c$.canBasePair = Clazz_defineMethod (c$, "canBasePair", 
+ function (seq, i, k) {
+return seq.get (i).containsKey (new Integer (k));
+}, "java.util.ArrayList,~N,~N");
+c$.basePairScore = Clazz_defineMethod (c$, "basePairScore", 
+ function (seq, i, k) {
+return seq.get (i).get (new Integer (k));
+}, "java.util.ArrayList,~N,~N");
+c$.fillMatrix = Clazz_defineMethod (c$, "fillMatrix", 
+ function (seq) {
+var n = seq.size ();
+var tab =  Clazz_newDoubleArray (n, n, 0);
+for (var m = 1; m <= n; m++) {
+for (var i = 0; i < n - m + 1; i++) {
+var j = i + m - 1;
+tab[i][j] = 0;
+if (i < j) {
+tab[i][j] = Math.max (tab[i][j], tab[i + 1][j]);
+for (var k = i + 1; k <= j; k++) {
+if (jalview.analysis.SecStrConsensus.canBasePair (seq, i, k)) {
+var fact1 = 0;
+if (k > i + 1) {
+fact1 = tab[i + 1][k - 1];
+}var fact2 = 0;
+if (k < j) {
+fact2 = tab[k + 1][j];
+}tab[i][j] = Math.max (tab[i][j], jalview.analysis.SecStrConsensus.basePairScore (seq, i, k) + fact1 + fact2);
+}}
+}}
+}
+return tab;
+}, "java.util.ArrayList");
+c$.backtrack = Clazz_defineMethod (c$, "backtrack", 
+ function (tab, seq) {
+return jalview.analysis.SecStrConsensus.backtrack (tab, seq, 0, seq.size () - 1);
+}, "~A,java.util.ArrayList");
+c$.backtrack = Clazz_defineMethod (c$, "backtrack", 
+ function (tab, seq, i, j) {
+var result =  new java.util.ArrayList ();
+if (i < j) {
+var indices =  new java.util.ArrayList ();
+indices.add (new Integer (-1));
+for (var k = i + 1; k <= j; k++) {
+indices.add (new Integer (k));
+}
+for (var k, $k = indices.iterator (); $k.hasNext () && ((k = $k.next ()) || true);) {
+if (k == -1) {
+if (tab[i][j] == tab[i + 1][j]) {
+result = jalview.analysis.SecStrConsensus.backtrack (tab, seq, i + 1, j);
+}} else {
+if (jalview.analysis.SecStrConsensus.canBasePair (seq, i, k)) {
+var fact1 = 0;
+if (k > i + 1) {
+fact1 = tab[i + 1][k - 1];
+}var fact2 = 0;
+if (k < j) {
+fact2 = tab[k + 1][j];
+}if (tab[i][j] == jalview.analysis.SecStrConsensus.basePairScore (seq, i, k) + fact1 + fact2) {
+result = jalview.analysis.SecStrConsensus.backtrack (tab, seq, i + 1, k - 1);
+result.addAll (jalview.analysis.SecStrConsensus.backtrack (tab, seq, k + 1, j));
+result.add ( new jalview.analysis.SecStrConsensus.SimpleBP (i, k));
+}}}}
+} else if (i == j) {
+} else {
+}return result;
+}, "~A,java.util.ArrayList,~N,~N");
+Clazz_pu$h(self.c$);
+c$ = Clazz_decorateAsClass (function () {
+this.bp5 = 0;
+this.bp3 = 0;
+Clazz_instantialize (this, arguments);
+}, jalview.analysis.SecStrConsensus, "SimpleBP");
+Clazz_makeConstructor (c$, 
+function () {
+});
+Clazz_makeConstructor (c$, 
+function (a, b) {
+this.bp5 = a;
+this.bp3 = b;
+}, "~N,~N");
+Clazz_defineMethod (c$, "setBP5", 
+function (a) {
+this.bp5 = a;
+}, "~N");
+Clazz_defineMethod (c$, "setBP3", 
+function (a) {
+this.bp3 = a;
+}, "~N");
+Clazz_defineMethod (c$, "getBP5", 
+function () {
+return this.bp5;
+});
+Clazz_defineMethod (c$, "getBP3", 
+function () {
+return this.bp3;
+});
+Clazz_overrideMethod (c$, "toString", 
+function () {
+return "(" + this.bp5 + "," + this.bp3 + ")";
+});
+c$ = Clazz_p0p ();
+});
+Clazz_declarePackage ("jalview.analysis");
+Clazz_load (["java.lang.Exception"], "jalview.analysis.WUSSParseException", null, function () {
+c$ = Clazz_decorateAsClass (function () {
+this.problemPos = 0;
+Clazz_instantialize (this, arguments);
+}, jalview.analysis, "WUSSParseException", Exception);
+Clazz_makeConstructor (c$, 
+function (problemPos) {
+this.construct ("Invalid WUSS Notation", problemPos);
+}, "~N");
+Clazz_makeConstructor (c$, 
+function (message, problemPos) {
+Clazz_superConstructor (this, jalview.analysis.WUSSParseException, [message + " at or near position " + problemPos]);
+this.problemPos = problemPos;
+}, "~S,~N");
+Clazz_defineMethod (c$, "getProblemPos", 
+function () {
+return this.problemPos;
+});
+});
+Clazz_load(["java.util.Vector"],"java.util.Stack",["java.util.EmptyStackException"],function(){
+c$=Clazz_declareType(java.util,"Stack",java.util.Vector);
+Clazz_defineMethod(c$,"empty",
+function(){
+return this.elementCount==0;
+});
+Clazz_defineMethod(c$,"peek",
+function(){
+try{
+return this.elementData[this.elementCount-1];
+}catch(e){
+if(Clazz_instanceOf(e,IndexOutOfBoundsException)){
+throw new java.util.EmptyStackException();
+}else{
+throw e;
+}
+}
+});
+Clazz_defineMethod(c$,"pop",
+function(){
+try{
+var index=this.elementCount-1;
+var obj=this.elementData[index];
+this.removeElementAt(index);
+return obj;
+}catch(e){
+if(Clazz_instanceOf(e,IndexOutOfBoundsException)){
+throw new java.util.EmptyStackException();
+}else{
+throw e;
+}
+}
+});
+Clazz_defineMethod(c$,"push",
+function(object){
+this.addElement(object);
+return object;
+},"~O");
+Clazz_defineMethod(c$,"search",
+function(o){
+var index=this.lastIndexOf(o);
+if(index>=0)return(this.elementCount-index);
+return-1;
+},"~O");
+});
+Clazz_declarePackage ("jalview.datamodel");
+Clazz_load (null, "jalview.datamodel.Annotation", ["java.lang.Float", "$.StringBuffer"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.displayCharacter = "";
+this.description = "";
+this.secondaryStructure = ' ';
+this.value = 0;
+this.colour = null;
+Clazz_instantialize (this, arguments);
+}, jalview.datamodel, "Annotation");
+Clazz_makeConstructor (c$, 
+function (displayChar, desc, ss, val) {
+this.displayCharacter = displayChar;
+this.description = desc;
+this.secondaryStructure = ss;
+this.value = val;
+}, "~S,~S,~S,~N");
+Clazz_makeConstructor (c$, 
+function (displayChar, desc, ss, val, colour) {
+this.construct (displayChar, desc, ss, val);
+this.colour = colour;
+}, "~S,~S,~S,~N,java.awt.Color");
+Clazz_makeConstructor (c$, 
+function (that) {
+if (that == null || this === that) {
+return;
+}if (that.displayCharacter != null) this.displayCharacter =  String.instantialize (that.displayCharacter);
+if (that.description != null) this.description =  String.instantialize (that.description);
+this.secondaryStructure = that.secondaryStructure;
+this.value = that.value;
+this.colour = that.colour;
+}, "jalview.datamodel.Annotation");
+Clazz_makeConstructor (c$, 
+function (val) {
+this.construct (null, null, ' ', val, null);
+}, "~N");
+Clazz_overrideMethod (c$, "toString", 
+function () {
+var sb =  new StringBuffer ();
+if (this.displayCharacter != null) {
+sb.append ("\'");
+sb.append (this.displayCharacter);
+sb.append ("\'");
+}{
+sb.append (",");
+}if (this.secondaryStructure.charCodeAt (0) != 0 && !("" + this.displayCharacter).equals ("" + this.secondaryStructure)) {
+sb.append ("\'");
+sb.append (this.secondaryStructure);
+sb.append ("\'");
+}{
+sb.append (",");
+}if (this.description != null && this.description.length > 0) {
+sb.append ("\"");
+sb.append (this.description);
+sb.append ("\"");
+}{
+sb.append (",");
+}if (!Float.isNaN (this.value)) {
+sb.append (this.value);
+}if (this.colour != null) {
+if (sb.length () > 0) {
+sb.append (",");
+}sb.append ("[");
+sb.append ("" + this.colour.getRed ());
+sb.append (",");
+sb.append ("" + this.colour.getGreen ());
+sb.append (",");
+sb.append ("" + this.colour.getBlue ());
+sb.append ("]");
+}return sb.toString ();
+});
+});
+Clazz_declarePackage ("jalview.datamodel");
+Clazz_load (["java.awt.Color"], "jalview.datamodel.GraphLine", null, function () {
+c$ = Clazz_decorateAsClass (function () {
+this.value = 0;
+this.label = "";
+this.colour = null;
+this.displayed = true;
+Clazz_instantialize (this, arguments);
+}, jalview.datamodel, "GraphLine");
+Clazz_prepareFields (c$, function () {
+this.colour = java.awt.Color.black;
+});
+Clazz_makeConstructor (c$, 
+function (value, label, col) {
+this.value = value;
+if (label != null) {
+this.label = label;
+}if (col != null) {
+this.colour = col;
+}}, "~N,~S,java.awt.Color");
+Clazz_makeConstructor (c$, 
+function (from) {
+if (from != null) {
+this.value = from.value;
+this.label =  String.instantialize (from.label);
+this.colour = from.colour;
+this.displayed = from.displayed;
+}}, "jalview.datamodel.GraphLine");
+Clazz_overrideMethod (c$, "equals", 
+function (obj) {
+if (obj != null && Clazz_instanceOf (obj, jalview.datamodel.GraphLine)) {
+var other = obj;
+return this.displayed == other.displayed && this.value == other.value && (this.colour != null ? (other.colour != null && other.colour.equals (this.colour)) : other.colour == null) && (this.label != null ? (other.label != null && other.label.equals (this.label)) : other.label == null);
+}return false;
+}, "~O");
+});
+Clazz_declarePackage ("jalview.datamodel");
+Clazz_load (null, "jalview.datamodel.DBRefEntry", ["jalview.datamodel.Mapping"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.source = "";
+this.version = "";
+this.accessionId = "";
+this.map = null;
+Clazz_instantialize (this, arguments);
+}, jalview.datamodel, "DBRefEntry");
+Clazz_makeConstructor (c$, 
+function () {
+});
+Clazz_makeConstructor (c$, 
+function (source, version, accessionId) {
+this.construct (source, version, accessionId, null);
+}, "~S,~S,~S");
+Clazz_makeConstructor (c$, 
+function (source, version, accessionId, map) {
+this.source = source.toUpperCase ();
+this.version = version;
+this.accessionId = accessionId;
+this.map = map;
+}, "~S,~S,~S,jalview.datamodel.Mapping");
+Clazz_makeConstructor (c$, 
+function (entry) {
+this.construct ((entry.source == null ? "" :  String.instantialize (entry.source)), (entry.version == null ? "" :  String.instantialize (entry.version)), (entry.accessionId == null ? "" :  String.instantialize (entry.accessionId)), (entry.map == null ? null :  new jalview.datamodel.Mapping (entry.map)));
+}, "jalview.datamodel.DBRefEntry");
+Clazz_overrideMethod (c$, "equals", 
+function (o) {
+if (o == null || !(Clazz_instanceOf (o, jalview.datamodel.DBRefEntry))) {
+return false;
+}var entry = o;
+if (entry === this) {
+return true;
+}if (this.equalRef (entry) && ((this.map == null && entry.map == null) || (this.map != null && entry.map != null && this.map.equals (entry.map)))) {
+return true;
+}return false;
+}, "~O");
+Clazz_defineMethod (c$, "equalRef", 
+function (entry) {
+if (entry == null) {
+return false;
+}if (entry === this) {
+return true;
+}if ((this.source != null && entry.source != null && this.source.equalsIgnoreCase (entry.source)) && (this.accessionId != null && entry.accessionId != null && this.accessionId.equalsIgnoreCase (entry.accessionId)) && (this.version != null && entry.version != null && this.version.equalsIgnoreCase (entry.version))) {
+return true;
+}return false;
+}, "jalview.datamodel.DBRefEntry");
+Clazz_defineMethod (c$, "getSource", 
+function () {
+return this.source;
+});
+Clazz_defineMethod (c$, "getVersion", 
+function () {
+return this.version;
+});
+Clazz_defineMethod (c$, "getAccessionId", 
+function () {
+return this.accessionId;
+});
+Clazz_defineMethod (c$, "setAccessionId", 
+function (accessionId) {
+this.accessionId = accessionId;
+}, "~S");
+Clazz_defineMethod (c$, "setSource", 
+function (source) {
+this.source = source;
+}, "~S");
+Clazz_defineMethod (c$, "setVersion", 
+function (version) {
+this.version = version;
+}, "~S");
+Clazz_defineMethod (c$, "getMap", 
+function () {
+return this.map;
+});
+Clazz_defineMethod (c$, "setMap", 
+function (map) {
+this.map = map;
+}, "jalview.datamodel.Mapping");
+Clazz_defineMethod (c$, "hasMap", 
+function () {
+return this.map != null;
+});
+Clazz_defineMethod (c$, "getSrcAccString", 
+function () {
+return ((this.source != null) ? this.source : "") + ":" + ((this.accessionId != null) ? this.accessionId : "");
+});
+Clazz_overrideMethod (c$, "toString", 
+function () {
+return this.getSrcAccString ();
+});
+});
+Clazz_declarePackage ("jalview.datamodel");
+c$ = Clazz_declareType (jalview.datamodel, "DBRefSource");
+Clazz_defineStatics (c$,
+"UNIPROT", "UNIPROT");
+c$.UP_NAME = c$.prototype.UP_NAME = "UNIPROT_NAME".toUpperCase ();
+c$.UNIPROTKB = c$.prototype.UNIPROTKB = "UniProtKB/TrEMBL".toUpperCase ();
+c$.EMBLCDSProduct = c$.prototype.EMBLCDSProduct = "EMBLCDSProtein".toUpperCase ();
+Clazz_defineStatics (c$,
+"PDB", "PDB",
+"EMBL", "EMBL",
+"EMBLCDS", "EMBLCDS",
+"PFAM", "PFAM",
+"RFAM", "RFAM");
+c$.GENEDB = c$.prototype.GENEDB = "GeneDB".toUpperCase ();
+c$.DNACODINGDBS = c$.prototype.DNACODINGDBS =  Clazz_newArray (-1, [jalview.datamodel.DBRefSource.EMBL, jalview.datamodel.DBRefSource.EMBLCDS, jalview.datamodel.DBRefSource.GENEDB]);
+c$.CODINGDBS = c$.prototype.CODINGDBS =  Clazz_newArray (-1, [jalview.datamodel.DBRefSource.EMBLCDS, jalview.datamodel.DBRefSource.GENEDB]);
+c$.PROTEINDBS = c$.prototype.PROTEINDBS =  Clazz_newArray (-1, [jalview.datamodel.DBRefSource.UNIPROT, jalview.datamodel.DBRefSource.PDB, jalview.datamodel.DBRefSource.UNIPROTKB, jalview.datamodel.DBRefSource.EMBLCDSProduct]);
+c$.PROTEINSEQ = c$.prototype.PROTEINSEQ =  Clazz_newArray (-1, [jalview.datamodel.DBRefSource.UNIPROT, jalview.datamodel.DBRefSource.UNIPROTKB, jalview.datamodel.DBRefSource.EMBLCDSProduct]);
+c$.PROTEINSTR = c$.prototype.PROTEINSTR =  Clazz_newArray (-1, [jalview.datamodel.DBRefSource.PDB]);
+c$.DOMAINDBS = c$.prototype.DOMAINDBS =  Clazz_newArray (-1, [jalview.datamodel.DBRefSource.PFAM, jalview.datamodel.DBRefSource.RFAM]);
+Clazz_defineStatics (c$,
+"SEQDB", "SQ",
+"DNASEQDB", "NASQ",
+"PROTSEQDB", "PROTSQ",
+"CODINGSEQDB", "CODING",
+"DNACODINGSEQDB", "XONCODING",
+"DOMAINDB", "DOMAIN",
+"MULTIACC", "MULTIACC",
+"ALIGNMENTDB", "ALIGNMENTS");
+Clazz_declarePackage ("jalview.datamodel");
+Clazz_load (["java.lang.Enum"], "jalview.datamodel.PDBEntry", null, function () {
+c$ = Clazz_decorateAsClass (function () {
+this.file = null;
+this.type = null;
+this.id = null;
+this.chainCode = null;
+this.properties = null;
+Clazz_instantialize (this, arguments);
+}, jalview.datamodel, "PDBEntry");
+Clazz_overrideMethod (c$, "equals", 
+function (obj) {
+if (obj == null || !(Clazz_instanceOf (obj, jalview.datamodel.PDBEntry))) {
+return false;
+}if (obj === this) {
+return true;
+}var o = obj;
+return (this.type === o.type || (this.type != null && o.type != null && o.type.equals (this.type))) && (this.id === o.id || (this.id != null && o.id != null && o.id.equalsIgnoreCase (this.id))) && (this.chainCode === o.chainCode || (this.chainCode != null && o.chainCode != null && o.chainCode.equalsIgnoreCase (this.chainCode))) && (this.properties === o.properties || (this.properties != null && o.properties != null && this.properties.equals (o.properties)));
+}, "~O");
+Clazz_makeConstructor (c$, 
+function () {
+});
+Clazz_makeConstructor (c$, 
+function (pdbId, chain, type, filePath) {
+this.id = pdbId;
+this.chainCode = chain;
+this.type = type == null ? null : type.toString ();
+this.file = filePath;
+}, "~S,~S,jalview.datamodel.PDBEntry.Type,~S");
+Clazz_makeConstructor (c$, 
+function (entry) {
+this.file = entry.file;
+this.type = entry.type;
+this.id = entry.id;
+this.chainCode = entry.chainCode;
+if (entry.properties != null) {
+this.properties = entry.properties.clone ();
+}}, "jalview.datamodel.PDBEntry");
+Clazz_defineMethod (c$, "setFile", 
+function (file) {
+this.file = file;
+}, "~S");
+Clazz_defineMethod (c$, "getFile", 
+function () {
+return this.file;
+});
+Clazz_defineMethod (c$, "setType", 
+function (t) {
+this.type = t;
+}, "~S");
+Clazz_defineMethod (c$, "setType", 
+function (type) {
+this.type = type == null ? null : type.toString ();
+}, "jalview.datamodel.PDBEntry.Type");
+Clazz_defineMethod (c$, "getType", 
+function () {
+return this.type;
+});
+Clazz_defineMethod (c$, "setId", 
+function (id) {
+this.id = id;
+}, "~S");
+Clazz_defineMethod (c$, "getId", 
+function () {
+return this.id;
+});
+Clazz_defineMethod (c$, "setProperty", 
+function (property) {
+this.properties = property;
+}, "java.util.Hashtable");
+Clazz_defineMethod (c$, "getProperty", 
+function () {
+return this.properties;
+});
+Clazz_defineMethod (c$, "getChainCode", 
+function () {
+return this.chainCode;
+});
+Clazz_defineMethod (c$, "setChainCode", 
+function (chainCode) {
+this.chainCode = chainCode;
+}, "~S");
+Clazz_pu$h(self.c$);
+c$ = Clazz_declareType (jalview.datamodel.PDBEntry, "Type", Enum);
+Clazz_defineEnumConstant (c$, "PDB", 0, []);
+Clazz_defineEnumConstant (c$, "FILE", 1, []);
+c$ = Clazz_p0p ();
+});
+Clazz_declarePackage ("jalview.util");
+Clazz_load (["java.util.regex.Pattern"], "jalview.util.StringUtils", ["java.lang.StringBuffer", "java.util.ArrayList"], function () {
+c$ = Clazz_declareType (jalview.util, "StringUtils");
+c$.insertCharAt = Clazz_defineMethod (c$, "insertCharAt", 
+function ($in, position, count, ch) {
+var tmp =  Clazz_newCharArray ($in.length + count, '\0');
+if (position >= $in.length) {
+System.arraycopy ($in, 0, tmp, 0, $in.length);
+position = $in.length;
+} else {
+System.arraycopy ($in, 0, tmp, 0, position);
+}var index = position;
+while (count > 0) {
+tmp[index++] = ch;
+count--;
+}
+if (position < $in.length) {
+System.arraycopy ($in, position, tmp, index, $in.length - position);
+}return tmp;
+}, "~A,~N,~N,~S");
+c$.deleteChars = Clazz_defineMethod (c$, "deleteChars", 
+function ($in, from, to) {
+if (from >= $in.length || from < 0) {
+return $in;
+}var tmp;
+if (to >= $in.length) {
+tmp =  Clazz_newCharArray (from, '\0');
+System.arraycopy ($in, 0, tmp, 0, from);
+to = $in.length;
+} else {
+tmp =  Clazz_newCharArray ($in.length - to + from, '\0');
+System.arraycopy ($in, 0, tmp, 0, from);
+System.arraycopy ($in, to, tmp, from, $in.length - to);
+}return tmp;
+}, "~A,~N,~N");
+c$.getLastToken = Clazz_defineMethod (c$, "getLastToken", 
+function (input, token) {
+if (input == null) {
+return null;
+}if (token == null) {
+return input;
+}var st = input.$plit (token);
+return st[st.length - 1];
+}, "~S,~S");
+c$.separatorListToArray = Clazz_defineMethod (c$, "separatorListToArray", 
+function (input, delimiter) {
+var seplen = delimiter.length;
+if (input == null || input.equals ("") || input.equals (delimiter)) {
+return null;
+}var jv =  new java.util.ArrayList ();
+var cp = 0;
+var pos;
+var escape;
+var wasescaped = false;
+var wasquoted = false;
+var lstitem = null;
+while ((pos = input.indexOf (delimiter, cp)) >= cp) {
+escape = (pos > 0 && input.charAt (pos - 1) == '\\') ? -1 : 0;
+if (wasescaped || wasquoted) {
+jv.set (jv.size () - 1, lstitem = lstitem + delimiter + input.substring (cp, pos + escape));
+} else {
+jv.add (lstitem = input.substring (cp, pos + escape));
+}cp = pos + seplen;
+wasescaped = escape == -1;
+wasquoted = jalview.util.StringUtils.DELIMITERS_PATTERN.matcher (lstitem).matches ();
+}
+if (cp < input.length) {
+var c = input.substring (cp);
+if (wasescaped || wasquoted) {
+jv.set (jv.size () - 1, lstitem + delimiter + c);
+} else {
+if (!c.equals (delimiter)) {
+jv.add (c);
+}}}if (jv.size () > 0) {
+var v = jv.toArray ( new Array (jv.size ()));
+jv.clear ();
+if (false) {
+System.err.println ("Array from '" + delimiter + "' separated List:\n" + v.length);
+for (var i = 0; i < v.length; i++) {
+System.err.println ("item " + i + " '" + v[i] + "'");
+}
+}return v;
+}if (false) {
+System.err.println ("Empty Array from '" + delimiter + "' separated List");
+}return null;
+}, "~S,~S");
+c$.arrayToSeparatorList = Clazz_defineMethod (c$, "arrayToSeparatorList", 
+function (list, separator) {
+var v =  new StringBuffer ();
+if (list != null && list.length > 0) {
+for (var i = 0, iSize = list.length; i < iSize; i++) {
+if (list[i] != null) {
+if (v.length () > 0) {
+v.append (separator);
+}v.append (list[i]);
+}}
+if (false) {
+System.err.println ("Returning '" + separator + "' separated List:\n");
+System.err.println (v);
+}return v.toString ();
+}if (false) {
+System.err.println ("Returning empty '" + separator + "' separated List\n");
+}return "" + separator;
+}, "~A,~S");
+c$.DELIMITERS_PATTERN = c$.prototype.DELIMITERS_PATTERN = java.util.regex.Pattern.compile (".*='[^']*(?!')");
+Clazz_defineStatics (c$,
+"DEBUG", false);
+});
+Clazz_declarePackage("java.util.regex");
+Clazz_load(null,"java.util.regex.Pattern",["java.lang.IllegalArgumentException","$.StringBuffer","java.util.regex.Matcher"],function(){
+c$=Clazz_decorateAsClass(function(){
+this.$flags=0;
+this.regexp=null;
+Clazz_instantialize(this,arguments);
+},java.util.regex,"Pattern",null,java.io.Serializable);
+Clazz_defineMethod(c$,"matcher",
+function(cs){
+return new java.util.regex.Matcher(this,cs);
+},"CharSequence");
+Clazz_defineMethod(c$,"split",
+function(input,limit){
+var res=new Array(0);
+var mat=this.matcher(input);
+var index=0;
+var curPos=0;
+if(input.length()==0){
+return[""];
+}else{
+while(mat.find()&&(index+1<limit||limit<=0)){
+res[res.length]=input.subSequence(curPos,mat.start()).toString();
+curPos=mat.end();
+index++;
+}
+res[res.length]=input.subSequence(curPos,input.length()).toString();
+index++;
+if(limit==0){
+while(--index>=0&&res[index].toString().length==0){
+res.length--;
+}
+}}return res;
+},"CharSequence,~N");
+Clazz_defineMethod(c$,"split",
+function(input){
+return this.split(input,0);
+},"CharSequence");
+Clazz_defineMethod(c$,"pattern",
+function(){
+{
+return this.regexp.source;
+}return null;
+});
+Clazz_defineMethod(c$,"toString",
+function(){
+return this.pattern();
+});
+Clazz_defineMethod(c$,"flags",
+function(){
+return this.$flags;
+});
+c$.compile=Clazz_defineMethod(c$,"compile",
+function(regex,flags){
+if((flags!=0)&&((flags|239)!=239)){
+throw new IllegalArgumentException("Illegal flags");
+}var flagStr="g";
+if((flags&8)!=0){
+flagStr+="m";
+}if((flags&2)!=0){
+flagStr+="i";
+}var pattern=new java.util.regex.Pattern();
+{
+pattern.regexp=new RegExp(regex,flagStr);
+}return pattern;
+},"~S,~N");
+c$.compile=Clazz_defineMethod(c$,"compile",
+function(pattern){
+return java.util.regex.Pattern.compile(pattern,0);
+},"~S");
+c$.matches=Clazz_defineMethod(c$,"matches",
+function(regex,input){
+return java.util.regex.Pattern.compile(regex).matcher(input).matches();
+},"~S,CharSequence");
+c$.quote=Clazz_defineMethod(c$,"quote",
+function(s){
+var sb=new StringBuffer().append("\\Q");
+var apos=0;
+var k;
+while((k=s.indexOf("\\E",apos))>=0){
+sb.append(s.substring(apos,k+2)).append("\\\\E\\Q");
+apos=k+2;
+}
+return sb.append(s.substring(apos)).append("\\E").toString();
+},"~S");
+Clazz_makeConstructor(c$,
+($fz=function(){
+},$fz.isPrivate=true,$fz));
+Clazz_defineStatics(c$,
+"UNIX_LINES",1,
+"CASE_INSENSITIVE",2,
+"COMMENTS",4,
+"MULTILINE",8,
+"LITERAL",16,
+"DOTALL",32,
+"UNICODE_CASE",64,
+"CANON_EQ",128,
+"flagsBitMask",239);
+});
+Clazz_declarePackage("java.util.regex");
+Clazz_load(["java.util.regex.MatchResult"],"java.util.regex.Matcher",["java.lang.IllegalArgumentException","$.IndexOutOfBoundsException","$.NullPointerException","$.StringBuffer"],function(){
+c$=Clazz_decorateAsClass(function(){
+this.pat=null;
+this.string=null;
+this.leftBound=-1;
+this.rightBound=-1;
+this.appendPos=0;
+this.replacement=null;
+this.processedRepl=null;
+this.replacementParts=null;
+this.results=null;
+Clazz_instantialize(this,arguments);
+},java.util.regex,"Matcher",null,java.util.regex.MatchResult);
+Clazz_defineMethod(c$,"appendReplacement",
+function(sb,replacement){
+this.processedRepl=this.processReplacement(replacement);
+sb.append(this.string.subSequence(this.appendPos,this.start()));
+sb.append(this.processedRepl);
+this.appendPos=this.end();
+return this;
+},"StringBuffer,~S");
+Clazz_defineMethod(c$,"processReplacement",
+($fz=function(replacement){
+if(this.replacement!=null&&this.replacement.equals(replacement)){
+if(this.replacementParts==null){
+return this.processedRepl;
+}else{
+var sb=new StringBuffer();
+for(var i=0;i<this.replacementParts.length;i++){
+sb.append(this.replacementParts[i]);
+}
+return sb.toString();
+}}else{
+this.replacement=replacement;
+var repl=replacement.toCharArray();
+var res=new StringBuffer();
+this.replacementParts=null;
+var index=0;
+var replacementPos=0;
+var nextBackSlashed=false;
+while(index<repl.length){
+if((repl[index]).charCodeAt(0)==('\\').charCodeAt(0)&&!nextBackSlashed){
+nextBackSlashed=true;
+index++;
+}if(nextBackSlashed){
+res.append(repl[index]);
+nextBackSlashed=false;
+}else{
+if((repl[index]).charCodeAt(0)==('$').charCodeAt(0)){
+if(this.replacementParts==null){
+this.replacementParts=new Array(0);
+}try{
+var gr=Integer.parseInt(String.instantialize(repl,++index,1));
+if(replacementPos!=res.length()){
+this.replacementParts[this.replacementParts.length]=res.subSequence(replacementPos,res.length());
+replacementPos=res.length();
+}this.replacementParts[this.replacementParts.length]=((Clazz_isClassDefined("java.util.regex.Matcher$1")?0:java.util.regex.Matcher.$Matcher$1$()),Clazz_innerTypeInstance(java.util.regex.Matcher$1,this,null));
+var group=this.group(gr);
+replacementPos+=group.length;
+res.append(group);
+}catch(e$$){
+if(Clazz_instanceOf(e$$,IndexOutOfBoundsException)){
+var iob=e$$;
+{
+throw iob;
+}
+}else if(Clazz_instanceOf(e$$,Exception)){
+var e=e$$;
+{
+throw new IllegalArgumentException("Illegal regular expression format");
+}
+}else{
+throw e$$;
+}
+}
+}else{
+res.append(repl[index]);
+}}index++;
+}
+if(this.replacementParts!=null&&replacementPos!=res.length()){
+this.replacementParts[this.replacementParts.length]=res.subSequence(replacementPos,res.length());
+}return res.toString();
+}},$fz.isPrivate=true,$fz),"~S");
+Clazz_defineMethod(c$,"reset",
+function(newSequence){
+if(newSequence==null){
+throw new NullPointerException("Empty new sequence!");
+}this.string=newSequence;
+return this.reset();
+},"CharSequence");
+Clazz_defineMethod(c$,"reset",
+function(){
+this.leftBound=0;
+this.rightBound=this.string.length();
+this.appendPos=0;
+this.replacement=null;
+{
+var flags=""+(this.pat.regexp.ignoreCase?"i":"")
++(this.pat.regexp.global?"g":"")
++(this.pat.regexp.multiline?"m":"");
+this.pat.regexp=new RegExp(this.pat.regexp.source,flags);
+}return this;
+});
+Clazz_defineMethod(c$,"region",
+function(leftBound,rightBound){
+if(leftBound>rightBound||leftBound<0||rightBound<0||leftBound>this.string.length()||rightBound>this.string.length()){
+throw new IndexOutOfBoundsException(leftBound+" is out of bound of "+rightBound);
+}this.leftBound=leftBound;
+this.rightBound=rightBound;
+this.results=null;
+this.appendPos=0;
+this.replacement=null;
+return this;
+},"~N,~N");
+Clazz_defineMethod(c$,"appendTail",
+function(sb){
+return sb.append(this.string.subSequence(this.appendPos,this.string.length()));
+},"StringBuffer");
+Clazz_defineMethod(c$,"replaceFirst",
+function(replacement){
+this.reset();
+if(this.find()){
+var sb=new StringBuffer();
+this.appendReplacement(sb,replacement);
+return this.appendTail(sb).toString();
+}return this.string.toString();
+},"~S");
+Clazz_defineMethod(c$,"replaceAll",
+function(replacement){
+var sb=new StringBuffer();
+this.reset();
+while(this.find()){
+this.appendReplacement(sb,replacement);
+}
+return this.appendTail(sb).toString();
+},"~S");
+Clazz_defineMethod(c$,"pattern",
+function(){
+return this.pat;
+});
+Clazz_defineMethod(c$,"group",
+function(groupIndex){
+if(this.results==null||groupIndex<0||groupIndex>this.results.length){
+return null;
+}return this.results[groupIndex];
+},"~N");
+Clazz_defineMethod(c$,"group",
+function(){
+return this.group(0);
+});
+Clazz_defineMethod(c$,"find",
+function(startIndex){
+var stringLength=this.string.length();
+if(startIndex<0||startIndex>stringLength)throw new IndexOutOfBoundsException("Out of bound "+startIndex);
+startIndex=this.findAt(startIndex);
+return false;
+},"~N");
+Clazz_defineMethod(c$,"findAt",
+($fz=function(startIndex){
+return-1;
+},$fz.isPrivate=true,$fz),"~N");
+Clazz_defineMethod(c$,"find",
+function(){
+{
+this.results=this.pat.regexp.exec(this.string.subSequence(this.leftBound,this.rightBound));
+}return(this.results!=null);
+});
+Clazz_defineMethod(c$,"start",
+function(groupIndex){
+var beginningIndex=0;
+{
+beginningIndex=this.pat.regexp.lastIndex;
+}beginningIndex-=this.results[0].length;
+return beginningIndex;
+},"~N");
+Clazz_defineMethod(c$,"end",
+function(groupIndex){
+{
+return this.pat.regexp.lastIndex;
+}return-1;
+},"~N");
+Clazz_defineMethod(c$,"matches",
+function(){
+return this.find();
+});
+c$.quoteReplacement=Clazz_defineMethod(c$,"quoteReplacement",
+function(string){
+if(string.indexOf('\\') < 0 && string.indexOf ('$')<0)return string;
+var res=new StringBuffer(string.length*2);
+var ch;
+var len=string.length;
+for(var i=0;i<len;i++){
+switch(ch=string.charAt(i)){
+case'$':
+res.append('\\');
+res.append('$');
+break;
+case'\\':
+res.append('\\');
+res.append('\\');
+break;
+default:
+res.append(ch);
+}
+}
+return res.toString();
+},"~S");
+Clazz_defineMethod(c$,"lookingAt",
+function(){
+return false;
+});
+Clazz_defineMethod(c$,"start",
+function(){
+return this.start(0);
+});
+Clazz_overrideMethod(c$,"groupCount",
+function(){
+return this.results==null?0:this.results.length;
+});
+Clazz_defineMethod(c$,"end",
+function(){
+return this.end(0);
+});
+Clazz_defineMethod(c$,"toMatchResult",
+function(){
+return this;
+});
+Clazz_defineMethod(c$,"useAnchoringBounds",
+function(value){
+return this;
+},"~B");
+Clazz_defineMethod(c$,"hasAnchoringBounds",
+function(){
+return false;
+});
+Clazz_defineMethod(c$,"useTransparentBounds",
+function(value){
+return this;
+},"~B");
+Clazz_defineMethod(c$,"hasTransparentBounds",
+function(){
+return false;
+});
+Clazz_defineMethod(c$,"regionStart",
+function(){
+return this.leftBound;
+});
+Clazz_defineMethod(c$,"regionEnd",
+function(){
+return this.rightBound;
+});
+Clazz_defineMethod(c$,"requireEnd",
+function(){
+return false;
+});
+Clazz_defineMethod(c$,"hitEnd",
+function(){
+return false;
+});
+Clazz_defineMethod(c$,"usePattern",
+function(pat){
+if(pat==null){
+throw new IllegalArgumentException("Empty pattern!");
+}this.pat=pat;
+this.results=null;
+return this;
+},"java.util.regex.Pattern");
+Clazz_makeConstructor(c$,
+function(pat,cs){
+this.pat=pat;
+this.string=cs;
+this.leftBound=0;
+this.rightBound=this.string.toString().length;
+},"java.util.regex.Pattern,CharSequence");
+c$.$Matcher$1$=function(){
+Clazz_pu$h(self.c$);
+c$=Clazz_decorateAsClass(function(){
+Clazz_prepareCallback(this,arguments);
+this.grN=0;
+Clazz_instantialize(this,arguments);
+},java.util.regex,"Matcher$1");
+Clazz_prepareFields(c$,function(){
+this.grN=gr;
+});
+Clazz_overrideMethod(c$,"toString",
+function(){
+return this.b$["java.util.regex.Matcher"].group(this.grN);
+});
+c$=Clazz_p0p();
+};
+Clazz_defineStatics(c$,
+"MODE_FIND",1,
+"MODE_MATCH",2);
+});
+Clazz_declarePackage("java.util.regex");
+Clazz_declareInterface(java.util.regex,"MatchResult");
+Clazz_declarePackage ("jalview.util");
+Clazz_load (null, "jalview.util.Format", ["java.lang.Character", "$.IllegalArgumentException", "$.StringBuffer"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.width = 0;
+this.precision = 0;
+this.pre = null;
+this.post = null;
+this.leading_zeroes = false;
+this.show_plus = false;
+this.alternate = false;
+this.show_space = false;
+this.left_align = false;
+this.fmt = '\0';
+this.formatString = null;
+Clazz_instantialize (this, arguments);
+}, jalview.util, "Format");
+Clazz_makeConstructor (c$, 
+function (s) {
+this.formatString = s;
+this.width = 0;
+this.precision = -1;
+this.pre = "";
+this.post = "";
+this.leading_zeroes = false;
+this.show_plus = false;
+this.alternate = false;
+this.show_space = false;
+this.left_align = false;
+this.fmt = ' ';
+var length = s.length;
+var parse_state = 0;
+var i = 0;
+while (parse_state == 0) {
+if (i >= length) {
+parse_state = 5;
+} else if (s.charAt (i) == '%') {
+if (i < (length - 1)) {
+if (s.charAt (i + 1) == '%') {
+this.pre = this.pre + '%';
+i++;
+} else {
+parse_state = 1;
+}} else {
+throw  new IllegalArgumentException ();
+}} else {
+this.pre = this.pre + s.charAt (i);
+}i++;
+}
+while (parse_state == 1) {
+if (i >= length) {
+parse_state = 5;
+} else if (s.charAt (i) == ' ') {
+this.show_space = true;
+} else if (s.charAt (i) == '-') {
+this.left_align = true;
+} else if (s.charAt (i) == '+') {
+this.show_plus = true;
+} else if (s.charAt (i) == '0') {
+this.leading_zeroes = true;
+} else if (s.charAt (i) == '#') {
+this.alternate = true;
+} else {
+parse_state = 2;
+i--;
+}i++;
+}
+while (parse_state == 2) {
+if (i >= length) {
+parse_state = 5;
+} else if (('0' <= s.charAt (i)) && (s.charAt (i) <= '9')) {
+this.width = ((this.width * 10) + s.charCodeAt (i)) - 48;
+i++;
+} else if (s.charAt (i) == '.') {
+parse_state = 3;
+this.precision = 0;
+i++;
+} else {
+parse_state = 4;
+}}
+while (parse_state == 3) {
+if (i >= length) {
+parse_state = 5;
+} else if (('0' <= s.charAt (i)) && (s.charAt (i) <= '9')) {
+this.precision = ((this.precision * 10) + s.charCodeAt (i)) - 48;
+i++;
+} else {
+parse_state = 4;
+}}
+if (parse_state == 4) {
+if (i >= length) {
+parse_state = 5;
+} else {
+this.fmt = s.charAt (i);
+}i++;
+}if (i < length) {
+this.post = s.substring (i, length);
+}}, "~S");
+c$.getHexString = Clazz_defineMethod (c$, "getHexString", 
+function (color) {
+var r;
+var g;
+var b;
+r = Integer.toHexString (color.getRed ());
+if (r.length < 2) {
+r = "0" + r;
+}g = Integer.toHexString (color.getGreen ());
+if (g.length < 2) {
+g = "0" + g;
+}b = Integer.toHexString (color.getBlue ());
+if (b.length < 2) {
+b = "0" + b;
+}return r + g + b;
+}, "java.awt.Color");
+c$.printDouble = Clazz_defineMethod (c$, "printDouble", 
+function (s, fmt, x) {
+s.print ( new jalview.util.Format (fmt).formDouble (x));
+}, "java.io.PrintStream,~S,~N");
+c$.printLong = Clazz_defineMethod (c$, "printLong", 
+function (s, fmt, x) {
+s.print ( new jalview.util.Format (fmt).formLong (x));
+}, "java.io.PrintStream,~S,~N");
+c$.printChar = Clazz_defineMethod (c$, "printChar", 
+function (s, fmt, x) {
+s.print ( new jalview.util.Format (fmt).formChar (x));
+}, "java.io.PrintStream,~S,~S");
+c$.print = Clazz_defineMethod (c$, "print", 
+function (s, fmt, x) {
+s.print ( new jalview.util.Format (fmt).form (x));
+}, "java.io.PrintStream,~S,~S");
+c$.atoi = Clazz_defineMethod (c$, "atoi", 
+function (s) {
+return jalview.util.Format.atol (s);
+}, "~S");
+c$.atol = Clazz_defineMethod (c$, "atol", 
+function (s) {
+var i = 0;
+while ((i < s.length) && Character.isWhitespace (s.charAt (i))) {
+i++;
+}
+if ((i < s.length) && (s.charAt (i) == '0')) {
+if (((i + 1) < s.length) && ((s.charAt (i + 1) == 'x') || (s.charAt (i + 1) == 'X'))) {
+return jalview.util.Format.parseLong (s.substring (i + 2), 16);
+} else {
+return jalview.util.Format.parseLong (s, 8);
+}} else {
+return jalview.util.Format.parseLong (s, 10);
+}}, "~S");
+c$.parseLong = Clazz_defineMethod (c$, "parseLong", 
+ function (s, base) {
+var i = 0;
+var sign = 1;
+var r = 0;
+while ((i < s.length) && Character.isWhitespace (s.charAt (i))) {
+i++;
+}
+if ((i < s.length) && (s.charAt (i) == '-')) {
+sign = -1;
+i++;
+} else if ((i < s.length) && (s.charAt (i) == '+')) {
+i++;
+}while (i < s.length) {
+var ch = s.charAt (i);
+if (('0' <= ch) && (ch.charCodeAt (0) < (48 + base))) {
+r = ((r * base) + ch.charCodeAt (0)) - 48;
+} else if (('A' <= ch) && (ch.charCodeAt (0) < ((65 + base) - 10))) {
+r = ((r * base) + ch.charCodeAt (0)) - 65 + 10;
+} else if (('a' <= ch) && (ch.charCodeAt (0) < ((97 + base) - 10))) {
+r = ((r * base) + ch.charCodeAt (0)) - 97 + 10;
+} else {
+return r * sign;
+}i++;
+}
+return r * sign;
+}, "~S,~N");
+c$.atof = Clazz_defineMethod (c$, "atof", 
+function (s) {
+var i = 0;
+var sign = 1;
+var r = 0;
+var p = 1;
+var state = 0;
+while ((i < s.length) && Character.isWhitespace (s.charAt (i))) {
+i++;
+}
+if ((i < s.length) && (s.charAt (i) == '-')) {
+sign = -1;
+i++;
+} else if ((i < s.length) && (s.charAt (i) == '+')) {
+i++;
+}while (i < s.length) {
+var ch = s.charAt (i);
+if (('0' <= ch) && (ch <= '9')) {
+if (state == 0) {
+r = ((r * 10) + ch.charCodeAt (0)) - 48;
+} else if (state == 1) {
+p = p / 10;
+r = r + (p * (ch.charCodeAt (0) - 48));
+}} else if (ch == '.') {
+if (state == 0) {
+state = 1;
+} else {
+return sign * r;
+}} else if ((ch == 'e') || (ch == 'E')) {
+var e = jalview.util.Format.parseLong (s.substring (i + 1), 10);
+return sign * r * Math.pow (10, e);
+} else {
+return sign * r;
+}i++;
+}
+return sign * r;
+}, "~S");
+Clazz_defineMethod (c$, "formDouble", 
+function (x) {
+var r;
+if (this.precision < 0) {
+this.precision = 6;
+}var s = 1;
+if (x < 0) {
+x = -x;
+s = -1;
+}if (this.fmt == 'f') {
+r = this.fixed_format (x);
+} else if ((this.fmt == 'e') || (this.fmt == 'E') || (this.fmt == 'g') || (this.fmt == 'G')) {
+r = this.exp_format (x);
+} else {
+throw  new IllegalArgumentException ();
+}return this.pad (this.sign (s, r));
+}, "~N");
+Clazz_defineMethod (c$, "formLong", 
+function (x) {
+var r;
+var s = 0;
+if ((this.fmt == 'd') || (this.fmt == 'i')) {
+if (x < 0) {
+r = ("" + x).substring (1);
+s = -1;
+} else {
+r = "" + x;
+s = 1;
+}} else if (this.fmt == 'o') {
+r = jalview.util.Format.convert (x, 3, 7, "01234567");
+} else if (this.fmt == 'x') {
+r = jalview.util.Format.convert (x, 4, 15, "0123456789abcdef");
+} else if (this.fmt == 'X') {
+r = jalview.util.Format.convert (x, 4, 15, "0123456789ABCDEF");
+} else {
+throw  new IllegalArgumentException ();
+}return this.pad (this.sign (s, r));
+}, "~N");
+Clazz_defineMethod (c$, "formChar", 
+function (c) {
+if (this.fmt != 'c') {
+throw  new IllegalArgumentException ();
+}var r = "" + c;
+return this.pad (r);
+}, "~S");
+Clazz_defineMethod (c$, "form", 
+function (s) {
+if (this.fmt != 's') {
+throw  new IllegalArgumentException ();
+}if (this.precision >= 0) {
+s = s.substring (0, this.precision);
+}return this.pad (s);
+}, "~S");
+c$.repeat = Clazz_defineMethod (c$, "repeat", 
+ function (c, n) {
+if (n <= 0) {
+return "";
+}var s =  new StringBuffer (n);
+for (var i = 0; i < n; i++) {
+s.append (c);
+}
+return s.toString ();
+}, "~S,~N");
+c$.convert = Clazz_defineMethod (c$, "convert", 
+ function (x, n, m, d) {
+if (x == 0) {
+return "0";
+}var r = "";
+while (x != 0) {
+r = d.charAt ((x & m)) + r;
+x = x >>> n;
+}
+return r;
+}, "~N,~N,~N,~S");
+Clazz_defineMethod (c$, "pad", 
+ function (r) {
+var p = jalview.util.Format.repeat (' ', this.width - r.length);
+if (this.left_align) {
+return this.pre + r + p + this.post;
+} else {
+return this.pre + p + r + this.post;
+}}, "~S");
+Clazz_defineMethod (c$, "sign", 
+ function (s, r) {
+var p = "";
+if (s < 0) {
+p = "-";
+} else if (s > 0) {
+if (this.show_plus) {
+p = "+";
+} else if (this.show_space) {
+p = " ";
+}} else {
+if ((this.fmt == 'o') && this.alternate && (r.length > 0) && (r.charAt (0) != '0')) {
+p = "0";
+} else if ((this.fmt == 'x') && this.alternate) {
+p = "0x";
+} else if ((this.fmt == 'X') && this.alternate) {
+p = "0X";
+}}var w = 0;
+if (this.leading_zeroes) {
+w = this.width;
+} else if (((this.fmt == 'd') || (this.fmt == 'i') || (this.fmt == 'x') || (this.fmt == 'X') || (this.fmt == 'o')) && (this.precision > 0)) {
+w = this.precision;
+}return p + jalview.util.Format.repeat ('0', w - p.length - r.length) + r;
+}, "~N,~S");
+Clazz_defineMethod (c$, "fixed_format", 
+ function (d) {
+var removeTrailing = ((this.fmt == 'G') || (this.fmt == 'g')) && !this.alternate;
+if (d > 0x7FFFFFFFFFFFFFFF) {
+return this.exp_format (d);
+}if (this.precision == 0) {
+return Clazz_doubleToLong (d + 0.5) + (removeTrailing ? "" : ".");
+}var whole = Clazz_doubleToLong (d);
+var fr = d - whole;
+if ((fr >= 1) || (fr < 0)) {
+return this.exp_format (d);
+}var factor = 1;
+var leading_zeroes = "";
+for (var i = 1; (i <= this.precision) && (factor <= 0x7FFFFFFFFFFFFFFF); i++) {
+factor *= 10;
+leading_zeroes = leading_zeroes + "0";
+}
+var l = Clazz_doubleToLong ((factor * fr) + 0.5);
+if (l >= factor) {
+l = 0;
+whole++;
+}var z = leading_zeroes + l;
+z = "." + z.substring (z.length - this.precision, z.length);
+if (removeTrailing) {
+var t = z.length - 1;
+while ((t >= 0) && (z.charAt (t) == '0')) {
+t--;
+}
+if ((t >= 0) && (z.charAt (t) == '.')) {
+t--;
+}z = z.substring (0, t + 1);
+}return whole + z;
+}, "~N");
+Clazz_defineMethod (c$, "exp_format", 
+ function (d) {
+var f = "";
+var e = 0;
+var dd = d;
+var factor = 1;
+if (d != 0) {
+while (dd > 10) {
+e++;
+factor /= 10;
+dd = dd / 10;
+}
+while (dd < 1) {
+e--;
+factor *= 10;
+dd = dd * 10;
+}
+}if (((this.fmt == 'g') || (this.fmt == 'G')) && (e >= -4) && (e < this.precision)) {
+return this.fixed_format (d);
+}d = d * factor;
+f = f + this.fixed_format (d);
+if ((this.fmt == 'e') || (this.fmt == 'g')) {
+f = f + "e";
+} else {
+f = f + "E";
+}var p = "000";
+if (e >= 0) {
+f = f + "+";
+p = p + e;
+} else {
+f = f + "-";
+p = p + (-e);
+}return f + p.substring (p.length - 3, p.length);
+}, "~N");
+Clazz_overrideMethod (c$, "toString", 
+function () {
+return this.formatString;
+});
+});
+Clazz_declarePackage ("jalview.util");
+Clazz_load (["java.util.Iterator"], "jalview.util.ReverseListIterator", null, function () {
+c$ = Clazz_decorateAsClass (function () {
+this.iterator = null;
+Clazz_instantialize (this, arguments);
+}, jalview.util, "ReverseListIterator", null, java.util.Iterator);
+Clazz_makeConstructor (c$, 
+function (stuff) {
+this.iterator = stuff.listIterator (stuff.size ());
+}, "java.util.List");
+Clazz_overrideMethod (c$, "hasNext", 
+function () {
+return this.iterator.hasPrevious ();
+});
+Clazz_overrideMethod (c$, "next", 
+function () {
+return this.iterator.previous ();
+});
+Clazz_overrideMethod (c$, "remove", 
+function () {
+this.iterator.remove ();
+});
+});
+Clazz_declarePackage ("jalview.commands");
+Clazz_load (["jalview.commands.CommandI"], "jalview.commands.OrderCommand", ["jalview.analysis.AlignmentSorter"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.description = null;
+this.seqs = null;
+this.seqs2 = null;
+this.al = null;
+Clazz_instantialize (this, arguments);
+}, jalview.commands, "OrderCommand", null, jalview.commands.CommandI);
+Clazz_makeConstructor (c$, 
+function (description, seqs, al) {
+this.description = description;
+this.seqs = seqs;
+this.seqs2 = al.getSequencesArray ();
+this.al = al;
+this.doCommand (null);
+}, "~S,~A,jalview.datamodel.AlignmentI");
+Clazz_overrideMethod (c$, "getDescription", 
+function () {
+return this.description;
+});
+Clazz_overrideMethod (c$, "getSize", 
+function () {
+return 1;
+});
+Clazz_overrideMethod (c$, "doCommand", 
+function (views) {
+jalview.analysis.AlignmentSorter.setOrder (this.al, this.seqs2);
+}, "~A");
+Clazz_overrideMethod (c$, "undoCommand", 
+function (views) {
+jalview.analysis.AlignmentSorter.setOrder (this.al, this.seqs);
+}, "~A");
+Clazz_defineMethod (c$, "getSequenceOrder", 
+function (undo) {
+return undo ? this.seqs : this.seqs2;
+}, "~B");
+});
+Clazz_declarePackage ("jalview.datamodel");
+Clazz_load (null, "jalview.datamodel.AlignmentOrder", ["java.lang.Error", "java.util.ArrayList", "$.Arrays"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.Type = 0;
+this.Name = null;
+this.Order = null;
+Clazz_instantialize (this, arguments);
+}, jalview.datamodel, "AlignmentOrder");
+Clazz_makeConstructor (c$, 
+function () {
+});
+Clazz_makeConstructor (c$, 
+function (anOrder) {
+this.Order = anOrder;
+}, "java.util.List");
+Clazz_makeConstructor (c$, 
+function (orderFrom) {
+this.Order =  new java.util.ArrayList ();
+for (var seq, $seq = orderFrom.getSequences ().iterator (); $seq.hasNext () && ((seq = $seq.next ()) || true);) {
+this.Order.add (seq);
+}
+}, "jalview.datamodel.AlignmentI");
+Clazz_makeConstructor (c$, 
+function (orderFrom) {
+this.Order =  new java.util.ArrayList (java.util.Arrays.asList (orderFrom));
+}, "~A");
+Clazz_defineMethod (c$, "setType", 
+function (Type) {
+this.Type = Type;
+}, "~N");
+Clazz_defineMethod (c$, "getType", 
+function () {
+return this.Type;
+});
+Clazz_defineMethod (c$, "setName", 
+function (Name) {
+this.Name = Name;
+}, "~S");
+Clazz_defineMethod (c$, "getName", 
+function () {
+return this.Name;
+});
+Clazz_defineMethod (c$, "setOrder", 
+function (Order) {
+this.Order = Order;
+}, "java.util.List");
+Clazz_defineMethod (c$, "getOrder", 
+function () {
+return this.Order;
+});
+Clazz_defineMethod (c$, "updateSequence", 
+function (oldref, newref) {
+var found = this.Order.indexOf (oldref);
+if (found > -1) {
+this.Order.set (found, newref);
+}return found > -1;
+}, "jalview.datamodel.SequenceI,jalview.datamodel.SequenceI");
+Clazz_defineMethod (c$, "equals", 
+function (o) {
+if (o == null || !(Clazz_instanceOf (o, jalview.datamodel.AlignmentOrder))) {
+return false;
+}return this.equals (o, true);
+}, "~O");
+Clazz_defineMethod (c$, "equals", 
+function (o, identity) {
+if (o !== this) {
+if (o == null) {
+return false;
+}if (this.Order != null && o.Order != null && this.Order.size () == o.Order.size ()) {
+if (!identity) {
+throw  new Error ("Weak sequenceI equivalence not yet implemented.");
+} else {
+for (var i = 0, j = o.Order.size (); i < j; i++) {
+if (this.Order.get (i) !== o.Order.get (i)) {
+return false;
+}}
+}} else {
+return false;
+}}return true;
+}, "jalview.datamodel.AlignmentOrder,~B");
+Clazz_defineMethod (c$, "isConsistent", 
+function (o) {
+return this.isConsistent (o, true);
+}, "jalview.datamodel.AlignmentOrder");
+Clazz_defineMethod (c$, "isConsistent", 
+function (o, identity) {
+if (o !== this) {
+if (o == null) {
+return false;
+}if (this.Order != null && o.Order != null) {
+var c;
+var s;
+if (o.Order.size () > this.Order.size ()) {
+c = o.Order;
+s = this.Order;
+} else {
+c = this.Order;
+s = o.Order;
+}if (!identity) {
+throw  new Error ("Weak sequenceI equivalence not yet implemented.");
+} else {
+var last = -1;
+for (var i = 0, j = s.size (); i < j; i++) {
+var pos = c.indexOf (s.get (i));
+if (pos > last) {
+last = pos;
+} else {
+return false;
+}}
+}} else {
+return false;
+}}return true;
+}, "jalview.datamodel.AlignmentOrder,~B");
+Clazz_defineStatics (c$,
+"FILE", 0,
+"MSA", 1,
+"USER", 2);
+});
+Clazz_declarePackage ("jalview.datamodel");
+Clazz_load (["java.util.Vector"], "jalview.datamodel.ColumnSelection", ["jalview.util.ShiftList", "jalview.viewmodel.annotationfilter.AnnotationFilterParameter", "java.lang.StringBuffer", "java.util.ArrayList", "$.Collections"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.selected = null;
+this.hiddenColumns = null;
+Clazz_instantialize (this, arguments);
+}, jalview.datamodel, "ColumnSelection");
+Clazz_prepareFields (c$, function () {
+this.selected =  new java.util.Vector ();
+});
+Clazz_defineMethod (c$, "addElement", 
+function (col) {
+var column =  new Integer (col);
+if (!this.selected.contains (column)) {
+this.selected.addElement (column);
+}}, "~N");
+Clazz_defineMethod (c$, "clear", 
+function () {
+this.selected.removeAllElements ();
+});
+Clazz_defineMethod (c$, "removeElement", 
+function (col) {
+var colInt =  new Integer (col);
+if (this.selected.contains (colInt)) {
+this.selected.removeElement (colInt);
+}}, "~N");
+Clazz_defineMethod (c$, "removeElements", 
+function (start, end) {
+var colInt;
+for (var i = start; i < end; i++) {
+colInt =  new Integer (i);
+if (this.selected.contains (colInt)) {
+this.selected.removeElement (colInt);
+}}
+}, "~N,~N");
+Clazz_defineMethod (c$, "getSelected", 
+function () {
+return this.selected;
+});
+Clazz_defineMethod (c$, "contains", 
+function (col) {
+return this.selected.contains ( new Integer (col));
+}, "~N");
+Clazz_defineMethod (c$, "columnAt", 
+function (i) {
+return this.selected.elementAt (i).intValue ();
+}, "~N");
+Clazz_defineMethod (c$, "size", 
+function () {
+return this.selected.size ();
+});
+Clazz_defineMethod (c$, "getMax", 
+function () {
+var max = -1;
+for (var i = 0; i < this.selected.size (); i++) {
+if (this.columnAt (i) > max) {
+max = this.columnAt (i);
+}}
+return max;
+});
+Clazz_defineMethod (c$, "getMin", 
+function () {
+var min = 1000000000;
+for (var i = 0; i < this.selected.size (); i++) {
+if (this.columnAt (i) < min) {
+min = this.columnAt (i);
+}}
+return min;
+});
+Clazz_defineMethod (c$, "compensateForEdit", 
+function (start, change) {
+var deletedHiddenColumns = null;
+for (var i = 0; i < this.size (); i++) {
+var temp = this.columnAt (i);
+if (temp >= start) {
+this.selected.setElementAt ( new Integer (temp - change), i);
+}}
+if (this.hiddenColumns != null) {
+deletedHiddenColumns =  new java.util.ArrayList ();
+var hSize = this.hiddenColumns.size ();
+for (var i = 0; i < hSize; i++) {
+var region = this.hiddenColumns.elementAt (i);
+if (region[0] > start && start + change > region[1]) {
+deletedHiddenColumns.add (region);
+this.hiddenColumns.removeElementAt (i);
+i--;
+hSize--;
+continue;
+}if (region[0] > start) {
+region[0] -= change;
+region[1] -= change;
+}if (region[0] < 0) {
+region[0] = 0;
+}}
+this.revealHiddenColumns (0);
+}return deletedHiddenColumns;
+}, "~N,~N");
+Clazz_defineMethod (c$, "compensateForDelEdits", 
+ function (start, change) {
+for (var i = 0; i < this.size (); i++) {
+var temp = this.columnAt (i);
+if (temp >= start) {
+this.selected.setElementAt ( new Integer (temp - change), i);
+}}
+if (this.hiddenColumns != null) {
+for (var i = 0; i < this.hiddenColumns.size (); i++) {
+var region = this.hiddenColumns.elementAt (i);
+if (region[0] >= start) {
+region[0] -= change;
+}if (region[1] >= start) {
+region[1] -= change;
+}if (region[1] < region[0]) {
+this.hiddenColumns.removeElementAt (i--);
+}if (region[0] < 0) {
+region[0] = 0;
+}if (region[1] < 0) {
+region[1] = 0;
+}}
+}}, "~N,~N");
+Clazz_defineMethod (c$, "compensateForEdits", 
+function (shiftrecord) {
+if (shiftrecord != null) {
+var shifts = shiftrecord.getShifts ();
+if (shifts != null && shifts.size () > 0) {
+var shifted = 0;
+for (var i = 0, j = shifts.size (); i < j; i++) {
+var sh = shifts.get (i);
+this.compensateForDelEdits (shifted + sh[0], sh[1]);
+shifted -= sh[1];
+}
+}return shiftrecord.getInverse ();
+}return null;
+}, "jalview.util.ShiftList");
+Clazz_defineMethod (c$, "pruneIntervalVector", 
+ function (shifts, intervals) {
+var pruned = false;
+var i = 0;
+var j = intervals.size () - 1;
+var s = 0;
+var t = shifts.size () - 1;
+var hr = intervals.elementAt (i);
+var sr = shifts.get (s);
+while (i <= j && s <= t) {
+var trailinghn = hr[1] >= sr[0];
+if (!trailinghn) {
+if (i < j) {
+hr = intervals.elementAt (++i);
+} else {
+i++;
+}continue;
+}var endshift = sr[0] + sr[1];
+if (endshift < hr[0] || endshift < sr[0]) {
+if (s < t) {
+sr = shifts.get (++s);
+} else {
+s++;
+}continue;
+}var leadinghn = hr[0] >= sr[0];
+var leadinghc = hr[0] < endshift;
+var trailinghc = hr[1] < endshift;
+if (leadinghn) {
+if (trailinghc) {
+intervals.removeElementAt (i);
+pruned = true;
+j--;
+if (i <= j) {
+hr = intervals.elementAt (i);
+}continue;
+}if (leadinghc) {
+hr[0] = endshift;
+leadinghn = !leadinghn;
+pruned = true;
+}}if (!leadinghn) {
+if (trailinghc) {
+if (trailinghn) {
+hr[1] = sr[0] - 1;
+pruned = true;
+}} else {
+if (s < t) {
+sr = shifts.get (++s);
+} else {
+s++;
+}continue;
+}}}
+return pruned;
+}, "java.util.List,java.util.Vector");
+Clazz_defineMethod (c$, "pruneColumnList", 
+ function (shifts, list) {
+var s = 0;
+var t = shifts.size ();
+var sr = shifts.get (s++);
+var pruned = false;
+var i = 0;
+var j = list.size ();
+while (i < j && s <= t) {
+var c = list.elementAt (i++).intValue ();
+if (sr[0] <= c) {
+if (sr[1] + sr[0] >= c) {
+list.removeElementAt (--i);
+j--;
+} else {
+if (s < t) {
+sr = shifts.get (s);
+}s++;
+}}}
+return pruned;
+}, "java.util.List,java.util.Vector");
+Clazz_defineMethod (c$, "pruneDeletions", 
+function (deletions) {
+if (deletions != null) {
+var shifts = deletions.getShifts ();
+if (shifts != null && shifts.size () > 0) {
+if (this.hiddenColumns != null) {
+this.pruneIntervalVector (shifts, this.hiddenColumns);
+if (this.hiddenColumns != null && this.hiddenColumns.size () == 0) {
+this.hiddenColumns = null;
+}}if (this.selected != null && this.selected.size () > 0) {
+this.pruneColumnList (shifts, this.selected);
+if (this.selected != null && this.selected.size () == 0) {
+this.selected = null;
+}}this.compensateForEdits (deletions);
+}}}, "jalview.util.ShiftList");
+Clazz_defineMethod (c$, "getHiddenColumns", 
+function () {
+return this.hiddenColumns == null ? java.util.Collections.emptyList () : this.hiddenColumns;
+});
+Clazz_defineMethod (c$, "adjustForHiddenColumns", 
+function (column) {
+var result = column;
+if (this.hiddenColumns != null) {
+for (var i = 0; i < this.hiddenColumns.size (); i++) {
+var region = this.hiddenColumns.elementAt (i);
+if (result >= region[0]) {
+result += region[1] - region[0] + 1;
+}}
+}return result;
+}, "~N");
+Clazz_defineMethod (c$, "findColumnPosition", 
+function (hiddenColumn) {
+var result = hiddenColumn;
+if (this.hiddenColumns != null) {
+var index = 0;
+var region;
+do {
+region = this.hiddenColumns.elementAt (index++);
+if (hiddenColumn > region[1]) {
+result -= region[1] + 1 - region[0];
+}} while ((hiddenColumn > region[1]) && (index < this.hiddenColumns.size ()));
+if (hiddenColumn > region[0] && hiddenColumn < region[1]) {
+return region[0] + hiddenColumn - result;
+}}return result;
+}, "~N");
+Clazz_defineMethod (c$, "findHiddenRegionPosition", 
+function (hiddenRegion) {
+var result = 0;
+if (this.hiddenColumns != null) {
+var index = 0;
+var gaps = 0;
+do {
+var region = this.hiddenColumns.elementAt (index);
+if (hiddenRegion == 0) {
+return region[0];
+}gaps += region[1] + 1 - region[0];
+result = region[1] + 1;
+index++;
+} while (index < hiddenRegion + 1);
+result -= gaps;
+}return result;
+}, "~N");
+Clazz_defineMethod (c$, "getHiddenBoundaryRight", 
+function (alPos) {
+if (this.hiddenColumns != null) {
+var index = 0;
+do {
+var region = this.hiddenColumns.elementAt (index);
+if (alPos < region[0]) {
+return region[0];
+}index++;
+} while (index < this.hiddenColumns.size ());
+}return alPos;
+}, "~N");
+Clazz_defineMethod (c$, "getHiddenBoundaryLeft", 
+function (alPos) {
+if (this.hiddenColumns != null) {
+var index = this.hiddenColumns.size () - 1;
+do {
+var region = this.hiddenColumns.elementAt (index);
+if (alPos > region[1]) {
+return region[1];
+}index--;
+} while (index > -1);
+}return alPos;
+}, "~N");
+Clazz_defineMethod (c$, "hideSelectedColumns", 
+function () {
+while (this.size () > 0) {
+var column = this.getSelected ().firstElement ().intValue ();
+this.hideColumns (column);
+}
+});
+Clazz_defineMethod (c$, "hideColumns", 
+function (start, end) {
+if (this.hiddenColumns == null) {
+this.hiddenColumns =  new java.util.Vector ();
+}var added = false;
+var overlap = false;
+for (var i = 0; i < this.hiddenColumns.size (); i++) {
+var region = this.hiddenColumns.elementAt (i);
+if (start <= region[1] && end >= region[0]) {
+this.hiddenColumns.removeElementAt (i);
+overlap = true;
+break;
+} else if (end < region[0] && start < region[0]) {
+this.hiddenColumns.insertElementAt ( Clazz_newIntArray (-1, [start, end]), i);
+added = true;
+break;
+}}
+if (overlap) {
+this.hideColumns (start, end);
+} else if (!added) {
+this.hiddenColumns.addElement ( Clazz_newIntArray (-1, [start, end]));
+}}, "~N,~N");
+Clazz_defineMethod (c$, "hideColumns", 
+function (col) {
+var min = col;
+var max = col + 1;
+while (this.contains (min)) {
+this.removeElement (min);
+min--;
+}
+while (this.contains (max)) {
+this.removeElement (max);
+max++;
+}
+min++;
+max--;
+if (min > max) {
+min = max;
+}this.hideColumns (min, max);
+}, "~N");
+Clazz_defineMethod (c$, "revealAllHiddenColumns", 
+function () {
+if (this.hiddenColumns != null) {
+for (var i = 0; i < this.hiddenColumns.size (); i++) {
+var region = this.hiddenColumns.elementAt (i);
+for (var j = region[0]; j < region[1] + 1; j++) {
+this.addElement (j);
+}
+}
+}this.hiddenColumns = null;
+});
+Clazz_defineMethod (c$, "revealHiddenColumns", 
+function (res) {
+for (var i = 0; i < this.hiddenColumns.size (); i++) {
+var region = this.hiddenColumns.elementAt (i);
+if (res == region[0]) {
+for (var j = region[0]; j < region[1] + 1; j++) {
+this.addElement (j);
+}
+this.hiddenColumns.removeElement (region);
+break;
+}}
+if (this.hiddenColumns.size () == 0) {
+this.hiddenColumns = null;
+}}, "~N");
+Clazz_defineMethod (c$, "isVisible", 
+function (column) {
+if (this.hiddenColumns != null) {
+for (var i = 0; i < this.hiddenColumns.size (); i++) {
+var region = this.hiddenColumns.elementAt (i);
+if (column >= region[0] && column <= region[1]) {
+return false;
+}}
+}return true;
+}, "~N");
+Clazz_makeConstructor (c$, 
+function (copy) {
+if (copy != null) {
+if (copy.selected != null) {
+this.selected =  new java.util.Vector ();
+for (var i = 0, j = copy.selected.size (); i < j; i++) {
+this.selected.addElement (copy.selected.elementAt (i));
+}
+}if (copy.hiddenColumns != null) {
+this.hiddenColumns =  new java.util.Vector (copy.hiddenColumns.size ());
+for (var i = 0, j = copy.hiddenColumns.size (); i < j; i++) {
+var rh;
+var cp;
+rh = copy.hiddenColumns.elementAt (i);
+if (rh != null) {
+cp =  Clazz_newIntArray (rh.length, 0);
+System.arraycopy (rh, 0, cp, 0, rh.length);
+this.hiddenColumns.addElement (cp);
+}}
+}}}, "jalview.datamodel.ColumnSelection");
+Clazz_makeConstructor (c$, 
+function () {
+});
+Clazz_defineMethod (c$, "getVisibleSequenceStrings", 
+function (start, end, seqs) {
+var i;
+var iSize = seqs.length;
+var selection =  new Array (iSize);
+if (this.hiddenColumns != null && this.hiddenColumns.size () > 0) {
+for (i = 0; i < iSize; i++) {
+var visibleSeq =  new StringBuffer ();
+var regions = this.getHiddenColumns ();
+var blockStart = start;
+var blockEnd = end;
+var region;
+var hideStart;
+var hideEnd;
+for (var j = 0; j < regions.size (); j++) {
+region = regions.get (j);
+hideStart = region[0];
+hideEnd = region[1];
+if (hideStart < start) {
+continue;
+}blockStart = Math.min (blockStart, hideEnd + 1);
+blockEnd = Math.min (blockEnd, hideStart);
+if (blockStart > blockEnd) {
+break;
+}visibleSeq.append (seqs[i].getSequence (blockStart, blockEnd));
+blockStart = hideEnd + 1;
+blockEnd = end;
+}
+if (end > blockStart) {
+visibleSeq.append (seqs[i].getSequence (blockStart, end));
+}selection[i] = visibleSeq.toString ();
+}
+} else {
+for (i = 0; i < iSize; i++) {
+selection[i] = seqs[i].getSequenceAsString (start, end);
+}
+}return selection;
+}, "~N,~N,~A");
+Clazz_defineMethod (c$, "getVisibleContigs", 
+function (start, end) {
+if (this.hiddenColumns != null && this.hiddenColumns.size () > 0) {
+var visiblecontigs =  new java.util.ArrayList ();
+var regions = this.getHiddenColumns ();
+var vstart = start;
+var region;
+var hideStart;
+var hideEnd;
+for (var j = 0; vstart < end && j < regions.size (); j++) {
+region = regions.get (j);
+hideStart = region[0];
+hideEnd = region[1];
+if (hideEnd < vstart) {
+continue;
+}if (hideStart > vstart) {
+visiblecontigs.add ( Clazz_newIntArray (-1, [vstart, hideStart - 1]));
+}vstart = hideEnd + 1;
+}
+if (vstart < end) {
+visiblecontigs.add ( Clazz_newIntArray (-1, [vstart, end - 1]));
+}var vcontigs =  Clazz_newIntArray (visiblecontigs.size () * 2, 0);
+for (var i = 0, j = visiblecontigs.size (); i < j; i++) {
+var vc = visiblecontigs.get (i);
+visiblecontigs.set (i, null);
+vcontigs[i * 2] = vc[0];
+vcontigs[i * 2 + 1] = vc[1];
+}
+visiblecontigs.clear ();
+return vcontigs;
+} else {
+return  Clazz_newIntArray (-1, [start, end - 1]);
+}}, "~N,~N");
+Clazz_defineMethod (c$, "makeVisibleAnnotation", 
+function (alignmentAnnotation) {
+this.makeVisibleAnnotation (-1, -1, alignmentAnnotation);
+}, "jalview.datamodel.AlignmentAnnotation");
+Clazz_defineMethod (c$, "makeVisibleAnnotation", 
+function (start, end, alignmentAnnotation) {
+if (alignmentAnnotation.annotations == null) {
+return;
+}if (start == end && end == -1) {
+start = 0;
+end = alignmentAnnotation.annotations.length;
+}if (this.hiddenColumns != null && this.hiddenColumns.size () > 0) {
+var annels =  new java.util.Vector ();
+var els = null;
+var regions = this.getHiddenColumns ();
+var blockStart = start;
+var blockEnd = end;
+var region;
+var hideStart;
+var hideEnd;
+var w = 0;
+for (var j = 0; j < regions.size (); j++) {
+region = regions.get (j);
+hideStart = region[0];
+hideEnd = region[1];
+if (hideStart < start) {
+continue;
+}blockStart = Math.min (blockStart, hideEnd + 1);
+blockEnd = Math.min (blockEnd, hideStart);
+if (blockStart > blockEnd) {
+break;
+}annels.addElement (els =  new Array (blockEnd - blockStart));
+System.arraycopy (alignmentAnnotation.annotations, blockStart, els, 0, els.length);
+w += els.length;
+blockStart = hideEnd + 1;
+blockEnd = end;
+}
+if (end > blockStart) {
+annels.addElement (els =  new Array (end - blockStart + 1));
+if ((els.length + blockStart) <= alignmentAnnotation.annotations.length) {
+System.arraycopy (alignmentAnnotation.annotations, blockStart, els, 0, els.length);
+} else {
+System.arraycopy (alignmentAnnotation.annotations, blockStart, els, 0, (alignmentAnnotation.annotations.length - blockStart));
+}w += els.length;
+}if (w == 0) {
+return;
+}alignmentAnnotation.annotations =  new Array (w);
+w = 0;
+for (var chnk, $chnk = annels.iterator (); $chnk.hasNext () && ((chnk = $chnk.next ()) || true);) {
+System.arraycopy (chnk, 0, alignmentAnnotation.annotations, w, chnk.length);
+w += chnk.length;
+}
+} else {
+alignmentAnnotation.restrict (start, end);
+}}, "~N,~N,jalview.datamodel.AlignmentAnnotation");
+Clazz_defineMethod (c$, "invertColumnSelection", 
+function (first, width) {
+var hasHidden = this.hiddenColumns != null && this.hiddenColumns.size () > 0;
+for (var i = first; i < width; i++) {
+if (this.contains (i)) {
+this.removeElement (i);
+} else {
+if (!hasHidden || this.isVisible (i)) {
+this.addElement (i);
+}}}
+}, "~N,~N");
+Clazz_defineMethod (c$, "addElementsFrom", 
+function (colsel) {
+if (colsel != null && colsel.size () > 0) {
+for (var col, $col = colsel.getSelected ().iterator (); $col.hasNext () && ((col = $col.next ()) || true);) {
+if (this.hiddenColumns != null && this.isVisible (col.intValue ())) {
+if (!this.selected.contains (col)) {
+this.selected.addElement (col);
+}}}
+}}, "jalview.datamodel.ColumnSelection");
+Clazz_defineMethod (c$, "setElementsFrom", 
+function (colsel) {
+this.selected =  new java.util.Vector ();
+if (colsel.selected != null && colsel.selected.size () > 0) {
+if (this.hiddenColumns != null && this.hiddenColumns.size () > 0) {
+this.addElementsFrom (colsel);
+} else {
+for (var col, $col = colsel.getSelected ().iterator (); $col.hasNext () && ((col = $col.next ()) || true);) {
+this.addElement ((col).intValue ());
+}
+}}}, "jalview.datamodel.ColumnSelection");
+c$.propagateInsertions = Clazz_defineMethod (c$, "propagateInsertions", 
+function (profileseq, al, input) {
+var profsqpos = 0;
+var gc = al.getGapCharacter ();
+var alandcolsel = input.getAlignmentAndColumnSelection (gc);
+var nview = alandcolsel[1];
+var origseq = (alandcolsel[0])[profsqpos];
+nview.propagateInsertions (profileseq, al, origseq);
+return nview;
+}, "jalview.datamodel.SequenceI,jalview.datamodel.AlignmentI,jalview.datamodel.AlignmentView");
+Clazz_defineMethod (c$, "propagateInsertions", 
+function (profileseq, al, origseq) {
+var gc = al.getGapCharacter ();
+this.pruneDeletions (jalview.util.ShiftList.parseMap (origseq.gapMap ()));
+var viscontigs = this.getVisibleContigs (0, profileseq.getLength ());
+var spos = 0;
+var offset = 0;
+for (var v = 0; v < viscontigs.length; v += 2) {
+if (viscontigs[v] > spos) {
+var sb =  new StringBuffer ();
+for (var s = 0, ns = viscontigs[v] - spos; s < ns; s++) {
+sb.append (gc);
+}
+for (var s = 0, ns = al.getHeight (); s < ns; s++) {
+var sqobj = al.getSequenceAt (s);
+if (sqobj !== profileseq) {
+var sq = al.getSequenceAt (s).getSequenceAsString ();
+if (sq.length <= spos + offset) {
+var diff = spos + offset - sq.length - 1;
+if (diff > 0) {
+sq = sq + sb;
+while ((diff = spos + offset - sq.length - 1) > 0) {
+if (diff >= sb.length ()) {
+sq += sb.toString ();
+} else {
+var buf =  Clazz_newCharArray (diff, '\0');
+sb.getChars (0, diff, buf, 0);
+sq += buf.toString ();
+}}
+}sq += sb.toString ();
+} else {
+al.getSequenceAt (s).setSequence (sq.substring (0, spos + offset) + sb.toString () + sq.substring (spos + offset));
+}}}
+}spos = viscontigs[v + 1] + 1;
+}
+if ((offset + spos) < profileseq.getLength ()) {
+var sb =  new StringBuffer ();
+for (var s = 0, ns = profileseq.getLength () - spos - offset; s < ns; s++) {
+sb.append (gc);
+}
+for (var s = 0, ns = al.getHeight (); s < ns; s++) {
+var sqobj = al.getSequenceAt (s);
+if (sqobj === profileseq) {
+continue;
+}var sq = sqobj.getSequenceAsString ();
+var diff = origseq.getLength () - sq.length;
+while (diff > 0) {
+if (diff >= sb.length ()) {
+sq += sb.toString ();
+} else {
+var buf =  Clazz_newCharArray (diff, '\0');
+sb.getChars (0, diff, buf, 0);
+sq += buf.toString ();
+}diff = origseq.getLength () - sq.length;
+}
+}
+}}, "jalview.datamodel.SequenceI,jalview.datamodel.AlignmentI,jalview.datamodel.SequenceI");
+Clazz_defineMethod (c$, "hasSelectedColumns", 
+function () {
+return (this.selected != null && this.selected.size () > 0);
+});
+Clazz_defineMethod (c$, "hasHiddenColumns", 
+function () {
+return this.hiddenColumns != null && this.hiddenColumns.size () > 0;
+});
+Clazz_defineMethod (c$, "hasManyHiddenColumns", 
+function () {
+return this.hiddenColumns != null && this.hiddenColumns.size () > 1;
+});
+Clazz_defineMethod (c$, "hideInsertionsFor", 
+function (sr) {
+var inserts = sr.getInsertions ();
+for (var r, $r = inserts.iterator (); $r.hasNext () && ((r = $r.next ()) || true);) {
+this.hideColumns (r[0], r[1]);
+}
+}, "jalview.datamodel.SequenceI");
+Clazz_defineMethod (c$, "filterAnnotations", 
+function (annotations, filterParams) {
+this.revealAllHiddenColumns ();
+this.clear ();
+var count = 0;
+do {
+if (annotations[count] != null) {
+var itemMatched = false;
+if (filterParams.getThresholdType () === jalview.viewmodel.annotationfilter.AnnotationFilterParameter.ThresholdType.ABOVE_THRESHOLD && annotations[count].value >= filterParams.getThresholdValue ()) {
+itemMatched = true;
+}if (filterParams.getThresholdType () === jalview.viewmodel.annotationfilter.AnnotationFilterParameter.ThresholdType.BELOW_THRESHOLD && annotations[count].value <= filterParams.getThresholdValue ()) {
+itemMatched = true;
+}if (filterParams.isFilterAlphaHelix () && annotations[count].secondaryStructure == 'H') {
+itemMatched = true;
+}if (filterParams.isFilterBetaSheet () && annotations[count].secondaryStructure == 'E') {
+itemMatched = true;
+}if (filterParams.isFilterTurn () && annotations[count].secondaryStructure == 'S') {
+itemMatched = true;
+}var regexSearchString = filterParams.getRegexString ();
+if (regexSearchString != null && !filterParams.getRegexSearchFields ().isEmpty ()) {
+var fields = filterParams.getRegexSearchFields ();
+try {
+if (fields.contains (jalview.viewmodel.annotationfilter.AnnotationFilterParameter.SearchableAnnotationField.DISPLAY_STRING) && annotations[count].displayCharacter.matches (regexSearchString)) {
+itemMatched = true;
+}} catch (pse) {
+if (Clazz_exceptionOf (pse, java.util.regex.PatternSyntaxException)) {
+if (annotations[count].displayCharacter.equals (regexSearchString)) {
+itemMatched = true;
+}} else {
+throw pse;
+}
+}
+if (fields.contains (jalview.viewmodel.annotationfilter.AnnotationFilterParameter.SearchableAnnotationField.DESCRIPTION) && annotations[count].description != null && annotations[count].description.matches (regexSearchString)) {
+itemMatched = true;
+}}if (itemMatched) {
+this.addElement (count);
+}}count++;
+} while (count < annotations.length);
+return false;
+}, "~A,jalview.viewmodel.annotationfilter.AnnotationFilterParameter");
+});
+Clazz_declarePackage ("jalview.util");
+Clazz_load (null, "jalview.util.ShiftList", ["java.util.ArrayList"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.shifts = null;
+Clazz_instantialize (this, arguments);
+}, jalview.util, "ShiftList");
+Clazz_makeConstructor (c$, 
+function () {
+this.shifts =  new java.util.ArrayList ();
+});
+Clazz_defineMethod (c$, "addShift", 
+function (pos, shift) {
+{
+var sidx = 0;
+var rshift = null;
+while (sidx < this.shifts.size () && (rshift = this.shifts.get (sidx))[0] < pos) {
+sidx++;
+}
+if (sidx == this.shifts.size ()) {
+this.shifts.add (sidx,  Clazz_newIntArray (-1, [pos, shift]));
+} else {
+rshift[1] += shift;
+}}}, "~N,~N");
+Clazz_defineMethod (c$, "shift", 
+function (pos) {
+if (this.shifts.size () == 0) {
+return pos;
+}var shifted = pos;
+var sidx = 0;
+var rshift;
+while (sidx < this.shifts.size () && (rshift = (this.shifts.get (sidx++)))[0] <= pos) {
+shifted += rshift[1];
+}
+return shifted;
+}, "~N");
+Clazz_defineMethod (c$, "clear", 
+function () {
+this.shifts.clear ();
+});
+Clazz_defineMethod (c$, "getInverse", 
+function () {
+var inverse =  new jalview.util.ShiftList ();
+{
+if (this.shifts != null) {
+for (var sh, $sh = this.shifts.iterator (); $sh.hasNext () && ((sh = $sh.next ()) || true);) {
+if (sh != null) {
+inverse.shifts.add ( Clazz_newIntArray (-1, [sh[0], -sh[1]]));
+}}
+}}return inverse;
+});
+c$.parseMap = Clazz_defineMethod (c$, "parseMap", 
+function (gapMap) {
+var shiftList = null;
+if (gapMap != null && gapMap.length > 0) {
+shiftList =  new jalview.util.ShiftList ();
+for (var i = 0, p = 0; i < gapMap.length; p++, i++) {
+if (p != gapMap[i]) {
+shiftList.addShift (p, gapMap[i] - p);
+p = gapMap[i];
+}}
+}return shiftList;
+}, "~A");
+Clazz_defineMethod (c$, "getShifts", 
+function () {
+return this.shifts;
+});
+});
+Clazz_declarePackage ("jalview.viewmodel.annotationfilter");
+Clazz_load (["java.lang.Enum", "java.util.ArrayList"], "jalview.viewmodel.annotationfilter.AnnotationFilterParameter", null, function () {
+c$ = Clazz_decorateAsClass (function () {
+this.thresholdType = null;
+this.thresholdValue = 0;
+this.filterAlphaHelix = false;
+this.filterBetaSheet = false;
+this.filterTurn = false;
+this.regexString = null;
+this.regexSearchFields = null;
+Clazz_instantialize (this, arguments);
+}, jalview.viewmodel.annotationfilter, "AnnotationFilterParameter");
+Clazz_prepareFields (c$, function () {
+this.regexSearchFields =  new java.util.ArrayList ();
+});
+Clazz_defineMethod (c$, "getThresholdType", 
+function () {
+return this.thresholdType;
+});
+Clazz_defineMethod (c$, "setThresholdType", 
+function (thresholdType) {
+this.thresholdType = thresholdType;
+}, "jalview.viewmodel.annotationfilter.AnnotationFilterParameter.ThresholdType");
+Clazz_defineMethod (c$, "getThresholdValue", 
+function () {
+return this.thresholdValue;
+});
+Clazz_defineMethod (c$, "setThresholdValue", 
+function (thresholdValue) {
+this.thresholdValue = thresholdValue;
+}, "~N");
+Clazz_defineMethod (c$, "getRegexString", 
+function () {
+return this.regexString;
+});
+Clazz_defineMethod (c$, "setRegexString", 
+function (regexString) {
+this.regexString = regexString;
+}, "~S");
+Clazz_defineMethod (c$, "getRegexSearchFields", 
+function () {
+return this.regexSearchFields;
+});
+Clazz_defineMethod (c$, "addRegexSearchField", 
+function (regexSearchField) {
+this.regexSearchFields.add (regexSearchField);
+}, "jalview.viewmodel.annotationfilter.AnnotationFilterParameter.SearchableAnnotationField");
+Clazz_defineMethod (c$, "isFilterAlphaHelix", 
+function () {
+return this.filterAlphaHelix;
+});
+Clazz_defineMethod (c$, "setFilterAlphaHelix", 
+function (alphaHelix) {
+this.filterAlphaHelix = alphaHelix;
+}, "~B");
+Clazz_defineMethod (c$, "isFilterBetaSheet", 
+function () {
+return this.filterBetaSheet;
+});
+Clazz_defineMethod (c$, "setFilterBetaSheet", 
+function (betaSheet) {
+this.filterBetaSheet = betaSheet;
+}, "~B");
+Clazz_defineMethod (c$, "isFilterTurn", 
+function () {
+return this.filterTurn;
+});
+Clazz_defineMethod (c$, "setFilterTurn", 
+function (turn) {
+this.filterTurn = turn;
+}, "~B");
+Clazz_pu$h(self.c$);
+c$ = Clazz_declareType (jalview.viewmodel.annotationfilter.AnnotationFilterParameter, "ThresholdType", Enum);
+Clazz_defineEnumConstant (c$, "NO_THRESHOLD", 0, []);
+Clazz_defineEnumConstant (c$, "BELOW_THRESHOLD", 1, []);
+Clazz_defineEnumConstant (c$, "ABOVE_THRESHOLD", 2, []);
+c$ = Clazz_p0p ();
+Clazz_pu$h(self.c$);
+c$ = Clazz_declareType (jalview.viewmodel.annotationfilter.AnnotationFilterParameter, "SearchableAnnotationField", Enum);
+Clazz_defineEnumConstant (c$, "DISPLAY_STRING", 0, []);
+Clazz_defineEnumConstant (c$, "DESCRIPTION", 1, []);
+c$ = Clazz_p0p ();
+});
+Clazz_declarePackage ("jalview.datamodel");
+Clazz_load (["java.util.ArrayList"], "jalview.datamodel.SearchResults", ["java.lang.StringBuilder", "java.util.Arrays"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.matches = null;
+if (!Clazz_isClassDefined ("jalview.datamodel.SearchResults.Match")) {
+jalview.datamodel.SearchResults.$SearchResults$Match$ ();
+}
+Clazz_instantialize (this, arguments);
+}, jalview.datamodel, "SearchResults");
+Clazz_prepareFields (c$, function () {
+this.matches =  new java.util.ArrayList ();
+});
+Clazz_defineMethod (c$, "addResult", 
+function (seq, start, end) {
+this.matches.add (Clazz_innerTypeInstance (jalview.datamodel.SearchResults.Match, this, null, seq, start, end));
+}, "jalview.datamodel.SequenceI,~N,~N");
+Clazz_defineMethod (c$, "involvesSequence", 
+function (sequence) {
+var ds = sequence.getDatasetSequence ();
+for (var m, $m = this.matches.iterator (); $m.hasNext () && ((m = $m.next ()) || true);) {
+if (m.sequence != null && (m.sequence === sequence || m.sequence === ds)) {
+return true;
+}}
+return false;
+}, "jalview.datamodel.SequenceI");
+Clazz_defineMethod (c$, "getResults", 
+function (sequence, start, end) {
+if (this.matches.isEmpty ()) {
+return null;
+}var result = null;
+var tmp = null;
+var resultLength;
+var matchStart = 0;
+var matchEnd = 0;
+var mfound;
+for (var m, $m = this.matches.iterator (); $m.hasNext () && ((m = $m.next ()) || true);) {
+mfound = false;
+if (m.sequence === sequence) {
+mfound = true;
+matchStart = sequence.findIndex (m.start) - 1;
+matchEnd = sequence.findIndex (m.end) - 1;
+} else if (m.sequence === sequence.getDatasetSequence ()) {
+mfound = true;
+matchStart = sequence.findIndex (m.start) - 1;
+matchEnd = sequence.findIndex (m.end) - 1;
+}if (mfound) {
+if (matchStart <= end && matchEnd >= start) {
+if (matchStart < start) {
+matchStart = start;
+}if (matchEnd > end) {
+matchEnd = end;
+}if (result == null) {
+result =  Clazz_newIntArray (-1, [matchStart, matchEnd]);
+} else {
+resultLength = result.length;
+tmp =  Clazz_newIntArray (resultLength + 2, 0);
+System.arraycopy (result, 0, tmp, 0, resultLength);
+result = tmp;
+result[resultLength] = matchStart;
+result[resultLength + 1] = matchEnd;
+}} else {
+}}}
+return result;
+}, "jalview.datamodel.SequenceI,~N,~N");
+Clazz_defineMethod (c$, "getSize", 
+function () {
+return this.matches.size ();
+});
+Clazz_defineMethod (c$, "getResultSequence", 
+function (index) {
+return this.matches.get (index).sequence;
+}, "~N");
+Clazz_defineMethod (c$, "getResultStart", 
+function (i) {
+return this.matches.get (i).start;
+}, "~N");
+Clazz_defineMethod (c$, "getResultEnd", 
+function (i) {
+return this.matches.get (i).end;
+}, "~N");
+Clazz_defineMethod (c$, "isEmpty", 
+function () {
+return this.matches.isEmpty ();
+});
+Clazz_defineMethod (c$, "getResults", 
+function () {
+return this.matches;
+});
+Clazz_overrideMethod (c$, "toString", 
+function () {
+var result =  new StringBuilder (256);
+for (var m, $m = this.matches.iterator (); $m.hasNext () && ((m = $m.next ()) || true);) {
+result.append (m.toString ());
+}
+return result.toString ();
+});
+c$.$SearchResults$Match$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_decorateAsClass (function () {
+Clazz_prepareCallback (this, arguments);
+this.sequence = null;
+this.start = 0;
+this.end = 0;
+Clazz_instantialize (this, arguments);
+}, jalview.datamodel.SearchResults, "Match");
+Clazz_makeConstructor (c$, 
+function (a, b, c) {
+this.sequence = a;
+this.start = b;
+this.end = c;
+}, "jalview.datamodel.SequenceI,~N,~N");
+Clazz_defineMethod (c$, "getSequence", 
+function () {
+return this.sequence;
+});
+Clazz_defineMethod (c$, "getStart", 
+function () {
+return this.start;
+});
+Clazz_defineMethod (c$, "getEnd", 
+function () {
+return this.end;
+});
+Clazz_overrideMethod (c$, "toString", 
+function () {
+var a = this.sequence.getSequence ();
+var b = Math.max (this.start - 1, 0);
+var c = Math.min (this.end, a.length + 1);
+return String.valueOf (java.util.Arrays.copyOfRange (a, b, c));
+});
+Clazz_defineMethod (c$, "setSequence", 
+function (a) {
+this.sequence = a;
+}, "jalview.datamodel.SequenceI");
+c$ = Clazz_p0p ();
+};
+});
+Clazz_declarePackage ("jalview.datamodel");
+Clazz_load (["jalview.datamodel.AnnotatedCollectionI", "java.awt.Color", "java.util.ArrayList"], "jalview.datamodel.SequenceGroup", ["jalview.analysis.AAFrequency", "$.Conservation", "jalview.datamodel.AlignmentAnnotation", "$.Sequence", "jalview.schemes.ResidueProperties", "jalview.util.Comparison", "java.lang.StringBuffer"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.groupName = null;
+this.description = null;
+this.conserve = null;
+this.aaFrequency = null;
+this.displayBoxes = true;
+this.displayText = true;
+this.colourText = false;
+this.showNonconserved = false;
+this.sequences = null;
+this.seqrep = null;
+this.width = -1;
+this.cs = null;
+this.startRes = 0;
+this.endRes = 0;
+this.outlineColour = null;
+this.idColour = null;
+this.thresholdTextColour = 0;
+this.textColour = null;
+this.textColour2 = null;
+this.ignoreGapsInConsensus = true;
+this.showSequenceLogo = false;
+this.normaliseSequenceLogo = false;
+this.consPercGaps = 25;
+this.consensusData = null;
+this.hidereps = false;
+this.hidecols = false;
+this.consensus = null;
+this.conservation = null;
+this.showConsensusHistogram = false;
+this.context = null;
+Clazz_instantialize (this, arguments);
+}, jalview.datamodel, "SequenceGroup", null, jalview.datamodel.AnnotatedCollectionI);
+Clazz_prepareFields (c$, function () {
+this.sequences =  new java.util.ArrayList ();
+this.outlineColour = java.awt.Color.black;
+this.textColour = java.awt.Color.black;
+this.textColour2 = java.awt.Color.white;
+});
+Clazz_defineMethod (c$, "isShowSequenceLogo", 
+function () {
+return this.showSequenceLogo;
+});
+Clazz_makeConstructor (c$, 
+function () {
+this.groupName = "JGroup:" + this.hashCode ();
+});
+Clazz_makeConstructor (c$, 
+function (sequences, groupName, scheme, displayBoxes, displayText, colourText, start, end) {
+this.sequences = sequences;
+this.groupName = groupName;
+this.displayBoxes = displayBoxes;
+this.displayText = displayText;
+this.colourText = colourText;
+this.cs = scheme;
+this.startRes = start;
+this.endRes = end;
+this.recalcConservation ();
+}, "java.util.List,~S,jalview.schemes.ColourSchemeI,~B,~B,~B,~N,~N");
+Clazz_makeConstructor (c$, 
+function (seqsel) {
+if (seqsel != null) {
+this.sequences =  new java.util.ArrayList ();
+this.sequences.addAll (seqsel.sequences);
+if (seqsel.groupName != null) {
+this.groupName =  String.instantialize (seqsel.groupName);
+}this.displayBoxes = seqsel.displayBoxes;
+this.displayText = seqsel.displayText;
+this.colourText = seqsel.colourText;
+this.startRes = seqsel.startRes;
+this.endRes = seqsel.endRes;
+this.cs = seqsel.cs;
+if (seqsel.description != null) {
+this.description =  String.instantialize (seqsel.description);
+}this.hidecols = seqsel.hidecols;
+this.hidereps = seqsel.hidereps;
+this.idColour = seqsel.idColour;
+this.outlineColour = seqsel.outlineColour;
+this.seqrep = seqsel.seqrep;
+this.textColour = seqsel.textColour;
+this.textColour2 = seqsel.textColour2;
+this.thresholdTextColour = seqsel.thresholdTextColour;
+this.width = seqsel.width;
+this.ignoreGapsInConsensus = seqsel.ignoreGapsInConsensus;
+if (seqsel.conserve != null) {
+this.recalcConservation ();
+}}}, "jalview.datamodel.SequenceGroup");
+Clazz_defineMethod (c$, "getSelectionAsNewSequences", 
+function (align) {
+var iSize = this.sequences.size ();
+var seqs =  new Array (iSize);
+var inorder = this.getSequencesInOrder (align);
+for (var i = 0, ipos = 0; i < inorder.length; i++) {
+var seq = inorder[i];
+seqs[ipos] = seq.getSubSequence (this.startRes, this.endRes + 1);
+if (seqs[ipos] != null) {
+seqs[ipos].setDescription (seq.getDescription ());
+seqs[ipos].setDBRef (seq.getDBRef ());
+seqs[ipos].setSequenceFeatures (seq.getSequenceFeatures ());
+if (seq.getDatasetSequence () != null) {
+seqs[ipos].setDatasetSequence (seq.getDatasetSequence ());
+}if (seq.getAnnotation () != null) {
+var alann = align.getAlignmentAnnotation ();
+for (var a = 0; a < seq.getAnnotation ().length; a++) {
+var tocopy = seq.getAnnotation ()[a];
+if (alann != null) {
+var found = false;
+for (var pos = 0; pos < alann.length; pos++) {
+if (alann[pos] === tocopy) {
+found = true;
+break;
+}}
+if (!found) {
+continue;
+}}var newannot =  new jalview.datamodel.AlignmentAnnotation (seq.getAnnotation ()[a]);
+newannot.restrict (this.startRes, this.endRes);
+newannot.setSequenceRef (seqs[ipos]);
+newannot.adjustForAlignment ();
+seqs[ipos].addAlignmentAnnotation (newannot);
+}
+}ipos++;
+} else {
+iSize--;
+}}
+if (iSize != inorder.length) {
+var nseqs =  new Array (iSize);
+System.arraycopy (seqs, 0, nseqs, 0, iSize);
+seqs = nseqs;
+}return seqs;
+}, "jalview.datamodel.AlignmentI");
+Clazz_defineMethod (c$, "findEndRes", 
+function (seq) {
+var eres = 0;
+var ch;
+for (var j = 0; j < this.endRes + 1 && j < seq.getLength (); j++) {
+ch = seq.getCharAt (j);
+if (!jalview.util.Comparison.isGap ((ch))) {
+eres++;
+}}
+if (eres > 0) {
+eres += seq.getStart () - 1;
+}return eres;
+}, "jalview.datamodel.SequenceI");
+Clazz_defineMethod (c$, "getSequences", 
+function () {
+return this.sequences;
+});
+Clazz_defineMethod (c$, "getSequences", 
+function (hiddenReps) {
+if (hiddenReps == null) {
+return this.sequences;
+} else {
+var allSequences =  new java.util.ArrayList ();
+for (var seq, $seq = this.sequences.iterator (); $seq.hasNext () && ((seq = $seq.next ()) || true);) {
+allSequences.add (seq);
+if (hiddenReps.containsKey (seq)) {
+var hsg = hiddenReps.get (seq);
+for (var seq2, $seq2 = hsg.getSequences ().iterator (); $seq2.hasNext () && ((seq2 = $seq2.next ()) || true);) {
+if (seq2 !== seq && !allSequences.contains (seq2)) {
+allSequences.add (seq2);
+}}
+}}
+return allSequences;
+}}, "java.util.Map");
+Clazz_defineMethod (c$, "getSequencesAsArray", 
+function (map) {
+var tmp = this.getSequences (map);
+if (tmp == null) {
+return null;
+}return tmp.toArray ( new Array (tmp.size ()));
+}, "java.util.Map");
+Clazz_defineMethod (c$, "adjustForRemoveLeft", 
+function (col) {
+if (this.startRes >= col) {
+this.startRes = this.startRes - col;
+}if (this.endRes >= col) {
+this.endRes = this.endRes - col;
+if (this.startRes > this.endRes) {
+this.startRes = 0;
+}} else {
+return false;
+}return true;
+}, "~N");
+Clazz_defineMethod (c$, "adjustForRemoveRight", 
+function (col) {
+if (this.startRes > col) {
+return false;
+}if (this.endRes >= col) {
+this.endRes = col;
+}return true;
+}, "~N");
+Clazz_defineMethod (c$, "getName", 
+function () {
+return this.groupName;
+});
+Clazz_defineMethod (c$, "getDescription", 
+function () {
+return this.description;
+});
+Clazz_defineMethod (c$, "setName", 
+function (name) {
+this.groupName = name;
+}, "~S");
+Clazz_defineMethod (c$, "setDescription", 
+function (desc) {
+this.description = desc;
+}, "~S");
+Clazz_defineMethod (c$, "getConservation", 
+function () {
+return this.conserve;
+});
+Clazz_defineMethod (c$, "setConservation", 
+function (c) {
+this.conserve = c;
+}, "jalview.analysis.Conservation");
+Clazz_defineMethod (c$, "addSequence", 
+function (s, recalc) {
+{
+if (s != null && !this.sequences.contains (s)) {
+this.sequences.add (s);
+}if (recalc) {
+this.recalcConservation ();
+}}}, "jalview.datamodel.SequenceI,~B");
+Clazz_defineMethod (c$, "getConsPercGaps", 
+function () {
+return this.consPercGaps;
+});
+Clazz_defineMethod (c$, "setConsPercGaps", 
+function (consPercGaps) {
+this.consPercGaps = consPercGaps;
+}, "~N");
+Clazz_defineMethod (c$, "recalcConservation", 
+function () {
+if (this.cs == null && this.consensus == null && this.conservation == null) {
+return;
+}try {
+var cnsns = jalview.analysis.AAFrequency.calculate (this.sequences, this.startRes, this.endRes + 1, this.showSequenceLogo);
+if (this.consensus != null) {
+this._updateConsensusRow (cnsns, this.sequences.size ());
+}if (this.cs != null) {
+this.cs.setConsensus (cnsns);
+}if ((this.conservation != null) || (this.cs != null && this.cs.conservationApplied ())) {
+var c =  new jalview.analysis.Conservation (this.groupName, jalview.schemes.ResidueProperties.propHash, 3, this.sequences, this.startRes, this.endRes + 1);
+c.calculate ();
+c.verdict (false, this.consPercGaps);
+if (this.conservation != null) {
+this._updateConservationRow (c);
+}if (this.cs != null) {
+if (this.cs.conservationApplied ()) {
+this.cs.setConservation (c);
+}}}if (this.cs != null) {
+this.cs.alignmentChanged (this.context != null ? this.context : this, null);
+}} catch (err) {
+if (Clazz_exceptionOf (err, OutOfMemoryError)) {
+System.out.println ("Out of memory loading groups: " + err);
+} else {
+throw err;
+}
+}
+});
+Clazz_defineMethod (c$, "_updateConservationRow", 
+ function (c) {
+if (this.conservation == null) {
+this.getConservation ();
+}this.conservation.label = "Conservation for " + this.getName ();
+this.conservation.description = "Conservation for group " + this.getName () + " less than " + this.consPercGaps + "% gaps";
+var aWidth = (this.conservation.annotations != null) ? (this.endRes < this.conservation.annotations.length ? this.conservation.annotations.length : this.endRes + 1) : this.endRes + 1;
+this.conservation.annotations = null;
+this.conservation.annotations =  new Array (aWidth);
+c.completeAnnotations (this.conservation, null, this.startRes, this.endRes + 1);
+}, "jalview.analysis.Conservation");
+Clazz_defineMethod (c$, "_updateConsensusRow", 
+ function (cnsns, nseq) {
+if (this.consensus == null) {
+this.getConsensus ();
+}this.consensus.label = "Consensus for " + this.getName ();
+this.consensus.description = "Percent Identity";
+this.consensusData = cnsns;
+var aWidth = (this.consensus.annotations != null) ? (this.endRes < this.consensus.annotations.length ? this.consensus.annotations.length : this.endRes + 1) : this.endRes + 1;
+this.consensus.annotations = null;
+this.consensus.annotations =  new Array (aWidth);
+jalview.analysis.AAFrequency.completeConsensus (this.consensus, cnsns, this.startRes, this.endRes + 1, this.ignoreGapsInConsensus, this.showSequenceLogo, nseq);
+}, "~A,~N");
+Clazz_defineMethod (c$, "addOrRemove", 
+function (s, recalc) {
+{
+if (this.sequences.contains (s)) {
+this.deleteSequence (s, recalc);
+} else {
+this.addSequence (s, recalc);
+}}}, "jalview.datamodel.SequenceI,~B");
+Clazz_defineMethod (c$, "deleteSequence", 
+function (s, recalc) {
+{
+this.sequences.remove (s);
+if (recalc) {
+this.recalcConservation ();
+}}}, "jalview.datamodel.SequenceI,~B");
+Clazz_overrideMethod (c$, "getStartRes", 
+function () {
+return this.startRes;
+});
+Clazz_overrideMethod (c$, "getEndRes", 
+function () {
+return this.endRes;
+});
+Clazz_defineMethod (c$, "setStartRes", 
+function (i) {
+this.startRes = i;
+}, "~N");
+Clazz_defineMethod (c$, "setEndRes", 
+function (i) {
+this.endRes = i;
+}, "~N");
+Clazz_defineMethod (c$, "getSize", 
+function () {
+return this.sequences.size ();
+});
+Clazz_defineMethod (c$, "getSequenceAt", 
+function (i) {
+return this.sequences.get (i);
+}, "~N");
+Clazz_defineMethod (c$, "setColourText", 
+function (state) {
+this.colourText = state;
+}, "~B");
+Clazz_defineMethod (c$, "getColourText", 
+function () {
+return this.colourText;
+});
+Clazz_defineMethod (c$, "setDisplayText", 
+function (state) {
+this.displayText = state;
+}, "~B");
+Clazz_defineMethod (c$, "getDisplayText", 
+function () {
+return this.displayText;
+});
+Clazz_defineMethod (c$, "setDisplayBoxes", 
+function (state) {
+this.displayBoxes = state;
+}, "~B");
+Clazz_defineMethod (c$, "getDisplayBoxes", 
+function () {
+return this.displayBoxes;
+});
+Clazz_overrideMethod (c$, "getWidth", 
+function () {
+{
+var first = true;
+for (var seq, $seq = this.sequences.iterator (); $seq.hasNext () && ((seq = $seq.next ()) || true);) {
+if (first || seq.getLength () > this.width) {
+this.width = seq.getLength ();
+first = false;
+}}
+return this.width;
+}});
+Clazz_defineMethod (c$, "setOutlineColour", 
+function (c) {
+this.outlineColour = c;
+}, "java.awt.Color");
+Clazz_defineMethod (c$, "getOutlineColour", 
+function () {
+return this.outlineColour;
+});
+Clazz_defineMethod (c$, "getSequencesInOrder", 
+function (al) {
+return this.getSequencesInOrder (al, true);
+}, "jalview.datamodel.AlignmentI");
+Clazz_defineMethod (c$, "getSequencesInOrder", 
+function (al, trim) {
+{
+var sSize = this.sequences.size ();
+var alHeight = al.getHeight ();
+var seqs =  new Array ((trim) ? sSize : alHeight);
+var index = 0;
+for (var i = 0; i < alHeight && index < sSize; i++) {
+if (this.sequences.contains (al.getSequenceAt (i))) {
+seqs[(trim) ? index : i] = al.getSequenceAt (i);
+index++;
+}}
+if (index == 0) {
+return null;
+}if (!trim) {
+return seqs;
+}if (index < seqs.length) {
+var dummy = seqs;
+seqs =  new Array (index);
+while (--index >= 0) {
+seqs[index] = dummy[index];
+dummy[index] = null;
+}
+}return seqs;
+}}, "jalview.datamodel.AlignmentI,~B");
+Clazz_defineMethod (c$, "getIdColour", 
+function () {
+return this.idColour;
+});
+Clazz_defineMethod (c$, "setIdColour", 
+function (idColour) {
+this.idColour = idColour;
+}, "java.awt.Color");
+Clazz_overrideMethod (c$, "getSeqrep", 
+function () {
+return this.seqrep;
+});
+Clazz_overrideMethod (c$, "setSeqrep", 
+function (seqrep) {
+this.seqrep = seqrep;
+}, "jalview.datamodel.SequenceI");
+Clazz_overrideMethod (c$, "hasSeqrep", 
+function () {
+return this.seqrep != null;
+});
+Clazz_defineMethod (c$, "setHidereps", 
+function (visibility) {
+this.hidereps = visibility;
+}, "~B");
+Clazz_defineMethod (c$, "isHidereps", 
+function () {
+return this.hidereps;
+});
+Clazz_defineMethod (c$, "setHideCols", 
+function (visibility) {
+this.hidecols = visibility;
+}, "~B");
+Clazz_defineMethod (c$, "isHideCols", 
+function () {
+return this.hidecols;
+});
+Clazz_defineMethod (c$, "intersect", 
+function (alignment, map) {
+var sgroup =  new jalview.datamodel.SequenceGroup (this);
+var insect = this.getSequencesInOrder (alignment);
+sgroup.sequences =  new java.util.ArrayList ();
+for (var s = 0; insect != null && s < insect.length; s++) {
+if (map == null || map.containsKey (insect[s])) {
+sgroup.sequences.add (insect[s]);
+}}
+return sgroup;
+}, "jalview.datamodel.AlignmentI,java.util.Map");
+Clazz_defineMethod (c$, "getShowNonconserved", 
+function () {
+return this.showNonconserved;
+});
+Clazz_defineMethod (c$, "setShowNonconserved", 
+function (displayNonconserved) {
+this.showNonconserved = displayNonconserved;
+}, "~B");
+Clazz_defineMethod (c$, "setConsensus", 
+function (aan) {
+if (this.consensus == null) {
+this.consensus = aan;
+}}, "jalview.datamodel.AlignmentAnnotation");
+Clazz_defineMethod (c$, "getConsensus", 
+function () {
+var aWidth = this.getWidth ();
+if (aWidth < 0) {
+return null;
+}if (this.consensus == null) {
+this.consensus =  new jalview.datamodel.AlignmentAnnotation ("", "",  new Array (1), 0, 100, 1);
+this.consensus.hasText = true;
+this.consensus.autoCalculated = true;
+this.consensus.groupRef = this;
+this.consensus.label = "Consensus for " + this.getName ();
+this.consensus.description = "Percent Identity";
+}return this.consensus;
+});
+Clazz_defineMethod (c$, "setConservationRow", 
+function (aan) {
+if (this.conservation == null) {
+this.conservation = aan;
+}}, "jalview.datamodel.AlignmentAnnotation");
+Clazz_defineMethod (c$, "getConservationRow", 
+function () {
+if (this.conservation == null) {
+this.conservation =  new jalview.datamodel.AlignmentAnnotation ("", "",  new Array (1), 0, 11, 1);
+}this.conservation.hasText = true;
+this.conservation.autoCalculated = true;
+this.conservation.groupRef = this;
+this.conservation.label = "Conservation for " + this.getName ();
+this.conservation.description = "Conservation for group " + this.getName () + " less than " + this.consPercGaps + "% gaps";
+return this.conservation;
+});
+Clazz_defineMethod (c$, "hasAnnotationRows", 
+function () {
+return this.consensus != null || this.conservation != null;
+});
+Clazz_defineMethod (c$, "getConsensusSeq", 
+function () {
+this.getConsensus ();
+var seqs =  new StringBuffer ();
+for (var i = 0; i < this.consensus.annotations.length; i++) {
+if (this.consensus.annotations[i] != null) {
+if (this.consensus.annotations[i].description.charAt (0) == '[') {
+seqs.append (this.consensus.annotations[i].description.charAt (1));
+} else {
+seqs.append (this.consensus.annotations[i].displayCharacter);
+}}}
+var sq =  new jalview.datamodel.Sequence ("Group" + this.getName () + " Consensus", seqs.toString ());
+sq.setDescription ("Percentage Identity Consensus " + ((this.ignoreGapsInConsensus) ? " without gaps" : ""));
+return sq;
+});
+Clazz_defineMethod (c$, "setIgnoreGapsConsensus", 
+function (state) {
+if (this.ignoreGapsInConsensus != state && this.consensus != null) {
+this.ignoreGapsInConsensus = state;
+this.recalcConservation ();
+}this.ignoreGapsInConsensus = state;
+}, "~B");
+Clazz_defineMethod (c$, "getIgnoreGapsConsensus", 
+function () {
+return this.ignoreGapsInConsensus;
+});
+Clazz_defineMethod (c$, "setshowSequenceLogo", 
+function (showSequenceLogo) {
+if (this.showSequenceLogo != showSequenceLogo && this.consensus != null) {
+this.showSequenceLogo = showSequenceLogo;
+this.recalcConservation ();
+}this.showSequenceLogo = showSequenceLogo;
+}, "~B");
+Clazz_defineMethod (c$, "setShowConsensusHistogram", 
+function (showConsHist) {
+if (this.showConsensusHistogram != showConsHist && this.consensus != null) {
+this.showConsensusHistogram = showConsHist;
+this.recalcConservation ();
+}this.showConsensusHistogram = showConsHist;
+}, "~B");
+Clazz_defineMethod (c$, "isShowConsensusHistogram", 
+function () {
+return this.showConsensusHistogram;
+});
+Clazz_defineMethod (c$, "setNormaliseSequenceLogo", 
+function (norm) {
+this.normaliseSequenceLogo = norm;
+}, "~B");
+Clazz_defineMethod (c$, "isNormaliseSequenceLogo", 
+function () {
+return this.normaliseSequenceLogo;
+});
+Clazz_overrideMethod (c$, "getAlignmentAnnotation", 
+function () {
+var annot =  new java.util.ArrayList ();
+{
+for (var seq, $seq = this.sequences.iterator (); $seq.hasNext () && ((seq = $seq.next ()) || true);) {
+var aa = seq.getAnnotation ();
+if (aa != null) {
+for (var al, $al = 0, $$al = aa; $al < $$al.length && ((al = $$al[$al]) || true); $al++) {
+if (al.groupRef === this) {
+annot.add (al);
+}}
+}}
+if (this.consensus != null) {
+annot.add (this.consensus);
+}if (this.conservation != null) {
+annot.add (this.conservation);
+}}return annot.toArray ( new Array (0));
+});
+Clazz_overrideMethod (c$, "findAnnotation", 
+function (calcId) {
+var aa =  new java.util.ArrayList ();
+for (var a, $a = 0, $$a = this.getAlignmentAnnotation (); $a < $$a.length && ((a = $$a[$a]) || true); $a++) {
+if (a.getCalcId () === calcId) {
+aa.add (a);
+}}
+return aa;
+}, "~S");
+Clazz_overrideMethod (c$, "findAnnotations", 
+function (seq, calcId, label) {
+var aa =  new java.util.ArrayList ();
+for (var ann, $ann = 0, $$ann = this.getAlignmentAnnotation (); $ann < $$ann.length && ((ann = $$ann[$ann]) || true); $ann++) {
+if (ann.getCalcId () != null && ann.getCalcId ().equals (calcId) && ann.sequenceRef != null && ann.sequenceRef === seq && ann.label != null && ann.label.equals (label)) {
+aa.add (ann);
+}}
+return aa;
+}, "jalview.datamodel.SequenceI,~S,~S");
+Clazz_defineMethod (c$, "hasAnnotation", 
+function (calcId) {
+if (calcId != null && !"".equals (calcId)) {
+for (var a, $a = 0, $$a = this.getAlignmentAnnotation (); $a < $$a.length && ((a = $$a[$a]) || true); $a++) {
+if (a.getCalcId () === calcId) {
+return true;
+}}
+}return false;
+}, "~S");
+Clazz_defineMethod (c$, "clear", 
+function () {
+{
+this.sequences.clear ();
+}});
+Clazz_defineMethod (c$, "setContext", 
+function (context) {
+this.context = context;
+}, "jalview.datamodel.AnnotatedCollectionI");
+Clazz_overrideMethod (c$, "getContext", 
+function () {
+return this.context;
+});
+});
+Clazz_declarePackage ("jalview.datamodel");
+Clazz_load (["jalview.datamodel.SequenceCollectionI"], "jalview.datamodel.AnnotatedCollectionI", null, function () {
+Clazz_declareInterface (jalview.datamodel, "AnnotatedCollectionI", jalview.datamodel.SequenceCollectionI);
+});
+Clazz_declarePackage ("jalview.datamodel");
+Clazz_declareInterface (jalview.datamodel, "SequenceCollectionI");
+Clazz_declarePackage ("jalview.analysis");
+Clazz_load (null, "jalview.analysis.AAFrequency", ["jalview.analysis.CodingUtils", "jalview.datamodel.Annotation", "jalview.util.Format", "$.MappingUtils", "$.QuickSort", "java.lang.Float", "$.StringBuilder", "java.util.Arrays", "$.Hashtable"], function () {
+c$ = Clazz_declareType (jalview.analysis, "AAFrequency");
+c$.calculate = Clazz_defineMethod (c$, "calculate", 
+function (list, start, end) {
+return jalview.analysis.AAFrequency.calculate (list, start, end, false);
+}, "java.util.List,~N,~N");
+c$.calculate = Clazz_defineMethod (c$, "calculate", 
+function (sequences, start, end, profile) {
+var seqs =  new Array (sequences.size ());
+var width = 0;
+{
+for (var i = 0; i < sequences.size (); i++) {
+seqs[i] = sequences.get (i);
+if (seqs[i].getLength () > width) {
+width = seqs[i].getLength ();
+}}
+var reply =  new Array (width);
+if (end >= width) {
+end = width;
+}jalview.analysis.AAFrequency.calculate (seqs, start, end, reply, profile);
+return reply;
+}}, "java.util.List,~N,~N,~B");
+c$.calculate = Clazz_defineMethod (c$, "calculate", 
+function (sequences, start, end, result, profile) {
+var residueHash;
+var maxCount;
+var nongap;
+var i;
+var j;
+var v;
+var jSize = sequences.length;
+var maxResidue;
+var c = '-';
+var percentage;
+var values =  Clazz_newIntArray (255, 0);
+var seq;
+for (i = start; i < end; i++) {
+residueHash =  new java.util.Hashtable ();
+maxCount = 0;
+maxResidue = "";
+nongap = 0;
+values =  Clazz_newIntArray (255, 0);
+for (j = 0; j < jSize; j++) {
+if (sequences[j] == null) {
+System.err.println ("WARNING: Consensus skipping null sequence - possible race condition.");
+continue;
+}seq = sequences[j].getSequence ();
+if (seq.length > i) {
+c = seq[i];
+if (c == '.' || c == ' ') {
+c = '-';
+}if (c == '-') {
+values['-'.charCodeAt (0)]++;
+continue;
+} else if ('a' <= c && c <= 'z') {
+c = String.fromCharCode (c.charCodeAt (0) + -32);
+}nongap++;
+values[c.charCodeAt (0)]++;
+} else {
+values['-'.charCodeAt (0)]++;
+}}
+if (jSize == 1) {
+maxResidue = String.valueOf (c);
+maxCount = 1;
+} else {
+for (v = 65; v <= 90; v++) {
+if (values[v] < 1 || values[v] < maxCount) {
+continue;
+}if (values[v] > maxCount) {
+maxResidue = jalview.analysis.AAFrequency.CHARS[v - 65];
+} else if (values[v] == maxCount) {
+maxResidue += jalview.analysis.AAFrequency.CHARS[v - 65];
+}maxCount = values[v];
+}
+}if (maxResidue.length == 0) {
+maxResidue = "-";
+}if (profile) {
+residueHash.put ("P",  Clazz_newArray (-1, [values,  Clazz_newIntArray (-1, [jSize, nongap])]));
+}residueHash.put ("C",  new Integer (maxCount));
+residueHash.put ("R", maxResidue);
+percentage = (maxCount * 100) / jSize;
+residueHash.put ("G",  new Float (percentage));
+if (nongap > 0) {
+percentage = (maxCount * 100) / nongap;
+}residueHash.put ("N",  new Float (percentage));
+result[i] = residueHash;
+}
+}, "~A,~N,~N,~A,~B");
+c$.completeConsensus = Clazz_defineMethod (c$, "completeConsensus", 
+function (consensus, hconsensus, iStart, width, ignoreGapsInConsensusCalculation, includeAllConsSymbols, nseq) {
+jalview.analysis.AAFrequency.completeConsensus (consensus, hconsensus, iStart, width, ignoreGapsInConsensusCalculation, includeAllConsSymbols, null, nseq);
+}, "jalview.datamodel.AlignmentAnnotation,~A,~N,~N,~B,~B,~N");
+c$.completeConsensus = Clazz_defineMethod (c$, "completeConsensus", 
+function (consensus, hconsensus, iStart, width, ignoreGapsInConsensusCalculation, includeAllConsSymbols, alphabet, nseq) {
+if (consensus == null || consensus.annotations == null || consensus.annotations.length < width) {
+return;
+}var fmt = jalview.analysis.AAFrequency.getPercentageFormat (nseq);
+for (var i = iStart; i < width; i++) {
+var hci;
+if (i >= hconsensus.length || ((hci = hconsensus[i]) == null)) {
+consensus.annotations[i] = null;
+continue;
+}var fv = hci.get (ignoreGapsInConsensusCalculation ? "N" : "G");
+if (fv == null) {
+consensus.annotations[i] = null;
+continue;
+}var value = fv.floatValue ();
+var maxRes = hci.get ("R").toString ();
+var mouseOver =  new StringBuilder (64);
+if (maxRes.length > 1) {
+mouseOver.append ("[").append (maxRes).append ("] ");
+maxRes = "+";
+} else {
+mouseOver.append (hci.get ("R") + " ");
+}var profile = hci.get ("P");
+if (profile != null && includeAllConsSymbols) {
+var sequenceCount = profile[1][0];
+var nonGappedCount = profile[1][1];
+var normalisedBy = ignoreGapsInConsensusCalculation ? nonGappedCount : sequenceCount;
+mouseOver.setLength (0);
+if (alphabet != null) {
+for (var c = 0; c < alphabet.length; c++) {
+var tval = profile[0][alphabet[c].charCodeAt (0)] * 100 / normalisedBy;
+mouseOver.append (((c == 0) ? "" : "; ")).append (alphabet[c]).append (" ").append (((fmt != null) ? fmt.formDouble (tval) : (Clazz_floatToInt (tval)))).append ("%");
+}
+} else {
+var ca =  Clazz_newCharArray (profile[0].length, '\0');
+var vl =  Clazz_newFloatArray (profile[0].length, 0);
+for (var c = 0; c < ca.length; c++) {
+ca[c] = String.fromCharCode (c);
+vl[c] = profile[0][c];
+}
+jalview.util.QuickSort.sortFloatChar (vl, ca);
+for (var p = 0, c = ca.length - 1; profile[0][ca[c].charCodeAt (0)] > 0; c--) {
+var residue = ca[c];
+if (residue != '-') {
+var tval = profile[0][residue.charCodeAt (0)] * 100 / normalisedBy;
+mouseOver.append ((((p == 0) ? "" : "; "))).append (residue).append (" ").append (((fmt != null) ? fmt.formDouble (tval) : (Clazz_floatToInt (tval)))).append ("%");
+p++;
+}}
+}} else {
+mouseOver.append ((((fmt != null) ? fmt.formDouble (value) : (Clazz_floatToInt (value))))).append ("%");
+}consensus.annotations[i] =  new jalview.datamodel.Annotation (maxRes, mouseOver.toString (), ' ', value);
+}
+}, "jalview.datamodel.AlignmentAnnotation,~A,~N,~N,~B,~B,~A,~N");
+c$.getPercentageFormat = Clazz_defineMethod (c$, "getPercentageFormat", 
+function (nseq) {
+var scale = 0;
+while (nseq >= 10) {
+scale++;
+nseq /= 10;
+}
+return scale <= 1 ? null :  new jalview.util.Format ("%3." + (scale - 1) + "f");
+}, "~N");
+c$.extractProfile = Clazz_defineMethod (c$, "extractProfile", 
+function (hconsensus, ignoreGaps) {
+var rtnval =  Clazz_newIntArray (64, 0);
+var profile = hconsensus.get ("P");
+if (profile == null) {
+return null;
+}var ca =  Clazz_newCharArray (profile[0].length, '\0');
+var vl =  Clazz_newFloatArray (profile[0].length, 0);
+for (var c = 0; c < ca.length; c++) {
+ca[c] = String.fromCharCode (c);
+vl[c] = profile[0][c];
+}
+jalview.util.QuickSort.sortFloatChar (vl, ca);
+var nextArrayPos = 2;
+var totalPercentage = 0;
+var distinctValuesCount = 0;
+var divisor = profile[1][ignoreGaps ? 1 : 0];
+for (var c = ca.length - 1; profile[0][ca[c].charCodeAt (0)] > 0; c--) {
+if (ca[c] != '-') {
+rtnval[nextArrayPos++] = (ca[c]).charCodeAt (0);
+var percentage = Clazz_floatToInt (profile[0][ca[c].charCodeAt (0)] * 100 / divisor);
+rtnval[nextArrayPos++] = percentage;
+totalPercentage += percentage;
+distinctValuesCount++;
+}}
+rtnval[0] = distinctValuesCount;
+rtnval[1] = totalPercentage;
+var result =  Clazz_newIntArray (rtnval.length + 1, 0);
+result[0] = 0;
+System.arraycopy (rtnval, 0, result, 1, rtnval.length);
+return result;
+}, "java.util.Hashtable,~B");
+c$.extractCdnaProfile = Clazz_defineMethod (c$, "extractCdnaProfile", 
+function (hashtable, ignoreGaps) {
+var codonCounts = hashtable.get ("P");
+var sortedCounts =  Clazz_newIntArray (codonCounts.length - 2, 0);
+System.arraycopy (codonCounts, 2, sortedCounts, 0, codonCounts.length - 2);
+var result =  Clazz_newIntArray (3 + 2 * sortedCounts.length, 0);
+result[0] = 2;
+var codons =  Clazz_newCharArray (sortedCounts.length, '\0');
+for (var i = 0; i < codons.length; i++) {
+codons[i] = String.fromCharCode (i);
+}
+jalview.util.QuickSort.sortIntChar (sortedCounts, codons);
+var totalPercentage = 0;
+var distinctValuesCount = 0;
+var j = 3;
+var divisor = ignoreGaps ? codonCounts[1] : codonCounts[0];
+for (var i = codons.length - 1; i >= 0; i--) {
+var codonCount = sortedCounts[i];
+if (codonCount == 0) {
+break;
+}distinctValuesCount++;
+result[j++] = (codons[i]).charCodeAt (0);
+var percentage = Clazz_doubleToInt (codonCount * 100 / divisor);
+result[j++] = percentage;
+totalPercentage += percentage;
+}
+result[2] = totalPercentage;
+result[1] = distinctValuesCount;
+return java.util.Arrays.copyOfRange (result, 0, j);
+}, "java.util.Hashtable,~B");
+c$.calculateCdna = Clazz_defineMethod (c$, "calculateCdna", 
+function (alignment, mappings, hconsensus, col0, col1) {
+var gapCharacter = alignment.getGapCharacter ();
+for (var col = col0; col < col1; col++) {
+var columnHash =  new java.util.Hashtable ();
+var codonCounts =  Clazz_newIntArray (66, 0);
+codonCounts[0] = alignment.getSequences ().size ();
+var ungappedCount = 0;
+for (var seq, $seq = alignment.getSequences ().iterator (); $seq.hasNext () && ((seq = $seq.next ()) || true);) {
+if (seq.getCharAt (col) == gapCharacter) {
+continue;
+}var codon = jalview.util.MappingUtils.findCodonFor (seq, col, mappings);
+var codonEncoded = jalview.analysis.CodingUtils.encodeCodon (codon);
+if (codonEncoded >= 0) {
+codonCounts[codonEncoded + 2]++;
+ungappedCount++;
+}}
+codonCounts[1] = ungappedCount;
+columnHash.put ("P", codonCounts);
+hconsensus[col] = columnHash;
+}
+}, "jalview.datamodel.AlignmentI,java.util.Set,~A,~N,~N");
+c$.completeCdnaConsensus = Clazz_defineMethod (c$, "completeCdnaConsensus", 
+function (consensusAnnotation, consensusData, showProfileLogo, nseqs) {
+if (consensusAnnotation == null || consensusAnnotation.annotations == null || consensusAnnotation.annotations.length < consensusData.length) {
+return;
+}consensusAnnotation.scaleColLabel = true;
+for (var col = 0; col < consensusData.length; col++) {
+var hci = consensusData[col];
+if (hci == null) {
+continue;
+}var codonCounts = hci.get ("P");
+var totalCount = 0;
+var codons =  Clazz_newCharArray (codonCounts.length - 2, '\0');
+for (var j = 2; j < codonCounts.length; j++) {
+var codonCount = codonCounts[j];
+codons[j - 2] = String.fromCharCode (j - 2);
+totalCount += codonCount;
+}
+var sortedCodonCounts =  Clazz_newIntArray (codonCounts.length - 2, 0);
+System.arraycopy (codonCounts, 2, sortedCodonCounts, 0, codonCounts.length - 2);
+jalview.util.QuickSort.sortIntChar (sortedCodonCounts, codons);
+var modalCodonEncoded = (codons[codons.length - 1]).charCodeAt (0);
+var modalCodonCount = sortedCodonCounts[codons.length - 1];
+var modalCodon = String.valueOf (jalview.analysis.CodingUtils.decodeCodon (modalCodonEncoded));
+if (sortedCodonCounts.length > 1 && sortedCodonCounts[codons.length - 2] == modalCodonEncoded) {
+modalCodon = "+";
+}var pid = sortedCodonCounts[sortedCodonCounts.length - 1] * 100 / totalCount;
+var mouseOver =  new StringBuilder (32);
+var samePercent =  new StringBuilder ();
+var percent = null;
+var lastPercent = null;
+var fmt = jalview.analysis.AAFrequency.getPercentageFormat (nseqs);
+for (var j = codons.length - 1; j >= 0; j--) {
+var codonCount = sortedCodonCounts[j];
+if (codonCount == 0) {
+if (samePercent.length () > 0) {
+mouseOver.append (samePercent).append (": ").append (percent).append ("% ");
+}break;
+}var codonEncoded = (codons[j]).charCodeAt (0);
+var pct = Clazz_doubleToInt (codonCount * 100 / totalCount);
+var codon = String.valueOf (jalview.analysis.CodingUtils.decodeCodon (codonEncoded));
+percent = fmt == null ? Integer.toString (pct) : fmt.formLong (pct);
+if (showProfileLogo || codonCount == modalCodonCount) {
+if (percent.equals (lastPercent) && j > 0) {
+samePercent.append (samePercent.length () == 0 ? "" : ", ");
+samePercent.append (codon);
+} else {
+if (samePercent.length () > 0) {
+mouseOver.append (samePercent).append (": ").append (lastPercent).append ("% ");
+}samePercent.setLength (0);
+samePercent.append (codon);
+}lastPercent = percent;
+}}
+consensusAnnotation.annotations[col] =  new jalview.datamodel.Annotation (modalCodon, mouseOver.toString (), ' ', pid);
+}
+}, "jalview.datamodel.AlignmentAnnotation,~A,~B,~N");
+Clazz_defineStatics (c$,
+"TO_UPPER_CASE", -32,
+"MAXCOUNT", "C",
+"MAXRESIDUE", "R",
+"PID_GAPS", "G",
+"PID_NOGAPS", "N",
+"PROFILE", "P",
+"ENCODED_CHARS", "E");
+c$.CHARS = c$.prototype.CHARS =  new Array (26);
+{
+for (var c = 'A'; c <= 'Z'; c = String.fromCharCode (c.charCodeAt (0) + 1)) {
+jalview.analysis.AAFrequency.CHARS[c.charCodeAt (0) - 65] = String.valueOf (c);
+}
+}});
+Clazz_declarePackage ("jalview.analysis");
+c$ = Clazz_declareType (jalview.analysis, "CodingUtils");
+c$.encodeCodon = Clazz_defineMethod (c$, "encodeCodon", 
+function (codon) {
+if (codon == null) {
+return -1;
+}return jalview.analysis.CodingUtils.encodeCodon (codon[2]) + (jalview.analysis.CodingUtils.encodeCodon (codon[1]) << 2) + (jalview.analysis.CodingUtils.encodeCodon (codon[0]) << (4));
+}, "~A");
+c$.encodeCodon = Clazz_defineMethod (c$, "encodeCodon", 
+function (c) {
+var result = -2147483648;
+switch (c) {
+case 'A':
+case 'a':
+result = 0;
+break;
+case 'C':
+case 'c':
+result = 1;
+break;
+case 'G':
+case 'g':
+result = 2;
+break;
+case 'T':
+case 't':
+case 'U':
+case 'u':
+result = 3;
+break;
+}
+return result;
+}, "~S");
+c$.decodeCodon = Clazz_defineMethod (c$, "decodeCodon", 
+function (encoded) {
+var result =  Clazz_newCharArray (3, '\0');
+result[2] = jalview.analysis.CodingUtils.decodeNucleotide (encoded & 3);
+encoded = encoded >>> 2;
+result[1] = jalview.analysis.CodingUtils.decodeNucleotide (encoded & 3);
+encoded = encoded >>> 2;
+result[0] = jalview.analysis.CodingUtils.decodeNucleotide (encoded & 3);
+return result;
+}, "~N");
+c$.decodeNucleotide = Clazz_defineMethod (c$, "decodeNucleotide", 
+function (i) {
+var result = '0';
+switch (i) {
+case 0:
+result = 'A';
+break;
+case 1:
+result = 'C';
+break;
+case 2:
+result = 'G';
+break;
+case 3:
+result = 'T';
+break;
+}
+return result;
+}, "~N");
+Clazz_defineStatics (c$,
+"CODON_ENCODING_BITSHIFT", 2);
+Clazz_declarePackage ("jalview.analysis");
+Clazz_load (null, "jalview.analysis.Conservation", ["jalview.datamodel.Annotation", "$.Sequence", "jalview.schemes.ResidueProperties", "jalview.util.Comparison", "java.awt.Color", "java.lang.Character", "$.Double", "$.StringBuffer", "java.util.Hashtable", "$.Vector"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.sequences = null;
+this.start = 0;
+this.end = 0;
+this.seqNums = null;
+this.maxLength = 0;
+this.seqNumsChanged = false;
+this.total = null;
+this.canonicaliseAa = true;
+this.quality = null;
+this.qualityRange = null;
+this.consString = "";
+this.consSequence = null;
+this.propHash = null;
+this.threshold = 0;
+this.name = "";
+this.cons2 = null;
+this.consSymbs = null;
+Clazz_instantialize (this, arguments);
+}, jalview.analysis, "Conservation");
+Clazz_prepareFields (c$, function () {
+this.qualityRange =  new Array (2);
+});
+Clazz_makeConstructor (c$, 
+function (name, propHash, threshold, sequences, start, end) {
+this.name = name;
+this.propHash = propHash;
+this.threshold = threshold;
+this.start = start;
+this.end = end;
+this.maxLength = end - start + 1;
+var s;
+var sSize = sequences.size ();
+var sarray =  new Array (sSize);
+this.sequences = sarray;
+try {
+for (s = 0; s < sSize; s++) {
+sarray[s] = sequences.get (s);
+if (sarray[s].getLength () > this.maxLength) {
+this.maxLength = sarray[s].getLength ();
+}}
+} catch (ex) {
+if (Clazz_exceptionOf (ex, ArrayIndexOutOfBoundsException)) {
+this.sequences =  new Array (0);
+this.maxLength = 0;
+} else {
+throw ex;
+}
+}
+}, "~S,java.util.Hashtable,~N,java.util.List,~N,~N");
+Clazz_defineMethod (c$, "calcSeqNum", 
+ function (i) {
+var sq = null;
+var sqnum = null;
+var sSize = this.sequences.length;
+if ((i > -1) && (i < sSize)) {
+sq = this.sequences[i].getSequenceAsString ();
+if (this.seqNums.size () <= i) {
+this.seqNums.addElement ( Clazz_newIntArray (sq.length + 1, 0));
+}if (sq.hashCode () != (this.seqNums.elementAt (i))[0]) {
+var j;
+var len;
+this.seqNumsChanged = true;
+len = sq.length;
+if (this.maxLength < len) {
+this.maxLength = len;
+}sqnum =  Clazz_newIntArray (len + 1, 0);
+sqnum[0] = sq.hashCode ();
+for (j = 1; j <= len; j++) {
+sqnum[j] = jalview.schemes.ResidueProperties.aaIndex[sq.charCodeAt (j - 1)];
+}
+this.seqNums.setElementAt (sqnum, i);
+} else {
+System.out.println ("SEQUENCE HAS BEEN DELETED!!!");
+}} else {
+System.err.println ("ERROR: calcSeqNum called with out of range sequence index for Alignment\n");
+}}, "~N");
+Clazz_defineMethod (c$, "calculate", 
+function () {
+var resultHash;
+var ht;
+var thresh;
+var j;
+var jSize = this.sequences.length;
+var values;
+var type;
+var res = null;
+var c;
+var enumeration2;
+this.total =  new Array (this.maxLength);
+for (var i = this.start; i <= this.end; i++) {
+values =  Clazz_newIntArray (255, 0);
+for (j = 0; j < jSize; j++) {
+if (this.sequences[j].getLength () > i) {
+c = this.sequences[j].getCharAt (i);
+if (this.canonicaliseAa) {
+c = String.fromCharCode (jalview.schemes.ResidueProperties.aaIndex[this.sequences[j].getCharAt (i).charCodeAt (0)]);
+if (c.charCodeAt (0) > 20) {
+c = '-';
+} else {
+c = jalview.schemes.ResidueProperties.aa[c.charCodeAt (0)].charAt (0);
+}} else {
+if (c == '.' || c == ' ') {
+c = '-';
+}if (!this.canonicaliseAa && 'a' <= c && c <= 'z') {
+c = String.fromCharCode (c.charCodeAt (0) - (32));
+}}values[c.charCodeAt (0)]++;
+} else {
+values['-'.charCodeAt (0)]++;
+}}
+thresh = Clazz_doubleToInt ((this.threshold * (jSize)) / 100);
+resultHash =  new java.util.Hashtable ();
+for (var v = '-'; v < 'Z'; v = String.fromCharCode (v.charCodeAt (0) + 1)) {
+if (values[v.charCodeAt (0)] > thresh) {
+res = String.valueOf (v);
+enumeration2 = this.propHash.keys ();
+while (enumeration2.hasMoreElements ()) {
+type = enumeration2.nextElement ();
+ht = this.propHash.get (type);
+if (!resultHash.containsKey (type)) {
+if (ht.containsKey (res)) {
+resultHash.put (type, ht.get (res));
+} else {
+resultHash.put (type, ht.get ("-"));
+}} else if ((resultHash.get (type)).equals (ht.get (res)) == false) {
+resultHash.put (type,  new Integer (-1));
+}}
+}}
+if (this.total.length > 0) {
+this.total[i - this.start] = resultHash;
+}}
+});
+Clazz_defineMethod (c$, "countConsNGaps", 
+function (j) {
+var count = 0;
+var cons = 0;
+var nres = 0;
+var r =  Clazz_newIntArray (2, 0);
+var f = '$';
+var i;
+var iSize = this.sequences.length;
+var c;
+for (i = 0; i < iSize; i++) {
+if (j >= this.sequences[i].getLength ()) {
+count++;
+continue;
+}c = this.sequences[i].getCharAt (j);
+if (jalview.util.Comparison.isGap ((c))) {
+count++;
+} else {
+nres++;
+if (nres == 1) {
+f = c;
+cons++;
+} else if (f == c) {
+cons++;
+}}}
+r[0] = (nres == cons) ? 1 : 0;
+r[1] = count;
+return r;
+}, "~N");
+Clazz_defineMethod (c$, "verdict", 
+function (consflag, percentageGaps) {
+var consString =  new StringBuffer ();
+var type;
+var result;
+var gapcons;
+var totGaps;
+var count;
+var pgaps;
+var resultHash;
+var enumeration;
+for (var i = 0; i < this.start; i++) {
+consString.append ('-');
+}
+this.consSymbs =  new Array (this.end - this.start + 1);
+for (var i = this.start; i <= this.end; i++) {
+gapcons = this.countConsNGaps (i);
+totGaps = gapcons[1];
+pgaps = (totGaps * 100) / this.sequences.length;
+this.consSymbs[i - this.start] =  String.instantialize ();
+if (percentageGaps > pgaps) {
+resultHash = this.total[i - this.start];
+count = 0;
+enumeration = resultHash.keys ();
+while (enumeration.hasMoreElements ()) {
+type = enumeration.nextElement ();
+result = resultHash.get (type);
+if (consflag) {
+if (result.intValue () == 1) {
+this.consSymbs[i - this.start] = type + " " + this.consSymbs[i - this.start];
+count++;
+}} else {
+if (result.intValue () != -1) {
+{
+if (result.intValue () == 0) {
+this.consSymbs[i - this.start] = this.consSymbs[i - this.start] + " !" + type;
+} else {
+this.consSymbs[i - this.start] = type + " " + this.consSymbs[i - this.start];
+}}count++;
+}}}
+if (count < 10) {
+consString.append ("" + count);
+} else {
+consString.append ((gapcons[0] == 1) ? "*" : "+");
+}} else {
+consString.append ('-');
+}}
+this.consSequence =  new jalview.datamodel.Sequence (this.name, consString.toString (), this.start, this.end);
+}, "~B,~N");
+Clazz_defineMethod (c$, "getConsSequence", 
+function () {
+return this.consSequence;
+});
+Clazz_defineMethod (c$, "findQuality", 
+function () {
+this.findQuality (0, this.maxLength - 1);
+});
+Clazz_defineMethod (c$, "percentIdentity2", 
+ function () {
+this.seqNums =  new java.util.Vector ();
+var i = 0;
+var iSize = this.sequences.length;
+for (i = 0; i < iSize; i++) {
+this.calcSeqNum (i);
+}
+if ((this.cons2 == null) || this.seqNumsChanged) {
+this.cons2 =  Clazz_newIntArray (this.maxLength, 24, 0);
+for (var j = 0; j < 24; j++) {
+for (i = 0; i < this.maxLength; i++) {
+this.cons2[i][j] = 0;
+}
+}
+var sqnum;
+var j = 0;
+while (j < this.sequences.length) {
+sqnum = this.seqNums.elementAt (j);
+for (i = 1; i < sqnum.length; i++) {
+this.cons2[i - 1][sqnum[i]]++;
+}
+for (i = sqnum.length - 1; i < this.maxLength; i++) {
+this.cons2[i][23]++;
+}
+j++;
+}
+}});
+Clazz_defineMethod (c$, "findQuality", 
+function (start, end) {
+this.quality =  new java.util.Vector ();
+var max = -10000;
+var BLOSUM62 = jalview.schemes.ResidueProperties.getBLOSUM62 ();
+this.percentIdentity2 ();
+var size = this.seqNums.size ();
+var lengths =  Clazz_newIntArray (size, 0);
+var tot;
+var bigtot;
+var sr;
+var tmp;
+var x;
+var xx;
+var l;
+var j;
+var i;
+var ii;
+var i2;
+var k;
+var seqNum;
+for (l = 0; l < size; l++) {
+lengths[l] = (this.seqNums.elementAt (l)).length - 1;
+}
+for (j = start; j <= end; j++) {
+bigtot = 0;
+x =  Clazz_newDoubleArray (24, 0);
+for (ii = 0; ii < 24; ii++) {
+x[ii] = 0;
+for (i2 = 0; i2 < 24; i2++) {
+x[ii] += ((this.cons2[j][i2] * BLOSUM62[ii][i2]) + 4);
+}
+x[ii] /= size;
+}
+for (k = 0; k < size; k++) {
+tot = 0;
+xx =  Clazz_newDoubleArray (24, 0);
+seqNum = (j < lengths[k]) ? (this.seqNums.elementAt (k))[j + 1] : 23;
+for (i = 0; i < 23; i++) {
+sr = 0;
+sr = BLOSUM62[i][seqNum] + 4;
+xx[i] = x[i] - sr;
+tot += (xx[i] * xx[i]);
+}
+bigtot += Math.sqrt (tot);
+}
+if (max < bigtot) {
+max = bigtot;
+}this.quality.addElement ( new Double (bigtot));
+}
+var newmax = -10000;
+for (j = start; j <= end; j++) {
+tmp = (this.quality.elementAt (j)).doubleValue ();
+tmp = ((max - tmp) * (size - this.cons2[j][23])) / size;
+this.quality.setElementAt ( new Double (tmp), j);
+if (tmp > newmax) {
+newmax = tmp;
+}}
+this.qualityRange[0] =  new Double (0);
+this.qualityRange[1] =  new Double (newmax);
+}, "~N,~N");
+Clazz_defineMethod (c$, "completeAnnotations", 
+function (conservation, quality2, istart, alWidth) {
+var sequence = this.getConsSequence ().getSequence ();
+var minR;
+var minG;
+var minB;
+var maxR;
+var maxG;
+var maxB;
+minR = 0.3;
+minG = 0.0;
+minB = 0;
+maxR = 1.0 - minR;
+maxG = 0.9 - minG;
+maxB = 0 - minB;
+var min = 0;
+var max = 11;
+var qmin = 0;
+var qmax = 0;
+var c;
+if (conservation.annotations != null && conservation.annotations.length < alWidth) {
+conservation.annotations =  new Array (alWidth);
+}if (quality2 != null) {
+quality2.graphMax = this.qualityRange[1].floatValue ();
+if (quality2.annotations != null && quality2.annotations.length < alWidth) {
+quality2.annotations =  new Array (alWidth);
+}qmin = this.qualityRange[0].floatValue ();
+qmax = this.qualityRange[1].floatValue ();
+}for (var i = 0; i < alWidth; i++) {
+var value = 0;
+c = sequence[i];
+if (Character.isDigit (c)) {
+value = c.charCodeAt (0) - 48;
+} else if (c == '*') {
+value = 11;
+} else if (c == '+') {
+value = 10;
+}var vprop = value - min;
+vprop /= max;
+conservation.annotations[i] =  new jalview.datamodel.Annotation (String.valueOf (c), this.consSymbs[i - this.start], ' ', value,  new java.awt.Color (minR + (maxR * vprop), minG + (maxG * vprop), minB + (maxB * vprop)));
+if (quality2 != null) {
+value = (this.quality.elementAt (i)).floatValue ();
+vprop = value - qmin;
+vprop /= qmax;
+quality2.annotations[i] =  new jalview.datamodel.Annotation (" ", String.valueOf (value), ' ', value,  new java.awt.Color (minR + (maxR * vprop), minG + (maxG * vprop), minB + (maxB * vprop)));
+}}
+}, "jalview.datamodel.AlignmentAnnotation,jalview.datamodel.AlignmentAnnotation,~N,~N");
+c$.calculateConservation = Clazz_defineMethod (c$, "calculateConservation", 
+function (name, consHash, threshold, seqs, start, end, posOrNeg, consPercGaps, calcQuality) {
+var cons =  new jalview.analysis.Conservation (name, consHash, threshold, seqs, start, end);
+return jalview.analysis.Conservation.calculateConservation (cons, posOrNeg, consPercGaps, calcQuality);
+}, "~S,java.util.Hashtable,~N,java.util.List,~N,~N,~B,~N,~B");
+c$.calculateConservation = Clazz_defineMethod (c$, "calculateConservation", 
+function (cons, b, consPercGaps, calcQuality) {
+cons.calculate ();
+cons.verdict (b, consPercGaps);
+if (calcQuality) {
+cons.findQuality ();
+}return cons;
+}, "jalview.analysis.Conservation,~B,~N,~B");
+});
+Clazz_declarePackage ("jalview.datamodel");
+Clazz_load (["jalview.datamodel.AlignmentI", "$.HiddenSequences", "java.util.ArrayList", "$.Collections", "$.LinkedHashSet"], "jalview.datamodel.Alignment", ["jalview.analysis.AlignmentUtils", "jalview.datamodel.AlignmentAnnotation", "$.CigarArray", "$.SeqCigar", "$.Sequence", "jalview.util.Comparison", "$.MessageManager", "java.lang.Error", "java.util.HashSet", "$.Hashtable", "$.Vector"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.dataset = null;
+this.sequences = null;
+this.groups = null;
+this.gapCharacter = '-';
+this.type = 1;
+this.$hasRNAStructure = false;
+this.annotations = null;
+this.hiddenSequences = null;
+this.alignmentProperties = null;
+this.codonFrameList = null;
+this.alignmentRefs = 0;
+this.seqrep = null;
+Clazz_instantialize (this, arguments);
+}, jalview.datamodel, "Alignment", null, jalview.datamodel.AlignmentI);
+Clazz_prepareFields (c$, function () {
+this.groups = java.util.Collections.synchronizedList ( new java.util.ArrayList ());
+this.hiddenSequences =  new jalview.datamodel.HiddenSequences (this);
+this.codonFrameList =  new java.util.LinkedHashSet ();
+});
+Clazz_defineMethod (c$, "initAlignment", 
+ function (seqs) {
+var i = 0;
+if (jalview.util.Comparison.isNucleotide (seqs)) {
+this.type = 1;
+} else {
+this.type = 0;
+}this.sequences = java.util.Collections.synchronizedList ( new java.util.ArrayList ());
+for (i = 0; i < seqs.length; i++) {
+this.sequences.add (seqs[i]);
+}
+}, "~A");
+Clazz_makeConstructor (c$, 
+function (al) {
+var seqs = al.getSequencesArray ();
+for (var i = 0; i < seqs.length; i++) {
+seqs[i] =  new jalview.datamodel.Sequence (seqs[i]);
+}
+this.codonFrameList = (al).codonFrameList;
+this.initAlignment (seqs);
+}, "jalview.datamodel.AlignmentI");
+Clazz_makeConstructor (c$, 
+function (seqs) {
+this.initAlignment (seqs);
+}, "~A");
+c$.createAlignment = Clazz_defineMethod (c$, "createAlignment", 
+function (compactAlignment) {
+throw  new Error (jalview.util.MessageManager.getString ("error.alignment_cigararray_not_implemented"));
+}, "jalview.datamodel.CigarArray");
+Clazz_defineMethod (c$, "getSequences", 
+function () {
+return this.sequences;
+});
+Clazz_defineMethod (c$, "getSequences", 
+function (hiddenReps) {
+return this.sequences;
+}, "java.util.Map");
+Clazz_defineMethod (c$, "getSequencesArray", 
+function () {
+if (this.sequences == null) {
+return null;
+}{
+return this.sequences.toArray ( new Array (this.sequences.size ()));
+}});
+Clazz_overrideMethod (c$, "getSequencesByName", 
+function () {
+return jalview.analysis.AlignmentUtils.getSequencesByName (this);
+});
+Clazz_overrideMethod (c$, "getSequenceAt", 
+function (i) {
+{
+if (i > -1 && i < this.sequences.size ()) {
+return this.sequences.get (i);
+}}return null;
+}, "~N");
+Clazz_overrideMethod (c$, "addSequence", 
+function (snew) {
+if (this.dataset != null) {
+if (snew.getDatasetSequence () != null) {
+this.getDataset ().addSequence (snew.getDatasetSequence ());
+} else {
+var adding = snew.deriveSequence ();
+this.getDataset ().addSequence (adding.getDatasetSequence ());
+snew = adding;
+}}if (this.sequences == null) {
+this.initAlignment ( Clazz_newArray (-1, [snew]));
+} else {
+{
+this.sequences.add (snew);
+}}if (this.hiddenSequences != null) {
+this.hiddenSequences.adjustHeightSequenceAdded ();
+}}, "jalview.datamodel.SequenceI");
+Clazz_overrideMethod (c$, "setSequenceAt", 
+function (i, snew) {
+{
+this.deleteSequence (i);
+this.sequences.set (i, snew);
+}}, "~N,jalview.datamodel.SequenceI");
+Clazz_defineMethod (c$, "getGroups", 
+function () {
+return this.groups;
+});
+Clazz_overrideMethod (c$, "finalize", 
+function () {
+if (this.getDataset () != null) {
+this.getDataset ().removeAlignmentRef ();
+}this.dataset = null;
+this.sequences = null;
+this.groups = null;
+this.annotations = null;
+this.hiddenSequences = null;
+});
+Clazz_defineMethod (c$, "removeAlignmentRef", 
+ function () {
+if (--this.alignmentRefs == 0) {
+this.finalize ();
+}});
+Clazz_defineMethod (c$, "deleteSequence", 
+function (s) {
+this.deleteSequence (this.findIndex (s));
+}, "jalview.datamodel.SequenceI");
+Clazz_defineMethod (c$, "deleteSequence", 
+function (i) {
+if (i > -1 && i < this.getHeight ()) {
+{
+this.sequences.remove (i);
+this.hiddenSequences.adjustHeightSequenceDeleted (i);
+}}}, "~N");
+Clazz_overrideMethod (c$, "findGroup", 
+function (s) {
+{
+for (var i = 0; i < this.groups.size (); i++) {
+var sg = this.groups.get (i);
+if (sg.getSequences (null).contains (s)) {
+return sg;
+}}
+}return null;
+}, "jalview.datamodel.SequenceI");
+Clazz_overrideMethod (c$, "findAllGroups", 
+function (s) {
+var temp =  new java.util.ArrayList ();
+{
+var gSize = this.groups.size ();
+for (var i = 0; i < gSize; i++) {
+var sg = this.groups.get (i);
+if (sg == null || sg.getSequences () == null) {
+this.deleteGroup (sg);
+gSize--;
+continue;
+}if (sg.getSequences ().contains (s)) {
+temp.add (sg);
+}}
+}var ret =  new Array (temp.size ());
+return temp.toArray (ret);
+}, "jalview.datamodel.SequenceI");
+Clazz_overrideMethod (c$, "addGroup", 
+function (sg) {
+{
+if (!this.groups.contains (sg)) {
+if (this.hiddenSequences.getSize () > 0) {
+var i;
+var iSize = sg.getSize ();
+for (i = 0; i < iSize; i++) {
+if (!this.sequences.contains (sg.getSequenceAt (i))) {
+sg.deleteSequence (sg.getSequenceAt (i), false);
+iSize--;
+i--;
+}}
+if (sg.getSize () < 1) {
+return;
+}}sg.setContext (this);
+this.groups.add (sg);
+}}}, "jalview.datamodel.SequenceGroup");
+Clazz_defineMethod (c$, "removeAnnotationForGroup", 
+ function (gp) {
+if (this.annotations == null || this.annotations.length == 0) {
+return;
+}var t;
+var todelete =  new Array (this.annotations.length);
+var tokeep =  new Array (this.annotations.length);
+var i;
+var p;
+var k;
+if (gp == null) {
+for (i = 0, p = 0, k = 0; i < this.annotations.length; i++) {
+if (this.annotations[i].groupRef != null) {
+todelete[p++] = this.annotations[i];
+} else {
+tokeep[k++] = this.annotations[i];
+}}
+} else {
+for (i = 0, p = 0, k = 0; i < this.annotations.length; i++) {
+if (this.annotations[i].groupRef === gp) {
+todelete[p++] = this.annotations[i];
+} else {
+tokeep[k++] = this.annotations[i];
+}}
+}if (p > 0) {
+for (i = 0; i < p; i++) {
+this.unhookAnnotation (todelete[i]);
+todelete[i] = null;
+}
+t =  new Array (k);
+for (i = 0; i < k; i++) {
+t[i] = tokeep[i];
+}
+this.annotations = t;
+}}, "jalview.datamodel.SequenceGroup");
+Clazz_overrideMethod (c$, "deleteAllGroups", 
+function () {
+{
+if (this.annotations != null) {
+this.removeAnnotationForGroup (null);
+}for (var sg, $sg = this.groups.iterator (); $sg.hasNext () && ((sg = $sg.next ()) || true);) {
+sg.setContext (null);
+}
+this.groups.clear ();
+}});
+Clazz_overrideMethod (c$, "deleteGroup", 
+function (g) {
+{
+if (this.groups.contains (g)) {
+this.removeAnnotationForGroup (g);
+this.groups.remove (g);
+g.setContext (null);
+}}}, "jalview.datamodel.SequenceGroup");
+Clazz_defineMethod (c$, "findName", 
+function (name) {
+return this.findName (name, false);
+}, "~S");
+Clazz_defineMethod (c$, "findName", 
+function (token, b) {
+return this.findName (null, token, b);
+}, "~S,~B");
+Clazz_defineMethod (c$, "findName", 
+function (startAfter, token, b) {
+var i = 0;
+var sq = null;
+var sqname = null;
+if (startAfter != null) {
+var matched = false;
+while (i < this.sequences.size ()) {
+if (this.getSequenceAt (i++) === startAfter) {
+matched = true;
+break;
+}}
+if (!matched) {
+i = 0;
+}}while (i < this.sequences.size ()) {
+sq = this.getSequenceAt (i);
+sqname = sq.getName ();
+if (sqname.equals (token) || (b && (sqname.equalsIgnoreCase (token)))) {
+return this.getSequenceAt (i);
+}i++;
+}
+return null;
+}, "jalview.datamodel.SequenceI,~S,~B");
+Clazz_overrideMethod (c$, "findSequenceMatch", 
+function (name) {
+var matches =  new java.util.Vector ();
+var i = 0;
+while (i < this.sequences.size ()) {
+if (this.getSequenceAt (i).getName ().equals (name)) {
+matches.addElement (this.getSequenceAt (i));
+}i++;
+}
+var result =  new Array (matches.size ());
+for (i = 0; i < result.length; i++) {
+result[i] = matches.elementAt (i);
+}
+return result;
+}, "~S");
+Clazz_defineMethod (c$, "findIndex", 
+function (s) {
+var i = 0;
+while (i < this.sequences.size ()) {
+if (s === this.getSequenceAt (i)) {
+return i;
+}i++;
+}
+return -1;
+}, "jalview.datamodel.SequenceI");
+Clazz_defineMethod (c$, "findIndex", 
+function (results) {
+var i = 0;
+while (i < this.sequences.size ()) {
+if (results.involvesSequence (this.getSequenceAt (i))) {
+return i;
+}i++;
+}
+return -1;
+}, "jalview.datamodel.SearchResults");
+Clazz_overrideMethod (c$, "getHeight", 
+function () {
+return this.sequences.size ();
+});
+Clazz_overrideMethod (c$, "getWidth", 
+function () {
+var maxLength = -1;
+for (var i = 0; i < this.sequences.size (); i++) {
+if (this.getSequenceAt (i).getLength () > maxLength) {
+maxLength = this.getSequenceAt (i).getLength ();
+}}
+return maxLength;
+});
+Clazz_overrideMethod (c$, "setGapCharacter", 
+function (gc) {
+this.gapCharacter = gc;
+{
+for (var seq, $seq = this.sequences.iterator (); $seq.hasNext () && ((seq = $seq.next ()) || true);) {
+seq.setSequence (seq.getSequenceAsString ().$replace ('.', gc).$replace ('-', gc).$replace (' ', gc));
+}
+}}, "~S");
+Clazz_defineMethod (c$, "getGapCharacter", 
+function () {
+return this.gapCharacter;
+});
+Clazz_defineMethod (c$, "isAligned", 
+function () {
+return this.isAligned (false);
+});
+Clazz_defineMethod (c$, "isAligned", 
+function (includeHidden) {
+var width = this.getWidth ();
+if (this.hiddenSequences == null || this.hiddenSequences.getSize () == 0) {
+includeHidden = true;
+}for (var i = 0; i < this.sequences.size (); i++) {
+if (includeHidden || !this.hiddenSequences.isHidden (this.getSequenceAt (i))) {
+if (this.getSequenceAt (i).getLength () != width) {
+return false;
+}}}
+return true;
+}, "~B");
+Clazz_overrideMethod (c$, "deleteAllAnnotations", 
+function (includingAutoCalculated) {
+var result = false;
+for (var alan, $alan = 0, $$alan = this.getAlignmentAnnotation (); $alan < $$alan.length && ((alan = $$alan[$alan]) || true); $alan++) {
+if (!alan.autoCalculated || includingAutoCalculated) {
+this.deleteAnnotation (alan);
+result = true;
+}}
+return result;
+}, "~B");
+Clazz_defineMethod (c$, "deleteAnnotation", 
+function (aa) {
+return this.deleteAnnotation (aa, true);
+}, "jalview.datamodel.AlignmentAnnotation");
+Clazz_defineMethod (c$, "deleteAnnotation", 
+function (aa, unhook) {
+var aSize = 1;
+if (this.annotations != null) {
+aSize = this.annotations.length;
+}if (aSize < 1) {
+return false;
+}var temp =  new Array (aSize - 1);
+var swap = false;
+var tIndex = 0;
+for (var i = 0; i < aSize; i++) {
+if (this.annotations[i] === aa) {
+swap = true;
+continue;
+}if (tIndex < temp.length) {
+temp[tIndex++] = this.annotations[i];
+}}
+if (swap) {
+this.annotations = temp;
+if (unhook) {
+this.unhookAnnotation (aa);
+}}return swap;
+}, "jalview.datamodel.AlignmentAnnotation,~B");
+Clazz_defineMethod (c$, "unhookAnnotation", 
+ function (aa) {
+if (aa.sequenceRef != null) {
+aa.sequenceRef.removeAlignmentAnnotation (aa);
+}if (aa.groupRef != null) {
+aa.groupRef = null;
+}}, "jalview.datamodel.AlignmentAnnotation");
+Clazz_defineMethod (c$, "addAnnotation", 
+function (aa) {
+this.addAnnotation (aa, -1);
+}, "jalview.datamodel.AlignmentAnnotation");
+Clazz_defineMethod (c$, "addAnnotation", 
+function (aa, pos) {
+if (aa.getRNAStruc () != null) {
+this.$hasRNAStructure = true;
+}var aSize = 1;
+if (this.annotations != null) {
+aSize = this.annotations.length + 1;
+}var temp =  new Array (aSize);
+var i = 0;
+if (pos == -1 || pos >= aSize) {
+temp[aSize - 1] = aa;
+} else {
+temp[pos] = aa;
+}if (aSize > 1) {
+var p = 0;
+for (i = 0; i < (aSize - 1); i++, p++) {
+if (p == pos) {
+p++;
+}if (p < temp.length) {
+temp[p] = this.annotations[i];
+}}
+}this.annotations = temp;
+}, "jalview.datamodel.AlignmentAnnotation,~N");
+Clazz_overrideMethod (c$, "setAnnotationIndex", 
+function (aa, index) {
+if (aa == null || this.annotations == null || this.annotations.length - 1 < index) {
+return;
+}var aSize = this.annotations.length;
+var temp =  new Array (aSize);
+temp[index] = aa;
+for (var i = 0; i < aSize; i++) {
+if (i == index) {
+continue;
+}if (i < index) {
+temp[i] = this.annotations[i];
+} else {
+temp[i] = this.annotations[i - 1];
+}}
+this.annotations = temp;
+}, "jalview.datamodel.AlignmentAnnotation,~N");
+Clazz_defineMethod (c$, "getAlignmentAnnotation", 
+function () {
+return this.annotations;
+});
+Clazz_overrideMethod (c$, "setNucleotide", 
+function (b) {
+if (b) {
+this.type = 1;
+} else {
+this.type = 0;
+}}, "~B");
+Clazz_defineMethod (c$, "isNucleotide", 
+function () {
+if (this.type == 1) {
+return true;
+} else {
+return false;
+}});
+Clazz_overrideMethod (c$, "hasRNAStructure", 
+function () {
+return this.$hasRNAStructure;
+});
+Clazz_overrideMethod (c$, "setDataset", 
+function (data) {
+if (this.dataset == null && data == null) {
+var seqs =  new Array (this.getHeight ());
+var currentSeq;
+for (var i = 0; i < this.getHeight (); i++) {
+currentSeq = this.getSequenceAt (i);
+if (currentSeq.getDatasetSequence () != null) {
+seqs[i] = currentSeq.getDatasetSequence ();
+} else {
+seqs[i] = currentSeq.createDatasetSequence ();
+}}
+this.dataset =  new jalview.datamodel.Alignment (seqs);
+} else if (this.dataset == null && data != null) {
+this.dataset = data;
+for (var i = 0; i < this.getHeight (); i++) {
+var currentSeq = this.getSequenceAt (i);
+var dsq = currentSeq.getDatasetSequence ();
+if (dsq == null) {
+dsq = currentSeq.createDatasetSequence ();
+this.dataset.addSequence (dsq);
+} else {
+while (dsq.getDatasetSequence () != null) {
+dsq = dsq.getDatasetSequence ();
+}
+if (this.dataset.findIndex (dsq) == -1) {
+this.dataset.addSequence (dsq);
+}}}
+}this.dataset.addAlignmentRef ();
+}, "jalview.datamodel.Alignment");
+Clazz_defineMethod (c$, "addAlignmentRef", 
+ function () {
+this.alignmentRefs++;
+});
+Clazz_overrideMethod (c$, "getDataset", 
+function () {
+return this.dataset;
+});
+Clazz_overrideMethod (c$, "padGaps", 
+function () {
+var modified = false;
+var maxLength = -1;
+var current;
+for (var i = 0; i < this.sequences.size (); i++) {
+current = this.getSequenceAt (i);
+for (var j = current.getLength (); j > maxLength; j--) {
+if (j > maxLength && !jalview.util.Comparison.isGap (current.getCharAt (j))) {
+maxLength = j;
+break;
+}}
+}
+maxLength++;
+var cLength;
+for (var i = 0; i < this.sequences.size (); i++) {
+current = this.getSequenceAt (i);
+cLength = current.getLength ();
+if (cLength < maxLength) {
+current.insertCharAt (cLength, maxLength - cLength, this.gapCharacter);
+modified = true;
+} else if (current.getLength () > maxLength) {
+current.deleteChars (maxLength, current.getLength ());
+}}
+return modified;
+});
+Clazz_overrideMethod (c$, "justify", 
+function (right) {
+var modified = false;
+var maxLength = -1;
+var ends =  Clazz_newIntArray (this.sequences.size () * 2, 0);
+var current;
+for (var i = 0; i < this.sequences.size (); i++) {
+current = this.getSequenceAt (i);
+ends[i * 2] = current.findIndex (current.getStart ());
+ends[i * 2 + 1] = current.findIndex (current.getStart () + current.getLength ());
+var hitres = false;
+for (var j = 0, rs = 0, ssiz = current.getLength (); j < ssiz; j++) {
+if (!jalview.util.Comparison.isGap (current.getCharAt (j))) {
+if (!hitres) {
+ends[i * 2] = j;
+hitres = true;
+} else {
+ends[i * 2 + 1] = j;
+if (j - ends[i * 2] > maxLength) {
+maxLength = j - ends[i * 2];
+}}}}
+}
+maxLength++;
+var cLength;
+var extent;
+var diff;
+for (var i = 0; i < this.sequences.size (); i++) {
+current = this.getSequenceAt (i);
+cLength = 1 + ends[i * 2 + 1] - ends[i * 2];
+diff = maxLength - cLength;
+extent = current.getLength ();
+if (right) {
+if (extent > ends[i * 2 + 1]) {
+current.deleteChars (ends[i * 2 + 1] + 1, extent);
+modified = true;
+}if (ends[i * 2] > diff) {
+current.deleteChars (0, ends[i * 2] - diff);
+modified = true;
+} else {
+if (ends[i * 2] < diff) {
+current.insertCharAt (0, diff - ends[i * 2], this.gapCharacter);
+modified = true;
+}}} else {
+if (ends[i * 2] > 0) {
+current.deleteChars (0, ends[i * 2]);
+modified = true;
+ends[i * 2 + 1] -= ends[i * 2];
+extent -= ends[i * 2];
+}if (extent > maxLength) {
+current.deleteChars (maxLength + 1, extent);
+modified = true;
+} else {
+if (extent < maxLength) {
+current.insertCharAt (extent, maxLength - extent, this.gapCharacter);
+modified = true;
+}}}}
+return modified;
+}, "~B");
+Clazz_defineMethod (c$, "getHiddenSequences", 
+function () {
+return this.hiddenSequences;
+});
+Clazz_overrideMethod (c$, "getCompactAlignment", 
+function () {
+{
+var alseqs =  new Array (this.sequences.size ());
+var i = 0;
+for (var seq, $seq = this.sequences.iterator (); $seq.hasNext () && ((seq = $seq.next ()) || true);) {
+alseqs[i++] =  new jalview.datamodel.SeqCigar (seq);
+}
+var cal =  new jalview.datamodel.CigarArray (alseqs);
+cal.addOperation ('M', this.getWidth ());
+return cal;
+}});
+Clazz_overrideMethod (c$, "setProperty", 
+function (key, value) {
+if (this.alignmentProperties == null) {
+this.alignmentProperties =  new java.util.Hashtable ();
+}this.alignmentProperties.put (key, value);
+}, "~O,~O");
+Clazz_defineMethod (c$, "getProperty", 
+function (key) {
+if (this.alignmentProperties != null) {
+return this.alignmentProperties.get (key);
+} else {
+return null;
+}}, "~O");
+Clazz_defineMethod (c$, "getProperties", 
+function () {
+return this.alignmentProperties;
+});
+Clazz_overrideMethod (c$, "addCodonFrame", 
+function (codons) {
+if (codons != null) {
+this.codonFrameList.add (codons);
+}}, "jalview.datamodel.AlignedCodonFrame");
+Clazz_overrideMethod (c$, "getCodonFrame", 
+function (seq) {
+if (seq == null) {
+return null;
+}var cframes =  new java.util.ArrayList ();
+for (var acf, $acf = this.codonFrameList.iterator (); $acf.hasNext () && ((acf = $acf.next ()) || true);) {
+if (acf.involvesSequence (seq)) {
+cframes.add (acf);
+}}
+return cframes;
+}, "jalview.datamodel.SequenceI");
+Clazz_overrideMethod (c$, "setCodonFrames", 
+function (acfs) {
+this.codonFrameList = acfs;
+}, "java.util.Set");
+Clazz_defineMethod (c$, "getCodonFrames", 
+function () {
+return this.codonFrameList;
+});
+Clazz_overrideMethod (c$, "removeCodonFrame", 
+function (codons) {
+if (codons == null || this.codonFrameList == null) {
+return false;
+}return this.codonFrameList.remove (codons);
+}, "jalview.datamodel.AlignedCodonFrame");
+Clazz_overrideMethod (c$, "append", 
+function (toappend) {
+if (toappend === this) {
+System.err.println ("Self append may cause a deadlock.");
+}var samegap = toappend.getGapCharacter () == this.getGapCharacter ();
+var oldc = toappend.getGapCharacter ();
+var hashidden = toappend.getHiddenSequences () != null && toappend.getHiddenSequences ().hiddenSequences != null;
+var sqs = (hashidden) ? toappend.getHiddenSequences ().getFullAlignment ().getSequences () : toappend.getSequences ();
+if (sqs != null) {
+{
+for (var addedsq, $addedsq = sqs.iterator (); $addedsq.hasNext () && ((addedsq = $addedsq.next ()) || true);) {
+if (!samegap) {
+var oldseq = addedsq.getSequence ();
+for (var c = 0; c < oldseq.length; c++) {
+if (oldseq[c] == oldc) {
+oldseq[c] = this.gapCharacter;
+}}
+}this.addSequence (addedsq);
+}
+}}var alan = toappend.getAlignmentAnnotation ();
+for (var a = 0; alan != null && a < alan.length; a++) {
+this.addAnnotation (alan[a]);
+}
+this.codonFrameList.addAll (toappend.getCodonFrames ());
+var sg = toappend.getGroups ();
+if (sg != null) {
+for (var _sg, $_sg = sg.iterator (); $_sg.hasNext () && ((_sg = $_sg.next ()) || true);) {
+this.addGroup (_sg);
+}
+}if (toappend.getHiddenSequences () != null) {
+var hs = toappend.getHiddenSequences ();
+if (this.hiddenSequences == null) {
+this.hiddenSequences =  new jalview.datamodel.HiddenSequences (this);
+}if (hs.hiddenSequences != null) {
+for (var s = 0; s < hs.hiddenSequences.length; s++) {
+if (hs.hiddenSequences[s] != null) {
+this.hiddenSequences.hideSequence (hs.hiddenSequences[s]);
+}}
+}}if (toappend.getProperties () != null) {
+var key = toappend.getProperties ().keys ();
+while (key.hasMoreElements ()) {
+var k = key.nextElement ();
+var ourval = this.getProperty (k);
+var toapprop = toappend.getProperty (k);
+if (ourval != null) {
+if (ourval.getClass ().equals (toapprop.getClass ()) && !ourval.equals (toapprop)) {
+if (Clazz_instanceOf (ourval, String)) {
+this.setProperty (k, (ourval) + "; " + (toapprop));
+} else {
+if (Clazz_instanceOf (ourval, java.util.Vector)) {
+var theirv = (toapprop).elements ();
+while (theirv.hasMoreElements ()) {
+(ourval).addElement (theirv);
+}
+}}}} else {
+this.setProperty (k, toapprop);
+}}
+}}, "jalview.datamodel.AlignmentI");
+Clazz_overrideMethod (c$, "findOrCreateAnnotation", 
+function (name, calcId, autoCalc, seqRef, groupRef) {
+if (this.annotations != null) {
+for (var annot, $annot = 0, $$annot = this.getAlignmentAnnotation (); $annot < $$annot.length && ((annot = $$annot[$annot]) || true); $annot++) {
+if (annot.autoCalculated == autoCalc && (name.equals (annot.label)) && (calcId == null || annot.getCalcId ().equals (calcId)) && annot.sequenceRef === seqRef && annot.groupRef === groupRef) {
+return annot;
+}}
+}var annot =  new jalview.datamodel.AlignmentAnnotation (name, name,  new Array (1), 0, 0, 1);
+annot.hasText = false;
+annot.setCalcId ( String.instantialize (calcId));
+annot.autoCalculated = autoCalc;
+if (seqRef != null) {
+annot.setSequenceRef (seqRef);
+}annot.groupRef = groupRef;
+this.addAnnotation (annot);
+return annot;
+}, "~S,~S,~B,jalview.datamodel.SequenceI,jalview.datamodel.SequenceGroup");
+Clazz_overrideMethod (c$, "findAnnotation", 
+function (calcId) {
+var aa =  new java.util.ArrayList ();
+for (var a, $a = 0, $$a = this.getAlignmentAnnotation (); $a < $$a.length && ((a = $$a[$a]) || true); $a++) {
+if (a.getCalcId () === calcId || (a.getCalcId () != null && calcId != null && a.getCalcId ().equals (calcId))) {
+aa.add (a);
+}}
+return aa;
+}, "~S");
+Clazz_overrideMethod (c$, "findAnnotations", 
+function (seq, calcId, label) {
+var aa =  new java.util.ArrayList ();
+for (var ann, $ann = 0, $$ann = this.getAlignmentAnnotation (); $ann < $$ann.length && ((ann = $$ann[$ann]) || true); $ann++) {
+if (ann.getCalcId () != null && ann.getCalcId ().equals (calcId) && ann.sequenceRef != null && ann.sequenceRef === seq && ann.label != null && ann.label.equals (label)) {
+aa.add (ann);
+}}
+return aa;
+}, "jalview.datamodel.SequenceI,~S,~S");
+Clazz_overrideMethod (c$, "moveSelectedSequencesByOne", 
+function (sg, map, up) {
+{
+if (up) {
+for (var i = 1, iSize = this.sequences.size (); i < iSize; i++) {
+var seq = this.sequences.get (i);
+if (!sg.getSequences (map).contains (seq)) {
+continue;
+}var temp = this.sequences.get (i - 1);
+if (sg.getSequences (null).contains (temp)) {
+continue;
+}this.sequences.set (i, temp);
+this.sequences.set (i - 1, seq);
+}
+} else {
+for (var i = this.sequences.size () - 2; i > -1; i--) {
+var seq = this.sequences.get (i);
+if (!sg.getSequences (map).contains (seq)) {
+continue;
+}var temp = this.sequences.get (i + 1);
+if (sg.getSequences (map).contains (temp)) {
+continue;
+}this.sequences.set (i, temp);
+this.sequences.set (i + 1, seq);
+}
+}}}, "jalview.datamodel.SequenceGroup,java.util.Map,~B");
+Clazz_overrideMethod (c$, "validateAnnotation", 
+function (alignmentAnnotation) {
+alignmentAnnotation.validateRangeAndDisplay ();
+if (this.isNucleotide () && alignmentAnnotation.isValidStruc ()) {
+this.$hasRNAStructure = true;
+}}, "jalview.datamodel.AlignmentAnnotation");
+Clazz_overrideMethod (c$, "getSeqrep", 
+function () {
+return this.seqrep;
+});
+Clazz_overrideMethod (c$, "setSeqrep", 
+function (seqrep) {
+this.seqrep = seqrep;
+}, "jalview.datamodel.SequenceI");
+Clazz_overrideMethod (c$, "hasSeqrep", 
+function () {
+return this.seqrep != null;
+});
+Clazz_overrideMethod (c$, "getEndRes", 
+function () {
+return this.getWidth () - 1;
+});
+Clazz_overrideMethod (c$, "getStartRes", 
+function () {
+return 0;
+});
+Clazz_overrideMethod (c$, "getContext", 
+function () {
+return this.dataset;
+});
+Clazz_defineMethod (c$, "alignAs", 
+function (al) {
+return this.alignAs (al, false, true);
+}, "jalview.datamodel.AlignmentI");
+Clazz_defineMethod (c$, "alignAs", 
+function (al, preserveMappedGaps, preserveUnmappedGaps) {
+var count = 0;
+var thisIsNucleotide = this.isNucleotide ();
+var thatIsProtein = !al.isNucleotide ();
+if (!thatIsProtein && !thisIsNucleotide) {
+return jalview.analysis.AlignmentUtils.alignProteinAsDna (this, al);
+}var thisGapChar = this.getGapCharacter ();
+var gap = thisIsNucleotide && thatIsProtein ? String.valueOf ( Clazz_newCharArray (-1, [thisGapChar, thisGapChar, thisGapChar])) : String.valueOf (thisGapChar);
+for (var alignTo, $alignTo = this.getSequences ().iterator (); $alignTo.hasNext () && ((alignTo = $alignTo.next ()) || true);) {
+count += jalview.analysis.AlignmentUtils.alignSequenceAs (alignTo, al, gap, preserveMappedGaps, preserveUnmappedGaps) ? 1 : 0;
+}
+return count;
+}, "jalview.datamodel.AlignmentI,~B,~B");
+Clazz_overrideMethod (c$, "getSequenceNames", 
+function () {
+var names =  new java.util.HashSet ();
+for (var seq, $seq = this.getSequences ().iterator (); $seq.hasNext () && ((seq = $seq.next ()) || true);) {
+names.add (seq.getName ());
+}
+return names;
+});
+Clazz_overrideMethod (c$, "toString", 
+function () {
+var seq = this.getSequencesArray ();
+{
+return "" + JSON.stringify(seq);
+}});
+Clazz_defineStatics (c$,
+"PROTEIN", 0,
+"NUCLEOTIDE", 1);
+});
+Clazz_declarePackage ("jalview.datamodel");
+Clazz_load (["jalview.datamodel.AnnotatedCollectionI"], "jalview.datamodel.AlignmentI", null, function () {
+Clazz_declareInterface (jalview.datamodel, "AlignmentI", jalview.datamodel.AnnotatedCollectionI);
+});
+Clazz_declarePackage ("jalview.datamodel");
+Clazz_load (null, "jalview.datamodel.HiddenSequences", ["jalview.datamodel.Alignment", "java.util.ArrayList"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.hiddenSequences = null;
+this.alignment = null;
+Clazz_instantialize (this, arguments);
+}, jalview.datamodel, "HiddenSequences");
+Clazz_makeConstructor (c$, 
+function (al) {
+this.alignment = al;
+}, "jalview.datamodel.AlignmentI");
+Clazz_defineMethod (c$, "getSize", 
+function () {
+if (this.hiddenSequences == null) {
+return 0;
+}var count = 0;
+for (var i = 0; i < this.hiddenSequences.length; i++) {
+if (this.hiddenSequences[i] != null) {
+count++;
+}}
+return count;
+});
+Clazz_defineMethod (c$, "getWidth", 
+function () {
+var width = 0;
+for (var i = 0; i < this.hiddenSequences.length; i++) {
+if (this.hiddenSequences[i] != null && this.hiddenSequences[i].getLength () > width) {
+width = this.hiddenSequences[i].getLength ();
+}}
+return width;
+});
+Clazz_defineMethod (c$, "adjustHeightSequenceDeleted", 
+function (seqIndex) {
+if (this.hiddenSequences == null) {
+return;
+}var alHeight = this.alignment.getHeight ();
+var tmp =  new Array (alHeight + this.getSize ());
+var deletionIndex = this.adjustForHiddenSeqs (seqIndex);
+for (var i = 0; i < this.hiddenSequences.length; i++) {
+if (this.hiddenSequences[i] == null) {
+continue;
+}if (i > deletionIndex) {
+tmp[i - 1] = this.hiddenSequences[i];
+} else {
+tmp[i] = this.hiddenSequences[i];
+}}
+this.hiddenSequences = tmp;
+}, "~N");
+Clazz_defineMethod (c$, "adjustHeightSequenceAdded", 
+function () {
+if (this.hiddenSequences == null) {
+return;
+}var alHeight = this.alignment.getHeight ();
+var tmp =  new Array (alHeight + this.getSize ());
+System.arraycopy (this.hiddenSequences, 0, tmp, 0, this.hiddenSequences.length);
+this.hiddenSequences = tmp;
+});
+Clazz_defineMethod (c$, "hideSequence", 
+function (sequence) {
+if (this.hiddenSequences == null) {
+this.hiddenSequences =  new Array (this.alignment.getHeight ());
+}var alignmentIndex = this.alignment.findIndex (sequence);
+alignmentIndex = this.adjustForHiddenSeqs (alignmentIndex);
+if (this.hiddenSequences[alignmentIndex] != null) {
+System.out.println ("ERROR!!!!!!!!!!!");
+}this.hiddenSequences[alignmentIndex] = sequence;
+this.alignment.deleteSequence (sequence);
+}, "jalview.datamodel.SequenceI");
+Clazz_defineMethod (c$, "showAll", 
+function (hiddenRepSequences) {
+var revealedSeqs =  new java.util.ArrayList ();
+for (var i = 0; i < this.hiddenSequences.length; i++) {
+if (this.hiddenSequences[i] != null) {
+var tmp = this.showSequence (i, hiddenRepSequences);
+for (var seq, $seq = tmp.iterator (); $seq.hasNext () && ((seq = $seq.next ()) || true);) {
+revealedSeqs.add (seq);
+}
+}}
+return revealedSeqs;
+}, "java.util.Map");
+Clazz_defineMethod (c$, "showSequence", 
+function (alignmentIndex, hiddenRepSequences) {
+var revealedSeqs =  new java.util.ArrayList ();
+var repSequence = this.alignment.getSequenceAt (alignmentIndex);
+if (repSequence != null && hiddenRepSequences != null && hiddenRepSequences.containsKey (repSequence)) {
+hiddenRepSequences.remove (repSequence);
+revealedSeqs.add (repSequence);
+}var start = this.adjustForHiddenSeqs (alignmentIndex - 1);
+var end = this.adjustForHiddenSeqs (alignmentIndex);
+if (end >= this.hiddenSequences.length) {
+end = this.hiddenSequences.length - 1;
+}var asequences;
+{
+for (var index = end; index > start; index--) {
+var seq = this.hiddenSequences[index];
+this.hiddenSequences[index] = null;
+if (seq != null) {
+if (seq.getLength () > 0) {
+revealedSeqs.add (seq);
+asequences.add (alignmentIndex, seq);
+} else {
+System.out.println (seq.getName () + " has been deleted whilst hidden");
+}}}
+}return revealedSeqs;
+}, "~N,java.util.Map");
+Clazz_defineMethod (c$, "getHiddenSequence", 
+function (alignmentIndex) {
+return this.hiddenSequences[alignmentIndex];
+}, "~N");
+Clazz_defineMethod (c$, "findIndexWithoutHiddenSeqs", 
+function (alignmentIndex) {
+var index = 0;
+var hiddenSeqs = 0;
+if (this.hiddenSequences.length <= alignmentIndex) {
+alignmentIndex = this.hiddenSequences.length - 1;
+}while (index <= alignmentIndex) {
+if (this.hiddenSequences[index] != null) {
+hiddenSeqs++;
+}index++;
+}
+;return (alignmentIndex - hiddenSeqs);
+}, "~N");
+Clazz_defineMethod (c$, "adjustForHiddenSeqs", 
+function (alignmentIndex) {
+var index = 0;
+var hSize = this.hiddenSequences.length;
+while (index <= alignmentIndex && index < hSize) {
+if (this.hiddenSequences[index] != null) {
+alignmentIndex++;
+}index++;
+}
+;return alignmentIndex;
+}, "~N");
+Clazz_defineMethod (c$, "getFullAlignment", 
+function () {
+var isize = this.hiddenSequences.length;
+var seq =  new Array (isize);
+var index = 0;
+for (var i = 0; i < this.hiddenSequences.length; i++) {
+if (this.hiddenSequences[i] != null) {
+seq[i] = this.hiddenSequences[i];
+} else {
+seq[i] = this.alignment.getSequenceAt (index);
+index++;
+}}
+var fAlignmt =  new jalview.datamodel.Alignment (seq);
+fAlignmt.annotations = this.alignment.getAlignmentAnnotation ();
+fAlignmt.alignmentProperties = this.alignment.getProperties ();
+fAlignmt.groups = this.alignment.getGroups ();
+fAlignmt.$hasRNAStructure = this.alignment.hasRNAStructure ();
+return fAlignmt;
+});
+Clazz_defineMethod (c$, "isHidden", 
+function (seq) {
+if (this.hiddenSequences != null) {
+for (var i = 0; i < this.hiddenSequences.length; i++) {
+if (this.hiddenSequences[i] != null && this.hiddenSequences[i] === seq) {
+return true;
+}}
+}return false;
+}, "jalview.datamodel.SequenceI");
+});
+Clazz_load(["java.util.HashSet","$.Set"],"java.util.LinkedHashSet",["java.util.LinkedHashMap"],function(){
+c$=Clazz_declareType(java.util,"LinkedHashSet",java.util.HashSet,[java.util.Set,Cloneable,java.io.Serializable]);
+Clazz_makeConstructor(c$,
+function(){
+Clazz_superConstructor(this,java.util.LinkedHashSet,[new java.util.LinkedHashMap()]);
+});
+Clazz_makeConstructor(c$,
+function(capacity){
+Clazz_superConstructor(this,java.util.LinkedHashSet,[new java.util.LinkedHashMap(capacity)]);
+},"~N");
+Clazz_makeConstructor(c$,
+function(capacity,loadFactor){
+Clazz_superConstructor(this,java.util.LinkedHashSet,[new java.util.LinkedHashMap(capacity,loadFactor)]);
+},"~N,~N");
+Clazz_makeConstructor(c$,
+function(collection){
+Clazz_superConstructor(this,java.util.LinkedHashSet,[new java.util.LinkedHashMap(collection.size()<6?11:collection.size()*2)]);
+for(var e,$e=collection.iterator();$e.hasNext()&&((e=$e.next())||true);){
+this.add(e);
+}
+},"java.util.Collection");
+Clazz_overrideMethod(c$,"createBackingMap",
+function(capacity,loadFactor){
+return new java.util.LinkedHashMap(capacity,loadFactor);
+},"~N,~N");
+});
+Clazz_load(["java.util.HashMap"],"java.util.LinkedHashMap",["java.lang.IllegalStateException","java.util.AbstractCollection","$.AbstractSet","java.util.MapEntry.Type","java.util.NoSuchElementException"],function(){
+c$=Clazz_decorateAsClass(function(){
+this.accessOrder=false;
+this.head=null;
+this.tail=null;
+Clazz_instantialize(this,arguments);
+},java.util,"LinkedHashMap",java.util.HashMap);
+Clazz_makeConstructor(c$,
+function(){
+Clazz_superConstructor(this,java.util.LinkedHashMap);
+this.accessOrder=false;
+this.head=null;
+});
+Clazz_makeConstructor(c$,
+function(s){
+Clazz_superConstructor(this,java.util.LinkedHashMap,[s]);
+this.accessOrder=false;
+this.head=null;
+},"~N");
+Clazz_makeConstructor(c$,
+function(s,lf){
+Clazz_superConstructor(this,java.util.LinkedHashMap,[s,lf]);
+this.accessOrder=false;
+this.head=null;
+this.tail=null;
+},"~N,~N");
+Clazz_makeConstructor(c$,
+function(s,lf,order){
+Clazz_superConstructor(this,java.util.LinkedHashMap,[s,lf]);
+this.accessOrder=order;
+this.head=null;
+this.tail=null;
+},"~N,~N,~B");
+Clazz_makeConstructor(c$,
+function(m){
+Clazz_superConstructor(this,java.util.LinkedHashMap,[]);
+this.accessOrder=false;
+this.head=null;
+this.tail=null;
+this.putAll(m);
+},"java.util.Map");
+Clazz_overrideMethod(c$,"newElementArray",
+function(s){
+return new Array(s);
+},"~N");
+Clazz_overrideMethod(c$,"get",
+function(key){
+var m=this.getEntry(key);
+if(m==null){
+return null;
+}if(this.accessOrder&&this.tail!==m){
+var p=m.chainBackward;
+var n=m.chainForward;
+n.chainBackward=p;
+if(p!=null){
+p.chainForward=n;
+}else{
+this.head=n;
+}m.chainForward=null;
+m.chainBackward=this.tail;
+this.tail.chainForward=m;
+this.tail=m;
+}return m.value;
+},"~O");
+Clazz_overrideMethod(c$,"createEntry",
+function(key,index,value){
+var m=new java.util.LinkedHashMap.LinkedHashMapEntry(key,value);
+m.next=this.elementData[index];
+this.elementData[index]=m;
+this.linkEntry(m);
+return m;
+},"~O,~N,~O");
+Clazz_overrideMethod(c$,"put",
+function(key,value){
+var index=this.getModuloHash(key);
+var m=this.findEntry(key,index);
+if(m==null){
+this.modCount++;
+if(++this.elementCount>this.threshold){
+this.rehash();
+index=key==null?0:(key.hashCode()&0x7FFFFFFF)%this.elementData.length;
+}m=this.createEntry(key,index,null);
+}else{
+this.linkEntry(m);
+}var result=m.value;
+m.value=value;
+if(this.removeEldestEntry(this.head)){
+this.remove(this.head.key);
+}return result;
+},"~O,~O");
+Clazz_defineMethod(c$,"linkEntry",
+function(m){
+if(this.tail===m){
+return;
+}if(this.head==null){
+this.head=this.tail=m;
+return;
+}var p=m.chainBackward;
+var n=m.chainForward;
+if(p==null){
+if(n!=null){
+if(this.accessOrder){
+this.head=n;
+n.chainBackward=null;
+m.chainBackward=this.tail;
+m.chainForward=null;
+this.tail.chainForward=m;
+this.tail=m;
+}}else{
+m.chainBackward=this.tail;
+m.chainForward=null;
+this.tail.chainForward=m;
+this.tail=m;
+}return;
+}if(n==null){
+return;
+}if(this.accessOrder){
+p.chainForward=n;
+n.chainBackward=p;
+m.chainForward=null;
+m.chainBackward=this.tail;
+this.tail.chainForward=m;
+this.tail=m;
+}},"java.util.LinkedHashMap.LinkedHashMapEntry");
+Clazz_overrideMethod(c$,"entrySet",
+function(){
+return new java.util.LinkedHashMap.LinkedHashMapEntrySet(this);
+});
+Clazz_overrideMethod(c$,"keySet",
+function(){
+if(this.$keySet==null){
+this.$keySet=((Clazz_isClassDefined("java.util.LinkedHashMap$1")?0:java.util.LinkedHashMap.$LinkedHashMap$1$()),Clazz_innerTypeInstance(java.util.LinkedHashMap$1,this,null));
+}return this.$keySet;
+});
+Clazz_overrideMethod(c$,"values",
+function(){
+if(this.valuesCollection==null){
+this.valuesCollection=((Clazz_isClassDefined("java.util.LinkedHashMap$2")?0:java.util.LinkedHashMap.$LinkedHashMap$2$()),Clazz_innerTypeInstance(java.util.LinkedHashMap$2,this,null));
+}return this.valuesCollection;
+});
+Clazz_overrideMethod(c$,"remove",
+function(key){
+var m=this.removeEntry(key);
+if(m==null){
+return null;
+}var p=m.chainBackward;
+var n=m.chainForward;
+if(p!=null){
+p.chainForward=n;
+}else{
+this.head=n;
+}if(n!=null){
+n.chainBackward=p;
+}else{
+this.tail=p;
+}return m.value;
+},"~O");
+Clazz_defineMethod(c$,"removeEldestEntry",
+function(eldest){
+return false;
+},"java.util.Map.Entry");
+Clazz_defineMethod(c$,"clear",
+function(){
+Clazz_superCall(this,java.util.LinkedHashMap,"clear",[]);
+this.head=this.tail=null;
+});
+Clazz_defineMethod(c$,"clone",
+function(){
+var map=Clazz_superCall(this,java.util.LinkedHashMap,"clone",[]);
+map.clear();
+for(var entry,$entry=this.entrySet().iterator();$entry.hasNext()&&((entry=$entry.next())||true);){
+map.put(entry.getKey(),entry.getValue());
+}
+return map;
+});
+c$.$LinkedHashMap$1$=function(){
+Clazz_pu$h(self.c$);
+c$=Clazz_declareAnonymous(java.util,"LinkedHashMap$1",java.util.AbstractSet);
+Clazz_overrideMethod(c$,"contains",
+function(object){
+return this.b$["java.util.LinkedHashMap"].containsKey(object);
+},"~O");
+Clazz_overrideMethod(c$,"size",
+function(){
+return this.b$["java.util.LinkedHashMap"].size();
+});
+Clazz_overrideMethod(c$,"clear",
+function(){
+this.b$["java.util.LinkedHashMap"].clear();
+});
+Clazz_overrideMethod(c$,"remove",
+function(key){
+if(this.b$["java.util.LinkedHashMap"].containsKey(key)){
+this.b$["java.util.LinkedHashMap"].remove(key);
+return true;
+}return false;
+},"~O");
+Clazz_overrideMethod(c$,"iterator",
+function(){
+return new java.util.LinkedHashMap.LinkedHashIterator(((Clazz_isClassDefined("java.util.LinkedHashMap$1$1")?0:java.util.LinkedHashMap.$LinkedHashMap$1$1$()),Clazz_innerTypeInstance(java.util.LinkedHashMap$1$1,this,null)),this.b$["java.util.LinkedHashMap"]);
+});
+c$=Clazz_p0p();
+};
+c$.$LinkedHashMap$1$1$=function(){
+Clazz_pu$h(self.c$);
+c$=Clazz_declareAnonymous(java.util,"LinkedHashMap$1$1",null,java.util.MapEntry.Type);
+Clazz_overrideMethod(c$,"get",
+function(entry){
+return entry.key;
+},"java.util.MapEntry");
+c$=Clazz_p0p();
+};
+c$.$LinkedHashMap$2$=function(){
+Clazz_pu$h(self.c$);
+c$=Clazz_declareAnonymous(java.util,"LinkedHashMap$2",java.util.AbstractCollection);
+Clazz_overrideMethod(c$,"contains",
+function(object){
+return this.b$["java.util.LinkedHashMap"].containsValue(object);
+},"~O");
+Clazz_overrideMethod(c$,"size",
+function(){
+return this.b$["java.util.LinkedHashMap"].size();
+});
+Clazz_overrideMethod(c$,"clear",
+function(){
+this.b$["java.util.LinkedHashMap"].clear();
+});
+Clazz_overrideMethod(c$,"iterator",
+function(){
+return new java.util.LinkedHashMap.LinkedHashIterator(((Clazz_isClassDefined("java.util.LinkedHashMap$2$1")?0:java.util.LinkedHashMap.$LinkedHashMap$2$1$()),Clazz_innerTypeInstance(java.util.LinkedHashMap$2$1,this,null)),this.b$["java.util.LinkedHashMap"]);
+});
+c$=Clazz_p0p();
+};
+c$.$LinkedHashMap$2$1$=function(){
+Clazz_pu$h(self.c$);
+c$=Clazz_declareAnonymous(java.util,"LinkedHashMap$2$1",null,java.util.MapEntry.Type);
+Clazz_overrideMethod(c$,"get",
+function(entry){
+return entry.value;
+},"java.util.MapEntry");
+c$=Clazz_p0p();
+};
+Clazz_pu$h(self.c$);
+c$=Clazz_declareType(java.util.LinkedHashMap,"LinkedHashIterator",java.util.HashMap.HashMapIterator);
+Clazz_makeConstructor(c$,
+function(a,b){
+Clazz_superConstructor(this,java.util.LinkedHashMap.LinkedHashIterator,[a,b]);
+this.entry=b.head;
+},"java.util.MapEntry.Type,java.util.LinkedHashMap");
+Clazz_overrideMethod(c$,"hasNext",
+function(){
+return(this.entry!=null);
+});
+Clazz_overrideMethod(c$,"next",
+function(){
+this.checkConcurrentMod();
+if(!this.hasNext()){
+throw new java.util.NoSuchElementException();
+}var a=this.type.get(this.entry);
+this.lastEntry=this.entry;
+this.entry=(this.entry).chainForward;
+this.canRemove=true;
+return a;
+});
+Clazz_overrideMethod(c$,"remove",
+function(){
+this.checkConcurrentMod();
+if(!this.canRemove){
+throw new IllegalStateException();
+}this.canRemove=false;
+this.associatedMap.modCount++;
+var a=this.associatedMap.getModuloHash(this.lastEntry.key);
+var b=this.associatedMap.elementData[a];
+if(b===this.lastEntry){
+this.associatedMap.elementData[a]=this.lastEntry.next;
+}else{
+while(b.next!=null){
+if(b.next===this.lastEntry){
+break;
+}b=b.next;
+}
+b.next=this.lastEntry.next;
+}var c=this.lastEntry;
+var d=c.chainBackward;
+var e=c.chainForward;
+var f=this.associatedMap;
+if(d!=null){
+d.chainForward=e;
+if(e!=null){
+e.chainBackward=d;
+}else{
+f.tail=d;
+}}else{
+f.head=e;
+if(e!=null){
+e.chainBackward=null;
+}else{
+f.tail=null;
+}}this.associatedMap.elementCount--;
+this.expectedModCount++;
+});
+c$=Clazz_p0p();
+Clazz_pu$h(self.c$);
+c$=Clazz_declareType(java.util.LinkedHashMap,"LinkedHashMapEntrySet",java.util.HashMap.HashMapEntrySet);
+Clazz_overrideMethod(c$,"iterator",
+function(){
+return new java.util.LinkedHashMap.LinkedHashIterator(((Clazz_isClassDefined("java.util.LinkedHashMap$LinkedHashMapEntrySet$1")?0:java.util.LinkedHashMap.LinkedHashMapEntrySet.$LinkedHashMap$LinkedHashMapEntrySet$1$()),Clazz_innerTypeInstance(java.util.LinkedHashMap$LinkedHashMapEntrySet$1,this,null)),this.hashMap());
+});
+c$.$LinkedHashMap$LinkedHashMapEntrySet$1$=function(){
+Clazz_pu$h(self.c$);
+c$=Clazz_declareAnonymous(java.util,"LinkedHashMap$LinkedHashMapEntrySet$1",null,java.util.MapEntry.Type);
+Clazz_overrideMethod(c$,"get",
+function(a){
+return a;
+},"java.util.MapEntry");
+c$=Clazz_p0p();
+};
+c$=Clazz_p0p();
+Clazz_pu$h(self.c$);
+c$=Clazz_decorateAsClass(function(){
+this.chainForward=null;
+this.chainBackward=null;
+Clazz_instantialize(this,arguments);
+},java.util.LinkedHashMap,"LinkedHashMapEntry",java.util.HashMap.Entry);
+Clazz_makeConstructor(c$,
+function(a,b){
+Clazz_superConstructor(this,java.util.LinkedHashMap.LinkedHashMapEntry,[a,b]);
+this.chainForward=null;
+this.chainBackward=null;
+},"~O,~O");
+Clazz_defineMethod(c$,"clone",
+function(){
+var a=Clazz_superCall(this,java.util.LinkedHashMap.LinkedHashMapEntry,"clone",[]);
+a.chainBackward=this.chainBackward;
+a.chainForward=this.chainForward;
+var b=a.next;
+if(b!=null){
+a.next=b.clone();
+}return a;
+});
+c$=Clazz_p0p();
+});
+Clazz_declarePackage ("jalview.datamodel");
+Clazz_load (["jalview.datamodel.CigarBase"], "jalview.datamodel.CigarArray", ["jalview.datamodel.CigarCigar", "$.SeqCigar", "java.lang.StringBuffer", "java.util.Vector"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.refCigars = null;
+this.seqcigararray = false;
+Clazz_instantialize (this, arguments);
+}, jalview.datamodel, "CigarArray", jalview.datamodel.CigarBase);
+Clazz_defineMethod (c$, "isSeqCigarArray", 
+function () {
+return this.seqcigararray;
+});
+Clazz_makeConstructor (c$, 
+function (cigars) {
+Clazz_superConstructor (this, jalview.datamodel.CigarArray);
+this.seqcigararray = true;
+if (cigars != null && cigars.length > 0) {
+this.refCigars =  new Array (cigars.length);
+for (var c = 0; c < cigars.length; c++) {
+this.refCigars[c] = cigars[c];
+if (!((Clazz_instanceOf (cigars[c], jalview.datamodel.SeqCigar)) || Clazz_instanceOf (cigars[c], jalview.datamodel.CigarCigar))) {
+this.seqcigararray = false;
+}}
+}}, "~A");
+Clazz_makeConstructor (c$, 
+function (alignment, columnSelection, selectionGroup) {
+this.construct (jalview.datamodel.CigarArray.constructSeqCigarArray (alignment, selectionGroup));
+this.constructFromAlignment (alignment, columnSelection != null ? columnSelection.getHiddenColumns () : null, selectionGroup);
+}, "jalview.datamodel.AlignmentI,jalview.datamodel.ColumnSelection,jalview.datamodel.SequenceGroup");
+c$._calcStartEndBounds = Clazz_defineMethod (c$, "_calcStartEndBounds", 
+ function (alignment, selectionGroup) {
+var startend =  Clazz_newIntArray (-1, [0, 0, 0]);
+if (selectionGroup != null) {
+startend[0] = selectionGroup.getSize ();
+startend[1] = selectionGroup.getStartRes ();
+startend[2] = selectionGroup.getEndRes ();
+} else {
+startend[0] = alignment.getHeight ();
+startend[2] = alignment.getWidth () - 1;
+}return startend;
+}, "jalview.datamodel.AlignmentI,jalview.datamodel.SequenceGroup");
+c$.constructSeqCigarArray = Clazz_defineMethod (c$, "constructSeqCigarArray", 
+function (alignment, selectionGroup) {
+var seqs = null;
+var i;
+var iSize;
+var _startend = jalview.datamodel.CigarArray._calcStartEndBounds (alignment, selectionGroup);
+var start = _startend[1];
+var end = _startend[2];
+if (selectionGroup != null) {
+iSize = selectionGroup.getSize ();
+seqs = selectionGroup.getSequencesInOrder (alignment);
+start = selectionGroup.getStartRes ();
+end = selectionGroup.getEndRes ();
+} else {
+iSize = alignment.getHeight ();
+seqs = alignment.getSequencesArray ();
+end = alignment.getWidth () - 1;
+}var selseqs =  new Array (iSize);
+for (i = 0; i < iSize; i++) {
+selseqs[i] =  new jalview.datamodel.SeqCigar (seqs[i], start, end);
+}
+return selseqs;
+}, "jalview.datamodel.AlignmentI,jalview.datamodel.SequenceGroup");
+Clazz_defineMethod (c$, "constructFromAlignment", 
+ function (alignment, list, selectionGroup) {
+var _startend = jalview.datamodel.CigarArray._calcStartEndBounds (alignment, selectionGroup);
+var start = _startend[1];
+var end = _startend[2];
+if (list != null) {
+var region;
+var hideStart;
+var hideEnd;
+var last = start;
+for (var j = 0;  new Boolean (last < end & j < list.size ()).valueOf (); j++) {
+region = list.get (j);
+hideStart = region[0];
+hideEnd = region[1];
+if (hideStart < last) {
+if (hideEnd > last) {
+hideStart = last;
+} else {
+continue;
+}}if (hideStart > end) {
+break;
+}if (hideEnd > end) {
+hideEnd = end;
+}if (hideStart > hideEnd) {
+break;
+}if (last < hideStart) {
+this.addOperation ('M', hideStart - last);
+}this.addOperation ('D', 1 + hideEnd - hideStart);
+last = hideEnd + 1;
+}
+if (last < end) {
+this.addOperation ('M', end - last + 1);
+}} else {
+this.addOperation ('M', end - start + 1);
+}}, "jalview.datamodel.AlignmentI,java.util.List,jalview.datamodel.SequenceGroup");
+Clazz_defineMethod (c$, "getArrayofSequenceAndDeletions", 
+function (GapChar) {
+if (this.refCigars == null || this.refCigars.length == 0 || this.length == 0) {
+return null;
+}var sqanddels =  new Array (this.refCigars.length);
+for (var c = 0; c < this.refCigars.length; c++) {
+var refString = this.refCigars[c].getSequenceString (GapChar);
+if (refString != null) {
+sqanddels[c] = this.getSequenceAndDeletions (refString, GapChar);
+} else {
+sqanddels[c] = null;
+}}
+return sqanddels;
+}, "~S");
+Clazz_defineMethod (c$, "getSequenceString", 
+function (GapChar) {
+if (this.length == 0 || this.refCigars == null) {
+return "";
+}var seqStrings =  new StringBuffer ();
+var sqanddels = this.getArrayofSequenceAndDeletions (GapChar);
+for (var c = 0; c < this.refCigars.length; c++) {
+if (sqanddels[c] != null) {
+seqStrings.append (sqanddels[c][0]);
+sqanddels[c][0] = null;
+}seqStrings.append ('\n');
+}
+return seqStrings.toString ();
+}, "~S");
+Clazz_defineMethod (c$, "getSequenceStrings", 
+function (GapChar) {
+if (this.length == 0 || this.refCigars == null || this.refCigars.length == 0) {
+return null;
+}var sqanddels = this.getArrayofSequenceAndDeletions (GapChar);
+var seqs =  new Array (sqanddels.length);
+for (var c = 0; c < this.refCigars.length; c++) {
+seqs[c] = sqanddels[c][0];
+}
+return seqs;
+}, "~S");
+Clazz_defineMethod (c$, "applyDeletions", 
+function () {
+var delpos = null;
+if (this.length == 0) {
+return null;
+}var cursor = 0;
+var vcursor = 0;
+var offset = 0;
+var i = 0;
+while (i < this.length) {
+if (this.operation[i] != 'D') {
+if (this.operation[i] == 'M') {
+cursor += this.range[i];
+}vcursor += this.range[i++];
+} else {
+if (delpos == null) {
+delpos =  new java.util.Vector ();
+}var delstart = cursor;
+var delend = cursor + this.range[i] - 1;
+delpos.addElement ( Clazz_newIntArray (-1, [vcursor + offset, this.range[i]]));
+offset += this.range[i] - 1;
+System.arraycopy (this.operation, i + 1, this.operation, i, this.length - i);
+System.arraycopy (this.range, i + 1, this.range, i, this.length - i);
+this.length--;
+for (var s = 0; s < this.refCigars.length; s++) {
+var d = this.refCigars[s].deleteRange (delstart, delend);
+}
+}}
+if (delpos != null) {
+var pos =  Clazz_newIntArray (delpos.size () * 2, 0);
+for (var k = 0, l = delpos.size (); k < l; k++) {
+var dr = (delpos.elementAt (k));
+pos[k * 2] = dr[0];
+pos[k * 2 + 1] = dr[1];
+delpos.setElementAt (null, k);
+}
+delpos = null;
+return pos;
+}return null;
+});
+Clazz_defineMethod (c$, "getSeqCigarArray", 
+function () {
+if (!this.isSeqCigarArray ()) {
+return null;
+}var sa =  new Array (this.refCigars.length);
+for (var i = 0; i < this.refCigars.length; i++) {
+sa[i] = this.refCigars[i];
+}
+return sa;
+});
+});
+Clazz_declarePackage ("jalview.datamodel");
+Clazz_load (null, "jalview.datamodel.CigarBase", ["jalview.util.MessageManager", "java.lang.Error", "$.Exception", "$.StringBuffer", "java.util.Vector", "JU.AU"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.length = 0;
+this._inc_length = 10;
+this.operation = null;
+this.range = null;
+Clazz_instantialize (this, arguments);
+}, jalview.datamodel, "CigarBase");
+Clazz_makeConstructor (c$, 
+function () {
+});
+Clazz_defineMethod (c$, "getSequenceAndDeletions", 
+function (reference, GapChar) {
+var rlength = 0;
+var deletions = JU.AU.newInt2 (this.length);
+var trunc_deletions = null;
+var sq =  new StringBuffer ();
+var cursor = 0;
+var alcursor = 0;
+var start = 0;
+var startpos = 0;
+var end = 0;
+var endpos = 0;
+var delcount = -1;
+var consecutive_del = false;
+if (this.length == 0) {
+return null;
+}if (reference != null) {
+rlength = reference.length;
+}var modstart = true;
+for (var i = 0; i < this.length; i++) {
+switch (this.operation[i]) {
+case 'D':
+if (!consecutive_del) {
+deletions[++delcount] =  Clazz_newIntArray (-1, [cursor, 0, alcursor]);
+}cursor += this.range[i];
+deletions[delcount][1] = cursor - 1;
+consecutive_del = true;
+break;
+case 'I':
+consecutive_del = false;
+for (var r = 0; r < this.range[i]; r++) {
+sq.append (GapChar);
+alcursor++;
+}
+break;
+case 'M':
+consecutive_del = false;
+if (modstart) {
+start = cursor;
+startpos = alcursor;
+modstart = false;
+}if (reference != null) {
+var sbend = cursor + this.range[i];
+if (sbend > rlength) {
+sq.append (reference.substring (cursor, rlength));
+while (sbend-- >= rlength) {
+sq.append (GapChar);
+}
+} else {
+sq.append (reference.substring (cursor, sbend));
+}}alcursor += this.range[i];
+cursor += this.range[i];
+end = cursor - 1;
+endpos = alcursor;
+break;
+default:
+throw  new Error (jalview.util.MessageManager.formatMessage ("error.unknown_seq_cigar_operation",  Clazz_newArray (-1, [ new StringBuffer (this.operation[i].charCodeAt (0)).toString ()])));
+}
+}
+if (++delcount > 0) {
+trunc_deletions =  Clazz_newIntArray (delcount, 0);
+System.arraycopy (deletions, 0, trunc_deletions, 0, delcount);
+}deletions = null;
+return  Clazz_newArray (-1, [((reference != null) ? sq.toString () : null),  Clazz_newIntArray (-1, [start, startpos, end, endpos]), trunc_deletions]);
+}, "~S,~S");
+Clazz_defineMethod (c$, "compact_operations", 
+function () {
+var i = 1;
+if (this.operation == null) {
+return;
+}var last = this.operation[0];
+while (i < this.length) {
+if (last == this.operation[i]) {
+this.range[i - 1] += this.range[i];
+var r = this.length - i;
+if (r > 0) {
+System.arraycopy (this.range, i + 1, this.range, i, r);
+System.arraycopy (this.operation, i + 1, this.operation, i, r);
+}this.length--;
+} else {
+last = this.operation[i++];
+}}
+});
+c$.parseCigarString = Clazz_defineMethod (c$, "parseCigarString", 
+function (cigarString) {
+var ops = 0;
+for (var i = 0, l = cigarString.length; i < l; i++) {
+var c = cigarString.charAt (i);
+if (c == 'M' || c.charCodeAt (0) == (45) || c == 'I' || c.charCodeAt (0) == (41) || c == 'D' || c.charCodeAt (0) == (36)) {
+ops++;
+}}
+var operation =  Clazz_newCharArray (ops, '\0');
+var range =  Clazz_newIntArray (ops, 0);
+var op = 0;
+var i = 0;
+var l = cigarString.length;
+while (i < l) {
+var c;
+var j = i;
+do {
+c = cigarString.charAt (j++);
+} while (c >= '0' && c <= '9' && j < l);
+if (j >= l && c >= '0' && c <= '9') {
+throw  new Exception (jalview.util.MessageManager.getString ("exception.unterminated_cigar_string"));
+}try {
+var rangeint = cigarString.substring (i, j - 1);
+range[op] = Integer.parseInt (rangeint);
+i = j;
+} catch (e) {
+if (Clazz_exceptionOf (e, Exception)) {
+throw  new Error (jalview.util.MessageManager.getString ("error.implementation_bug_parse_cigar_string"));
+} else {
+throw e;
+}
+}
+if (c >= 'a' && c <= 'z') {
+c = String.fromCharCode (c.charCodeAt (0) - 32);
+}if ((c == 'M' || c == 'I' || c == 'D')) {
+operation[op++] = c;
+} else {
+throw  new Exception (jalview.util.MessageManager.formatMessage ("exception.unexpected_operation_cigar_string_pos",  Clazz_newArray (-1, [ new StringBuffer (c.charCodeAt (0)).toString (), Integer.$valueOf (i).toString (), cigarString])));
+}}
+return  Clazz_newArray (-1, [operation, range]);
+}, "~S");
+Clazz_defineMethod (c$, "addOperation", 
+function (op, range) {
+if (op >= 'a' && op <= 'z') {
+op = String.fromCharCode (op.charCodeAt (0) - 32);
+}if (op != 'M' && op != 'D' && op != 'I') {
+throw  new Error (jalview.util.MessageManager.getString ("error.implementation_error_invalid_operation_string"));
+}if (range == 0) {
+return;
+}if (range < 0) {
+throw  new Error (jalview.util.MessageManager.getString ("error.invalid_range_string"));
+}var lngth = 0;
+if (this.operation == null) {
+this.operation =  Clazz_newCharArray (this._inc_length, '\0');
+this.range =  Clazz_newIntArray (this._inc_length, 0);
+}if (this.length + 1 == this.operation.length) {
+var ops = this.operation;
+this.operation =  Clazz_newCharArray (this.length + 1 + this._inc_length, '\0');
+System.arraycopy (ops, 0, this.operation, 0, this.length);
+ops = null;
+var rng = this.range;
+this.range =  Clazz_newIntArray (this.length + 1 + this._inc_length, 0);
+System.arraycopy (rng, 0, this.range, 0, this.length);
+rng = null;
+}if ((this.length > 0) && (this.operation[this.length - 1] == op)) {
+this.length--;
+} else {
+this.range[this.length] = 0;
+}this.operation[this.length] = op;
+this.range[this.length++] += range;
+}, "~S,~N");
+Clazz_defineMethod (c$, "deleteRange", 
+function (start, end) {
+var deleted = 0;
+if (this.length == 0) {
+return deleted;
+}if (start < 0 || start > end) {
+throw  new Error (jalview.util.MessageManager.getString ("error.implementation_error_delete_range_out_of_bounds"));
+}var cursor = 0;
+var rlength = 1 + end - start;
+var oldlen = this.length;
+var o = 0;
+var editing = false;
+var oldops = this.operation;
+var oldrange = this.range;
+this.length = 0;
+this.operation = null;
+this.range = null;
+this.compact_operations ();
+while (o < oldlen && cursor <= end && rlength > 0) {
+if (oldops[o] == 'D') {
+this.addDeleted (oldrange[o++]);
+continue;
+}var remain = oldrange[o];
+if (!editing) {
+if ((cursor + remain) <= start) {
+this.addOperation (oldops[o], oldrange[o]);
+cursor += oldrange[o++];
+continue;
+}editing = true;
+if (start - cursor > 0) {
+this.addOperation (oldops[o], start - cursor);
+remain -= start - cursor;
+}}if (o < oldlen && editing && rlength > 0 && remain > 0) {
+switch (oldops[o]) {
+case 'M':
+if (rlength > remain) {
+this.addDeleted (remain);
+deleted += remain;
+} else {
+deleted += rlength;
+this.addDeleted (rlength);
+if (remain - rlength > 0) {
+this.addOperation ('M', remain - rlength);
+}rlength = 0;
+remain = 0;
+}break;
+case 'I':
+if (remain - rlength > 0) {
+this.addInsertion (remain - rlength);
+rlength = 0;
+}break;
+case 'D':
+throw  new Error (jalview.util.MessageManager.getString ("error.implementation_error"));
+default:
+throw  new Error (jalview.util.MessageManager.formatMessage ("error.implementation_error_unknown_operation",  Clazz_newArray (-1, [ new StringBuffer (oldops[o].charCodeAt (0)).toString ()])));
+}
+rlength -= remain;
+remain = oldrange[++o];
+}}
+while (o < oldlen) {
+this.addOperation (oldops[o], oldrange[o++]);
+}
+return deleted;
+}, "~N,~N");
+Clazz_defineMethod (c$, "hasDeletedRegions", 
+function () {
+for (var i = 0; i < this.length; i++) {
+if (this.operation[i] == 'D') {
+return true;
+}}
+return false;
+});
+Clazz_defineMethod (c$, "getDeletedRegions", 
+function () {
+if (this.length == 0) {
+return null;
+}var dr =  new java.util.Vector ();
+var cursor = 0;
+var vcursor = 0;
+for (var i = 0; i < this.length; i++) {
+switch (this.operation[i]) {
+case 'M':
+cursor += this.range[i];
+case 'I':
+vcursor += this.range[i];
+break;
+case 'D':
+dr.addElement ( Clazz_newIntArray (-1, [vcursor, cursor, this.range[i]]));
+cursor += this.range[i];
+}
+}
+if (dr.size () == 0) {
+return null;
+}var delregions =  Clazz_newIntArray (dr.size () * 3, 0);
+for (var i = 0, l = dr.size (); i < l; i++) {
+var reg = dr.elementAt (i);
+delregions[i * 3] = reg[0];
+delregions[i * 3 + 1] = reg[1];
+delregions[i * 3 + 2] = reg[2];
+}
+return delregions;
+});
+Clazz_defineMethod (c$, "getFullWidth", 
+function () {
+var w = 0;
+if (this.range != null) {
+for (var i = 0; i < this.length; i++) {
+w += this.range[i];
+}
+}return w;
+});
+Clazz_defineMethod (c$, "getWidth", 
+function () {
+var w = 0;
+if (this.range != null) {
+for (var i = 0; i < this.length; i++) {
+if (this.operation[i] == 'M' || this.operation[i] == 'I') {
+w += this.range[i];
+}}
+}return w;
+});
+Clazz_defineMethod (c$, "addInsertion", 
+function (range) {
+this.addOperation ('I', range);
+}, "~N");
+Clazz_defineMethod (c$, "addDeleted", 
+function (range) {
+this.addOperation ('D', range);
+}, "~N");
+Clazz_defineMethod (c$, "getCigarstring", 
+function () {
+var cigarString =  new StringBuffer ();
+for (var i = 0; i < this.length; i++) {
+cigarString.append ("" + this.range[i]);
+cigarString.append (this.operation[i]);
+}
+return cigarString.toString ();
+});
+Clazz_defineStatics (c$,
+"D", 'D',
+"I", 'I',
+"M", 'M',
+"_case_shift", String.fromCharCode (32));
+});
+Clazz_declarePackage ("jalview.datamodel");
+Clazz_load (["jalview.datamodel.CigarSimple"], "jalview.datamodel.CigarCigar", null, function () {
+c$ = Clazz_decorateAsClass (function () {
+this.refCigar = null;
+Clazz_instantialize (this, arguments);
+}, jalview.datamodel, "CigarCigar", jalview.datamodel.CigarSimple);
+Clazz_makeConstructor (c$, 
+function (cigar) {
+Clazz_superConstructor (this, jalview.datamodel.CigarCigar);
+this.refCigar = cigar;
+}, "jalview.datamodel.SeqCigar");
+Clazz_overrideMethod (c$, "getSequenceString", 
+function (GapChar) {
+if (this.length == 0) {
+return "";
+}var refString = this.refCigar.getSequenceString (GapChar);
+if (refString != null) {
+return (this.length == 0) ? "" : this.getSequenceAndDeletions (refString, GapChar)[0];
+} else {
+return null;
+}}, "~S");
+});
+Clazz_declarePackage ("jalview.datamodel");
+Clazz_load (["jalview.datamodel.CigarBase"], "jalview.datamodel.CigarSimple", null, function () {
+c$ = Clazz_declareType (jalview.datamodel, "CigarSimple", jalview.datamodel.CigarBase);
+});
+Clazz_declarePackage ("jalview.datamodel");
+Clazz_load (["jalview.datamodel.CigarSimple"], "jalview.datamodel.SeqCigar", ["jalview.analysis.AlignSeq", "$.SeqsetUtils", "jalview.datamodel.Sequence", "jalview.util.Comparison", "$.MessageManager", "$.ShiftList", "java.lang.Error", "$.StringBuffer", "java.util.Hashtable"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.start = 0;
+this.end = 0;
+this.refseq = null;
+this.seqProps = null;
+this.selGroups = null;
+Clazz_instantialize (this, arguments);
+}, jalview.datamodel, "SeqCigar", jalview.datamodel.CigarSimple);
+Clazz_defineMethod (c$, "getRefSeq", 
+function () {
+return this.refseq;
+});
+Clazz_defineMethod (c$, "getStart", 
+function () {
+return this.start;
+});
+Clazz_defineMethod (c$, "getEnd", 
+function () {
+return this.end;
+});
+Clazz_overrideMethod (c$, "getSequenceString", 
+function (GapChar) {
+return (this.length == 0) ? "" : this.getSequenceAndDeletions (this.refseq.getSequenceAsString (this.start, this.end), GapChar)[0];
+}, "~S");
+Clazz_defineMethod (c$, "getSeq", 
+function (GapChar) {
+var seq;
+if (this.refseq == null || this.length == 0) {
+return null;
+}var edit_result = this.getSequenceAndDeletions (this.refseq.getSequenceAsString (this.start, this.end), GapChar);
+if (edit_result == null) {
+throw  new Error (jalview.util.MessageManager.getString ("error.implementation_error_unexpected_null_from_get_sequence_and_deletions"));
+}var bounds = edit_result[1];
+seq =  new jalview.datamodel.Sequence (this.refseq.getName (), edit_result[0], this.refseq.getStart () + this.start + bounds[0], this.refseq.getStart () + this.start + ((bounds[2] == 0) ? -1 : bounds[2]));
+seq.setDescription (this.refseq.getDescription ());
+var sstart = seq.getStart ();
+var send = seq.getEnd ();
+if (this.seqProps != null) {
+jalview.analysis.SeqsetUtils.SeqCharacterUnhash (seq, this.seqProps);
+}seq.setDatasetSequence (this.refseq);
+seq.setStart (sstart);
+seq.setEnd (send);
+return seq;
+}, "~S");
+Clazz_defineMethod (c$, "_setSeq", 
+ function (seq, initialDeletion, _s, _e) {
+var hasgaps = false;
+if (seq == null) {
+throw  new Error (jalview.util.MessageManager.getString ("error.implementation_error_set_seq_null"));
+}if (_s < 0) {
+throw  new Error (jalview.util.MessageManager.formatMessage ("error.implementation_error_s",  Clazz_newArray (-1, [Integer.$valueOf (_s).toString ()])));
+}var seq_string = seq.getSequenceAsString ();
+if (_e == 0 || _e < _s || _e > seq_string.length) {
+_e = seq_string.length;
+}this.start = seq.findPosition (_s) - seq.getStart ();
+this.end = seq.findPosition (_e) - seq.getStart ();
+var l_ungapped = this.end - this.start;
+var ds = seq.getDatasetSequence ();
+if (ds == null) {
+var ungapped = jalview.analysis.AlignSeq.extractGaps (jalview.util.Comparison.GapChars,  String.instantialize (seq_string));
+l_ungapped = ungapped.length;
+if (l_ungapped == seq.getLength ()) {
+ds = seq;
+} else {
+ds =  new jalview.datamodel.Sequence (seq.getName (), ungapped, seq.getStart (), seq.getStart () + ungapped.length - 1);
+}}if (ds.getStart () < seq.getStart ()) {
+var offset = seq.getStart () - ds.getStart ();
+if (initialDeletion) {
+this.addDeleted (_s + offset);
+this.start = 0;
+this.end += offset;
+} else {
+this.start += offset;
+this.end += offset;
+}}if (l_ungapped != (_e - _s)) {
+hasgaps = true;
+}this.refseq = ds;
+this.seqProps = jalview.analysis.SeqsetUtils.SeqCharacterHash (seq);
+if (this.end > ds.getLength ()) {
+throw  new Error (jalview.util.MessageManager.getString ("error.implementation_error_seqcigar_possible"));
+}return hasgaps;
+}, "jalview.datamodel.SequenceI,~B,~N,~N");
+Clazz_makeConstructor (c$, 
+function (seq, operation, range) {
+Clazz_superConstructor (this, jalview.datamodel.SeqCigar);
+if (seq == null) {
+throw  new Error (jalview.util.MessageManager.getString ("error.implmentation_bug_seq_null"));
+}if (operation.length != range.length) {
+throw  new Error (jalview.util.MessageManager.getString ("error.implementation_bug_cigar_operation_list_range_list"));
+}if (operation != null) {
+this.operation =  Clazz_newCharArray (operation.length + this._inc_length, '\0');
+this.range =  Clazz_newIntArray (operation.length + this._inc_length, 0);
+if (this._setSeq (seq, false, 0, 0)) {
+throw  new Error (jalview.util.MessageManager.getString ("error.not_yet_implemented_cigar_object_from_cigar_string"));
+}for (var i = this.length, j = 0; j < operation.length; i++, j++) {
+var op = operation[j];
+if (op != 'M' && op != 'I' && op != 'D') {
+throw  new Error (jalview.util.MessageManager.formatMessage ("error.implementation_bug_cigar_operation",  Clazz_newArray (-1, [Integer.$valueOf (j).toString (), Integer.$valueOf (op.charCodeAt (0)).toString (), Integer.$valueOf ('M'.charCodeAt (0)).toString (), Integer.$valueOf ('I'.charCodeAt (0)).toString (), Integer.$valueOf ('D'.charCodeAt (0)).toString ()])));
+}this.operation[i] = op;
+this.range[i] = range[j];
+}
+this.length += operation.length;
+} else {
+this.operation = null;
+this.range = null;
+this.length = 0;
+if (this._setSeq (seq, false, 0, 0)) {
+throw  new Error (jalview.util.MessageManager.getString ("error.not_yet_implemented_cigar_object_from_cigar_string"));
+}}}, "jalview.datamodel.SequenceI,~A,~A");
+Clazz_defineMethod (c$, "addMatch", 
+function (range) {
+this.addOperation ('M', range);
+}, "~N");
+c$.addSequenceOps = Clazz_defineMethod (c$, "addSequenceOps", 
+function (cigar, seq, startpos, endpos, initialDeletions) {
+var op = '\u0000';
+var range = 0;
+var p = 0;
+var res = seq.getLength ();
+if (!initialDeletions) {
+p = startpos;
+}while (p <= endpos) {
+var isGap = (p < res) ? jalview.util.Comparison.isGap (seq.getCharAt (p)) : true;
+if ((startpos <= p) && (p <= endpos)) {
+if (isGap) {
+if (range > 0 && op != 'I') {
+cigar.addOperation (op, range);
+range = 0;
+}op = 'I';
+range++;
+} else {
+if (range > 0 && op != 'M') {
+cigar.addOperation (op, range);
+range = 0;
+}op = 'M';
+range++;
+}} else {
+if (!isGap) {
+if (range > 0 && op != 'D') {
+cigar.addOperation (op, range);
+range = 0;
+}op = 'D';
+range++;
+} else {
+}}p++;
+}
+if (range > 0) {
+cigar.addOperation (op, range);
+}}, "jalview.datamodel.CigarBase,jalview.datamodel.SequenceI,~N,~N,~B");
+Clazz_makeConstructor (c$, 
+function (seq) {
+Clazz_superConstructor (this, jalview.datamodel.SeqCigar);
+if (seq == null) {
+throw  new Error (jalview.util.MessageManager.getString ("error.implementation_error_for_new_cigar"));
+}this._setSeq (seq, false, 0, 0);
+jalview.datamodel.SeqCigar.addSequenceOps (this, seq, 0, seq.getLength () - 1, false);
+}, "jalview.datamodel.SequenceI");
+Clazz_makeConstructor (c$, 
+function (seq, start, end) {
+Clazz_superConstructor (this, jalview.datamodel.SeqCigar);
+if (seq == null) {
+throw  new Error (jalview.util.MessageManager.getString ("error.implementation_error_for_new_cigar"));
+}this._setSeq (seq, false, start, end + 1);
+jalview.datamodel.SeqCigar.addSequenceOps (this, seq, start, end, false);
+}, "jalview.datamodel.SequenceI,~N,~N");
+c$.parseCigar = Clazz_defineMethod (c$, "parseCigar", 
+function (seq, cigarString) {
+var opsandrange = jalview.datamodel.CigarBase.parseCigarString (cigarString);
+return  new jalview.datamodel.SeqCigar (seq, opsandrange[0], opsandrange[1]);
+}, "jalview.datamodel.SequenceI,~S");
+c$.createAlignmentSequences = Clazz_defineMethod (c$, "createAlignmentSequences", 
+function (alseqs, gapCharacter, colsel, segments) {
+var seqs =  new Array (alseqs.length);
+var g_seqs =  new Array (alseqs.length);
+var alseqs_string =  new Array (alseqs.length);
+var gs_regions =  new Array (alseqs.length);
+for (var i = 0; i < alseqs.length; i++) {
+alseqs_string[i] = alseqs[i].getRefSeq ().getSequenceAsString (alseqs[i].start, alseqs[i].end);
+gs_regions[i] = alseqs[i].getSequenceAndDeletions (alseqs_string[i], gapCharacter);
+if (gs_regions[i] == null) {
+throw  new Error (jalview.util.MessageManager.formatMessage ("error.implementation_error_cigar_seq_no_operations",  Clazz_newArray (-1, [Integer.$valueOf (i).toString ()])));
+}g_seqs[i] =  new StringBuffer ((gs_regions[i])[0]);
+}
+var shifts =  new jalview.util.ShiftList ();
+for (var i = 0; i < alseqs.length; i++) {
+var gs_region = ((gs_regions[i])[2]);
+if (gs_region != null) {
+for (var hr = 0; hr < gs_region.length; hr++) {
+var region = gs_region[hr];
+var insert =  Clazz_newCharArray (region[1] - region[0] + 1, '\0');
+for (var s = 0; s < insert.length; s++) {
+insert[s] = gapCharacter;
+}
+var inspos = shifts.shift (region[2]);
+for (var s = 0; s < alseqs.length; s++) {
+if (s != i) {
+if (g_seqs[s].length () <= inspos) {
+for (var l = inspos - g_seqs[s].length (); l > 0; l--) {
+g_seqs[s].append (gapCharacter);
+}
+}g_seqs[s].insert (inspos, insert);
+} else {
+g_seqs[s].insert (inspos, alseqs_string[i].substring (region[0], region[1] + 1));
+}}
+shifts.addShift (region[2], insert.length);
+if (segments == null) {
+colsel.hideColumns (inspos, inspos + insert.length - 1);
+}}
+}}
+for (var i = 0; i < alseqs.length; i++) {
+var bounds = ((gs_regions[i])[1]);
+var ref = alseqs[i].getRefSeq ();
+seqs[i] =  new jalview.datamodel.Sequence (ref.getName (), g_seqs[i].toString (), ref.getStart () + alseqs[i].start + bounds[0], ref.getStart () + alseqs[i].start + (bounds[2] == 0 ? -1 : bounds[2]));
+seqs[i].setDatasetSequence (ref);
+seqs[i].setDescription (ref.getDescription ());
+}
+if (segments != null) {
+for (var i = 0; i < segments.length; i += 3) {
+colsel.hideColumns (segments[i + 1], segments[i + 1] + segments[i + 2] - 1);
+}
+}return seqs;
+}, "~A,~S,jalview.datamodel.ColumnSelection,~A");
+Clazz_defineMethod (c$, "setGroupMembership", 
+function (group) {
+if (this.selGroups == null) {
+this.selGroups =  new java.util.Hashtable ();
+}this.selGroups.put (group,  Clazz_newIntArray (0, 0));
+}, "~O");
+Clazz_defineMethod (c$, "removeGroupMembership", 
+function (group) {
+if (this.selGroups != null && this.selGroups.containsKey (group)) {
+this.selGroups.remove (group);
+return true;
+}return false;
+}, "~O");
+Clazz_defineMethod (c$, "clearMemberships", 
+function () {
+if (this.selGroups != null) {
+this.selGroups.clear ();
+}this.selGroups = null;
+});
+Clazz_defineMethod (c$, "getAllMemberships", 
+function () {
+if (this.selGroups == null) {
+return null;
+}var mmbs =  new Array (this.selGroups.size ());
+var en = this.selGroups.keys ();
+for (var i = 0; en.hasMoreElements (); i++) {
+mmbs[i] = en.nextElement ();
+}
+return mmbs;
+});
+Clazz_defineMethod (c$, "isMemberOf", 
+function (sgr) {
+return (this.selGroups != null) && this.selGroups.get (sgr) != null;
+}, "~O");
+});
+Clazz_declarePackage ("jalview.analysis");
+Clazz_load (null, "jalview.analysis.SeqsetUtils", ["jalview.analysis.AlignSeq", "$.SequenceIdMatcher", "jalview.datamodel.Sequence", "jalview.util.Comparison", "java.util.Hashtable", "$.Vector"], function () {
+c$ = Clazz_declareType (jalview.analysis, "SeqsetUtils");
+c$.SeqCharacterHash = Clazz_defineMethod (c$, "SeqCharacterHash", 
+function (seq) {
+var sqinfo =  new java.util.Hashtable ();
+sqinfo.put ("Name", seq.getName ());
+sqinfo.put ("Start",  new Integer (seq.getStart ()));
+sqinfo.put ("End",  new Integer (seq.getEnd ()));
+if (seq.getDescription () != null) {
+sqinfo.put ("Description", seq.getDescription ());
+}var sfeat =  new java.util.Vector ();
+var sfarray = seq.getSequenceFeatures ();
+if (sfarray != null && sfarray.length > 0) {
+for (var i = 0; i < sfarray.length; i++) {
+sfeat.addElement (sfarray[i]);
+}
+}sqinfo.put ("SeqFeatures", sfeat);
+sqinfo.put ("PdbId", (seq.getPDBId () != null) ? seq.getPDBId () :  new java.util.Vector ());
+sqinfo.put ("datasetSequence", (seq.getDatasetSequence () != null) ? seq.getDatasetSequence () :  new jalview.datamodel.Sequence ("THISISAPLACEHOLDER", ""));
+return sqinfo;
+}, "jalview.datamodel.SequenceI");
+c$.SeqCharacterUnhash = Clazz_defineMethod (c$, "SeqCharacterUnhash", 
+function (sq, sqinfo) {
+var namePresent = true;
+if (sqinfo == null) {
+return false;
+}var oldname = sqinfo.get ("Name");
+var start = sqinfo.get ("Start");
+var end = sqinfo.get ("End");
+var sfeatures = sqinfo.get ("SeqFeatures");
+var pdbid = sqinfo.get ("PdbId");
+var description = sqinfo.get ("Description");
+var seqds = sqinfo.get ("datasetSequence");
+if (oldname == null) {
+namePresent = false;
+} else {
+sq.setName (oldname);
+}if (pdbid != null && pdbid.size () > 0) {
+sq.setPDBId (pdbid);
+}if ((start != null) && (end != null)) {
+sq.setStart (start.intValue ());
+sq.setEnd (end.intValue ());
+}if ((sfeatures != null) && (sfeatures.size () > 0)) {
+var sfarray =  new Array (sfeatures.size ());
+for (var is = 0, isize = sfeatures.size (); is < isize; is++) {
+sfarray[is] = sfeatures.elementAt (is);
+}
+sq.setSequenceFeatures (sfarray);
+}if (description != null) {
+sq.setDescription (description);
+}if ((seqds != null) && !(seqds.getName ().equals ("THISISAPLACEHOLDER") && seqds.getLength () == 0)) {
+sq.setDatasetSequence (seqds);
+}return namePresent;
+}, "jalview.datamodel.SequenceI,java.util.Hashtable");
+c$.unique_name = Clazz_defineMethod (c$, "unique_name", 
+function (i) {
+return  String.instantialize ("Sequence" + i);
+}, "~N");
+c$.uniquify = Clazz_defineMethod (c$, "uniquify", 
+function (sequences, write_names) {
+var map =  new java.util.Hashtable ();
+for (var i = 0; i < sequences.length; i++) {
+var safename = jalview.analysis.SeqsetUtils.unique_name (i);
+map.put (safename, jalview.analysis.SeqsetUtils.SeqCharacterHash (sequences[i]));
+if (write_names) {
+sequences[i].setName (safename);
+}}
+return map;
+}, "~A,~B");
+c$.deuniquify = Clazz_defineMethod (c$, "deuniquify", 
+function (map, sequences) {
+return jalview.analysis.SeqsetUtils.deuniquify (map, sequences, true);
+}, "java.util.Hashtable,~A");
+c$.deuniquify = Clazz_defineMethod (c$, "deuniquify", 
+function (map, sequences, quiet) {
+var matcher =  new jalview.analysis.SequenceIdMatcher (sequences);
+var msq = null;
+var keys = map.keys ();
+var unmatched =  new java.util.Vector ();
+for (var i = 0, j = sequences.length; i < j; i++) {
+unmatched.addElement (sequences[i]);
+}
+while (keys.hasMoreElements ()) {
+var key = keys.nextElement ();
+if (Clazz_instanceOf (key, String)) {
+if ((msq = matcher.findIdMatch (key)) != null) {
+var sqinfo = map.get (key);
+unmatched.removeElement (msq);
+jalview.analysis.SeqsetUtils.SeqCharacterUnhash (msq, sqinfo);
+} else {
+if (!quiet) {
+System.err.println ("Can't find '" + (key) + "' in uniquified alignment");
+}}}}
+if (unmatched.size () > 0 && !quiet) {
+System.err.println ("Did not find matches for :");
+for (var i = unmatched.elements (); i.hasMoreElements (); System.out.println ((i.nextElement ()).getName ())) {
+;}
+return false;
+}return true;
+}, "java.util.Hashtable,~A,~B");
+c$.getNonEmptySequenceSet = Clazz_defineMethod (c$, "getNonEmptySequenceSet", 
+function (sequences) {
+var ungapped =  Clazz_newBooleanArray (sequences.length, false);
+var msflen = 0;
+for (var i = 0, j = sequences.length; i < j; i++) {
+var tempseq = jalview.analysis.AlignSeq.extractGaps (jalview.util.Comparison.GapChars, sequences[i].getSequenceAsString ());
+if (tempseq.length == 0) {
+ungapped[i] = false;
+} else {
+ungapped[i] = true;
+msflen++;
+}}
+if (msflen == 0) {
+return null;
+}var mset =  new Array (msflen);
+for (var i = 0, j = sequences.length, k = 0; i < j; i++) {
+if (ungapped[i]) {
+mset[k++] = sequences[i];
+}}
+ungapped = null;
+return mset;
+}, "~A");
+});
+Clazz_declarePackage ("jalview.datamodel");
+Clazz_load (null, "jalview.datamodel.FeatureProperties", ["jalview.datamodel.DBRefSource"], function () {
+c$ = Clazz_declareType (jalview.datamodel, "FeatureProperties");
+c$.isCodingFeature = Clazz_defineMethod (c$, "isCodingFeature", 
+function (dbrefsource, type) {
+if (type.equalsIgnoreCase ("CDS")) {
+return (dbrefsource == null || dbrefsource.equalsIgnoreCase (jalview.datamodel.DBRefSource.EMBL) || dbrefsource.equalsIgnoreCase (jalview.datamodel.DBRefSource.EMBLCDS));
+}return false;
+}, "~S,~S");
+c$.getCodingFeature = Clazz_defineMethod (c$, "getCodingFeature", 
+function (dbrefsource) {
+if (jalview.datamodel.DBRefSource.EMBL.equalsIgnoreCase (dbrefsource) || jalview.datamodel.DBRefSource.EMBLCDS.equalsIgnoreCase (dbrefsource)) {
+return "CDS";
+}return null;
+}, "~S");
+Clazz_defineStatics (c$,
+"EMBL_CODING_FEATURE", "CDS",
+"EXONPOS", "exon number",
+"EXONPRODUCT", "product");
+});
+Clazz_declarePackage ("jalview.util");
+Clazz_load (["java.util.HashMap"], "jalview.util.DBRefUtils", ["jalview.datamodel.DBRefEntry", "$.DBRefSource", "$.PDBEntry", "jalview.jsdev.RegExp", "java.util.ArrayList", "$.Hashtable"], function () {
+c$ = Clazz_declareType (jalview.util, "DBRefUtils");
+c$.selectRefs = Clazz_defineMethod (c$, "selectRefs", 
+function (dbrefs, sources) {
+if (dbrefs == null) {
+return null;
+}if (sources == null) {
+return dbrefs;
+}var srcs =  new java.util.HashMap ();
+var res =  new java.util.ArrayList ();
+for (var i = 0; i < sources.length; i++) {
+srcs.put ( String.instantialize (sources[i]),  new Integer (i));
+}
+for (var i = 0, j = dbrefs.length; i < j; i++) {
+if (srcs.containsKey (dbrefs[i].getSource ())) {
+res.add (dbrefs[i]);
+}}
+if (res.size () > 0) {
+var reply =  new Array (res.size ());
+return res.toArray (reply);
+}res = null;
+return null;
+}, "~A,~A");
+c$.isDasCoordinateSystem = Clazz_defineMethod (c$, "isDasCoordinateSystem", 
+function (string, dBRefEntry) {
+if (string == null || dBRefEntry == null) {
+return false;
+}var coordsys = jalview.util.DBRefUtils.dasCoordinateSystemsLookup.get (string.toLowerCase ());
+return coordsys == null ? false : coordsys.equals (dBRefEntry.getSource ());
+}, "~S,jalview.datamodel.DBRefEntry");
+c$.getCanonicalName = Clazz_defineMethod (c$, "getCanonicalName", 
+function (source) {
+if (source == null) {
+return null;
+}var canonical = jalview.util.DBRefUtils.canonicalSourceNameLookup.get (source.toLowerCase ());
+return canonical == null ? source : canonical;
+}, "~S");
+c$.searchRefs = Clazz_defineMethod (c$, "searchRefs", 
+function (ref, entry) {
+return jalview.util.DBRefUtils.searchRefs (ref, entry, jalview.util.DBRefUtils.matchDbAndIdAndEitherMapOrEquivalentMapList);
+}, "~A,jalview.datamodel.DBRefEntry");
+c$.searchRefs = Clazz_defineMethod (c$, "searchRefs", 
+function (refs, entry, comparator) {
+if (refs == null || entry == null) {
+return null;
+}var rfs =  new java.util.ArrayList ();
+for (var i = 0; i < refs.length; i++) {
+if (comparator.matches (entry, refs[i])) {
+rfs.add (refs[i]);
+}}
+return rfs.size () == 0 ? null : rfs.toArray ( new Array (rfs.size ()));
+}, "~A,jalview.datamodel.DBRefEntry,jalview.util.DBRefUtils.DbRefComp");
+c$.parseToDbRef = Clazz_defineMethod (c$, "parseToDbRef", 
+function (seq, dbname, version, acn) {
+var ref = null;
+if (dbname != null) {
+var locsrc = jalview.util.DBRefUtils.getCanonicalName (dbname);
+if (locsrc.equals (jalview.datamodel.DBRefSource.PDB)) {
+var r = jalview.jsdev.RegExp.newRegex (["([0-9][0-9A-Za-z]{3})\\s*(.?)\\s*;\\s*([0-9]+)-([0-9]+)"]);
+if (r.search (acn.trim ())) {
+var pdbid = r.stringMatchedI (1);
+var chaincode = r.stringMatchedI (2);
+if (chaincode == null) {
+chaincode = " ";
+}if (chaincode.equals (" ")) {
+chaincode = "_";
+}ref =  new jalview.datamodel.DBRefEntry (locsrc, version, pdbid + chaincode);
+var pdbr =  new jalview.datamodel.PDBEntry ();
+pdbr.setId (pdbid);
+pdbr.setType (jalview.datamodel.PDBEntry.Type.PDB);
+pdbr.setProperty ( new java.util.Hashtable ());
+pdbr.setChainCode (chaincode);
+seq.addPDBId (pdbr);
+} else {
+System.err.println ("Malformed PDB DR line:" + acn);
+}} else {
+ref =  new jalview.datamodel.DBRefEntry (locsrc, version, acn);
+}}if (ref != null) {
+seq.addDBRef (ref);
+}return ref;
+}, "jalview.datamodel.SequenceI,~S,~S,~S");
+c$.$DBRefUtils$1$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_declareAnonymous (jalview.util, "DBRefUtils$1", null, jalview.util.DBRefUtils.DbRefComp);
+Clazz_defineMethod (c$, "matches", 
+function (refa, refb) {
+if (refa.getSource () == null || refb.getSource ().equals (refa.getSource ())) {
+if (refa.getVersion () == null || refb.getVersion ().equals (refa.getVersion ())) {
+if (refa.getAccessionId () == null || refb.getAccessionId ().equals (refa.getAccessionId ())) {
+if (refa.getMap () == null || (refb.getMap () != null && refb.getMap ().equals (refa.getMap ()))) {
+return true;
+}}}}return false;
+}, "jalview.datamodel.DBRefEntry,jalview.datamodel.DBRefEntry");
+c$ = Clazz_p0p ();
+};
+c$.$DBRefUtils$2$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_declareAnonymous (jalview.util, "DBRefUtils$2", null, jalview.util.DBRefUtils.DbRefComp);
+Clazz_defineMethod (c$, "matches", 
+function (refa, refb) {
+if ((refa.getSource () == null || refb.getSource () == null) || refb.getSource ().equals (refa.getSource ())) {
+if ((refa.getVersion () == null || refb.getVersion () == null) || refb.getVersion ().equals (refa.getVersion ())) {
+if ((refa.getAccessionId () == null || refb.getAccessionId () == null) || refb.getAccessionId ().equals (refa.getAccessionId ())) {
+if ((refa.getMap () == null || refb.getMap () == null) || (refb.getMap () != null && refb.getMap ().equals (refa.getMap ()))) {
+return true;
+}}}}return false;
+}, "jalview.datamodel.DBRefEntry,jalview.datamodel.DBRefEntry");
+c$ = Clazz_p0p ();
+};
+c$.$DBRefUtils$3$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_declareAnonymous (jalview.util, "DBRefUtils$3", null, jalview.util.DBRefUtils.DbRefComp);
+Clazz_defineMethod (c$, "matches", 
+function (refa, refb) {
+if (refa.getSource () != null && refb.getSource () != null && refb.getSource ().equals (refa.getSource ())) {
+if (refa.getAccessionId () != null && refb.getAccessionId () != null || refb.getAccessionId ().equals (refa.getAccessionId ())) {
+if ((refa.getMap () == null || refb.getMap () == null) || (refa.getMap () != null && refb.getMap () != null && refb.getMap ().equals (refa.getMap ()))) {
+return true;
+}}}return false;
+}, "jalview.datamodel.DBRefEntry,jalview.datamodel.DBRefEntry");
+c$ = Clazz_p0p ();
+};
+c$.$DBRefUtils$4$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_declareAnonymous (jalview.util, "DBRefUtils$4", null, jalview.util.DBRefUtils.DbRefComp);
+Clazz_defineMethod (c$, "matches", 
+function (refa, refb) {
+if (refa.getSource () != null && refb.getSource () != null && refb.getSource ().equals (refa.getSource ())) {
+if (refa.getAccessionId () != null && refb.getAccessionId () != null || refb.getAccessionId ().equals (refa.getAccessionId ())) {
+if ((refa.getMap () == null && refb.getMap () == null) || (refa.getMap () != null && refb.getMap () != null)) {
+if ((refb.getMap ().getMap () == null && refa.getMap ().getMap () == null) || (refb.getMap ().getMap () != null && refa.getMap ().getMap () != null && refb.getMap ().getMap ().getInverse ().equals (refa.getMap ().getMap ()))) {
+return true;
+}}}}return false;
+}, "jalview.datamodel.DBRefEntry,jalview.datamodel.DBRefEntry");
+c$ = Clazz_p0p ();
+};
+c$.$DBRefUtils$5$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_declareAnonymous (jalview.util, "DBRefUtils$5", null, jalview.util.DBRefUtils.DbRefComp);
+Clazz_defineMethod (c$, "matches", 
+function (refa, refb) {
+if (refa.getSource () != null && refb.getSource () != null && refb.getSource ().equals (refa.getSource ())) {
+if (refa.getAccessionId () != null && refb.getAccessionId () != null || refb.getAccessionId ().equals (refa.getAccessionId ())) {
+if (refa.getMap () == null && refb.getMap () == null) {
+return true;
+}if (refa.getMap () != null && refb.getMap () != null && ((refb.getMap ().getMap () == null && refa.getMap ().getMap () == null) || (refb.getMap ().getMap () != null && refa.getMap ().getMap () != null && refb.getMap ().getMap ().equals (refa.getMap ().getMap ())))) {
+return true;
+}}}return false;
+}, "jalview.datamodel.DBRefEntry,jalview.datamodel.DBRefEntry");
+c$ = Clazz_p0p ();
+};
+c$.$DBRefUtils$6$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_declareAnonymous (jalview.util, "DBRefUtils$6", null, jalview.util.DBRefUtils.DbRefComp);
+Clazz_defineMethod (c$, "matches", 
+function (refa, refb) {
+if (refa.getSource () != null && refb.getSource () != null && refb.getSource ().equals (refa.getSource ())) {
+if (refa.getAccessionId () != null && refb.getAccessionId () != null && refb.getAccessionId ().equals (refa.getAccessionId ())) {
+if (refa.getMap () == null || refb.getMap () == null) {
+return true;
+}if ((refa.getMap () != null && refb.getMap () != null) && (refb.getMap ().getMap () == null && refa.getMap ().getMap () == null) || (refb.getMap ().getMap () != null && refa.getMap ().getMap () != null && (refb.getMap ().getMap ().equals (refa.getMap ().getMap ())))) {
+return true;
+}}}return false;
+}, "jalview.datamodel.DBRefEntry,jalview.datamodel.DBRefEntry");
+c$ = Clazz_p0p ();
+};
+Clazz_declareInterface (jalview.util.DBRefUtils, "DbRefComp");
+c$.canonicalSourceNameLookup = c$.prototype.canonicalSourceNameLookup =  new java.util.HashMap ();
+c$.dasCoordinateSystemsLookup = c$.prototype.dasCoordinateSystemsLookup =  new java.util.HashMap ();
+{
+jalview.util.DBRefUtils.canonicalSourceNameLookup.put ("uniprotkb/swiss-prot", jalview.datamodel.DBRefSource.UNIPROT);
+jalview.util.DBRefUtils.canonicalSourceNameLookup.put ("uniprotkb/trembl", jalview.datamodel.DBRefSource.UNIPROT);
+jalview.util.DBRefUtils.canonicalSourceNameLookup.put ("pdb", jalview.datamodel.DBRefSource.PDB);
+jalview.util.DBRefUtils.dasCoordinateSystemsLookup.put ("pdbresnum", jalview.datamodel.DBRefSource.PDB);
+jalview.util.DBRefUtils.dasCoordinateSystemsLookup.put ("uniprot", jalview.datamodel.DBRefSource.UNIPROT);
+jalview.util.DBRefUtils.dasCoordinateSystemsLookup.put ("embl", jalview.datamodel.DBRefSource.EMBL);
+}c$.matchNonNullonA = c$.prototype.matchNonNullonA = ((Clazz_isClassDefined ("jalview.util.DBRefUtils$1") ? 0 : jalview.util.DBRefUtils.$DBRefUtils$1$ ()), Clazz_innerTypeInstance (jalview.util.DBRefUtils$1, this, null));
+c$.matchEitherNonNull = c$.prototype.matchEitherNonNull = ((Clazz_isClassDefined ("jalview.util.DBRefUtils$2") ? 0 : jalview.util.DBRefUtils.$DBRefUtils$2$ ()), Clazz_innerTypeInstance (jalview.util.DBRefUtils$2, this, null));
+c$.matchDbAndIdAndEitherMap = c$.prototype.matchDbAndIdAndEitherMap = ((Clazz_isClassDefined ("jalview.util.DBRefUtils$3") ? 0 : jalview.util.DBRefUtils.$DBRefUtils$3$ ()), Clazz_innerTypeInstance (jalview.util.DBRefUtils$3, this, null));
+c$.matchDbAndIdAndComplementaryMapList = c$.prototype.matchDbAndIdAndComplementaryMapList = ((Clazz_isClassDefined ("jalview.util.DBRefUtils$4") ? 0 : jalview.util.DBRefUtils.$DBRefUtils$4$ ()), Clazz_innerTypeInstance (jalview.util.DBRefUtils$4, this, null));
+c$.matchDbAndIdAndEquivalentMapList = c$.prototype.matchDbAndIdAndEquivalentMapList = ((Clazz_isClassDefined ("jalview.util.DBRefUtils$5") ? 0 : jalview.util.DBRefUtils.$DBRefUtils$5$ ()), Clazz_innerTypeInstance (jalview.util.DBRefUtils$5, this, null));
+c$.matchDbAndIdAndEitherMapOrEquivalentMapList = c$.prototype.matchDbAndIdAndEitherMapOrEquivalentMapList = ((Clazz_isClassDefined ("jalview.util.DBRefUtils$6") ? 0 : jalview.util.DBRefUtils.$DBRefUtils$6$ ()), Clazz_innerTypeInstance (jalview.util.DBRefUtils$6, this, null));
+});
+Clazz_load(["java.util.AbstractCollection","$.AbstractMap","$.AbstractSet","$.Iterator","$.MapEntry","$.Set","$.SortedMap"],"java.util.TreeMap",["java.lang.IllegalArgumentException","$.IllegalStateException","java.util.ConcurrentModificationException","$.NoSuchElementException"],function(){
+c$=Clazz_decorateAsClass(function(){
+this.$size=0;
+this.root=null;
+this.$comparator=null;
+this.modCount=0;
+this.$entrySet=null;
+Clazz_instantialize(this,arguments);
+},java.util,"TreeMap",java.util.AbstractMap,[java.util.SortedMap,Cloneable,java.io.Serializable]);
+c$.toComparable=Clazz_defineMethod(c$,"toComparable",
+($fz=function(obj){
+return obj;
+},$fz.isPrivate=true,$fz),"~O");
+Clazz_makeConstructor(c$,
+function(comparator){
+Clazz_superConstructor(this,java.util.TreeMap,[]);
+this.$comparator=comparator;
+},"java.util.Comparator");
+Clazz_makeConstructor(c$,
+function(map){
+this.construct();
+this.putAll(map);
+},"java.util.Map");
+Clazz_makeConstructor(c$,
+function(map){
+this.construct(map.comparator());
+var it=map.entrySet().iterator();
+if(it.hasNext()){
+var entry=it.next();
+var last=new java.util.TreeMap.Entry(entry.getKey(),entry.getValue());
+this.root=last;
+this.$size=1;
+while(it.hasNext()){
+entry=it.next();
+var x=new java.util.TreeMap.Entry(entry.getKey(),entry.getValue());
+x.parent=last;
+last.right=x;
+this.$size++;
+this.balance(x);
+last=x;
+}
+}},"java.util.SortedMap");
+Clazz_defineMethod(c$,"balance",
+function(x){
+var y;
+x.color=true;
+while(x!==this.root&&x.parent.color){
+if(x.parent===x.parent.parent.left){
+y=x.parent.parent.right;
+if(y!=null&&y.color){
+x.parent.color=false;
+y.color=false;
+x.parent.parent.color=true;
+x=x.parent.parent;
+}else{
+if(x===x.parent.right){
+x=x.parent;
+this.leftRotate(x);
+}x.parent.color=false;
+x.parent.parent.color=true;
+this.rightRotate(x.parent.parent);
+}}else{
+y=x.parent.parent.left;
+if(y!=null&&y.color){
+x.parent.color=false;
+y.color=false;
+x.parent.parent.color=true;
+x=x.parent.parent;
+}else{
+if(x===x.parent.left){
+x=x.parent;
+this.rightRotate(x);
+}x.parent.color=false;
+x.parent.parent.color=true;
+this.leftRotate(x.parent.parent);
+}}}
+this.root.color=false;
+},"java.util.TreeMap.Entry");
+Clazz_overrideMethod(c$,"clear",
+function(){
+this.root=null;
+this.$size=0;
+this.modCount++;
+});
+Clazz_defineMethod(c$,"clone",
+function(){
+try{
+var clone=Clazz_superCall(this,java.util.TreeMap,"clone",[]);
+clone.$entrySet=null;
+if(this.root!=null){
+clone.root=this.root.clone(null);
+}return clone;
+}catch(e){
+if(Clazz_instanceOf(e,CloneNotSupportedException)){
+return null;
+}else{
+throw e;
+}
+}
+});
+Clazz_overrideMethod(c$,"comparator",
+function(){
+return this.$comparator;
+});
+Clazz_overrideMethod(c$,"containsKey",
+function(key){
+return this.find(key)!=null;
+},"~O");
+Clazz_defineMethod(c$,"containsValue",
+function(value){
+if(this.root!=null){
+return this.containsValue(this.root,value);
+}return false;
+},"~O");
+Clazz_defineMethod(c$,"containsValue",
+($fz=function(node,value){
+if(value==null?node.value==null:value.equals(node.value)){
+return true;
+}if(node.left!=null){
+if(this.containsValue(node.left,value)){
+return true;
+}}if(node.right!=null){
+if(this.containsValue(node.right,value)){
+return true;
+}}return false;
+},$fz.isPrivate=true,$fz),"java.util.TreeMap.Entry,~O");
+Clazz_overrideMethod(c$,"entrySet",
+function(){
+if(this.$entrySet==null){
+this.$entrySet=((Clazz_isClassDefined("java.util.TreeMap$1")?0:java.util.TreeMap.$TreeMap$1$()),Clazz_innerTypeInstance(java.util.TreeMap$1,this,null));
+}return this.$entrySet;
+});
+Clazz_defineMethod(c$,"find",
+($fz=function(keyObj){
+var result;
+var key=keyObj;
+var object=null;
+if(this.$comparator==null){
+object=java.util.TreeMap.toComparable(key);
+}var x=this.root;
+while(x!=null){
+result=object!=null?object.compareTo(x.key):this.$comparator.compare(key,x.key);
+if(result==0){
+return x;
+}x=result<0?x.left:x.right;
+}
+return null;
+},$fz.isPrivate=true,$fz),"~O");
+Clazz_defineMethod(c$,"findAfter",
+function(keyObj){
+var key=keyObj;
+var result;
+var object=null;
+if(this.$comparator==null){
+object=java.util.TreeMap.toComparable(key);
+}var x=this.root;
+var last=null;
+while(x!=null){
+result=object!=null?object.compareTo(x.key):this.$comparator.compare(key,x.key);
+if(result==0){
+return x;
+}if(result<0){
+last=x;
+x=x.left;
+}else{
+x=x.right;
+}}
+return last;
+},"~O");
+Clazz_defineMethod(c$,"findBefore",
+function(key){
+var result;
+var object=null;
+if(this.$comparator==null){
+object=java.util.TreeMap.toComparable(key);
+}var x=this.root;
+var last=null;
+while(x!=null){
+result=object!=null?object.compareTo(x.key):this.$comparator.compare(key,x.key);
+if(result<=0){
+x=x.left;
+}else{
+last=x;
+x=x.right;
+}}
+return last;
+},"~O");
+Clazz_overrideMethod(c$,"firstKey",
+function(){
+if(this.root!=null){
+return java.util.TreeMap.minimum(this.root).key;
+}throw new java.util.NoSuchElementException();
+});
+Clazz_defineMethod(c$,"fixup",
+($fz=function(x){
+var w;
+while(x!==this.root&&!x.color){
+if(x===x.parent.left){
+w=x.parent.right;
+if(w==null){
+x=x.parent;
+continue;}if(w.color){
+w.color=false;
+x.parent.color=true;
+this.leftRotate(x.parent);
+w=x.parent.right;
+if(w==null){
+x=x.parent;
+continue;}}if((w.left==null||!w.left.color)&&(w.right==null||!w.right.color)){
+w.color=true;
+x=x.parent;
+}else{
+if(w.right==null||!w.right.color){
+w.left.color=false;
+w.color=true;
+this.rightRotate(w);
+w=x.parent.right;
+}w.color=x.parent.color;
+x.parent.color=false;
+w.right.color=false;
+this.leftRotate(x.parent);
+x=this.root;
+}}else{
+w=x.parent.left;
+if(w==null){
+x=x.parent;
+continue;}if(w.color){
+w.color=false;
+x.parent.color=true;
+this.rightRotate(x.parent);
+w=x.parent.left;
+if(w==null){
+x=x.parent;
+continue;}}if((w.left==null||!w.left.color)&&(w.right==null||!w.right.color)){
+w.color=true;
+x=x.parent;
+}else{
+if(w.left==null||!w.left.color){
+w.right.color=false;
+w.color=true;
+this.leftRotate(w);
+w=x.parent.left;
+}w.color=x.parent.color;
+x.parent.color=false;
+w.left.color=false;
+this.rightRotate(x.parent);
+x=this.root;
+}}}
+x.color=false;
+},$fz.isPrivate=true,$fz),"java.util.TreeMap.Entry");
+Clazz_overrideMethod(c$,"get",
+function(key){
+var node=this.find(key);
+if(node!=null){
+return node.value;
+}return null;
+},"~O");
+Clazz_overrideMethod(c$,"headMap",
+function(endKey){
+if(this.$comparator==null){
+java.util.TreeMap.toComparable(endKey).compareTo(endKey);
+}else{
+this.$comparator.compare(endKey,endKey);
+}return new java.util.TreeMap.SubMap(this,endKey);
+},"~O");
+Clazz_overrideMethod(c$,"keySet",
+function(){
+if(this.$keySet==null){
+this.$keySet=((Clazz_isClassDefined("java.util.TreeMap$2")?0:java.util.TreeMap.$TreeMap$2$()),Clazz_innerTypeInstance(java.util.TreeMap$2,this,null));
+}return this.$keySet;
+});
+Clazz_overrideMethod(c$,"lastKey",
+function(){
+if(this.root!=null){
+return java.util.TreeMap.maximum(this.root).key;
+}throw new java.util.NoSuchElementException();
+});
+Clazz_defineMethod(c$,"leftRotate",
+($fz=function(x){
+var y=x.right;
+x.right=y.left;
+if(y.left!=null){
+y.left.parent=x;
+}y.parent=x.parent;
+if(x.parent==null){
+this.root=y;
+}else{
+if(x===x.parent.left){
+x.parent.left=y;
+}else{
+x.parent.right=y;
+}}y.left=x;
+x.parent=y;
+},$fz.isPrivate=true,$fz),"java.util.TreeMap.Entry");
+c$.maximum=Clazz_defineMethod(c$,"maximum",
+function(x){
+while(x.right!=null){
+x=x.right;
+}
+return x;
+},"java.util.TreeMap.Entry");
+c$.minimum=Clazz_defineMethod(c$,"minimum",
+function(x){
+while(x.left!=null){
+x=x.left;
+}
+return x;
+},"java.util.TreeMap.Entry");
+c$.predecessor=Clazz_defineMethod(c$,"predecessor",
+function(x){
+if(x.left!=null){
+return java.util.TreeMap.maximum(x.left);
+}var y=x.parent;
+while(y!=null&&x===y.left){
+x=y;
+y=y.parent;
+}
+return y;
+},"java.util.TreeMap.Entry");
+Clazz_overrideMethod(c$,"put",
+function(key,value){
+var entry=this.rbInsert(key);
+var result=entry.value;
+entry.value=value;
+return result;
+},"~O,~O");
+Clazz_defineMethod(c$,"rbDelete",
+function(z){
+var y=z.left==null||z.right==null?z:java.util.TreeMap.successor(z);
+var x=y.left!=null?y.left:y.right;
+if(x!=null){
+x.parent=y.parent;
+}if(y.parent==null){
+this.root=x;
+}else if(y===y.parent.left){
+y.parent.left=x;
+}else{
+y.parent.right=x;
+}this.modCount++;
+if(y!==z){
+z.key=y.key;
+z.value=y.value;
+}if(!y.color&&this.root!=null){
+if(x==null){
+this.fixup(y.parent);
+}else{
+this.fixup(x);
+}}this.$size--;
+},"java.util.TreeMap.Entry");
+Clazz_defineMethod(c$,"rbInsert",
+($fz=function(object){
+var result=0;
+var y=null;
+if(this.$size!=0){
+var key=null;
+if(this.$comparator==null){
+key=java.util.TreeMap.toComparable(object);
+}var x=this.root;
+while(x!=null){
+y=x;
+result=key!=null?key.compareTo(x.key):this.$comparator.compare(object,x.key);
+if(result==0){
+return x;
+}x=result<0?x.left:x.right;
+}
+}this.$size++;
+this.modCount++;
+var z=new java.util.TreeMap.Entry(object);
+if(y==null){
+return this.root=z;
+}z.parent=y;
+if(result<0){
+y.left=z;
+}else{
+y.right=z;
+}this.balance(z);
+return z;
+},$fz.isPrivate=true,$fz),"~O");
+Clazz_overrideMethod(c$,"remove",
+function(key){
+var node=this.find(key);
+if(node==null){
+return null;
+}var result=node.value;
+this.rbDelete(node);
+return result;
+},"~O");
+Clazz_defineMethod(c$,"rightRotate",
+($fz=function(x){
+var y=x.left;
+x.left=y.right;
+if(y.right!=null){
+y.right.parent=x;
+}y.parent=x.parent;
+if(x.parent==null){
+this.root=y;
+}else{
+if(x===x.parent.right){
+x.parent.right=y;
+}else{
+x.parent.left=y;
+}}y.right=x;
+x.parent=y;
+},$fz.isPrivate=true,$fz),"java.util.TreeMap.Entry");
+Clazz_overrideMethod(c$,"size",
+function(){
+return this.$size;
+});
+Clazz_overrideMethod(c$,"subMap",
+function(startKey,endKey){
+if(this.$comparator==null){
+if(java.util.TreeMap.toComparable(startKey).compareTo(endKey)<=0){
+return new java.util.TreeMap.SubMap(startKey,this,endKey);
+}}else{
+if(this.$comparator.compare(startKey,endKey)<=0){
+return new java.util.TreeMap.SubMap(startKey,this,endKey);
+}}throw new IllegalArgumentException();
+},"~O,~O");
+c$.successor=Clazz_defineMethod(c$,"successor",
+function(x){
+if(x.right!=null){
+return java.util.TreeMap.minimum(x.right);
+}var y=x.parent;
+while(y!=null&&x===y.right){
+x=y;
+y=y.parent;
+}
+return y;
+},"java.util.TreeMap.Entry");
+Clazz_overrideMethod(c$,"tailMap",
+function(startKey){
+if(this.$comparator==null){
+java.util.TreeMap.toComparable(startKey).compareTo(startKey);
+}else{
+this.$comparator.compare(startKey,startKey);
+}return new java.util.TreeMap.SubMap(startKey,this);
+},"~O");
+Clazz_overrideMethod(c$,"values",
+function(){
+if(this.valuesCollection==null){
+this.valuesCollection=((Clazz_isClassDefined("java.util.TreeMap$3")?0:java.util.TreeMap.$TreeMap$3$()),Clazz_innerTypeInstance(java.util.TreeMap$3,this,null));
+}return this.valuesCollection;
+});
+c$.$TreeMap$1$=function(){
+Clazz_pu$h(self.c$);
+c$=Clazz_declareAnonymous(java.util,"TreeMap$1",java.util.AbstractSet);
+Clazz_overrideMethod(c$,"size",
+function(){
+return this.b$["java.util.TreeMap"].$size;
+});
+Clazz_overrideMethod(c$,"clear",
+function(){
+this.b$["java.util.TreeMap"].clear();
+});
+Clazz_overrideMethod(c$,"contains",
+function(object){
+if(Clazz_instanceOf(object,java.util.Map.Entry)){
+var entry=object;
+var v1=this.b$["java.util.TreeMap"].get(entry.getKey());
+var v2=entry.getValue();
+return v1==null?v2==null:v1.equals(v2);
+}return false;
+},"~O");
+Clazz_defineMethod(c$,"iterator",
+function(){
+return new java.util.TreeMap.UnboundedEntryIterator(this.b$["java.util.TreeMap"]);
+});
+c$=Clazz_p0p();
+};
+c$.$TreeMap$2$=function(){
+Clazz_pu$h(self.c$);
+c$=Clazz_declareAnonymous(java.util,"TreeMap$2",java.util.AbstractSet);
+Clazz_overrideMethod(c$,"contains",
+function(object){
+return this.b$["java.util.TreeMap"].containsKey(object);
+},"~O");
+Clazz_overrideMethod(c$,"size",
+function(){
+return this.b$["java.util.TreeMap"].$size;
+});
+Clazz_overrideMethod(c$,"clear",
+function(){
+this.b$["java.util.TreeMap"].clear();
+});
+Clazz_overrideMethod(c$,"iterator",
+function(){
+return new java.util.TreeMap.UnboundedKeyIterator(this.b$["java.util.TreeMap"]);
+});
+c$=Clazz_p0p();
+};
+c$.$TreeMap$3$=function(){
+Clazz_pu$h(self.c$);
+c$=Clazz_declareAnonymous(java.util,"TreeMap$3",java.util.AbstractCollection);
+Clazz_overrideMethod(c$,"contains",
+function(object){
+return this.b$["java.util.TreeMap"].containsValue(object);
+},"~O");
+Clazz_overrideMethod(c$,"size",
+function(){
+return this.b$["java.util.TreeMap"].$size;
+});
+Clazz_overrideMethod(c$,"clear",
+function(){
+this.b$["java.util.TreeMap"].clear();
+});
+Clazz_overrideMethod(c$,"iterator",
+function(){
+return new java.util.TreeMap.UnboundedValueIterator(this.b$["java.util.TreeMap"]);
+});
+c$=Clazz_p0p();
+};
+Clazz_pu$h(self.c$);
+c$=Clazz_decorateAsClass(function(){
+this.parent=null;
+this.left=null;
+this.right=null;
+this.color=false;
+Clazz_instantialize(this,arguments);
+},java.util.TreeMap,"Entry",java.util.MapEntry);
+Clazz_defineMethod(c$,"clone",
+function(a){
+var b=Clazz_superCall(this,java.util.TreeMap.Entry,"clone",[]);
+b.parent=a;
+if(this.left!=null){
+b.left=this.left.clone(b);
+}if(this.right!=null){
+b.right=this.right.clone(b);
+}return b;
+},"java.util.TreeMap.Entry");
+c$=Clazz_p0p();
+Clazz_pu$h(self.c$);
+c$=Clazz_decorateAsClass(function(){
+this.backingMap=null;
+this.expectedModCount=0;
+this.node=null;
+this.lastNode=null;
+Clazz_instantialize(this,arguments);
+},java.util.TreeMap,"AbstractMapIterator");
+Clazz_makeConstructor(c$,
+function(a,b){
+this.backingMap=a;
+this.expectedModCount=a.modCount;
+this.node=b;
+},"java.util.TreeMap,java.util.TreeMap.Entry");
+Clazz_defineMethod(c$,"hasNext",
+function(){
+return this.node!=null;
+});
+Clazz_defineMethod(c$,"remove",
+function(){
+if(this.expectedModCount==this.backingMap.modCount){
+if(this.lastNode!=null){
+this.backingMap.rbDelete(this.lastNode);
+this.lastNode=null;
+this.expectedModCount++;
+}else{
+throw new IllegalStateException();
+}}else{
+throw new java.util.ConcurrentModificationException();
+}});
+Clazz_defineMethod(c$,"makeNext",
+function(){
+if(this.expectedModCount!=this.backingMap.modCount){
+throw new java.util.ConcurrentModificationException();
+}else if(this.node==null){
+throw new java.util.NoSuchElementException();
+}this.lastNode=this.node;
+this.node=java.util.TreeMap.successor(this.node);
+});
+c$=Clazz_p0p();
+Clazz_pu$h(self.c$);
+c$=Clazz_declareType(java.util.TreeMap,"UnboundedEntryIterator",java.util.TreeMap.AbstractMapIterator,java.util.Iterator);
+Clazz_makeConstructor(c$,
+function(a){
+Clazz_superConstructor(this,java.util.TreeMap.UnboundedEntryIterator,[a,a.root==null?null:java.util.TreeMap.minimum(a.root)]);
+},"java.util.TreeMap");
+Clazz_overrideMethod(c$,"next",
+function(){
+this.makeNext();
+return this.lastNode;
+});
+c$=Clazz_p0p();
+Clazz_pu$h(self.c$);
+c$=Clazz_declareType(java.util.TreeMap,"UnboundedKeyIterator",java.util.TreeMap.AbstractMapIterator,java.util.Iterator);
+Clazz_makeConstructor(c$,
+function(a){
+Clazz_superConstructor(this,java.util.TreeMap.UnboundedKeyIterator,[a,a.root==null?null:java.util.TreeMap.minimum(a.root)]);
+},"java.util.TreeMap");
+Clazz_overrideMethod(c$,"next",
+function(){
+this.makeNext();
+return this.lastNode.key;
+});
+c$=Clazz_p0p();
+Clazz_pu$h(self.c$);
+c$=Clazz_declareType(java.util.TreeMap,"UnboundedValueIterator",java.util.TreeMap.AbstractMapIterator,java.util.Iterator);
+Clazz_makeConstructor(c$,
+function(a){
+Clazz_superConstructor(this,java.util.TreeMap.UnboundedValueIterator,[a,a.root==null?null:java.util.TreeMap.minimum(a.root)]);
+},"java.util.TreeMap");
+Clazz_overrideMethod(c$,"next",
+function(){
+this.makeNext();
+return this.lastNode.value;
+});
+c$=Clazz_p0p();
+Clazz_pu$h(self.c$);
+c$=Clazz_decorateAsClass(function(){
+this.endKey=null;
+this.cmp=null;
+Clazz_instantialize(this,arguments);
+},java.util.TreeMap,"ComparatorBoundedIterator",java.util.TreeMap.AbstractMapIterator);
+Clazz_makeConstructor(c$,
+function(a,b,c){
+Clazz_superConstructor(this,java.util.TreeMap.ComparatorBoundedIterator,[a,b]);
+this.endKey=c;
+this.cmp=a.comparator();
+},"java.util.TreeMap,java.util.TreeMap.Entry,~O");
+Clazz_defineMethod(c$,"cleanNext",
+function(){
+if(this.node!=null&&this.cmp.compare(this.endKey,this.node.key)<=0){
+this.node=null;
+}});
+Clazz_overrideMethod(c$,"hasNext",
+function(){
+return(this.node!=null&&this.endKey!=null)&&(this.cmp.compare(this.node.key,this.endKey)<0);
+});
+c$=Clazz_p0p();
+Clazz_pu$h(self.c$);
+c$=Clazz_declareType(java.util.TreeMap,"ComparatorBoundedEntryIterator",java.util.TreeMap.ComparatorBoundedIterator,java.util.Iterator);
+Clazz_overrideMethod(c$,"next",
+function(){
+this.makeNext();
+this.cleanNext();
+return this.lastNode;
+});
+c$=Clazz_p0p();
+Clazz_pu$h(self.c$);
+c$=Clazz_declareType(java.util.TreeMap,"ComparatorBoundedKeyIterator",java.util.TreeMap.ComparatorBoundedIterator,java.util.Iterator);
+Clazz_overrideMethod(c$,"next",
+function(){
+this.makeNext();
+this.cleanNext();
+return this.lastNode.key;
+});
+c$=Clazz_p0p();
+Clazz_pu$h(self.c$);
+c$=Clazz_declareType(java.util.TreeMap,"ComparatorBoundedValueIterator",java.util.TreeMap.ComparatorBoundedIterator,java.util.Iterator);
+Clazz_overrideMethod(c$,"next",
+function(){
+this.makeNext();
+this.cleanNext();
+return this.lastNode.value;
+});
+c$=Clazz_p0p();
+Clazz_pu$h(self.c$);
+c$=Clazz_decorateAsClass(function(){
+this.endKey=null;
+Clazz_instantialize(this,arguments);
+},java.util.TreeMap,"ComparableBoundedIterator",java.util.TreeMap.AbstractMapIterator);
+Clazz_makeConstructor(c$,
+function(a,b,c){
+Clazz_superConstructor(this,java.util.TreeMap.ComparableBoundedIterator,[a,b]);
+this.endKey=c;
+},"java.util.TreeMap,java.util.TreeMap.Entry,Comparable");
+Clazz_defineMethod(c$,"cleanNext",
+function(){
+if((this.node!=null)&&(this.endKey.compareTo(this.node.key)<=0)){
+this.node=null;
+}});
+Clazz_overrideMethod(c$,"hasNext",
+function(){
+return(this.node!=null)&&(this.endKey.compareTo(this.node.key)>0);
+});
+c$=Clazz_p0p();
+Clazz_pu$h(self.c$);
+c$=Clazz_declareType(java.util.TreeMap,"ComparableBoundedEntryIterator",java.util.TreeMap.ComparableBoundedIterator,java.util.Iterator);
+Clazz_overrideMethod(c$,"next",
+function(){
+this.makeNext();
+this.cleanNext();
+return this.lastNode;
+});
+c$=Clazz_p0p();
+Clazz_pu$h(self.c$);
+c$=Clazz_declareType(java.util.TreeMap,"ComparableBoundedKeyIterator",java.util.TreeMap.ComparableBoundedIterator,java.util.Iterator);
+Clazz_overrideMethod(c$,"next",
+function(){
+this.makeNext();
+this.cleanNext();
+return this.lastNode.key;
+});
+c$=Clazz_p0p();
+Clazz_pu$h(self.c$);
+c$=Clazz_declareType(java.util.TreeMap,"ComparableBoundedValueIterator",java.util.TreeMap.ComparableBoundedIterator,java.util.Iterator);
+Clazz_overrideMethod(c$,"next",
+function(){
+this.makeNext();
+this.cleanNext();
+return this.lastNode.value;
+});
+c$=Clazz_p0p();
+Clazz_pu$h(self.c$);
+c$=Clazz_decorateAsClass(function(){
+this.backingMap=null;
+this.hasStart=false;
+this.hasEnd=false;
+this.startKey=null;
+this.endKey=null;
+this.$entrySet=null;
+Clazz_instantialize(this,arguments);
+},java.util.TreeMap,"SubMap",java.util.AbstractMap,[java.util.SortedMap,java.io.Serializable]);
+Clazz_makeConstructor(c$,
+function(a,b){
+Clazz_superConstructor(this,java.util.TreeMap.SubMap,[]);
+this.backingMap=b;
+this.hasStart=true;
+this.startKey=a;
+},"~O,java.util.TreeMap");
+Clazz_makeConstructor(c$,
+function(a,b,c){
+Clazz_superConstructor(this,java.util.TreeMap.SubMap,[]);
+this.backingMap=b;
+this.hasStart=this.hasEnd=true;
+this.startKey=a;
+this.endKey=c;
+},"~O,java.util.TreeMap,~O");
+Clazz_makeConstructor(c$,
+function(a,b){
+Clazz_superConstructor(this,java.util.TreeMap.SubMap,[]);
+this.backingMap=a;
+this.hasEnd=true;
+this.endKey=b;
+},"java.util.TreeMap,~O");
+Clazz_overrideMethod(c$,"comparator",
+function(){
+return this.backingMap.comparator();
+});
+Clazz_overrideMethod(c$,"containsKey",
+function(a){
+if(this.isInRange(a)){
+return this.backingMap.containsKey(a);
+}return false;
+},"~O");
+Clazz_overrideMethod(c$,"entrySet",
+function(){
+if(this.$entrySet==null){
+this.$entrySet=new java.util.TreeMap.SubMapEntrySet(this);
+}return this.$entrySet;
+});
+Clazz_overrideMethod(c$,"firstKey",
+function(){
+var a=this.firstEntry();
+if(a!=null){
+return a.key;
+}throw new java.util.NoSuchElementException();
+});
+Clazz_defineMethod(c$,"firstEntry",
+function(){
+if(!this.hasStart){
+var a=this.backingMap.root;
+return(a==null)?null:java.util.TreeMap.minimum(this.backingMap.root);
+}var a=this.backingMap.findAfter(this.startKey);
+if(a!=null&&this.checkUpperBound(a.key)){
+return a;
+}return null;
+});
+Clazz_overrideMethod(c$,"get",
+function(a){
+if(this.isInRange(a)){
+return this.backingMap.get(a);
+}return null;
+},"~O");
+Clazz_overrideMethod(c$,"headMap",
+function(a){
+this.checkRange(a);
+if(this.hasStart){
+return new java.util.TreeMap.SubMap(this.startKey,this.backingMap,a);
+}return new java.util.TreeMap.SubMap(this.backingMap,a);
+},"~O");
+Clazz_overrideMethod(c$,"isEmpty",
+function(){
+if(this.hasStart){
+var a=this.backingMap.findAfter(this.startKey);
+return a==null||!this.checkUpperBound(a.key);
+}return this.backingMap.findBefore(this.endKey)==null;
+});
+Clazz_overrideMethod(c$,"keySet",
+function(){
+if(this.$keySet==null){
+this.$keySet=new java.util.TreeMap.SubMapKeySet(this);
+}return this.$keySet;
+});
+Clazz_overrideMethod(c$,"lastKey",
+function(){
+if(!this.hasEnd){
+return this.backingMap.lastKey();
+}var a=this.backingMap.findBefore(this.endKey);
+if(a!=null&&this.checkLowerBound(a.key)){
+return a.key;
+}throw new java.util.NoSuchElementException();
+});
+Clazz_overrideMethod(c$,"put",
+function(a,b){
+if(this.isInRange(a)){
+return this.backingMap.put(a,b);
+}throw new IllegalArgumentException();
+},"~O,~O");
+Clazz_overrideMethod(c$,"remove",
+function(a){
+if(this.isInRange(a)){
+return this.backingMap.remove(a);
+}return null;
+},"~O");
+Clazz_overrideMethod(c$,"subMap",
+function(a,b){
+this.checkRange(a);
+this.checkRange(b);
+var c=this.backingMap.comparator();
+if(c==null){
+if(java.util.TreeMap.toComparable(a).compareTo(b)<=0){
+return new java.util.TreeMap.SubMap(a,this.backingMap,b);
+}}else{
+if(c.compare(a,b)<=0){
+return new java.util.TreeMap.SubMap(a,this.backingMap,b);
+}}throw new IllegalArgumentException();
+},"~O,~O");
+Clazz_overrideMethod(c$,"tailMap",
+function(a){
+this.checkRange(a);
+if(this.hasEnd){
+return new java.util.TreeMap.SubMap(a,this.backingMap,this.endKey);
+}return new java.util.TreeMap.SubMap(a,this.backingMap);
+},"~O");
+Clazz_overrideMethod(c$,"values",
+function(){
+if(this.valuesCollection==null){
+this.valuesCollection=new java.util.TreeMap.SubMapValuesCollection(this);
+}return this.valuesCollection;
+});
+c$=Clazz_p0p();
+Clazz_pu$h(self.c$);
+c$=Clazz_decorateAsClass(function(){
+this.subMap=null;
+Clazz_instantialize(this,arguments);
+},java.util.TreeMap,"SubMapEntrySet",java.util.AbstractSet,java.util.Set);
+Clazz_makeConstructor(c$,
+function(a){
+Clazz_superConstructor(this,java.util.TreeMap.SubMapEntrySet,[]);
+this.subMap=a;
+},"java.util.TreeMap.SubMap");
+Clazz_overrideMethod(c$,"isEmpty",
+function(){
+return this.subMap.isEmpty();
+});
+Clazz_overrideMethod(c$,"iterator",
+function(){
+var a=this.subMap.firstEntry();
+if(this.subMap.hasEnd){
+var b=this.subMap.comparator();
+if(b==null){
+return new java.util.TreeMap.ComparableBoundedEntryIterator(this.subMap.backingMap,a,java.util.TreeMap.toComparable(this.subMap.endKey));
+}return new java.util.TreeMap.ComparatorBoundedEntryIterator(this.subMap.backingMap,a,this.subMap.endKey);
+}return new java.util.TreeMap.UnboundedEntryIterator(this.subMap.backingMap,a);
+});
+Clazz_overrideMethod(c$,"size",
+function(){
+var a=0;
+var b=this.iterator();
+while(b.hasNext()){
+a++;
+b.next();
+}
+return a;
+});
+Clazz_overrideMethod(c$,"contains",
+function(a){
+if(Clazz_instanceOf(a,java.util.Map.Entry)){
+var b=a;
+var c=b.getKey();
+if(this.subMap.isInRange(c)){
+var d=this.subMap.get(c);
+var e=b.getValue();
+return d==null?e==null:d.equals(e);
+}}return false;
+},"~O");
+c$=Clazz_p0p();
+Clazz_pu$h(self.c$);
+c$=Clazz_decorateAsClass(function(){
+this.subMap=null;
+Clazz_instantialize(this,arguments);
+},java.util.TreeMap,"SubMapKeySet",java.util.AbstractSet,java.util.Set);
+Clazz_makeConstructor(c$,
+function(a){
+Clazz_superConstructor(this,java.util.TreeMap.SubMapKeySet,[]);
+this.subMap=a;
+},"java.util.TreeMap.SubMap");
+Clazz_overrideMethod(c$,"contains",
+function(a){
+return this.subMap.containsKey(a);
+},"~O");
+Clazz_overrideMethod(c$,"isEmpty",
+function(){
+return this.subMap.isEmpty();
+});
+Clazz_overrideMethod(c$,"size",
+function(){
+var a=0;
+var b=this.iterator();
+while(b.hasNext()){
+a++;
+b.next();
+}
+return a;
+});
+Clazz_overrideMethod(c$,"iterator",
+function(){
+var a=this.subMap.firstEntry();
+if(this.subMap.hasEnd){
+var b=this.subMap.comparator();
+if(b==null){
+return new java.util.TreeMap.ComparableBoundedKeyIterator(this.subMap.backingMap,a,java.util.TreeMap.toComparable(this.subMap.endKey));
+}return new java.util.TreeMap.ComparatorBoundedKeyIterator(this.subMap.backingMap,a,this.subMap.endKey);
+}return new java.util.TreeMap.UnboundedKeyIterator(this.subMap.backingMap,a);
+});
+c$=Clazz_p0p();
+Clazz_pu$h(self.c$);
+c$=Clazz_decorateAsClass(function(){
+this.subMap=null;
+Clazz_instantialize(this,arguments);
+},java.util.TreeMap,"SubMapValuesCollection",java.util.AbstractCollection);
+Clazz_makeConstructor(c$,
+function(a){
+Clazz_superConstructor(this,java.util.TreeMap.SubMapValuesCollection,[]);
+this.subMap=a;
+},"java.util.TreeMap.SubMap");
+Clazz_overrideMethod(c$,"isEmpty",
+function(){
+return this.subMap.isEmpty();
+});
+Clazz_overrideMethod(c$,"iterator",
+function(){
+var a=this.subMap.firstEntry();
+if(this.subMap.hasEnd){
+var b=this.subMap.comparator();
+if(b==null){
+return new java.util.TreeMap.ComparableBoundedValueIterator(this.subMap.backingMap,a,java.util.TreeMap.toComparable(this.subMap.endKey));
+}return new java.util.TreeMap.ComparatorBoundedValueIterator(this.subMap.backingMap,a,this.subMap.endKey);
+}return new java.util.TreeMap.UnboundedValueIterator(this.subMap.backingMap,a);
+});
+Clazz_overrideMethod(c$,"size",
+function(){
+var a=0;
+for(var b=this.iterator();b.hasNext();){
+b.next();
+a++;
+}
+return a;
+});
+c$=Clazz_p0p();
+});
+Clazz_declarePackage ("jalview.appletgui");
+Clazz_load (["jalview.structure.CommandListener", "$.SelectionSource", "$.VamsasSource", "jalview.viewmodel.AlignmentViewport", "java.awt.Font"], "jalview.appletgui.AlignViewport", ["awt2swing.Frame", "jalview.api.AlignViewportI", "jalview.bin.JalviewLite", "jalview.datamodel.ColumnSelection", "$.SearchResults", "$.Sequence", "$.SequenceGroup", "jalview.schemes.ColourSchemeProperty", "jalview.structure.StructureSelectionManager", "jalview.util.Platform", "jalview.workers.AlignCalcManager", "java.lang.Float", "$.StringBuilder"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.cursorMode = false;
+this.font = null;
+this.validCharWidth = true;
+this.currentTree = null;
+this.applet = null;
+this.MAC = false;
+this.annotationColumnSelectionState = null;
+this.nullFrame = null;
+this.featureSettings = null;
+this.heightScale = 1;
+this.widthScale = 1;
+this.centreColumnLabels = false;
+this.followSelection = true;
+Clazz_instantialize (this, arguments);
+}, jalview.appletgui, "AlignViewport", jalview.viewmodel.AlignmentViewport, [jalview.structure.SelectionSource, jalview.structure.VamsasSource, jalview.structure.CommandListener]);
+Clazz_prepareFields (c$, function () {
+this.font =  new java.awt.Font ("SansSerif", 0, 10);
+});
+Clazz_overrideMethod (c$, "finalize", 
+function () {
+this.applet = null;
+this.quality = null;
+this.alignment = null;
+this.colSel = null;
+});
+Clazz_makeConstructor (c$, 
+function (al, applet) {
+Clazz_superConstructor (this, jalview.appletgui.AlignViewport);
+this.calculator =  new jalview.workers.AlignCalcManager ();
+this.applet = applet;
+this.alignment = al;
+this.setPadGaps (true);
+this.startRes = 0;
+this.endRes = al.getWidth () - 1;
+this.startSeq = 0;
+this.endSeq = al.getHeight () - 1;
+if (applet != null) {
+var param = applet.widthScale;
+if (param != null) {
+try {
+this.widthScale =  new Float (param).floatValue ();
+} catch (e) {
+if (Clazz_exceptionOf (e, Exception)) {
+} else {
+throw e;
+}
+}
+if (this.widthScale <= 1.0) {
+System.err.println ("Invalid alignment character width scaling factor (" + this.widthScale + "). Ignoring.");
+this.widthScale = 1;
+}if (jalview.bin.JalviewLite.debug) {
+System.err.println ("Alignment character width scaling factor is now " + this.widthScale);
+}}param = applet.heightScale;
+if (param != null) {
+try {
+this.heightScale =  new Float (param).floatValue ();
+} catch (e) {
+if (Clazz_exceptionOf (e, Exception)) {
+} else {
+throw e;
+}
+}
+if (this.heightScale <= 1.0) {
+System.err.println ("Invalid alignment character height scaling factor (" + this.heightScale + "). Ignoring.");
+this.heightScale = 1;
+}if (jalview.bin.JalviewLite.debug) {
+System.err.println ("Alignment character height scaling factor is now " + this.heightScale);
+}}}this.setFont (this.font);
+this.MAC = jalview.util.Platform.isAMac ();
+if (applet != null) {
+this.setShowJVSuffix (applet.getDefaultParameter ("showFullId", this.getShowJVSuffix ()));
+this.setShowAnnotation (applet.getDefaultParameter ("showAnnotation", this.isShowAnnotation ()));
+this.showConservation = applet.getDefaultParameter ("showConservation", this.showConservation);
+this.showQuality = applet.getDefaultParameter ("showQuality", this.showQuality);
+this.showConsensus = applet.getDefaultParameter ("showConsensus", this.showConsensus);
+this.setShowUnconserved (applet.getDefaultParameter ("showUnconserved", this.getShowUnconserved ()));
+this.setScaleProteinAsCdna (applet.getDefaultParameter ("scaleProteinAsCdna", this.isScaleProteinAsCdna ()));
+var param = applet.upperCase;
+if (param != null) {
+if (param.equalsIgnoreCase ("bold")) {
+this.setUpperCasebold (true);
+}}this.sortByTree = applet.getDefaultParameter ("sortByTree", this.sortByTree);
+this.setFollowHighlight (applet.getDefaultParameter ("automaticScrolling", this.isFollowHighlight ()));
+this.followSelection = this.isFollowHighlight ();
+this.showSequenceLogo = applet.getDefaultParameter ("showSequenceLogo", this.showSequenceLogo);
+this.normaliseSequenceLogo = applet.getDefaultParameter ("normaliseSequenceLogo", applet.getDefaultParameter ("normaliseLogo", this.normaliseSequenceLogo));
+this.showGroupConsensus = applet.getDefaultParameter ("showGroupConsensus", this.showGroupConsensus);
+this.showGroupConservation = applet.getDefaultParameter ("showGroupConservation", this.showGroupConservation);
+this.showConsensusHistogram = applet.getDefaultParameter ("showConsensusHistogram", this.showConsensusHistogram);
+}if (applet != null) {
+var colour = applet.defaultColour;
+if (colour == null) {
+colour = applet.userDefinedColour;
+if (colour != null) {
+colour = "User Defined";
+}}if (colour != null) {
+this.globalColourScheme = jalview.schemes.ColourSchemeProperty.getColour (this.alignment, colour);
+if (this.globalColourScheme != null) {
+this.globalColourScheme.setConsensus (this.hconsensus);
+}}if (applet.userDefinedColour != null) {
+(this.globalColourScheme).parseAppletParameter (applet.userDefinedColour);
+}}this.initAutoAnnotation ();
+}, "jalview.datamodel.AlignmentI,jalview.bin.JalviewLite");
+Clazz_defineMethod (c$, "getConsensusSeq", 
+function () {
+if (this.consensus == null) {
+this.updateConsensus (null);
+}if (this.consensus == null) {
+return null;
+}var seqs =  new StringBuilder (this.consensus.annotations.length);
+for (var i = 0; i < this.consensus.annotations.length; i++) {
+if (this.consensus.annotations[i] != null) {
+if (this.consensus.annotations[i].description.charAt (0) == '[') {
+seqs.append (this.consensus.annotations[i].description.charAt (1));
+} else {
+seqs.append (this.consensus.annotations[i].displayCharacter);
+}}}
+var sq =  new jalview.datamodel.Sequence ("Consensus", seqs.toString ());
+sq.setDescription ("Percentage Identity Consensus " + ((this.ignoreGapsInConsensusCalculation) ? " without gaps" : ""));
+return sq;
+});
+Clazz_defineMethod (c$, "setFont", 
+function (f) {
+this.font = f;
+if (this.nullFrame == null) {
+this.nullFrame =  new awt2swing.Frame ();
+this.nullFrame.addNotify ();
+this.nullFrame.setFont (this.font);
+}var fm = this.nullFrame.getGraphics ().getFontMetrics (this.font);
+this.setCharHeight (Clazz_floatToInt (this.heightScale * fm.getHeight ()));
+this.setCharWidth (Clazz_floatToInt (this.widthScale * fm.charWidth ('M')));
+if (this.isUpperCasebold ()) {
+var f2 =  new java.awt.Font (f.getName (), 1, f.getSize ());
+fm = this.nullFrame.getGraphics ().getFontMetrics (f2);
+this.setCharWidth (Clazz_floatToInt (this.widthScale * (Clazz_doubleToInt (fm.stringWidth ("MMMMMMMMMMM") / 10))));
+}}, "java.awt.Font");
+Clazz_defineMethod (c$, "getFont", 
+function () {
+return this.font;
+});
+Clazz_defineMethod (c$, "resetSeqLimits", 
+function (height) {
+this.setEndSeq (Clazz_doubleToInt (height / this.getCharHeight ()));
+}, "~N");
+Clazz_defineMethod (c$, "setCurrentTree", 
+function (tree) {
+this.currentTree = tree;
+}, "jalview.analysis.NJTree");
+Clazz_defineMethod (c$, "getCurrentTree", 
+function () {
+return this.currentTree;
+});
+Clazz_defineMethod (c$, "getCentreColumnLabels", 
+function () {
+return this.centreColumnLabels;
+});
+Clazz_defineMethod (c$, "getFollowSelection", 
+function () {
+return this.followSelection;
+});
+Clazz_overrideMethod (c$, "sendSelection", 
+function () {
+this.getStructureSelectionManager ().sendSelection ( new jalview.datamodel.SequenceGroup (this.getSelectionGroup ()),  new jalview.datamodel.ColumnSelection (this.getColumnSelection ()), this);
+});
+Clazz_overrideMethod (c$, "getStructureSelectionManager", 
+function () {
+return jalview.structure.StructureSelectionManager.getStructureSelectionManager (this.applet);
+});
+Clazz_defineMethod (c$, "expandColSelection", 
+function (sg, wholewidth) {
+var sgs;
+var sge;
+if (sg != null && (sgs = sg.getStartRes ()) >= 0 && sg.getStartRes () <= (sge = sg.getEndRes ()) && (this.colSel == null || this.colSel.getSelected () == null || this.colSel.getSelected ().size () == 0)) {
+if (!wholewidth && this.alignment.getWidth () == (1 + sge - sgs)) {
+return;
+}if (this.colSel == null) {
+this.colSel =  new jalview.datamodel.ColumnSelection ();
+}for (var cspos = sg.getStartRes (); cspos <= sg.getEndRes (); cspos++) {
+this.colSel.addElement (cspos);
+}
+}}, "jalview.datamodel.SequenceGroup,~B");
+Clazz_overrideMethod (c$, "isNormaliseSequenceLogo", 
+function () {
+return this.normaliseSequenceLogo;
+});
+Clazz_defineMethod (c$, "setNormaliseSequenceLogo", 
+function (state) {
+this.normaliseSequenceLogo = state;
+}, "~B");
+Clazz_overrideMethod (c$, "isValidCharWidth", 
+function () {
+return this.validCharWidth;
+});
+Clazz_defineMethod (c$, "getAnnotationColumnSelectionState", 
+function () {
+return this.annotationColumnSelectionState;
+});
+Clazz_defineMethod (c$, "setAnnotationColumnSelectionState", 
+function (annotationColumnSelectionState) {
+this.annotationColumnSelectionState = annotationColumnSelectionState;
+}, "jalview.appletgui.AnnotationColumnChooser");
+Clazz_overrideMethod (c$, "mirrorCommand", 
+function (command, undo, ssm, source) {
+if (Clazz_instanceOf (source, jalview.api.AlignViewportI) && (source).getCodingComplement () === this) {
+} else {
+return;
+}var mappedCommand = ssm.mapCommand (command, undo, this.getAlignment (), this.getGapCharacter ());
+if (mappedCommand != null) {
+mappedCommand.doCommand (null);
+this.firePropertyChange ("alignment", null, this.getAlignment ().getSequences ());
+}}, "jalview.commands.CommandI,~B,jalview.structure.StructureSelectionManager,jalview.structure.VamsasSource");
+Clazz_overrideMethod (c$, "getVamsasSource", 
+function () {
+return this;
+});
+Clazz_defineMethod (c$, "scrollComplementaryAlignment", 
+function (complementPanel) {
+if (complementPanel == null) {
+return;
+}var sr =  new jalview.datamodel.SearchResults ();
+var seqOffset = this.findComplementScrollTarget (sr);
+if (!sr.isEmpty ()) {
+complementPanel.setFollowingComplementScroll (true);
+complementPanel.scrollToCentre (sr, seqOffset);
+}}, "jalview.appletgui.AlignmentPanel");
+});
+Clazz_declarePackage ("jalview.structure");
+Clazz_declareInterface (jalview.structure, "CommandListener");
+Clazz_declarePackage ("jalview.structure");
+Clazz_declareInterface (jalview.structure, "SelectionSource");
+Clazz_declarePackage ("jalview.structure");
+Clazz_declareInterface (jalview.structure, "VamsasSource");
+Clazz_declarePackage ("jalview.viewmodel");
+Clazz_load (["jalview.api.AlignViewportI", "jalview.structure.CommandListener", "$.VamsasSource", "jalview.datamodel.ColumnSelection", "jalview.viewmodel.styles.ViewStyle", "jalview.workers.AlignCalcManager", "java.beans.PropertyChangeSupport", "java.util.ArrayDeque", "$.HashMap"], "jalview.viewmodel.AlignmentViewport", ["jalview.analysis.Conservation", "jalview.datamodel.AlignmentAnnotation", "$.AlignmentView", "$.CigarArray", "$.Sequence", "$.SequenceGroup", "jalview.schemes.Blosum62ColourScheme", "$.PIDColourScheme", "$.ResidueProperties", "jalview.util.Comparison", "$.MappingUtils", "jalview.workers.ComplementConsensusThread", "$.ConsensusThread", "$.ConservationThread", "$.StrucConsensusThread", "java.awt.Color", "java.util.ArrayList", "$.BitSet", "$.Hashtable"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.viewStyle = null;
+this.codingComplement = null;
+this.featuresDisplayed = null;
+this.historyList = null;
+this.redoList = null;
+this.alignment = null;
+this.sequenceSetID = null;
+this.$isDataset = false;
+this.hiddenRepSequences = null;
+this.colSel = null;
+this.autoCalculateConsensus = true;
+this.autoCalculateStrucConsensus = true;
+this.ignoreGapsInConsensusCalculation = false;
+this.globalColourScheme = null;
+this.consensus = null;
+this.complementConsensus = null;
+this.strucConsensus = null;
+this.conservation = null;
+this.quality = null;
+this.groupConsensus = null;
+this.groupConservation = null;
+this.hconsensus = null;
+this.hcomplementConsensus = null;
+this.hStrucConsensus = null;
+this.hconservation = null;
+this.ConsPercGaps = 25;
+this.calculator = null;
+this.showGroupConservation = false;
+this.showGroupConsensus = false;
+this.showSequenceLogo = false;
+this.normaliseSequenceLogo = false;
+this.showConsensusHistogram = true;
+this.padGaps = false;
+this.sortByTree = false;
+this.selectionGroup = null;
+this.viewId = null;
+this.sgrouphash = -1;
+this.colselhash = -1;
+this.changeSupport = null;
+this.showConservation = true;
+this.showQuality = true;
+this.showConsensus = true;
+this.sequenceColours = null;
+this.sortAnnotationsBy = null;
+this.showAutocalculatedAbove = false;
+this.followHighlight = true;
+this.startRes = 0;
+this.endRes = 0;
+this.startSeq = 0;
+this.endSeq = 0;
+Clazz_instantialize (this, arguments);
+}, jalview.viewmodel, "AlignmentViewport", null, [jalview.api.AlignViewportI, jalview.structure.CommandListener, jalview.structure.VamsasSource]);
+Clazz_prepareFields (c$, function () {
+this.viewStyle =  new jalview.viewmodel.styles.ViewStyle ();
+this.historyList =  new java.util.ArrayDeque ();
+this.redoList =  new java.util.ArrayDeque ();
+this.colSel =  new jalview.datamodel.ColumnSelection ();
+this.calculator =  new jalview.workers.AlignCalcManager ();
+this.changeSupport =  new java.beans.PropertyChangeSupport (this);
+this.sequenceColours =  new java.util.HashMap ();
+});
+Clazz_defineMethod (c$, "setFontName", 
+function (name) {
+this.viewStyle.setFontName (name);
+}, "~S");
+Clazz_defineMethod (c$, "setFontStyle", 
+function (style) {
+this.viewStyle.setFontStyle (style);
+}, "~N");
+Clazz_defineMethod (c$, "setFontSize", 
+function (size) {
+this.viewStyle.setFontSize (size);
+}, "~N");
+Clazz_defineMethod (c$, "getFontStyle", 
+function () {
+return this.viewStyle.getFontStyle ();
+});
+Clazz_defineMethod (c$, "getFontName", 
+function () {
+return this.viewStyle.getFontName ();
+});
+Clazz_defineMethod (c$, "getFontSize", 
+function () {
+return this.viewStyle.getFontSize ();
+});
+Clazz_defineMethod (c$, "setUpperCasebold", 
+function (upperCasebold) {
+this.viewStyle.setUpperCasebold (upperCasebold);
+}, "~B");
+Clazz_defineMethod (c$, "isUpperCasebold", 
+function () {
+return this.viewStyle.isUpperCasebold ();
+});
+Clazz_defineMethod (c$, "isSeqNameItalics", 
+function () {
+return this.viewStyle.isSeqNameItalics ();
+});
+Clazz_defineMethod (c$, "setColourByReferenceSeq", 
+function (colourByReferenceSeq) {
+this.viewStyle.setColourByReferenceSeq (colourByReferenceSeq);
+}, "~B");
+Clazz_defineMethod (c$, "setColourAppliesToAllGroups", 
+function (b) {
+this.viewStyle.setColourAppliesToAllGroups (b);
+}, "~B");
+Clazz_defineMethod (c$, "getColourAppliesToAllGroups", 
+function () {
+return this.viewStyle.getColourAppliesToAllGroups ();
+});
+Clazz_defineMethod (c$, "getAbovePIDThreshold", 
+function () {
+return this.viewStyle.getAbovePIDThreshold ();
+});
+Clazz_defineMethod (c$, "setIncrement", 
+function (inc) {
+this.viewStyle.setIncrement (inc);
+}, "~N");
+Clazz_defineMethod (c$, "getIncrement", 
+function () {
+return this.viewStyle.getIncrement ();
+});
+Clazz_defineMethod (c$, "setConservationSelected", 
+function (b) {
+this.viewStyle.setConservationSelected (b);
+}, "~B");
+Clazz_defineMethod (c$, "setShowHiddenMarkers", 
+function (show) {
+this.viewStyle.setShowHiddenMarkers (show);
+}, "~B");
+Clazz_defineMethod (c$, "getShowHiddenMarkers", 
+function () {
+return this.viewStyle.getShowHiddenMarkers ();
+});
+Clazz_defineMethod (c$, "setScaleRightWrapped", 
+function (b) {
+this.viewStyle.setScaleRightWrapped (b);
+}, "~B");
+Clazz_defineMethod (c$, "setScaleLeftWrapped", 
+function (b) {
+this.viewStyle.setScaleLeftWrapped (b);
+}, "~B");
+Clazz_defineMethod (c$, "setScaleAboveWrapped", 
+function (b) {
+this.viewStyle.setScaleAboveWrapped (b);
+}, "~B");
+Clazz_defineMethod (c$, "getScaleLeftWrapped", 
+function () {
+return this.viewStyle.getScaleLeftWrapped ();
+});
+Clazz_defineMethod (c$, "getScaleAboveWrapped", 
+function () {
+return this.viewStyle.getScaleAboveWrapped ();
+});
+Clazz_defineMethod (c$, "getScaleRightWrapped", 
+function () {
+return this.viewStyle.getScaleRightWrapped ();
+});
+Clazz_defineMethod (c$, "setAbovePIDThreshold", 
+function (b) {
+this.viewStyle.setAbovePIDThreshold (b);
+}, "~B");
+Clazz_defineMethod (c$, "setThreshold", 
+function (thresh) {
+this.viewStyle.setThreshold (thresh);
+}, "~N");
+Clazz_defineMethod (c$, "getThreshold", 
+function () {
+return this.viewStyle.getThreshold ();
+});
+Clazz_defineMethod (c$, "getShowJVSuffix", 
+function () {
+return this.viewStyle.getShowJVSuffix ();
+});
+Clazz_defineMethod (c$, "setShowJVSuffix", 
+function (b) {
+this.viewStyle.setShowJVSuffix (b);
+}, "~B");
+Clazz_defineMethod (c$, "setWrapAlignment", 
+function (state) {
+this.viewStyle.setWrapAlignment (state);
+}, "~B");
+Clazz_defineMethod (c$, "setShowText", 
+function (state) {
+this.viewStyle.setShowText (state);
+}, "~B");
+Clazz_defineMethod (c$, "setRenderGaps", 
+function (state) {
+this.viewStyle.setRenderGaps (state);
+}, "~B");
+Clazz_defineMethod (c$, "getColourText", 
+function () {
+return this.viewStyle.getColourText ();
+});
+Clazz_defineMethod (c$, "setColourText", 
+function (state) {
+this.viewStyle.setColourText (state);
+}, "~B");
+Clazz_defineMethod (c$, "getWrapAlignment", 
+function () {
+return this.viewStyle.getWrapAlignment ();
+});
+Clazz_defineMethod (c$, "getShowText", 
+function () {
+return this.viewStyle.getShowText ();
+});
+Clazz_defineMethod (c$, "getWrappedWidth", 
+function () {
+return this.viewStyle.getWrappedWidth ();
+});
+Clazz_defineMethod (c$, "setWrappedWidth", 
+function (w) {
+this.viewStyle.setWrappedWidth (w);
+}, "~N");
+Clazz_defineMethod (c$, "getCharHeight", 
+function () {
+return this.viewStyle.getCharHeight ();
+});
+Clazz_defineMethod (c$, "setCharHeight", 
+function (h) {
+this.viewStyle.setCharHeight (h);
+}, "~N");
+Clazz_defineMethod (c$, "getCharWidth", 
+function () {
+return this.viewStyle.getCharWidth ();
+});
+Clazz_defineMethod (c$, "setCharWidth", 
+function (w) {
+this.viewStyle.setCharWidth (w);
+}, "~N");
+Clazz_defineMethod (c$, "getShowBoxes", 
+function () {
+return this.viewStyle.getShowBoxes ();
+});
+Clazz_defineMethod (c$, "getShowUnconserved", 
+function () {
+return this.viewStyle.getShowUnconserved ();
+});
+Clazz_defineMethod (c$, "setShowUnconserved", 
+function (showunconserved) {
+this.viewStyle.setShowUnconserved (showunconserved);
+}, "~B");
+Clazz_defineMethod (c$, "setSeqNameItalics", 
+function (default1) {
+this.viewStyle.setSeqNameItalics (default1);
+}, "~B");
+Clazz_defineMethod (c$, "getAlignment", 
+function () {
+return this.alignment;
+});
+Clazz_overrideMethod (c$, "getGapCharacter", 
+function () {
+return this.alignment.getGapCharacter ();
+});
+Clazz_defineMethod (c$, "setDataset", 
+function (b) {
+this.$isDataset = b;
+}, "~B");
+Clazz_defineMethod (c$, "isDataset", 
+function () {
+return this.$isDataset;
+});
+Clazz_overrideMethod (c$, "setGlobalColourScheme", 
+function (cs) {
+this.globalColourScheme = cs;
+var recalc = false;
+if (cs != null) {
+cs.setConservationApplied (recalc = this.getConservationSelected ());
+if (this.getAbovePIDThreshold () || Clazz_instanceOf (cs, jalview.schemes.PIDColourScheme) || Clazz_instanceOf (cs, jalview.schemes.Blosum62ColourScheme)) {
+recalc = true;
+cs.setThreshold (this.viewStyle.getThreshold (), this.ignoreGapsInConsensusCalculation);
+} else {
+cs.setThreshold (0, this.ignoreGapsInConsensusCalculation);
+}if (recalc) {
+cs.setConsensus (this.hconsensus);
+cs.setConservation (this.hconservation);
+}cs.alignmentChanged (this.alignment, this.hiddenRepSequences);
+}if (this.getColourAppliesToAllGroups ()) {
+for (var sg, $sg = this.getAlignment ().getGroups ().iterator (); $sg.hasNext () && ((sg = $sg.next ()) || true);) {
+if (cs == null) {
+sg.cs = null;
+continue;
+}sg.cs = cs.applyTo (sg, this.getHiddenRepSequences ());
+sg.setConsPercGaps (this.ConsPercGaps);
+if (this.getAbovePIDThreshold () || Clazz_instanceOf (cs, jalview.schemes.PIDColourScheme) || Clazz_instanceOf (cs, jalview.schemes.Blosum62ColourScheme)) {
+sg.cs.setThreshold (this.viewStyle.getThreshold (), this.isIgnoreGapsConsensus ());
+recalc = true;
+} else {
+sg.cs.setThreshold (0, this.isIgnoreGapsConsensus ());
+}if (this.getConservationSelected ()) {
+sg.cs.setConservationApplied (true);
+recalc = true;
+} else {
+sg.cs.setConservation (null);
+}if (recalc) {
+sg.recalcConservation ();
+} else {
+sg.cs.alignmentChanged (sg, this.hiddenRepSequences);
+}}
+}}, "jalview.schemes.ColourSchemeI");
+Clazz_overrideMethod (c$, "getGlobalColourScheme", 
+function () {
+return this.globalColourScheme;
+});
+Clazz_overrideMethod (c$, "setConservation", 
+function (cons) {
+this.hconservation = cons;
+}, "jalview.analysis.Conservation");
+Clazz_overrideMethod (c$, "getConsPercGaps", 
+function () {
+return this.ConsPercGaps;
+});
+Clazz_overrideMethod (c$, "setSequenceConsensusHash", 
+function (hconsensus) {
+this.hconsensus = hconsensus;
+}, "~A");
+Clazz_overrideMethod (c$, "setComplementConsensusHash", 
+function (hconsensus) {
+this.hcomplementConsensus = hconsensus;
+}, "~A");
+Clazz_overrideMethod (c$, "getSequenceConsensusHash", 
+function () {
+return this.hconsensus;
+});
+Clazz_overrideMethod (c$, "getComplementConsensusHash", 
+function () {
+return this.hcomplementConsensus;
+});
+Clazz_overrideMethod (c$, "getRnaStructureConsensusHash", 
+function () {
+return this.hStrucConsensus;
+});
+Clazz_overrideMethod (c$, "setRnaStructureConsensusHash", 
+function (hStrucConsensus) {
+this.hStrucConsensus = hStrucConsensus;
+}, "~A");
+Clazz_overrideMethod (c$, "getAlignmentQualityAnnot", 
+function () {
+return this.quality;
+});
+Clazz_overrideMethod (c$, "getAlignmentConservationAnnotation", 
+function () {
+return this.conservation;
+});
+Clazz_overrideMethod (c$, "getAlignmentConsensusAnnotation", 
+function () {
+return this.consensus;
+});
+Clazz_overrideMethod (c$, "getComplementConsensusAnnotation", 
+function () {
+return this.complementConsensus;
+});
+Clazz_overrideMethod (c$, "getAlignmentStrucConsensusAnnotation", 
+function () {
+return this.strucConsensus;
+});
+Clazz_defineMethod (c$, "updateConservation", 
+function (ap) {
+if (this.alignment.isNucleotide () || this.conservation == null || !this.autoCalculateConsensus) {
+return;
+}if (this.calculator.getRegisteredWorkersOfClass (jalview.workers.ConservationThread) == null) {
+this.calculator.registerWorker ( new jalview.workers.ConservationThread (this, ap));
+}}, "jalview.api.AlignmentViewPanel");
+Clazz_defineMethod (c$, "updateConsensus", 
+function (ap) {
+if (this.consensus == null || !this.autoCalculateConsensus) {
+return;
+}if (this.calculator.getRegisteredWorkersOfClass (jalview.workers.ConsensusThread) == null) {
+this.calculator.registerWorker ( new jalview.workers.ConsensusThread (this, ap));
+}var al = this.getAlignment ();
+if (!al.isNucleotide () && al.getCodonFrames () != null && !al.getCodonFrames ().isEmpty ()) {
+if (this.calculator.getRegisteredWorkersOfClass (jalview.workers.ComplementConsensusThread) == null) {
+this.calculator.registerWorker ( new jalview.workers.ComplementConsensusThread (this, ap));
+}}}, "jalview.api.AlignmentViewPanel");
+Clazz_defineMethod (c$, "updateStrucConsensus", 
+function (ap) {
+if (this.autoCalculateStrucConsensus && this.strucConsensus == null && this.alignment.isNucleotide () && this.alignment.hasRNAStructure ()) {
+this.initRNAStructure ();
+}if (this.strucConsensus == null || !this.autoCalculateStrucConsensus) {
+return;
+}if (this.calculator.getRegisteredWorkersOfClass (jalview.workers.StrucConsensusThread) == null) {
+this.calculator.registerWorker ( new jalview.workers.StrucConsensusThread (this, ap));
+}}, "jalview.api.AlignmentViewPanel");
+Clazz_defineMethod (c$, "isCalcInProgress", 
+function () {
+return this.calculator.isWorking ();
+});
+Clazz_overrideMethod (c$, "isCalculationInProgress", 
+function (alignmentAnnotation) {
+if (!alignmentAnnotation.autoCalculated) {
+return false;
+}if (this.calculator.workingInvolvedWith (alignmentAnnotation)) {
+return true;
+}return false;
+}, "jalview.datamodel.AlignmentAnnotation");
+Clazz_overrideMethod (c$, "isClosed", 
+function () {
+return this.alignment == null;
+});
+Clazz_overrideMethod (c$, "getCalcManager", 
+function () {
+return this.calculator;
+});
+Clazz_overrideMethod (c$, "isShowSequenceLogo", 
+function () {
+return this.showSequenceLogo;
+});
+Clazz_defineMethod (c$, "setShowSequenceLogo", 
+function (showSequenceLogo) {
+if (showSequenceLogo != this.showSequenceLogo) {
+this.showSequenceLogo = showSequenceLogo;
+this.calculator.updateAnnotationFor (jalview.workers.ConsensusThread);
+this.calculator.updateAnnotationFor (jalview.workers.ComplementConsensusThread);
+this.calculator.updateAnnotationFor (jalview.workers.StrucConsensusThread);
+}this.showSequenceLogo = showSequenceLogo;
+}, "~B");
+Clazz_defineMethod (c$, "setShowConsensusHistogram", 
+function (showConsensusHistogram) {
+this.showConsensusHistogram = showConsensusHistogram;
+}, "~B");
+Clazz_defineMethod (c$, "isShowGroupConservation", 
+function () {
+return this.showGroupConservation;
+});
+Clazz_defineMethod (c$, "setShowGroupConservation", 
+function (showGroupConservation) {
+this.showGroupConservation = showGroupConservation;
+}, "~B");
+Clazz_defineMethod (c$, "isShowGroupConsensus", 
+function () {
+return this.showGroupConsensus;
+});
+Clazz_defineMethod (c$, "setShowGroupConsensus", 
+function (showGroupConsensus) {
+this.showGroupConsensus = showGroupConsensus;
+}, "~B");
+Clazz_overrideMethod (c$, "isShowConsensusHistogram", 
+function () {
+return this.showConsensusHistogram;
+});
+Clazz_overrideMethod (c$, "getSelectionGroup", 
+function () {
+return this.selectionGroup;
+});
+Clazz_overrideMethod (c$, "setSelectionGroup", 
+function (sg) {
+this.selectionGroup = sg;
+}, "jalview.datamodel.SequenceGroup");
+Clazz_defineMethod (c$, "setHiddenColumns", 
+function (colsel) {
+this.colSel = colsel;
+}, "jalview.datamodel.ColumnSelection");
+Clazz_overrideMethod (c$, "getColumnSelection", 
+function () {
+return this.colSel;
+});
+Clazz_overrideMethod (c$, "setColumnSelection", 
+function (colSel) {
+this.colSel = colSel;
+if (colSel != null) {
+this.updateHiddenColumns ();
+}}, "jalview.datamodel.ColumnSelection");
+Clazz_overrideMethod (c$, "getHiddenRepSequences", 
+function () {
+return this.hiddenRepSequences;
+});
+Clazz_overrideMethod (c$, "setHiddenRepSequences", 
+function (hiddenRepSequences) {
+this.hiddenRepSequences = hiddenRepSequences;
+}, "java.util.Map");
+Clazz_overrideMethod (c$, "hasHiddenColumns", 
+function () {
+return this.colSel != null && this.colSel.hasHiddenColumns ();
+});
+Clazz_defineMethod (c$, "updateHiddenColumns", 
+function () {
+});
+Clazz_overrideMethod (c$, "hasHiddenRows", 
+function () {
+return this.alignment.getHiddenSequences ().getSize () > 0;
+});
+Clazz_defineMethod (c$, "setSequenceSetId", 
+function (newid) {
+if (this.sequenceSetID != null) {
+System.err.println ("Warning - overwriting a sequenceSetId for a viewport!");
+}this.sequenceSetID =  String.instantialize (newid);
+}, "~S");
+Clazz_overrideMethod (c$, "getSequenceSetId", 
+function () {
+if (this.sequenceSetID == null) {
+this.sequenceSetID = this.alignment.hashCode () + "";
+}return this.sequenceSetID;
+});
+Clazz_overrideMethod (c$, "getViewId", 
+function () {
+if (this.viewId == null) {
+this.viewId = this.getSequenceSetId () + "." + this.hashCode () + "";
+}return this.viewId;
+});
+Clazz_defineMethod (c$, "setIgnoreGapsConsensus", 
+function (b, ap) {
+this.ignoreGapsInConsensusCalculation = b;
+if (ap != null) {
+this.updateConsensus (ap);
+if (this.globalColourScheme != null) {
+this.globalColourScheme.setThreshold (this.globalColourScheme.getThreshold (), this.ignoreGapsInConsensusCalculation);
+}}}, "~B,jalview.api.AlignmentViewPanel");
+Clazz_defineMethod (c$, "isSelectionGroupChanged", 
+function (b) {
+var hc = (this.selectionGroup == null || this.selectionGroup.getSize () == 0) ? -1 : this.selectionGroup.hashCode ();
+if (hc != -1 && hc != this.sgrouphash) {
+if (b) {
+this.sgrouphash = hc;
+}return true;
+}return false;
+}, "~B");
+Clazz_defineMethod (c$, "isColSelChanged", 
+function (b) {
+var hc = (this.colSel == null || this.colSel.size () == 0) ? -1 : this.colSel.hashCode ();
+if (hc != -1 && hc != this.colselhash) {
+if (b) {
+this.colselhash = hc;
+}return true;
+}return false;
+}, "~B");
+Clazz_overrideMethod (c$, "isIgnoreGapsConsensus", 
+function () {
+return this.ignoreGapsInConsensusCalculation;
+});
+Clazz_defineMethod (c$, "addPropertyChangeListener", 
+function (listener) {
+this.changeSupport.addPropertyChangeListener (listener);
+}, "java.beans.PropertyChangeListener");
+Clazz_defineMethod (c$, "removePropertyChangeListener", 
+function (listener) {
+this.changeSupport.removePropertyChangeListener (listener);
+}, "java.beans.PropertyChangeListener");
+Clazz_defineMethod (c$, "firePropertyChange", 
+function (prop, oldvalue, newvalue) {
+this.changeSupport.firePropertyChange (prop, oldvalue, newvalue);
+}, "~S,~O,~O");
+Clazz_defineMethod (c$, "hideSelectedColumns", 
+function () {
+if (this.colSel.size () < 1) {
+return;
+}this.colSel.hideSelectedColumns ();
+this.setSelectionGroup (null);
+});
+Clazz_defineMethod (c$, "hideColumns", 
+function (start, end) {
+if (start == end) {
+this.colSel.hideColumns (start);
+} else {
+this.colSel.hideColumns (start, end);
+}}, "~N,~N");
+Clazz_defineMethod (c$, "showColumn", 
+function (col) {
+this.colSel.revealHiddenColumns (col);
+}, "~N");
+Clazz_defineMethod (c$, "showAllHiddenColumns", 
+function () {
+this.colSel.revealAllHiddenColumns ();
+});
+Clazz_defineMethod (c$, "showAllHiddenSeqs", 
+function () {
+if (this.alignment.getHiddenSequences ().getSize () > 0) {
+if (this.selectionGroup == null) {
+this.selectionGroup =  new jalview.datamodel.SequenceGroup ();
+this.selectionGroup.setEndRes (this.alignment.getWidth () - 1);
+}var tmp = this.alignment.getHiddenSequences ().showAll (this.hiddenRepSequences);
+for (var seq, $seq = tmp.iterator (); $seq.hasNext () && ((seq = $seq.next ()) || true);) {
+this.selectionGroup.addSequence (seq, false);
+this.setSequenceAnnotationsVisible (seq, true);
+}
+this.hiddenRepSequences = null;
+this.firePropertyChange ("alignment", null, this.alignment.getSequences ());
+this.sendSelection ();
+}});
+Clazz_defineMethod (c$, "showSequence", 
+function (index) {
+var tmp = this.alignment.getHiddenSequences ().showSequence (index, this.hiddenRepSequences);
+if (tmp.size () > 0) {
+if (this.selectionGroup == null) {
+this.selectionGroup =  new jalview.datamodel.SequenceGroup ();
+this.selectionGroup.setEndRes (this.alignment.getWidth () - 1);
+}for (var seq, $seq = tmp.iterator (); $seq.hasNext () && ((seq = $seq.next ()) || true);) {
+this.selectionGroup.addSequence (seq, false);
+this.setSequenceAnnotationsVisible (seq, true);
+}
+this.firePropertyChange ("alignment", null, this.alignment.getSequences ());
+this.sendSelection ();
+}}, "~N");
+Clazz_defineMethod (c$, "hideAllSelectedSeqs", 
+function () {
+if (this.selectionGroup == null || this.selectionGroup.getSize () < 1) {
+return;
+}var seqs = this.selectionGroup.getSequencesInOrder (this.alignment);
+this.hideSequence (seqs);
+this.setSelectionGroup (null);
+});
+Clazz_defineMethod (c$, "hideSequence", 
+function (seq) {
+if (seq != null) {
+for (var i = 0; i < seq.length; i++) {
+this.alignment.getHiddenSequences ().hideSequence (seq[i]);
+this.setSequenceAnnotationsVisible (seq[i], false);
+}
+this.firePropertyChange ("alignment", null, this.alignment.getSequences ());
+}}, "~A");
+Clazz_defineMethod (c$, "setSequenceAnnotationsVisible", 
+function (sequenceI, visible) {
+for (var ann, $ann = 0, $$ann = this.alignment.getAlignmentAnnotation (); $ann < $$ann.length && ((ann = $$ann[$ann]) || true); $ann++) {
+if (ann.sequenceRef === sequenceI) {
+ann.visible = visible;
+}}
+}, "jalview.datamodel.SequenceI,~B");
+Clazz_defineMethod (c$, "hideRepSequences", 
+function (repSequence, sg) {
+var sSize = sg.getSize ();
+if (sSize < 2) {
+return;
+}if (this.hiddenRepSequences == null) {
+this.hiddenRepSequences =  new java.util.Hashtable ();
+}this.hiddenRepSequences.put (repSequence, sg);
+var seqs =  new Array (sSize - 1);
+var index = 0;
+for (var i = 0; i < sSize; i++) {
+if (sg.getSequenceAt (i) !== repSequence) {
+if (index == sSize - 1) {
+return;
+}seqs[index++] = sg.getSequenceAt (i);
+}}
+sg.setSeqrep (repSequence);
+sg.setHidereps (true);
+this.hideSequence (seqs);
+}, "jalview.datamodel.SequenceI,jalview.datamodel.SequenceGroup");
+Clazz_defineMethod (c$, "isHiddenRepSequence", 
+function (seq) {
+return this.alignment.getSeqrep () === seq || (this.hiddenRepSequences != null && this.hiddenRepSequences.containsKey (seq));
+}, "jalview.datamodel.SequenceI");
+Clazz_defineMethod (c$, "getRepresentedSequences", 
+function (seq) {
+return (this.hiddenRepSequences == null ? null : this.hiddenRepSequences.get (seq));
+}, "jalview.datamodel.SequenceI");
+Clazz_overrideMethod (c$, "adjustForHiddenSeqs", 
+function (alignmentIndex) {
+return this.alignment.getHiddenSequences ().adjustForHiddenSeqs (alignmentIndex);
+}, "~N");
+Clazz_overrideMethod (c$, "invertColumnSelection", 
+function () {
+this.colSel.invertColumnSelection (0, this.alignment.getWidth ());
+});
+Clazz_overrideMethod (c$, "getSelectionAsNewSequence", 
+function () {
+var sequences;
+if (this.selectionGroup == null || this.selectionGroup.getSize () == 0) {
+sequences = this.alignment.getSequencesArray ();
+var annots = this.alignment.getAlignmentAnnotation ();
+for (var i = 0; i < sequences.length; i++) {
+sequences[i] =  new jalview.datamodel.Sequence (sequences[i], annots);
+}
+} else {
+sequences = this.selectionGroup.getSelectionAsNewSequences (this.alignment);
+}return sequences;
+});
+Clazz_overrideMethod (c$, "getSequenceSelection", 
+function () {
+var sequences = null;
+if (this.selectionGroup != null) {
+sequences = this.selectionGroup.getSequencesInOrder (this.alignment);
+}if (sequences == null) {
+sequences = this.alignment.getSequencesArray ();
+}return sequences;
+});
+Clazz_overrideMethod (c$, "getViewAsCigars", 
+function (selectedRegionOnly) {
+return  new jalview.datamodel.CigarArray (this.alignment, this.colSel, (selectedRegionOnly ? this.selectionGroup : null));
+}, "~B");
+Clazz_defineMethod (c$, "getAlignmentView", 
+function (selectedOnly) {
+return this.getAlignmentView (selectedOnly, false);
+}, "~B");
+Clazz_defineMethod (c$, "getAlignmentView", 
+function (selectedOnly, markGroups) {
+return  new jalview.datamodel.AlignmentView (this.alignment, this.colSel, this.selectionGroup, this.colSel != null && this.colSel.hasHiddenColumns (), selectedOnly, markGroups);
+}, "~B,~B");
+Clazz_overrideMethod (c$, "getViewAsString", 
+function (selectedRegionOnly) {
+var selection = null;
+var seqs = null;
+var i;
+var iSize;
+var start = 0;
+var end = 0;
+if (selectedRegionOnly && this.selectionGroup != null) {
+iSize = this.selectionGroup.getSize ();
+seqs = this.selectionGroup.getSequencesInOrder (this.alignment);
+start = this.selectionGroup.getStartRes ();
+end = this.selectionGroup.getEndRes () + 1;
+} else {
+iSize = this.alignment.getHeight ();
+seqs = this.alignment.getSequencesArray ();
+end = this.alignment.getWidth ();
+}selection =  new Array (iSize);
+if (this.colSel != null && this.colSel.hasHiddenColumns ()) {
+selection = this.colSel.getVisibleSequenceStrings (start, end, seqs);
+} else {
+for (i = 0; i < iSize; i++) {
+selection[i] = seqs[i].getSequenceAsString (start, end);
+}
+}return selection;
+}, "~B");
+Clazz_overrideMethod (c$, "getVisibleRegionBoundaries", 
+function (min, max) {
+var regions =  new java.util.ArrayList ();
+var start = min;
+var end = max;
+do {
+if (this.colSel != null && this.colSel.hasHiddenColumns ()) {
+if (start == 0) {
+start = this.colSel.adjustForHiddenColumns (start);
+}end = this.colSel.getHiddenBoundaryRight (start);
+if (start == end) {
+end = max;
+}if (end > max) {
+end = max;
+}}regions.add ( Clazz_newIntArray (-1, [start, end]));
+if (this.colSel != null && this.colSel.hasHiddenColumns ()) {
+start = this.colSel.adjustForHiddenColumns (end);
+start = this.colSel.getHiddenBoundaryLeft (start) + 1;
+}} while (end < max);
+var startEnd =  Clazz_newIntArray (regions.size (), 2, 0);
+return regions;
+}, "~N,~N");
+Clazz_overrideMethod (c$, "getVisibleAlignmentAnnotation", 
+function (selectedOnly) {
+var ala =  new java.util.ArrayList ();
+var aa;
+if ((aa = this.alignment.getAlignmentAnnotation ()) != null) {
+for (var annot, $annot = 0, $$annot = aa; $annot < $$annot.length && ((annot = $$annot[$annot]) || true); $annot++) {
+var clone =  new jalview.datamodel.AlignmentAnnotation (annot);
+if (selectedOnly && this.selectionGroup != null) {
+this.colSel.makeVisibleAnnotation (this.selectionGroup.getStartRes (), this.selectionGroup.getEndRes (), clone);
+} else {
+this.colSel.makeVisibleAnnotation (clone);
+}ala.add (clone);
+}
+}return ala;
+}, "~B");
+Clazz_overrideMethod (c$, "isPadGaps", 
+function () {
+return this.padGaps;
+});
+Clazz_overrideMethod (c$, "setPadGaps", 
+function (padGaps) {
+this.padGaps = padGaps;
+}, "~B");
+Clazz_overrideMethod (c$, "alignmentChanged", 
+function (ap) {
+if (this.isPadGaps ()) {
+this.alignment.padGaps ();
+}if (this.autoCalculateConsensus) {
+this.updateConsensus (ap);
+}if (this.hconsensus != null && this.autoCalculateConsensus) {
+this.updateConservation (ap);
+}if (this.autoCalculateStrucConsensus) {
+this.updateStrucConsensus (ap);
+}var alWidth = this.alignment.getWidth ();
+var groups = this.alignment.getGroups ();
+if (groups != null) {
+for (var sg, $sg = groups.iterator (); $sg.hasNext () && ((sg = $sg.next ()) || true);) {
+if (sg.getEndRes () > alWidth) {
+sg.setEndRes (alWidth - 1);
+}}
+}if (this.selectionGroup != null && this.selectionGroup.getEndRes () > alWidth) {
+this.selectionGroup.setEndRes (alWidth - 1);
+}this.resetAllColourSchemes ();
+this.calculator.restartWorkers ();
+}, "jalview.api.AlignmentViewPanel");
+Clazz_defineMethod (c$, "resetAllColourSchemes", 
+function () {
+var cs = this.globalColourScheme;
+if (cs != null) {
+cs.alignmentChanged (this.alignment, this.hiddenRepSequences);
+cs.setConsensus (this.hconsensus);
+if (cs.conservationApplied ()) {
+cs.setConservation (jalview.analysis.Conservation.calculateConservation ("All", jalview.schemes.ResidueProperties.propHash, 3, this.alignment.getSequences (), 0, this.alignment.getWidth (), false, this.getConsPercGaps (), false));
+}}for (var sg, $sg = this.alignment.getGroups ().iterator (); $sg.hasNext () && ((sg = $sg.next ()) || true);) {
+if (sg.cs != null) {
+sg.cs.alignmentChanged (sg, this.hiddenRepSequences);
+}sg.recalcConservation ();
+}
+});
+Clazz_defineMethod (c$, "initAutoAnnotation", 
+function () {
+if (this.hconsensus == null && !this.$isDataset) {
+if (!this.alignment.isNucleotide ()) {
+this.initConservation ();
+this.initQuality ();
+} else {
+this.initRNAStructure ();
+}this.consensus =  new jalview.datamodel.AlignmentAnnotation ("Consensus", "PID",  new Array (1), 0, 100, 1);
+this.initConsensus (this.consensus);
+this.initComplementConsensus ();
+}});
+Clazz_defineMethod (c$, "initComplementConsensus", 
+function () {
+if (!this.alignment.isNucleotide ()) {
+var codonMappings = this.alignment.getCodonFrames ();
+if (codonMappings != null && !codonMappings.isEmpty ()) {
+this.complementConsensus =  new jalview.datamodel.AlignmentAnnotation ("cDNA Consensus", "PID for cDNA",  new Array (1), 0, 100, 1);
+this.initConsensus (this.complementConsensus);
+}}});
+Clazz_defineMethod (c$, "initConsensus", 
+ function (aa) {
+aa.hasText = true;
+aa.autoCalculated = true;
+if (this.showConsensus) {
+this.alignment.addAnnotation (aa);
+}}, "jalview.datamodel.AlignmentAnnotation");
+Clazz_defineMethod (c$, "initConservation", 
+ function () {
+if (this.showConservation) {
+if (this.conservation == null) {
+this.conservation =  new jalview.datamodel.AlignmentAnnotation ("Conservation", "Conservation of total alignment less than " + this.getConsPercGaps () + "% gaps",  new Array (1), 0, 11, 1);
+this.conservation.hasText = true;
+this.conservation.autoCalculated = true;
+this.alignment.addAnnotation (this.conservation);
+}}});
+Clazz_defineMethod (c$, "initQuality", 
+ function () {
+if (this.showQuality) {
+if (this.quality == null) {
+this.quality =  new jalview.datamodel.AlignmentAnnotation ("Quality", "Alignment Quality based on Blosum62 scores",  new Array (1), 0, 11, 1);
+this.quality.hasText = true;
+this.quality.autoCalculated = true;
+this.alignment.addAnnotation (this.quality);
+}}});
+Clazz_defineMethod (c$, "initRNAStructure", 
+ function () {
+if (this.alignment.hasRNAStructure () && this.strucConsensus == null) {
+this.strucConsensus =  new jalview.datamodel.AlignmentAnnotation ("StrucConsensus", "PID",  new Array (1), 0, 100, 1);
+this.strucConsensus.hasText = true;
+this.strucConsensus.autoCalculated = true;
+if (this.showConsensus) {
+this.alignment.addAnnotation (this.strucConsensus);
+}}});
+Clazz_overrideMethod (c$, "calcPanelHeight", 
+function () {
+var anns = this.getAlignment ().getAlignmentAnnotation ();
+var height = 0;
+var charHeight = this.getCharHeight ();
+if (anns != null) {
+var graphgrp =  new java.util.BitSet ();
+for (var aa, $aa = 0, $$aa = anns; $aa < $$aa.length && ((aa = $$aa[$aa]) || true); $aa++) {
+if (aa == null) {
+System.err.println ("Null annotation row: ignoring.");
+continue;
+}if (!aa.visible) {
+continue;
+}if (aa.graphGroup > -1) {
+if (graphgrp.get (aa.graphGroup)) {
+continue;
+} else {
+graphgrp.set (aa.graphGroup);
+}}aa.height = 0;
+if (aa.hasText) {
+aa.height += charHeight;
+}if (aa.hasIcons) {
+aa.height += 16;
+}if (aa.graph > 0) {
+aa.height += aa.graphHeight;
+}if (aa.height == 0) {
+aa.height = 20;
+}height += aa.height;
+}
+}if (height == 0) {
+height = 20;
+}return height;
+});
+Clazz_overrideMethod (c$, "updateGroupAnnotationSettings", 
+function (applyGlobalSettings, preserveNewGroupSettings) {
+var updateCalcs = false;
+var conv = this.isShowGroupConservation ();
+var cons = this.isShowGroupConsensus ();
+var showprf = this.isShowSequenceLogo ();
+var showConsHist = this.isShowConsensusHistogram ();
+var normLogo = this.isNormaliseSequenceLogo ();
+var sortg = true;
+var aan = this.alignment.getAlignmentAnnotation ();
+var oldrfs =  new java.util.ArrayList ();
+if (aan != null) {
+for (var an = 0; an < aan.length; an++) {
+if (aan[an].autoCalculated && aan[an].groupRef != null) {
+oldrfs.add (aan[an].groupRef);
+this.alignment.deleteAnnotation (aan[an], false);
+}}
+}if (this.alignment.getGroups () != null) {
+for (var sg, $sg = this.alignment.getGroups ().iterator (); $sg.hasNext () && ((sg = $sg.next ()) || true);) {
+updateCalcs = false;
+if (applyGlobalSettings || (!preserveNewGroupSettings && !oldrfs.contains (sg))) {
+sg.setshowSequenceLogo (showprf);
+sg.setShowConsensusHistogram (showConsHist);
+sg.setNormaliseSequenceLogo (normLogo);
+}if (conv) {
+updateCalcs = true;
+this.alignment.addAnnotation (sg.getConservationRow (), 0);
+}if (cons) {
+updateCalcs = true;
+this.alignment.addAnnotation (sg.getConsensus (), 0);
+}if (updateCalcs) {
+sg.recalcConservation ();
+}}
+}oldrfs.clear ();
+}, "~B,~B");
+Clazz_defineMethod (c$, "isDisplayReferenceSeq", 
+function () {
+return this.alignment.hasSeqrep () && this.viewStyle.isDisplayReferenceSeq ();
+});
+Clazz_defineMethod (c$, "setDisplayReferenceSeq", 
+function (displayReferenceSeq) {
+this.viewStyle.setDisplayReferenceSeq (displayReferenceSeq);
+}, "~B");
+Clazz_defineMethod (c$, "isColourByReferenceSeq", 
+function () {
+return this.alignment.hasSeqrep () && this.viewStyle.isColourByReferenceSeq ();
+});
+Clazz_overrideMethod (c$, "getSequenceColour", 
+function (seq) {
+var sqc = this.sequenceColours.get (seq);
+return (sqc == null ? java.awt.Color.white : sqc);
+}, "jalview.datamodel.SequenceI");
+Clazz_overrideMethod (c$, "setSequenceColour", 
+function (seq, col) {
+if (col == null) {
+this.sequenceColours.remove (seq);
+} else {
+this.sequenceColours.put (seq, col);
+}}, "jalview.datamodel.SequenceI,java.awt.Color");
+Clazz_overrideMethod (c$, "updateSequenceIdColours", 
+function () {
+for (var sg, $sg = this.alignment.getGroups ().iterator (); $sg.hasNext () && ((sg = $sg.next ()) || true);) {
+if (sg.idColour != null) {
+for (var s, $s = sg.getSequences (this.getHiddenRepSequences ()).iterator (); $s.hasNext () && ((s = $s.next ()) || true);) {
+this.sequenceColours.put (s, sg.idColour);
+}
+}}
+});
+Clazz_overrideMethod (c$, "clearSequenceColours", 
+function () {
+this.sequenceColours.clear ();
+});
+Clazz_defineMethod (c$, "getCodingComplement", 
+function () {
+return this.codingComplement;
+});
+Clazz_defineMethod (c$, "setCodingComplement", 
+function (av) {
+if (this === av) {
+System.err.println ("Ignoring recursive setCodingComplement request");
+} else {
+this.codingComplement = av;
+if (av.getCodingComplement () !== this) {
+av.setCodingComplement (this);
+}}}, "jalview.api.AlignViewportI");
+Clazz_overrideMethod (c$, "isNucleotide", 
+function () {
+return this.getAlignment () == null ? false : this.getAlignment ().isNucleotide ();
+});
+Clazz_overrideMethod (c$, "getFeaturesDisplayed", 
+function () {
+return this.featuresDisplayed;
+});
+Clazz_overrideMethod (c$, "setFeaturesDisplayed", 
+function (featuresDisplayedI) {
+this.featuresDisplayed = featuresDisplayedI;
+}, "jalview.api.FeaturesDisplayedI");
+Clazz_overrideMethod (c$, "areFeaturesDisplayed", 
+function () {
+return this.featuresDisplayed != null && this.featuresDisplayed.getRegisterdFeaturesCount () > 0;
+});
+Clazz_defineMethod (c$, "setShowSequenceFeatures", 
+function (b) {
+this.viewStyle.setShowSequenceFeatures (b);
+}, "~B");
+Clazz_defineMethod (c$, "isShowSequenceFeatures", 
+function () {
+return this.viewStyle.isShowSequenceFeatures ();
+});
+Clazz_defineMethod (c$, "setShowSequenceFeaturesHeight", 
+function (selected) {
+this.viewStyle.setShowSequenceFeaturesHeight (selected);
+}, "~B");
+Clazz_defineMethod (c$, "isShowSequenceFeaturesHeight", 
+function () {
+return this.viewStyle.isShowSequenceFeaturesHeight ();
+});
+Clazz_defineMethod (c$, "setShowAnnotation", 
+function (b) {
+this.viewStyle.setShowAnnotation (b);
+}, "~B");
+Clazz_defineMethod (c$, "isShowAnnotation", 
+function () {
+return this.viewStyle.isShowAnnotation ();
+});
+Clazz_defineMethod (c$, "isRightAlignIds", 
+function () {
+return this.viewStyle.isRightAlignIds ();
+});
+Clazz_defineMethod (c$, "setRightAlignIds", 
+function (rightAlignIds) {
+this.viewStyle.setRightAlignIds (rightAlignIds);
+}, "~B");
+Clazz_defineMethod (c$, "getConservationSelected", 
+function () {
+return this.viewStyle.getConservationSelected ();
+});
+Clazz_defineMethod (c$, "setShowBoxes", 
+function (state) {
+this.viewStyle.setShowBoxes (state);
+}, "~B");
+Clazz_defineMethod (c$, "getTextColour", 
+function () {
+return this.viewStyle.getTextColour ();
+});
+Clazz_defineMethod (c$, "getTextColour2", 
+function () {
+return this.viewStyle.getTextColour2 ();
+});
+Clazz_defineMethod (c$, "getThresholdTextColour", 
+function () {
+return this.viewStyle.getThresholdTextColour ();
+});
+Clazz_defineMethod (c$, "isConservationColourSelected", 
+function () {
+return this.viewStyle.isConservationColourSelected ();
+});
+Clazz_defineMethod (c$, "isRenderGaps", 
+function () {
+return this.viewStyle.isRenderGaps ();
+});
+Clazz_defineMethod (c$, "isShowColourText", 
+function () {
+return this.viewStyle.isShowColourText ();
+});
+Clazz_defineMethod (c$, "setConservationColourSelected", 
+function (conservationColourSelected) {
+this.viewStyle.setConservationColourSelected (conservationColourSelected);
+}, "~B");
+Clazz_defineMethod (c$, "setShowColourText", 
+function (showColourText) {
+this.viewStyle.setShowColourText (showColourText);
+}, "~B");
+Clazz_defineMethod (c$, "setTextColour", 
+function (textColour) {
+this.viewStyle.setTextColour (textColour);
+}, "java.awt.Color");
+Clazz_defineMethod (c$, "setThresholdTextColour", 
+function (thresholdTextColour) {
+this.viewStyle.setThresholdTextColour (thresholdTextColour);
+}, "~N");
+Clazz_defineMethod (c$, "setTextColour2", 
+function (textColour2) {
+this.viewStyle.setTextColour2 (textColour2);
+}, "java.awt.Color");
+Clazz_overrideMethod (c$, "getViewStyle", 
+function () {
+return  new jalview.viewmodel.styles.ViewStyle (this.viewStyle);
+});
+Clazz_overrideMethod (c$, "setViewStyle", 
+function (settingsForView) {
+this.viewStyle =  new jalview.viewmodel.styles.ViewStyle (settingsForView);
+}, "jalview.api.ViewStyleI");
+Clazz_defineMethod (c$, "sameStyle", 
+function (them) {
+return this.viewStyle.sameStyle (them);
+}, "jalview.api.ViewStyleI");
+Clazz_defineMethod (c$, "getIdWidth", 
+function () {
+return this.viewStyle.getIdWidth ();
+});
+Clazz_defineMethod (c$, "setIdWidth", 
+function (i) {
+this.viewStyle.setIdWidth (i);
+}, "~N");
+Clazz_defineMethod (c$, "isCentreColumnLabels", 
+function () {
+return this.viewStyle.isCentreColumnLabels ();
+});
+Clazz_defineMethod (c$, "setCentreColumnLabels", 
+function (centreColumnLabels) {
+this.viewStyle.setCentreColumnLabels (centreColumnLabels);
+}, "~B");
+Clazz_defineMethod (c$, "setShowDBRefs", 
+function (showdbrefs) {
+this.viewStyle.setShowDBRefs (showdbrefs);
+}, "~B");
+Clazz_defineMethod (c$, "isShowDBRefs", 
+function () {
+return this.viewStyle.isShowDBRefs ();
+});
+Clazz_defineMethod (c$, "isShowNPFeats", 
+function () {
+return this.viewStyle.isShowNPFeats ();
+});
+Clazz_defineMethod (c$, "setShowNPFeats", 
+function (shownpfeats) {
+this.viewStyle.setShowNPFeats (shownpfeats);
+}, "~B");
+Clazz_defineMethod (c$, "addToHistoryList", 
+function (command) {
+if (this.historyList != null) {
+this.historyList.push (command);
+this.broadcastCommand (command, false);
+}}, "jalview.commands.CommandI");
+Clazz_defineMethod (c$, "broadcastCommand", 
+function (command, undo) {
+this.getStructureSelectionManager ().commandPerformed (command, undo, this.getVamsasSource ());
+}, "jalview.commands.CommandI,~B");
+Clazz_defineMethod (c$, "addToRedoList", 
+function (command) {
+if (this.redoList != null) {
+this.redoList.push (command);
+}this.broadcastCommand (command, true);
+}, "jalview.commands.CommandI");
+Clazz_defineMethod (c$, "clearRedoList", 
+function () {
+if (this.redoList != null) {
+this.redoList.clear ();
+}});
+Clazz_defineMethod (c$, "setHistoryList", 
+function (list) {
+this.historyList = list;
+}, "java.util.Deque");
+Clazz_defineMethod (c$, "getHistoryList", 
+function () {
+return this.historyList;
+});
+Clazz_defineMethod (c$, "setRedoList", 
+function (list) {
+this.redoList = list;
+}, "java.util.Deque");
+Clazz_defineMethod (c$, "getRedoList", 
+function () {
+return this.redoList;
+});
+Clazz_overrideMethod (c$, "getVamsasSource", 
+function () {
+return this;
+});
+Clazz_defineMethod (c$, "getSortAnnotationsBy", 
+function () {
+return this.sortAnnotationsBy;
+});
+Clazz_defineMethod (c$, "setSortAnnotationsBy", 
+function (sortAnnotationsBy) {
+this.sortAnnotationsBy = sortAnnotationsBy;
+}, "jalview.analysis.AnnotationSorter.SequenceAnnotationOrder");
+Clazz_defineMethod (c$, "isShowAutocalculatedAbove", 
+function () {
+return this.showAutocalculatedAbove;
+});
+Clazz_defineMethod (c$, "setShowAutocalculatedAbove", 
+function (showAutocalculatedAbove) {
+this.showAutocalculatedAbove = showAutocalculatedAbove;
+}, "~B");
+Clazz_defineMethod (c$, "isScaleProteinAsCdna", 
+function () {
+return this.viewStyle.isScaleProteinAsCdna ();
+});
+Clazz_defineMethod (c$, "setScaleProteinAsCdna", 
+function (b) {
+this.viewStyle.setScaleProteinAsCdna (b);
+}, "~B");
+Clazz_defineMethod (c$, "isFollowHighlight", 
+function () {
+return this.followHighlight;
+});
+Clazz_overrideMethod (c$, "setFollowHighlight", 
+function (b) {
+this.followHighlight = b;
+}, "~B");
+Clazz_defineMethod (c$, "getStartRes", 
+function () {
+return this.startRes;
+});
+Clazz_overrideMethod (c$, "getEndRes", 
+function () {
+return this.endRes;
+});
+Clazz_defineMethod (c$, "getStartSeq", 
+function () {
+return this.startSeq;
+});
+Clazz_defineMethod (c$, "setStartRes", 
+function (res) {
+this.startRes = res;
+}, "~N");
+Clazz_defineMethod (c$, "setStartSeq", 
+function (seq) {
+this.startSeq = seq;
+}, "~N");
+Clazz_defineMethod (c$, "setEndRes", 
+function (res) {
+if (res > this.alignment.getWidth () - 1) {
+res = this.alignment.getWidth () - 1;
+}if (res < 0) {
+res = 0;
+}this.endRes = res;
+}, "~N");
+Clazz_defineMethod (c$, "setEndSeq", 
+function (seq) {
+if (seq > this.alignment.getHeight ()) {
+seq = this.alignment.getHeight ();
+}if (seq < 0) {
+seq = 0;
+}this.endSeq = seq;
+}, "~N");
+Clazz_defineMethod (c$, "getEndSeq", 
+function () {
+return this.endSeq;
+});
+Clazz_defineMethod (c$, "findComplementScrollTarget", 
+function (sr) {
+var complement = this.getCodingComplement ();
+if (complement == null || !complement.isFollowHighlight ()) {
+return 0;
+}var iAmProtein = !this.getAlignment ().isNucleotide ();
+var proteinAlignment = iAmProtein ? this.getAlignment () : complement.getAlignment ();
+if (proteinAlignment == null) {
+return 0;
+}var mappings = proteinAlignment.getCodonFrames ();
+var seqOffset = 0;
+var sequence = null;
+var middleColumn = this.getStartRes () + Clazz_doubleToInt ((this.getEndRes () - this.getStartRes ()) / 2);
+var hiddenSequences = this.getAlignment ().getHiddenSequences ();
+for (var seqNo = this.getStartSeq (); seqNo < this.getEndSeq (); seqNo++, seqOffset++) {
+sequence = this.getAlignment ().getSequenceAt (seqNo);
+if (hiddenSequences != null && hiddenSequences.isHidden (sequence)) {
+continue;
+}if (jalview.util.Comparison.isGap (sequence.getCharAt (middleColumn))) {
+continue;
+}var seqMappings = jalview.util.MappingUtils.findMappingsForSequence (sequence, mappings);
+if (!seqMappings.isEmpty ()) {
+break;
+}}
+if (sequence == null) {
+return 0;
+}jalview.util.MappingUtils.addSearchResults (sr, sequence, sequence.findPosition (middleColumn), mappings);
+return seqOffset;
+}, "jalview.datamodel.SearchResults");
+});
+Clazz_declarePackage ("jalview.api");
+Clazz_load (["jalview.api.ViewStyleI"], "jalview.api.AlignViewportI", null, function () {
+Clazz_declareInterface (jalview.api, "AlignViewportI", jalview.api.ViewStyleI);
+});
+Clazz_declarePackage ("jalview.api");
+Clazz_declareInterface (jalview.api, "ViewStyleI");
+Clazz_declarePackage ("jalview.viewmodel.styles");
+Clazz_load (["jalview.api.ViewStyleI", "java.awt.Color"], "jalview.viewmodel.styles.ViewStyle", ["java.lang.Boolean"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.abovePIDThreshold = false;
+this.charHeight = 0;
+this.charWidth = 0;
+this.idWidth = -1;
+this.colourAppliesToAllGroups = false;
+this.centreColumnLabels = false;
+this.showdbrefs = false;
+this.shownpfeats = false;
+this.colourByReferenceSeq = false;
+this.conservationColourSelected = false;
+this.displayReferenceSeq = false;
+this.increment = 0;
+this.renderGaps = true;
+this.rightAlignIds = false;
+this.scaleAboveWrapped = false;
+this.scaleLeftWrapped = true;
+this.scaleRightWrapped = true;
+this.seqNameItalics = false;
+this.showAnnotation = true;
+this.showBoxes = true;
+this.showColourText = false;
+this.showHiddenMarkers = true;
+this.showJVSuffix = true;
+this.showSeqFeaturesHeight = false;
+this.showSequenceFeatures = false;
+this.showText = true;
+this.showUnconserved = false;
+this.textColour = null;
+this.textColour2 = null;
+this.threshold = 0;
+this.thresholdTextColour = 0;
+this.upperCasebold = false;
+this.fontName = null;
+this.fontSize = 0;
+this.scaleProteinAsCdna = true;
+this.wrapAlignment = false;
+this.wrappedWidth = 0;
+this.fontStyle = 0;
+Clazz_instantialize (this, arguments);
+}, jalview.viewmodel.styles, "ViewStyle", null, jalview.api.ViewStyleI);
+Clazz_prepareFields (c$, function () {
+this.textColour = java.awt.Color.black;
+this.textColour2 = java.awt.Color.white;
+});
+Clazz_makeConstructor (c$, 
+function (vs) {
+this.setAbovePIDThreshold (vs.getAbovePIDThreshold ());
+this.setCentreColumnLabels (vs.isCentreColumnLabels ());
+this.setCharHeight (vs.getCharHeight ());
+this.setCharWidth (vs.getCharWidth ());
+this.setColourAppliesToAllGroups (vs.getColourAppliesToAllGroups ());
+this.setColourByReferenceSeq (vs.isColourByReferenceSeq ());
+this.setColourText (vs.getColourText ());
+this.setConservationColourSelected (vs.isConservationColourSelected ());
+this.setConservationSelected (vs.getConservationSelected ());
+this.setDisplayReferenceSeq (vs.isDisplayReferenceSeq ());
+this.setFontName (vs.getFontName ());
+this.setFontSize (vs.getFontSize ());
+this.setFontStyle (vs.getFontStyle ());
+this.setIdWidth (vs.getIdWidth ());
+this.setIncrement (vs.getIncrement ());
+this.setRenderGaps (vs.isRenderGaps ());
+this.setRightAlignIds (vs.isRightAlignIds ());
+this.setScaleAboveWrapped (vs.getScaleAboveWrapped ());
+this.setScaleLeftWrapped (vs.getScaleLeftWrapped ());
+this.setScaleProteinAsCdna (vs.isScaleProteinAsCdna ());
+this.setScaleRightWrapped (vs.getScaleRightWrapped ());
+this.setSeqNameItalics (vs.isSeqNameItalics ());
+this.setShowAnnotation (vs.isShowAnnotation ());
+this.setShowBoxes (vs.getShowBoxes ());
+this.setShowColourText (vs.isShowColourText ());
+this.setShowDBRefs (vs.isShowDBRefs ());
+this.setShowHiddenMarkers (vs.getShowHiddenMarkers ());
+this.setShowJVSuffix (vs.getShowJVSuffix ());
+this.setShowNPFeats (vs.isShowNPFeats ());
+this.setShowSequenceFeaturesHeight (vs.isShowSequenceFeaturesHeight ());
+this.setShowSequenceFeatures (vs.isShowSequenceFeatures ());
+this.setShowText (vs.getShowText ());
+this.setShowUnconserved (vs.getShowUnconserved ());
+this.setTextColour (vs.getTextColour ());
+this.setTextColour2 (vs.getTextColour2 ());
+this.setThreshold (vs.getThreshold ());
+this.setThresholdTextColour (vs.getThresholdTextColour ());
+this.setUpperCasebold (vs.isUpperCasebold ());
+this.setWrapAlignment (vs.getWrapAlignment ());
+this.setWrappedWidth (vs.getWrappedWidth ());
+}, "jalview.api.ViewStyleI");
+Clazz_makeConstructor (c$, 
+function () {
+});
+Clazz_overrideMethod (c$, "equals", 
+function (other) {
+if (other == null || !(Clazz_instanceOf (other, jalview.viewmodel.styles.ViewStyle))) {
+return false;
+}var vs = other;
+var match = (this.getAbovePIDThreshold () == vs.getAbovePIDThreshold () && this.isCentreColumnLabels () == vs.isCentreColumnLabels () && this.getCharHeight () == vs.getCharHeight () && this.getCharWidth () == vs.getCharWidth () && this.getColourAppliesToAllGroups () == vs.getColourAppliesToAllGroups () && this.isColourByReferenceSeq () == vs.isColourByReferenceSeq () && this.getColourText () == vs.getColourText () && this.isConservationColourSelected () == vs.isConservationColourSelected () && this.getConservationSelected () == vs.getConservationSelected () && this.isDisplayReferenceSeq () == vs.isDisplayReferenceSeq () && this.getFontSize () == vs.getFontSize () && this.getFontStyle () == vs.getFontStyle () && this.getIdWidth () == vs.getIdWidth () && this.getIncrement () == vs.getIncrement () && this.isRenderGaps () == vs.isRenderGaps () && this.isRightAlignIds () == vs.isRightAlignIds () && this.getScaleAboveWrapped () == vs.getScaleAboveWrapped () && this.getScaleLeftWrapped () == vs.getScaleLeftWrapped () && this.isScaleProteinAsCdna () == vs.isScaleProteinAsCdna () && this.getScaleRightWrapped () == vs.getScaleRightWrapped () && this.isSeqNameItalics () == vs.isSeqNameItalics () && this.isShowAnnotation () == vs.isShowAnnotation () && this.getShowBoxes () == vs.getShowBoxes () && this.isShowColourText () == vs.isShowColourText () && this.isShowDBRefs () == vs.isShowDBRefs () && this.getShowHiddenMarkers () == vs.getShowHiddenMarkers () && this.getShowJVSuffix () == vs.getShowJVSuffix () && this.isShowNPFeats () == vs.isShowNPFeats () && this.isShowSequenceFeaturesHeight () == vs.isShowSequenceFeaturesHeight () && this.isShowSequenceFeatures () == vs.isShowSequenceFeatures () && this.getShowText () == vs.getShowText () && this.getShowUnconserved () == vs.getShowUnconserved () && this.getThreshold () == vs.getThreshold () && this.getThresholdTextColour () == vs.getThresholdTextColour () && this.isUpperCasebold () == vs.isUpperCasebold () && this.getWrapAlignment () == vs.getWrapAlignment () && this.getWrappedWidth () == vs.getWrappedWidth ());
+match = match && String.valueOf (this.getFontName ()).equals (String.valueOf (vs.getFontName ()));
+match = match && String.valueOf (this.getTextColour ()).equals (String.valueOf (vs.getTextColour ()));
+match = match && String.valueOf (this.getTextColour2 ()).equals (String.valueOf (vs.getTextColour2 ()));
+return match;
+}, "~O");
+Clazz_overrideMethod (c$, "hashCode", 
+function () {
+var hash = 0;
+var m = 1;
+hash += m++ * Boolean.$valueOf (this.abovePIDThreshold).hashCode ();
+hash += m++ * Boolean.$valueOf (this.centreColumnLabels).hashCode ();
+hash += m++ * Boolean.$valueOf (this.colourAppliesToAllGroups).hashCode ();
+hash += m++ * Boolean.$valueOf (this.displayReferenceSeq).hashCode ();
+hash += m++ * Boolean.$valueOf (this.renderGaps).hashCode ();
+hash += m++ * Boolean.$valueOf (this.rightAlignIds).hashCode ();
+hash += m++ * Boolean.$valueOf (this.scaleProteinAsCdna).hashCode ();
+hash += m++ * Boolean.$valueOf (this.scaleRightWrapped).hashCode ();
+hash += m++ * Boolean.$valueOf (this.seqNameItalics).hashCode ();
+hash += m++ * Boolean.$valueOf (this.showAnnotation).hashCode ();
+hash += m++ * Boolean.$valueOf (this.showBoxes).hashCode ();
+hash += m++ * Boolean.$valueOf (this.showdbrefs).hashCode ();
+hash += m++ * Boolean.$valueOf (this.showJVSuffix).hashCode ();
+hash += m++ * Boolean.$valueOf (this.showSequenceFeatures).hashCode ();
+hash += m++ * Boolean.$valueOf (this.showUnconserved).hashCode ();
+hash += m++ * Boolean.$valueOf (this.wrapAlignment).hashCode ();
+hash += m++ * this.charHeight;
+hash += m++ * this.charWidth;
+hash += m++ * this.fontSize;
+hash += m++ * this.fontStyle;
+hash += m++ * this.idWidth;
+hash += String.valueOf (this.fontName).hashCode ();
+return hash;
+});
+Clazz_defineMethod (c$, "isUpperCasebold", 
+function () {
+return this.upperCasebold;
+});
+Clazz_overrideMethod (c$, "setUpperCasebold", 
+function (upperCasebold) {
+this.upperCasebold = upperCasebold;
+}, "~B");
+Clazz_defineMethod (c$, "getAbovePIDThreshold", 
+function () {
+return this.abovePIDThreshold;
+});
+Clazz_defineMethod (c$, "getCharHeight", 
+function () {
+return this.charHeight;
+});
+Clazz_defineMethod (c$, "getCharWidth", 
+function () {
+return this.charWidth;
+});
+Clazz_defineMethod (c$, "getColourAppliesToAllGroups", 
+function () {
+return this.colourAppliesToAllGroups;
+});
+Clazz_defineMethod (c$, "getColourText", 
+function () {
+return this.showColourText;
+});
+Clazz_defineMethod (c$, "getConservationSelected", 
+function () {
+return this.conservationColourSelected;
+});
+Clazz_defineMethod (c$, "getIncrement", 
+function () {
+return this.increment;
+});
+Clazz_defineMethod (c$, "getScaleAboveWrapped", 
+function () {
+return this.scaleAboveWrapped;
+});
+Clazz_defineMethod (c$, "getScaleLeftWrapped", 
+function () {
+return this.scaleLeftWrapped;
+});
+Clazz_defineMethod (c$, "getScaleRightWrapped", 
+function () {
+return this.scaleRightWrapped;
+});
+Clazz_defineMethod (c$, "getShowBoxes", 
+function () {
+return this.showBoxes;
+});
+Clazz_defineMethod (c$, "getShowHiddenMarkers", 
+function () {
+return this.showHiddenMarkers;
+});
+Clazz_defineMethod (c$, "getShowJVSuffix", 
+function () {
+return this.showJVSuffix;
+});
+Clazz_defineMethod (c$, "getShowText", 
+function () {
+return this.showText;
+});
+Clazz_defineMethod (c$, "getShowUnconserved", 
+function () {
+return this.showUnconserved;
+});
+Clazz_defineMethod (c$, "getTextColour", 
+function () {
+return this.textColour;
+});
+Clazz_defineMethod (c$, "getTextColour2", 
+function () {
+return this.textColour2;
+});
+Clazz_defineMethod (c$, "getThreshold", 
+function () {
+return this.threshold;
+});
+Clazz_defineMethod (c$, "getThresholdTextColour", 
+function () {
+return this.thresholdTextColour;
+});
+Clazz_defineMethod (c$, "getWrapAlignment", 
+function () {
+return this.wrapAlignment;
+});
+Clazz_defineMethod (c$, "getWrappedWidth", 
+function () {
+return this.wrappedWidth;
+});
+Clazz_defineMethod (c$, "isColourByReferenceSeq", 
+function () {
+return this.colourByReferenceSeq;
+});
+Clazz_defineMethod (c$, "isConservationColourSelected", 
+function () {
+return this.conservationColourSelected;
+});
+Clazz_defineMethod (c$, "isDisplayReferenceSeq", 
+function () {
+return this.displayReferenceSeq;
+});
+Clazz_defineMethod (c$, "isRenderGaps", 
+function () {
+return this.renderGaps;
+});
+Clazz_defineMethod (c$, "isRightAlignIds", 
+function () {
+return this.rightAlignIds;
+});
+Clazz_defineMethod (c$, "isSeqNameItalics", 
+function () {
+return this.seqNameItalics;
+});
+Clazz_defineMethod (c$, "isShowAnnotation", 
+function () {
+return this.showAnnotation;
+});
+Clazz_defineMethod (c$, "isShowColourText", 
+function () {
+return this.showColourText;
+});
+Clazz_defineMethod (c$, "isShowSequenceFeaturesHeight", 
+function () {
+return this.showSeqFeaturesHeight;
+});
+Clazz_defineMethod (c$, "isShowSequenceFeatures", 
+function () {
+return this.showSequenceFeatures;
+});
+Clazz_overrideMethod (c$, "setAbovePIDThreshold", 
+function (b) {
+this.abovePIDThreshold = b;
+}, "~B");
+Clazz_overrideMethod (c$, "setCharHeight", 
+function (h) {
+this.charHeight = h;
+}, "~N");
+Clazz_overrideMethod (c$, "setCharWidth", 
+function (w) {
+this.charWidth = w;
+}, "~N");
+Clazz_overrideMethod (c$, "setColourAppliesToAllGroups", 
+function (b) {
+this.colourAppliesToAllGroups = b;
+}, "~B");
+Clazz_overrideMethod (c$, "setColourByReferenceSeq", 
+function (colourByReferenceSeq) {
+this.colourByReferenceSeq = colourByReferenceSeq;
+}, "~B");
+Clazz_overrideMethod (c$, "setColourText", 
+function (state) {
+this.showColourText = state;
+}, "~B");
+Clazz_overrideMethod (c$, "setConservationColourSelected", 
+function (conservationColourSelected) {
+this.conservationColourSelected = conservationColourSelected;
+}, "~B");
+Clazz_overrideMethod (c$, "setConservationSelected", 
+function (b) {
+this.conservationColourSelected = b;
+}, "~B");
+Clazz_overrideMethod (c$, "setDisplayReferenceSeq", 
+function (displayReferenceSeq) {
+this.displayReferenceSeq = displayReferenceSeq;
+}, "~B");
+Clazz_overrideMethod (c$, "setIncrement", 
+function (inc) {
+this.increment = inc;
+}, "~N");
+Clazz_overrideMethod (c$, "setRenderGaps", 
+function (state) {
+this.renderGaps = state;
+}, "~B");
+Clazz_overrideMethod (c$, "setRightAlignIds", 
+function (rightAlignIds) {
+this.rightAlignIds = rightAlignIds;
+}, "~B");
+Clazz_overrideMethod (c$, "setScaleAboveWrapped", 
+function (b) {
+this.scaleAboveWrapped = b;
+}, "~B");
+Clazz_overrideMethod (c$, "setScaleLeftWrapped", 
+function (b) {
+this.scaleLeftWrapped = b;
+}, "~B");
+Clazz_overrideMethod (c$, "setScaleRightWrapped", 
+function (b) {
+this.scaleRightWrapped = b;
+}, "~B");
+Clazz_overrideMethod (c$, "setSeqNameItalics", 
+function (italics) {
+this.seqNameItalics = italics;
+}, "~B");
+Clazz_overrideMethod (c$, "setShowAnnotation", 
+function (b) {
+this.showAnnotation = b;
+}, "~B");
+Clazz_overrideMethod (c$, "setShowBoxes", 
+function (state) {
+this.showBoxes = state;
+}, "~B");
+Clazz_overrideMethod (c$, "setShowColourText", 
+function (showColourText) {
+this.showColourText = showColourText;
+}, "~B");
+Clazz_overrideMethod (c$, "setShowHiddenMarkers", 
+function (show) {
+this.showHiddenMarkers = show;
+}, "~B");
+Clazz_overrideMethod (c$, "setShowJVSuffix", 
+function (b) {
+this.showJVSuffix = b;
+}, "~B");
+Clazz_overrideMethod (c$, "setShowSequenceFeaturesHeight", 
+function (selected) {
+this.showSeqFeaturesHeight = selected;
+}, "~B");
+Clazz_overrideMethod (c$, "setShowSequenceFeatures", 
+function (b) {
+this.showSequenceFeatures = b;
+}, "~B");
+Clazz_overrideMethod (c$, "setShowText", 
+function (state) {
+this.showText = state;
+}, "~B");
+Clazz_overrideMethod (c$, "setShowUnconserved", 
+function (showunconserved) {
+this.showUnconserved = showunconserved;
+}, "~B");
+Clazz_overrideMethod (c$, "setTextColour", 
+function (textColour) {
+this.textColour = textColour;
+}, "java.awt.Color");
+Clazz_overrideMethod (c$, "setTextColour2", 
+function (textColour2) {
+this.textColour2 = textColour2;
+}, "java.awt.Color");
+Clazz_overrideMethod (c$, "setThreshold", 
+function (thresh) {
+this.threshold = thresh;
+}, "~N");
+Clazz_overrideMethod (c$, "setThresholdTextColour", 
+function (thresholdTextColour) {
+this.thresholdTextColour = thresholdTextColour;
+}, "~N");
+Clazz_overrideMethod (c$, "setWrapAlignment", 
+function (state) {
+this.wrapAlignment = state;
+}, "~B");
+Clazz_overrideMethod (c$, "setWrappedWidth", 
+function (w) {
+this.wrappedWidth = w;
+}, "~N");
+Clazz_overrideMethod (c$, "sameStyle", 
+function (that) {
+return this.equals (that);
+}, "jalview.api.ViewStyleI");
+Clazz_defineMethod (c$, "getFontName", 
+function () {
+return this.fontName;
+});
+Clazz_defineMethod (c$, "getFontSize", 
+function () {
+return this.fontSize;
+});
+Clazz_defineMethod (c$, "getFontStyle", 
+function () {
+return this.fontStyle;
+});
+Clazz_overrideMethod (c$, "setFontName", 
+function (name) {
+this.fontName = name;
+}, "~S");
+Clazz_overrideMethod (c$, "setFontSize", 
+function (size) {
+this.fontSize = size;
+}, "~N");
+Clazz_overrideMethod (c$, "setFontStyle", 
+function (style) {
+this.fontStyle = style;
+}, "~N");
+Clazz_defineMethod (c$, "getIdWidth", 
+function () {
+return this.idWidth;
+});
+Clazz_overrideMethod (c$, "setIdWidth", 
+function (idWidth) {
+this.idWidth = idWidth;
+}, "~N");
+Clazz_defineMethod (c$, "isCentreColumnLabels", 
+function () {
+return this.centreColumnLabels;
+});
+Clazz_overrideMethod (c$, "setCentreColumnLabels", 
+function (centreColumnLabels) {
+this.centreColumnLabels = centreColumnLabels;
+}, "~B");
+Clazz_defineMethod (c$, "isShowDBRefs", 
+function () {
+return this.showdbrefs;
+});
+Clazz_overrideMethod (c$, "setShowDBRefs", 
+function (showdbrefs) {
+this.showdbrefs = showdbrefs;
+}, "~B");
+Clazz_defineMethod (c$, "isShowNPFeats", 
+function () {
+return this.shownpfeats;
+});
+Clazz_overrideMethod (c$, "setShowNPFeats", 
+function (shownpfeats) {
+this.shownpfeats = shownpfeats;
+}, "~B");
+Clazz_defineMethod (c$, "isScaleProteinAsCdna", 
+function () {
+return this.scaleProteinAsCdna;
+});
+Clazz_overrideMethod (c$, "setScaleProteinAsCdna", 
+function (b) {
+this.scaleProteinAsCdna = b;
+}, "~B");
+});
+Clazz_declarePackage ("jalview.workers");
+Clazz_load (["jalview.api.AlignCalcManagerI", "java.util.ArrayList", "$.Collections", "$.HashSet", "$.Hashtable"], "jalview.workers.AlignCalcManager", null, function () {
+c$ = Clazz_decorateAsClass (function () {
+this.restartable = null;
+this.blackList = null;
+this.inProgress = null;
+this.updating = null;
+this.canUpdate = null;
+Clazz_instantialize (this, arguments);
+}, jalview.workers, "AlignCalcManager", null, jalview.api.AlignCalcManagerI);
+Clazz_prepareFields (c$, function () {
+this.restartable = java.util.Collections.synchronizedList ( new java.util.ArrayList ());
+this.blackList = java.util.Collections.synchronizedList ( new java.util.ArrayList ());
+this.inProgress = java.util.Collections.synchronizedMap ( new java.util.Hashtable ());
+this.updating = java.util.Collections.synchronizedMap ( new java.util.Hashtable ());
+this.canUpdate =  new java.util.HashSet ();
+});
+Clazz_overrideMethod (c$, "notifyStart", 
+function (worker) {
+{
+var upd = this.updating.get (worker.getClass ());
+if (upd == null) {
+this.updating.put (worker.getClass (), upd = java.util.Collections.synchronizedList ( new java.util.ArrayList ()));
+}{
+upd.add (worker);
+}}}, "jalview.api.AlignCalcWorkerI");
+Clazz_overrideMethod (c$, "alreadyDoing", 
+function (worker) {
+{
+return this.inProgress.containsKey (worker.getClass ());
+}}, "jalview.api.AlignCalcWorkerI");
+Clazz_overrideMethod (c$, "isPending", 
+function (workingClass) {
+var upd;
+{
+upd = this.updating.get (workingClass.getClass ());
+if (upd == null) {
+return false;
+}{
+if (upd.size () > 1) {
+return true;
+}}return false;
+}}, "jalview.api.AlignCalcWorkerI");
+Clazz_defineMethod (c$, "numberLive", 
+function (worker) {
+{
+var upd = this.updating.get (worker.getClass ());
+if (upd == null) {
+return 0;
+};return upd.size ();
+}}, "jalview.api.AlignCalcWorkerI");
+Clazz_overrideMethod (c$, "notifyWorking", 
+function (worker) {
+{
+if (this.inProgress.get (worker.getClass ()) != null) {
+if (false) {
+System.err.println ("Warning: Multiple workers are running of type " + worker.getClass ());
+}return false;
+}this.inProgress.put (worker.getClass (), worker);
+}return true;
+}, "jalview.api.AlignCalcWorkerI");
+Clazz_overrideMethod (c$, "workerComplete", 
+function (worker) {
+{
+this.inProgress.remove (worker.getClass ());
+var upd = this.updating.get (worker.getClass ());
+if (upd != null) {
+{
+upd.remove (worker);
+}this.canUpdate.add (worker);
+}}}, "jalview.api.AlignCalcWorkerI");
+Clazz_overrideMethod (c$, "workerCannotRun", 
+function (worker) {
+{
+this.blackList.add (worker.getClass ());
+}}, "jalview.api.AlignCalcWorkerI");
+Clazz_defineMethod (c$, "isBlackListed", 
+function (workerType) {
+{
+return this.blackList.contains (workerType);
+}}, "Class");
+Clazz_overrideMethod (c$, "startWorker", 
+function (worker) {
+var workerAsThread = worker;
+if (workerAsThread.isAlive ()) {
+workerAsThread.interrupt ();
+worker = worker.getNewWorker ();
+}worker.setName (worker.getClass ().getName ());
+worker.start ();
+}, "jalview.api.AlignCalcWorkerI");
+Clazz_defineMethod (c$, "isWorking", 
+function (worker) {
+{
+return worker != null && this.inProgress.get (worker.getClass ()) === worker;
+}}, "jalview.api.AlignCalcWorkerI");
+Clazz_defineMethod (c$, "isWorking", 
+function () {
+{
+return this.inProgress.size () > 0;
+}});
+Clazz_overrideMethod (c$, "registerWorker", 
+function (worker) {
+{
+if (!this.restartable.contains (worker)) {
+this.restartable.add (worker);
+}this.startWorker (worker);
+}}, "jalview.api.AlignCalcWorkerI");
+Clazz_overrideMethod (c$, "restartWorkers", 
+function () {
+{
+for (var worker, $worker = this.restartable.iterator (); $worker.hasNext () && ((worker = $worker.next ()) || true);) {
+this.startWorker (worker);
+}
+}});
+Clazz_overrideMethod (c$, "workingInvolvedWith", 
+function (alignmentAnnotation) {
+{
+for (var worker, $worker = this.inProgress.values ().iterator (); $worker.hasNext () && ((worker = $worker.next ()) || true);) {
+if (worker.involves (alignmentAnnotation)) {
+return true;
+}}
+}{
+for (var workers, $workers = this.updating.values ().iterator (); $workers.hasNext () && ((workers = $workers.next ()) || true);) {
+for (var worker, $worker = workers.iterator (); $worker.hasNext () && ((worker = $worker.next ()) || true);) {
+if (worker.involves (alignmentAnnotation)) {
+return true;
+}}
+}
+}return false;
+}, "jalview.datamodel.AlignmentAnnotation");
+Clazz_overrideMethod (c$, "updateAnnotationFor", 
+function (workerClass) {
+var workers;
+{
+workers = this.canUpdate.toArray ( new Array (0));
+}for (var worker, $worker = 0, $$worker = workers; $worker < $$worker.length && ((worker = $$worker[$worker]) || true); $worker++) {
+if (workerClass.equals (worker.getClass ())) {
+worker.updateAnnotation ();
+}}
+}, "Class");
+Clazz_overrideMethod (c$, "getRegisteredWorkersOfClass", 
+function (workerClass) {
+var workingClass =  new java.util.ArrayList ();
+var workers;
+{
+workers = this.canUpdate.toArray ( new Array (this.canUpdate.size ()));
+}for (var worker, $worker = 0, $$worker = workers; $worker < $$worker.length && ((worker = $$worker[$worker]) || true); $worker++) {
+if (workerClass.equals (worker.getClass ())) {
+workingClass.add (worker);
+}}
+return (workingClass.size () == 0) ? null : workingClass;
+}, "Class");
+Clazz_overrideMethod (c$, "startRegisteredWorkersOfClass", 
+function (workerClass) {
+var workers = this.getRegisteredWorkersOfClass (workerClass);
+if (workers == null) {
+return false;
+}for (var worker, $worker = workers.iterator (); $worker.hasNext () && ((worker = $worker.next ()) || true);) {
+if (!this.isPending (worker)) {
+this.startWorker (worker);
+} else {
+System.err.println ("Pending exists for " + workerClass);
+}}
+return true;
+}, "Class");
+Clazz_overrideMethod (c$, "workerMayRun", 
+function (worker) {
+{
+if (this.blackList.contains (worker.getClass ())) {
+this.blackList.remove (worker.getClass ());
+}}}, "jalview.api.AlignCalcWorkerI");
+Clazz_overrideMethod (c$, "removeRegisteredWorkersOfClass", 
+function (typeToRemove) {
+var workers = this.getRegisteredWorkersOfClass (typeToRemove);
+var removable =  new java.util.ArrayList ();
+var toremovannot =  new java.util.HashSet ();
+{
+for (var worker, $worker = this.restartable.iterator (); $worker.hasNext () && ((worker = $worker.next ()) || true);) {
+if (typeToRemove.equals (worker.getClass ())) {
+removable.add (worker);
+toremovannot.add (worker);
+}}
+this.restartable.removeAll (removable);
+}{
+for (var worker, $worker = this.canUpdate.iterator (); $worker.hasNext () && ((worker = $worker.next ()) || true);) {
+if (typeToRemove.equals (worker.getClass ())) {
+removable.add (worker);
+toremovannot.add (worker);
+}}
+this.canUpdate.removeAll (removable);
+}}, "Class");
+});
+Clazz_declarePackage ("jalview.api");
+Clazz_declareInterface (jalview.api, "AlignCalcManagerI");
+Clazz_declarePackage ("java.util");
+Clazz_load (["java.util.AbstractCollection", "$.Iterator", "java.util.Deque"], "java.util.ArrayDeque", ["java.lang.AssertionError", "$.IllegalStateException", "$.NullPointerException", "java.lang.reflect.Array", "java.util.Arrays", "$.ConcurrentModificationException", "$.NoSuchElementException"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.elements = null;
+this.head = 0;
+this.tail = 0;
+if (!Clazz_isClassDefined ("java.util.ArrayDeque.DeqIterator")) {
+java.util.ArrayDeque.$ArrayDeque$DeqIterator$ ();
+}
+if (!Clazz_isClassDefined ("java.util.ArrayDeque.DescendingIterator")) {
+java.util.ArrayDeque.$ArrayDeque$DescendingIterator$ ();
+}
+Clazz_instantialize (this, arguments);
+}, java.util, "ArrayDeque", java.util.AbstractCollection, [java.util.Deque, Cloneable, java.io.Serializable]);
+Clazz_defineMethod (c$, "allocateElements", 
+ function (numElements) {
+var initialCapacity = 8;
+if (numElements >= initialCapacity) {
+initialCapacity = numElements;
+initialCapacity |= (initialCapacity >>> 1);
+initialCapacity |= (initialCapacity >>> 2);
+initialCapacity |= (initialCapacity >>> 4);
+initialCapacity |= (initialCapacity >>> 8);
+initialCapacity |= (initialCapacity >>> 16);
+initialCapacity++;
+if (initialCapacity < 0) initialCapacity >>>= 1;
+}this.elements =  new Array (initialCapacity);
+}, "~N");
+Clazz_defineMethod (c$, "doubleCapacity", 
+ function () {
+var p = this.head;
+var n = this.elements.length;
+var r = n - p;
+var newCapacity = n << 1;
+if (newCapacity < 0) throw  new IllegalStateException ("Sorry, deque too big");
+var a =  new Array (newCapacity);
+System.arraycopy (this.elements, p, a, 0, r);
+System.arraycopy (this.elements, 0, a, r, p);
+this.elements = a;
+this.head = 0;
+this.tail = n;
+});
+Clazz_defineMethod (c$, "copyElements", 
+ function (a) {
+if (this.head < this.tail) {
+System.arraycopy (this.elements, this.head, a, 0, this.size ());
+} else if (this.head > this.tail) {
+var headPortionLen = this.elements.length - this.head;
+System.arraycopy (this.elements, this.head, a, 0, headPortionLen);
+System.arraycopy (this.elements, 0, a, headPortionLen, this.tail);
+}return a;
+}, "~A");
+Clazz_makeConstructor (c$, 
+function () {
+Clazz_superConstructor (this, java.util.ArrayDeque, []);
+this.elements =  new Array (16);
+});
+Clazz_makeConstructor (c$, 
+function (numElements) {
+Clazz_superConstructor (this, java.util.ArrayDeque, []);
+this.allocateElements (numElements);
+}, "~N");
+Clazz_makeConstructor (c$, 
+function (c) {
+Clazz_superConstructor (this, java.util.ArrayDeque, []);
+this.allocateElements (c.size ());
+this.addAll (c);
+}, "java.util.Collection");
+Clazz_overrideMethod (c$, "addFirst", 
+function (e) {
+if (e == null) throw  new NullPointerException ();
+this.elements[this.head = (this.head - 1) & (this.elements.length - 1)] = e;
+if (this.head == this.tail) this.doubleCapacity ();
+}, "~O");
+Clazz_overrideMethod (c$, "addLast", 
+function (e) {
+if (e == null) throw  new NullPointerException ();
+this.elements[this.tail] = e;
+if ((this.tail = (this.tail + 1) & (this.elements.length - 1)) == this.head) this.doubleCapacity ();
+}, "~O");
+Clazz_overrideMethod (c$, "offerFirst", 
+function (e) {
+this.addFirst (e);
+return true;
+}, "~O");
+Clazz_overrideMethod (c$, "offerLast", 
+function (e) {
+this.addLast (e);
+return true;
+}, "~O");
+Clazz_overrideMethod (c$, "removeFirst", 
+function () {
+var x = this.pollFirst ();
+if (x == null) throw  new java.util.NoSuchElementException ();
+return x;
+});
+Clazz_overrideMethod (c$, "removeLast", 
+function () {
+var x = this.pollLast ();
+if (x == null) throw  new java.util.NoSuchElementException ();
+return x;
+});
+Clazz_overrideMethod (c$, "pollFirst", 
+function () {
+var h = this.head;
+var result = this.elements[h];
+if (result == null) return null;
+this.elements[h] = null;
+this.head = (h + 1) & (this.elements.length - 1);
+return result;
+});
+Clazz_overrideMethod (c$, "pollLast", 
+function () {
+var t = (this.tail - 1) & (this.elements.length - 1);
+var result = this.elements[t];
+if (result == null) return null;
+this.elements[t] = null;
+this.tail = t;
+return result;
+});
+Clazz_overrideMethod (c$, "getFirst", 
+function () {
+var x = this.elements[this.head];
+if (x == null) throw  new java.util.NoSuchElementException ();
+return x;
+});
+Clazz_overrideMethod (c$, "getLast", 
+function () {
+var x = this.elements[(this.tail - 1) & (this.elements.length - 1)];
+if (x == null) throw  new java.util.NoSuchElementException ();
+return x;
+});
+Clazz_overrideMethod (c$, "peekFirst", 
+function () {
+return this.elements[this.head];
+});
+Clazz_overrideMethod (c$, "peekLast", 
+function () {
+return this.elements[(this.tail - 1) & (this.elements.length - 1)];
+});
+Clazz_overrideMethod (c$, "removeFirstOccurrence", 
+function (o) {
+if (o == null) return false;
+var mask = this.elements.length - 1;
+var i = this.head;
+var x;
+while ((x = this.elements[i]) != null) {
+if (o.equals (x)) {
+this.$delete (i);
+return true;
+}i = (i + 1) & mask;
+}
+return false;
+}, "~O");
+Clazz_overrideMethod (c$, "removeLastOccurrence", 
+function (o) {
+if (o == null) return false;
+var mask = this.elements.length - 1;
+var i = (this.tail - 1) & mask;
+var x;
+while ((x = this.elements[i]) != null) {
+if (o.equals (x)) {
+this.$delete (i);
+return true;
+}i = (i - 1) & mask;
+}
+return false;
+}, "~O");
+Clazz_overrideMethod (c$, "add", 
+function (e) {
+this.addLast (e);
+return true;
+}, "~O");
+Clazz_overrideMethod (c$, "offer", 
+function (e) {
+return this.offerLast (e);
+}, "~O");
+Clazz_defineMethod (c$, "remove", 
+function () {
+return this.removeFirst ();
+});
+Clazz_overrideMethod (c$, "poll", 
+function () {
+return this.pollFirst ();
+});
+Clazz_overrideMethod (c$, "element", 
+function () {
+return this.getFirst ();
+});
+Clazz_overrideMethod (c$, "peek", 
+function () {
+return this.peekFirst ();
+});
+Clazz_overrideMethod (c$, "push", 
+function (e) {
+this.addFirst (e);
+}, "~O");
+Clazz_overrideMethod (c$, "pop", 
+function () {
+return this.removeFirst ();
+});
+Clazz_defineMethod (c$, "checkInvariants", 
+ function () {
+});
+Clazz_defineMethod (c$, "$delete", 
+ function (i) {
+this.checkInvariants ();
+var elements = this.elements;
+var mask = elements.length - 1;
+var h = this.head;
+var t = this.tail;
+var front = (i - h) & mask;
+var back = (t - i) & mask;
+if (front >= ((t - h) & mask)) throw  new java.util.ConcurrentModificationException ();
+if (front < back) {
+if (h <= i) {
+System.arraycopy (elements, h, elements, h + 1, front);
+} else {
+System.arraycopy (elements, 0, elements, 1, i);
+elements[0] = elements[mask];
+System.arraycopy (elements, h, elements, h + 1, mask - h);
+}elements[h] = null;
+this.head = (h + 1) & mask;
+return false;
+} else {
+if (i < t) {
+System.arraycopy (elements, i + 1, elements, i, back);
+this.tail = t - 1;
+} else {
+System.arraycopy (elements, i + 1, elements, i, mask - i);
+elements[mask] = elements[0];
+System.arraycopy (elements, 1, elements, 0, t);
+this.tail = (t - 1) & mask;
+}return true;
+}}, "~N");
+Clazz_overrideMethod (c$, "size", 
+function () {
+return (this.tail - this.head) & (this.elements.length - 1);
+});
+Clazz_overrideMethod (c$, "isEmpty", 
+function () {
+return this.head == this.tail;
+});
+Clazz_overrideMethod (c$, "iterator", 
+function () {
+return Clazz_innerTypeInstance (java.util.ArrayDeque.DeqIterator, this, null);
+});
+Clazz_overrideMethod (c$, "descendingIterator", 
+function () {
+return Clazz_innerTypeInstance (java.util.ArrayDeque.DescendingIterator, this, null);
+});
+Clazz_overrideMethod (c$, "contains", 
+function (o) {
+if (o == null) return false;
+var mask = this.elements.length - 1;
+var i = this.head;
+var x;
+while ((x = this.elements[i]) != null) {
+if (o.equals (x)) return true;
+i = (i + 1) & mask;
+}
+return false;
+}, "~O");
+Clazz_defineMethod (c$, "remove", 
+function (o) {
+return this.removeFirstOccurrence (o);
+}, "~O");
+Clazz_overrideMethod (c$, "clear", 
+function () {
+var h = this.head;
+var t = this.tail;
+if (h != t) {
+this.head = this.tail = 0;
+var i = h;
+var mask = this.elements.length - 1;
+do {
+this.elements[i] = null;
+i = (i + 1) & mask;
+} while (i != t);
+}});
+Clazz_defineMethod (c$, "toArray", 
+function () {
+return this.copyElements ( new Array (this.size ()));
+});
+Clazz_defineMethod (c$, "toArray", 
+function (a) {
+var size = this.size ();
+if (a.length < size) a = java.lang.reflect.Array.newInstance (a.getClass ().getComponentType (), size);
+this.copyElements (a);
+if (a.length > size) a[size] = null;
+return a;
+}, "~A");
+Clazz_defineMethod (c$, "clone", 
+function () {
+try {
+var result = Clazz_superCall (this, java.util.ArrayDeque, "clone", []);
+result.elements = java.util.Arrays.copyOf (this.elements, this.elements.length);
+return result;
+} catch (e) {
+if (Clazz_exceptionOf (e, CloneNotSupportedException)) {
+throw  new AssertionError ();
+} else {
+throw e;
+}
+}
+});
+c$.$ArrayDeque$DeqIterator$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_decorateAsClass (function () {
+Clazz_prepareCallback (this, arguments);
+this.cursor = 0;
+this.fence = 0;
+this.lastRet = -1;
+Clazz_instantialize (this, arguments);
+}, java.util.ArrayDeque, "DeqIterator", null, java.util.Iterator);
+Clazz_prepareFields (c$, function () {
+this.cursor = this.b$["java.util.ArrayDeque"].head;
+this.fence = this.b$["java.util.ArrayDeque"].tail;
+});
+Clazz_overrideMethod (c$, "hasNext", 
+function () {
+return this.cursor != this.fence;
+});
+Clazz_overrideMethod (c$, "next", 
+function () {
+if (this.cursor == this.fence) throw  new java.util.NoSuchElementException ();
+var a = this.b$["java.util.ArrayDeque"].elements[this.cursor];
+if (this.b$["java.util.ArrayDeque"].tail != this.fence || a == null) throw  new java.util.ConcurrentModificationException ();
+this.lastRet = this.cursor;
+this.cursor = (this.cursor + 1) & (this.b$["java.util.ArrayDeque"].elements.length - 1);
+return a;
+});
+Clazz_overrideMethod (c$, "remove", 
+function () {
+if (this.lastRet < 0) throw  new IllegalStateException ();
+if (this.b$["java.util.ArrayDeque"].$delete (this.lastRet)) {
+this.cursor = (this.cursor - 1) & (this.b$["java.util.ArrayDeque"].elements.length - 1);
+this.fence = this.b$["java.util.ArrayDeque"].tail;
+}this.lastRet = -1;
+});
+c$ = Clazz_p0p ();
+};
+c$.$ArrayDeque$DescendingIterator$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_decorateAsClass (function () {
+Clazz_prepareCallback (this, arguments);
+this.cursor = 0;
+this.fence = 0;
+this.lastRet = -1;
+Clazz_instantialize (this, arguments);
+}, java.util.ArrayDeque, "DescendingIterator", null, java.util.Iterator);
+Clazz_prepareFields (c$, function () {
+this.cursor = this.b$["java.util.ArrayDeque"].tail;
+this.fence = this.b$["java.util.ArrayDeque"].head;
+});
+Clazz_overrideMethod (c$, "hasNext", 
+function () {
+return this.cursor != this.fence;
+});
+Clazz_overrideMethod (c$, "next", 
+function () {
+if (this.cursor == this.fence) throw  new java.util.NoSuchElementException ();
+this.cursor = (this.cursor - 1) & (this.b$["java.util.ArrayDeque"].elements.length - 1);
+var a = this.b$["java.util.ArrayDeque"].elements[this.cursor];
+if (this.b$["java.util.ArrayDeque"].head != this.fence || a == null) throw  new java.util.ConcurrentModificationException ();
+this.lastRet = this.cursor;
+return a;
+});
+Clazz_overrideMethod (c$, "remove", 
+function () {
+if (this.lastRet < 0) throw  new IllegalStateException ();
+if (!this.b$["java.util.ArrayDeque"].$delete (this.lastRet)) {
+this.cursor = (this.cursor + 1) & (this.b$["java.util.ArrayDeque"].elements.length - 1);
+this.fence = this.b$["java.util.ArrayDeque"].head;
+}this.lastRet = -1;
+});
+c$ = Clazz_p0p ();
+};
+Clazz_defineStatics (c$,
+"MIN_INITIAL_CAPACITY", 8);
+});
+Clazz_declarePackage ("java.util");
+Clazz_load (["java.util.Queue"], "java.util.Deque", null, function () {
+Clazz_declareInterface (java.util, "Deque", java.util.Queue);
+});
+Clazz_declarePackage ("jalview.datamodel");
+Clazz_load (null, "jalview.datamodel.AlignmentView", ["jalview.datamodel.Alignment", "$.CigarArray", "$.ColumnSelection", "$.SeqCigar", "$.SequenceGroup", "jalview.util.MessageManager", "$.ShiftList", "java.lang.Error", "java.util.ArrayList", "$.Vector"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.sequences = null;
+this.contigs = null;
+this.width = 0;
+this.firstCol = 0;
+this.scGroups = null;
+this.$isNa = false;
+if (!Clazz_isClassDefined ("jalview.datamodel.AlignmentView.ScGroup")) {
+jalview.datamodel.AlignmentView.$AlignmentView$ScGroup$ ();
+}
+this.selected = null;
+Clazz_instantialize (this, arguments);
+}, jalview.datamodel, "AlignmentView");
+Clazz_defineMethod (c$, "isNa", 
+function () {
+return this.$isNa;
+});
+Clazz_makeConstructor (c$, 
+function (alignment, columnSelection, selection, hasHiddenColumns, selectedRegionOnly, recordGroups) {
+this.construct ( new jalview.datamodel.CigarArray (alignment, (hasHiddenColumns ? columnSelection : null), (selectedRegionOnly ? selection : null)), (selectedRegionOnly && selection != null) ? selection.getStartRes () : 0);
+this.$isNa = alignment.isNucleotide ();
+var selseqs;
+if (selection != null && selection.getSize () > 0) {
+var sel = selection.getSequences (null);
+this.selected =  new java.util.Vector ();
+selseqs = selection.getSequencesInOrder (alignment, selectedRegionOnly);
+} else {
+selseqs = alignment.getSequencesArray ();
+}var seqsets =  new java.util.ArrayList ();
+var grps =  new java.util.ArrayList ();
+var gg = alignment.getGroups ();
+grps.addAll (gg);
+var sgrps = null;
+var addedgps = null;
+if (grps != null) {
+if (selection != null && selectedRegionOnly) {
+var ssel = selection.getStartRes ();
+var esel = selection.getEndRes ();
+var isg =  new java.util.ArrayList ();
+for (var sg, $sg = grps.iterator (); $sg.hasNext () && ((sg = $sg.next ()) || true);) {
+if (!(sg.getStartRes () > esel || sg.getEndRes () < ssel)) {
+if (sg.getStartRes () < ssel) {
+sg.setStartRes (ssel);
+}if (sg.getEndRes () > esel) {
+sg.setEndRes (esel);
+}sg.setStartRes (sg.getStartRes () - ssel + 1);
+sg.setEndRes (sg.getEndRes () - ssel + 1);
+isg.add (sg);
+}}
+grps = isg;
+}sgrps =  new Array (grps.size ());
+addedgps =  Clazz_newBooleanArray (grps.size (), false);
+for (var g = 0; g < sgrps.length; g++) {
+var sg = grps.get (g);
+sgrps[g] = Clazz_innerTypeInstance (jalview.datamodel.AlignmentView.ScGroup, this, null);
+sgrps[g].sg =  new jalview.datamodel.SequenceGroup (sg);
+addedgps[g] = false;
+seqsets.add (sg.getSequences ());
+}
+}var csi = 0;
+for (var i = 0; i < selseqs.length; i++) {
+if (selseqs[i] != null) {
+if (selection != null && selection.getSize () > 0 && !selectedRegionOnly) {
+this.sequences[csi].setGroupMembership (this.selected);
+this.selected.addElement (this.sequences[csi]);
+}if (seqsets != null) {
+for (var sg = 0; sg < sgrps.length; sg++) {
+if ((seqsets.get (sg)).contains (selseqs[i])) {
+this.sequences[csi].setGroupMembership (sgrps[sg]);
+sgrps[sg].sg.deleteSequence (selseqs[i], false);
+sgrps[sg].seqs.addElement (this.sequences[csi]);
+if (!addedgps[sg]) {
+if (this.scGroups == null) {
+this.scGroups =  new java.util.ArrayList ();
+}addedgps[sg] = true;
+this.scGroups.add (sgrps[sg]);
+}}}
+}csi++;
+}}
+for (var sg = 0; sg < sgrps.length; sg++) {
+var sqs = sgrps[sg].sg.getSequencesAsArray (null);
+for (var si = 0; si < sqs.length; si++) {
+sgrps[sg].sg.deleteSequence (sqs[si], false);
+}
+sgrps[sg] = null;
+}
+}, "jalview.datamodel.AlignmentI,jalview.datamodel.ColumnSelection,jalview.datamodel.SequenceGroup,~B,~B,~B");
+Clazz_makeConstructor (c$, 
+function (seqcigararray) {
+if (!seqcigararray.isSeqCigarArray ()) {
+throw  new Error (jalview.util.MessageManager.getString ("error.implementation_error_can_only_make_alignmnet_from_cigararray"));
+}this.contigs = seqcigararray.getDeletedRegions ();
+this.sequences = seqcigararray.getSeqCigarArray ();
+this.width = seqcigararray.getWidth ();
+}, "jalview.datamodel.CigarArray");
+Clazz_makeConstructor (c$, 
+function (sdata, firstcol) {
+this.construct (sdata);
+this.firstCol = firstcol;
+}, "jalview.datamodel.CigarArray,~N");
+Clazz_defineMethod (c$, "setSequences", 
+function (sequences) {
+this.sequences = sequences;
+}, "~A");
+Clazz_defineMethod (c$, "setContigs", 
+function (contigs) {
+this.contigs = contigs;
+}, "~A");
+Clazz_defineMethod (c$, "getSequences", 
+function () {
+return this.sequences;
+});
+Clazz_defineMethod (c$, "getContigs", 
+function () {
+return this.contigs;
+});
+Clazz_defineMethod (c$, "getAlignmentAndColumnSelection", 
+function (gapCharacter) {
+var colsel =  new jalview.datamodel.ColumnSelection ();
+return  Clazz_newArray (-1, [jalview.datamodel.SeqCigar.createAlignmentSequences (this.sequences, gapCharacter, colsel, this.contigs), colsel]);
+}, "~S");
+Clazz_defineMethod (c$, "getVisibleAlignment", 
+function (c) {
+var aln = this.getVisibleSeqs (c);
+var vcal =  new jalview.datamodel.Alignment (aln);
+this.addPrunedGroupsInOrder (vcal, -1, -1, true);
+return vcal;
+}, "~S");
+Clazz_defineMethod (c$, "addPrunedGroupsInOrder", 
+ function (vcal, gstart, gend, viscontigs) {
+var r = false;
+if (gstart > -1 && gstart <= gend) {
+r = true;
+}var aln = vcal.getSequencesArray ();
+{
+{
+var nvg = (this.scGroups != null) ? this.scGroups.size () : 0;
+if (nvg > 0) {
+var nsg =  new Array (nvg);
+for (var g = 0; g < nvg; g++) {
+var sg = this.scGroups.get (g).sg;
+if (r) {
+if (sg.getStartRes () > gend || sg.getEndRes () < gstart) {
+nsg[g] = null;
+continue;
+}}nsg[g] =  new jalview.datamodel.SequenceGroup (sg);
+if (r && !viscontigs) {
+if (nsg[g].getStartRes () < gstart) {
+nsg[g].setStartRes (0);
+} else {
+nsg[g].setStartRes (nsg[g].getStartRes () - gstart);
+nsg[g].setEndRes (nsg[g].getEndRes () - gstart);
+}if (nsg[g].getEndRes () > (gend - gstart)) {
+nsg[g].setEndRes (gend - gstart);
+}}}
+if (viscontigs) {
+if (this.contigs != null) {
+var p = 0;
+var prune =  new jalview.util.ShiftList ();
+if (r) {
+prune.addShift (gstart, -gstart);
+}for (var h = 0; h < this.contigs.length; h += 3) {
+{
+prune.addShift (p + this.contigs[h + 1], this.contigs[h + 2] - this.contigs[h + 1]);
+}p = this.contigs[h + 1] + this.contigs[h + 2];
+}
+for (var g = 0; g < nsg.length; g++) {
+if (nsg[g] != null) {
+var s = nsg[g].getStartRes ();
+var t = nsg[g].getEndRes ();
+var w = 1 + t - s;
+if (r) {
+if (s < gstart) {
+s = gstart;
+}if (t > gend) {
+t = gend;
+}}s = prune.shift (s);
+t = prune.shift (t);
+nsg[g].setStartRes (s);
+nsg[g].setEndRes (t);
+}}
+}}for (var nsq = 0; nsq < aln.length; nsq++) {
+for (var g = 0; g < nvg; g++) {
+if (nsg[g] != null && this.sequences[nsq].isMemberOf (this.scGroups.get (g))) {
+nsg[g].addSequence (aln[nsq], false);
+}}
+}
+for (var g = 0; g < nvg; g++) {
+if (nsg[g] != null && nsg[g].getSize () > 0) {
+vcal.addGroup (nsg[g]);
+}nsg[g] = null;
+}
+}}}}, "jalview.datamodel.AlignmentI,~N,~N,~B");
+Clazz_defineMethod (c$, "getVisibleSeqs", 
+ function (c) {
+var aln =  new Array (this.sequences.length);
+for (var i = 0, j = this.sequences.length; i < j; i++) {
+aln[i] = this.sequences[i].getSeq ('-');
+}
+var seqs = this.getSequenceStrings ('-');
+for (var i = 0, j = aln.length; i < j; i++) {
+aln[i].setSequence (seqs[i]);
+}
+return aln;
+}, "~S");
+Clazz_defineMethod (c$, "getVisibleContigAlignments", 
+function (c) {
+var nvc = 0;
+var vcontigs = this.getVisibleContigs ();
+var contigviews = this.getVisibleContigs (c);
+var vcals =  new Array (contigviews.length);
+for (nvc = 0; nvc < contigviews.length; nvc++) {
+vcals[nvc] =  new jalview.datamodel.Alignment (contigviews[nvc]);
+if (this.scGroups != null && this.scGroups.size () > 0) {
+this.addPrunedGroupsInOrder (vcals[nvc], vcontigs[nvc * 2], vcontigs[nvc * 2 + 1], true);
+}}
+return vcals;
+}, "~S");
+Clazz_defineMethod (c$, "getSequenceStrings", 
+function (c) {
+var seqs =  new Array (this.sequences.length);
+for (var n = 0; n < this.sequences.length; n++) {
+var fullseq = this.sequences[n].getSequenceString (c);
+if (this.contigs != null) {
+seqs[n] = "";
+var p = 0;
+for (var h = 0; h < this.contigs.length; h += 3) {
+seqs[n] += fullseq.substring (p, this.contigs[h + 1]);
+p = this.contigs[h + 1] + this.contigs[h + 2];
+}
+seqs[n] += fullseq.substring (p);
+} else {
+seqs[n] = fullseq;
+}}
+return seqs;
+}, "~S");
+Clazz_defineMethod (c$, "getWidth", 
+function () {
+return this.width;
+});
+Clazz_defineMethod (c$, "setWidth", 
+function (width) {
+this.width = width;
+}, "~N");
+Clazz_defineMethod (c$, "getVisibleContigs", 
+function (gapCharacter) {
+var smsa;
+var njobs = 1;
+if (this.sequences == null || this.width <= 0) {
+return null;
+}if (this.contigs != null && this.contigs.length > 0) {
+var start = 0;
+njobs = 0;
+var fwidth = this.width;
+for (var contig = 0; contig < this.contigs.length; contig += 3) {
+if ((this.contigs[contig + 1] - start) > 0) {
+njobs++;
+}fwidth += this.contigs[contig + 2];
+start = this.contigs[contig + 1] + this.contigs[contig + 2];
+}
+if (start < fwidth) {
+njobs++;
+}smsa =  new Array (njobs);
+start = 0;
+var j = 0;
+for (var contig = 0; contig < this.contigs.length; contig += 3) {
+if (this.contigs[contig + 1] - start > 0) {
+var mseq =  new Array (this.sequences.length);
+for (var s = 0; s < mseq.length; s++) {
+mseq[s] = this.sequences[s].getSeq (gapCharacter).getSubSequence (start, this.contigs[contig + 1]);
+}
+smsa[j] = mseq;
+j++;
+}start = this.contigs[contig + 1] + this.contigs[contig + 2];
+}
+if (start < fwidth) {
+var mseq =  new Array (this.sequences.length);
+for (var s = 0; s < mseq.length; s++) {
+mseq[s] = this.sequences[s].getSeq (gapCharacter).getSubSequence (start, fwidth + 1);
+}
+smsa[j] = mseq;
+j++;
+}} else {
+smsa =  new Array (1);
+smsa[0] =  new Array (this.sequences.length);
+for (var s = 0; s < this.sequences.length; s++) {
+smsa[0][s] = this.sequences[s].getSeq (gapCharacter);
+}
+}return smsa;
+}, "~S");
+Clazz_defineMethod (c$, "getUpdatedView", 
+function (nvismsa, orders, gapCharacter) {
+if (this.sequences == null || this.width <= 0) {
+throw  new Error (jalview.util.MessageManager.getString ("error.empty_view_cannot_be_updated"));
+}if (nvismsa == null) {
+throw  new Error ("nvismsa==null. use getAlignmentAndColumnSelection() instead.");
+}if (this.contigs != null && this.contigs.length > 0) {
+var alignment =  new Array (this.sequences.length);
+var columnselection =  new jalview.datamodel.ColumnSelection ();
+if (this.contigs != null && this.contigs.length > 0) {
+var start = 0;
+var nwidth = 0;
+var owidth = this.width;
+var j = 0;
+for (var contig = 0; contig < this.contigs.length; contig += 3) {
+owidth += this.contigs[contig + 2];
+if (this.contigs[contig + 1] - start > 0) {
+var swidth = 0;
+if (nvismsa[j] != null) {
+var mseq = nvismsa[j];
+var order = (orders == null) ? null : orders[j];
+j++;
+if (mseq.length != this.sequences.length) {
+throw  new Error (jalview.util.MessageManager.formatMessage ("error.mismatch_between_number_of_sequences_in_block",  Clazz_newArray (-1, [Integer.$valueOf (j).toString (), Integer.$valueOf (mseq.length).toString (), Integer.$valueOf (this.sequences.length).toString ()])));
+}swidth = mseq[0].getLength ();
+for (var s = 0; s < mseq.length; s++) {
+if (alignment[s] == null) {
+alignment[s] = mseq[s];
+} else {
+alignment[s].setSequence (alignment[s].getSequenceAsString () + mseq[s].getSequenceAsString ());
+if (mseq[s].getStart () <= mseq[s].getEnd ()) {
+alignment[s].setEnd (mseq[s].getEnd ());
+}if (order != null) {
+order.updateSequence (mseq[s], alignment[s]);
+}}}
+} else {
+if (true) {
+for (var s = 0; s < this.sequences.length; s++) {
+var oseq = this.sequences[s].getSeq (gapCharacter).getSubSequence (start, this.contigs[contig + 1]);
+if (swidth < oseq.getLength ()) {
+swidth = oseq.getLength ();
+}if (alignment[s] == null) {
+alignment[s] = oseq;
+} else {
+alignment[s].setSequence (alignment[s].getSequenceAsString () + oseq.getSequenceAsString ());
+if (oseq.getEnd () >= oseq.getStart ()) {
+alignment[s].setEnd (oseq.getEnd ());
+}}}
+}j++;
+}nwidth += swidth;
+}start = this.contigs[contig + 1] + this.contigs[contig + 2];
+for (var s = 0; s < this.sequences.length; s++) {
+var hseq = this.sequences[s].getSeq (gapCharacter).getSubSequence (this.contigs[contig + 1], start);
+if (alignment[s] == null) {
+alignment[s] = hseq;
+} else {
+alignment[s].setSequence (alignment[s].getSequenceAsString () + hseq.getSequenceAsString ());
+if (hseq.getEnd () >= hseq.getStart ()) {
+alignment[s].setEnd (hseq.getEnd ());
+}}}
+columnselection.hideColumns (nwidth, nwidth + this.contigs[contig + 2] - 1);
+nwidth += this.contigs[contig + 2];
+}
+if (j < nvismsa.length) {
+var swidth = 0;
+if (nvismsa[j] != null) {
+var mseq = nvismsa[j];
+var order = (orders != null) ? orders[j] : null;
+swidth = mseq[0].getLength ();
+for (var s = 0; s < mseq.length; s++) {
+if (alignment[s] == null) {
+alignment[s] = mseq[s];
+} else {
+alignment[s].setSequence (alignment[s].getSequenceAsString () + mseq[s].getSequenceAsString ());
+if (mseq[s].getEnd () >= mseq[s].getStart ()) {
+alignment[s].setEnd (mseq[s].getEnd ());
+}if (order != null) {
+order.updateSequence (mseq[s], alignment[s]);
+}}}
+} else {
+if (start < owidth) {
+if (true) {
+for (var s = 0; s < this.sequences.length; s++) {
+var oseq = this.sequences[s].getSeq (gapCharacter).getSubSequence (start, owidth + 1);
+if (swidth < oseq.getLength ()) {
+swidth = oseq.getLength ();
+}if (alignment[s] == null) {
+alignment[s] = oseq;
+} else {
+alignment[s].setSequence (alignment[s].getSequenceAsString () + oseq.getSequenceAsString ());
+if (oseq.getEnd () >= oseq.getStart ()) {
+alignment[s].setEnd (oseq.getEnd ());
+}}}
+nwidth += swidth;
+} else {
+throw  new Error (jalview.util.MessageManager.getString ("error.padding_not_yet_implemented"));
+}}}}}return  Clazz_newArray (-1, [alignment, columnselection]);
+} else {
+if (nvismsa.length != 1) {
+throw  new Error (jalview.util.MessageManager.formatMessage ("error.mismatch_between_visible_blocks_to_update_and_number_of_contigs_in_view",  Clazz_newArray (-1, [Integer.$valueOf (nvismsa.length).toString ()])));
+}if (nvismsa[0] != null) {
+return  Clazz_newArray (-1, [nvismsa[0],  new jalview.datamodel.ColumnSelection ()]);
+} else {
+return this.getAlignmentAndColumnSelection (gapCharacter);
+}}}, "~A,~A,~S");
+Clazz_defineMethod (c$, "getVisibleContigs", 
+function () {
+if (this.contigs != null && this.contigs.length > 0) {
+var start = 0;
+var nvis = 0;
+var fwidth = this.width;
+for (var contig = 0; contig < this.contigs.length; contig += 3) {
+if ((this.contigs[contig + 1] - start) > 0) {
+nvis++;
+}fwidth += this.contigs[contig + 2];
+start = this.contigs[contig + 1] + this.contigs[contig + 2];
+}
+if (start < fwidth) {
+nvis++;
+}var viscontigs =  Clazz_newIntArray (nvis * 2, 0);
+nvis = 0;
+start = 0;
+for (var contig = 0; contig < this.contigs.length; contig += 3) {
+if ((this.contigs[contig + 1] - start) > 0) {
+viscontigs[nvis] = start;
+viscontigs[nvis + 1] = this.contigs[contig + 1] - 1;
+nvis += 2;
+}start = this.contigs[contig + 1] + this.contigs[contig + 2];
+}
+if (start < fwidth) {
+viscontigs[nvis] = start;
+viscontigs[nvis + 1] = fwidth;
+nvis += 2;
+}return viscontigs;
+} else {
+return  Clazz_newIntArray (-1, [0, this.width]);
+}});
+Clazz_defineMethod (c$, "getAlignmentOrigin", 
+function () {
+return this.firstCol;
+});
+Clazz_defineMethod (c$, "getVisibleContigMapFor", 
+function (gapMap) {
+var delMap = null;
+var viscontigs = this.getVisibleContigs ();
+var spos = 0;
+var i = 0;
+if (viscontigs != null) {
+delMap =  Clazz_newIntArray (gapMap.length, 0);
+for (var contig = 0; contig < viscontigs.length; contig += 2) {
+while (spos < gapMap.length && gapMap[spos] < viscontigs[contig]) {
+spos++;
+}
+while (spos < gapMap.length && gapMap[spos] <= viscontigs[contig + 1]) {
+delMap[i++] = spos++;
+}
+}
+var tmap =  Clazz_newIntArray (i, 0);
+System.arraycopy (delMap, 0, tmap, 0, i);
+delMap = tmap;
+}return delMap;
+}, "~A");
+Clazz_defineMethod (c$, "getEditedSequences", 
+function (gc, $delete) {
+var msf = this.getSequences ();
+var aln =  new Array (msf.length);
+for (var i = 0, j = msf.length; i < j; i++) {
+aln[i] = msf[i].getSeq (gc);
+}
+if ($delete) {
+var sqs = this.getSequenceStrings (gc);
+for (var i = 0; i < sqs.length; i++) {
+aln[i].setSequence (sqs[i]);
+sqs[i] = null;
+}
+}return aln;
+}, "~S,~B");
+c$.summariseAlignmentView = Clazz_defineMethod (c$, "summariseAlignmentView", 
+function (view, os) {
+os.print ("View has " + view.sequences.length + " of which ");
+if (view.selected == null) {
+os.print ("None");
+} else {
+os.print (" " + view.selected.size ());
+}os.println (" are selected.");
+os.print ("View is " + view.getWidth () + " columns wide");
+var viswid = 0;
+var contigs = view.getContigs ();
+if (contigs != null) {
+viswid = view.width;
+for (var i = 0; i < contigs.length; i += 3) {
+viswid += contigs[i + 2];
+}
+os.println ("with " + viswid + " visible columns spread over " + Clazz_doubleToInt (contigs.length / 3) + " regions.");
+} else {
+viswid = view.width;
+os.println (".");
+}if (view.scGroups != null) {
+os.println ("There are " + view.scGroups.size () + " groups defined on the view.");
+for (var g = 0; g < view.scGroups.size (); g++) {
+var sgr = view.scGroups.get (g);
+os.println ("Group " + g + ": Name = " + sgr.sg.getName () + " Contains " + sgr.seqs.size () + " Seqs.");
+os.println ("This group runs from " + sgr.sg.getStartRes () + " to " + sgr.sg.getEndRes ());
+for (var s = 0; s < sgr.seqs.size (); s++) {
+if (!(sgr.seqs.elementAt (s)).isMemberOf (sgr)) {
+os.println ("** WARNING: sequence " + (sgr.seqs.elementAt (s)).toString () + " is not marked as member of group.");
+}}
+}
+var visal = view.getVisibleAlignment ('-');
+if (visal != null) {
+os.println ("Vis. alignment is " + visal.getWidth () + " wide and has " + visal.getHeight () + " seqs.");
+if (visal.getGroups () != null && visal.getGroups ().size () > 0) {
+var i = 1;
+for (var sg, $sg = visal.getGroups ().iterator (); $sg.hasNext () && ((sg = $sg.next ()) || true);) {
+os.println ("Group " + (i++) + " begins at column " + sg.getStartRes () + " and ends at " + sg.getEndRes ());
+}
+}}}}, "jalview.datamodel.AlignmentView,java.io.PrintStream");
+c$.testSelectionViews = Clazz_defineMethod (c$, "testSelectionViews", 
+function (alignment, csel, selection) {
+System.out.println ("Testing standard view creation:\n");
+var view = null;
+try {
+System.out.println ("View with no hidden columns, no limit to selection, no groups to be collected:");
+view =  new jalview.datamodel.AlignmentView (alignment, csel, selection, false, false, false);
+jalview.datamodel.AlignmentView.summariseAlignmentView (view, System.out);
+} catch (e) {
+if (Clazz_exceptionOf (e, Exception)) {
+e.printStackTrace ();
+System.err.println ("Failed to generate alignment with selection but no groups marked.");
+} else {
+throw e;
+}
+}
+try {
+System.out.println ("View with no hidden columns, no limit to selection, and all groups to be collected:");
+view =  new jalview.datamodel.AlignmentView (alignment, csel, selection, false, false, true);
+jalview.datamodel.AlignmentView.summariseAlignmentView (view, System.out);
+} catch (e) {
+if (Clazz_exceptionOf (e, Exception)) {
+e.printStackTrace ();
+System.err.println ("Failed to generate alignment with selection marked but no groups marked.");
+} else {
+throw e;
+}
+}
+try {
+System.out.println ("View with no hidden columns, limited to selection and no groups to be collected:");
+view =  new jalview.datamodel.AlignmentView (alignment, csel, selection, false, true, false);
+jalview.datamodel.AlignmentView.summariseAlignmentView (view, System.out);
+} catch (e) {
+if (Clazz_exceptionOf (e, Exception)) {
+e.printStackTrace ();
+System.err.println ("Failed to generate alignment with selection restricted but no groups marked.");
+} else {
+throw e;
+}
+}
+try {
+System.out.println ("View with no hidden columns, limited to selection, and all groups to be collected:");
+view =  new jalview.datamodel.AlignmentView (alignment, csel, selection, false, true, true);
+jalview.datamodel.AlignmentView.summariseAlignmentView (view, System.out);
+} catch (e) {
+if (Clazz_exceptionOf (e, Exception)) {
+e.printStackTrace ();
+System.err.println ("Failed to generate alignment with selection restricted and groups marked.");
+} else {
+throw e;
+}
+}
+try {
+System.out.println ("View *with* hidden columns, no limit to selection, no groups to be collected:");
+view =  new jalview.datamodel.AlignmentView (alignment, csel, selection, true, false, false);
+jalview.datamodel.AlignmentView.summariseAlignmentView (view, System.out);
+} catch (e) {
+if (Clazz_exceptionOf (e, Exception)) {
+e.printStackTrace ();
+System.err.println ("Failed to generate alignment with selection but no groups marked.");
+} else {
+throw e;
+}
+}
+try {
+System.out.println ("View *with* hidden columns, no limit to selection, and all groups to be collected:");
+view =  new jalview.datamodel.AlignmentView (alignment, csel, selection, true, false, true);
+jalview.datamodel.AlignmentView.summariseAlignmentView (view, System.out);
+} catch (e) {
+if (Clazz_exceptionOf (e, Exception)) {
+e.printStackTrace ();
+System.err.println ("Failed to generate alignment with selection marked but no groups marked.");
+} else {
+throw e;
+}
+}
+try {
+System.out.println ("View *with* hidden columns, limited to selection and no groups to be collected:");
+view =  new jalview.datamodel.AlignmentView (alignment, csel, selection, true, true, false);
+jalview.datamodel.AlignmentView.summariseAlignmentView (view, System.out);
+} catch (e) {
+if (Clazz_exceptionOf (e, Exception)) {
+e.printStackTrace ();
+System.err.println ("Failed to generate alignment with selection restricted but no groups marked.");
+} else {
+throw e;
+}
+}
+try {
+System.out.println ("View *with* hidden columns, limited to selection, and all groups to be collected:");
+view =  new jalview.datamodel.AlignmentView (alignment, csel, selection, true, true, true);
+jalview.datamodel.AlignmentView.summariseAlignmentView (view, System.out);
+} catch (e) {
+if (Clazz_exceptionOf (e, Exception)) {
+e.printStackTrace ();
+System.err.println ("Failed to generate alignment with selection restricted and groups marked.");
+} else {
+throw e;
+}
+}
+}, "jalview.datamodel.AlignmentI,jalview.datamodel.ColumnSelection,jalview.datamodel.SequenceGroup");
+c$.$AlignmentView$ScGroup$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_decorateAsClass (function () {
+Clazz_prepareCallback (this, arguments);
+this.seqs = null;
+this.sg = null;
+Clazz_instantialize (this, arguments);
+}, jalview.datamodel.AlignmentView, "ScGroup");
+Clazz_makeConstructor (c$, 
+function () {
+this.seqs =  new java.util.Vector ();
+});
+c$ = Clazz_p0p ();
+};
+});
+Clazz_declarePackage ("jalview.schemes");
+Clazz_load (["jalview.schemes.ResidueColourScheme"], "jalview.schemes.Blosum62ColourScheme", ["jalview.schemes.ResidueProperties", "jalview.util.Comparison", "java.awt.Color"], function () {
+c$ = Clazz_declareType (jalview.schemes, "Blosum62ColourScheme", jalview.schemes.ResidueColourScheme);
+Clazz_overrideMethod (c$, "findColourSeq", 
+function (res, j, seq) {
+if ('a' <= res && res <= 'z') {
+res = String.fromCharCode (res.charCodeAt (0) - (32));
+}if (this.consensus == null || j >= this.consensus.length || this.consensus[j] == null || (this.threshold != 0 && !this.aboveThreshold (res, j))) {
+return java.awt.Color.white;
+}var currentColour;
+if (!jalview.util.Comparison.isGap (res)) {
+var max = this.consensus[j].get ("R");
+if (max.indexOf (res) > -1) {
+currentColour =  new java.awt.Color (154, 154, 255);
+} else {
+var c = 0;
+var max_aa = 0;
+var n = max.length;
+do {
+c += jalview.schemes.ResidueProperties.getBLOSUM62 (max.charAt (max_aa), res);
+} while (++max_aa < n);
+if (c > 0) {
+currentColour =  new java.awt.Color (204, 204, 255);
+} else {
+currentColour = java.awt.Color.white;
+}}if (this.conservationColouring) {
+currentColour = this.applyConservation (currentColour, j);
+}} else {
+return java.awt.Color.white;
+}return currentColour;
+}, "~S,~N,jalview.datamodel.SequenceI");
+Clazz_defineMethod (c$, "applyTo", 
+function (sg, hiddenRepSequences) {
+var newcs = Clazz_superCall (this, jalview.schemes.Blosum62ColourScheme, "applyTo", [sg, hiddenRepSequences]);
+return newcs;
+}, "jalview.datamodel.AnnotatedCollectionI,java.util.Map");
+});
+Clazz_declarePackage ("jalview.schemes");
+Clazz_load (["jalview.schemes.ColourSchemeI"], "jalview.schemes.ResidueColourScheme", ["jalview.util.Comparison", "$.MessageManager", "java.awt.Color", "java.lang.Error"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.symbolIndex = null;
+this.conservationColouring = false;
+this.colors = null;
+this.threshold = 0;
+this.ignoreGaps = "G";
+this.consensus = null;
+this.conservation = null;
+this.conservationLength = 0;
+this.inc = 30;
+Clazz_instantialize (this, arguments);
+}, jalview.schemes, "ResidueColourScheme", null, jalview.schemes.ColourSchemeI);
+Clazz_makeConstructor (c$, 
+function (aaOrnaIndex, colours, threshold) {
+this.symbolIndex = aaOrnaIndex;
+this.colors = colours;
+this.threshold = threshold;
+}, "~A,~A,~N");
+Clazz_makeConstructor (c$, 
+function (aaOrNaIndex) {
+this.symbolIndex = aaOrNaIndex;
+}, "~A");
+Clazz_makeConstructor (c$, 
+function () {
+this.symbolIndex = null;
+});
+Clazz_overrideMethod (c$, "findColour", 
+function (c) {
+return this.colors == null ? java.awt.Color.white : this.colors[this.symbolIndex[c.charCodeAt (0)]];
+}, "~S");
+Clazz_overrideMethod (c$, "findColourSeq", 
+function (c, j, seq) {
+var currentColour;
+if (this.colors != null && this.symbolIndex != null && (this.threshold == 0) || this.aboveThreshold (c, j)) {
+currentColour = this.colors[this.symbolIndex[c.charCodeAt (0)]];
+} else {
+currentColour = java.awt.Color.white;
+}if (this.conservationColouring) {
+currentColour = this.applyConservation (currentColour, j);
+}return currentColour;
+}, "~S,~N,jalview.datamodel.SequenceI");
+Clazz_overrideMethod (c$, "getThreshold", 
+function () {
+return this.threshold;
+});
+Clazz_overrideMethod (c$, "setThreshold", 
+function (ct, ignoreGaps) {
+this.threshold = ct;
+if (ignoreGaps) {
+this.ignoreGaps = "N";
+} else {
+this.ignoreGaps = "G";
+}}, "~N,~B");
+Clazz_defineMethod (c$, "aboveThreshold", 
+function (c, j) {
+if ('a' <= c && c <= 'z') {
+c = String.fromCharCode (c.charCodeAt (0) - (32));
+}if (this.consensus == null || this.consensus.length < j || this.consensus[j] == null) {
+return false;
+}if (((this.consensus[j].get ("C")).intValue () != -1) && this.consensus[j].contains (String.valueOf (c))) {
+if ((this.consensus[j].get (this.ignoreGaps)).floatValue () >= this.threshold) {
+return true;
+}}return false;
+}, "~S,~N");
+Clazz_overrideMethod (c$, "conservationApplied", 
+function () {
+return this.conservationColouring;
+});
+Clazz_overrideMethod (c$, "setConservationApplied", 
+function (conservationApplied) {
+this.conservationColouring = conservationApplied;
+}, "~B");
+Clazz_overrideMethod (c$, "setConservationInc", 
+function (i) {
+this.inc = i;
+}, "~N");
+Clazz_overrideMethod (c$, "getConservationInc", 
+function () {
+return this.inc;
+});
+Clazz_overrideMethod (c$, "setConsensus", 
+function (consensus) {
+if (consensus == null) {
+return;
+}this.consensus = consensus;
+}, "~A");
+Clazz_overrideMethod (c$, "setConservation", 
+function (cons) {
+if (cons == null) {
+this.conservationColouring = false;
+this.conservation = null;
+} else {
+this.conservationColouring = true;
+var i;
+var iSize = cons.getConsSequence ().getLength ();
+this.conservation =  Clazz_newCharArray (iSize, '\0');
+for (i = 0; i < iSize; i++) {
+this.conservation[i] = cons.getConsSequence ().getCharAt (i);
+}
+this.conservationLength = this.conservation.length;
+}}, "jalview.analysis.Conservation");
+Clazz_defineMethod (c$, "applyConservation", 
+function (currentColour, i) {
+if ((this.conservationLength > i) && (this.conservation[i] != '*') && (this.conservation[i] != '+')) {
+if (jalview.util.Comparison.isGap (this.conservation[i])) {
+currentColour = java.awt.Color.white;
+} else {
+var t = 11 - ((this.conservation[i]).charCodeAt (0) - 48);
+if (t == 0) {
+return java.awt.Color.white;
+}var red = currentColour.getRed ();
+var green = currentColour.getGreen ();
+var blue = currentColour.getBlue ();
+var dr = 255 - red;
+var dg = 255 - green;
+var db = 255 - blue;
+dr *= t / 10;
+dg *= t / 10;
+db *= t / 10;
+red += (this.inc / 20) * dr;
+green += (this.inc / 20) * dg;
+blue += (this.inc / 20) * db;
+if (red > 255 || green > 255 || blue > 255) {
+currentColour = java.awt.Color.white;
+} else {
+currentColour =  new java.awt.Color (red, green, blue);
+}}}return currentColour;
+}, "java.awt.Color,~N");
+Clazz_overrideMethod (c$, "alignmentChanged", 
+function (alignment, hiddenReps) {
+}, "jalview.datamodel.AnnotatedCollectionI,java.util.Map");
+Clazz_overrideMethod (c$, "applyTo", 
+function (sg, hiddenRepSequences) {
+try {
+return this.getClass ().newInstance ();
+} catch (q) {
+if (Clazz_exceptionOf (q, Exception)) {
+throw  new Error (jalview.util.MessageManager.formatMessage ("error.implementation_error_cannot_duplicate_colour_scheme",  Clazz_newArray (-1, [this.getClass ().getName ()])), q);
+} else {
+throw q;
+}
+}
+}, "jalview.datamodel.AnnotatedCollectionI,java.util.Map");
+});
+Clazz_declarePackage ("jalview.schemes");
+Clazz_declareInterface (jalview.schemes, "ColourSchemeI");
+Clazz_declarePackage ("jalview.schemes");
+Clazz_load (["jalview.schemes.ResidueColourScheme"], "jalview.schemes.PIDColourScheme", ["jalview.schemes.ResidueProperties", "jalview.util.Comparison", "java.awt.Color"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.pidColours = null;
+this.thresholds = null;
+this.group = null;
+Clazz_instantialize (this, arguments);
+}, jalview.schemes, "PIDColourScheme", jalview.schemes.ResidueColourScheme);
+Clazz_makeConstructor (c$, 
+function () {
+Clazz_superConstructor (this, jalview.schemes.PIDColourScheme, []);
+this.pidColours = jalview.schemes.ResidueProperties.pidColours;
+this.thresholds = jalview.schemes.ResidueProperties.pidThresholds;
+});
+Clazz_overrideMethod (c$, "findColourSeq", 
+function (c, j, seq) {
+if ('a' <= c && c <= 'z') {
+c = String.fromCharCode (c.charCodeAt (0) - (32));
+}if (this.consensus == null || j >= this.consensus.length || this.consensus[j] == null) {
+return java.awt.Color.white;
+}if ((this.threshold != 0) && !this.aboveThreshold (c, j)) {
+return java.awt.Color.white;
+}var currentColour = java.awt.Color.white;
+var sc = 0;
+if (this.consensus.length <= j) {
+return java.awt.Color.white;
+}if ((Integer.parseInt (this.consensus[j].get ("C").toString ()) != -1) && this.consensus[j].contains (String.valueOf (c))) {
+sc = (this.consensus[j].get (this.ignoreGaps)).floatValue ();
+if (!jalview.util.Comparison.isGap (c)) {
+for (var i = 0; i < this.thresholds.length; i++) {
+if (sc > this.thresholds[i]) {
+currentColour = this.pidColours[i];
+break;
+}}
+}}if (this.conservationColouring) {
+currentColour = this.applyConservation (currentColour, j);
+}return currentColour;
+}, "~S,~N,jalview.datamodel.SequenceI");
+});
+Clazz_declarePackage ("jalview.workers");
+Clazz_load (["jalview.workers.ConsensusThread"], "jalview.workers.ComplementConsensusThread", ["jalview.analysis.AAFrequency"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.mappings = null;
+Clazz_instantialize (this, arguments);
+}, jalview.workers, "ComplementConsensusThread", jalview.workers.ConsensusThread);
+Clazz_overrideMethod (c$, "getNewWorker", 
+function () {
+return  new jalview.workers.ComplementConsensusThread (this.alignViewport, this.ap);
+});
+Clazz_overrideMethod (c$, "getConsensusAnnotation", 
+function () {
+return this.alignViewport.getComplementConsensusAnnotation ();
+});
+Clazz_overrideMethod (c$, "getViewportConsensus", 
+function () {
+return this.alignViewport.getComplementConsensusHash ();
+});
+Clazz_defineMethod (c$, "initializeCalc", 
+function () {
+this.mappings = this.alignment.getCodonFrames ();
+return (this.mappings != null && !this.mappings.isEmpty () && Clazz_superCall (this, jalview.workers.ComplementConsensusThread, "initializeCalc", []));
+});
+Clazz_overrideMethod (c$, "computeConsensus", 
+function () {
+for (var i = 0; i < 3; i++) {
+try {
+jalview.analysis.AAFrequency.calculateCdna (this.alignment, this.mappings, this.hconsensus, this.iFirst, this.iLast);
+break;
+} catch (e) {
+if (Clazz_exceptionOf (e, java.util.ConcurrentModificationException)) {
+} else {
+throw e;
+}
+}
+}
+});
+Clazz_overrideMethod (c$, "finalizeCalc", 
+function () {
+this.alignViewport.setComplementConsensusHash (this.hconsensus);
+});
+Clazz_overrideMethod (c$, "deriveConsensus", 
+function (consensusAnnotation, consensusData) {
+jalview.analysis.AAFrequency.completeCdnaConsensus (consensusAnnotation, consensusData, this.alignViewport.isShowSequenceLogo (), this.getSequences ().length);
+}, "jalview.datamodel.AlignmentAnnotation,~A");
+});
+Clazz_declarePackage ("jalview.workers");
+Clazz_load (["jalview.api.AlignCalcWorkerI", "jalview.workers.AlignCalcWorker"], "jalview.workers.ConsensusThread", ["jalview.analysis.AAFrequency"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.hconsensus = null;
+this.aseqs = null;
+Clazz_instantialize (this, arguments);
+}, jalview.workers, "ConsensusThread", jalview.workers.AlignCalcWorker, jalview.api.AlignCalcWorkerI);
+Clazz_overrideMethod (c$, "getNewWorker", 
+function () {
+return  new jalview.workers.ConsensusThread (this.alignViewport, this.ap);
+});
+Clazz_overrideMethod (c$, "run1", 
+function (state) {
+while (!Thread.interrupted ()) {
+if (this.alignViewport.isClosed ()) {
+this.abortAndDestroy ();
+return;
+}try {
+switch (state) {
+case 0:
+if (this.calcMan.isPending (this)) return;
+this.calcMan.notifyStart (this);
+var consensus = this.getConsensusAnnotation ();
+if (consensus == null || this.calcMan.isPending (this)) {
+this.calcMan.workerComplete (this);
+return;
+}state = 3;
+break;
+case 3:
+while (!this.calcMan.notifyWorking (this)) {
+if (this.ap != null) {
+this.ap.paintAlignment (false);
+}try {
+if (this.sleepAndReturn (200, state)) return;
+} catch (e) {
+if (Clazz_exceptionOf (e, InterruptedException)) {
+state = 2;
+break;
+} else {
+throw e;
+}
+}
+}
+if (this.alignViewport.isClosed ()) {
+this.abortAndDestroy ();
+state = 2;
+break;
+}this.alignment = this.alignViewport.getAlignment ();
+this.aWidth = -1;
+if (this.alignment == null || (this.aWidth = this.alignment.getWidth ()) < 0) {
+state = 2;
+}this.eraseConsensus (this.aWidth);
+state = (this.initializeCalc () ? 4 : 2);
+break;
+case 4:
+this.iFirst = this.iLast;
+this.iLast = Math.min (this.iLast + this.nPer, this.aWidth);
+if (this.iLast == this.iFirst) {
+state = 2;
+} else {
+this.computeConsensus ();
+if (this.sleepAndReturn (0, state)) return;
+}break;
+case 2:
+this.finalizeCalc ();
+this.updateAlignment ();
+this.notifyDone ();
+return;
+}
+} catch (e$$) {
+if (Clazz_exceptionOf (e$$, OutOfMemoryError)) {
+var error = e$$;
+{
+this.calcMan.workerCannotRun (this);
+this.ap.raiseOOMWarning ("calculating consensus", error);
+}
+} else {
+var e = e$$;
+{
+System.out.println ("Error in ConsensusThread: " + e);
+e.printStackTrace ();
+this.calcMan.workerComplete (this);
+}
+}
+}
+}
+}, "~N");
+Clazz_defineMethod (c$, "initializeCalc", 
+function () {
+this.iLast = 0;
+this.hconsensus =  new Array (this.aWidth);
+this.aseqs = this.getSequences ();
+return true;
+});
+Clazz_defineMethod (c$, "computeConsensus", 
+function () {
+this.started = System.currentTimeMillis ();
+jalview.analysis.AAFrequency.calculate (this.aseqs, this.iFirst, this.iLast, this.hconsensus, true);
+if (System.currentTimeMillis () - this.started < 500) this.nPer *= 2;
+});
+Clazz_defineMethod (c$, "finalizeCalc", 
+function () {
+this.alignViewport.setSequenceConsensusHash (this.hconsensus);
+});
+Clazz_defineMethod (c$, "updateAlignment", 
+function () {
+this.setColourSchemeConsensus (this.hconsensus);
+this.updateResultAnnotation (true);
+});
+Clazz_defineMethod (c$, "eraseConsensus", 
+function (aWidth) {
+var consensus = this.getConsensusAnnotation ();
+consensus.annotations =  new Array (aWidth);
+}, "~N");
+Clazz_defineMethod (c$, "getSequences", 
+function () {
+return this.alignViewport.getAlignment ().getSequencesArray ();
+});
+Clazz_defineMethod (c$, "setColourSchemeConsensus", 
+function (hconsensus) {
+var globalColourScheme = this.alignViewport.getGlobalColourScheme ();
+if (globalColourScheme != null) {
+globalColourScheme.setConsensus (hconsensus);
+}}, "~A");
+Clazz_defineMethod (c$, "getConsensusAnnotation", 
+function () {
+return this.alignViewport.getAlignmentConsensusAnnotation ();
+});
+Clazz_overrideMethod (c$, "updateAnnotation", 
+function () {
+this.updateResultAnnotation (false);
+});
+Clazz_defineMethod (c$, "updateResultAnnotation", 
+function (immediate) {
+var consensus = this.getConsensusAnnotation ();
+var hconsensus = this.getViewportConsensus ();
+if (immediate || !this.calcMan.isWorking (this) && consensus != null && hconsensus != null) {
+this.deriveConsensus (consensus, hconsensus);
+}}, "~B");
+Clazz_defineMethod (c$, "deriveConsensus", 
+function (consensusAnnotation, consensusData) {
+var nseq = this.getSequences ().length;
+jalview.analysis.AAFrequency.completeConsensus (consensusAnnotation, consensusData, 0, consensusData.length, this.alignViewport.isIgnoreGapsConsensus (), this.alignViewport.isShowSequenceLogo (), nseq);
+}, "jalview.datamodel.AlignmentAnnotation,~A");
+Clazz_defineMethod (c$, "getViewportConsensus", 
+function () {
+return this.alignViewport.getSequenceConsensusHash ();
+});
+});
+Clazz_declarePackage ("jalview.api");
+Clazz_declareInterface (jalview.api, "AlignCalcWorkerI", Runnable);
+Clazz_declarePackage ("jalview.workers");
+Clazz_load (["jalview.api.AlignCalcWorkerI", "swingjs.JSThread"], "jalview.workers.AlignCalcWorker", null, function () {
+c$ = Clazz_decorateAsClass (function () {
+this.iFirst = 0;
+this.iLast = 0;
+this.nPer = 2;
+this.started = 0;
+this.alignment = null;
+this.aWidth = 0;
+this.alignViewport = null;
+this.calcMan = null;
+this.ap = null;
+this.ourAnnots = null;
+Clazz_instantialize (this, arguments);
+}, jalview.workers, "AlignCalcWorker", swingjs.JSThread, jalview.api.AlignCalcWorkerI);
+Clazz_makeConstructor (c$, 
+function (alignViewport, alignPanel) {
+Clazz_superConstructor (this, jalview.workers.AlignCalcWorker, [null, "AlignCalcWorker"]);
+this.alignViewport = alignViewport;
+this.calcMan = alignViewport.getCalcManager ();
+this.ap = alignPanel;
+}, "jalview.api.AlignViewportI,jalview.api.AlignmentViewPanel");
+Clazz_defineMethod (c$, "abortAndDestroy", 
+function () {
+if (this.calcMan != null) {
+this.calcMan.workerComplete (this);
+}this.alignViewport = null;
+this.calcMan = null;
+this.ap = null;
+});
+Clazz_overrideMethod (c$, "involves", 
+function (i) {
+return this.ourAnnots != null && this.ourAnnots.contains (i);
+}, "jalview.datamodel.AlignmentAnnotation");
+Clazz_overrideMethod (c$, "removeOurAnnotation", 
+function () {
+if (this.ourAnnots != null && this.alignViewport != null) {
+var alignment = this.alignViewport.getAlignment ();
+{
+for (var aa, $aa = this.ourAnnots.iterator (); $aa.hasNext () && ((aa = $aa.next ()) || true);) {
+alignment.deleteAnnotation (aa, true);
+}
+}}});
+Clazz_defineMethod (c$, "notifyDone", 
+function () {
+if (this.ap != null) {
+this.ap.paintAlignment (true);
+}this.calcMan.workerComplete (this);
+});
+Clazz_defineStatics (c$,
+"LOOP_STANDBY", 3,
+"LOOP_CALCULATE", 4,
+"MS_MAX", 500);
+});
+Clazz_declarePackage ("jalview.workers");
+Clazz_load (["jalview.api.AlignCalcWorkerI", "jalview.workers.AlignCalcWorker"], "jalview.workers.ConservationThread", ["jalview.analysis.Conservation", "jalview.schemes.ResidueProperties", "java.util.ArrayList"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.ConsPercGaps = 25;
+this.cons = null;
+this.conservation = null;
+this.quality = null;
+Clazz_instantialize (this, arguments);
+}, jalview.workers, "ConservationThread", jalview.workers.AlignCalcWorker, jalview.api.AlignCalcWorkerI);
+Clazz_overrideMethod (c$, "getNewWorker", 
+function () {
+return  new jalview.workers.ConservationThread (this.alignViewport, this.ap);
+});
+Clazz_makeConstructor (c$, 
+function (alignViewport, alignPanel) {
+Clazz_superConstructor (this, jalview.workers.ConservationThread, [alignViewport, alignPanel]);
+this.ConsPercGaps = alignViewport.getConsPercGaps ();
+}, "jalview.api.AlignViewportI,jalview.api.AlignmentViewPanel");
+Clazz_overrideMethod (c$, "run1", 
+function (state) {
+while (!Thread.interrupted ()) {
+try {
+switch (state) {
+case 0:
+if (this.calcMan.isPending (this)) return;
+this.calcMan.notifyStart (this);
+state = 3;
+break;
+case 3:
+while (!this.calcMan.notifyWorking (this)) {
+if (this.ap != null) {
+this.ap.paintAlignment (false);
+}try {
+if (this.sleepAndReturn (200, state)) return;
+} catch (e) {
+if (Clazz_exceptionOf (e, InterruptedException)) {
+state = 2;
+break;
+} else {
+throw e;
+}
+}
+}
+if (this.alignViewport.isClosed ()) {
+this.abortAndDestroy ();
+state = 2;
+break;
+}var ourAnnot =  new java.util.ArrayList ();
+this.alignment = this.alignViewport.getAlignment ();
+this.conservation = this.alignViewport.getAlignmentConservationAnnotation ();
+this.quality = this.alignViewport.getAlignmentQualityAnnot ();
+ourAnnot.add (this.conservation);
+ourAnnot.add (this.quality);
+this.ourAnnots = ourAnnot;
+this.ConsPercGaps = this.alignViewport.getConsPercGaps ();
+if (this.alignment == null || (this.aWidth = this.alignment.getWidth ()) < 0) {
+this.calcMan.workerComplete (this);
+return;
+}state = 4;
+break;
+case 4:
+this.iFirst = this.iLast;
+this.nPer = this.aWidth + 1;
+this.iLast = Math.min (this.iLast + this.nPer, this.aWidth);
+if (this.iLast == this.iFirst) {
+state = 2;
+} else {
+this.computeConsensus ();
+if (this.sleepAndReturn (0, state)) return;
+}break;
+case 2:
+this.updateResultAnnotation (true);
+this.notifyDone ();
+return;
+}
+} catch (e$$) {
+if (Clazz_exceptionOf (e$$, OutOfMemoryError)) {
+var error = e$$;
+{
+this.calcMan.workerCannotRun (this);
+this.ap.raiseOOMWarning ("calculating conservation", error);
+}
+} else {
+var e = e$$;
+{
+System.out.println ("Error in ConsensusThread: " + e);
+e.printStackTrace ();
+this.calcMan.workerComplete (this);
+}
+}
+}
+}
+}, "~N");
+Clazz_defineMethod (c$, "computeConsensus", 
+ function () {
+this.cons = jalview.analysis.Conservation.calculateConservation ("All", jalview.schemes.ResidueProperties.propHash, 3, this.alignment.getSequences (), 0, this.aWidth - 1, false, this.ConsPercGaps, this.quality != null);
+});
+Clazz_defineMethod (c$, "updateResultAnnotation", 
+ function (b) {
+if (b || !this.calcMan.isWorking (this) && this.cons != null && this.conservation != null && this.quality != null) {
+this.alignViewport.setConservation (this.cons);
+this.cons.completeAnnotations (this.conservation, this.quality, 0, this.aWidth);
+}}, "~B");
+Clazz_overrideMethod (c$, "updateAnnotation", 
+function () {
+this.updateResultAnnotation (false);
+});
+});
+Clazz_declarePackage ("jalview.workers");
+Clazz_load (["jalview.api.AlignCalcWorkerI", "jalview.workers.AlignCalcWorker"], "jalview.workers.StrucConsensusThread", ["jalview.analysis.StructureFrequency"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.rnaStruc = null;
+this.strucConsensus = null;
+this.hStrucConsensus = null;
+this.nseq = -1;
+this.aa = null;
+this.arr = null;
+Clazz_instantialize (this, arguments);
+}, jalview.workers, "StrucConsensusThread", jalview.workers.AlignCalcWorker, jalview.api.AlignCalcWorkerI);
+Clazz_overrideMethod (c$, "getNewWorker", 
+function () {
+return  new jalview.workers.StrucConsensusThread (this.alignViewport, this.ap);
+});
+Clazz_overrideMethod (c$, "run1", 
+function (state) {
+if (this.alignViewport.isClosed ()) {
+this.abortAndDestroy ();
+return;
+}while (!Thread.interrupted ()) {
+try {
+switch (state) {
+case 0:
+if (this.calcMan.isPending (this)) return;
+this.calcMan.notifyStart (this);
+state = 3;
+break;
+case 3:
+while (!this.calcMan.notifyWorking (this)) {
+if (this.ap != null) {
+this.ap.paintAlignment (false);
+}try {
+if (this.sleepAndReturn (200, state)) return;
+} catch (e) {
+if (Clazz_exceptionOf (e, InterruptedException)) {
+state = 2;
+break;
+} else {
+throw e;
+}
+}
+}
+if (this.alignViewport.isClosed ()) {
+this.abortAndDestroy ();
+state = 2;
+break;
+}this.alignment = this.alignViewport.getAlignment ();
+this.aWidth = -1;
+if (this.alignment == null || (this.aWidth = this.alignment.getWidth ()) < 0) {
+state = 2;
+}this.strucConsensus = this.alignViewport.getAlignmentStrucConsensusAnnotation ();
+this.hStrucConsensus = this.alignViewport.getRnaStructureConsensusHash ();
+this.strucConsensus.annotations = null;
+this.strucConsensus.annotations =  new Array (this.aWidth);
+this.hStrucConsensus =  new Array (this.aWidth);
+this.aa = this.alignViewport.getAlignment ().getAlignmentAnnotation ();
+for (var i = 0; i < this.aa.length; i++) {
+if (this.aa[i].getRNAStruc () != null && this.aa[i].isValidStruc ()) {
+this.rnaStruc = this.aa[i];
+break;
+}}
+if (this.rnaStruc == null || !this.rnaStruc.isValidStruc ()) {
+this.calcMan.workerComplete (this);
+return;
+}this.arr = this.alignment.getSequencesArray ();
+this.nseq = this.arr.length;
+state = 4;
+break;
+case 4:
+this.iFirst = this.iLast;
+this.iLast = Math.min (this.iLast + this.nPer, this.aWidth);
+if (this.iLast == this.iFirst) {
+state = 2;
+} else {
+jalview.analysis.StructureFrequency.calculate (this.arr, 0, this.alignment.getWidth (), this.hStrucConsensus, true, this.rnaStruc);
+if (this.sleepAndReturn (0, state)) return;
+}break;
+case 2:
+this.alignViewport.setRnaStructureConsensusHash (this.hStrucConsensus);
+this.updateResultAnnotation (true);
+if (this.alignViewport.getGlobalColourScheme () != null) {
+this.alignViewport.getGlobalColourScheme ().setConsensus (this.hStrucConsensus);
+}this.notifyDone ();
+return;
+}
+} catch (e$$) {
+if (Clazz_exceptionOf (e$$, OutOfMemoryError)) {
+var error = e$$;
+{
+this.calcMan.workerCannotRun (this);
+this.ap.raiseOOMWarning ("calculating RNA structure consensus", error);
+}
+} else {
+var e = e$$;
+{
+System.out.println ("Error in ConsensusThread: " + e);
+e.printStackTrace ();
+this.calcMan.workerComplete (this);
+}
+}
+}
+}
+}, "~N");
+Clazz_overrideMethod (c$, "updateAnnotation", 
+function () {
+this.updateResultAnnotation (false);
+});
+Clazz_defineMethod (c$, "updateResultAnnotation", 
+function (immediate) {
+if (immediate || !this.calcMan.isWorking (this) && this.strucConsensus != null && this.hStrucConsensus != null) {
+jalview.analysis.StructureFrequency.completeConsensus (this.strucConsensus, this.hStrucConsensus, 0, this.hStrucConsensus.length, this.alignViewport.isIgnoreGapsConsensus (), this.alignViewport.isShowSequenceLogo (), this.nseq);
+}}, "~B");
+});
+Clazz_declarePackage ("jalview.analysis");
+Clazz_load (null, "jalview.analysis.StructureFrequency", ["jalview.datamodel.Annotation", "jalview.util.Format", "$.QuickSort", "java.lang.Float", "java.util.Hashtable", "JU.AU"], function () {
+c$ = Clazz_declareType (jalview.analysis, "StructureFrequency");
+c$.findPair = Clazz_defineMethod (c$, "findPair", 
+function (pairs, indice) {
+for (var i = 0; i < pairs.length; i++) {
+if (pairs[i].getBegin () == indice) {
+return pairs[i].getEnd ();
+}}
+return -1;
+}, "~A,~N");
+c$.calculate = Clazz_defineMethod (c$, "calculate", 
+function (sequences, start, end, result, profile, rnaStruc) {
+var residueHash;
+var maxResidue;
+var struc = rnaStruc.getRNAStruc ().toCharArray ();
+var rna = rnaStruc._rnasecstr;
+var c;
+var s;
+var cEnd;
+var count = 0;
+var nonGap = 0;
+var i;
+var bpEnd = -1;
+var j;
+var jSize = sequences.length;
+var values;
+var pairs;
+var percentage;
+var wooble = true;
+for (i = start; i < end; i++) {
+residueHash =  new java.util.Hashtable ();
+maxResidue = "-";
+values =  Clazz_newIntArray (255, 0);
+pairs =  Clazz_newIntArray (255, 255, 0);
+bpEnd = -1;
+if (i < struc.length) {
+s = struc[i];
+} else {
+s = '-';
+}if (s == '.' || s == ' ') {
+s = '-';
+}if (s != '(' && s != '[') {
+if (s == '-') {
+values['-'.charCodeAt (0)]++;
+}} else {
+bpEnd = jalview.analysis.StructureFrequency.findPair (rna, i);
+if (bpEnd > -1) {
+for (j = 0; j < jSize; j++) {
+if (sequences[j] == null) {
+System.err.println ("WARNING: Consensus skipping null sequence - possible race condition.");
+continue;
+}c = sequences[j].getCharAt (i);
+if (c == '.' || c == ' ') {
+c = '-';
+}if (c == '-') {
+values['-'.charCodeAt (0)]++;
+continue;
+}cEnd = sequences[j].getCharAt (bpEnd);
+if (jalview.analysis.StructureFrequency.checkBpType (c, cEnd) == true) {
+values['('.charCodeAt (0)]++;
+maxResidue = "(";
+wooble = true;
+}if (jalview.analysis.StructureFrequency.checkBpType (c, cEnd) == false) {
+wooble = false;
+values['['.charCodeAt (0)]++;
+maxResidue = "[";
+}pairs[c.charCodeAt (0)][cEnd.charCodeAt (0)]++;
+}
+}}if (profile) {
+residueHash.put ("P",  Clazz_newArray (-1, [values,  Clazz_newIntArray (-1, [jSize, (jSize - values['-'.charCodeAt (0)])])]));
+residueHash.put ("B", pairs);
+}if (wooble == true) {
+count = values['('.charCodeAt (0)];
+}if (wooble == false) {
+count = values['['.charCodeAt (0)];
+}residueHash.put ("C",  new Integer (count));
+residueHash.put ("R", maxResidue);
+percentage = (count * 100) / jSize;
+residueHash.put ("G",  new Float (percentage));
+if (result[i] == null) {
+result[i] = residueHash;
+}if (bpEnd > 0) {
+values[')'.charCodeAt (0)] = values['('.charCodeAt (0)];
+values[']'.charCodeAt (0)] = values['['.charCodeAt (0)];
+values['('.charCodeAt (0)] = 0;
+values['['.charCodeAt (0)] = 0;
+residueHash =  new java.util.Hashtable ();
+if (wooble == true) {
+maxResidue = ")";
+}if (wooble == false) {
+maxResidue = "]";
+}if (profile) {
+residueHash.put ("P",  Clazz_newArray (-1, [values,  Clazz_newIntArray (-1, [jSize, (jSize - values['-'.charCodeAt (0)])])]));
+residueHash.put ("B", pairs);
+}residueHash.put ("C",  new Integer (count));
+residueHash.put ("R", maxResidue);
+percentage = (count * 100) / jSize;
+residueHash.put ("G",  new Float (percentage));
+result[bpEnd] = residueHash;
+}}
+}, "~A,~N,~N,~A,~B,jalview.datamodel.AlignmentAnnotation");
+c$.checkBpType = Clazz_defineMethod (c$, "checkBpType", 
+function (up, down) {
+if (up > 'Z') {
+up = String.fromCharCode (up.charCodeAt (0) - 32);
+}if (down > 'Z') {
+down = String.fromCharCode (down.charCodeAt (0) - 32);
+}switch (up) {
+case 'A':
+switch (down) {
+case 'T':
+return true;
+case 'U':
+return true;
+}
+break;
+case 'C':
+switch (down) {
+case 'G':
+return true;
+}
+break;
+case 'T':
+switch (down) {
+case 'A':
+return true;
+case 'G':
+return true;
+}
+break;
+case 'G':
+switch (down) {
+case 'C':
+return true;
+case 'T':
+return true;
+case 'U':
+return true;
+}
+break;
+case 'U':
+switch (down) {
+case 'A':
+return true;
+case 'G':
+return true;
+}
+break;
+}
+return false;
+}, "~S,~S");
+c$.completeConsensus = Clazz_defineMethod (c$, "completeConsensus", 
+function (consensus, hconsensus, iStart, width, ignoreGapsInConsensusCalculation, includeAllConsSymbols, nseq) {
+var tval;
+var value;
+if (consensus == null || consensus.annotations == null || consensus.annotations.length < width) {
+return;
+}var fmtstr = "%3.1f";
+var precision = 2;
+while (nseq > 100) {
+precision++;
+nseq /= 10;
+}
+if (precision > 2) {
+fmtstr = "%" + (2 + precision) + "." + precision + "f";
+}var fmt =  new jalview.util.Format (fmtstr);
+for (var i = iStart; i < width; i++) {
+var hci;
+if (i >= hconsensus.length || ((hci = hconsensus[i]) == null)) {
+consensus.annotations[i] = null;
+continue;
+}value = 0;
+var fv;
+if (ignoreGapsInConsensusCalculation) {
+fv = hci.get ("N");
+} else {
+fv = hci.get ("G");
+}if (fv == null) {
+consensus.annotations[i] = null;
+continue;
+}value = fv.floatValue ();
+var maxRes = hci.get ("R").toString ();
+var mouseOver = hci.get ("R") + " ";
+if (maxRes.length > 1) {
+mouseOver = "[" + maxRes + "] ";
+maxRes = "+";
+}var profile = hci.get ("P");
+var pairs = hci.get ("B");
+if (pairs != null && includeAllConsSymbols) {
+mouseOver = "";
+var ca = JU.AU.newInt2 (625);
+var vl =  Clazz_newFloatArray (625, 0);
+var x = 0;
+for (var c = 65; c < 90; c++) {
+for (var d = 65; d < 90; d++) {
+ca[x] =  Clazz_newIntArray (-1, [c, d]);
+vl[x] = pairs[c][d];
+x++;
+}
+}
+jalview.util.QuickSort.sortFloatObject (vl, ca);
+var p = 0;
+var divisor = profile[1][ignoreGapsInConsensusCalculation ? 1 : 0];
+for (var c = 624; c > 0; c--) {
+if (vl[c] > 0) {
+tval = (vl[c] * 100 / divisor);
+mouseOver += ((p == 0) ? "" : "; ") + String.fromCharCode (ca[c][0]) + String.fromCharCode (ca[c][1]) + " " + fmt.formDouble (tval) + "%";
+p++;
+}}
+} else {
+mouseOver += (fmt.formDouble (value) + "%");
+}consensus.annotations[i] =  new jalview.datamodel.Annotation (maxRes, mouseOver, ' ', value);
+}
+}, "jalview.datamodel.AlignmentAnnotation,~A,~N,~N,~B,~B,~N");
+c$.extractProfile = Clazz_defineMethod (c$, "extractProfile", 
+function (hconsensus, ignoreGapsInConsensusCalculation) {
+var rtnval =  Clazz_newIntArray (74, 0);
+var profile = hconsensus.get ("P");
+var pairs = hconsensus.get ("B");
+if (profile == null) {
+return null;
+}var ca = JU.AU.newInt2 (625);
+var vl =  Clazz_newFloatArray (625, 0);
+var x = 0;
+for (var c = 65; c < 90; c++) {
+for (var d = 65; d < 90; d++) {
+ca[x] =  Clazz_newIntArray (-1, [c, d]);
+vl[x] = pairs[c][d];
+x++;
+}
+}
+jalview.util.QuickSort.sortFloatObject (vl, ca);
+var valuesCount = 0;
+rtnval[1] = 0;
+var offset = 2;
+var divisor = profile[1][ignoreGapsInConsensusCalculation ? 1 : 0];
+for (var c = 624; c > 0; c--) {
+if (vl[c] > 0) {
+rtnval[offset++] = ca[c][0];
+rtnval[offset++] = ca[c][1];
+rtnval[offset] = Clazz_floatToInt (vl[c] * 100 / divisor);
+rtnval[1] += rtnval[offset++];
+valuesCount++;
+}}
+rtnval[0] = valuesCount;
+var result =  Clazz_newIntArray (rtnval.length + 1, 0);
+result[0] = 1;
+System.arraycopy (rtnval, 0, result, 1, rtnval.length);
+return result;
+}, "java.util.Hashtable,~B");
+Clazz_defineStatics (c$,
+"STRUCTURE_PROFILE_LENGTH", 74,
+"MAXCOUNT", "C",
+"MAXRESIDUE", "R",
+"PID_GAPS", "G",
+"PID_NOGAPS", "N",
+"PROFILE", "P",
+"PAIRPROFILE", "B");
+});
+Clazz_declarePackage ("jalview.schemes");
+Clazz_load (null, "jalview.schemes.ColourSchemeProperty", ["jalview.schemes.Blosum62ColourScheme", "$.BuriedColourScheme", "$.ClustalxColourScheme", "$.HelixColourScheme", "$.HydrophobicColourScheme", "$.NucleotideColourScheme", "$.PIDColourScheme", "$.PurinePyrimidineColourScheme", "$.RNAHelicesColour", "$.StrandColourScheme", "$.TCoffeeColourScheme", "$.TaylorColourScheme", "$.TurnColourScheme", "$.UserColourScheme", "$.ZappoColourScheme", "jalview.util.ColorUtils", "java.awt.Color"], function () {
+c$ = Clazz_declareType (jalview.schemes, "ColourSchemeProperty");
+c$.getColourIndexFromName = Clazz_defineMethod (c$, "getColourIndexFromName", 
+function (name) {
+var ret = -1;
+if (name.equalsIgnoreCase ("Clustal")) {
+ret = 2;
+} else if (name.equalsIgnoreCase ("Blosum62")) {
+ret = 3;
+} else if (name.equalsIgnoreCase ("% Identity")) {
+ret = 4;
+} else if (name.equalsIgnoreCase ("Zappo")) {
+ret = 5;
+} else if (name.equalsIgnoreCase ("Taylor")) {
+ret = 6;
+} else if (name.equalsIgnoreCase ("Hydrophobic")) {
+ret = 7;
+} else if (name.equalsIgnoreCase ("Helix Propensity")) {
+ret = 8;
+} else if (name.equalsIgnoreCase ("Strand Propensity")) {
+ret = 9;
+} else if (name.equalsIgnoreCase ("Turn Propensity")) {
+ret = 10;
+} else if (name.equalsIgnoreCase ("Buried Index")) {
+ret = 11;
+} else if (name.equalsIgnoreCase ("Nucleotide")) {
+ret = 12;
+} else if (name.equalsIgnoreCase ("T-Coffee Scores")) {
+ret = 15;
+} else if (name.equalsIgnoreCase ("User Defined")) {
+ret = 0;
+} else if (name.equalsIgnoreCase ("None")) {
+ret = 1;
+} else if (name.equalsIgnoreCase ("Purine/Pyrimidine")) {
+ret = 13;
+} else if (name.equalsIgnoreCase ("RNA Interaction type")) {
+ret = 17;
+} else if (name.equalsIgnoreCase ("RNA Helices")) {
+ret = 16;
+}return ret;
+}, "~S");
+c$.getColourName = Clazz_defineMethod (c$, "getColourName", 
+function (cs) {
+var index = 1;
+if (Clazz_instanceOf (cs, jalview.schemes.ClustalxColourScheme)) {
+index = 2;
+} else if (Clazz_instanceOf (cs, jalview.schemes.Blosum62ColourScheme)) {
+index = 3;
+} else if (Clazz_instanceOf (cs, jalview.schemes.PIDColourScheme)) {
+index = 4;
+} else if (Clazz_instanceOf (cs, jalview.schemes.ZappoColourScheme)) {
+index = 5;
+} else if (Clazz_instanceOf (cs, jalview.schemes.TaylorColourScheme)) {
+index = 6;
+} else if (Clazz_instanceOf (cs, jalview.schemes.HydrophobicColourScheme)) {
+index = 7;
+} else if (Clazz_instanceOf (cs, jalview.schemes.HelixColourScheme)) {
+index = 8;
+} else if (Clazz_instanceOf (cs, jalview.schemes.StrandColourScheme)) {
+index = 9;
+} else if (Clazz_instanceOf (cs, jalview.schemes.TurnColourScheme)) {
+index = 10;
+} else if (Clazz_instanceOf (cs, jalview.schemes.BuriedColourScheme)) {
+index = 11;
+} else if (Clazz_instanceOf (cs, jalview.schemes.NucleotideColourScheme)) {
+index = 12;
+} else if (Clazz_instanceOf (cs, jalview.schemes.PurinePyrimidineColourScheme)) {
+index = 13;
+} else if (Clazz_instanceOf (cs, jalview.schemes.TCoffeeColourScheme)) {
+index = 15;
+} else if (Clazz_instanceOf (cs, jalview.schemes.RNAHelicesColour)) {
+index = 16;
+} else if (Clazz_instanceOf (cs, jalview.schemes.UserColourScheme)) {
+if (((cs).getName () != null) && ((cs).getName ().length > 0)) {
+return (cs).getName ();
+}index = 0;
+}return jalview.schemes.ColourSchemeProperty.getColourName (index);
+}, "jalview.schemes.ColourSchemeI");
+c$.getColourName = Clazz_defineMethod (c$, "getColourName", 
+function (index) {
+var ret = null;
+switch (index) {
+case 2:
+ret = "Clustal";
+break;
+case 3:
+ret = "Blosum62";
+break;
+case 4:
+ret = "% Identity";
+break;
+case 5:
+ret = "Zappo";
+break;
+case 6:
+ret = "Taylor";
+break;
+case 7:
+ret = "Hydrophobic";
+break;
+case 8:
+ret = "Helix Propensity";
+break;
+case 9:
+ret = "Strand Propensity";
+break;
+case 10:
+ret = "Turn Propensity";
+break;
+case 11:
+ret = "Buried Index";
+break;
+case 12:
+ret = "Nucleotide";
+break;
+case 13:
+ret = "Purine/Pyrimidine";
+break;
+case 15:
+ret = "T-Coffee Scores";
+break;
+case 17:
+ret = "RNA Interaction type";
+break;
+case 16:
+ret = "RNA Helices";
+break;
+case 0:
+ret = "User Defined";
+break;
+default:
+ret = "None";
+break;
+}
+return ret;
+}, "~N");
+c$.getColour = Clazz_defineMethod (c$, "getColour", 
+function (alignment, name) {
+var colindex = jalview.schemes.ColourSchemeProperty.getColourIndexFromName (name);
+if (colindex == -1) {
+if (name.indexOf ('=') == -1) {
+try {
+return  new jalview.schemes.UserColourScheme (name);
+} catch (e) {
+if (Clazz_exceptionOf (e, Exception)) {
+} else {
+throw e;
+}
+}
+} else {
+try {
+var ucs =  new jalview.schemes.UserColourScheme ("white");
+ucs.parseAppletParameter (name);
+} catch (e) {
+if (Clazz_exceptionOf (e, Exception)) {
+} else {
+throw e;
+}
+}
+}}return jalview.schemes.ColourSchemeProperty.getColour (alignment, jalview.schemes.ColourSchemeProperty.getColourIndexFromName (name));
+}, "jalview.datamodel.AnnotatedCollectionI,~S");
+c$.getColour = Clazz_defineMethod (c$, "getColour", 
+function (coll, index) {
+var cs = null;
+switch (index) {
+case 2:
+cs =  new jalview.schemes.ClustalxColourScheme (coll, null);
+break;
+case 3:
+cs =  new jalview.schemes.Blosum62ColourScheme ();
+break;
+case 4:
+cs =  new jalview.schemes.PIDColourScheme ();
+break;
+case 5:
+cs =  new jalview.schemes.ZappoColourScheme ();
+break;
+case 6:
+cs =  new jalview.schemes.TaylorColourScheme ();
+break;
+case 7:
+cs =  new jalview.schemes.HydrophobicColourScheme ();
+break;
+case 8:
+cs =  new jalview.schemes.HelixColourScheme ();
+break;
+case 9:
+cs =  new jalview.schemes.StrandColourScheme ();
+break;
+case 10:
+cs =  new jalview.schemes.TurnColourScheme ();
+break;
+case 11:
+cs =  new jalview.schemes.BuriedColourScheme ();
+break;
+case 12:
+cs =  new jalview.schemes.NucleotideColourScheme ();
+break;
+case 13:
+cs =  new jalview.schemes.PurinePyrimidineColourScheme ();
+break;
+case 15:
+cs =  new jalview.schemes.TCoffeeColourScheme (coll);
+break;
+case 16:
+cs =  new jalview.schemes.RNAHelicesColour (coll);
+break;
+case 0:
+var col =  new Array (24);
+for (var i = 0; i < 24; i++) {
+col[i] = java.awt.Color.white;
+}
+cs =  new jalview.schemes.UserColourScheme (col);
+break;
+default:
+break;
+}
+return cs;
+}, "jalview.datamodel.AnnotatedCollectionI,~N");
+c$.getAWTColorFromName = Clazz_defineMethod (c$, "getAWTColorFromName", 
+function (name) {
+var col = null;
+name = name.toLowerCase ();
+if (name.equals ("black")) {
+col = java.awt.Color.black;
+} else if (name.equals ("blue")) {
+col = java.awt.Color.blue;
+} else if (name.equals ("cyan")) {
+col = java.awt.Color.cyan;
+} else if (name.equals ("darkGray")) {
+col = java.awt.Color.darkGray;
+} else if (name.equals ("gray")) {
+col = java.awt.Color.gray;
+} else if (name.equals ("green")) {
+col = java.awt.Color.green;
+} else if (name.equals ("lightGray")) {
+col = java.awt.Color.lightGray;
+} else if (name.equals ("magenta")) {
+col = java.awt.Color.magenta;
+} else if (name.equals ("orange")) {
+col = java.awt.Color.orange;
+} else if (name.equals ("pink")) {
+col = java.awt.Color.pink;
+} else if (name.equals ("red")) {
+col = java.awt.Color.red;
+} else if (name.equals ("white")) {
+col = java.awt.Color.white;
+} else if (name.equals ("yellow")) {
+col = java.awt.Color.yellow;
+}return col;
+}, "~S");
+c$.initRnaHelicesShading = Clazz_defineMethod (c$, "initRnaHelicesShading", 
+function (n) {
+var j = 0;
+if (jalview.schemes.ColourSchemeProperty.rnaHelices == null) {
+jalview.schemes.ColourSchemeProperty.rnaHelices =  new Array (n + 1);
+} else if (jalview.schemes.ColourSchemeProperty.rnaHelices != null && jalview.schemes.ColourSchemeProperty.rnaHelices.length <= n) {
+var t =  new Array (n + 1);
+System.arraycopy (jalview.schemes.ColourSchemeProperty.rnaHelices, 0, t, 0, jalview.schemes.ColourSchemeProperty.rnaHelices.length);
+j = jalview.schemes.ColourSchemeProperty.rnaHelices.length;
+jalview.schemes.ColourSchemeProperty.rnaHelices = t;
+} else {
+return;
+}for (; j <= n; j++) {
+jalview.schemes.ColourSchemeProperty.rnaHelices[j] = jalview.util.ColorUtils.generateRandomColor (java.awt.Color.white);
+}
+}, "~N");
+Clazz_defineStatics (c$,
+"UNDEFINED", -1,
+"USER_DEFINED", 0,
+"NONE", 1,
+"CLUSTAL", 2,
+"BLOSUM", 3,
+"PID", 4,
+"ZAPPO", 5,
+"TAYLOR", 6,
+"HYDROPHOBIC", 7,
+"HELIX", 8,
+"STRAND", 9,
+"TURN", 10,
+"BURIED", 11,
+"NUCLEOTIDE", 12,
+"PURINEPYRIMIDINE", 13,
+"COVARIATION", 14,
+"TCOFFEE", 15,
+"RNAHELIX", 16,
+"RNAINTERACTION", 17,
+"FIRST_COLOUR", 1,
+"LAST_COLOUR", 17,
+"rnaHelices", null);
+});
+Clazz_declarePackage ("jalview.schemes");
+Clazz_load (["jalview.schemes.ScoreColourScheme"], "jalview.schemes.BuriedColourScheme", ["jalview.schemes.ResidueProperties", "java.awt.Color"], function () {
+c$ = Clazz_declareType (jalview.schemes, "BuriedColourScheme", jalview.schemes.ScoreColourScheme);
+Clazz_makeConstructor (c$, 
+function () {
+Clazz_superConstructor (this, jalview.schemes.BuriedColourScheme, [jalview.schemes.ResidueProperties.aaIndex, jalview.schemes.ResidueProperties.buried, 0.05, 4.6]);
+});
+Clazz_overrideMethod (c$, "makeColour", 
+function (c) {
+return  new java.awt.Color (0, (1.0 - c), c);
+}, "~N");
+});
+Clazz_declarePackage ("jalview.schemes");
+Clazz_load (["jalview.schemes.ResidueColourScheme"], "jalview.schemes.ScoreColourScheme", ["jalview.schemes.ResidueProperties", "jalview.util.Comparison", "java.awt.Color"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.min = 0;
+this.max = 0;
+this.scores = null;
+Clazz_instantialize (this, arguments);
+}, jalview.schemes, "ScoreColourScheme", jalview.schemes.ResidueColourScheme);
+Clazz_makeConstructor (c$, 
+function (symbolIndex, scores, min, max) {
+Clazz_superConstructor (this, jalview.schemes.ScoreColourScheme, [symbolIndex]);
+this.scores = scores;
+this.min = min;
+this.max = max;
+var i;
+var iSize = scores.length;
+this.colors =  new Array (scores.length);
+for (i = 0; i < iSize; i++) {
+var red = (scores[i] - min) / (max - min);
+if (red > 1.0) {
+red = 1.0;
+}if (red < 0.0) {
+red = 0.0;
+}this.colors[i] = this.makeColour (red);
+}
+}, "~A,~A,~N,~N");
+Clazz_overrideMethod (c$, "findColourSeq", 
+function (c, j, seq) {
+if (this.threshold > 0) {
+if (!this.aboveThreshold (c, j)) {
+return java.awt.Color.white;
+}}if (jalview.util.Comparison.isGap (c)) {
+return java.awt.Color.white;
+}var currentColour = this.colors[jalview.schemes.ResidueProperties.aaIndex[c.charCodeAt (0)]];
+if (this.conservationColouring) {
+currentColour = this.applyConservation (currentColour, j);
+}return currentColour;
+}, "~S,~N,jalview.datamodel.SequenceI");
+Clazz_defineMethod (c$, "makeColour", 
+function (c) {
+return  new java.awt.Color (c, 0.0, 1.0 - c);
+}, "~N");
+});
+Clazz_declarePackage ("jalview.schemes");
+Clazz_load (["jalview.schemes.ResidueColourScheme", "java.util.HashMap"], ["jalview.schemes.ConsensusColour", "$.ClustalxColourScheme"], ["jalview.schemes.Consensus", "$.ResidueProperties", "java.awt.Color"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.cons2 = null;
+this.colours = null;
+this.residueColour = null;
+this.size = 0;
+this.conses = null;
+this.includeGaps = true;
+Clazz_instantialize (this, arguments);
+}, jalview.schemes, "ClustalxColourScheme", jalview.schemes.ResidueColourScheme);
+Clazz_prepareFields (c$, function () {
+this.conses =  new Array (32);
+});
+Clazz_makeConstructor (c$, 
+function (alignment, hiddenReps) {
+Clazz_superConstructor (this, jalview.schemes.ClustalxColourScheme, []);
+this.alignmentChanged (alignment, hiddenReps);
+}, "jalview.datamodel.AnnotatedCollectionI,java.util.Map");
+Clazz_overrideMethod (c$, "alignmentChanged", 
+function (alignment, hiddenReps) {
+var maxWidth = alignment.getWidth ();
+var seqs = alignment.getSequences (hiddenReps);
+this.cons2 =  Clazz_newIntArray (maxWidth, 24, 0);
+this.includeGaps = this.isIncludeGaps ();
+var start = 0;
+for (var j = 0; j < 24; j++) {
+for (var i = 0; i < maxWidth; i++) {
+this.cons2[i][j] = 0;
+}
+}
+var res;
+var i;
+var j = 0;
+var seq;
+for (var sq, $sq = seqs.iterator (); $sq.hasNext () && ((sq = $sq.next ()) || true);) {
+seq = sq.getSequence ();
+var end_j = seq.length - 1;
+for (i = start; i <= end_j; i++) {
+if ((seq.length - 1) < i) {
+res = 23;
+} else {
+res = jalview.schemes.ResidueProperties.aaIndex[seq[i].charCodeAt (0)];
+}this.cons2[i][res]++;
+}
+j++;
+}
+this.size = seqs.size ();
+this.makeColours ();
+}, "jalview.datamodel.AnnotatedCollectionI,java.util.Map");
+Clazz_defineMethod (c$, "makeColours", 
+function () {
+this.conses[0] =  new jalview.schemes.Consensus ("WLVIMAFCYHP", 60);
+this.conses[1] =  new jalview.schemes.Consensus ("WLVIMAFCYHP", 80);
+this.conses[2] =  new jalview.schemes.Consensus ("ED", 50);
+this.conses[3] =  new jalview.schemes.Consensus ("KR", 60);
+this.conses[4] =  new jalview.schemes.Consensus ("G", 50);
+this.conses[5] =  new jalview.schemes.Consensus ("N", 50);
+this.conses[6] =  new jalview.schemes.Consensus ("QE", 50);
+this.conses[7] =  new jalview.schemes.Consensus ("P", 50);
+this.conses[8] =  new jalview.schemes.Consensus ("TS", 50);
+this.conses[26] =  new jalview.schemes.Consensus ("A", 85);
+this.conses[27] =  new jalview.schemes.Consensus ("C", 85);
+this.conses[10] =  new jalview.schemes.Consensus ("E", 85);
+this.conses[11] =  new jalview.schemes.Consensus ("F", 85);
+this.conses[12] =  new jalview.schemes.Consensus ("G", 85);
+this.conses[13] =  new jalview.schemes.Consensus ("H", 85);
+this.conses[14] =  new jalview.schemes.Consensus ("I", 85);
+this.conses[15] =  new jalview.schemes.Consensus ("L", 85);
+this.conses[16] =  new jalview.schemes.Consensus ("M", 85);
+this.conses[17] =  new jalview.schemes.Consensus ("N", 85);
+this.conses[18] =  new jalview.schemes.Consensus ("P", 85);
+this.conses[19] =  new jalview.schemes.Consensus ("Q", 85);
+this.conses[20] =  new jalview.schemes.Consensus ("R", 85);
+this.conses[21] =  new jalview.schemes.Consensus ("S", 85);
+this.conses[22] =  new jalview.schemes.Consensus ("T", 85);
+this.conses[23] =  new jalview.schemes.Consensus ("V", 85);
+this.conses[24] =  new jalview.schemes.Consensus ("W", 85);
+this.conses[25] =  new jalview.schemes.Consensus ("Y", 85);
+this.conses[28] =  new jalview.schemes.Consensus ("K", 85);
+this.conses[29] =  new jalview.schemes.Consensus ("D", 85);
+this.conses[30] =  new jalview.schemes.Consensus ("G", 0);
+this.conses[31] =  new jalview.schemes.Consensus ("P", 0);
+this.colours =  new Array (11);
+var tmp8 =  new Array (1);
+tmp8[0] = this.conses[30];
+this.colours[7] =  new jalview.schemes.ConsensusColour (jalview.schemes.ClustalxColourScheme.colhash.get (java.awt.Color.ORANGE), tmp8);
+var tmp9 =  new Array (1);
+tmp9[0] = this.conses[31];
+this.colours[8] =  new jalview.schemes.ConsensusColour (jalview.schemes.ClustalxColourScheme.colhash.get (java.awt.Color.YELLOW), tmp9);
+var tmp10 =  new Array (1);
+tmp10[0] = this.conses[27];
+this.colours[9] =  new jalview.schemes.ConsensusColour (jalview.schemes.ClustalxColourScheme.colhash.get (java.awt.Color.PINK), tmp8);
+var tmp1 =  new Array (14);
+tmp1[0] = this.conses[0];
+tmp1[1] = this.conses[1];
+tmp1[2] = this.conses[26];
+tmp1[3] = this.conses[27];
+tmp1[4] = this.conses[11];
+tmp1[5] = this.conses[13];
+tmp1[6] = this.conses[14];
+tmp1[7] = this.conses[15];
+tmp1[8] = this.conses[16];
+tmp1[9] = this.conses[23];
+tmp1[10] = this.conses[24];
+tmp1[11] = this.conses[25];
+tmp1[12] = this.conses[18];
+tmp1[13] = this.conses[19];
+this.colours[0] =  new jalview.schemes.ConsensusColour (jalview.schemes.ClustalxColourScheme.colhash.get (java.awt.Color.BLUE), tmp1);
+this.colours[10] =  new jalview.schemes.ConsensusColour (jalview.schemes.ClustalxColourScheme.colhash.get (java.awt.Color.CYAN), tmp1);
+var tmp2 =  new Array (5);
+tmp2[0] = this.conses[8];
+tmp2[1] = this.conses[21];
+tmp2[2] = this.conses[22];
+tmp2[3] = this.conses[0];
+tmp2[4] = this.conses[1];
+this.colours[1] =  new jalview.schemes.ConsensusColour (jalview.schemes.ClustalxColourScheme.colhash.get (java.awt.Color.GREEN), tmp2);
+var tmp3 =  new Array (3);
+tmp3[0] = this.conses[17];
+tmp3[1] = this.conses[29];
+tmp3[2] = this.conses[5];
+this.colours[2] =  new jalview.schemes.ConsensusColour (jalview.schemes.ClustalxColourScheme.colhash.get (java.awt.Color.GREEN), tmp3);
+var tmp4 =  new Array (6);
+tmp4[0] = this.conses[6];
+tmp4[1] = this.conses[19];
+tmp4[2] = this.conses[22];
+tmp4[3] = this.conses[3];
+tmp4[4] = this.conses[28];
+tmp4[5] = this.conses[20];
+this.colours[3] =  new jalview.schemes.ConsensusColour (jalview.schemes.ClustalxColourScheme.colhash.get (java.awt.Color.GREEN), tmp4);
+var tmp5 =  new Array (4);
+tmp5[0] = this.conses[3];
+tmp5[1] = this.conses[28];
+tmp5[2] = this.conses[20];
+tmp5[3] = this.conses[19];
+this.colours[4] =  new jalview.schemes.ConsensusColour (jalview.schemes.ClustalxColourScheme.colhash.get (java.awt.Color.RED), tmp5);
+var tmp6 =  new Array (6);
+tmp6[0] = this.conses[3];
+tmp6[1] = this.conses[29];
+tmp6[2] = this.conses[10];
+tmp6[3] = this.conses[6];
+tmp6[4] = this.conses[19];
+tmp6[5] = this.conses[2];
+this.colours[5] =  new jalview.schemes.ConsensusColour (jalview.schemes.ClustalxColourScheme.colhash.get (java.awt.Color.MAGENTA), tmp6);
+var tmp7 =  new Array (5);
+tmp7[0] = this.conses[3];
+tmp7[1] = this.conses[29];
+tmp7[2] = this.conses[10];
+tmp7[3] = this.conses[17];
+tmp7[4] = this.conses[2];
+this.colours[6] =  new jalview.schemes.ConsensusColour (jalview.schemes.ClustalxColourScheme.colhash.get (java.awt.Color.MAGENTA), tmp7);
+this.residueColour =  new Array (20);
+this.residueColour[0] = this.colours[0];
+this.residueColour[1] = this.colours[4];
+this.residueColour[2] = this.colours[2];
+this.residueColour[3] = this.colours[6];
+this.residueColour[4] = this.colours[0];
+this.residueColour[5] = this.colours[3];
+this.residueColour[6] = this.colours[5];
+this.residueColour[7] = this.colours[7];
+this.residueColour[8] = this.colours[10];
+this.residueColour[9] = this.colours[0];
+this.residueColour[10] = this.colours[0];
+this.residueColour[11] = this.colours[4];
+this.residueColour[12] = this.colours[0];
+this.residueColour[13] = this.colours[0];
+this.residueColour[14] = this.colours[8];
+this.residueColour[15] = this.colours[1];
+this.residueColour[16] = this.colours[1];
+this.residueColour[17] = this.colours[0];
+this.residueColour[18] = this.colours[10];
+this.residueColour[19] = this.colours[0];
+});
+Clazz_overrideMethod (c$, "findColour", 
+function (c) {
+return java.awt.Color.pink;
+}, "~S");
+Clazz_overrideMethod (c$, "findColourSeq", 
+function (c, j, seq) {
+var currentColour;
+if (this.cons2.length <= j || (this.includeGaps && this.threshold != 0 && !this.aboveThreshold (c, j))) {
+return java.awt.Color.white;
+}var i = jalview.schemes.ResidueProperties.aaIndex[c.charCodeAt (0)];
+currentColour = java.awt.Color.white;
+if (i > 19) {
+return currentColour;
+}for (var k = 0; k < this.residueColour[i].conses.length; k++) {
+if (this.residueColour[i].conses[k].isConserved (this.cons2, j, this.size, this.includeGaps)) {
+currentColour = this.residueColour[i].c;
+}}
+if (i == 4) {
+if (this.conses[27].isConserved (this.cons2, j, this.size, this.includeGaps)) {
+currentColour = jalview.schemes.ClustalxColourScheme.colhash.get (java.awt.Color.PINK);
+}}if (this.conservationColouring) {
+currentColour = this.applyConservation (currentColour, j);
+}return currentColour;
+}, "~S,~N,jalview.datamodel.SequenceI");
+Clazz_defineMethod (c$, "isIncludeGaps", 
+function () {
+return this.includeGaps;
+});
+Clazz_defineMethod (c$, "setIncludeGaps", 
+function (includeGaps) {
+this.includeGaps = includeGaps;
+}, "~B");
+Clazz_overrideMethod (c$, "applyTo", 
+function (sg, hiddenRepSequences) {
+var css =  new jalview.schemes.ClustalxColourScheme (sg, hiddenRepSequences);
+css.includeGaps = this.includeGaps;
+return css;
+}, "jalview.datamodel.AnnotatedCollectionI,java.util.Map");
+Clazz_defineStatics (c$,
+"EIGHTY_FIVE", 85,
+"FIFTY", 50,
+"EIGHTY", 80,
+"SIXTY", 60);
+c$.colhash = c$.prototype.colhash =  new java.util.HashMap ();
+{
+jalview.schemes.ClustalxColourScheme.colhash.put (java.awt.Color.RED,  new java.awt.Color (0.9, 0.2, 0.1));
+jalview.schemes.ClustalxColourScheme.colhash.put (java.awt.Color.BLUE,  new java.awt.Color (0.5, 0.7, 0.9));
+jalview.schemes.ClustalxColourScheme.colhash.put (java.awt.Color.GREEN,  new java.awt.Color (0.1, 0.8, 0.1));
+jalview.schemes.ClustalxColourScheme.colhash.put (java.awt.Color.ORANGE,  new java.awt.Color (0.9, 0.6, 0.3));
+jalview.schemes.ClustalxColourScheme.colhash.put (java.awt.Color.CYAN,  new java.awt.Color (0.1, 0.7, 0.7));
+jalview.schemes.ClustalxColourScheme.colhash.put (java.awt.Color.PINK,  new java.awt.Color (0.9, 0.5, 0.5));
+jalview.schemes.ClustalxColourScheme.colhash.put (java.awt.Color.MAGENTA,  new java.awt.Color (0.8, 0.3, 0.8));
+jalview.schemes.ClustalxColourScheme.colhash.put (java.awt.Color.YELLOW,  new java.awt.Color (0.8, 0.8, 0.0));
+}c$ = Clazz_decorateAsClass (function () {
+this.conses = null;
+this.c = null;
+Clazz_instantialize (this, arguments);
+}, jalview.schemes, "ConsensusColour");
+Clazz_makeConstructor (c$, 
+function (c, conses) {
+this.conses = conses;
+this.c = c;
+}, "java.awt.Color,~A");
+});
+Clazz_declarePackage ("jalview.schemes");
+Clazz_load (null, "jalview.schemes.Consensus", ["jalview.schemes.ResidueProperties"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.mask = null;
+this.threshold = 0;
+this.maskstr = null;
+Clazz_instantialize (this, arguments);
+}, jalview.schemes, "Consensus");
+Clazz_makeConstructor (c$, 
+function (mask, threshold) {
+this.maskstr = mask;
+this.setMask (mask);
+this.threshold = threshold;
+}, "~S,~N");
+Clazz_defineMethod (c$, "setMask", 
+function (s) {
+this.mask = this.setNums (s);
+}, "~S");
+Clazz_defineMethod (c$, "isConserved", 
+function (cons2, col, size) {
+return this.isConserved (cons2, col, size, true);
+}, "~A,~N,~N");
+Clazz_defineMethod (c$, "isConserved", 
+function (cons2, col, size, includeGaps) {
+var tot = 0;
+if (!includeGaps) {
+size -= cons2[col][cons2[col].length - 1];
+}for (var i = 0; i < this.mask.length; i++) {
+tot += cons2[col][this.mask[i]];
+}
+if (tot > ((this.threshold * size) / 100)) {
+return true;
+}return false;
+}, "~A,~N,~N,~B");
+Clazz_defineMethod (c$, "setNums", 
+function (s) {
+var out =  Clazz_newIntArray (s.length, 0);
+var i = 0;
+while (i < s.length) {
+out[i] = jalview.schemes.ResidueProperties.aaIndex[s.charCodeAt (i)];
+i++;
+}
+return out;
+}, "~S");
+});
+Clazz_declarePackage ("jalview.schemes");
+Clazz_load (["jalview.schemes.ScoreColourScheme"], "jalview.schemes.HelixColourScheme", ["jalview.schemes.ResidueProperties", "java.awt.Color"], function () {
+c$ = Clazz_declareType (jalview.schemes, "HelixColourScheme", jalview.schemes.ScoreColourScheme);
+Clazz_makeConstructor (c$, 
+function () {
+Clazz_superConstructor (this, jalview.schemes.HelixColourScheme, [jalview.schemes.ResidueProperties.aaIndex, jalview.schemes.ResidueProperties.helix, 0.57, 1.51]);
+});
+Clazz_overrideMethod (c$, "makeColour", 
+function (c) {
+return  new java.awt.Color (c, 1.0 - c, c);
+}, "~N");
+});
+Clazz_declarePackage ("jalview.schemes");
+Clazz_load (["jalview.schemes.ScoreColourScheme"], "jalview.schemes.HydrophobicColourScheme", ["jalview.schemes.ResidueProperties", "java.awt.Color"], function () {
+c$ = Clazz_declareType (jalview.schemes, "HydrophobicColourScheme", jalview.schemes.ScoreColourScheme);
+Clazz_makeConstructor (c$, 
+function () {
+Clazz_superConstructor (this, jalview.schemes.HydrophobicColourScheme, [jalview.schemes.ResidueProperties.aaIndex, jalview.schemes.ResidueProperties.hyd, -3.9, 4.5]);
+});
+Clazz_overrideMethod (c$, "makeColour", 
+function (c) {
+return  new java.awt.Color (c, 0.0, 1.0 - c);
+}, "~N");
+});
+Clazz_declarePackage ("jalview.schemes");
+Clazz_load (["jalview.schemes.ResidueColourScheme"], "jalview.schemes.NucleotideColourScheme", ["jalview.schemes.ResidueProperties", "java.awt.Color"], function () {
+c$ = Clazz_declareType (jalview.schemes, "NucleotideColourScheme", jalview.schemes.ResidueColourScheme);
+Clazz_makeConstructor (c$, 
+function () {
+Clazz_superConstructor (this, jalview.schemes.NucleotideColourScheme, [jalview.schemes.ResidueProperties.nucleotideIndex, jalview.schemes.ResidueProperties.nucleotide, 0]);
+});
+Clazz_overrideMethod (c$, "findColour", 
+function (c) {
+return this.colors[jalview.schemes.ResidueProperties.nucleotideIndex[c.charCodeAt (0)]];
+}, "~S");
+Clazz_overrideMethod (c$, "findColourSeq", 
+function (c, j, seq) {
+var currentColour;
+if ((this.threshold == 0) || this.aboveThreshold (c, j)) {
+try {
+currentColour = this.colors[jalview.schemes.ResidueProperties.nucleotideIndex[c.charCodeAt (0)]];
+} catch (ex) {
+if (Clazz_exceptionOf (ex, Exception)) {
+return java.awt.Color.white;
+} else {
+throw ex;
+}
+}
+} else {
+return java.awt.Color.white;
+}if (this.conservationColouring) {
+currentColour = this.applyConservation (currentColour, j);
+}return currentColour;
+}, "~S,~N,jalview.datamodel.SequenceI");
+});
+Clazz_declarePackage ("jalview.schemes");
+Clazz_load (["jalview.schemes.ResidueColourScheme"], "jalview.schemes.PurinePyrimidineColourScheme", ["jalview.schemes.ResidueProperties", "java.awt.Color"], function () {
+c$ = Clazz_declareType (jalview.schemes, "PurinePyrimidineColourScheme", jalview.schemes.ResidueColourScheme);
+Clazz_makeConstructor (c$, 
+function () {
+Clazz_superConstructor (this, jalview.schemes.PurinePyrimidineColourScheme, [jalview.schemes.ResidueProperties.purinepyrimidineIndex, jalview.schemes.ResidueProperties.purinepyrimidine, 0]);
+});
+Clazz_defineMethod (c$, "findColour", 
+function (c) {
+return this.colors[jalview.schemes.ResidueProperties.purinepyrimidineIndex[c.charCodeAt (0)]];
+}, "~S");
+Clazz_defineMethod (c$, "findColour", 
+function (c, j) {
+var currentColour;
+if ((this.threshold == 0) || this.aboveThreshold (c, j)) {
+try {
+currentColour = this.colors[jalview.schemes.ResidueProperties.purinepyrimidineIndex[c.charCodeAt (0)]];
+} catch (ex) {
+if (Clazz_exceptionOf (ex, Exception)) {
+return java.awt.Color.white;
+} else {
+throw ex;
+}
+}
+} else {
+return java.awt.Color.white;
+}if (this.conservationColouring) {
+currentColour = this.applyConservation (currentColour, j);
+}return currentColour;
+}, "~S,~N");
+});
+Clazz_declarePackage ("jalview.schemes");
+Clazz_load (["jalview.schemes.ResidueColourScheme", "java.util.Hashtable"], "jalview.schemes.RNAHelicesColour", ["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;
+this.lastrefresh = -1;
+Clazz_instantialize (this, arguments);
+}, jalview.schemes, "RNAHelicesColour", 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.RNAHelicesColour, [jalview.schemes.ResidueProperties.nucleotideIndex]);
+this.annotation = annotation;
+this.refresh ();
+}, "jalview.datamodel.AlignmentAnnotation");
+Clazz_makeConstructor (c$, 
+function (alignment) {
+Clazz_superConstructor (this, jalview.schemes.RNAHelicesColour, [jalview.schemes.ResidueProperties.nucleotideIndex]);
+this.alignmentChanged (alignment, null);
+}, "jalview.datamodel.AnnotatedCollectionI");
+Clazz_overrideMethod (c$, "alignmentChanged", 
+function (alignment, hiddenReps) {
+var annotations = alignment.getAlignmentAnnotation ();
+for (var i = 0; i < annotations.length; i++) {
+if (annotations[i].getRNAStruc () != null) {
+this.annotation = annotations[i];
+break;
+}}
+this.refresh ();
+}, "jalview.datamodel.AnnotatedCollectionI,java.util.Map");
+Clazz_defineMethod (c$, "refresh", 
+function () {
+if (this.annotation != null && ((this.annotation._rnasecstr == null || this.lastrefresh != this.annotation._rnasecstr.hashCode ()) && this.annotation.isValidStruc ())) {
+this.annotation.getRNAStruc ();
+this.lastrefresh = this.annotation._rnasecstr.hashCode ();
+this.numHelix = 0;
+this.positionsToHelix =  new java.util.Hashtable ();
+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++) {
+if (!this.helixcolorhash.containsKey (Integer.toString (j))) {
+this.helixcolorhash.put (Integer.toString (j), jalview.util.ColorUtils.generateRandomColor (java.awt.Color.white));
+}}
+}});
+Clazz_overrideMethod (c$, "findColour", 
+function (c) {
+return jalview.schemes.ResidueProperties.purinepyrimidine[jalview.schemes.ResidueProperties.purinepyrimidineIndex[c.charCodeAt (0)]];
+}, "~S");
+Clazz_overrideMethod (c$, "findColourSeq", 
+function (c, j, seq) {
+this.refresh ();
+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,jalview.datamodel.SequenceI");
+});
+Clazz_declarePackage ("jalview.util");
+Clazz_load (null, "jalview.util.ColorUtils", ["java.awt.Color", "java.util.Random"], function () {
+c$ = Clazz_declareType (jalview.util, "ColorUtils");
+c$.generateRandomColor = Clazz_defineMethod (c$, "generateRandomColor", 
+function (mix) {
+var random =  new java.util.Random ();
+var red = random.nextInt (256);
+var green = random.nextInt (256);
+var blue = random.nextInt (256);
+if (mix != null) {
+red = Clazz_doubleToInt ((red + mix.getRed ()) / 2);
+green = Clazz_doubleToInt ((green + mix.getGreen ()) / 2);
+blue = Clazz_doubleToInt ((blue + mix.getBlue ()) / 2);
+}var color =  new java.awt.Color (red, green, blue);
+return color;
+}, "java.awt.Color");
+c$.toTkCode = Clazz_defineMethod (c$, "toTkCode", 
+function (colour) {
+var colstring = "#" + ((colour.getRed () < 16) ? "0" : "") + Integer.toHexString (colour.getRed ()) + ((colour.getGreen () < 16) ? "0" : "") + Integer.toHexString (colour.getGreen ()) + ((colour.getBlue () < 16) ? "0" : "") + Integer.toHexString (colour.getBlue ());
+return colstring;
+}, "java.awt.Color");
+c$.darkerThan = Clazz_defineMethod (c$, "darkerThan", 
+function (col) {
+return col == null ? null : col.darker ().darker ().darker ();
+}, "java.awt.Color");
+c$.brighterThan = Clazz_defineMethod (c$, "brighterThan", 
+function (col) {
+return col == null ? null : col.brighter ().brighter ().brighter ();
+}, "java.awt.Color");
+});
+Clazz_declarePackage ("jalview.schemes");
+Clazz_load (["jalview.schemes.ScoreColourScheme"], "jalview.schemes.StrandColourScheme", ["jalview.schemes.ResidueProperties", "java.awt.Color"], function () {
+c$ = Clazz_declareType (jalview.schemes, "StrandColourScheme", jalview.schemes.ScoreColourScheme);
+Clazz_makeConstructor (c$, 
+function () {
+Clazz_superConstructor (this, jalview.schemes.StrandColourScheme, [jalview.schemes.ResidueProperties.aaIndex, jalview.schemes.ResidueProperties.strand, 0.37, 1.7]);
+});
+Clazz_overrideMethod (c$, "makeColour", 
+function (c) {
+return  new java.awt.Color (c, c, 1.0 - c);
+}, "~N");
+});
+Clazz_declarePackage ("jalview.schemes");
+Clazz_load (["jalview.schemes.ResidueColourScheme", "java.awt.Color"], "jalview.schemes.TCoffeeColourScheme", ["jalview.datamodel.AlignmentI", "java.util.ArrayList", "$.IdentityHashMap"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.seqMap = null;
+Clazz_instantialize (this, arguments);
+}, jalview.schemes, "TCoffeeColourScheme", jalview.schemes.ResidueColourScheme);
+Clazz_makeConstructor (c$, 
+function (alignment) {
+Clazz_superConstructor (this, jalview.schemes.TCoffeeColourScheme, []);
+this.alignmentChanged (alignment, null);
+}, "jalview.datamodel.AnnotatedCollectionI");
+Clazz_overrideMethod (c$, "alignmentChanged", 
+function (alignment, hiddenReps) {
+var annots =  new java.util.ArrayList ();
+this.seqMap =  new java.util.IdentityHashMap ();
+var alcontext = Clazz_instanceOf (alignment, jalview.datamodel.AlignmentI) ? alignment : alignment.getContext ();
+var w = 0;
+for (var al, $al = alcontext.findAnnotation ("TCoffeeScore").iterator (); $al.hasNext () && ((al = $al.next ()) || true);) {
+if (al.sequenceRef != null && !al.belowAlignment) {
+annots.add (al);
+if (w < al.annotations.length) {
+w = al.annotations.length;
+}var scores =  new Array (al.annotations.length);
+var i = 0;
+for (var an, $an = 0, $$an = al.annotations; $an < $$an.length && ((an = $$an[$an]) || true); $an++) {
+scores[i++] = (an != null) ? an.colour : java.awt.Color.white;
+}
+this.seqMap.put (al.sequenceRef, scores);
+}}
+}, "jalview.datamodel.AnnotatedCollectionI,java.util.Map");
+Clazz_overrideMethod (c$, "findColourSeq", 
+function (c, j, seq) {
+var cols;
+if (this.seqMap == null || (cols = this.seqMap.get (seq)) == null) {
+return java.awt.Color.white;
+}if (j < 0 || j >= cols.length) {
+return java.awt.Color.white;
+}return cols[j];
+}, "~S,~N,jalview.datamodel.SequenceI");
+Clazz_overrideMethod (c$, "applyTo", 
+function (sg, hiddenRepSequences) {
+return  new jalview.schemes.TCoffeeColourScheme (sg);
+}, "jalview.datamodel.AnnotatedCollectionI,java.util.Map");
+c$.$colors = c$.prototype.$colors =  Clazz_newArray (-1, [ new java.awt.Color (102, 102, 255),  new java.awt.Color (0, 255, 0),  new java.awt.Color (102, 255, 0),  new java.awt.Color (204, 255, 0),  new java.awt.Color (255, 255, 0),  new java.awt.Color (255, 204, 0),  new java.awt.Color (255, 153, 0),  new java.awt.Color (255, 102, 0),  new java.awt.Color (255, 51, 0),  new java.awt.Color (255, 34, 0)]);
+});
+Clazz_declarePackage ("jalview.schemes");
+Clazz_load (["jalview.schemes.ResidueColourScheme"], "jalview.schemes.TaylorColourScheme", ["jalview.schemes.ResidueProperties"], function () {
+c$ = Clazz_declareType (jalview.schemes, "TaylorColourScheme", jalview.schemes.ResidueColourScheme);
+Clazz_makeConstructor (c$, 
+function () {
+Clazz_superConstructor (this, jalview.schemes.TaylorColourScheme, [jalview.schemes.ResidueProperties.aaIndex, jalview.schemes.ResidueProperties.taylor, 0]);
+});
+});
+Clazz_declarePackage ("jalview.schemes");
+Clazz_load (["jalview.schemes.ScoreColourScheme"], "jalview.schemes.TurnColourScheme", ["jalview.schemes.ResidueProperties", "java.awt.Color"], function () {
+c$ = Clazz_declareType (jalview.schemes, "TurnColourScheme", jalview.schemes.ScoreColourScheme);
+Clazz_makeConstructor (c$, 
+function () {
+Clazz_superConstructor (this, jalview.schemes.TurnColourScheme, [jalview.schemes.ResidueProperties.aaIndex, jalview.schemes.ResidueProperties.turn, 0.47, 1.56]);
+});
+Clazz_overrideMethod (c$, "makeColour", 
+function (c) {
+return  new java.awt.Color (c, 1 - c, 1 - c);
+}, "~N");
+});
+Clazz_declarePackage ("jalview.schemes");
+Clazz_load (["jalview.schemes.ResidueColourScheme"], "jalview.schemes.UserColourScheme", ["jalview.schemes.ColourSchemeProperty", "$.ResidueProperties", "java.awt.Color", "java.util.StringTokenizer"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.lowerCaseColours = null;
+this.schemeName = null;
+Clazz_instantialize (this, arguments);
+}, jalview.schemes, "UserColourScheme", jalview.schemes.ResidueColourScheme);
+Clazz_makeConstructor (c$, 
+function () {
+Clazz_superConstructor (this, jalview.schemes.UserColourScheme, [jalview.schemes.ResidueProperties.aaIndex]);
+});
+Clazz_makeConstructor (c$, 
+function (newColors) {
+Clazz_superConstructor (this, jalview.schemes.UserColourScheme, [jalview.schemes.ResidueProperties.aaIndex]);
+this.colors = newColors;
+}, "~A");
+Clazz_overrideMethod (c$, "applyTo", 
+function (sg, hiddenRepSequences) {
+var usc =  new jalview.schemes.UserColourScheme (this.colors);
+if (this.lowerCaseColours != null) {
+usc.schemeName =  String.instantialize (this.schemeName);
+usc.lowerCaseColours =  new Array (this.lowerCaseColours.length);
+System.arraycopy (this.lowerCaseColours, 0, usc.lowerCaseColours, 0, this.lowerCaseColours.length);
+}return usc;
+}, "jalview.datamodel.AnnotatedCollectionI,java.util.Map");
+Clazz_makeConstructor (c$, 
+function (colour) {
+Clazz_superConstructor (this, jalview.schemes.UserColourScheme, [jalview.schemes.ResidueProperties.aaIndex]);
+var col = this.getColourFromString (colour);
+if (col == null) {
+System.out.println ("Unknown colour!! " + colour);
+col = this.createColourFromName (colour);
+}this.colors =  new Array (24);
+for (var i = 0; i < 24; i++) {
+this.colors[i] = col;
+}
+this.schemeName = colour;
+}, "~S");
+Clazz_defineMethod (c$, "getColours", 
+function () {
+return this.colors;
+});
+Clazz_defineMethod (c$, "getLowerCaseColours", 
+function () {
+return this.lowerCaseColours;
+});
+Clazz_defineMethod (c$, "setName", 
+function (name) {
+this.schemeName = name;
+}, "~S");
+Clazz_defineMethod (c$, "getName", 
+function () {
+return this.schemeName;
+});
+Clazz_defineMethod (c$, "getColourFromString", 
+function (colour) {
+colour = colour.trim ();
+var col = null;
+try {
+var value = Integer.parseInt (colour, 16);
+col =  new java.awt.Color (value);
+} catch (ex) {
+if (Clazz_exceptionOf (ex, NumberFormatException)) {
+} else {
+throw ex;
+}
+}
+if (col == null) {
+col = jalview.schemes.ColourSchemeProperty.getAWTColorFromName (colour);
+}if (col == null) {
+try {
+var st =  new java.util.StringTokenizer (colour, ",");
+var r = Integer.parseInt (st.nextToken ());
+var g = Integer.parseInt (st.nextToken ());
+var b = Integer.parseInt (st.nextToken ());
+col =  new java.awt.Color (r, g, b);
+} catch (ex) {
+if (Clazz_exceptionOf (ex, Exception)) {
+} else {
+throw ex;
+}
+}
+}return col;
+}, "~S");
+Clazz_defineMethod (c$, "createColourFromName", 
+function (name) {
+var r;
+var g;
+var b;
+var lsize = name.length;
+var start = 0;
+var end = Clazz_doubleToInt (lsize / 3);
+var rgbOffset = Math.abs (name.hashCode () % 10) * 15;
+r = Math.abs (name.substring (start, end).hashCode () + rgbOffset) % 210 + 20;
+start = end;
+end += Clazz_doubleToInt (lsize / 3);
+if (end > lsize) {
+end = lsize;
+}g = Math.abs (name.substring (start, end).hashCode () + rgbOffset) % 210 + 20;
+b = Math.abs (name.substring (end).hashCode () + rgbOffset) % 210 + 20;
+var color =  new java.awt.Color (r, g, b);
+return color;
+}, "~S");
+Clazz_defineMethod (c$, "parseAppletParameter", 
+function (paramValue) {
+var st =  new java.util.StringTokenizer (paramValue, ";");
+var st2;
+var token = null;
+var colour;
+var residues;
+try {
+while (st.hasMoreElements ()) {
+token = st.nextToken ().trim ();
+residues = token.substring (0, token.indexOf ("="));
+colour = token.substring (token.indexOf ("=") + 1);
+st2 =  new java.util.StringTokenizer (residues, " ,");
+while (st2.hasMoreTokens ()) {
+token = st2.nextToken ();
+if (jalview.schemes.ResidueProperties.aaIndex[token.charCodeAt (0)] == -1) {
+continue;
+}var colIndex = jalview.schemes.ResidueProperties.aaIndex[token.charCodeAt (0)];
+if (token.equalsIgnoreCase ("lowerCase")) {
+if (this.lowerCaseColours == null) {
+this.lowerCaseColours =  new Array (23);
+}for (var i = 0; i < 23; i++) {
+if (this.lowerCaseColours[i] == null) {
+this.lowerCaseColours[i] = this.getColourFromString (colour);
+}}
+continue;
+}if (token.equals (token.toLowerCase ())) {
+if (this.lowerCaseColours == null) {
+this.lowerCaseColours =  new Array (23);
+}this.lowerCaseColours[colIndex] = this.getColourFromString (colour);
+} else {
+this.colors[colIndex] = this.getColourFromString (colour);
+}}
+}
+} catch (ex) {
+if (Clazz_exceptionOf (ex, Exception)) {
+System.out.println ("Error parsing userDefinedColours:\n" + token + "\n" + ex);
+} else {
+throw ex;
+}
+}
+}, "~S");
+Clazz_overrideMethod (c$, "findColourSeq", 
+function (c, j, seq) {
+var currentColour;
+var index = jalview.schemes.ResidueProperties.aaIndex[c.charCodeAt (0)];
+if ((this.threshold == 0) || this.aboveThreshold (c, j)) {
+if (this.lowerCaseColours != null && 'a' <= c && c <= 'z') {
+currentColour = this.lowerCaseColours[index];
+} else {
+currentColour = this.colors[index];
+}} else {
+currentColour = java.awt.Color.white;
+}if (this.conservationColouring) {
+currentColour = this.applyConservation (currentColour, j);
+}return currentColour;
+}, "~S,~N,jalview.datamodel.SequenceI");
+Clazz_defineMethod (c$, "setLowerCaseColours", 
+function (lcolours) {
+this.lowerCaseColours = lcolours;
+}, "~A");
+});
+Clazz_declarePackage ("jalview.schemes");
+Clazz_load (["jalview.schemes.ResidueColourScheme"], "jalview.schemes.ZappoColourScheme", ["jalview.schemes.ResidueProperties"], function () {
+c$ = Clazz_declareType (jalview.schemes, "ZappoColourScheme", jalview.schemes.ResidueColourScheme);
+Clazz_makeConstructor (c$, 
+function () {
+Clazz_superConstructor (this, jalview.schemes.ZappoColourScheme, [jalview.schemes.ResidueProperties.aaIndex, jalview.schemes.ResidueProperties.zappo, 0]);
+});
+});
+Clazz_declarePackage ("jalview.structure");
+Clazz_load (["java.util.ArrayList", "$.HashMap", "$.LinkedHashSet", "$.Vector"], "jalview.structure.StructureSelectionManager", ["MCview.PDBfile", "jalview.analysis.AlignSeq", "jalview.commands.EditCommand", "$.OrderCommand", "jalview.datamodel.Mapping", "$.SearchResults", "jalview.io.AppletFormatAdapter", "jalview.structure.AtomSpec", "$.SecondaryStructureListener", "$.SequenceListener", "$.StructureListener", "$.StructureMapping", "$.VamsasListener", "jalview.util.MappingUtils", "$.MessageManager", "java.lang.Error", "$.NullPointerException", "$.StringBuilder", "java.util.Arrays", "$.Collections", "$.IdentityHashMap"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.mappings = null;
+this.processSecondaryStructure = false;
+this.secStructServices = false;
+this.addTempFacAnnot = false;
+this.seqmappings = null;
+this.seqMappingRefCounts = null;
+this.commandListeners = null;
+this.sel_listeners = null;
+this.pdbIdFileName = null;
+this.pdbFileNameId = null;
+this.relaySeqMappings = true;
+this.listeners = null;
+this.handlingVamsasMo = false;
+this.lastmsg = 0;
+this.view_listeners = null;
+Clazz_instantialize (this, arguments);
+}, jalview.structure, "StructureSelectionManager");
+Clazz_prepareFields (c$, function () {
+this.mappings =  new java.util.ArrayList ();
+this.seqmappings =  new java.util.LinkedHashSet ();
+this.seqMappingRefCounts =  new java.util.HashMap ();
+this.commandListeners =  new java.util.ArrayList ();
+this.sel_listeners =  new java.util.ArrayList ();
+this.pdbIdFileName =  new java.util.HashMap ();
+this.pdbFileNameId =  new java.util.HashMap ();
+this.listeners =  new java.util.Vector ();
+this.view_listeners =  new java.util.Vector ();
+});
+Clazz_defineMethod (c$, "isSecStructServices", 
+function () {
+return this.secStructServices;
+});
+Clazz_defineMethod (c$, "setSecStructServices", 
+function (secStructServices) {
+this.secStructServices = secStructServices;
+}, "~B");
+Clazz_defineMethod (c$, "isAddTempFacAnnot", 
+function () {
+return this.addTempFacAnnot;
+});
+Clazz_defineMethod (c$, "setAddTempFacAnnot", 
+function (addTempFacAnnot) {
+this.addTempFacAnnot = addTempFacAnnot;
+}, "~B");
+Clazz_defineMethod (c$, "isProcessSecondaryStructure", 
+function () {
+return this.processSecondaryStructure;
+});
+Clazz_defineMethod (c$, "setProcessSecondaryStructure", 
+function (enable) {
+this.processSecondaryStructure = enable;
+}, "~B");
+Clazz_defineMethod (c$, "reportMapping", 
+function () {
+if (this.mappings.isEmpty ()) {
+System.err.println ("reportMapping: No PDB/Sequence mappings.");
+} else {
+System.err.println ("reportMapping: There are " + this.mappings.size () + " mappings.");
+var i = 0;
+for (var sm, $sm = this.mappings.iterator (); $sm.hasNext () && ((sm = $sm.next ()) || true);) {
+System.err.println ("mapping " + i++ + " : " + sm.pdbfile);
+}
+}});
+Clazz_defineMethod (c$, "registerPDBFile", 
+function (idForFile, absoluteFile) {
+this.pdbIdFileName.put (idForFile, absoluteFile);
+this.pdbFileNameId.put (absoluteFile, idForFile);
+}, "~S,~S");
+Clazz_defineMethod (c$, "findIdForPDBFile", 
+function (idOrFile) {
+var id = this.pdbFileNameId.get (idOrFile);
+return id;
+}, "~S");
+Clazz_defineMethod (c$, "findFileForPDBId", 
+function (idOrFile) {
+var id = this.pdbIdFileName.get (idOrFile);
+return id;
+}, "~S");
+Clazz_defineMethod (c$, "isPDBFileRegistered", 
+function (idOrFile) {
+return this.pdbFileNameId.containsKey (idOrFile) || this.pdbIdFileName.containsKey (idOrFile);
+}, "~S");
+c$.getStructureSelectionManager = Clazz_defineMethod (c$, "getStructureSelectionManager", 
+function (context) {
+if (context == null) {
+if (jalview.structure.StructureSelectionManager.nullProvider == null) {
+if (jalview.structure.StructureSelectionManager.instances != null) {
+throw  new Error (jalview.util.MessageManager.getString ("error.implementation_error_structure_selection_manager_null"),  new NullPointerException (jalview.util.MessageManager.getString ("exception.ssm_context_is_null")));
+} else {
+jalview.structure.StructureSelectionManager.nullProvider =  new jalview.structure.StructureSelectionManager ();
+}return jalview.structure.StructureSelectionManager.nullProvider;
+}}if (jalview.structure.StructureSelectionManager.instances == null) {
+jalview.structure.StructureSelectionManager.instances =  new java.util.IdentityHashMap ();
+}var instance = jalview.structure.StructureSelectionManager.instances.get (context);
+if (instance == null) {
+if (jalview.structure.StructureSelectionManager.nullProvider != null) {
+instance = jalview.structure.StructureSelectionManager.nullProvider;
+} else {
+instance =  new jalview.structure.StructureSelectionManager ();
+}jalview.structure.StructureSelectionManager.instances.put (context, instance);
+}return instance;
+}, "jalview.api.StructureSelectionManagerProvider");
+Clazz_defineMethod (c$, "setRelaySeqMappings", 
+function (relay) {
+this.relaySeqMappings = relay;
+}, "~B");
+Clazz_defineMethod (c$, "isRelaySeqMappingsEnabled", 
+function () {
+return this.relaySeqMappings;
+});
+Clazz_defineMethod (c$, "addStructureViewerListener", 
+function (svl) {
+if (!this.listeners.contains (svl)) {
+this.listeners.addElement (svl);
+}}, "~O");
+Clazz_defineMethod (c$, "alreadyMappedToFile", 
+function (pdbid) {
+for (var sm, $sm = this.mappings.iterator (); $sm.hasNext () && ((sm = $sm.next ()) || true);) {
+if (sm.getPdbId ().equals (pdbid)) {
+return sm.pdbfile;
+}}
+return null;
+}, "~S");
+Clazz_defineMethod (c$, "setMapping", 
+function (sequence, targetChains, pdbFile, protocol) {
+return this.setMapping (true, sequence, targetChains, pdbFile, protocol);
+}, "~A,~A,~S,~S");
+Clazz_defineMethod (c$, "setMapping", 
+function (forStructureView, sequence, targetChains, pdbFile, protocol) {
+var parseSecStr = this.processSecondaryStructure;
+if (this.isPDBFileRegistered (pdbFile)) {
+for (var sq, $sq = 0, $$sq = sequence; $sq < $$sq.length && ((sq = $$sq[$sq]) || true); $sq++) {
+var ds = sq;
+while (ds.getDatasetSequence () != null) {
+ds = ds.getDatasetSequence ();
+}
+;if (ds.getAnnotation () != null) {
+for (var ala, $ala = 0, $$ala = ds.getAnnotation (); $ala < $$ala.length && ((ala = $$ala[$ala]) || true); $ala++) {
+if (MCview.PDBfile.isCalcIdForFile (ala, this.findIdForPDBFile (pdbFile))) {
+parseSecStr = false;
+}}
+}}
+}var pdb = null;
+try {
+pdb =  new MCview.PDBfile (this.addTempFacAnnot, parseSecStr, this.secStructServices, pdbFile, protocol);
+if (pdb.id != null && pdb.id.trim ().length > 0 && jalview.io.AppletFormatAdapter.FILE.equals (protocol)) {
+this.registerPDBFile (pdb.id.trim (), pdbFile);
+}} catch (ex) {
+if (Clazz_exceptionOf (ex, Exception)) {
+ex.printStackTrace ();
+return null;
+} else {
+throw ex;
+}
+}
+var targetChain;
+for (var s = 0; s < sequence.length; s++) {
+var infChain = true;
+var seq = sequence[s];
+if (targetChains != null && targetChains[s] != null) {
+infChain = false;
+targetChain = targetChains[s];
+} else if (seq.getName ().indexOf ("|") > -1) {
+targetChain = seq.getName ().substring (seq.getName ().lastIndexOf ("|") + 1);
+if (targetChain.length > 1) {
+if (targetChain.trim ().length == 0) {
+targetChain = " ";
+} else {
+targetChain = "";
+}}} else {
+targetChain = "";
+}var max = -10;
+var maxAlignseq = null;
+var maxChainId = " ";
+var maxChain = null;
+var first = true;
+for (var chain, $chain = pdb.chains.iterator (); $chain.hasNext () && ((chain = $chain.next ()) || true);) {
+if (targetChain.length > 0 && !targetChain.equals (chain.id) && !infChain) {
+continue;
+}var type = chain.isNa ? "dna" : "pep";
+var as = jalview.analysis.AlignSeq.doGlobalNWAlignment (seq, chain.sequence, type);
+if (first || as.maxscore > max || (as.maxscore == max && chain.id.equals (targetChain))) {
+first = false;
+maxChain = chain;
+max = as.maxscore;
+maxAlignseq = as;
+maxChainId = chain.id;
+}}
+if (maxChain == null) {
+continue;
+}var mappingDetails =  new StringBuilder (128);
+mappingDetails.append (jalview.structure.StructureSelectionManager.NEWLINE).append ("PDB Sequence is :").append (jalview.structure.StructureSelectionManager.NEWLINE).append ("Sequence = ").append (maxChain.sequence.getSequenceAsString ());
+mappingDetails.append (jalview.structure.StructureSelectionManager.NEWLINE).append ("No of residues = ").append (maxChain.residues.size ()).append (jalview.structure.StructureSelectionManager.NEWLINE).append (jalview.structure.StructureSelectionManager.NEWLINE);
+var ps = ((Clazz_isClassDefined ("jalview.structure.StructureSelectionManager$1") ? 0 : jalview.structure.StructureSelectionManager.$StructureSelectionManager$1$ ()), Clazz_innerTypeInstance (jalview.structure.StructureSelectionManager$1, this, Clazz_cloneFinals ("mappingDetails", mappingDetails), System.out));
+maxAlignseq.printAlignment (ps);
+mappingDetails.append (jalview.structure.StructureSelectionManager.NEWLINE).append ("PDB start/end ");
+mappingDetails.append (String.valueOf (maxAlignseq.seq2start)).append (" ");
+mappingDetails.append (String.valueOf (maxAlignseq.seq2end));
+mappingDetails.append (jalview.structure.StructureSelectionManager.NEWLINE).append ("SEQ start/end ");
+mappingDetails.append (String.valueOf (maxAlignseq.seq1start + seq.getStart () - 1)).append (" ");
+mappingDetails.append (String.valueOf (maxAlignseq.seq1end + seq.getEnd () - 1));
+maxChain.makeExactMapping (maxAlignseq, seq);
+var sqmpping = maxAlignseq.getMappingFromS1 (false);
+var omap =  new jalview.datamodel.Mapping (sqmpping.getMap ().getInverse ());
+maxChain.transferRESNUMFeatures (seq, null);
+var mapping =  Clazz_newIntArray (seq.findPosition (seq.getLength ()) + 2, 2, 0);
+var resNum = -10000;
+var index = 0;
+do {
+var tmp = maxChain.atoms.elementAt (index);
+if (resNum != tmp.resNumber && tmp.alignmentMapping != -1) {
+resNum = tmp.resNumber;
+mapping[tmp.alignmentMapping + 1][0] = tmp.resNumber;
+mapping[tmp.alignmentMapping + 1][1] = tmp.atomIndex;
+}index++;
+} while (index < maxChain.atoms.size ());
+if (protocol.equals (jalview.io.AppletFormatAdapter.PASTE)) {
+pdbFile = "INLINE" + pdb.id;
+}var newMapping =  new jalview.structure.StructureMapping (seq, pdbFile, pdb.id, maxChainId, mapping, mappingDetails.toString ());
+if (forStructureView) {
+this.mappings.add (newMapping);
+}maxChain.transferResidueAnnotation (newMapping, sqmpping);
+}
+return pdb;
+}, "~B,~A,~A,~S,~S");
+Clazz_defineMethod (c$, "removeStructureViewerListener", 
+function (svl, pdbfiles) {
+this.listeners.removeElement (svl);
+if (Clazz_instanceOf (svl, jalview.structure.SequenceListener)) {
+for (var i = 0; i < this.listeners.size (); i++) {
+if (Clazz_instanceOf (this.listeners.elementAt (i), jalview.structure.StructureListener)) {
+(this.listeners.elementAt (i)).releaseReferences (svl);
+}}
+}if (pdbfiles == null) {
+return;
+}var pdbs =  new java.util.ArrayList (java.util.Arrays.asList (pdbfiles));
+var sl;
+for (var i = 0; i < this.listeners.size (); i++) {
+if (Clazz_instanceOf (this.listeners.elementAt (i), jalview.structure.StructureListener)) {
+sl = this.listeners.elementAt (i);
+for (var pdbfile, $pdbfile = 0, $$pdbfile = sl.getPdbFile (); $pdbfile < $$pdbfile.length && ((pdbfile = $$pdbfile[$pdbfile]) || true); $pdbfile++) {
+pdbs.remove (pdbfile);
+}
+}}
+if (pdbs.size () > 0) {
+var tmp =  new java.util.ArrayList ();
+for (var sm, $sm = this.mappings.iterator (); $sm.hasNext () && ((sm = $sm.next ()) || true);) {
+if (!pdbs.contains (sm.pdbfile)) {
+tmp.add (sm);
+}}
+this.mappings = tmp;
+}}, "~O,~A");
+Clazz_defineMethod (c$, "mouseOverStructure", 
+function (pdbResNum, chain, pdbfile) {
+var atomSpec =  new jalview.structure.AtomSpec (pdbfile, chain, pdbResNum, 0);
+var atoms = java.util.Collections.singletonList (atomSpec);
+this.mouseOverStructure (atoms);
+}, "~N,~S,~S");
+Clazz_defineMethod (c$, "mouseOverStructure", 
+function (atoms) {
+if (this.listeners == null) {
+return;
+}var hasSequenceListener = false;
+for (var i = 0; i < this.listeners.size (); i++) {
+if (Clazz_instanceOf (this.listeners.elementAt (i), jalview.structure.SequenceListener)) {
+hasSequenceListener = true;
+}}
+if (!hasSequenceListener) {
+return;
+}var results =  new jalview.datamodel.SearchResults ();
+for (var atom, $atom = atoms.iterator (); $atom.hasNext () && ((atom = $atom.next ()) || true);) {
+var lastseq = null;
+var lastipos = -1;
+for (var sm, $sm = this.mappings.iterator (); $sm.hasNext () && ((sm = $sm.next ()) || true);) {
+if (sm.pdbfile.equals (atom.getPdbFile ()) && sm.pdbchain.equals (atom.getChain ())) {
+var indexpos = sm.getSeqPos (atom.getPdbResNum ());
+if (lastipos != indexpos && lastseq !== sm.sequence) {
+results.addResult (sm.sequence, indexpos, indexpos);
+lastipos = indexpos;
+lastseq = sm.sequence;
+for (var acf, $acf = this.seqmappings.iterator (); $acf.hasNext () && ((acf = $acf.next ()) || true);) {
+acf.markMappedRegion (sm.sequence, indexpos, results);
+}
+}}}
+}
+for (var li, $li = this.listeners.iterator (); $li.hasNext () && ((li = $li.next ()) || true);) {
+if (Clazz_instanceOf (li, jalview.structure.SequenceListener)) {
+(li).highlightSequence (results);
+}}
+}, "java.util.List");
+Clazz_defineMethod (c$, "mouseOverSequence", 
+function (seq, indexpos, index, source) {
+var hasSequenceListeners = this.handlingVamsasMo || !this.seqmappings.isEmpty ();
+var results = null;
+if (index == -1) {
+index = seq.findPosition (indexpos);
+}for (var i = 0; i < this.listeners.size (); i++) {
+var listener = this.listeners.elementAt (i);
+if (listener === source) {
+continue;
+}if (Clazz_instanceOf (listener, jalview.structure.StructureListener)) {
+this.highlightStructure (listener, seq, index);
+} else {
+if (Clazz_instanceOf (listener, jalview.structure.SequenceListener)) {
+var seqListener = listener;
+if (hasSequenceListeners && seqListener.getVamsasSource () !== source) {
+if (this.relaySeqMappings) {
+if (results == null) {
+results = jalview.util.MappingUtils.buildSearchResults (seq, index, this.seqmappings);
+}if (this.handlingVamsasMo) {
+results.addResult (seq, index, index);
+}seqListener.highlightSequence (results);
+}}} else if (Clazz_instanceOf (listener, jalview.structure.VamsasListener) && !this.handlingVamsasMo) {
+(listener).mouseOverSequence (seq, indexpos, source);
+} else if (Clazz_instanceOf (listener, jalview.structure.SecondaryStructureListener)) {
+(listener).mouseOverSequence (seq, indexpos, index);
+}}}
+}, "jalview.datamodel.SequenceI,~N,~N,jalview.structure.VamsasSource");
+Clazz_defineMethod (c$, "highlightStructure", 
+function (sl, seq, index) {
+if (!sl.isListeningFor (seq)) {
+return;
+}var atomNo;
+var atoms =  new java.util.ArrayList ();
+for (var sm, $sm = this.mappings.iterator (); $sm.hasNext () && ((sm = $sm.next ()) || true);) {
+if (sm.sequence === seq || sm.sequence === seq.getDatasetSequence ()) {
+atomNo = sm.getAtomNum (index);
+if (atomNo > 0) {
+atoms.add ( new jalview.structure.AtomSpec (sm.pdbfile, sm.pdbchain, sm.getPDBResNum (index), atomNo));
+}}}
+sl.highlightAtoms (atoms);
+}, "jalview.structure.StructureListener,jalview.datamodel.SequenceI,~N");
+Clazz_defineMethod (c$, "mouseOverVamsasSequence", 
+function (sequenceI, position, source) {
+this.handlingVamsasMo = true;
+var msg = sequenceI.hashCode () * (1 + position);
+if (this.lastmsg != msg) {
+this.lastmsg = msg;
+this.mouseOverSequence (sequenceI, position, -1, source);
+}this.handlingVamsasMo = false;
+}, "jalview.datamodel.SequenceI,~N,jalview.structure.VamsasSource");
+Clazz_defineMethod (c$, "colourSequenceFromStructure", 
+function (seq, pdbid) {
+return null;
+}, "jalview.datamodel.SequenceI,~S");
+Clazz_defineMethod (c$, "structureSelectionChanged", 
+function () {
+});
+Clazz_defineMethod (c$, "sequenceSelectionChanged", 
+function () {
+});
+Clazz_defineMethod (c$, "sequenceColoursChanged", 
+function (source) {
+var sl;
+for (var i = 0; i < this.listeners.size (); i++) {
+if (Clazz_instanceOf (this.listeners.elementAt (i), jalview.structure.StructureListener)) {
+sl = this.listeners.elementAt (i);
+sl.updateColours (source);
+}}
+}, "~O");
+Clazz_defineMethod (c$, "getMapping", 
+function (pdbfile) {
+var tmp =  new java.util.ArrayList ();
+for (var sm, $sm = this.mappings.iterator (); $sm.hasNext () && ((sm = $sm.next ()) || true);) {
+if (sm.pdbfile.equals (pdbfile)) {
+tmp.add (sm);
+}}
+return tmp.toArray ( new Array (tmp.size ()));
+}, "~S");
+Clazz_defineMethod (c$, "printMappings", 
+function (pdbfile, seqs) {
+if (pdbfile == null || seqs == null || seqs.isEmpty ()) {
+return "";
+}var sb =  new StringBuilder (64);
+for (var sm, $sm = this.mappings.iterator (); $sm.hasNext () && ((sm = $sm.next ()) || true);) {
+if (sm.pdbfile.equals (pdbfile) && seqs.contains (sm.sequence)) {
+sb.append (sm.mappingDetails);
+sb.append (jalview.structure.StructureSelectionManager.NEWLINE);
+sb.append ("=====================");
+sb.append (jalview.structure.StructureSelectionManager.NEWLINE);
+}}
+sb.append (jalview.structure.StructureSelectionManager.NEWLINE);
+return sb.toString ();
+}, "~S,java.util.List");
+Clazz_defineMethod (c$, "removeMappings", 
+function (set) {
+if (set != null) {
+for (var acf, $acf = set.iterator (); $acf.hasNext () && ((acf = $acf.next ()) || true);) {
+this.removeMapping (acf);
+}
+}}, "java.util.Set");
+Clazz_defineMethod (c$, "removeMapping", 
+function (acf) {
+if (acf != null && this.seqmappings.contains (acf)) {
+var count = (this.seqMappingRefCounts.get (acf)).intValue ();
+count--;
+if (count > 0) {
+this.seqMappingRefCounts.put (acf, new Integer (count));
+} else {
+this.seqmappings.remove (acf);
+this.seqMappingRefCounts.remove (acf);
+}}}, "jalview.datamodel.AlignedCodonFrame");
+Clazz_defineMethod (c$, "addMappings", 
+function (set) {
+if (set != null) {
+for (var acf, $acf = set.iterator (); $acf.hasNext () && ((acf = $acf.next ()) || true);) {
+this.addMapping (acf);
+}
+}}, "java.util.Set");
+Clazz_defineMethod (c$, "addMapping", 
+function (acf) {
+if (acf != null) {
+if (this.seqmappings.contains (acf)) {
+this.seqMappingRefCounts.put (acf, new Integer ((this.seqMappingRefCounts.get (acf)).intValue () + 1));
+} else {
+this.seqmappings.add (acf);
+this.seqMappingRefCounts.put (acf, new Integer (1));
+}}}, "jalview.datamodel.AlignedCodonFrame");
+Clazz_defineMethod (c$, "addSelectionListener", 
+function (selecter) {
+if (!this.sel_listeners.contains (selecter)) {
+this.sel_listeners.add (selecter);
+}}, "jalview.structure.SelectionListener");
+Clazz_defineMethod (c$, "removeSelectionListener", 
+function (toremove) {
+if (this.sel_listeners.contains (toremove)) {
+this.sel_listeners.remove (toremove);
+}}, "jalview.structure.SelectionListener");
+Clazz_defineMethod (c$, "sendSelection", 
+function (selection, colsel, source) {
+for (var slis, $slis = this.sel_listeners.iterator (); $slis.hasNext () && ((slis = $slis.next ()) || true);) {
+if (slis !== source) {
+slis.selection (selection, colsel, source);
+}}
+}, "jalview.datamodel.SequenceGroup,jalview.datamodel.ColumnSelection,jalview.structure.SelectionSource");
+Clazz_defineMethod (c$, "sendViewPosition", 
+function (source, startRes, endRes, startSeq, endSeq) {
+if (this.view_listeners != null && this.view_listeners.size () > 0) {
+var listeners = this.view_listeners.elements ();
+while (listeners.hasMoreElements ()) {
+var slis = listeners.nextElement ();
+if (slis !== source) {
+slis.viewPosition (startRes, endRes, startSeq, endSeq, source);
+};}
+}}, "jalview.api.AlignmentViewPanel,~N,~N,~N,~N");
+c$.release = Clazz_defineMethod (c$, "release", 
+function (jalviewLite) {
+{
+if (jalview.structure.StructureSelectionManager.instances == null) {
+return;
+}var mnger = (jalview.structure.StructureSelectionManager.instances.get (jalviewLite));
+if (mnger != null) {
+jalview.structure.StructureSelectionManager.instances.remove (jalviewLite);
+try {
+mnger.finalize ();
+} catch (x) {
+}
+}}}, "jalview.api.StructureSelectionManagerProvider");
+Clazz_defineMethod (c$, "registerPDBEntry", 
+function (pdbentry) {
+if (pdbentry.getFile () != null && pdbentry.getFile ().trim ().length > 0) {
+this.registerPDBFile (pdbentry.getId (), pdbentry.getFile ());
+}}, "jalview.datamodel.PDBEntry");
+Clazz_defineMethod (c$, "addCommandListener", 
+function (cl) {
+if (!this.commandListeners.contains (cl)) {
+this.commandListeners.add (cl);
+}}, "jalview.structure.CommandListener");
+Clazz_defineMethod (c$, "hasCommandListener", 
+function (cl) {
+return this.commandListeners.contains (cl);
+}, "jalview.structure.CommandListener");
+Clazz_defineMethod (c$, "removeCommandListener", 
+function (l) {
+return this.commandListeners.remove (l);
+}, "jalview.structure.CommandListener");
+Clazz_defineMethod (c$, "commandPerformed", 
+function (command, undo, source) {
+for (var listener, $listener = this.commandListeners.iterator (); $listener.hasNext () && ((listener = $listener.next ()) || true);) {
+listener.mirrorCommand (command, undo, this, source);
+}
+}, "jalview.commands.CommandI,~B,jalview.structure.VamsasSource");
+Clazz_defineMethod (c$, "mapCommand", 
+function (command, undo, mapTo, gapChar) {
+if (Clazz_instanceOf (command, jalview.commands.EditCommand)) {
+return jalview.util.MappingUtils.mapEditCommand (command, undo, mapTo, gapChar, this.seqmappings);
+} else if (Clazz_instanceOf (command, jalview.commands.OrderCommand)) {
+return jalview.util.MappingUtils.mapOrderCommand (command, undo, mapTo, this.seqmappings);
+}return null;
+}, "jalview.commands.CommandI,~B,jalview.datamodel.AlignmentI,~S");
+c$.$StructureSelectionManager$1$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_declareAnonymous (jalview.structure, "StructureSelectionManager$1", java.io.PrintStream);
+Clazz_defineMethod (c$, "print", 
+function (x) {
+this.f$.mappingDetails.append (x);
+}, "~S");
+Clazz_defineMethod (c$, "println", 
+function () {
+this.f$.mappingDetails.append (jalview.structure.StructureSelectionManager.NEWLINE);
+});
+c$ = Clazz_p0p ();
+};
+c$.NEWLINE = c$.prototype.NEWLINE = System.lineSeparator ();
+Clazz_defineStatics (c$,
+"instances", null,
+"nullProvider", null);
+});
+Clazz_declarePackage ("MCview");
+Clazz_load (["jalview.io.AlignFile"], "MCview.PDBfile", ["MCview.Atom", "$.PDBChain", "jalview.analysis.AlignSeq", "jalview.datamodel.Alignment", "$.AlignmentI", "$.PDBEntry", "jalview.io.FileParse", "jalview.util.MessageManager", "java.awt.Color", "java.io.IOException", "java.util.ArrayList", "$.Hashtable", "$.Vector"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.chains = null;
+this.id = null;
+this.visibleChainAnnotation = false;
+this.$predictSecondaryStructure = true;
+this.externalSecondaryStructure = false;
+Clazz_instantialize (this, arguments);
+}, MCview, "PDBfile", jalview.io.AlignFile);
+Clazz_makeConstructor (c$, 
+function (addAlignmentAnnotations, predictSecondaryStructure, externalSecStr) {
+Clazz_superConstructor (this, MCview.PDBfile);
+this.visibleChainAnnotation = addAlignmentAnnotations;
+this.$predictSecondaryStructure = predictSecondaryStructure;
+this.externalSecondaryStructure = externalSecStr;
+}, "~B,~B,~B");
+Clazz_makeConstructor (c$, 
+function (addAlignmentAnnotations, predictSecondaryStructure, externalSecStr, file, protocol) {
+Clazz_superConstructor (this, MCview.PDBfile, [false, file, protocol]);
+this.visibleChainAnnotation = addAlignmentAnnotations;
+this.$predictSecondaryStructure = predictSecondaryStructure;
+this.externalSecondaryStructure = externalSecStr;
+this.doParse ();
+}, "~B,~B,~B,~S,~S");
+Clazz_makeConstructor (c$, 
+function (addAlignmentAnnotations, predictSecondaryStructure, externalSecStr, source) {
+Clazz_superConstructor (this, MCview.PDBfile, [false, source]);
+this.visibleChainAnnotation = addAlignmentAnnotations;
+this.$predictSecondaryStructure = predictSecondaryStructure;
+this.externalSecondaryStructure = externalSecStr;
+this.doParse ();
+}, "~B,~B,~B,jalview.io.FileParse");
+Clazz_overrideMethod (c$, "print", 
+function () {
+return null;
+});
+Clazz_overrideMethod (c$, "parse", 
+function () {
+this.id = this.safeName (this.getDataName ());
+this.chains =  new java.util.Vector ();
+var rna =  new java.util.ArrayList ();
+var prot =  new java.util.ArrayList ();
+var tmpchain;
+var line = null;
+var modelFlag = false;
+var terFlag = false;
+var lastID = "";
+var indexx = 0;
+var atomnam = null;
+try {
+while ((line = this.nextLine ()) != null) {
+if (line.indexOf ("HEADER") == 0) {
+if (line.length > 62) {
+var tid;
+if (line.length > 67) {
+tid = line.substring (62, 67).trim ();
+} else {
+tid = line.substring (62).trim ();
+}if (tid.length > 0) {
+this.id = tid;
+}continue;
+}}if (line.indexOf ("SEQRES") == 0) {
+}if (line.indexOf ("MODEL") == 0) {
+modelFlag = true;
+}if (line.indexOf ("TER") == 0) {
+terFlag = true;
+}if (modelFlag && line.indexOf ("ENDMDL") == 0) {
+break;
+}if (line.indexOf ("ATOM") == 0 || (line.indexOf ("HETATM") == 0 && !terFlag)) {
+terFlag = false;
+atomnam = line.substring (12, 15).trim ();
+if (!atomnam.equals ("CA") && !atomnam.equals ("P")) {
+continue;
+}var tmpatom =  new MCview.Atom (line);
+tmpchain = this.findChain (tmpatom.chain);
+if (tmpchain != null) {
+if (tmpatom.resNumIns.trim ().equals (lastID)) {
+continue;
+}tmpchain.atoms.addElement (tmpatom);
+} else {
+tmpchain =  new MCview.PDBChain (this.id, tmpatom.chain);
+this.chains.addElement (tmpchain);
+tmpchain.atoms.addElement (tmpatom);
+}lastID = tmpatom.resNumIns.trim ();
+}this.index++;
+}
+this.makeResidueList ();
+this.makeCaBondList ();
+if (this.id == null) {
+this.id = this.inFile.getName ();
+}for (var chain, $chain = this.chains.iterator (); $chain.hasNext () && ((chain = $chain.next ()) || true);) {
+var chainseq = this.postProcessChain (chain);
+if (MCview.PDBfile.isRNA (chainseq)) {
+rna.add (chainseq);
+} else {
+prot.add (chainseq);
+}}
+if (this.$predictSecondaryStructure) {
+this.predictSecondaryStructure (rna, prot);
+}} catch (e$$) {
+if (Clazz_exceptionOf (e$$, OutOfMemoryError)) {
+var er = e$$;
+{
+System.out.println ("OUT OF MEMORY LOADING PDB FILE");
+throw  new java.io.IOException (jalview.util.MessageManager.getString ("exception.outofmemory_loading_pdb_file"));
+}
+} else if (Clazz_exceptionOf (e$$, NumberFormatException)) {
+var ex = e$$;
+{
+if (line != null) {
+System.err.println ("Couldn't read number from line:");
+System.err.println (line);
+}}
+} else {
+throw e$$;
+}
+}
+this.markCalcIds ();
+});
+Clazz_defineMethod (c$, "predictSecondaryStructure", 
+function (rnaSequences, proteinSequences) {
+if (this.externalSecondaryStructure && rnaSequences.size () > 0) {
+try {
+this.processPdbFileWithAnnotate3d (rnaSequences);
+} catch (x) {
+if (Clazz_exceptionOf (x, Exception)) {
+System.err.println ("Exceptions when dealing with RNA in pdb file");
+x.printStackTrace ();
+} else {
+throw x;
+}
+}
+}if (proteinSequences.size () > 0) {
+try {
+this.processPdbFileWithJmol (proteinSequences);
+} catch (x) {
+if (Clazz_exceptionOf (x, Exception)) {
+System.err.println ("Exceptions from Jmol when processing data in pdb file");
+x.printStackTrace ();
+} else {
+throw x;
+}
+}
+}}, "java.util.List,java.util.List");
+Clazz_defineMethod (c$, "postProcessChain", 
+function (chain) {
+var dataset = chain.sequence;
+dataset.setName (this.id + "|" + dataset.getName ());
+var entry =  new jalview.datamodel.PDBEntry ();
+entry.setId (this.id);
+entry.setType (jalview.datamodel.PDBEntry.Type.PDB);
+entry.setProperty ( new java.util.Hashtable ());
+if (chain.id != null) {
+entry.setChainCode (String.valueOf (chain.id));
+}if (this.inFile != null) {
+entry.setFile (this.inFile.getAbsolutePath ());
+} else {
+entry.setFile (this.getDataName ());
+}dataset.addPDBId (entry);
+var chainseq = dataset.deriveSequence ();
+this.seqs.addElement (chainseq);
+var chainannot = chainseq.getAnnotation ();
+if (chainannot != null && this.visibleChainAnnotation) {
+for (var ai = 0; ai < chainannot.length; ai++) {
+chainannot[ai].visible = this.visibleChainAnnotation;
+this.annotations.addElement (chainannot[ai]);
+}
+}return chainseq;
+}, "MCview.PDBChain");
+c$.isCalcIdHandled = Clazz_defineMethod (c$, "isCalcIdHandled", 
+function (calcId) {
+return calcId != null && (MCview.PDBfile.CALC_ID_PREFIX.equals (calcId));
+}, "~S");
+c$.isCalcIdForFile = Clazz_defineMethod (c$, "isCalcIdForFile", 
+function (alan, pdbFile) {
+return alan.getCalcId () != null && MCview.PDBfile.CALC_ID_PREFIX.equals (alan.getCalcId ()) && pdbFile.equals (alan.getProperty ("PDBID"));
+}, "jalview.datamodel.AlignmentAnnotation,~S");
+c$.relocateCalcId = Clazz_defineMethod (c$, "relocateCalcId", 
+function (calcId, alreadyLoadedPDB) {
+var s = MCview.PDBfile.CALC_ID_PREFIX.length;
+var end = calcId.indexOf (MCview.PDBfile.CALC_ID_PREFIX, s);
+var between = calcId.substring (s, end - 1);
+return MCview.PDBfile.CALC_ID_PREFIX + alreadyLoadedPDB.get (between) + ":" + calcId.substring (end);
+}, "~S,java.util.Hashtable");
+Clazz_defineMethod (c$, "markCalcIds", 
+ function () {
+for (var sq, $sq = this.seqs.iterator (); $sq.hasNext () && ((sq = $sq.next ()) || true);) {
+if (sq.getAnnotation () != null) {
+for (var aa, $aa = 0, $$aa = sq.getAnnotation (); $aa < $$aa.length && ((aa = $$aa[$aa]) || true); $aa++) {
+var oldId = aa.getCalcId ();
+if (oldId == null) {
+oldId = "";
+}aa.setCalcId (MCview.PDBfile.CALC_ID_PREFIX);
+aa.setProperty ("PDBID", this.id);
+aa.setProperty ("oldCalcId", oldId);
+}
+}}
+});
+Clazz_defineMethod (c$, "processPdbFileWithJmol", 
+ function (prot) {
+try {
+var cl = Clazz._4Name ("jalview.ext.jmol.PDBFileWithJmol");
+if (cl != null) {
+var constructor = cl.getConstructor ( Clazz_newArray (-1, [jalview.io.FileParse]));
+var args =  Clazz_newArray (-1, [ new jalview.io.FileParse (this.getDataName (), this.type)]);
+var jmf = constructor.newInstance (args);
+var al =  new jalview.datamodel.Alignment (cl.getMethod ("getSeqsAsArray",  Clazz_newArray (-1, [])).invoke (jmf, []));
+cl.getMethod ("addAnnotations",  Clazz_newArray (-1, [jalview.datamodel.AlignmentI])).invoke (jmf, [al]);
+for (var sq, $sq = al.getSequences ().iterator (); $sq.hasNext () && ((sq = $sq.next ()) || true);) {
+if (sq.getDatasetSequence () != null) {
+sq.getDatasetSequence ().getPDBId ().clear ();
+} else {
+sq.getPDBId ().clear ();
+}}
+this.replaceAndUpdateChains (prot, al, "pep", false);
+}} catch (q) {
+if (Clazz_exceptionOf (q, ClassNotFoundException)) {
+} else {
+throw q;
+}
+}
+}, "java.util.List");
+Clazz_defineMethod (c$, "replaceAndUpdateChains", 
+ function (prot, al, pep, b) {
+var replaced = jalview.analysis.AlignSeq.replaceMatchingSeqsWith (this.seqs, this.annotations, prot, al, pep, false);
+for (var ch, $ch = this.chains.iterator (); $ch.hasNext () && ((ch = $ch.next ()) || true);) {
+var p = 0;
+for (var sq, $sq = replaced.get (0).iterator (); $sq.hasNext () && ((sq = $sq.next ()) || true);) {
+p++;
+if (sq === ch.sequence || sq.getDatasetSequence () === ch.sequence) {
+p = -p;
+break;
+}}
+if (p < 0) {
+p = -p - 1;
+ch.shadow = replaced.get (1).get (p);
+ch.shadowMap = (replaced.get (2).get (p)).getMappingFromS1 (false);
+}}
+}, "java.util.List,jalview.datamodel.AlignmentI,~S,~B");
+Clazz_defineMethod (c$, "processPdbFileWithAnnotate3d", 
+ function (rna) {
+try {
+var cl = Clazz._4Name ("jalview.ws.jws1.Annotate3D");
+if (cl != null) {
+var annotate3d = cl.getConstructor ( Clazz_newArray (-1, [])).newInstance ( Clazz_newArray (-1, []));
+var al = (cl.getMethod ("getRNAMLFor",  Clazz_newArray (-1, [jalview.io.FileParse])).invoke (annotate3d,  Clazz_newArray (-1, [ new jalview.io.FileParse (this.getDataName (), this.type)])));
+for (var sq, $sq = al.getSequences ().iterator (); $sq.hasNext () && ((sq = $sq.next ()) || true);) {
+if (sq.getDatasetSequence () != null) {
+if (sq.getDatasetSequence ().getPDBId () != null) {
+sq.getDatasetSequence ().getPDBId ().clear ();
+}} else {
+if (sq.getPDBId () != null) {
+sq.getPDBId ().clear ();
+}}}
+this.replaceAndUpdateChains (rna, al, "dna", false);
+}} catch (x) {
+if (Clazz_exceptionOf (x, ClassNotFoundException)) {
+} else {
+throw x;
+}
+}
+;}, "java.util.List");
+Clazz_defineMethod (c$, "safeName", 
+ function (dataName) {
+var p = 0;
+while ((p = dataName.indexOf ("/")) > -1 && p < dataName.length) {
+dataName = dataName.substring (p + 1);
+}
+return dataName;
+}, "~S");
+Clazz_defineMethod (c$, "makeResidueList", 
+function () {
+for (var i = 0; i < this.chains.size (); i++) {
+this.chains.elementAt (i).makeResidueList (this.visibleChainAnnotation);
+}
+});
+Clazz_defineMethod (c$, "makeCaBondList", 
+function () {
+for (var i = 0; i < this.chains.size (); i++) {
+this.chains.elementAt (i).makeCaBondList ();
+}
+});
+Clazz_defineMethod (c$, "findChain", 
+function (id) {
+for (var i = 0; i < this.chains.size (); i++) {
+if (this.chains.elementAt (i).id.equals (id)) {
+return this.chains.elementAt (i);
+}}
+return null;
+}, "~S");
+Clazz_defineMethod (c$, "setChargeColours", 
+function () {
+for (var i = 0; i < this.chains.size (); i++) {
+this.chains.elementAt (i).setChargeColours ();
+}
+});
+Clazz_defineMethod (c$, "setColours", 
+function (cs) {
+for (var i = 0; i < this.chains.size (); i++) {
+this.chains.elementAt (i).setChainColours (cs);
+}
+}, "jalview.schemes.ColourSchemeI");
+Clazz_defineMethod (c$, "setChainColours", 
+function () {
+for (var i = 0; i < this.chains.size (); i++) {
+this.chains.elementAt (i).setChainColours (java.awt.Color.getHSBColor (1.0 / i, .4, 1.0));
+}
+});
+c$.isRNA = Clazz_defineMethod (c$, "isRNA", 
+function (seq) {
+for (var c, $c = 0, $$c = seq.getSequence (); $c < $$c.length && ((c = $$c[$c]) || true); $c++) {
+if ((c != 'A') && (c != 'C') && (c != 'G') && (c != 'U')) {
+return false;
+}}
+return true;
+}, "jalview.datamodel.SequenceI");
+Clazz_defineStatics (c$,
+"CALC_ID_PREFIX", "JalviewPDB");
+});
+Clazz_declarePackage ("jalview.io");
+Clazz_load (["jalview.io.FileParse"], "jalview.io.AlignFile", ["jalview.datamodel.Sequence", "jalview.util.MessageManager", "java.io.IOException", "java.lang.Error", "java.util.ArrayList", "$.Hashtable", "$.Vector"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.noSeqs = 0;
+this.maxLength = 0;
+this.seqs = null;
+this.annotations = null;
+this.seqGroups = null;
+this.properties = null;
+this.start = 0;
+this.end = 0;
+this.jvSuffix = true;
+this.parseCalled = false;
+this.newickStrings = null;
+Clazz_instantialize (this, arguments);
+}, jalview.io, "AlignFile", jalview.io.FileParse);
+Clazz_makeConstructor (c$, 
+function () {
+Clazz_superConstructor (this, jalview.io.AlignFile, []);
+this.initData ();
+});
+Clazz_makeConstructor (c$, 
+function (inFile, type) {
+this.construct (true, inFile, type);
+}, "~S,~S");
+Clazz_makeConstructor (c$, 
+function (parseImmediately, inFile, type) {
+Clazz_superConstructor (this, jalview.io.AlignFile, [inFile, type]);
+this.initData ();
+if (parseImmediately) {
+this.doParse ();
+}}, "~B,~S,~S");
+Clazz_makeConstructor (c$, 
+function (source) {
+this.construct (true, source);
+}, "jalview.io.FileParse");
+Clazz_makeConstructor (c$, 
+function (parseImmediately, source) {
+Clazz_superConstructor (this, jalview.io.AlignFile, [source]);
+this.initData ();
+if (parseImmediately) {
+this.doParse ();
+}}, "~B,jalview.io.FileParse");
+Clazz_defineMethod (c$, "doParse", 
+function () {
+if (this.parseCalled) {
+throw  new java.io.IOException ("Implementation error: Parser called twice for same data.\nNeed to call initData() again before parsing can be reattempted.");
+}this.parseCalled = true;
+this.parse ();
+for (var i = 0, c = this.seqs.size (); i < c; i++) {
+this.seqs.get (i).setIndex (i);
+}
+});
+Clazz_defineMethod (c$, "getSeqs", 
+function () {
+return this.seqs;
+});
+Clazz_defineMethod (c$, "getSeqGroups", 
+function () {
+return this.seqGroups;
+});
+Clazz_defineMethod (c$, "getSeqsAsArray", 
+function () {
+var s =  new Array (this.seqs.size ());
+for (var i = 0; i < this.seqs.size (); i++) {
+s[i] = this.seqs.elementAt (i);
+}
+return s;
+});
+Clazz_defineMethod (c$, "addAnnotations", 
+function (al) {
+this.addProperties (al);
+for (var i = 0; i < this.annotations.size (); i++) {
+var an = this.annotations.elementAt (i);
+an.validateRangeAndDisplay ();
+al.addAnnotation (an);
+}
+}, "jalview.datamodel.AlignmentI");
+Clazz_defineMethod (c$, "addSeqGroups", 
+function (al) {
+this.seqGroups = al.getGroups ();
+}, "jalview.datamodel.AlignmentI");
+Clazz_defineMethod (c$, "addProperties", 
+function (al) {
+if (this.properties != null && this.properties.size () > 0) {
+var keys = this.properties.keys ();
+var vals = this.properties.elements ();
+while (keys.hasMoreElements ()) {
+al.setProperty (keys.nextElement (), vals.nextElement ());
+}
+}}, "jalview.datamodel.AlignmentI");
+Clazz_defineMethod (c$, "setAlignmentProperty", 
+function (key, value) {
+if (key == null) {
+throw  new Error (jalview.util.MessageManager.getString ("error.implementation_error_cannot_have_null_alignment"));
+}if (value == null) {
+return;
+}if (this.properties == null) {
+this.properties =  new java.util.Hashtable ();
+}this.properties.put (key, value);
+}, "~O,~O");
+Clazz_defineMethod (c$, "getAlignmentProperty", 
+function (key) {
+if (this.properties != null && key != null) {
+return this.properties.get (key);
+}return null;
+}, "~O");
+Clazz_defineMethod (c$, "initData", 
+function () {
+this.seqs =  new java.util.Vector ();
+this.annotations =  new java.util.Vector ();
+this.seqGroups =  new java.util.ArrayList ();
+this.parseCalled = false;
+});
+Clazz_defineMethod (c$, "setSeqs", 
+function (s) {
+this.seqs =  new java.util.Vector ();
+for (var i = 0; i < s.length; i++) {
+this.seqs.addElement (s[i]);
+}
+}, "~A");
+Clazz_defineMethod (c$, "addJVSuffix", 
+function (b) {
+this.jvSuffix = b;
+}, "~B");
+Clazz_defineMethod (c$, "parseId", 
+function (id) {
+var seq = null;
+id = id.trim ();
+var space = id.indexOf (" ");
+if (space > -1) {
+seq =  new jalview.datamodel.Sequence (id.substring (0, space), "");
+seq.setDescription (id.substring (space + 1));
+} else {
+seq =  new jalview.datamodel.Sequence (id, "");
+}return seq;
+}, "~S");
+Clazz_defineMethod (c$, "printId", 
+function (seq) {
+return seq.getDisplayId (this.jvSuffix);
+}, "jalview.datamodel.SequenceI");
+Clazz_defineMethod (c$, "addNewickTree", 
+function (treeName, newickString) {
+if (this.newickStrings == null) {
+this.newickStrings =  new java.util.Vector ();
+}this.newickStrings.addElement ( Clazz_newArray (-1, [treeName, newickString]));
+}, "~S,~S");
+Clazz_defineMethod (c$, "getTreeCount", 
+function () {
+return this.newickStrings == null ? 0 : this.newickStrings.size ();
+});
+Clazz_defineMethod (c$, "addGroups", 
+function (al) {
+for (var sg, $sg = this.getSeqGroups ().iterator (); $sg.hasNext () && ((sg = $sg.next ()) || true);) {
+al.addGroup (sg);
+}
+}, "jalview.datamodel.AlignmentI");
+});
+Clazz_declarePackage ("jalview.io");
+Clazz_load (null, "jalview.io.FileParse", ["jalview.io.AppletFormatAdapter", "jalview.util.MessageManager", "java.io.BufferedReader", "$.IOException", "$.InputStreamReader", "$.StringReader", "java.lang.Error", "java.net.URL", "java.util.zip.GZIPInputStream"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.dataName = "unknown source";
+this.inFile = null;
+this.viewport = null;
+this.exportSettings = null;
+this.index = 1;
+this.suffixSeparator = '#';
+this.newline = null;
+this.suffix = null;
+this.type = null;
+this.dataIn = null;
+this.errormessage = "UNITIALISED SOURCE";
+this.error = true;
+this.warningMessage = null;
+this.READAHEAD_LIMIT = 2048;
+Clazz_instantialize (this, arguments);
+}, jalview.io, "FileParse");
+Clazz_prepareFields (c$, function () {
+this.newline = System.getProperty ("line.separator");
+});
+Clazz_defineMethod (c$, "setNewlineString", 
+function (nl) {
+this.newline = nl;
+}, "~S");
+Clazz_defineMethod (c$, "getNewlineString", 
+function () {
+return this.newline;
+});
+Clazz_makeConstructor (c$, 
+function () {
+});
+Clazz_makeConstructor (c$, 
+function (from) {
+if (from == null) {
+throw  new Error (jalview.util.MessageManager.getString ("error.implementation_error_null_fileparse"));
+}if (from === this) {
+return;
+}this.index = ++from.index;
+this.inFile = from.inFile;
+this.suffixSeparator = from.suffixSeparator;
+this.suffix = from.suffix;
+this.errormessage = from.errormessage;
+this.error = false;
+this.type = from.type;
+this.dataIn = from.dataIn;
+if (this.dataIn != null) {
+this.mark ();
+}this.dataName = from.dataName;
+}, "jalview.io.FileParse");
+Clazz_defineMethod (c$, "tryAsGzipSource", 
+ function (inputStream) {
+var inData =  new java.io.BufferedReader ( new java.io.InputStreamReader ( new java.util.zip.GZIPInputStream (inputStream)));
+inData.mark (2048);
+inData.read ();
+inData.reset ();
+return inData;
+}, "java.io.InputStream");
+Clazz_defineMethod (c$, "checkURLSource", 
+ function (fileStr) {
+this.errormessage = "URL NOT FOUND";
+var url =  new java.net.URL (fileStr);
+var e = null;
+if (fileStr.toLowerCase ().endsWith (".gz")) {
+try {
+var inputStream = url.openStream ();
+this.dataIn = this.tryAsGzipSource (inputStream);
+this.dataName = fileStr;
+return false;
+} catch (ex) {
+if (Clazz_exceptionOf (ex, Exception)) {
+e = ex;
+} else {
+throw ex;
+}
+}
+}try {
+this.dataIn =  new java.io.BufferedReader ( new java.io.InputStreamReader (url.openStream ()));
+} catch (q) {
+if (Clazz_exceptionOf (q, java.io.IOException)) {
+if (e != null) {
+throw  new java.io.IOException (jalview.util.MessageManager.getString ("exception.failed_to_resolve_gzip_stream"), e);
+}throw q;
+} else {
+throw q;
+}
+}
+this.dataName = fileStr;
+return false;
+}, "~S");
+Clazz_defineMethod (c$, "extractSuffix", 
+ function (fileStr) {
+var sfpos = fileStr.lastIndexOf (this.suffixSeparator);
+if (sfpos > -1 && sfpos < fileStr.length - 1) {
+this.suffix = fileStr.substring (sfpos + 1);
+return fileStr.substring (0, sfpos);
+}return null;
+}, "~S");
+Clazz_makeConstructor (c$, 
+function (fileStr, type) {
+this.type = type;
+this.error = false;
+if (type.equals (jalview.io.AppletFormatAdapter.FILE)) {
+{
+}} else if (type.equals (jalview.io.AppletFormatAdapter.URL)) {
+try {
+try {
+this.checkURLSource (fileStr);
+if (this.suffixSeparator == '#') {
+this.extractSuffix (fileStr);
+}} catch (e) {
+if (Clazz_exceptionOf (e, java.io.IOException)) {
+var suffixLess = this.extractSuffix (fileStr);
+if (suffixLess == null) {
+throw (e);
+} else {
+try {
+this.checkURLSource (suffixLess);
+} catch (e2) {
+if (Clazz_exceptionOf (e2, java.io.IOException)) {
+this.errormessage = "BAD URL WITH OR WITHOUT SUFFIX";
+throw (e);
+} else {
+throw e2;
+}
+}
+}} else {
+throw e;
+}
+}
+} catch (e) {
+if (Clazz_exceptionOf (e, Exception)) {
+this.errormessage = "CANNOT ACCESS DATA AT URL '" + fileStr + "' (" + e.getMessage () + ")";
+this.error = true;
+} else {
+throw e;
+}
+}
+} else if (type.equals (jalview.io.AppletFormatAdapter.PASTE)) {
+this.errormessage = "PASTE INACCESSIBLE!";
+this.dataIn =  new java.io.BufferedReader ( new java.io.StringReader (fileStr));
+this.dataName = "Paste";
+} else if (type.equals (jalview.io.AppletFormatAdapter.CLASSLOADER)) {
+this.errormessage = "RESOURCE CANNOT BE LOCATED";
+var is = this.getClass ().getResourceAsStream ("/" + fileStr);
+if (is == null) {
+var suffixLess = this.extractSuffix (fileStr);
+if (suffixLess != null) {
+is = this.getClass ().getResourceAsStream ("/" + suffixLess);
+}}if (is != null) {
+this.dataIn =  new java.io.BufferedReader ( new java.io.InputStreamReader (is));
+this.dataName = fileStr;
+} else {
+this.error = true;
+}} else {
+this.errormessage = "PROBABLE IMPLEMENTATION ERROR : Datasource Type given as '" + (type != null ? type : "null") + "'";
+this.error = true;
+}if (this.dataIn == null || this.error) {
+throw  new java.io.IOException (jalview.util.MessageManager.formatMessage ("exception.failed_to_read_data_from_source",  Clazz_newArray (-1, [this.errormessage])));
+}this.error = false;
+this.dataIn.mark (2048);
+}, "~S,~S");
+Clazz_defineMethod (c$, "mark", 
+function () {
+if (this.dataIn != null) {
+this.dataIn.mark (2048);
+} else {
+throw  new java.io.IOException (jalview.util.MessageManager.getString ("exception.no_init_source_stream"));
+}});
+Clazz_defineMethod (c$, "nextLine", 
+function () {
+if (!this.error) {
+return this.dataIn.readLine ();
+}throw  new java.io.IOException (jalview.util.MessageManager.formatMessage ("exception.invalid_source_stream",  Clazz_newArray (-1, [this.errormessage])));
+});
+Clazz_defineMethod (c$, "isExporting", 
+function () {
+return !this.error && this.dataIn == null;
+});
+Clazz_defineMethod (c$, "isValid", 
+function () {
+return !this.error;
+});
+Clazz_defineMethod (c$, "close", 
+function () {
+this.errormessage = "EXCEPTION ON CLOSE";
+this.error = true;
+this.dataIn.close ();
+this.dataIn = null;
+this.errormessage = "SOURCE IS CLOSED";
+});
+Clazz_defineMethod (c$, "reset", 
+function () {
+if (this.dataIn != null && !this.error) {
+this.dataIn.reset ();
+} else {
+throw  new java.io.IOException (jalview.util.MessageManager.getString ("error.implementation_error_reset_called_for_invalid_source"));
+}});
+Clazz_defineMethod (c$, "hasWarningMessage", 
+function () {
+return (this.warningMessage != null && this.warningMessage.length > 0);
+});
+Clazz_defineMethod (c$, "getWarningMessage", 
+function () {
+return this.warningMessage;
+});
+Clazz_defineMethod (c$, "getInFile", 
+function () {
+if (this.inFile != null) {
+return this.inFile.getAbsolutePath () + " (" + this.index + ")";
+} else {
+return "From Paste + (" + this.index + ")";
+}});
+Clazz_defineMethod (c$, "getDataName", 
+function () {
+return this.dataName;
+});
+Clazz_defineMethod (c$, "setDataName", 
+function (dataname) {
+this.dataName = dataname;
+}, "~S");
+Clazz_defineMethod (c$, "getReader", 
+function () {
+if (this.dataIn != null) {
+return this.dataIn;
+}return null;
+});
+Clazz_defineMethod (c$, "getViewport", 
+function () {
+return this.viewport;
+});
+Clazz_defineMethod (c$, "setViewport", 
+function (viewport) {
+this.viewport = viewport;
+}, "jalview.api.AlignViewportI");
+Clazz_defineMethod (c$, "getExportSettings", 
+function () {
+return this.exportSettings;
+});
+Clazz_defineMethod (c$, "setExportSettings", 
+function (exportSettings) {
+this.exportSettings = exportSettings;
+}, "jalview.api.AlignExportSettingI");
+Clazz_defineMethod (c$, "configureForView", 
+function (avpanel) {
+if (avpanel != null) {
+this.setViewport (avpanel.getAlignViewport ());
+}}, "jalview.api.AlignmentViewPanel");
+});
+Clazz_declarePackage ("jalview.io");
+Clazz_load (null, "jalview.io.AppletFormatAdapter", ["MCview.PDBfile", "jalview.datamodel.Alignment", "jalview.io.FileParse", "$.IdentifyFile", "jalview.jsdev.GenericFileAdapter", "jalview.util.MessageManager", "java.io.IOException", "java.lang.Exception", "$.StringBuffer"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.viewpanel = null;
+this.annotFromStructure = false;
+this.localSecondaryStruct = false;
+this.serviceSecondaryStruct = false;
+this.alignFile = null;
+this.inFile = null;
+this.newline = null;
+this.exportSettings = null;
+Clazz_instantialize (this, arguments);
+}, jalview.io, "AppletFormatAdapter");
+Clazz_prepareFields (c$, function () {
+this.newline = System.getProperty ("line.separator");
+});
+Clazz_makeConstructor (c$, 
+function () {
+});
+Clazz_makeConstructor (c$, 
+function (viewpanel) {
+this.viewpanel = viewpanel;
+}, "jalview.api.AlignmentViewPanel");
+Clazz_makeConstructor (c$, 
+function (alignPanel, settings) {
+this.viewpanel = alignPanel;
+this.exportSettings = settings;
+}, "jalview.api.AlignmentViewPanel,jalview.api.AlignExportSettingI");
+c$.prettyPrint = Clazz_defineMethod (c$, "prettyPrint", 
+function (els) {
+var list =  new StringBuffer ();
+for (var i = 0, iSize = els.length - 1; i < iSize; i++) {
+list.append (els[i]);
+list.append (", ");
+}
+list.append (" and " + els[els.length - 1] + ".");
+return list.toString ();
+}, "~A");
+Clazz_defineMethod (c$, "setNewlineString", 
+function (nl) {
+this.newline = nl;
+}, "~S");
+Clazz_defineMethod (c$, "getNewlineString", 
+function () {
+return this.newline;
+});
+c$.isValidFormat = Clazz_defineMethod (c$, "isValidFormat", 
+function (format) {
+return jalview.io.AppletFormatAdapter.isValidFormat (format, false);
+}, "~S");
+c$.isValidFormat = Clazz_defineMethod (c$, "isValidFormat", 
+function (format, forwriting) {
+var valid = false;
+var format_list = (forwriting) ? jalview.io.AppletFormatAdapter.WRITEABLE_FORMATS : jalview.io.AppletFormatAdapter.READABLE_FORMATS;
+for (var element, $element = 0, $$element = format_list; $element < $$element.length && ((element = $$element[$element]) || true); $element++) {
+if (element.equalsIgnoreCase (format)) {
+return true;
+}}
+return valid;
+}, "~S,~B");
+Clazz_defineMethod (c$, "readFile", 
+function (inFile, type, format) {
+this.inFile = inFile;
+try {
+if (format.equals ("FASTA")) {
+this.alignFile = jalview.jsdev.GenericFileAdapter.getFile ("FastaFile", [inFile, type]);
+} else if (format.equals ("MSF")) {
+this.alignFile = jalview.jsdev.GenericFileAdapter.getFile ("MSFfile", [inFile, type]);
+} else if (format.equals ("PileUp")) {
+this.alignFile = jalview.jsdev.GenericFileAdapter.getFile ("PileUpfile", [inFile, type]);
+} else if (format.equals ("CLUSTAL")) {
+this.alignFile = jalview.jsdev.GenericFileAdapter.getFile ("ClustalFile", [inFile, type]);
+} else if (format.equals ("BLC")) {
+this.alignFile = jalview.jsdev.GenericFileAdapter.getFile ("BLCFile", [inFile, type]);
+} else if (format.equals ("PIR")) {
+this.alignFile = jalview.jsdev.GenericFileAdapter.getFile ("PIRFile", [inFile, type]);
+} else if (format.equals ("PFAM")) {
+this.alignFile = jalview.jsdev.GenericFileAdapter.getFile ("PfamFile", [inFile, type]);
+} else if (format.equals ("JnetFile")) {
+this.alignFile = jalview.jsdev.GenericFileAdapter.getFile ("JPredFile", [inFile, type]);
+(this.alignFile).removeNonSequences ();
+} else if (format.equals ("PDB")) {
+this.alignFile =  new MCview.PDBfile (this.annotFromStructure, this.localSecondaryStruct, this.serviceSecondaryStruct, inFile, type);
+} else if (format.equals ("STH")) {
+this.alignFile = jalview.jsdev.GenericFileAdapter.getFile ("StockholmFile", [inFile, type]);
+} else if (format.equals ("SimpleBLAST")) {
+this.alignFile = jalview.jsdev.GenericFileAdapter.getFile ("SimpleBlastFile", [inFile, type]);
+} else if (format.equals ("PHYLIP")) {
+this.alignFile = jalview.jsdev.GenericFileAdapter.getFile ("PhylipFile", [inFile, type]);
+} else if (format.equals ("JSON")) {
+this.alignFile = jalview.jsdev.GenericFileAdapter.getFile ("JSONFile", [inFile, type]);
+} else if (format.equals ("HTML")) {
+this.alignFile = jalview.jsdev.GenericFileAdapter.getFile ("HtmlFile", [inFile, type]);
+} else if (format.equals ("RNAML")) {
+this.alignFile = jalview.jsdev.GenericFileAdapter.getFile ("RnamlFile", [inFile, type]);
+} else if (format.equals ("GFF v2 or v3")) {
+this.alignFile = jalview.jsdev.GenericFileAdapter.getFile ("Gff3File", [inFile, type]);
+}return this.buildAlignmentFrom (this.alignFile);
+} catch (e) {
+if (Clazz_exceptionOf (e, Exception)) {
+e.printStackTrace ();
+System.err.println ("Failed to read alignment using the '" + format + "' reader.\n" + e);
+if (e.getMessage () != null && e.getMessage ().startsWith (jalview.io.AppletFormatAdapter.INVALID_CHARACTERS)) {
+throw  new java.io.IOException (e.getMessage ());
+}if (type.equalsIgnoreCase ("Paste")) {
+try {
+this.alignFile = jalview.jsdev.GenericFileAdapter.getFile ("FastaFile", [">UNKNOWN\n" + inFile, "Paste"]);
+return this.buildAlignmentFrom (this.alignFile);
+} catch (ex) {
+if (Clazz_exceptionOf (ex, Exception)) {
+if (ex.toString ().startsWith (jalview.io.AppletFormatAdapter.INVALID_CHARACTERS)) {
+throw  new java.io.IOException (e.getMessage ());
+}ex.printStackTrace ();
+} else {
+throw ex;
+}
+}
+}throw  new java.io.IOException (jalview.io.AppletFormatAdapter.SUPPORTED_FORMATS);
+} else {
+throw e;
+}
+}
+}, "~S,~S,~S");
+Clazz_defineMethod (c$, "readFromFile", 
+function (source, format) {
+this.inFile = source.getInFile ();
+var type = source.type;
+try {
+if (format.equals ("FASTA")) {
+this.alignFile = jalview.jsdev.GenericFileAdapter.getFile ("FastaFile", [source]);
+} else if (format.equals ("MSF")) {
+this.alignFile = jalview.jsdev.GenericFileAdapter.getFile ("MSFfile", [source]);
+} else if (format.equals ("PileUp")) {
+this.alignFile = jalview.jsdev.GenericFileAdapter.getFile ("PileUpfile", [source]);
+} else if (format.equals ("CLUSTAL")) {
+this.alignFile = jalview.jsdev.GenericFileAdapter.getFile ("ClustalFile", [source]);
+} else if (format.equals ("BLC")) {
+this.alignFile = jalview.jsdev.GenericFileAdapter.getFile ("BLCFile", [source]);
+} else if (format.equals ("PIR")) {
+this.alignFile = jalview.jsdev.GenericFileAdapter.getFile ("PIRFile", [source]);
+} else if (format.equals ("PFAM")) {
+this.alignFile = jalview.jsdev.GenericFileAdapter.getFile ("PfamFile", [source]);
+} else if (format.equals ("JnetFile")) {
+this.alignFile = jalview.jsdev.GenericFileAdapter.getFile ("JPredFile", [source]);
+(this.alignFile).removeNonSequences ();
+} else if (format.equals ("PDB")) {
+this.alignFile =  new MCview.PDBfile (this.annotFromStructure, this.localSecondaryStruct, this.serviceSecondaryStruct, source);
+} else if (format.equals ("STH")) {
+this.alignFile = jalview.jsdev.GenericFileAdapter.getFile ("StockholmFile", [source]);
+} else if (format.equals ("RNAML")) {
+this.alignFile = jalview.jsdev.GenericFileAdapter.getFile ("RnamlFile", [source]);
+} else if (format.equals ("SimpleBLAST")) {
+this.alignFile = jalview.jsdev.GenericFileAdapter.getFile ("SimpleBlastFile", [source]);
+} else if (format.equals ("PHYLIP")) {
+this.alignFile = jalview.jsdev.GenericFileAdapter.getFile ("PhylipFile", [source]);
+} else if (format.equals ("GFF v2 or v3")) {
+this.alignFile = jalview.jsdev.GenericFileAdapter.getFile ("Gff3File", [this.inFile, type]);
+} else if (format.equals ("JSON")) {
+this.alignFile = jalview.jsdev.GenericFileAdapter.getFile ("JSONFile", [source]);
+} else if (format.equals ("HTML")) {
+this.alignFile = jalview.jsdev.GenericFileAdapter.getFile ("HtmlFile", [source]);
+}return this.buildAlignmentFrom (this.alignFile);
+} catch (e) {
+if (Clazz_exceptionOf (e, Exception)) {
+e.printStackTrace ();
+System.err.println ("Failed to read alignment using the '" + format + "' reader.\n" + e);
+if (e.getMessage () != null && e.getMessage ().startsWith (jalview.io.AppletFormatAdapter.INVALID_CHARACTERS)) {
+throw  new java.io.IOException (e.getMessage ());
+}if (type.equalsIgnoreCase ("Paste")) {
+try {
+this.alignFile = jalview.jsdev.GenericFileAdapter.getFile ("FastaFile", [">UNKNOWN\n" + this.inFile, "Paste"]);
+return this.buildAlignmentFrom (this.alignFile);
+} catch (ex) {
+if (Clazz_exceptionOf (ex, Exception)) {
+if (ex.toString ().startsWith (jalview.io.AppletFormatAdapter.INVALID_CHARACTERS)) {
+throw  new java.io.IOException (e.getMessage ());
+}ex.printStackTrace ();
+} else {
+throw ex;
+}
+}
+}throw  new java.io.IOException (jalview.io.AppletFormatAdapter.SUPPORTED_FORMATS);
+} else {
+throw e;
+}
+}
+}, "jalview.io.FileParse,~S");
+Clazz_defineMethod (c$, "buildAlignmentFrom", 
+ function (alignFile2) {
+var al =  new jalview.datamodel.Alignment (this.alignFile.getSeqsAsArray ());
+this.alignFile.addAnnotations (al);
+this.alignFile.addGroups (al);
+return al;
+}, "jalview.io.AlignFile");
+Clazz_defineMethod (c$, "formatSequences", 
+function (format, jvsuffix, ap, selectedOnly) {
+var selvew = ap.getAlignViewport ().getAlignmentView (selectedOnly, false);
+var aselview = selvew.getVisibleAlignment (ap.getAlignViewport ().getGapCharacter ());
+var ala = (ap.getAlignViewport ().getVisibleAlignmentAnnotation (selectedOnly));
+if (ala != null) {
+for (var aa, $aa = ala.iterator (); $aa.hasNext () && ((aa = $aa.next ()) || true);) {
+aselview.addAnnotation (aa);
+}
+}this.viewpanel = ap;
+return this.formatSequences (format, aselview, jvsuffix);
+}, "~S,~B,jalview.api.AlignmentViewPanel,~B");
+Clazz_defineMethod (c$, "formatSequences", 
+function (format, alignment, jvsuffix) {
+try {
+var afile = null;
+if (format.equalsIgnoreCase ("FASTA")) {
+afile = jalview.jsdev.GenericFileAdapter.getFile ("FastaFile", []);
+} else if (format.equalsIgnoreCase ("MSF")) {
+afile = jalview.jsdev.GenericFileAdapter.getFile ("MSFfile", []);
+} else if (format.equalsIgnoreCase ("PileUp")) {
+afile = jalview.jsdev.GenericFileAdapter.getFile ("PileUpfile", []);
+} else if (format.equalsIgnoreCase ("CLUSTAL")) {
+afile = jalview.jsdev.GenericFileAdapter.getFile ("ClustalFile", []);
+} else if (format.equalsIgnoreCase ("BLC")) {
+afile = jalview.jsdev.GenericFileAdapter.getFile ("BLCFile", []);
+} else if (format.equalsIgnoreCase ("PIR")) {
+afile = jalview.jsdev.GenericFileAdapter.getFile ("PIRFile", []);
+} else if (format.equalsIgnoreCase ("PFAM")) {
+afile = jalview.jsdev.GenericFileAdapter.getFile ("PfamFile", []);
+} else if (format.equalsIgnoreCase ("STH")) {
+afile = jalview.jsdev.GenericFileAdapter.getFile ("StockholmFile", [alignment]);
+} else if (format.equalsIgnoreCase ("AMSA")) {
+afile = jalview.jsdev.GenericFileAdapter.getFile ("AMSAFile", [alignment]);
+} else if (format.equalsIgnoreCase ("PHYLIP")) {
+afile = jalview.jsdev.GenericFileAdapter.getFile ("PhylipFile", []);
+} else if (format.equalsIgnoreCase ("JSON")) {
+afile = jalview.jsdev.GenericFileAdapter.getFile ("JSONFile", []);
+} else if (format.equalsIgnoreCase ("RNAML")) {
+afile = jalview.jsdev.GenericFileAdapter.getFile ("RnamlFile", []);
+} else {
+throw  new Exception (jalview.util.MessageManager.getString ("error.implementation_error_unknown_file_format_string"));
+}afile.setNewlineString (this.newline);
+afile.addJVSuffix (jvsuffix);
+afile.setExportSettings (this.exportSettings);
+afile.configureForView (this.viewpanel);
+if (this.viewpanel == null || this.viewpanel.getAlignment () == null || this.viewpanel.getAlignment () !== alignment) {
+afile.setSeqs (alignment.getSequencesArray ());
+} else {
+afile.setSeqs (this.viewpanel.getAlignment ().getSequencesArray ());
+}var afileresp = afile.print ();
+if (afile.hasWarningMessage ()) {
+System.err.println ("Warning raised when writing as " + format + " : " + afile.getWarningMessage ());
+}return afileresp;
+} catch (e) {
+if (Clazz_exceptionOf (e, Exception)) {
+System.err.println ("Failed to write alignment as a '" + format + "' file\n");
+e.printStackTrace ();
+} else {
+throw e;
+}
+}
+return null;
+}, "~S,jalview.datamodel.AlignmentI,~B");
+c$.checkProtocol = Clazz_defineMethod (c$, "checkProtocol", 
+function (file) {
+var protocol = jalview.io.AppletFormatAdapter.FILE;
+var ft = file.toLowerCase ().trim ();
+if (ft.indexOf ("http:") == 0 || ft.indexOf ("https:") == 0 || ft.indexOf ("file:") == 0) {
+protocol = jalview.io.AppletFormatAdapter.URL;
+}return protocol;
+}, "~S");
+c$.resolveProtocol = Clazz_defineMethod (c$, "resolveProtocol", 
+function (file, format) {
+return jalview.io.AppletFormatAdapter.resolveProtocol (file, format, false);
+}, "~S,~S");
+c$.resolveProtocol = Clazz_defineMethod (c$, "resolveProtocol", 
+function (file, format, debug) {
+var protocol = null;
+if (debug) {
+System.out.println ("resolving datasource started with:\n>>file\n" + file + ">>endfile");
+}try {
+var rtn = false;
+var is = System.getSecurityManager ().getClass ().getResourceAsStream ("/" + file);
+if (is != null) {
+rtn = true;
+is.close ();
+}if (debug) {
+System.err.println ("Resource '" + file + "' was " + (rtn ? "" : "not") + " located by classloader.");
+};if (rtn) {
+protocol = jalview.io.AppletFormatAdapter.CLASSLOADER;
+}} catch (ex) {
+if (Clazz_exceptionOf (ex, Exception)) {
+System.err.println ("Exception checking resources: " + file + " " + ex);
+} else {
+throw ex;
+}
+}
+if (file.indexOf ("://") > -1) {
+protocol = jalview.io.AppletFormatAdapter.URL;
+} else {
+protocol = jalview.io.AppletFormatAdapter.FILE;
+}var fp = null;
+try {
+if (debug) {
+System.out.println ("Trying to get contents of resource as " + protocol + ":");
+}fp =  new jalview.io.FileParse (file, protocol);
+if (!fp.isValid ()) {
+fp = null;
+} else {
+if (debug) {
+System.out.println ("Successful.");
+}}} catch (e) {
+if (Clazz_exceptionOf (e, Exception)) {
+if (debug) {
+System.err.println ("Exception when accessing content: " + e);
+}fp = null;
+} else {
+throw e;
+}
+}
+if (fp == null) {
+if (debug) {
+System.out.println ("Accessing as paste.");
+}protocol = jalview.io.AppletFormatAdapter.PASTE;
+fp = null;
+try {
+fp =  new jalview.io.FileParse (file, protocol);
+if (!fp.isValid ()) {
+fp = null;
+}} catch (e) {
+if (Clazz_exceptionOf (e, Exception)) {
+System.err.println ("Failed to access content as paste!");
+e.printStackTrace ();
+fp = null;
+} else {
+throw e;
+}
+}
+}if (fp == null) {
+return null;
+}if (format == null || format.length == 0) {
+return protocol;
+} else {
+try {
+var idformat =  new jalview.io.IdentifyFile ().Identify (file, protocol);
+if (idformat == null) {
+if (debug) {
+System.out.println ("Format not identified. Inaccessible file.");
+}return null;
+}if (debug) {
+System.out.println ("Format identified as " + idformat + "and expected as " + format);
+}if (idformat.equals (format)) {
+if (debug) {
+System.out.println ("Protocol identified as " + protocol);
+}return protocol;
+} else {
+if (debug) {
+System.out.println ("File deemed not accessible via " + protocol);
+}fp.close ();
+return null;
+}} catch (e) {
+if (Clazz_exceptionOf (e, Exception)) {
+if (debug) {
+System.err.println ("File deemed not accessible via " + protocol);
+e.printStackTrace ();
+};} else {
+throw e;
+}
+}
+}return null;
+}, "~S,~S,~B");
+Clazz_defineMethod (c$, "getAlignFile", 
+function () {
+return this.alignFile;
+});
+Clazz_defineMethod (c$, "setAlignFile", 
+function (alignFile) {
+this.alignFile = alignFile;
+}, "jalview.io.AlignFile");
+Clazz_defineStatics (c$,
+"FILE", "File",
+"URL", "URL",
+"PASTE", "Paste",
+"CLASSLOADER", "ClassLoader");
+c$.READABLE_FORMATS = c$.prototype.READABLE_FORMATS =  Clazz_newArray (-1, ["BLC", "CLUSTAL", "FASTA", "MSF", "PileUp", "PIR", "PFAM", "STH", "PDB", "JnetFile", "RNAML", "PHYLIP", "JSON", "GFF v2 or v3", "HTML"]);
+c$.READABLE_EXTENSIONS = c$.prototype.READABLE_EXTENSIONS =  Clazz_newArray (-1, ["fa, fasta, mfa, fastq", "aln", "pfam", "msf", "pir", "blc", "amsa", "sto,stk", "xml,rnaml", "phy", "json", ".gff2,gff3", "jar,jvp", "html"]);
+c$.READABLE_FNAMES = c$.prototype.READABLE_FNAMES =  Clazz_newArray (-1, ["Fasta", "Clustal", "PFAM", "MSF", "PIR", "BLC", "AMSA", "Stockholm", "RNAML", "PHYLIP", "JSON", "GFF v2 or v3", "Jalview", "HTML"]);
+c$.WRITEABLE_FORMATS = c$.prototype.WRITEABLE_FORMATS =  Clazz_newArray (-1, ["BLC", "CLUSTAL", "FASTA", "MSF", "PileUp", "PIR", "PFAM", "AMSA", "STH", "PHYLIP", "JSON"]);
+c$.WRITABLE_EXTENSIONS = c$.prototype.WRITABLE_EXTENSIONS =  Clazz_newArray (-1, ["fa, fasta, mfa, fastq", "aln", "pfam", "msf", "pir", "blc", "amsa", "sto,stk", "phy", "json", "jvp"]);
+c$.WRITABLE_FNAMES = c$.prototype.WRITABLE_FNAMES =  Clazz_newArray (-1, ["Fasta", "Clustal", "PFAM", "MSF", "PIR", "BLC", "AMSA", "STH", "PHYLIP", "JSON", "Jalview"]);
+Clazz_defineStatics (c$,
+"INVALID_CHARACTERS", "Contains invalid characters");
+c$.SUPPORTED_FORMATS = c$.prototype.SUPPORTED_FORMATS = "Formats currently supported are\n" + jalview.io.AppletFormatAdapter.prettyPrint (jalview.io.AppletFormatAdapter.READABLE_FORMATS);
+});
+Clazz_declarePackage ("jalview.io");
+Clazz_load (null, "jalview.io.IdentifyFile", ["jalview.io.FileParse"], function () {
+c$ = Clazz_declareType (jalview.io, "IdentifyFile");
+Clazz_defineMethod (c$, "Identify", 
+function (file, protocol) {
+var emessage = "UNIDENTIFIED FILE PARSING ERROR";
+var parser = null;
+try {
+parser =  new jalview.io.FileParse (file, protocol);
+if (parser.isValid ()) {
+return this.Identify (parser);
+}} catch (e) {
+if (Clazz_exceptionOf (e, Exception)) {
+System.err.println ("Error whilst identifying");
+e.printStackTrace (System.err);
+emessage = e.getMessage ();
+} else {
+throw e;
+}
+}
+if (parser != null) {
+return parser.errormessage;
+}return emessage;
+}, "~S,~S");
+Clazz_defineMethod (c$, "Identify", 
+function (source) {
+return this.Identify (source, true);
+}, "jalview.io.FileParse");
+Clazz_defineMethod (c$, "Identify", 
+function (source, closeSource) {
+var reply = "PFAM";
+var data;
+var length = 0;
+var lineswereskipped = false;
+var isBinary = false;
+try {
+if (!closeSource) {
+source.mark ();
+}while ((data = source.nextLine ()) != null) {
+length += data.trim ().length;
+if (!lineswereskipped) {
+for (var i = 0; !isBinary && i < data.length; i++) {
+var c = data.charAt (i);
+isBinary = (c.charCodeAt (0) < 32 && c != '\t' && c != '\n' && c != '\r' && c.charCodeAt (0) != 5 && c.charCodeAt (0) != 27);
+}
+}if (isBinary) {
+if (source.inFile != null) {
+var fileStr = source.inFile.getName ();
+if (fileStr.lastIndexOf (".jar") > -1 || fileStr.lastIndexOf (".zip") > -1) {
+reply = "Jalview";
+}}if (!lineswereskipped && data.startsWith ("PK")) {
+reply = "Jalview";
+break;
+}}data = data.toUpperCase ();
+if (data.startsWith ("##GFF-VERSION")) {
+reply = "GFF v2 or v3";
+break;
+}if (data.indexOf ("# STOCKHOLM") > -1) {
+reply = "STH";
+break;
+}if (data.matches ("<HTML(\"[^\"]*\"|'[^']*'|[^'\">])*>")) {
+reply = "HTML";
+break;
+}if (data.matches ("<RNAML (\"[^\"]*\"|'[^']*'|[^'\">])*>")) {
+reply = "RNAML";
+break;
+}if (data.indexOf ("{\"") > -1) {
+reply = "JSON";
+break;
+}if ((data.length < 1) || (data.indexOf ("#") == 0)) {
+lineswereskipped = true;
+continue;
+}if (data.indexOf ("PILEUP") > -1) {
+reply = "PileUp";
+break;
+}if ((data.indexOf ("//") == 0) || ((data.indexOf ("!!") > -1) && (data.indexOf ("!!") < data.indexOf ("_MULTIPLE_ALIGNMENT ")))) {
+reply = "MSF";
+break;
+} else if (data.indexOf ("CLUSTAL") > -1) {
+reply = "CLUSTAL";
+break;
+} else if (data.indexOf (">") > -1) {
+var checkPIR = false;
+var starterm = false;
+if ((data.indexOf (">P1;") > -1) || (data.indexOf (">DL;") > -1)) {
+checkPIR = true;
+reply = "PIR";
+}data = source.nextLine ();
+if (data.indexOf (">") > -1) {
+reply = "BLC";
+} else {
+var data1 = source.nextLine ();
+var data2 = source.nextLine ();
+var c1;
+if (checkPIR) {
+starterm = (data1 != null && data1.indexOf ("*") > -1) || (data2 != null && data2.indexOf ("*") > -1);
+}if (data2 != null && (c1 = data.indexOf ("*")) > -1) {
+if (c1 == 0 && c1 == data2.indexOf ("*")) {
+reply = "BLC";
+} else {
+reply = "FASTA";
+}} else {
+reply = "FASTA";
+if (!checkPIR) {
+break;
+}}}if (checkPIR) {
+var dta = null;
+if (!starterm) {
+do {
+try {
+dta = source.nextLine ();
+} catch (ex) {
+if (Clazz_exceptionOf (ex, java.io.IOException)) {
+} else {
+throw ex;
+}
+}
+;if (dta != null && dta.indexOf ("*") > -1) {
+starterm = true;
+}} while (dta != null && !starterm);
+}if (starterm) {
+reply = "PIR";
+break;
+} else {
+reply = "FASTA";
+}}break;
+} else if (data.indexOf ("HEADER") == 0 || data.indexOf ("ATOM") == 0) {
+reply = "PDB";
+break;
+} else if (data.matches ("\\s*\\d+\\s+\\d+\\s*")) {
+reply = "PHYLIP";
+break;
+} else if (!lineswereskipped && data.charAt (0) != '*' && data.charAt (0) != ' ' && data.indexOf (":") < data.indexOf (",")) {
+reply = "JnetFile";
+break;
+}lineswereskipped = true;
+}
+if (closeSource) {
+source.close ();
+} else {
+source.reset ();
+}} catch (ex) {
+if (Clazz_exceptionOf (ex, Exception)) {
+System.err.println ("File Identification failed!\n" + ex);
+return source.errormessage;
+} else {
+throw ex;
+}
+}
+if (length == 0) {
+System.err.println ("File Identification failed! - Empty file was read.");
+return "EMPTY DATA FILE";
+}return reply;
+}, "jalview.io.FileParse,~B");
+Clazz_defineStatics (c$,
+"GFF3File", "GFF v2 or v3");
+});
+Clazz_declarePackage ("jalview.jsdev");
+Clazz_load (["jalview.io.AlignFile"], "jalview.jsdev.GenericFileAdapter", ["jalview.datamodel.AlignmentI", "jalview.io.FileParse", "java.io.BufferedReader", "$.InputStreamReader", "java.net.URL"], function () {
+c$ = Clazz_declareType (jalview.jsdev, "GenericFileAdapter", jalview.io.AlignFile);
+c$.getFile = Clazz_defineMethod (c$, "getFile", 
+function (fileType, params) {
+var cl = null;
+try {
+cl = Clazz._4Name ("jalview.io." + fileType);
+} catch (e) {
+if (Clazz_exceptionOf (e, ClassNotFoundException)) {
+System.err.println ("did not find file jalview.io." + fileType);
+return null;
+} else {
+throw e;
+}
+}
+var m;
+var ex = null;
+try {
+switch (params.length) {
+case 0:
+return cl.newInstance ();
+case 1:
+m = (Clazz_instanceOf (params[0], jalview.io.FileParse) ? cl.getConstructor ([jalview.io.FileParse]) : cl.getConstructor ([jalview.datamodel.AlignmentI]));
+break;
+case 2:
+m = cl.getConstructor ([String, String]);
+break;
+default:
+return null;
+}
+return m.newInstance (params);
+} catch (e$$) {
+if (Clazz_exceptionOf (e$$, InstantiationException)) {
+var e = e$$;
+{
+ex = e;
+}
+} else if (Clazz_exceptionOf (e$$, IllegalAccessException)) {
+var e = e$$;
+{
+ex = e;
+}
+} else if (Clazz_exceptionOf (e$$, NoSuchMethodException)) {
+var e = e$$;
+{
+ex = e;
+}
+} else if (Clazz_exceptionOf (e$$, SecurityException)) {
+var e = e$$;
+{
+ex = e;
+}
+} else if (Clazz_exceptionOf (e$$, IllegalArgumentException)) {
+var e = e$$;
+{
+ex = e;
+}
+} else if (Clazz_exceptionOf (e$$, java.lang.reflect.InvocationTargetException)) {
+var e = e$$;
+{
+ex = e;
+}
+} else {
+throw e$$;
+}
+}
+if (ex != null) {
+System.err.println ("Error in GenericFileAdapter: " + ex);
+{
+alert(ex)
+}}return null;
+}, "~S,~A");
+c$.isJS = Clazz_defineMethod (c$, "isJS", 
+function () {
+{
+return true;
+}});
+c$.getReader = Clazz_defineMethod (c$, "getReader", 
+function (fileName, forceURL) {
+if (!forceURL && !jalview.jsdev.GenericFileAdapter.isJS ()) return  new java.io.BufferedReader ( new java.io.FileReader (fileName));
+if (fileName.indexOf ("//") < 0) fileName = "file://" + fileName;
+return  new java.io.BufferedReader ( new java.io.InputStreamReader ( new java.net.URL (fileName).openStream ()));
+}, "~S,~B");
+Clazz_defineStatics (c$,
+"TCOFFEE_SCORE", "TCoffeeScore",
+"Phylip_FILE", 1,
+"Phylip_FILE_EXT", "phy",
+"Phylip_FILE_DESC", "PHYLIP",
+"JSON_FILE", 2,
+"JSON_FILE_EXT", "json",
+"JSON_FILE_DESC", "JSON",
+"Html_FILE", 3,
+"Html_FILE_EXT", "html",
+"Html_FILE_DESC", "HTML");
+});
+Clazz_declarePackage ("java.util.zip");
+Clazz_load (["java.util.zip.InflaterInputStream", "$.CRC32"], "java.util.zip.GZIPInputStream", ["java.io.EOFException", "$.IOException", "java.util.zip.CheckedInputStream", "$.Inflater", "$.ZipException"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.crc = null;
+this.eos = false;
+this.$closed = false;
+this.tmpbuf = null;
+Clazz_instantialize (this, arguments);
+}, java.util.zip, "GZIPInputStream", java.util.zip.InflaterInputStream);
+Clazz_prepareFields (c$, function () {
+this.crc =  new java.util.zip.CRC32 ();
+this.tmpbuf =  Clazz_newByteArray (128, 0);
+});
+Clazz_defineMethod (c$, "ensureOpen", 
+ function () {
+if (this.$closed) {
+throw  new java.io.IOException ("Stream closed");
+}});
+Clazz_makeConstructor (c$, 
+function ($in, size) {
+Clazz_superConstructor (this, java.util.zip.GZIPInputStream, [$in,  new java.util.zip.Inflater ().init (0, true), size]);
+this.readHeader ($in);
+}, "java.io.InputStream,~N");
+Clazz_overrideMethod (c$, "read", 
+function (buf, off, len) {
+this.ensureOpen ();
+if (this.eos) {
+return -1;
+}var n = this.readInf (buf, off, len);
+if (n == -1) {
+if (this.readTrailer ()) this.eos = true;
+ else return this.read (buf, off, len);
+} else {
+this.crc.update (buf, off, n);
+}return n;
+}, "~A,~N,~N");
+Clazz_defineMethod (c$, "close", 
+function () {
+if (!this.$closed) {
+Clazz_superCall (this, java.util.zip.GZIPInputStream, "close", []);
+this.eos = true;
+this.$closed = true;
+}});
+Clazz_defineMethod (c$, "readHeader", 
+ function (this_in) {
+var $in =  new java.util.zip.CheckedInputStream (this_in).set (this.crc);
+this.crc.reset ();
+if (this.readUShort ($in) != 35615) {
+throw  new java.util.zip.ZipException ("Not in GZIP format");
+}if (this.readUByte ($in) != 8) {
+throw  new java.util.zip.ZipException ("Unsupported compression method");
+}var flg = this.readUByte ($in);
+this.skipBytes ($in, 6);
+var n = 10;
+if ((flg & 4) == 4) {
+var m = this.readUShort ($in);
+this.skipBytes ($in, m);
+n += m + 2;
+}if ((flg & 8) == 8) {
+do {
+n++;
+} while (this.readUByte ($in) != 0);
+}if ((flg & 16) == 16) {
+do {
+n++;
+} while (this.readUByte ($in) != 0);
+}if ((flg & 2) == 2) {
+var v = this.crc.getValue () & 0xffff;
+if (this.readUShort ($in) != v) {
+throw  new java.util.zip.ZipException ("Corrupt GZIP header");
+}n += 2;
+}this.crc.reset ();
+return n;
+}, "java.io.InputStream");
+Clazz_defineMethod (c$, "readTrailer", 
+ function () {
+return true;
+});
+Clazz_defineMethod (c$, "readUShort", 
+ function ($in) {
+var b = this.readUByte ($in);
+return (this.readUByte ($in) << 8) | b;
+}, "java.io.InputStream");
+Clazz_defineMethod (c$, "readUByte", 
+ function ($in) {
+var b = $in.readByteAsInt ();
+if (b == -1) {
+throw  new java.io.EOFException ();
+}if (b < -1 || b > 255) {
+throw  new java.io.IOException (this.$in.getClass ().getName () + ".read() returned value out of range -1..255: " + b);
+}return b;
+}, "java.io.InputStream");
+Clazz_defineMethod (c$, "skipBytes", 
+ function ($in, n) {
+while (n > 0) {
+var len = $in.read (this.tmpbuf, 0, n < this.tmpbuf.length ? n : this.tmpbuf.length);
+if (len == -1) {
+throw  new java.io.EOFException ();
+}n -= len;
+}
+}, "java.io.InputStream,~N");
+Clazz_defineStatics (c$,
+"GZIP_MAGIC", 0x8b1f,
+"FHCRC", 2,
+"FEXTRA", 4,
+"FNAME", 8,
+"FCOMMENT", 16);
+});
+Clazz_declarePackage ("java.util.zip");
+Clazz_load (["JU.InflaterInputStream"], "java.util.zip.InflaterInputStream", null, function () {
+c$ = Clazz_decorateAsClass (function () {
+this.inf = null;
+Clazz_instantialize (this, arguments);
+}, java.util.zip, "InflaterInputStream", JU.InflaterInputStream);
+Clazz_makeConstructor (c$, 
+function ($in, inflater, size) {
+Clazz_superConstructor (this, java.util.zip.InflaterInputStream, [$in, inflater, size, true]);
+this.inf = inflater;
+}, "java.io.InputStream,java.util.zip.Inflater,~N");
+});
+Clazz_declarePackage ("JU");
+Clazz_load (["java.io.FilterInputStream"], "JU.InflaterInputStream", ["java.io.EOFException", "$.IOException", "java.lang.IllegalArgumentException", "$.IndexOutOfBoundsException", "$.NullPointerException"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.inflater = null;
+this.buf = null;
+this.len = 0;
+this.closed = false;
+this.eof = false;
+this.close_in = true;
+this.myinflater = false;
+this.byte1 = null;
+this.b = null;
+Clazz_instantialize (this, arguments);
+}, JU, "InflaterInputStream", java.io.FilterInputStream);
+Clazz_prepareFields (c$, function () {
+this.byte1 =  Clazz_newByteArray (1, 0);
+this.b =  Clazz_newByteArray (512, 0);
+});
+Clazz_makeConstructor (c$, 
+function ($in, inflater, size, close_in) {
+Clazz_superConstructor (this, JU.InflaterInputStream, [$in]);
+this.inflater = inflater;
+this.buf =  Clazz_newByteArray (size, 0);
+this.close_in = close_in;
+}, "java.io.InputStream,JU.Inflater,~N,~B");
+Clazz_overrideMethod (c$, "readByteAsInt", 
+function () {
+if (this.closed) {
+throw  new java.io.IOException ("Stream closed");
+}return this.read (this.byte1, 0, 1) == -1 ? -1 : this.byte1[0] & 0xff;
+});
+Clazz_overrideMethod (c$, "read", 
+function (b, off, len) {
+return this.readInf (b, off, len);
+}, "~A,~N,~N");
+Clazz_defineMethod (c$, "readInf", 
+function (b, off, len) {
+if (this.closed) {
+throw  new java.io.IOException ("Stream closed");
+}if (b == null) {
+throw  new NullPointerException ();
+} else if (off < 0 || len < 0 || len > b.length - off) {
+throw  new IndexOutOfBoundsException ();
+} else if (len == 0) {
+return 0;
+} else if (this.eof) {
+return -1;
+}var n = 0;
+this.inflater.setOutput (b, off, len);
+while (!this.eof) {
+if (this.inflater.avail_in == 0) this.fill ();
+var err = this.inflater.inflate (0);
+n += this.inflater.next_out_index - off;
+off = this.inflater.next_out_index;
+switch (err) {
+case -3:
+throw  new java.io.IOException (this.inflater.msg);
+case 1:
+case 2:
+this.eof = true;
+if (err == 2) return -1;
+break;
+default:
+}
+if (this.inflater.avail_out == 0) break;
+}
+return n;
+}, "~A,~N,~N");
+Clazz_overrideMethod (c$, "available", 
+function () {
+if (this.closed) {
+throw  new java.io.IOException ("Stream closed");
+}return (this.eof ? 0 : 1);
+});
+Clazz_overrideMethod (c$, "skip", 
+function (n) {
+if (n < 0) {
+throw  new IllegalArgumentException ("negative skip length");
+}if (this.closed) {
+throw  new java.io.IOException ("Stream closed");
+}var max = Math.min (n, 2147483647);
+var total = 0;
+while (total < max) {
+var len = max - total;
+if (len > this.b.length) {
+len = this.b.length;
+}len = this.read (this.b, 0, len);
+if (len == -1) {
+this.eof = true;
+break;
+}total += len;
+}
+return total;
+}, "~N");
+Clazz_overrideMethod (c$, "close", 
+function () {
+if (!this.closed) {
+if (this.myinflater) this.inflater.end ();
+if (this.close_in) this.$in.close ();
+this.closed = true;
+}});
+Clazz_defineMethod (c$, "fill", 
+function () {
+if (this.closed) {
+throw  new java.io.IOException ("Stream closed");
+}this.len = this.$in.read (this.buf, 0, this.buf.length);
+if (this.len == -1) {
+if (this.inflater.istate.wrap == 0 && !this.inflater.finished ()) {
+this.buf[0] = 0;
+this.len = 1;
+} else if (this.inflater.istate.was != -1) {
+throw  new java.io.IOException ("footer is not found");
+} else {
+throw  new java.io.EOFException ("Unexpected end of ZLIB input stream");
+}}this.inflater.setInput (this.buf, 0, this.len, true);
+});
+Clazz_overrideMethod (c$, "markSupported", 
+function () {
+return false;
+});
+Clazz_overrideMethod (c$, "mark", 
+function (readlimit) {
+}, "~N");
+Clazz_overrideMethod (c$, "reset", 
+function () {
+throw  new java.io.IOException ("mark/reset not supported");
+});
+Clazz_defineMethod (c$, "getTotalIn", 
+function () {
+return this.inflater.getTotalIn ();
+});
+Clazz_defineMethod (c$, "getTotalOut", 
+function () {
+return this.inflater.getTotalOut ();
+});
+Clazz_defineMethod (c$, "getAvailIn", 
+function () {
+if (this.inflater.avail_in <= 0) return null;
+var tmp =  Clazz_newByteArray (this.inflater.avail_in, 0);
+System.arraycopy (this.inflater.next_in, this.inflater.next_in_index, tmp, 0, this.inflater.avail_in);
+return tmp;
+});
+Clazz_defineMethod (c$, "readHeader", 
+function () {
+var empty = "".getBytes ();
+this.inflater.setInput (empty, 0, 0, false);
+this.inflater.setOutput (empty, 0, 0);
+var err = this.inflater.inflate (0);
+if (!this.inflater.istate.inParsingHeader ()) {
+return;
+}var b1 =  Clazz_newByteArray (1, 0);
+do {
+var i = this.$in.read (b1, 0, 1);
+if (i <= 0) throw  new java.io.IOException ("no input");
+this.inflater.setInput (b1, 0, b1.length, false);
+err = this.inflater.inflate (0);
+if (err != 0) throw  new java.io.IOException (this.inflater.msg);
+} while (this.inflater.istate.inParsingHeader ());
+});
+Clazz_defineMethod (c$, "getInflater", 
+function () {
+return this.inflater;
+});
+Clazz_defineStatics (c$,
+"DEFAULT_BUFSIZE", 512);
+});
+Clazz_declarePackage ("java.util.zip");
+Clazz_load (["JU.CRC32"], "java.util.zip.CRC32", null, function () {
+c$ = Clazz_declareType (java.util.zip, "CRC32", JU.CRC32);
+});
+Clazz_declarePackage ("JU");
+Clazz_load (["JU.Checksum"], "JU.CRC32", null, function () {
+c$ = Clazz_decorateAsClass (function () {
+this.crc = 0;
+this.b1 = null;
+Clazz_instantialize (this, arguments);
+}, JU, "CRC32", null, JU.Checksum);
+Clazz_prepareFields (c$, function () {
+this.b1 =  Clazz_newByteArray (1, 0);
+});
+Clazz_overrideMethod (c$, "update", 
+function (buf, index, len) {
+var c = ~this.crc;
+while (--len >= 0) c = JU.CRC32.crc_table[(c ^ buf[index++]) & 0xff] ^ (c >>> 8);
+
+this.crc = ~c;
+}, "~A,~N,~N");
+Clazz_overrideMethod (c$, "reset", 
+function () {
+this.crc = 0;
+});
+Clazz_overrideMethod (c$, "resetLong", 
+function (vv) {
+this.crc = (vv & 0xffffffff);
+}, "~N");
+Clazz_overrideMethod (c$, "getValue", 
+function () {
+return this.crc & 0xffffffff;
+});
+Clazz_overrideMethod (c$, "updateByteAsInt", 
+function (b) {
+this.b1[0] = b;
+this.update (this.b1, 0, 1);
+}, "~N");
+Clazz_defineStatics (c$,
+"crc_table",  Clazz_newIntArray (-1, [0, 1996959894, -301047508, -1727442502, 124634137, 1886057615, -379345611, -1637575261, 249268274, 2044508324, -522852066, -1747789432, 162941995, 2125561021, -407360249, -1866523247, 498536548, 1789927666, -205950648, -2067906082, 450548861, 1843258603, -187386543, -2083289657, 325883990, 1684777152, -43845254, -1973040660, 335633487, 1661365465, -99664541, -1928851979, 997073096, 1281953886, -715111964, -1570279054, 1006888145, 1258607687, -770865667, -1526024853, 901097722, 1119000684, -608450090, -1396901568, 853044451, 1172266101, -589951537, -1412350631, 651767980, 1373503546, -925412992, -1076862698, 565507253, 1454621731, -809855591, -1195530993, 671266974, 1594198024, -972236366, -1324619484, 795835527, 1483230225, -1050600021, -1234817731, 1994146192, 31158534, -1731059524, -271249366, 1907459465, 112637215, -1614814043, -390540237, 2013776290, 251722036, -1777751922, -519137256, 2137656763, 141376813, -1855689577, -429695999, 1802195444, 476864866, -2056965928, -228458418, 1812370925, 453092731, -2113342271, -183516073, 1706088902, 314042704, -1950435094, -54949764, 1658658271, 366619977, -1932296973, -69972891, 1303535960, 984961486, -1547960204, -725929758, 1256170817, 1037604311, -1529756563, -740887301, 1131014506, 879679996, -1385723834, -631195440, 1141124467, 855842277, -1442165665, -586318647, 1342533948, 654459306, -1106571248, -921952122, 1466479909, 544179635, -1184443383, -832445281, 1591671054, 702138776, -1328506846, -942167884, 1504918807, 783551873, -1212326853, -1061524307, -306674912, -1698712650, 62317068, 1957810842, -355121351, -1647151185, 81470997, 1943803523, -480048366, -1805370492, 225274430, 2053790376, -468791541, -1828061283, 167816743, 2097651377, -267414716, -2029476910, 503444072, 1762050814, -144550051, -2140837941, 426522225, 1852507879, -19653770, -1982649376, 282753626, 1742555852, -105259153, -1900089351, 397917763, 1622183637, -690576408, -1580100738, 953729732, 1340076626, -776247311, -1497606297, 1068828381, 1219638859, -670225446, -1358292148, 906185462, 1090812512, -547295293, -1469587627, 829329135, 1181335161, -882789492, -1134132454, 628085408, 1382605366, -871598187, -1156888829, 570562233, 1426400815, -977650754, -1296233688, 733239954, 1555261956, -1026031705, -1244606671, 752459403, 1541320221, -1687895376, -328994266, 1969922972, 40735498, -1677130071, -351390145, 1913087877, 83908371, -1782625662, -491226604, 2075208622, 213261112, -1831694693, -438977011, 2094854071, 198958881, -2032938284, -237706686, 1759359992, 534414190, -2118248755, -155638181, 1873836001, 414664567, -2012718362, -15766928, 1711684554, 285281116, -1889165569, -127750551, 1634467795, 376229701, -1609899400, -686959890, 1308918612, 956543938, -1486412191, -799009033, 1231636301, 1047427035, -1362007478, -640263460, 1088359270, 936918000, -1447252397, -558129467, 1202900863, 817233897, -1111625188, -893730166, 1404277552, 615818150, -1160759803, -841546093, 1423857449, 601450431, -1285129682, -1000256840, 1567103746, 711928724, -1274298825, -1022587231, 1510334235, 755167117]));
+});
+Clazz_declarePackage ("JU");
+Clazz_declareInterface (JU, "Checksum");
+Clazz_declarePackage ("java.util.zip");
+Clazz_load (["java.io.FilterInputStream"], "java.util.zip.CheckedInputStream", null, function () {
+c$ = Clazz_decorateAsClass (function () {
+this.cksum = null;
+Clazz_instantialize (this, arguments);
+}, java.util.zip, "CheckedInputStream", java.io.FilterInputStream);
+Clazz_defineMethod (c$, "set", 
+function (cksum) {
+this.$in = this.$in;
+this.cksum = cksum;
+return this;
+}, "JU.Checksum");
+Clazz_overrideMethod (c$, "readByteAsInt", 
+function () {
+var b = this.$in.readByteAsInt ();
+if (b != -1) {
+this.cksum.updateByteAsInt (b);
+}return b;
+});
+Clazz_overrideMethod (c$, "read", 
+function (buf, off, len) {
+len = this.$in.read (buf, off, len);
+if (len != -1) {
+this.cksum.update (buf, off, len);
+}return len;
+}, "~A,~N,~N");
+Clazz_overrideMethod (c$, "skip", 
+function (n) {
+var buf =  Clazz_newByteArray (512, 0);
+var total = 0;
+while (total < n) {
+var len = n - total;
+len = this.read (buf, 0, len < buf.length ? len : buf.length);
+if (len == -1) {
+return total;
+}total += len;
+}
+return total;
+}, "~N");
+Clazz_defineMethod (c$, "getChecksum", 
+function () {
+return this.cksum;
+});
+});
+Clazz_declarePackage ("java.util.zip");
+Clazz_load (["JU.Inflater"], "java.util.zip.Inflater", null, function () {
+c$ = Clazz_declareType (java.util.zip, "Inflater", JU.Inflater);
+Clazz_defineMethod (c$, "initialize", 
+function (nowrap) {
+return this.init (0, nowrap);
+}, "~B");
+});
+Clazz_declarePackage ("JU");
+Clazz_load (["JU.ZStream"], "JU.Inflater", ["JU.Inflate"], function () {
+c$ = Clazz_declareType (JU, "Inflater", JU.ZStream);
+Clazz_defineMethod (c$, "init", 
+function (w, nowrap) {
+this.setAdler32 ();
+if (w == 0) w = 15;
+this.istate =  new JU.Inflate (this);
+this.istate.inflateInit (nowrap ? -w : w);
+return this;
+}, "~N,~B");
+Clazz_overrideMethod (c$, "inflate", 
+function (f) {
+if (this.istate == null) return -2;
+var ret = this.istate.inflate (f);
+return ret;
+}, "~N");
+Clazz_overrideMethod (c$, "end", 
+function () {
+if (this.istate == null) return -2;
+var ret = this.istate.inflateEnd ();
+return ret;
+});
+Clazz_defineMethod (c$, "sync", 
+function () {
+if (this.istate == null) return -2;
+return this.istate.inflateSync ();
+});
+Clazz_defineMethod (c$, "syncPoint", 
+function () {
+if (this.istate == null) return -2;
+return this.istate.inflateSyncPoint ();
+});
+Clazz_defineMethod (c$, "setDictionary", 
+function (dictionary, dictLength) {
+if (this.istate == null) return -2;
+return this.istate.inflateSetDictionary (dictionary, dictLength);
+}, "~A,~N");
+Clazz_overrideMethod (c$, "finished", 
+function () {
+return this.istate.mode == 12;
+});
+Clazz_defineMethod (c$, "reset", 
+function () {
+this.avail_in = 0;
+if (this.istate != null) this.istate.reset ();
+});
+Clazz_defineStatics (c$,
+"MAX_WBITS", 15,
+"DEF_WBITS", 15,
+"$Z_STREAM_ERROR", -2);
+});
+Clazz_declarePackage ("JU");
+Clazz_load (null, "JU.ZStream", ["JU.Adler32"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.next_in = null;
+this.next_in_index = 0;
+this.avail_in = 0;
+this.total_in = 0;
+this.next_out = null;
+this.next_out_index = 0;
+this.avail_out = 0;
+this.total_out = 0;
+this.msg = null;
+this.dstate = null;
+this.istate = null;
+this.data_type = 0;
+this.checksum = null;
+Clazz_instantialize (this, arguments);
+}, JU, "ZStream");
+Clazz_defineMethod (c$, "setAdler32", 
+function () {
+this.checksum =  new JU.Adler32 ();
+});
+Clazz_defineMethod (c$, "inflate", 
+function (f) {
+if (this.istate == null) return -2;
+return this.istate.inflate (f);
+}, "~N");
+Clazz_defineMethod (c$, "deflate", 
+function (flush) {
+if (this.dstate == null) {
+return -2;
+}return this.dstate.deflate (flush);
+}, "~N");
+Clazz_defineMethod (c$, "flush_pending", 
+function () {
+var len = this.dstate.pending;
+if (len > this.avail_out) len = this.avail_out;
+if (len == 0) return;
+System.arraycopy (this.dstate.pending_buf, this.dstate.pending_out, this.next_out, this.next_out_index, len);
+this.next_out_index += len;
+this.dstate.pending_out += len;
+this.total_out += len;
+this.avail_out -= len;
+this.dstate.pending -= len;
+if (this.dstate.pending == 0) {
+this.dstate.pending_out = 0;
+}});
+Clazz_defineMethod (c$, "read_buf", 
+function (buf, start, size) {
+var len = this.avail_in;
+if (len > size) len = size;
+if (len == 0) return 0;
+this.avail_in -= len;
+if (this.dstate.wrap != 0) {
+this.checksum.update (this.next_in, this.next_in_index, len);
+}System.arraycopy (this.next_in, this.next_in_index, buf, start, len);
+this.next_in_index += len;
+this.total_in += len;
+return len;
+}, "~A,~N,~N");
+Clazz_defineMethod (c$, "getAdler", 
+function () {
+return this.checksum.getValue ();
+});
+Clazz_defineMethod (c$, "free", 
+function () {
+this.next_in = null;
+this.next_out = null;
+this.msg = null;
+});
+Clazz_defineMethod (c$, "setOutput", 
+function (buf, off, len) {
+this.next_out = buf;
+this.next_out_index = off;
+this.avail_out = len;
+}, "~A,~N,~N");
+Clazz_defineMethod (c$, "setInput", 
+function (buf, off, len, append) {
+if (len <= 0 && append && this.next_in != null) return;
+if (this.avail_in > 0 && append) {
+var tmp =  Clazz_newByteArray (this.avail_in + len, 0);
+System.arraycopy (this.next_in, this.next_in_index, tmp, 0, this.avail_in);
+System.arraycopy (buf, off, tmp, this.avail_in, len);
+this.next_in = tmp;
+this.next_in_index = 0;
+this.avail_in += len;
+} else {
+this.next_in = buf;
+this.next_in_index = off;
+this.avail_in = len;
+}}, "~A,~N,~N,~B");
+Clazz_defineMethod (c$, "getAvailIn", 
+function () {
+return this.avail_in;
+});
+Clazz_defineMethod (c$, "getTotalOut", 
+function () {
+return this.total_out;
+});
+Clazz_defineMethod (c$, "getTotalIn", 
+function () {
+return this.total_in;
+});
+c$.getBytes = Clazz_defineMethod (c$, "getBytes", 
+function (s) {
+{
+var x = [];
+for (var i = 0; i < s.length;i++) {
+var pt = s.charCodeAt(i);
+if (pt <= 0x7F) {
+x.push(pt);
+} else if (pt <= 0x7FF) {
+x.push(0xC0|((pt>>6)&0x1F));
+x.push(0x80|(pt&0x3F));
+} else if (pt <= 0xFFFF) {
+x.push(0xE0|((pt>>12)&0xF));
+x.push(0x80|((pt>>6)&0x3F));
+x.push(0x80|(pt&0x3F));
+} else {
+x.push(0x3F); // '?'
+}
+}
+return (Int32Array != Array ? new Int32Array(x) : x);
+}}, "~S");
+Clazz_defineStatics (c$,
+"Z_STREAM_ERROR", -2);
+});
+Clazz_declarePackage ("JU");
+Clazz_load (["JU.Checksum"], "JU.Adler32", null, function () {
+c$ = Clazz_decorateAsClass (function () {
+this.s1 = 1;
+this.s2 = 0;
+this.b1 = null;
+Clazz_instantialize (this, arguments);
+}, JU, "Adler32", null, JU.Checksum);
+Clazz_prepareFields (c$, function () {
+this.b1 =  Clazz_newByteArray (1, 0);
+});
+Clazz_overrideMethod (c$, "resetLong", 
+function (init) {
+this.s1 = init & 0xffff;
+this.s2 = (init >> 16) & 0xffff;
+}, "~N");
+Clazz_overrideMethod (c$, "reset", 
+function () {
+this.s1 = 1;
+this.s2 = 0;
+});
+Clazz_overrideMethod (c$, "getValue", 
+function () {
+return ((this.s2 << 16) | this.s1);
+});
+Clazz_overrideMethod (c$, "update", 
+function (buf, index, len) {
+if (len == 1) {
+this.s1 += buf[index++] & 0xff;
+this.s2 += this.s1;
+this.s1 %= 65521;
+this.s2 %= 65521;
+return;
+}var len1 = Clazz_doubleToInt (len / 5552);
+var len2 = len % 5552;
+while (len1-- > 0) {
+var k = 5552;
+len -= k;
+while (k-- > 0) {
+this.s1 += buf[index++] & 0xff;
+this.s2 += this.s1;
+}
+this.s1 %= 65521;
+this.s2 %= 65521;
+}
+var k = len2;
+len -= k;
+while (k-- > 0) {
+this.s1 += buf[index++] & 0xff;
+this.s2 += this.s1;
+}
+this.s1 %= 65521;
+this.s2 %= 65521;
+}, "~A,~N,~N");
+Clazz_overrideMethod (c$, "updateByteAsInt", 
+function (b) {
+this.b1[0] = b;
+this.update (this.b1, 0, 1);
+}, "~N");
+Clazz_defineStatics (c$,
+"BASE", 65521,
+"NMAX", 5552);
+});
+Clazz_declarePackage ("JU");
+Clazz_load (["java.lang.Exception"], "JU.Inflate", ["JU.Adler32", "$.CRC32", "$.GZIPHeader", "$.InfBlocks", "java.io.ByteArrayOutputStream"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.mode = 0;
+this.method = 0;
+this.was = -1;
+this.need = 0;
+this.marker = 0;
+this.wrap = 0;
+this.wbits = 0;
+this.blocks = null;
+this.z = null;
+this.flags = 0;
+this.need_bytes = -1;
+this.crcbuf = null;
+this.gheader = null;
+if (!Clazz_isClassDefined ("JU.Inflate.Return")) {
+JU.Inflate.$Inflate$Return$ ();
+}
+this.tmp_string = null;
+Clazz_instantialize (this, arguments);
+}, JU, "Inflate");
+Clazz_prepareFields (c$, function () {
+this.crcbuf =  Clazz_newByteArray (4, 0);
+});
+Clazz_defineMethod (c$, "reset", 
+function () {
+this.inflateReset ();
+});
+Clazz_defineMethod (c$, "inflateReset", 
+function () {
+if (this.z == null) return -2;
+this.z.total_in = this.z.total_out = 0;
+this.z.msg = null;
+this.mode = 14;
+this.need_bytes = -1;
+this.blocks.reset ();
+return 0;
+});
+Clazz_defineMethod (c$, "inflateEnd", 
+function () {
+if (this.blocks != null) {
+this.blocks.free ();
+}return 0;
+});
+Clazz_makeConstructor (c$, 
+function (z) {
+this.z = z;
+}, "JU.ZStream");
+Clazz_defineMethod (c$, "inflateInit", 
+function (w) {
+this.z.msg = null;
+this.blocks = null;
+this.wrap = 0;
+if (w < 0) {
+w = -w;
+} else {
+this.wrap = (w >> 4) + 1;
+if (w < 48) w &= 15;
+}if (w < 8 || w > 15) {
+this.inflateEnd ();
+return -2;
+}if (this.blocks != null && this.wbits != w) {
+this.blocks.free ();
+this.blocks = null;
+}this.wbits = w;
+this.blocks =  new JU.InfBlocks (this.z, 1 << w);
+this.inflateReset ();
+return 0;
+}, "~N");
+Clazz_defineMethod (c$, "inflate", 
+function (f) {
+var r;
+var b;
+if (this.z == null || this.z.next_in == null) {
+if (f == 4 && this.mode == 14) return 0;
+return -2;
+}f = f == 4 ? -5 : 0;
+r = -5;
+while (true) {
+switch (this.mode) {
+case 14:
+if (this.wrap == 0) {
+this.mode = 7;
+break;
+}try {
+r = this.readBytes (2, r, f);
+} catch (e) {
+if (Clazz_exceptionOf (e, JU.Inflate.Return)) {
+return e.r;
+} else {
+throw e;
+}
+}
+if ((this.wrap & 2) != 0 && this.need == 0x8b1f) {
+this.z.checksum =  new JU.CRC32 ();
+this.checksum (2, this.need);
+if (this.gheader == null) this.gheader =  new JU.GZIPHeader ();
+this.mode = 23;
+break;
+}this.flags = 0;
+this.method = (this.need) & 0xff;
+b = ((this.need >> 8)) & 0xff;
+if ((this.wrap & 1) == 0 || (((this.method << 8) + b) % 31) != 0) {
+this.mode = 13;
+this.z.msg = "incorrect header check";
+break;
+}if ((this.method & 0xf) != 8) {
+this.mode = 13;
+this.z.msg = "unknown compression method";
+break;
+}if ((this.method >> 4) + 8 > this.wbits) {
+this.mode = 13;
+this.z.msg = "invalid window size";
+break;
+}this.z.checksum =  new JU.Adler32 ();
+if ((b & 32) == 0) {
+this.mode = 7;
+break;
+}this.mode = 2;
+case 2:
+if (this.z.avail_in == 0) return r;
+r = f;
+this.z.avail_in--;
+this.z.total_in++;
+this.need = ((this.z.next_in[this.z.next_in_index++] & 0xff) << 24) & 0xff000000;
+this.mode = 3;
+case 3:
+if (this.z.avail_in == 0) return r;
+r = f;
+this.z.avail_in--;
+this.z.total_in++;
+this.need += ((this.z.next_in[this.z.next_in_index++] & 0xff) << 16) & 0xff0000;
+this.mode = 4;
+case 4:
+if (this.z.avail_in == 0) return r;
+r = f;
+this.z.avail_in--;
+this.z.total_in++;
+this.need += ((this.z.next_in[this.z.next_in_index++] & 0xff) << 8) & 0xff00;
+this.mode = 5;
+case 5:
+if (this.z.avail_in == 0) return r;
+r = f;
+this.z.avail_in--;
+this.z.total_in++;
+this.need += (this.z.next_in[this.z.next_in_index++] & 0xff);
+this.z.checksum.resetLong (this.need);
+this.mode = 6;
+return 2;
+case 6:
+this.mode = 13;
+this.z.msg = "need dictionary";
+this.marker = 0;
+return -2;
+case 7:
+r = this.blocks.proc (r);
+if (r == -3) {
+this.mode = 13;
+this.marker = 0;
+break;
+}if (r == 0) {
+r = f;
+}if (r != 1) {
+return r;
+}r = f;
+this.was = this.z.checksum.getValue ();
+this.blocks.reset ();
+if (this.wrap == 0) {
+this.mode = 12;
+break;
+}this.mode = 8;
+case 8:
+if (this.z.avail_in == 0) return r;
+r = f;
+this.z.avail_in--;
+this.z.total_in++;
+this.need = ((this.z.next_in[this.z.next_in_index++] & 0xff) << 24) & 0xff000000;
+this.mode = 9;
+case 9:
+if (this.z.avail_in == 0) return r;
+r = f;
+this.z.avail_in--;
+this.z.total_in++;
+this.need += ((this.z.next_in[this.z.next_in_index++] & 0xff) << 16) & 0xff0000;
+this.mode = 10;
+case 10:
+if (this.z.avail_in == 0) return r;
+r = f;
+this.z.avail_in--;
+this.z.total_in++;
+this.need += ((this.z.next_in[this.z.next_in_index++] & 0xff) << 8) & 0xff00;
+this.mode = 11;
+case 11:
+if (this.z.avail_in == 0) return r;
+r = f;
+this.z.avail_in--;
+this.z.total_in++;
+this.need += (this.z.next_in[this.z.next_in_index++] & 0xff);
+if (this.flags != 0) {
+this.need = ((this.need & 0xff000000) >> 24 | (this.need & 0x00ff0000) >> 8 | (this.need & 0x0000ff00) << 8 | (this.need & 0x0000ffff) << 24) & 0xffffffff;
+}if (((this.was)) != ((this.need))) {
+this.z.msg = "incorrect data check";
+} else if (this.flags != 0 && this.gheader != null) {
+this.gheader.crc = this.need;
+}this.mode = 15;
+case 15:
+if (this.wrap != 0 && this.flags != 0) {
+try {
+r = this.readBytes (4, r, f);
+} catch (e) {
+if (Clazz_exceptionOf (e, JU.Inflate.Return)) {
+return e.r;
+} else {
+throw e;
+}
+}
+if (this.z.msg != null && this.z.msg.equals ("incorrect data check")) {
+this.mode = 13;
+this.marker = 5;
+break;
+}if (this.need != (this.z.total_out & 0xffffffff)) {
+this.z.msg = "incorrect length check";
+this.mode = 13;
+break;
+}this.z.msg = null;
+} else {
+if (this.z.msg != null && this.z.msg.equals ("incorrect data check")) {
+this.mode = 13;
+this.marker = 5;
+break;
+}}this.mode = 12;
+case 12:
+return 1;
+case 13:
+return -3;
+case 23:
+try {
+r = this.readBytes (2, r, f);
+} catch (e) {
+if (Clazz_exceptionOf (e, JU.Inflate.Return)) {
+return e.r;
+} else {
+throw e;
+}
+}
+this.flags = (this.need) & 0xffff;
+if ((this.flags & 0xff) != 8) {
+this.z.msg = "unknown compression method";
+this.mode = 13;
+break;
+}if ((this.flags & 0xe000) != 0) {
+this.z.msg = "unknown header flags set";
+this.mode = 13;
+break;
+}if ((this.flags & 0x0200) != 0) {
+this.checksum (2, this.need);
+}this.mode = 16;
+case 16:
+try {
+r = this.readBytes (4, r, f);
+} catch (e) {
+if (Clazz_exceptionOf (e, JU.Inflate.Return)) {
+return e.r;
+} else {
+throw e;
+}
+}
+if (this.gheader != null) this.gheader.time = this.need;
+if ((this.flags & 0x0200) != 0) {
+this.checksum (4, this.need);
+}this.mode = 17;
+case 17:
+try {
+r = this.readBytes (2, r, f);
+} catch (e) {
+if (Clazz_exceptionOf (e, JU.Inflate.Return)) {
+return e.r;
+} else {
+throw e;
+}
+}
+if (this.gheader != null) {
+this.gheader.xflags = (this.need) & 0xff;
+this.gheader.os = ((this.need) >> 8) & 0xff;
+}if ((this.flags & 0x0200) != 0) {
+this.checksum (2, this.need);
+}this.mode = 18;
+case 18:
+if ((this.flags & 0x0400) != 0) {
+try {
+r = this.readBytes (2, r, f);
+} catch (e) {
+if (Clazz_exceptionOf (e, JU.Inflate.Return)) {
+return e.r;
+} else {
+throw e;
+}
+}
+if (this.gheader != null) {
+this.gheader.extra =  Clazz_newByteArray ((this.need) & 0xffff, 0);
+}if ((this.flags & 0x0200) != 0) {
+this.checksum (2, this.need);
+}} else if (this.gheader != null) {
+this.gheader.extra = null;
+}this.mode = 19;
+case 19:
+if ((this.flags & 0x0400) != 0) {
+try {
+r = this.readBytes (r, f);
+if (this.gheader != null) {
+var foo = this.tmp_string.toByteArray ();
+this.tmp_string = null;
+if (foo.length == this.gheader.extra.length) {
+System.arraycopy (foo, 0, this.gheader.extra, 0, foo.length);
+} else {
+this.z.msg = "bad extra field length";
+this.mode = 13;
+break;
+}}} catch (e) {
+if (Clazz_exceptionOf (e, JU.Inflate.Return)) {
+return e.r;
+} else {
+throw e;
+}
+}
+} else if (this.gheader != null) {
+this.gheader.extra = null;
+}this.mode = 20;
+case 20:
+if ((this.flags & 0x0800) != 0) {
+try {
+r = this.readString (r, f);
+if (this.gheader != null) {
+this.gheader.name = this.tmp_string.toByteArray ();
+}this.tmp_string = null;
+} catch (e) {
+if (Clazz_exceptionOf (e, JU.Inflate.Return)) {
+return e.r;
+} else {
+throw e;
+}
+}
+} else if (this.gheader != null) {
+this.gheader.name = null;
+}this.mode = 21;
+case 21:
+if ((this.flags & 0x1000) != 0) {
+try {
+r = this.readString (r, f);
+if (this.gheader != null) {
+this.gheader.comment = this.tmp_string.toByteArray ();
+}this.tmp_string = null;
+} catch (e) {
+if (Clazz_exceptionOf (e, JU.Inflate.Return)) {
+return e.r;
+} else {
+throw e;
+}
+}
+} else if (this.gheader != null) {
+this.gheader.comment = null;
+}this.mode = 22;
+case 22:
+if ((this.flags & 0x0200) != 0) {
+try {
+r = this.readBytes (2, r, f);
+} catch (e) {
+if (Clazz_exceptionOf (e, JU.Inflate.Return)) {
+return e.r;
+} else {
+throw e;
+}
+}
+if (this.gheader != null) {
+this.gheader.hcrc = (this.need & 0xffff);
+}if (this.need != (this.z.checksum.getValue () & 0xffff)) {
+this.mode = 13;
+this.z.msg = "header crc mismatch";
+this.marker = 5;
+break;
+}}this.z.checksum =  new JU.CRC32 ();
+this.mode = 7;
+break;
+default:
+return -2;
+}
+}
+}, "~N");
+Clazz_defineMethod (c$, "inflateSetDictionary", 
+function (dictionary, dictLength) {
+if (this.z == null || (this.mode != 6 && this.wrap != 0)) {
+return -2;
+}var index = 0;
+var length = dictLength;
+if (this.mode == 6) {
+var adler_need = this.z.checksum.getValue ();
+this.z.checksum.reset ();
+this.z.checksum.update (dictionary, 0, dictLength);
+if (this.z.checksum.getValue () != adler_need) {
+return -3;
+}}this.z.checksum.reset ();
+if (length >= (1 << this.wbits)) {
+length = (1 << this.wbits) - 1;
+index = dictLength - length;
+}this.blocks.set_dictionary (dictionary, index, length);
+this.mode = 7;
+return 0;
+}, "~A,~N");
+Clazz_defineMethod (c$, "inflateSync", 
+function () {
+var n;
+var p;
+var m;
+var r;
+var w;
+if (this.z == null) return -2;
+if (this.mode != 13) {
+this.mode = 13;
+this.marker = 0;
+}if ((n = this.z.avail_in) == 0) return -5;
+p = this.z.next_in_index;
+m = this.marker;
+while (n != 0 && m < 4) {
+if (this.z.next_in[p] == JU.Inflate.mark[m]) {
+m++;
+} else if (this.z.next_in[p] != 0) {
+m = 0;
+} else {
+m = 4 - m;
+}p++;
+n--;
+}
+this.z.total_in += p - this.z.next_in_index;
+this.z.next_in_index = p;
+this.z.avail_in = n;
+this.marker = m;
+if (m != 4) {
+return -3;
+}r = this.z.total_in;
+w = this.z.total_out;
+this.inflateReset ();
+this.z.total_in = r;
+this.z.total_out = w;
+this.mode = 7;
+return 0;
+});
+Clazz_defineMethod (c$, "inflateSyncPoint", 
+function () {
+if (this.z == null || this.blocks == null) return -2;
+return this.blocks.sync_point ();
+});
+Clazz_defineMethod (c$, "readBytes", 
+ function (n, r, f) {
+if (this.need_bytes == -1) {
+this.need_bytes = n;
+this.need = 0;
+}while (this.need_bytes > 0) {
+if (this.z.avail_in == 0) {
+throw Clazz_innerTypeInstance (JU.Inflate.Return, this, null, r);
+}r = f;
+this.z.avail_in--;
+this.z.total_in++;
+this.need = this.need | ((this.z.next_in[this.z.next_in_index++] & 0xff) << ((n - this.need_bytes) * 8));
+this.need_bytes--;
+}
+if (n == 2) {
+this.need &= 0xffff;
+} else if (n == 4) {
+this.need &= 0xffffffff;
+}this.need_bytes = -1;
+return r;
+}, "~N,~N,~N");
+Clazz_defineMethod (c$, "readString", 
+ function (r, f) {
+if (this.tmp_string == null) {
+this.tmp_string =  new java.io.ByteArrayOutputStream ();
+}var b = 0;
+do {
+if (this.z.avail_in == 0) {
+throw Clazz_innerTypeInstance (JU.Inflate.Return, this, null, r);
+}r = f;
+this.z.avail_in--;
+this.z.total_in++;
+b = this.z.next_in[this.z.next_in_index];
+if (b != 0) this.tmp_string.write (this.z.next_in, this.z.next_in_index, 1);
+this.z.checksum.update (this.z.next_in, this.z.next_in_index, 1);
+this.z.next_in_index++;
+} while (b != 0);
+return r;
+}, "~N,~N");
+Clazz_defineMethod (c$, "readBytes", 
+ function (r, f) {
+if (this.tmp_string == null) {
+this.tmp_string =  new java.io.ByteArrayOutputStream ();
+}while (this.need > 0) {
+if (this.z.avail_in == 0) {
+throw Clazz_innerTypeInstance (JU.Inflate.Return, this, null, r);
+}r = f;
+this.z.avail_in--;
+this.z.total_in++;
+this.tmp_string.write (this.z.next_in, this.z.next_in_index, 1);
+this.z.checksum.update (this.z.next_in, this.z.next_in_index, 1);
+this.z.next_in_index++;
+this.need--;
+}
+return r;
+}, "~N,~N");
+Clazz_defineMethod (c$, "checksum", 
+ function (n, v) {
+for (var i = 0; i < n; i++) {
+this.crcbuf[i] = (v & 0xff);
+v >>= 8;
+}
+this.z.checksum.update (this.crcbuf, 0, n);
+}, "~N,~N");
+Clazz_defineMethod (c$, "getGZIPHeader", 
+function () {
+return this.gheader;
+});
+Clazz_defineMethod (c$, "inParsingHeader", 
+function () {
+switch (this.mode) {
+case 14:
+case 2:
+case 3:
+case 4:
+case 5:
+case 23:
+case 16:
+case 17:
+case 18:
+case 19:
+case 20:
+case 21:
+case 22:
+return true;
+default:
+return false;
+}
+});
+c$.$Inflate$Return$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_decorateAsClass (function () {
+Clazz_prepareCallback (this, arguments);
+this.r = 0;
+Clazz_instantialize (this, arguments);
+}, JU.Inflate, "Return", Exception);
+Clazz_makeConstructor (c$, 
+function (a) {
+Clazz_superConstructor (this, JU.Inflate.Return, []);
+this.r = a;
+}, "~N");
+c$ = Clazz_p0p ();
+};
+Clazz_defineStatics (c$,
+"PRESET_DICT", 0x20,
+"Z_NO_FLUSH", 0,
+"Z_PARTIAL_FLUSH", 1,
+"Z_SYNC_FLUSH", 2,
+"Z_FULL_FLUSH", 3,
+"Z_FINISH", 4,
+"Z_DEFLATED", 8,
+"Z_OK", 0,
+"Z_STREAM_END", 1,
+"Z_NEED_DICT", 2,
+"Z_STREAM_ERROR", -2,
+"Z_DATA_ERROR", -3,
+"Z_BUF_ERROR", -5,
+"DICT4", 2,
+"DICT3", 3,
+"DICT2", 4,
+"DICT1", 5,
+"DICT0", 6,
+"BLOCKS", 7,
+"CHECK4", 8,
+"CHECK3", 9,
+"CHECK2", 10,
+"CHECK1", 11,
+"DONE", 12,
+"BAD", 13,
+"HEAD", 14,
+"LENGTH", 15,
+"TIME", 16,
+"OS", 17,
+"EXLEN", 18,
+"EXTRA", 19,
+"NAME", 20,
+"COMMENT", 21,
+"HCRC", 22,
+"FLAGS", 23,
+"mark",  Clazz_newByteArray (-1, [0, 0, 0xff, 0xff]));
+});
+Clazz_declarePackage ("JU");
+Clazz_load (null, "JU.GZIPHeader", ["JU.ZStream", "java.lang.IllegalArgumentException", "$.InternalError"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.text = false;
+this.fhcrc = false;
+this.time = 0;
+this.xflags = 0;
+this.os = 255;
+this.extra = null;
+this.name = null;
+this.comment = null;
+this.hcrc = 0;
+this.crc = 0;
+this.done = false;
+this.mtime = 0;
+Clazz_instantialize (this, arguments);
+}, JU, "GZIPHeader", null, Cloneable);
+Clazz_defineMethod (c$, "setModifiedTime", 
+function (mtime) {
+this.mtime = mtime;
+}, "~N");
+Clazz_defineMethod (c$, "getModifiedTime", 
+function () {
+return this.mtime;
+});
+Clazz_defineMethod (c$, "setOS", 
+function (os) {
+if ((0 <= os && os <= 13) || os == 255) this.os = os;
+ else throw  new IllegalArgumentException ("os: " + os);
+}, "~N");
+Clazz_defineMethod (c$, "getOS", 
+function () {
+return this.os;
+});
+Clazz_defineMethod (c$, "setName", 
+function (name) {
+this.name = JU.ZStream.getBytes (name);
+}, "~S");
+Clazz_defineMethod (c$, "getName", 
+function () {
+if (this.name == null) return "";
+try {
+return  String.instantialize (this.name, "ISO-8859-1");
+} catch (e) {
+if (Clazz_exceptionOf (e, java.io.UnsupportedEncodingException)) {
+throw  new InternalError (e.toString ());
+} else {
+throw e;
+}
+}
+});
+Clazz_defineMethod (c$, "setComment", 
+function (comment) {
+this.comment = JU.ZStream.getBytes (comment);
+}, "~S");
+Clazz_defineMethod (c$, "getComment", 
+function () {
+if (this.comment == null) return "";
+try {
+return  String.instantialize (this.comment, "ISO-8859-1");
+} catch (e) {
+if (Clazz_exceptionOf (e, java.io.UnsupportedEncodingException)) {
+throw  new InternalError (e.toString ());
+} else {
+throw e;
+}
+}
+});
+Clazz_defineMethod (c$, "setCRC", 
+function (crc) {
+this.crc = crc;
+}, "~N");
+Clazz_defineMethod (c$, "getCRC", 
+function () {
+return this.crc;
+});
+Clazz_defineMethod (c$, "put", 
+function (d) {
+var flag = 0;
+if (this.text) {
+flag |= 1;
+}if (this.fhcrc) {
+flag |= 2;
+}if (this.extra != null) {
+flag |= 4;
+}if (this.name != null) {
+flag |= 8;
+}if (this.comment != null) {
+flag |= 16;
+}var xfl = 0;
+if (d.level == 1) {
+xfl |= 4;
+} else if (d.level == 9) {
+xfl |= 2;
+}d.put_short (0x8b1f);
+d.put_byteB (8);
+d.put_byteB (flag);
+d.put_byteB (this.mtime);
+d.put_byteB ((this.mtime >> 8));
+d.put_byteB ((this.mtime >> 16));
+d.put_byteB ((this.mtime >> 24));
+d.put_byteB (xfl);
+d.put_byteB (this.os);
+if (this.extra != null) {
+d.put_byteB (this.extra.length);
+d.put_byteB ((this.extra.length >> 8));
+d.put_byte (this.extra, 0, this.extra.length);
+}if (this.name != null) {
+d.put_byte (this.name, 0, this.name.length);
+d.put_byteB (0);
+}if (this.comment != null) {
+d.put_byte (this.comment, 0, this.comment.length);
+d.put_byteB (0);
+}}, "JU.Deflate");
+Clazz_defineMethod (c$, "clone", 
+function () {
+var gheader = Clazz_superCall (this, JU.GZIPHeader, "clone", []);
+var tmp;
+if (gheader.extra != null) {
+tmp =  Clazz_newByteArray (gheader.extra.length, 0);
+System.arraycopy (gheader.extra, 0, tmp, 0, tmp.length);
+gheader.extra = tmp;
+}if (gheader.name != null) {
+tmp =  Clazz_newByteArray (gheader.name.length, 0);
+System.arraycopy (gheader.name, 0, tmp, 0, tmp.length);
+gheader.name = tmp;
+}if (gheader.comment != null) {
+tmp =  Clazz_newByteArray (gheader.comment.length, 0);
+System.arraycopy (gheader.comment, 0, tmp, 0, tmp.length);
+gheader.comment = tmp;
+}return gheader;
+});
+Clazz_defineStatics (c$,
+"OS_MSDOS", 0x00,
+"OS_AMIGA", 0x01,
+"OS_VMS", 0x02,
+"OS_UNIX", 0x03,
+"OS_ATARI", 0x05,
+"OS_OS2", 0x06,
+"OS_MACOS", 0x07,
+"OS_TOPS20", 0x0a,
+"OS_WIN32", 0x0b,
+"OS_VMCMS", 0x04,
+"OS_ZSYSTEM", 0x08,
+"OS_CPM", 0x09,
+"OS_QDOS", 0x0c,
+"OS_RISCOS", 0x0d,
+"OS_UNKNOWN", 0xff);
+});
+Clazz_declarePackage ("JU");
+Clazz_load (["JU.InfTree"], "JU.InfBlocks", ["JU.InfCodes"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.mode = 0;
+this.left = 0;
+this.table = 0;
+this.index = 0;
+this.blens = null;
+this.bb = null;
+this.tb = null;
+this.bl = null;
+this.bd = null;
+this.tl = null;
+this.td = null;
+this.tli = null;
+this.tdi = null;
+this.codes = null;
+this.last = 0;
+this.bitk = 0;
+this.bitb = 0;
+this.hufts = null;
+this.window = null;
+this.end = 0;
+this.read = 0;
+this.write = 0;
+this.check = false;
+this.inftree = null;
+this.z = null;
+Clazz_instantialize (this, arguments);
+}, JU, "InfBlocks");
+Clazz_prepareFields (c$, function () {
+this.bb =  Clazz_newIntArray (1, 0);
+this.tb =  Clazz_newIntArray (1, 0);
+this.bl =  Clazz_newIntArray (1, 0);
+this.bd =  Clazz_newIntArray (1, 0);
+this.tli =  Clazz_newIntArray (1, 0);
+this.tdi =  Clazz_newIntArray (1, 0);
+this.inftree =  new JU.InfTree ();
+});
+Clazz_makeConstructor (c$, 
+function (z, w) {
+this.z = z;
+this.codes =  new JU.InfCodes (this.z, this);
+this.hufts =  Clazz_newIntArray (4320, 0);
+this.window =  Clazz_newByteArray (w, 0);
+this.end = w;
+this.check = (z.istate.wrap == 0) ? false : true;
+this.mode = 0;
+{
+this.tl = Clazz_newArray(1, null);
+this.td = Clazz_newArray(1, null);
+}this.reset ();
+}, "JU.ZStream,~N");
+Clazz_defineMethod (c$, "reset", 
+function () {
+if (this.mode == 6) {
+this.codes.free (this.z);
+}this.mode = 0;
+this.bitk = 0;
+this.bitb = 0;
+this.read = this.write = 0;
+if (this.check) {
+this.z.checksum.reset ();
+}});
+Clazz_defineMethod (c$, "proc", 
+function (r) {
+var t;
+var b;
+var k;
+var p;
+var n;
+var q;
+var m;
+{
+p = this.z.next_in_index;
+n = this.z.avail_in;
+b = this.bitb;
+k = this.bitk;
+}{
+q = this.write;
+m = (q < this.read ? this.read - q - 1 : this.end - q);
+}while (true) {
+switch (this.mode) {
+case 0:
+while (k < (3)) {
+if (n != 0) {
+r = 0;
+} else {
+this.bitb = b;
+this.bitk = k;
+this.z.avail_in = n;
+this.z.total_in += p - this.z.next_in_index;
+this.z.next_in_index = p;
+this.write = q;
+return this.inflate_flush (r);
+}n--;
+b |= (this.z.next_in[p++] & 0xff) << k;
+k += 8;
+}
+t = (b & 7);
+this.last = t & 1;
+switch (t >>> 1) {
+case 0:
+{
+b >>>= (3);
+k -= (3);
+}t = k & 7;
+{
+b >>>= (t);
+k -= (t);
+}this.mode = 1;
+break;
+case 1:
+JU.InfTree.inflate_trees_fixed (this.bl, this.bd, this.tl, this.td, this.z);
+this.codes.init (this.bl[0], this.bd[0], this.tl[0], 0, this.td[0], 0);
+{
+b >>>= (3);
+k -= (3);
+}this.mode = 6;
+break;
+case 2:
+{
+b >>>= (3);
+k -= (3);
+}this.mode = 3;
+break;
+case 3:
+{
+b >>>= (3);
+k -= (3);
+}this.mode = 9;
+this.z.msg = "invalid block type";
+r = -3;
+this.bitb = b;
+this.bitk = k;
+this.z.avail_in = n;
+this.z.total_in += p - this.z.next_in_index;
+this.z.next_in_index = p;
+this.write = q;
+return this.inflate_flush (r);
+}
+break;
+case 1:
+while (k < (32)) {
+if (n != 0) {
+r = 0;
+} else {
+this.bitb = b;
+this.bitk = k;
+this.z.avail_in = n;
+this.z.total_in += p - this.z.next_in_index;
+this.z.next_in_index = p;
+this.write = q;
+return this.inflate_flush (r);
+}n--;
+b |= (this.z.next_in[p++] & 0xff) << k;
+k += 8;
+}
+if ((((~b) >>> 16) & 0xffff) != (b & 0xffff)) {
+this.mode = 9;
+this.z.msg = "invalid stored block lengths";
+r = -3;
+this.bitb = b;
+this.bitk = k;
+this.z.avail_in = n;
+this.z.total_in += p - this.z.next_in_index;
+this.z.next_in_index = p;
+this.write = q;
+return this.inflate_flush (r);
+}this.left = (b & 0xffff);
+b = k = 0;
+this.mode = this.left != 0 ? 2 : (this.last != 0 ? 7 : 0);
+break;
+case 2:
+if (n == 0) {
+this.bitb = b;
+this.bitk = k;
+this.z.avail_in = n;
+this.z.total_in += p - this.z.next_in_index;
+this.z.next_in_index = p;
+this.write = q;
+return this.inflate_flush (r);
+}if (m == 0) {
+if (q == this.end && this.read != 0) {
+q = 0;
+m = (q < this.read ? this.read - q - 1 : this.end - q);
+}if (m == 0) {
+this.write = q;
+r = this.inflate_flush (r);
+q = this.write;
+m = (q < this.read ? this.read - q - 1 : this.end - q);
+if (q == this.end && this.read != 0) {
+q = 0;
+m = (q < this.read ? this.read - q - 1 : this.end - q);
+}if (m == 0) {
+this.bitb = b;
+this.bitk = k;
+this.z.avail_in = n;
+this.z.total_in += p - this.z.next_in_index;
+this.z.next_in_index = p;
+this.write = q;
+return this.inflate_flush (r);
+}}}r = 0;
+t = this.left;
+if (t > n) t = n;
+if (t > m) t = m;
+System.arraycopy (this.z.next_in, p, this.window, q, t);
+p += t;
+n -= t;
+q += t;
+m -= t;
+if ((this.left -= t) != 0) break;
+this.mode = this.last != 0 ? 7 : 0;
+break;
+case 3:
+while (k < (14)) {
+if (n != 0) {
+r = 0;
+} else {
+this.bitb = b;
+this.bitk = k;
+this.z.avail_in = n;
+this.z.total_in += p - this.z.next_in_index;
+this.z.next_in_index = p;
+this.write = q;
+return this.inflate_flush (r);
+}n--;
+b |= (this.z.next_in[p++] & 0xff) << k;
+k += 8;
+}
+this.table = t = (b & 0x3fff);
+if ((t & 0x1f) > 29 || ((t >> 5) & 0x1f) > 29) {
+this.mode = 9;
+this.z.msg = "too many length or distance symbols";
+r = -3;
+this.bitb = b;
+this.bitk = k;
+this.z.avail_in = n;
+this.z.total_in += p - this.z.next_in_index;
+this.z.next_in_index = p;
+this.write = q;
+return this.inflate_flush (r);
+}t = 258 + (t & 0x1f) + ((t >> 5) & 0x1f);
+if (this.blens == null || this.blens.length < t) {
+this.blens =  Clazz_newIntArray (t, 0);
+} else {
+for (var i = 0; i < t; i++) {
+this.blens[i] = 0;
+}
+}{
+b >>>= (14);
+k -= (14);
+}this.index = 0;
+this.mode = 4;
+case 4:
+while (this.index < 4 + (this.table >>> 10)) {
+while (k < (3)) {
+if (n != 0) {
+r = 0;
+} else {
+this.bitb = b;
+this.bitk = k;
+this.z.avail_in = n;
+this.z.total_in += p - this.z.next_in_index;
+this.z.next_in_index = p;
+this.write = q;
+return this.inflate_flush (r);
+}n--;
+b |= (this.z.next_in[p++] & 0xff) << k;
+k += 8;
+}
+this.blens[JU.InfBlocks.border[this.index++]] = b & 7;
+{
+b >>>= (3);
+k -= (3);
+}}
+while (this.index < 19) {
+this.blens[JU.InfBlocks.border[this.index++]] = 0;
+}
+this.bb[0] = 7;
+t = this.inftree.inflate_trees_bits (this.blens, this.bb, this.tb, this.hufts, this.z);
+if (t != 0) {
+r = t;
+if (r == -3) {
+this.blens = null;
+this.mode = 9;
+}this.bitb = b;
+this.bitk = k;
+this.z.avail_in = n;
+this.z.total_in += p - this.z.next_in_index;
+this.z.next_in_index = p;
+this.write = q;
+return this.inflate_flush (r);
+}this.index = 0;
+this.mode = 5;
+case 5:
+while (true) {
+t = this.table;
+if (!(this.index < 258 + (t & 0x1f) + ((t >> 5) & 0x1f))) {
+break;
+}var i;
+var j;
+var c;
+t = this.bb[0];
+while (k < (t)) {
+if (n != 0) {
+r = 0;
+} else {
+this.bitb = b;
+this.bitk = k;
+this.z.avail_in = n;
+this.z.total_in += p - this.z.next_in_index;
+this.z.next_in_index = p;
+this.write = q;
+return this.inflate_flush (r);
+}n--;
+b |= (this.z.next_in[p++] & 0xff) << k;
+k += 8;
+}
+t = this.hufts[(this.tb[0] + (b & JU.InfBlocks.inflate_mask[t])) * 3 + 1];
+c = this.hufts[(this.tb[0] + (b & JU.InfBlocks.inflate_mask[t])) * 3 + 2];
+if (c < 16) {
+b >>>= (t);
+k -= (t);
+this.blens[this.index++] = c;
+} else {
+i = c == 18 ? 7 : c - 14;
+j = c == 18 ? 11 : 3;
+while (k < (t + i)) {
+if (n != 0) {
+r = 0;
+} else {
+this.bitb = b;
+this.bitk = k;
+this.z.avail_in = n;
+this.z.total_in += p - this.z.next_in_index;
+this.z.next_in_index = p;
+this.write = q;
+return this.inflate_flush (r);
+}n--;
+b |= (this.z.next_in[p++] & 0xff) << k;
+k += 8;
+}
+b >>>= (t);
+k -= (t);
+j += (b & JU.InfBlocks.inflate_mask[i]);
+b >>>= (i);
+k -= (i);
+i = this.index;
+t = this.table;
+if (i + j > 258 + (t & 0x1f) + ((t >> 5) & 0x1f) || (c == 16 && i < 1)) {
+this.blens = null;
+this.mode = 9;
+this.z.msg = "invalid bit length repeat";
+r = -3;
+this.bitb = b;
+this.bitk = k;
+this.z.avail_in = n;
+this.z.total_in += p - this.z.next_in_index;
+this.z.next_in_index = p;
+this.write = q;
+return this.inflate_flush (r);
+}c = c == 16 ? this.blens[i - 1] : 0;
+do {
+this.blens[i++] = c;
+} while (--j != 0);
+this.index = i;
+}}
+this.tb[0] = -1;
+{
+this.bl[0] = 9;
+this.bd[0] = 6;
+t = this.table;
+t = this.inftree.inflate_trees_dynamic (257 + (t & 0x1f), 1 + ((t >> 5) & 0x1f), this.blens, this.bl, this.bd, this.tli, this.tdi, this.hufts, this.z);
+if (t != 0) {
+if (t == -3) {
+this.blens = null;
+this.mode = 9;
+}r = t;
+this.bitb = b;
+this.bitk = k;
+this.z.avail_in = n;
+this.z.total_in += p - this.z.next_in_index;
+this.z.next_in_index = p;
+this.write = q;
+return this.inflate_flush (r);
+}this.codes.init (this.bl[0], this.bd[0], this.hufts, this.tli[0], this.hufts, this.tdi[0]);
+}this.mode = 6;
+case 6:
+this.bitb = b;
+this.bitk = k;
+this.z.avail_in = n;
+this.z.total_in += p - this.z.next_in_index;
+this.z.next_in_index = p;
+this.write = q;
+if ((r = this.codes.proc (r)) != 1) {
+return this.inflate_flush (r);
+}r = 0;
+this.codes.free (this.z);
+p = this.z.next_in_index;
+n = this.z.avail_in;
+b = this.bitb;
+k = this.bitk;
+q = this.write;
+m = (q < this.read ? this.read - q - 1 : this.end - q);
+if (this.last == 0) {
+this.mode = 0;
+break;
+}this.mode = 7;
+case 7:
+this.write = q;
+r = this.inflate_flush (r);
+q = this.write;
+m = (q < this.read ? this.read - q - 1 : this.end - q);
+if (this.read != this.write) {
+this.bitb = b;
+this.bitk = k;
+this.z.avail_in = n;
+this.z.total_in += p - this.z.next_in_index;
+this.z.next_in_index = p;
+this.write = q;
+return this.inflate_flush (r);
+}this.mode = 8;
+case 8:
+r = 1;
+this.bitb = b;
+this.bitk = k;
+this.z.avail_in = n;
+this.z.total_in += p - this.z.next_in_index;
+this.z.next_in_index = p;
+this.write = q;
+return this.inflate_flush (r);
+case 9:
+r = -3;
+this.bitb = b;
+this.bitk = k;
+this.z.avail_in = n;
+this.z.total_in += p - this.z.next_in_index;
+this.z.next_in_index = p;
+this.write = q;
+return this.inflate_flush (r);
+default:
+r = -2;
+this.bitb = b;
+this.bitk = k;
+this.z.avail_in = n;
+this.z.total_in += p - this.z.next_in_index;
+this.z.next_in_index = p;
+this.write = q;
+return this.inflate_flush (r);
+}
+}
+}, "~N");
+Clazz_defineMethod (c$, "free", 
+function () {
+this.reset ();
+this.window = null;
+this.hufts = null;
+});
+Clazz_defineMethod (c$, "set_dictionary", 
+function (d, start, n) {
+System.arraycopy (d, start, this.window, 0, n);
+this.read = this.write = n;
+}, "~A,~N,~N");
+Clazz_defineMethod (c$, "sync_point", 
+function () {
+return this.mode == 1 ? 1 : 0;
+});
+Clazz_defineMethod (c$, "inflate_flush", 
+function (r) {
+var n;
+var p;
+var q;
+p = this.z.next_out_index;
+q = this.read;
+n = ((q <= this.write ? this.write : this.end) - q);
+if (n > this.z.avail_out) n = this.z.avail_out;
+if (n != 0 && r == -5) r = 0;
+this.z.avail_out -= n;
+this.z.total_out += n;
+if (this.check && n > 0) {
+this.z.checksum.update (this.window, q, n);
+}System.arraycopy (this.window, q, this.z.next_out, p, n);
+p += n;
+q += n;
+if (q == this.end) {
+q = 0;
+if (this.write == this.end) this.write = 0;
+n = this.write - q;
+if (n > this.z.avail_out) n = this.z.avail_out;
+if (n != 0 && r == -5) r = 0;
+this.z.avail_out -= n;
+this.z.total_out += n;
+if (this.check && n > 0) {
+this.z.checksum.update (this.window, q, n);
+}System.arraycopy (this.window, q, this.z.next_out, p, n);
+p += n;
+q += n;
+}this.z.next_out_index = p;
+this.read = q;
+return r;
+}, "~N");
+Clazz_defineStatics (c$,
+"MANY", 1440,
+"inflate_mask",  Clazz_newIntArray (-1, [0x00000000, 0x00000001, 0x00000003, 0x00000007, 0x0000000f, 0x0000001f, 0x0000003f, 0x0000007f, 0x000000ff, 0x000001ff, 0x000003ff, 0x000007ff, 0x00000fff, 0x00001fff, 0x00003fff, 0x00007fff, 0x0000ffff]),
+"border",  Clazz_newIntArray (-1, [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]),
+"Z_OK", 0,
+"Z_STREAM_END", 1,
+"Z_STREAM_ERROR", -2,
+"Z_DATA_ERROR", -3,
+"Z_BUF_ERROR", -5,
+"TYPE", 0,
+"LENS", 1,
+"STORED", 2,
+"TABLE", 3,
+"BTREE", 4,
+"DTREE", 5,
+"CODES", 6,
+"DRY", 7,
+"DONE", 8,
+"BAD", 9);
+});
+Clazz_declarePackage ("JU");
+c$ = Clazz_decorateAsClass (function () {
+this.hn = null;
+this.v = null;
+this.c = null;
+this.r = null;
+this.u = null;
+this.x = null;
+Clazz_instantialize (this, arguments);
+}, JU, "InfTree");
+Clazz_defineMethod (c$, "huft_build", 
+ function (b, bindex, n, s, d, e, t, m, hp, hn, v) {
+var a;
+var f;
+var g;
+var h;
+var i;
+var j;
+var k;
+var l;
+var mask;
+var p;
+var q;
+var w;
+var xp;
+var y;
+var z;
+p = 0;
+i = n;
+do {
+this.c[b[bindex + p]]++;
+p++;
+i--;
+} while (i != 0);
+if (this.c[0] == n) {
+t[0] = -1;
+m[0] = 0;
+return 0;
+}l = m[0];
+for (j = 1; j <= 15; j++) if (this.c[j] != 0) break;
+
+k = j;
+if (l < j) {
+l = j;
+}for (i = 15; i != 0; i--) {
+if (this.c[i] != 0) break;
+}
+g = i;
+if (l > i) {
+l = i;
+}m[0] = l;
+for (y = 1 << j; j < i; j++, y <<= 1) {
+if ((y -= this.c[j]) < 0) {
+return -3;
+}}
+if ((y -= this.c[i]) < 0) {
+return -3;
+}this.c[i] += y;
+this.x[1] = j = 0;
+p = 1;
+xp = 2;
+while (--i != 0) {
+this.x[xp] = (j += this.c[p]);
+xp++;
+p++;
+}
+i = 0;
+p = 0;
+do {
+if ((j = b[bindex + p]) != 0) {
+v[this.x[j]++] = i;
+}p++;
+} while (++i < n);
+n = this.x[g];
+this.x[0] = i = 0;
+p = 0;
+h = -1;
+w = -l;
+this.u[0] = 0;
+q = 0;
+z = 0;
+for (; k <= g; k++) {
+a = this.c[k];
+while (a-- != 0) {
+while (k > w + l) {
+h++;
+w += l;
+z = g - w;
+z = (z > l) ? l : z;
+if ((f = 1 << (j = k - w)) > a + 1) {
+f -= a + 1;
+xp = k;
+if (j < z) {
+while (++j < z) {
+if ((f <<= 1) <= this.c[++xp]) break;
+f -= this.c[xp];
+}
+}}z = 1 << j;
+if (hn[0] + z > 1440) {
+return -3;
+}this.u[h] = q = hn[0];
+hn[0] += z;
+if (h != 0) {
+this.x[h] = i;
+this.r[0] = j;
+this.r[1] = l;
+j = i >>> (w - l);
+this.r[2] = (q - this.u[h - 1] - j);
+System.arraycopy (this.r, 0, hp, (this.u[h - 1] + j) * 3, 3);
+} else {
+t[0] = q;
+}}
+this.r[1] = (k - w);
+if (p >= n) {
+this.r[0] = 192;
+} else if (v[p] < s) {
+this.r[0] = (v[p] < 256 ? 0 : 96);
+this.r[2] = v[p++];
+} else {
+this.r[0] = (e[v[p] - s] + 16 + 64);
+this.r[2] = d[v[p++] - s];
+}f = 1 << (k - w);
+for (j = i >>> w; j < z; j += f) {
+System.arraycopy (this.r, 0, hp, (q + j) * 3, 3);
+}
+for (j = 1 << (k - 1); (i & j) != 0; j >>>= 1) {
+i ^= j;
+}
+i ^= j;
+mask = (1 << w) - 1;
+while ((i & mask) != this.x[h]) {
+h--;
+w -= l;
+mask = (1 << w) - 1;
+}
+}
+}
+return y != 0 && g != 1 ? -5 : 0;
+}, "~A,~N,~N,~N,~A,~A,~A,~A,~A,~A,~A");
+Clazz_defineMethod (c$, "inflate_trees_bits", 
+function (c, bb, tb, hp, z) {
+var result;
+this.initWorkArea (19);
+this.hn[0] = 0;
+result = this.huft_build (c, 0, 19, 19, null, null, tb, bb, hp, this.hn, this.v);
+if (result == -3) {
+z.msg = "oversubscribed dynamic bit lengths tree";
+} else if (result == -5 || bb[0] == 0) {
+z.msg = "incomplete dynamic bit lengths tree";
+result = -3;
+}return result;
+}, "~A,~A,~A,~A,JU.ZStream");
+Clazz_defineMethod (c$, "inflate_trees_dynamic", 
+function (nl, nd, c, bl, bd, tl, td, hp, z) {
+var result;
+this.initWorkArea (288);
+this.hn[0] = 0;
+result = this.huft_build (c, 0, nl, 257, JU.InfTree.cplens, JU.InfTree.cplext, tl, bl, hp, this.hn, this.v);
+if (result != 0 || bl[0] == 0) {
+if (result == -3) {
+z.msg = "oversubscribed literal/length tree";
+} else if (result != -4) {
+z.msg = "incomplete literal/length tree";
+result = -3;
+}return result;
+}this.initWorkArea (288);
+result = this.huft_build (c, nl, nd, 0, JU.InfTree.cpdist, JU.InfTree.cpdext, td, bd, hp, this.hn, this.v);
+if (result != 0 || (bd[0] == 0 && nl > 257)) {
+if (result == -3) {
+z.msg = "oversubscribed distance tree";
+} else if (result == -5) {
+z.msg = "incomplete distance tree";
+result = -3;
+} else if (result != -4) {
+z.msg = "empty distance tree with lengths";
+result = -3;
+}return result;
+}return 0;
+}, "~N,~N,~A,~A,~A,~A,~A,~A,JU.ZStream");
+c$.inflate_trees_fixed = Clazz_defineMethod (c$, "inflate_trees_fixed", 
+function (bl, bd, tl, td, z) {
+bl[0] = 9;
+bd[0] = 5;
+tl[0] = JU.InfTree.fixed_tl;
+td[0] = JU.InfTree.fixed_td;
+return 0;
+}, "~A,~A,~A,~A,JU.ZStream");
+Clazz_defineMethod (c$, "initWorkArea", 
+ function (vsize) {
+if (this.hn == null) {
+this.hn =  Clazz_newIntArray (1, 0);
+this.v =  Clazz_newIntArray (vsize, 0);
+this.c =  Clazz_newIntArray (16, 0);
+this.r =  Clazz_newIntArray (3, 0);
+this.u =  Clazz_newIntArray (15, 0);
+this.x =  Clazz_newIntArray (16, 0);
+}if (this.v.length < vsize) {
+this.v =  Clazz_newIntArray (vsize, 0);
+}for (var i = 0; i < vsize; i++) {
+this.v[i] = 0;
+}
+for (var i = 0; i < 16; i++) {
+this.c[i] = 0;
+}
+for (var i = 0; i < 3; i++) {
+this.r[i] = 0;
+}
+System.arraycopy (this.c, 0, this.u, 0, 15);
+System.arraycopy (this.c, 0, this.x, 0, 16);
+}, "~N");
+Clazz_defineStatics (c$,
+"MANY", 1440,
+"Z_OK", 0,
+"Z_DATA_ERROR", -3,
+"Z_MEM_ERROR", -4,
+"Z_BUF_ERROR", -5,
+"fixed_bl", 9,
+"fixed_bd", 5,
+"fixed_tl",  Clazz_newIntArray (-1, [96, 7, 256, 0, 8, 80, 0, 8, 16, 84, 8, 115, 82, 7, 31, 0, 8, 112, 0, 8, 48, 0, 9, 192, 80, 7, 10, 0, 8, 96, 0, 8, 32, 0, 9, 160, 0, 8, 0, 0, 8, 128, 0, 8, 64, 0, 9, 224, 80, 7, 6, 0, 8, 88, 0, 8, 24, 0, 9, 144, 83, 7, 59, 0, 8, 120, 0, 8, 56, 0, 9, 208, 81, 7, 17, 0, 8, 104, 0, 8, 40, 0, 9, 176, 0, 8, 8, 0, 8, 136, 0, 8, 72, 0, 9, 240, 80, 7, 4, 0, 8, 84, 0, 8, 20, 85, 8, 227, 83, 7, 43, 0, 8, 116, 0, 8, 52, 0, 9, 200, 81, 7, 13, 0, 8, 100, 0, 8, 36, 0, 9, 168, 0, 8, 4, 0, 8, 132, 0, 8, 68, 0, 9, 232, 80, 7, 8, 0, 8, 92, 0, 8, 28, 0, 9, 152, 84, 7, 83, 0, 8, 124, 0, 8, 60, 0, 9, 216, 82, 7, 23, 0, 8, 108, 0, 8, 44, 0, 9, 184, 0, 8, 12, 0, 8, 140, 0, 8, 76, 0, 9, 248, 80, 7, 3, 0, 8, 82, 0, 8, 18, 85, 8, 163, 83, 7, 35, 0, 8, 114, 0, 8, 50, 0, 9, 196, 81, 7, 11, 0, 8, 98, 0, 8, 34, 0, 9, 164, 0, 8, 2, 0, 8, 130, 0, 8, 66, 0, 9, 228, 80, 7, 7, 0, 8, 90, 0, 8, 26, 0, 9, 148, 84, 7, 67, 0, 8, 122, 0, 8, 58, 0, 9, 212, 82, 7, 19, 0, 8, 106, 0, 8, 42, 0, 9, 180, 0, 8, 10, 0, 8, 138, 0, 8, 74, 0, 9, 244, 80, 7, 5, 0, 8, 86, 0, 8, 22, 192, 8, 0, 83, 7, 51, 0, 8, 118, 0, 8, 54, 0, 9, 204, 81, 7, 15, 0, 8, 102, 0, 8, 38, 0, 9, 172, 0, 8, 6, 0, 8, 134, 0, 8, 70, 0, 9, 236, 80, 7, 9, 0, 8, 94, 0, 8, 30, 0, 9, 156, 84, 7, 99, 0, 8, 126, 0, 8, 62, 0, 9, 220, 82, 7, 27, 0, 8, 110, 0, 8, 46, 0, 9, 188, 0, 8, 14, 0, 8, 142, 0, 8, 78, 0, 9, 252, 96, 7, 256, 0, 8, 81, 0, 8, 17, 85, 8, 131, 82, 7, 31, 0, 8, 113, 0, 8, 49, 0, 9, 194, 80, 7, 10, 0, 8, 97, 0, 8, 33, 0, 9, 162, 0, 8, 1, 0, 8, 129, 0, 8, 65, 0, 9, 226, 80, 7, 6, 0, 8, 89, 0, 8, 25, 0, 9, 146, 83, 7, 59, 0, 8, 121, 0, 8, 57, 0, 9, 210, 81, 7, 17, 0, 8, 105, 0, 8, 41, 0, 9, 178, 0, 8, 9, 0, 8, 137, 0, 8, 73, 0, 9, 242, 80, 7, 4, 0, 8, 85, 0, 8, 21, 80, 8, 258, 83, 7, 43, 0, 8, 117, 0, 8, 53, 0, 9, 202, 81, 7, 13, 0, 8, 101, 0, 8, 37, 0, 9, 170, 0, 8, 5, 0, 8, 133, 0, 8, 69, 0, 9, 234, 80, 7, 8, 0, 8, 93, 0, 8, 29, 0, 9, 154, 84, 7, 83, 0, 8, 125, 0, 8, 61, 0, 9, 218, 82, 7, 23, 0, 8, 109, 0, 8, 45, 0, 9, 186, 0, 8, 13, 0, 8, 141, 0, 8, 77, 0, 9, 250, 80, 7, 3, 0, 8, 83, 0, 8, 19, 85, 8, 195, 83, 7, 35, 0, 8, 115, 0, 8, 51, 0, 9, 198, 81, 7, 11, 0, 8, 99, 0, 8, 35, 0, 9, 166, 0, 8, 3, 0, 8, 131, 0, 8, 67, 0, 9, 230, 80, 7, 7, 0, 8, 91, 0, 8, 27, 0, 9, 150, 84, 7, 67, 0, 8, 123, 0, 8, 59, 0, 9, 214, 82, 7, 19, 0, 8, 107, 0, 8, 43, 0, 9, 182, 0, 8, 11, 0, 8, 139, 0, 8, 75, 0, 9, 246, 80, 7, 5, 0, 8, 87, 0, 8, 23, 192, 8, 0, 83, 7, 51, 0, 8, 119, 0, 8, 55, 0, 9, 206, 81, 7, 15, 0, 8, 103, 0, 8, 39, 0, 9, 174, 0, 8, 7, 0, 8, 135, 0, 8, 71, 0, 9, 238, 80, 7, 9, 0, 8, 95, 0, 8, 31, 0, 9, 158, 84, 7, 99, 0, 8, 127, 0, 8, 63, 0, 9, 222, 82, 7, 27, 0, 8, 111, 0, 8, 47, 0, 9, 190, 0, 8, 15, 0, 8, 143, 0, 8, 79, 0, 9, 254, 96, 7, 256, 0, 8, 80, 0, 8, 16, 84, 8, 115, 82, 7, 31, 0, 8, 112, 0, 8, 48, 0, 9, 193, 80, 7, 10, 0, 8, 96, 0, 8, 32, 0, 9, 161, 0, 8, 0, 0, 8, 128, 0, 8, 64, 0, 9, 225, 80, 7, 6, 0, 8, 88, 0, 8, 24, 0, 9, 145, 83, 7, 59, 0, 8, 120, 0, 8, 56, 0, 9, 209, 81, 7, 17, 0, 8, 104, 0, 8, 40, 0, 9, 177, 0, 8, 8, 0, 8, 136, 0, 8, 72, 0, 9, 241, 80, 7, 4, 0, 8, 84, 0, 8, 20, 85, 8, 227, 83, 7, 43, 0, 8, 116, 0, 8, 52, 0, 9, 201, 81, 7, 13, 0, 8, 100, 0, 8, 36, 0, 9, 169, 0, 8, 4, 0, 8, 132, 0, 8, 68, 0, 9, 233, 80, 7, 8, 0, 8, 92, 0, 8, 28, 0, 9, 153, 84, 7, 83, 0, 8, 124, 0, 8, 60, 0, 9, 217, 82, 7, 23, 0, 8, 108, 0, 8, 44, 0, 9, 185, 0, 8, 12, 0, 8, 140, 0, 8, 76, 0, 9, 249, 80, 7, 3, 0, 8, 82, 0, 8, 18, 85, 8, 163, 83, 7, 35, 0, 8, 114, 0, 8, 50, 0, 9, 197, 81, 7, 11, 0, 8, 98, 0, 8, 34, 0, 9, 165, 0, 8, 2, 0, 8, 130, 0, 8, 66, 0, 9, 229, 80, 7, 7, 0, 8, 90, 0, 8, 26, 0, 9, 149, 84, 7, 67, 0, 8, 122, 0, 8, 58, 0, 9, 213, 82, 7, 19, 0, 8, 106, 0, 8, 42, 0, 9, 181, 0, 8, 10, 0, 8, 138, 0, 8, 74, 0, 9, 245, 80, 7, 5, 0, 8, 86, 0, 8, 22, 192, 8, 0, 83, 7, 51, 0, 8, 118, 0, 8, 54, 0, 9, 205, 81, 7, 15, 0, 8, 102, 0, 8, 38, 0, 9, 173, 0, 8, 6, 0, 8, 134, 0, 8, 70, 0, 9, 237, 80, 7, 9, 0, 8, 94, 0, 8, 30, 0, 9, 157, 84, 7, 99, 0, 8, 126, 0, 8, 62, 0, 9, 221, 82, 7, 27, 0, 8, 110, 0, 8, 46, 0, 9, 189, 0, 8, 14, 0, 8, 142, 0, 8, 78, 0, 9, 253, 96, 7, 256, 0, 8, 81, 0, 8, 17, 85, 8, 131, 82, 7, 31, 0, 8, 113, 0, 8, 49, 0, 9, 195, 80, 7, 10, 0, 8, 97, 0, 8, 33, 0, 9, 163, 0, 8, 1, 0, 8, 129, 0, 8, 65, 0, 9, 227, 80, 7, 6, 0, 8, 89, 0, 8, 25, 0, 9, 147, 83, 7, 59, 0, 8, 121, 0, 8, 57, 0, 9, 211, 81, 7, 17, 0, 8, 105, 0, 8, 41, 0, 9, 179, 0, 8, 9, 0, 8, 137, 0, 8, 73, 0, 9, 243, 80, 7, 4, 0, 8, 85, 0, 8, 21, 80, 8, 258, 83, 7, 43, 0, 8, 117, 0, 8, 53, 0, 9, 203, 81, 7, 13, 0, 8, 101, 0, 8, 37, 0, 9, 171, 0, 8, 5, 0, 8, 133, 0, 8, 69, 0, 9, 235, 80, 7, 8, 0, 8, 93, 0, 8, 29, 0, 9, 155, 84, 7, 83, 0, 8, 125, 0, 8, 61, 0, 9, 219, 82, 7, 23, 0, 8, 109, 0, 8, 45, 0, 9, 187, 0, 8, 13, 0, 8, 141, 0, 8, 77, 0, 9, 251, 80, 7, 3, 0, 8, 83, 0, 8, 19, 85, 8, 195, 83, 7, 35, 0, 8, 115, 0, 8, 51, 0, 9, 199, 81, 7, 11, 0, 8, 99, 0, 8, 35, 0, 9, 167, 0, 8, 3, 0, 8, 131, 0, 8, 67, 0, 9, 231, 80, 7, 7, 0, 8, 91, 0, 8, 27, 0, 9, 151, 84, 7, 67, 0, 8, 123, 0, 8, 59, 0, 9, 215, 82, 7, 19, 0, 8, 107, 0, 8, 43, 0, 9, 183, 0, 8, 11, 0, 8, 139, 0, 8, 75, 0, 9, 247, 80, 7, 5, 0, 8, 87, 0, 8, 23, 192, 8, 0, 83, 7, 51, 0, 8, 119, 0, 8, 55, 0, 9, 207, 81, 7, 15, 0, 8, 103, 0, 8, 39, 0, 9, 175, 0, 8, 7, 0, 8, 135, 0, 8, 71, 0, 9, 239, 80, 7, 9, 0, 8, 95, 0, 8, 31, 0, 9, 159, 84, 7, 99, 0, 8, 127, 0, 8, 63, 0, 9, 223, 82, 7, 27, 0, 8, 111, 0, 8, 47, 0, 9, 191, 0, 8, 15, 0, 8, 143, 0, 8, 79, 0, 9, 255]),
+"fixed_td",  Clazz_newIntArray (-1, [80, 5, 1, 87, 5, 257, 83, 5, 17, 91, 5, 4097, 81, 5, 5, 89, 5, 1025, 85, 5, 65, 93, 5, 16385, 80, 5, 3, 88, 5, 513, 84, 5, 33, 92, 5, 8193, 82, 5, 9, 90, 5, 2049, 86, 5, 129, 192, 5, 24577, 80, 5, 2, 87, 5, 385, 83, 5, 25, 91, 5, 6145, 81, 5, 7, 89, 5, 1537, 85, 5, 97, 93, 5, 24577, 80, 5, 4, 88, 5, 769, 84, 5, 49, 92, 5, 12289, 82, 5, 13, 90, 5, 3073, 86, 5, 193, 192, 5, 24577]),
+"cplens",  Clazz_newIntArray (-1, [3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0]),
+"cplext",  Clazz_newIntArray (-1, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 112, 112]),
+"cpdist",  Clazz_newIntArray (-1, [1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577]),
+"cpdext",  Clazz_newIntArray (-1, [0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13]),
+"BMAX", 15);
+Clazz_declarePackage ("JU");
+c$ = Clazz_decorateAsClass (function () {
+this.mode = 0;
+this.len = 0;
+this.tree = null;
+this.tree_index = 0;
+this.need = 0;
+this.lit = 0;
+this.get = 0;
+this.dist = 0;
+this.lbits = 0;
+this.dbits = 0;
+this.ltree = null;
+this.ltree_index = 0;
+this.dtree = null;
+this.dtree_index = 0;
+this.z = null;
+this.s = null;
+Clazz_instantialize (this, arguments);
+}, JU, "InfCodes");
+Clazz_makeConstructor (c$, 
+function (z, s) {
+this.z = z;
+this.s = s;
+}, "JU.ZStream,JU.InfBlocks");
+Clazz_defineMethod (c$, "init", 
+function (bl, bd, tl, tl_index, td, td_index) {
+this.mode = 0;
+this.lbits = bl;
+this.dbits = bd;
+this.ltree = tl;
+this.ltree_index = tl_index;
+this.dtree = td;
+this.dtree_index = td_index;
+this.tree = null;
+}, "~N,~N,~A,~N,~A,~N");
+Clazz_defineMethod (c$, "proc", 
+function (r) {
+var j;
+var tindex;
+var e;
+var b = 0;
+var k = 0;
+var p = 0;
+var n;
+var q;
+var m;
+var f;
+p = this.z.next_in_index;
+n = this.z.avail_in;
+b = this.s.bitb;
+k = this.s.bitk;
+q = this.s.write;
+m = q < this.s.read ? this.s.read - q - 1 : this.s.end - q;
+while (true) {
+switch (this.mode) {
+case 0:
+if (m >= 258 && n >= 10) {
+this.s.bitb = b;
+this.s.bitk = k;
+this.z.avail_in = n;
+this.z.total_in += p - this.z.next_in_index;
+this.z.next_in_index = p;
+this.s.write = q;
+r = this.inflate_fast (this.lbits, this.dbits, this.ltree, this.ltree_index, this.dtree, this.dtree_index, this.s, this.z);
+p = this.z.next_in_index;
+n = this.z.avail_in;
+b = this.s.bitb;
+k = this.s.bitk;
+q = this.s.write;
+m = q < this.s.read ? this.s.read - q - 1 : this.s.end - q;
+if (r != 0) {
+this.mode = r == 1 ? 7 : 9;
+break;
+}}this.need = this.lbits;
+this.tree = this.ltree;
+this.tree_index = this.ltree_index;
+this.mode = 1;
+case 1:
+j = this.need;
+while (k < (j)) {
+if (n != 0) r = 0;
+ else {
+this.s.bitb = b;
+this.s.bitk = k;
+this.z.avail_in = n;
+this.z.total_in += p - this.z.next_in_index;
+this.z.next_in_index = p;
+this.s.write = q;
+return this.s.inflate_flush (r);
+}n--;
+b |= (this.z.next_in[p++] & 0xff) << k;
+k += 8;
+}
+tindex = (this.tree_index + (b & JU.InfCodes.inflate_mask[j])) * 3;
+b >>>= (this.tree[tindex + 1]);
+k -= (this.tree[tindex + 1]);
+e = this.tree[tindex];
+if (e == 0) {
+this.lit = this.tree[tindex + 2];
+this.mode = 6;
+break;
+}if ((e & 16) != 0) {
+this.get = e & 15;
+this.len = this.tree[tindex + 2];
+this.mode = 2;
+break;
+}if ((e & 64) == 0) {
+this.need = e;
+this.tree_index = Clazz_doubleToInt (tindex / 3) + this.tree[tindex + 2];
+break;
+}if ((e & 32) != 0) {
+this.mode = 7;
+break;
+}this.mode = 9;
+this.z.msg = "invalid literal/length code";
+r = -3;
+this.s.bitb = b;
+this.s.bitk = k;
+this.z.avail_in = n;
+this.z.total_in += p - this.z.next_in_index;
+this.z.next_in_index = p;
+this.s.write = q;
+return this.s.inflate_flush (r);
+case 2:
+j = this.get;
+while (k < (j)) {
+if (n != 0) r = 0;
+ else {
+this.s.bitb = b;
+this.s.bitk = k;
+this.z.avail_in = n;
+this.z.total_in += p - this.z.next_in_index;
+this.z.next_in_index = p;
+this.s.write = q;
+return this.s.inflate_flush (r);
+}n--;
+b |= (this.z.next_in[p++] & 0xff) << k;
+k += 8;
+}
+this.len += (b & JU.InfCodes.inflate_mask[j]);
+b >>= j;
+k -= j;
+this.need = this.dbits;
+this.tree = this.dtree;
+this.tree_index = this.dtree_index;
+this.mode = 3;
+case 3:
+j = this.need;
+while (k < (j)) {
+if (n != 0) r = 0;
+ else {
+this.s.bitb = b;
+this.s.bitk = k;
+this.z.avail_in = n;
+this.z.total_in += p - this.z.next_in_index;
+this.z.next_in_index = p;
+this.s.write = q;
+return this.s.inflate_flush (r);
+}n--;
+b |= (this.z.next_in[p++] & 0xff) << k;
+k += 8;
+}
+tindex = (this.tree_index + (b & JU.InfCodes.inflate_mask[j])) * 3;
+b >>= this.tree[tindex + 1];
+k -= this.tree[tindex + 1];
+e = (this.tree[tindex]);
+if ((e & 16) != 0) {
+this.get = e & 15;
+this.dist = this.tree[tindex + 2];
+this.mode = 4;
+break;
+}if ((e & 64) == 0) {
+this.need = e;
+this.tree_index = Clazz_doubleToInt (tindex / 3) + this.tree[tindex + 2];
+break;
+}this.mode = 9;
+this.z.msg = "invalid distance code";
+r = -3;
+this.s.bitb = b;
+this.s.bitk = k;
+this.z.avail_in = n;
+this.z.total_in += p - this.z.next_in_index;
+this.z.next_in_index = p;
+this.s.write = q;
+return this.s.inflate_flush (r);
+case 4:
+j = this.get;
+while (k < (j)) {
+if (n != 0) r = 0;
+ else {
+this.s.bitb = b;
+this.s.bitk = k;
+this.z.avail_in = n;
+this.z.total_in += p - this.z.next_in_index;
+this.z.next_in_index = p;
+this.s.write = q;
+return this.s.inflate_flush (r);
+}n--;
+b |= (this.z.next_in[p++] & 0xff) << k;
+k += 8;
+}
+this.dist += (b & JU.InfCodes.inflate_mask[j]);
+b >>= j;
+k -= j;
+this.mode = 5;
+case 5:
+f = q - this.dist;
+while (f < 0) {
+f += this.s.end;
+}
+while (this.len != 0) {
+if (m == 0) {
+if (q == this.s.end && this.s.read != 0) {
+q = 0;
+m = q < this.s.read ? this.s.read - q - 1 : this.s.end - q;
+}if (m == 0) {
+this.s.write = q;
+r = this.s.inflate_flush (r);
+q = this.s.write;
+m = q < this.s.read ? this.s.read - q - 1 : this.s.end - q;
+if (q == this.s.end && this.s.read != 0) {
+q = 0;
+m = q < this.s.read ? this.s.read - q - 1 : this.s.end - q;
+}if (m == 0) {
+this.s.bitb = b;
+this.s.bitk = k;
+this.z.avail_in = n;
+this.z.total_in += p - this.z.next_in_index;
+this.z.next_in_index = p;
+this.s.write = q;
+return this.s.inflate_flush (r);
+}}}this.s.window[q++] = this.s.window[f++];
+m--;
+if (f == this.s.end) f = 0;
+this.len--;
+}
+this.mode = 0;
+break;
+case 6:
+if (m == 0) {
+if (q == this.s.end && this.s.read != 0) {
+q = 0;
+m = q < this.s.read ? this.s.read - q - 1 : this.s.end - q;
+}if (m == 0) {
+this.s.write = q;
+r = this.s.inflate_flush (r);
+q = this.s.write;
+m = q < this.s.read ? this.s.read - q - 1 : this.s.end - q;
+if (q == this.s.end && this.s.read != 0) {
+q = 0;
+m = q < this.s.read ? this.s.read - q - 1 : this.s.end - q;
+}if (m == 0) {
+this.s.bitb = b;
+this.s.bitk = k;
+this.z.avail_in = n;
+this.z.total_in += p - this.z.next_in_index;
+this.z.next_in_index = p;
+this.s.write = q;
+return this.s.inflate_flush (r);
+}}}r = 0;
+this.s.window[q++] = this.lit;
+m--;
+this.mode = 0;
+break;
+case 7:
+if (k > 7) {
+k -= 8;
+n++;
+p--;
+}this.s.write = q;
+r = this.s.inflate_flush (r);
+q = this.s.write;
+m = q < this.s.read ? this.s.read - q - 1 : this.s.end - q;
+if (this.s.read != this.s.write) {
+this.s.bitb = b;
+this.s.bitk = k;
+this.z.avail_in = n;
+this.z.total_in += p - this.z.next_in_index;
+this.z.next_in_index = p;
+this.s.write = q;
+return this.s.inflate_flush (r);
+}this.mode = 8;
+case 8:
+r = 1;
+this.s.bitb = b;
+this.s.bitk = k;
+this.z.avail_in = n;
+this.z.total_in += p - this.z.next_in_index;
+this.z.next_in_index = p;
+this.s.write = q;
+return this.s.inflate_flush (r);
+case 9:
+r = -3;
+this.s.bitb = b;
+this.s.bitk = k;
+this.z.avail_in = n;
+this.z.total_in += p - this.z.next_in_index;
+this.z.next_in_index = p;
+this.s.write = q;
+return this.s.inflate_flush (r);
+default:
+r = -2;
+this.s.bitb = b;
+this.s.bitk = k;
+this.z.avail_in = n;
+this.z.total_in += p - this.z.next_in_index;
+this.z.next_in_index = p;
+this.s.write = q;
+return this.s.inflate_flush (r);
+}
+}
+}, "~N");
+Clazz_defineMethod (c$, "free", 
+function (z) {
+}, "JU.ZStream");
+Clazz_defineMethod (c$, "inflate_fast", 
+function (bl, bd, tl, tl_index, td, td_index, s, z) {
+var t;
+var tp;
+var tp_index;
+var e;
+var b;
+var k;
+var p;
+var n;
+var q;
+var m;
+var ml;
+var md;
+var c;
+var d;
+var r;
+var tp_index_t_3;
+p = z.next_in_index;
+n = z.avail_in;
+b = s.bitb;
+k = s.bitk;
+q = s.write;
+m = q < s.read ? s.read - q - 1 : s.end - q;
+ml = JU.InfCodes.inflate_mask[bl];
+md = JU.InfCodes.inflate_mask[bd];
+do {
+while (k < (20)) {
+n--;
+b |= (z.next_in[p++] & 0xff) << k;
+k += 8;
+}
+t = b & ml;
+tp = tl;
+tp_index = tl_index;
+tp_index_t_3 = (tp_index + t) * 3;
+if ((e = tp[tp_index_t_3]) == 0) {
+b >>= (tp[tp_index_t_3 + 1]);
+k -= (tp[tp_index_t_3 + 1]);
+s.window[q++] = tp[tp_index_t_3 + 2];
+m--;
+continue;
+}do {
+b >>= (tp[tp_index_t_3 + 1]);
+k -= (tp[tp_index_t_3 + 1]);
+if ((e & 16) != 0) {
+e &= 15;
+c = tp[tp_index_t_3 + 2] + (b & JU.InfCodes.inflate_mask[e]);
+b >>= e;
+k -= e;
+while (k < (15)) {
+n--;
+b |= (z.next_in[p++] & 0xff) << k;
+k += 8;
+}
+t = b & md;
+tp = td;
+tp_index = td_index;
+tp_index_t_3 = (tp_index + t) * 3;
+e = tp[tp_index_t_3];
+do {
+b >>= (tp[tp_index_t_3 + 1]);
+k -= (tp[tp_index_t_3 + 1]);
+if ((e & 16) != 0) {
+e &= 15;
+while (k < (e)) {
+n--;
+b |= (z.next_in[p++] & 0xff) << k;
+k += 8;
+}
+d = tp[tp_index_t_3 + 2] + (b & JU.InfCodes.inflate_mask[e]);
+b >>= (e);
+k -= (e);
+m -= c;
+if (q >= d) {
+r = q - d;
+if (q - r > 0 && 2 > (q - r)) {
+s.window[q++] = s.window[r++];
+s.window[q++] = s.window[r++];
+c -= 2;
+} else {
+System.arraycopy (s.window, r, s.window, q, 2);
+q += 2;
+r += 2;
+c -= 2;
+}} else {
+r = q - d;
+do {
+r += s.end;
+} while (r < 0);
+e = s.end - r;
+if (c > e) {
+c -= e;
+if (q - r > 0 && e > (q - r)) {
+do {
+s.window[q++] = s.window[r++];
+} while (--e != 0);
+} else {
+System.arraycopy (s.window, r, s.window, q, e);
+q += e;
+r += e;
+e = 0;
+}r = 0;
+}}if (q - r > 0 && c > (q - r)) {
+do {
+s.window[q++] = s.window[r++];
+} while (--c != 0);
+} else {
+System.arraycopy (s.window, r, s.window, q, c);
+q += c;
+r += c;
+c = 0;
+}break;
+} else if ((e & 64) == 0) {
+t += tp[tp_index_t_3 + 2];
+t += (b & JU.InfCodes.inflate_mask[e]);
+tp_index_t_3 = (tp_index + t) * 3;
+e = tp[tp_index_t_3];
+} else {
+z.msg = "invalid distance code";
+c = z.avail_in - n;
+c = (k >> 3) < c ? k >> 3 : c;
+n += c;
+p -= c;
+k -= c << 3;
+s.bitb = b;
+s.bitk = k;
+z.avail_in = n;
+z.total_in += p - z.next_in_index;
+z.next_in_index = p;
+s.write = q;
+return -3;
+}} while (true);
+break;
+}if ((e & 64) == 0) {
+t += tp[tp_index_t_3 + 2];
+t += (b & JU.InfCodes.inflate_mask[e]);
+tp_index_t_3 = (tp_index + t) * 3;
+if ((e = tp[tp_index_t_3]) == 0) {
+b >>= (tp[tp_index_t_3 + 1]);
+k -= (tp[tp_index_t_3 + 1]);
+s.window[q++] = tp[tp_index_t_3 + 2];
+m--;
+break;
+}} else if ((e & 32) != 0) {
+c = z.avail_in - n;
+c = (k >> 3) < c ? k >> 3 : c;
+n += c;
+p -= c;
+k -= c << 3;
+s.bitb = b;
+s.bitk = k;
+z.avail_in = n;
+z.total_in += p - z.next_in_index;
+z.next_in_index = p;
+s.write = q;
+return 1;
+} else {
+z.msg = "invalid literal/length code";
+c = z.avail_in - n;
+c = (k >> 3) < c ? k >> 3 : c;
+n += c;
+p -= c;
+k -= c << 3;
+s.bitb = b;
+s.bitk = k;
+z.avail_in = n;
+z.total_in += p - z.next_in_index;
+z.next_in_index = p;
+s.write = q;
+return -3;
+}} while (true);
+} while (m >= 258 && n >= 10);
+c = z.avail_in - n;
+c = (k >> 3) < c ? k >> 3 : c;
+n += c;
+p -= c;
+k -= c << 3;
+s.bitb = b;
+s.bitk = k;
+z.avail_in = n;
+z.total_in += p - z.next_in_index;
+z.next_in_index = p;
+s.write = q;
+return 0;
+}, "~N,~N,~A,~N,~A,~N,JU.InfBlocks,JU.ZStream");
+Clazz_defineStatics (c$,
+"inflate_mask",  Clazz_newIntArray (-1, [0x00000000, 0x00000001, 0x00000003, 0x00000007, 0x0000000f, 0x0000001f, 0x0000003f, 0x0000007f, 0x000000ff, 0x000001ff, 0x000003ff, 0x000007ff, 0x00000fff, 0x00001fff, 0x00003fff, 0x00007fff, 0x0000ffff]),
+"Z_OK", 0,
+"Z_STREAM_END", 1,
+"Z_STREAM_ERROR", -2,
+"Z_DATA_ERROR", -3,
+"START", 0,
+"LEN", 1,
+"LENEXT", 2,
+"DIST", 3,
+"DISTEXT", 4,
+"COPY", 5,
+"LIT", 6,
+"WASH", 7,
+"END", 8,
+"BADCODE", 9);
+Clazz_load (["java.io.OutputStream"], "java.io.ByteArrayOutputStream", ["java.lang.IllegalArgumentException", "$.IndexOutOfBoundsException", "$.OutOfMemoryError"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.buf = null;
+this.count = 0;
+Clazz_instantialize (this, arguments);
+}, java.io, "ByteArrayOutputStream", java.io.OutputStream);
+Clazz_makeConstructor (c$, 
+function () {
+this.construct (32);
+});
+Clazz_makeConstructor (c$, 
+function (size) {
+Clazz_superConstructor (this, java.io.ByteArrayOutputStream, []);
+if (size < 0) {
+throw  new IllegalArgumentException ("Negative initial size: " + size);
+}this.buf =  Clazz_newByteArray (size, 0);
+}, "~N");
+Clazz_defineMethod (c$, "ensureCapacity", 
+ function (minCapacity) {
+if (minCapacity - this.buf.length > 0) this.grow (minCapacity);
+}, "~N");
+Clazz_defineMethod (c$, "grow", 
+ function (minCapacity) {
+var oldCapacity = this.buf.length;
+var newCapacity = oldCapacity << 1;
+if (newCapacity - minCapacity < 0) newCapacity = minCapacity;
+if (newCapacity < 0) {
+if (minCapacity < 0) throw  new OutOfMemoryError ();
+newCapacity = minCapacity;
+}this.buf = java.io.ByteArrayOutputStream.arrayCopyByte (this.buf, newCapacity);
+}, "~N");
+c$.arrayCopyByte = Clazz_defineMethod (c$, "arrayCopyByte", 
+ function (array, newLength) {
+var t =  Clazz_newByteArray (newLength, 0);
+System.arraycopy (array, 0, t, 0, array.length < newLength ? array.length : newLength);
+return t;
+}, "~A,~N");
+Clazz_overrideMethod (c$, "writeByteAsInt", 
+function (b) {
+this.ensureCapacity (this.count + 1);
+this.buf[this.count] = b;
+this.count += 1;
+}, "~N");
+Clazz_defineMethod (c$, "write", 
+function (b, off, len) {
+if ((off < 0) || (off > b.length) || (len < 0) || ((off + len) - b.length > 0)) {
+throw  new IndexOutOfBoundsException ();
+}this.ensureCapacity (this.count + len);
+System.arraycopy (b, off, this.buf, this.count, len);
+this.count += len;
+}, "~A,~N,~N");
+Clazz_defineMethod (c$, "writeTo", 
+function (out) {
+out.write (this.buf, 0, this.count);
+}, "java.io.OutputStream");
+Clazz_defineMethod (c$, "reset", 
+function () {
+this.count = 0;
+});
+Clazz_defineMethod (c$, "toByteArray", 
+function () {
+return (this.count == this.buf.length ? this.buf : java.io.ByteArrayOutputStream.arrayCopyByte (this.buf, this.count));
+});
+Clazz_defineMethod (c$, "size", 
+function () {
+return this.count;
+});
+Clazz_overrideMethod (c$, "toString", 
+function () {
+return  String.instantialize (this.buf, 0, this.count);
+});
+Clazz_overrideMethod (c$, "close", 
+function () {
+});
+});
+Clazz_load (["java.io.Closeable", "$.Flushable"], "java.io.OutputStream", ["java.lang.IndexOutOfBoundsException", "$.NullPointerException"], function () {
+c$ = Clazz_declareType (java.io, "OutputStream", null, [java.io.Closeable, java.io.Flushable]);
+Clazz_defineMethod (c$, "write", 
+function (b, off, len) {
+if (b == null) {
+throw  new NullPointerException ();
+} else if ((off < 0) || (off > b.length) || (len < 0) || ((off + len) > b.length) || ((off + len) < 0)) {
+throw  new IndexOutOfBoundsException ();
+} else if (len == 0) {
+return;
+}for (var i = 0; i < len; i++) {
+this.writeByteAsInt (b[off + i]);
+}
+}, "~A,~N,~N");
+Clazz_overrideMethod (c$, "flush", 
+function () {
+});
+Clazz_overrideMethod (c$, "close", 
+function () {
+});
+});
+Clazz_declarePackage ("java.util.zip");
+Clazz_load (["java.io.IOException"], "java.util.zip.ZipException", null, function () {
+c$ = Clazz_declareType (java.util.zip, "ZipException", java.io.IOException);
+});
+Clazz_declarePackage ("MCview");
+Clazz_load (["java.awt.Color"], "MCview.Atom", ["java.lang.Float"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.x = 0;
+this.y = 0;
+this.z = 0;
+this.number = 0;
+this.name = null;
+this.resName = null;
+this.resNumber = 0;
+this.insCode = ' ';
+this.resNumIns = null;
+this.type = 0;
+this.color = null;
+this.chain = null;
+this.alignmentMapping = -1;
+this.atomIndex = 0;
+this.occupancy = 0;
+this.tfactor = 0;
+this.isSelected = false;
+Clazz_instantialize (this, arguments);
+}, MCview, "Atom");
+Clazz_prepareFields (c$, function () {
+this.color = java.awt.Color.lightGray;
+});
+Clazz_makeConstructor (c$, 
+function (str) {
+this.atomIndex = Integer.parseInt (str.substring (6, 11).trim ());
+this.name = str.substring (12, 15).trim ();
+this.resName = str.substring (17, 20);
+this.chain = str.substring (21, 22);
+this.resNumber = Integer.parseInt (str.substring (22, 26).trim ());
+this.resNumIns = str.substring (22, 27).trim ();
+this.insCode = str.substring (26, 27).charAt (0);
+this.x = ( new Float (str.substring (30, 38).trim ()).floatValue ());
+this.y = ( new Float (str.substring (38, 46).trim ()).floatValue ());
+this.z = ( new Float (str.substring (47, 55).trim ()).floatValue ());
+var tm = str.substring (54, 60).trim ();
+if (tm.length > 0) {
+this.occupancy = ( new Float (tm)).floatValue ();
+} else {
+this.occupancy = 1;
+}tm = str.substring (60, 66).trim ();
+if (tm.length > 0) {
+this.tfactor = ( new Float (tm).floatValue ());
+} else {
+this.tfactor = 1;
+}}, "~S");
+Clazz_makeConstructor (c$, 
+function (x, y, z) {
+this.x = x;
+this.y = y;
+this.z = z;
+}, "~N,~N,~N");
+});
+Clazz_declarePackage ("MCview");
+Clazz_load (["java.util.Vector"], "MCview.PDBChain", ["MCview.Bond", "$.Residue", "jalview.datamodel.AlignmentAnnotation", "$.Annotation", "$.Sequence", "$.SequenceFeature", "jalview.schemes.ResidueProperties", "java.awt.Color", "java.lang.StringBuilder"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.id = null;
+this.bonds = null;
+this.atoms = null;
+this.residues = null;
+this.offset = 0;
+this.sequence = null;
+this.shadow = null;
+this.isNa = false;
+this.isVisible = true;
+this.pdbstart = 0;
+this.pdbend = 0;
+this.seqstart = 0;
+this.seqend = 0;
+this.pdbid = "";
+this.newline = null;
+this.shadowMap = null;
+Clazz_instantialize (this, arguments);
+}, MCview, "PDBChain");
+Clazz_prepareFields (c$, function () {
+this.bonds =  new java.util.Vector ();
+this.atoms =  new java.util.Vector ();
+this.residues =  new java.util.Vector ();
+this.newline = System.getProperty ("line.separator");
+});
+Clazz_makeConstructor (c$, 
+function (pdbid, id) {
+this.pdbid = pdbid.toLowerCase ();
+this.id = id;
+}, "~S,~S");
+Clazz_defineMethod (c$, "setNewlineString", 
+function (nl) {
+this.newline = nl;
+}, "~S");
+Clazz_defineMethod (c$, "getNewlineString", 
+function () {
+return this.newline;
+});
+Clazz_defineMethod (c$, "print", 
+function () {
+var tmp =  new StringBuilder (256);
+for (var b, $b = this.bonds.iterator (); $b.hasNext () && ((b = $b.next ()) || true);) {
+tmp.append (b.at1.resName).append (" ").append (b.at1.resNumber).append (" ").append (this.offset).append (this.newline);
+}
+return tmp.toString ();
+});
+Clazz_defineMethod (c$, "makeExactMapping", 
+function (as, s1) {
+var pdbpos = as.getSeq2Start () - 2;
+var alignpos = s1.getStart () + as.getSeq1Start () - 3;
+for (var atom, $atom = this.atoms.iterator (); $atom.hasNext () && ((atom = $atom.next ()) || true);) {
+atom.alignmentMapping = -1;
+}
+for (var i = 0; i < as.astr1.length; i++) {
+if (as.astr1.charAt (i) != '-') {
+alignpos++;
+}if (as.astr2.charAt (i) != '-') {
+pdbpos++;
+}if (as.astr1.charAt (i) == as.astr2.charAt (i)) {
+var res = this.residues.elementAt (pdbpos);
+for (var atom, $atom = res.atoms.iterator (); $atom.hasNext () && ((atom = $atom.next ()) || true);) {
+atom.alignmentMapping = alignpos;
+}
+}}
+}, "jalview.analysis.AlignSeq,jalview.datamodel.SequenceI");
+Clazz_defineMethod (c$, "transferRESNUMFeatures", 
+function (seq, status) {
+var sq = seq;
+while (sq != null && sq.getDatasetSequence () != null) {
+sq = sq.getDatasetSequence ();
+if (sq === this.sequence) {
+return null;
+}}
+if (status == null) {
+status = "IEA:jalview";
+}var features = this.sequence.getSequenceFeatures ();
+for (var i = 0; i < features.length; i++) {
+if (features[i].getFeatureGroup ().equals (this.pdbid)) {
+var tx =  new jalview.datamodel.SequenceFeature (features[i]);
+tx.setBegin (1 + this.residues.elementAt (tx.getBegin () - this.offset).atoms.elementAt (0).alignmentMapping);
+tx.setEnd (1 + this.residues.elementAt (tx.getEnd () - this.offset).atoms.elementAt (0).alignmentMapping);
+tx.setStatus (status + ((tx.getStatus () == null || tx.getStatus ().length == 0) ? "" : ":" + tx.getStatus ()));
+if (tx.begin != 0 && tx.end != 0) {
+sq.addSequenceFeature (tx);
+}}}
+return features;
+}, "jalview.datamodel.SequenceI,~S");
+Clazz_defineMethod (c$, "makeCaBondList", 
+function () {
+var na = false;
+var numNa = 0;
+for (var i = 0; i < (this.residues.size () - 1); i++) {
+var tmpres = this.residues.elementAt (i);
+var tmpres2 = this.residues.elementAt (i + 1);
+var at1 = tmpres.findAtom ("CA");
+var at2 = tmpres2.findAtom ("CA");
+na = false;
+if ((at1 == null) && (at2 == null)) {
+na = true;
+at1 = tmpres.findAtom ("P");
+at2 = tmpres2.findAtom ("P");
+}if ((at1 != null) && (at2 != null)) {
+if (at1.chain.equals (at2.chain)) {
+if (na) {
+numNa++;
+}this.makeBond (at1, at2);
+}} else {
+System.out.println ("not found " + i);
+}}
+if (this.residues.size () > 0 && (Clazz_doubleToInt (numNa / (this.residues.size () - 1)) > 0.99)) {
+this.isNa = true;
+}});
+Clazz_defineMethod (c$, "makeBond", 
+function (at1, at2) {
+this.bonds.addElement ( new MCview.Bond (at1, at2));
+}, "MCview.Atom,MCview.Atom");
+Clazz_defineMethod (c$, "makeResidueList", 
+function (visibleChainAnnotation) {
+var count = 0;
+var symbol;
+var deoxyn = false;
+var nucleotide = false;
+var seq =  new StringBuilder (256);
+var resFeatures =  new java.util.Vector ();
+var resAnnotation =  new java.util.Vector ();
+var i;
+var iSize = this.atoms.size () - 1;
+var resNumber = -1;
+for (i = 0; i <= iSize; i++) {
+var tmp = this.atoms.elementAt (i);
+resNumber = tmp.resNumber;
+var res = resNumber;
+if (i == 0) {
+this.offset = resNumber;
+}var resAtoms =  new java.util.Vector ();
+while ((resNumber == res) && (i < this.atoms.size ())) {
+resAtoms.add (this.atoms.elementAt (i));
+i++;
+if (i < this.atoms.size ()) {
+resNumber = this.atoms.elementAt (i).resNumber;
+} else {
+resNumber++;
+}}
+i--;
+this.residues.addElement ( new MCview.Residue (resAtoms, resNumber - 1, count));
+var tmpres = this.residues.lastElement ();
+var tmpat = tmpres.atoms.get (0);
+var sf =  new jalview.datamodel.SequenceFeature ("RESNUM", tmpat.resName + ":" + tmpat.resNumIns + " " + this.pdbid + this.id, "", this.offset + count, this.offset + count, this.pdbid);
+resFeatures.addElement (sf);
+resAnnotation.addElement ( new jalview.datamodel.Annotation (tmpat.tfactor));
+if ((symbol = jalview.schemes.ResidueProperties.getAA3Hash ().get (tmpat.resName)) == null) {
+var nucname = tmpat.resName.trim ();
+deoxyn = nucname.length == 2 && jalview.schemes.ResidueProperties.aaIndex[nucname.charCodeAt (0)] == jalview.schemes.ResidueProperties.aaIndex['D'.charCodeAt (0)];
+if (tmpat.name.equalsIgnoreCase ("CA") || jalview.schemes.ResidueProperties.nucleotideIndex[nucname.charCodeAt ((deoxyn ? 1 : 0))] == -1) {
+seq.append ("X");
+} else {
+nucleotide = true;
+seq.append (nucname.charAt ((deoxyn ? 1 : 0)));
+}} else {
+if (nucleotide) {
+System.err.println ("Warning: mixed nucleotide and amino acid chain.. its gonna do bad things to you!");
+}seq.append (jalview.schemes.ResidueProperties.aa[(symbol).intValue ()]);
+}count++;
+}
+if (this.id.length < 1) {
+this.id = " ";
+}this.isNa = nucleotide;
+this.sequence =  new jalview.datamodel.Sequence (this.id, seq.toString (), this.offset, resNumber - 1);
+for (i = 0, iSize = resFeatures.size (); i < iSize; i++) {
+this.sequence.addSequenceFeature (resFeatures.elementAt (i));
+resFeatures.setElementAt (null, i);
+}
+if (visibleChainAnnotation) {
+var annots =  new Array (resAnnotation.size ());
+var max = 0;
+for (i = 0, iSize = annots.length; i < iSize; i++) {
+annots[i] = resAnnotation.elementAt (i);
+if (annots[i].value > max) {
+max = annots[i].value;
+}resAnnotation.setElementAt (null, i);
+}
+var tfactorann =  new jalview.datamodel.AlignmentAnnotation ("Temperature Factor", "Temperature Factor for " + this.pdbid + this.id, annots, 0, max, 2);
+tfactorann.setSequenceRef (this.sequence);
+this.sequence.addAlignmentAnnotation (tfactorann);
+}}, "~B");
+Clazz_defineMethod (c$, "setChargeColours", 
+function () {
+for (var b, $b = this.bonds.iterator (); $b.hasNext () && ((b = $b.next ()) || true);) {
+if (b.at1 != null && b.at2 != null) {
+b.startCol = MCview.PDBChain.getChargeColour (b.at1.resName);
+b.endCol = MCview.PDBChain.getChargeColour (b.at2.resName);
+} else {
+b.startCol = java.awt.Color.gray;
+b.endCol = java.awt.Color.gray;
+}}
+});
+c$.getChargeColour = Clazz_defineMethod (c$, "getChargeColour", 
+function (resName) {
+var result = java.awt.Color.lightGray;
+if ("ASP".equals (resName) || "GLU".equals (resName)) {
+result = java.awt.Color.red;
+} else if ("LYS".equals (resName) || "ARG".equals (resName)) {
+result = java.awt.Color.blue;
+} else if ("CYS".equals (resName)) {
+result = java.awt.Color.yellow;
+}return result;
+}, "~S");
+Clazz_defineMethod (c$, "setChainColours", 
+function (cs) {
+var index;
+for (var b, $b = this.bonds.iterator (); $b.hasNext () && ((b = $b.next ()) || true);) {
+try {
+index = jalview.schemes.ResidueProperties.aa3Hash.get (b.at1.resName).intValue ();
+b.startCol = cs.findColour (jalview.schemes.ResidueProperties.aa[index].charAt (0));
+index = jalview.schemes.ResidueProperties.aa3Hash.get (b.at2.resName).intValue ();
+b.endCol = cs.findColour (jalview.schemes.ResidueProperties.aa[index].charAt (0));
+} catch (e) {
+if (Clazz_exceptionOf (e, Exception)) {
+b.startCol = java.awt.Color.gray;
+b.endCol = java.awt.Color.gray;
+} else {
+throw e;
+}
+}
+}
+}, "jalview.schemes.ColourSchemeI");
+Clazz_defineMethod (c$, "setChainColours", 
+function (col) {
+for (var b, $b = this.bonds.iterator (); $b.hasNext () && ((b = $b.next ()) || true);) {
+b.startCol = col;
+b.endCol = col;
+}
+}, "java.awt.Color");
+Clazz_defineMethod (c$, "transferResidueAnnotation", 
+function (mapping, sqmpping) {
+var sq = mapping.getSequence ();
+var dsq = sq;
+if (sq != null) {
+while (dsq.getDatasetSequence () != null) {
+dsq = dsq.getDatasetSequence ();
+}
+if (this.shadow != null && this.shadow.getAnnotation () != null) {
+for (var ana, $ana = 0, $$ana = this.shadow.getAnnotation (); $ana < $$ana.length && ((ana = $$ana[$ana]) || true); $ana++) {
+var transfer = sq.getAlignmentAnnotations (ana.getCalcId (), ana.label);
+if (transfer == null || transfer.size () == 0) {
+ana =  new jalview.datamodel.AlignmentAnnotation (ana);
+ana.liftOver (this.sequence, this.shadowMap);
+ana.liftOver (dsq, sqmpping);
+dsq.addAlignmentAnnotation (ana);
+} else {
+continue;
+}}
+} else {
+if (this.sequence != null && this.sequence.getAnnotation () != null) {
+for (var ana, $ana = 0, $$ana = this.sequence.getAnnotation (); $ana < $$ana.length && ((ana = $$ana[$ana]) || true); $ana++) {
+var transfer = sq.getAlignmentAnnotations (ana.getCalcId (), ana.label);
+if (transfer == null || transfer.size () == 0) {
+ana =  new jalview.datamodel.AlignmentAnnotation (ana);
+ana.liftOver (dsq, sqmpping);
+} else {
+continue;
+}}
+}}if (false) {
+var min = -1;
+var max = 0;
+var an =  new Array (sq.getEnd () - sq.getStart () + 1);
+for (var i = sq.getStart (), j = sq.getEnd (), k = 0; i <= j; i++, k++) {
+var prn = mapping.getPDBResNum (k + 1);
+an[k] =  new jalview.datamodel.Annotation (prn);
+if (min == -1) {
+min = k;
+max = k;
+} else {
+if (min > k) {
+min = k;
+} else if (max < k) {
+max = k;
+}}}
+sq.addAlignmentAnnotation ( new jalview.datamodel.AlignmentAnnotation ("PDB.RESNUM", "PDB Residue Numbering for " + this.pdbid + ":" + this.id, an, min, max, 2));
+}}}, "jalview.structure.StructureMapping,jalview.datamodel.Mapping");
+Clazz_defineStatics (c$,
+"PDBFILEFEATURE", "PDBFile",
+"IEASTATUS", "IEA:jalview");
+});
+Clazz_declarePackage ("MCview");
+Clazz_load (["java.awt.Color"], "MCview.Bond", null, function () {
+c$ = Clazz_decorateAsClass (function () {
+this.start = null;
+this.end = null;
+this.startCol = null;
+this.endCol = null;
+this.at1 = null;
+this.at2 = null;
+Clazz_instantialize (this, arguments);
+}, MCview, "Bond");
+Clazz_prepareFields (c$, function () {
+this.startCol = java.awt.Color.lightGray;
+this.endCol = java.awt.Color.lightGray;
+});
+Clazz_makeConstructor (c$, 
+function (at1, at2) {
+this.start =  Clazz_newFloatArray (-1, [at1.x, at1.y, at1.z]);
+this.end =  Clazz_newFloatArray (-1, [at2.x, at2.y, at2.z]);
+this.startCol = at1.color;
+this.endCol = at2.color;
+this.at1 = at1;
+this.at2 = at2;
+}, "MCview.Atom,MCview.Atom");
+Clazz_defineMethod (c$, "translate", 
+function (x, y, z) {
+this.start[0] = this.start[0] + x;
+this.end[0] = this.end[0] + x;
+this.start[1] = this.start[1] + y;
+this.end[1] = this.end[1] + y;
+this.start[2] = this.start[2] + z;
+this.end[2] = this.end[2] + z;
+}, "~N,~N,~N");
+});
+Clazz_declarePackage ("MCview");
+c$ = Clazz_decorateAsClass (function () {
+this.atoms = null;
+this.number = 0;
+this.count = 0;
+Clazz_instantialize (this, arguments);
+}, MCview, "Residue");
+Clazz_makeConstructor (c$, 
+function (resAtoms, number, count) {
+this.atoms = resAtoms;
+this.number = number;
+this.count = count;
+}, "java.util.Vector,~N,~N");
+Clazz_defineMethod (c$, "findAtom", 
+function (name) {
+for (var atom, $atom = this.atoms.iterator (); $atom.hasNext () && ((atom = $atom.next ()) || true);) {
+if (atom.name.equals (name)) {
+return atom;
+}}
+return null;
+}, "~S");
+Clazz_declarePackage ("jalview.structure");
+c$ = Clazz_decorateAsClass (function () {
+this.pdbFile = null;
+this.chain = null;
+this.pdbResNum = 0;
+this.atomIndex = 0;
+Clazz_instantialize (this, arguments);
+}, jalview.structure, "AtomSpec");
+Clazz_makeConstructor (c$, 
+function (pdbFile, chain, resNo, atomNo) {
+this.pdbFile = pdbFile;
+this.chain = chain;
+this.pdbResNum = resNo;
+this.atomIndex = atomNo;
+}, "~S,~S,~N,~N");
+Clazz_defineMethod (c$, "getPdbFile", 
+function () {
+return this.pdbFile;
+});
+Clazz_defineMethod (c$, "getChain", 
+function () {
+return this.chain;
+});
+Clazz_defineMethod (c$, "getPdbResNum", 
+function () {
+return this.pdbResNum;
+});
+Clazz_defineMethod (c$, "getAtomIndex", 
+function () {
+return this.atomIndex;
+});
+Clazz_overrideMethod (c$, "toString", 
+function () {
+return "pdbFile: " + this.pdbFile + ", chain: " + this.chain + ", res: " + this.pdbResNum + ", atom: " + this.atomIndex;
+});
+Clazz_declarePackage ("jalview.structure");
+Clazz_declareInterface (jalview.structure, "SecondaryStructureListener");
+Clazz_declarePackage ("jalview.structure");
+Clazz_declareInterface (jalview.structure, "SequenceListener");
+Clazz_declarePackage ("jalview.structure");
+Clazz_declareInterface (jalview.structure, "StructureListener");
+Clazz_declarePackage ("jalview.structure");
+Clazz_load (null, "jalview.structure.StructureMapping", ["jalview.datamodel.AlignmentAnnotation"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.mappingDetails = null;
+this.sequence = null;
+this.pdbfile = null;
+this.pdbid = null;
+this.pdbchain = null;
+this.mapping = null;
+Clazz_instantialize (this, arguments);
+}, jalview.structure, "StructureMapping");
+Clazz_makeConstructor (c$, 
+function (seq, pdbfile, pdbid, chain, mapping, mappingDetails) {
+this.sequence = seq;
+this.pdbfile = pdbfile;
+this.pdbid = pdbid;
+this.pdbchain = chain;
+this.mapping = mapping;
+this.mappingDetails = mappingDetails;
+}, "jalview.datamodel.SequenceI,~S,~S,~S,~A,~S");
+Clazz_defineMethod (c$, "getSequence", 
+function () {
+return this.sequence;
+});
+Clazz_defineMethod (c$, "getChain", 
+function () {
+return this.pdbchain;
+});
+Clazz_defineMethod (c$, "getPdbId", 
+function () {
+return this.pdbid;
+});
+Clazz_defineMethod (c$, "getAtomNum", 
+function (seqpos) {
+if (this.mapping.length > seqpos) {
+return this.mapping[seqpos][1];
+} else {
+return 0;
+}}, "~N");
+Clazz_defineMethod (c$, "getPDBResNum", 
+function (seqpos) {
+if (this.mapping.length > seqpos) {
+return this.mapping[seqpos][0];
+} else {
+return 0;
+}}, "~N");
+Clazz_defineMethod (c$, "getSeqPos", 
+function (pdbResNum) {
+for (var i = 0; i < this.mapping.length; i++) {
+if (this.mapping[i][0] == pdbResNum) {
+return i;
+}}
+return -1;
+}, "~N");
+Clazz_defineMethod (c$, "transfer", 
+function (ana) {
+var ala_copy =  new jalview.datamodel.AlignmentAnnotation (ana);
+var ds = this.sequence;
+while (ds.getDatasetSequence () != null) {
+ds = ds.getDatasetSequence ();
+}
+ala_copy.remap (ds, this.mapping, -1, -1, 0);
+ds.addAlignmentAnnotation (ala_copy);
+if (ds !== this.sequence) {
+ala_copy =  new jalview.datamodel.AlignmentAnnotation (ala_copy);
+this.sequence.addAlignmentAnnotation (ala_copy);
+}return ala_copy;
+}, "jalview.datamodel.AlignmentAnnotation");
+});
+Clazz_declarePackage ("jalview.structure");
+Clazz_declareInterface (jalview.structure, "VamsasListener");
+Clazz_declarePackage ("jalview.appletgui");
+Clazz_load (["awt2swing.Panel", "jalview.api.AlignmentViewPanel", "java.awt.event.AdjustmentListener", "awt2swing.Scrollbar"], "jalview.appletgui.AlignmentPanel", ["awt2swing.Frame", "jalview.analysis.AnnotationSorter", "jalview.appletgui.AnnotationLabels", "$.AnnotationPanel", "$.FeatureRenderer", "$.IdPanel", "$.IdwidthAdjuster", "$.PaintRefresher", "$.ScalePanel", "$.SeqPanel", "jalview.bin.JalviewLite", "jalview.structure.StructureSelectionManager", "java.awt.BorderLayout", "$.Color", "$.Dimension", "java.awt.event.ComponentAdapter", "java.beans.PropertyChangeListener"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.av = null;
+this.overviewPanel = null;
+this.seqPanel = null;
+this.idPanel = null;
+this.idwidthAdjuster = null;
+this.alignFrame = null;
+this.scalePanel = null;
+this.annotationPanel = null;
+this.alabels = null;
+this.fastPaint = true;
+this.hextent = 0;
+this.vextent = 0;
+this.sequenceHolderPanel = null;
+this.vscroll = null;
+this.hscroll = null;
+this.seqPanelHolder = null;
+this.scalePanelHolder = null;
+this.idPanelHolder = null;
+this.idSpaceFillerPanel1 = null;
+this.annotationSpaceFillerHolder = null;
+this.hscrollFillerPanel = null;
+this.annotationPanelHolder = null;
+this.apvscroll = null;
+this.followingComplementScroll = false;
+Clazz_instantialize (this, arguments);
+}, jalview.appletgui, "AlignmentPanel", awt2swing.Panel, [java.awt.event.AdjustmentListener, jalview.api.AlignmentViewPanel]);
+Clazz_prepareFields (c$, function () {
+this.sequenceHolderPanel =  new awt2swing.Panel ();
+this.vscroll =  new awt2swing.Scrollbar ();
+this.hscroll =  new awt2swing.Scrollbar ();
+this.seqPanelHolder =  new awt2swing.Panel ();
+this.scalePanelHolder =  new awt2swing.Panel ();
+this.idPanelHolder =  new awt2swing.Panel ();
+this.idSpaceFillerPanel1 =  new awt2swing.Panel ();
+this.annotationSpaceFillerHolder =  new awt2swing.Panel ();
+this.hscrollFillerPanel =  new awt2swing.Panel ();
+this.annotationPanelHolder =  new awt2swing.Panel ();
+this.apvscroll =  new awt2swing.Scrollbar ();
+});
+Clazz_overrideMethod (c$, "finalize", 
+function () {
+this.alignFrame = null;
+this.av = null;
+this.seqPanel = null;
+this.seqPanelHolder = null;
+this.sequenceHolderPanel = null;
+this.scalePanel = null;
+this.scalePanelHolder = null;
+this.annotationPanel = null;
+this.annotationPanelHolder = null;
+this.annotationSpaceFillerHolder = null;
+});
+Clazz_makeConstructor (c$, 
+function (af, av) {
+Clazz_superConstructor (this, jalview.appletgui.AlignmentPanel, []);
+this.setName ("alignmentPanel");
+try {
+this.jbInit ();
+} catch (e) {
+if (Clazz_exceptionOf (e, Exception)) {
+e.printStackTrace ();
+} else {
+throw e;
+}
+}
+this.alignFrame = af;
+this.av = av;
+this.seqPanel =  new jalview.appletgui.SeqPanel (av, this);
+this.idPanel =  new jalview.appletgui.IdPanel (av, this);
+this.scalePanel =  new jalview.appletgui.ScalePanel (av, this);
+this.idwidthAdjuster =  new jalview.appletgui.IdwidthAdjuster (this);
+this.annotationPanel =  new jalview.appletgui.AnnotationPanel (this);
+this.annotationPanelHolder.add (this.annotationPanel, "Center");
+this.sequenceHolderPanel.add (this.annotationPanelHolder, "South");
+this.alabels =  new jalview.appletgui.AnnotationLabels (this);
+this.setAnnotationVisible (av.isShowAnnotation ());
+this.idPanelHolder.add (this.idPanel, "Center");
+this.idSpaceFillerPanel1.add (this.idwidthAdjuster, "Center");
+this.annotationSpaceFillerHolder.add (this.alabels, "Center");
+this.scalePanelHolder.add (this.scalePanel, "Center");
+this.seqPanelHolder.add (this.seqPanel, "Center");
+this.fontChanged ();
+this.setScrollValues (0, 0);
+this.apvscroll.addAdjustmentListener (this);
+this.hscroll.addAdjustmentListener (this);
+this.vscroll.addAdjustmentListener (this);
+this.addComponentListener (((Clazz_isClassDefined ("jalview.appletgui.AlignmentPanel$1") ? 0 : jalview.appletgui.AlignmentPanel.$AlignmentPanel$1$ ()), Clazz_innerTypeInstance (jalview.appletgui.AlignmentPanel$1, this, Clazz_cloneFinals ("av", av))));
+var d = this.calculateIdWidth ();
+this.idPanel.idCanvas.setSize (d);
+this.hscrollFillerPanel.setSize (d.width, this.annotationPanel.getSize ().height);
+this.idPanel.idCanvas.setSize (d.width, this.seqPanel.seqCanvas.getSize ().height);
+this.annotationSpaceFillerHolder.setSize (d.width, this.annotationPanel.getSize ().height);
+this.alabels.setSize (d.width, this.annotationPanel.getSize ().height);
+var ap = this;
+av.addPropertyChangeListener (((Clazz_isClassDefined ("jalview.appletgui.AlignmentPanel$2") ? 0 : jalview.appletgui.AlignmentPanel.$AlignmentPanel$2$ ()), Clazz_innerTypeInstance (jalview.appletgui.AlignmentPanel$2, this, Clazz_cloneFinals ("ap", ap, "av", av))));
+}, "jalview.appletgui.AlignFrame,jalview.appletgui.AlignViewport");
+Clazz_overrideMethod (c$, "getAlignViewport", 
+function () {
+return this.av;
+});
+Clazz_defineMethod (c$, "getSequenceRenderer", 
+function () {
+return this.seqPanel.seqCanvas.sr;
+});
+Clazz_overrideMethod (c$, "getFeatureRenderer", 
+function () {
+return this.seqPanel.seqCanvas.fr;
+});
+Clazz_overrideMethod (c$, "cloneFeatureRenderer", 
+function () {
+var nfr =  new jalview.appletgui.FeatureRenderer (this.av);
+nfr.transferSettings (this.seqPanel.seqCanvas.fr);
+return nfr;
+});
+Clazz_defineMethod (c$, "alignmentChanged", 
+function () {
+this.av.alignmentChanged (this);
+if (this.overviewPanel != null) {
+this.overviewPanel.updateOverviewImage ();
+}this.alignFrame.updateEditMenuBar ();
+this.repaint ();
+});
+Clazz_defineMethod (c$, "fontChanged", 
+function () {
+this.idPanel.idCanvas.image = null;
+var fm = this.getFontMetrics (this.av.getFont ());
+this.scalePanel.setSize ( new java.awt.Dimension (10, this.av.getCharHeight () + fm.getDescent ()));
+this.idwidthAdjuster.setSize ( new java.awt.Dimension (10, this.av.getCharHeight () + fm.getDescent ()));
+this.av.updateSequenceIdColours ();
+this.annotationPanel.image = null;
+var ap = this.annotationPanel.adjustPanelHeight (false);
+var d = this.calculateIdWidth ();
+d.setSize (d.width + 4, this.seqPanel.seqCanvas.getSize ().height);
+this.alabels.setSize (d.width + 4, ap);
+this.idPanel.idCanvas.setSize (d);
+this.hscrollFillerPanel.setSize (d);
+this.validateAnnotationDimensions (false);
+this.annotationPanel.repaint ();
+this.validate ();
+this.repaint ();
+if (this.overviewPanel != null) {
+this.overviewPanel.updateOverviewImage ();
+}});
+Clazz_defineMethod (c$, "setIdWidth", 
+function (w, h) {
+this.idPanel.idCanvas.setSize (w, h);
+this.idPanelHolder.setSize (w, this.idPanelHolder.getSize ().height);
+this.annotationSpaceFillerHolder.setSize (w, this.annotationSpaceFillerHolder.getSize ().height);
+this.alabels.setSize (w, this.alabels.getSize ().height);
+this.validate ();
+}, "~N,~N");
+Clazz_defineMethod (c$, "calculateIdWidth", 
+function () {
+if (this.av.nullFrame == null) {
+this.av.nullFrame =  new awt2swing.Frame ();
+this.av.nullFrame.addNotify ();
+this.av.nullFrame.setFont (this.av.font);
+}var g = this.av.nullFrame.getGraphics ();
+var fm = g.getFontMetrics (this.av.font);
+var al = this.av.getAlignment ();
+var i = 0;
+var idWidth = 0;
+var id;
+while (i < al.getHeight () && al.getSequenceAt (i) != null) {
+var s = al.getSequenceAt (i);
+id = s.getDisplayId (this.av.getShowJVSuffix ());
+if (fm.stringWidth (id) > idWidth) {
+idWidth = fm.stringWidth (id);
+}i++;
+}
+i = 0;
+if (al.getAlignmentAnnotation () != null) {
+fm = g.getFontMetrics (this.av.nullFrame.getFont ());
+while (i < al.getAlignmentAnnotation ().length) {
+var label = al.getAlignmentAnnotation ()[i].label;
+if (fm.stringWidth (label) > idWidth) {
+idWidth = fm.stringWidth (label);
+}i++;
+}
+}return  new java.awt.Dimension (idWidth, this.idPanel.idCanvas.getSize ().height);
+});
+Clazz_defineMethod (c$, "highlightSearchResults", 
+function (results) {
+this.scrollToPosition (results);
+this.seqPanel.seqCanvas.highlightSearchResults (results);
+}, "jalview.datamodel.SearchResults");
+Clazz_defineMethod (c$, "scrollToPosition", 
+function (results) {
+return this.scrollToPosition (results, true);
+}, "jalview.datamodel.SearchResults");
+Clazz_defineMethod (c$, "scrollToPosition", 
+function (results, redrawOverview) {
+return this.scrollToPosition (results, redrawOverview, false);
+}, "jalview.datamodel.SearchResults,~B");
+Clazz_defineMethod (c$, "scrollToPosition", 
+function (results, redrawOverview, centre) {
+if (results != null && results.getSize () > 0) {
+var alignment = this.av.getAlignment ();
+var seqIndex = alignment.findIndex (results);
+if (seqIndex == -1) {
+return false;
+}var seq = alignment.getSequenceAt (seqIndex);
+var r = results.getResults (seq, 0, alignment.getWidth ());
+if (r == null) {
+if (jalview.bin.JalviewLite.debug) {
+System.out.println ("DEBUG: scroll didn't happen - results not within alignment : " + seq.getStart () + "," + seq.getEnd ());
+}return false;
+}if (jalview.bin.JalviewLite.debug) {
+}var start = r[0];
+var end = r[1];
+if (centre) {
+var offset = Clazz_doubleToInt ((this.av.getEndRes () - this.av.getStartRes () + 1) / 2) - 1;
+start = Math.max (start - offset, 0);
+end = Math.min (end + offset, seq.getEnd () - 1);
+}if (start < 0) {
+return false;
+}if (end == seq.getEnd ()) {
+return false;
+}return this.scrollTo (start, end, seqIndex, false, redrawOverview);
+}return true;
+}, "jalview.datamodel.SearchResults,~B,~B");
+Clazz_defineMethod (c$, "scrollTo", 
+function (ostart, end, seqIndex, scrollToNearest, redrawOverview) {
+var startv;
+var endv;
+var starts;
+var ends;
+var width;
+var start = -1;
+if (this.av.hasHiddenColumns ()) {
+start = this.av.getColumnSelection ().findColumnPosition (ostart);
+end = this.av.getColumnSelection ().findColumnPosition (end);
+if (start == end) {
+if (!scrollToNearest && !this.av.getColumnSelection ().isVisible (ostart)) {
+return false;
+}}} else {
+start = ostart;
+}if (!this.av.getWrapAlignment ()) {
+if ((startv = this.av.getStartRes ()) >= start) {
+this.setScrollValues (start - 1, seqIndex);
+} else if ((endv = this.av.getEndRes ()) <= end) {
+this.setScrollValues (startv + 1 + end - endv, seqIndex);
+} else if ((starts = this.av.getStartSeq ()) > seqIndex) {
+this.setScrollValues (this.av.getStartRes (), seqIndex);
+} else if ((ends = this.av.getEndSeq ()) <= seqIndex) {
+this.setScrollValues (this.av.getStartRes (), starts + seqIndex - ends + 1);
+}} else {
+this.scrollToWrappedVisible (start);
+}if (redrawOverview && this.overviewPanel != null) {
+this.overviewPanel.setBoxPosition ();
+}this.paintAlignment (redrawOverview);
+return true;
+}, "~N,~N,~N,~B,~B");
+Clazz_defineMethod (c$, "scrollToWrappedVisible", 
+function (res) {
+var cwidth = this.seqPanel.seqCanvas.getWrappedCanvasWidth (this.seqPanel.seqCanvas.getSize ().width);
+if (res <= this.av.getStartRes () || res >= (this.av.getStartRes () + cwidth)) {
+this.vscroll.setValue (Clazz_doubleToInt (res / cwidth));
+this.av.startRes = this.vscroll.getValue () * cwidth;
+}}, "~N");
+Clazz_defineMethod (c$, "getOverviewPanel", 
+function () {
+return this.overviewPanel;
+});
+Clazz_defineMethod (c$, "setOverviewPanel", 
+function (op) {
+this.overviewPanel = op;
+}, "jalview.appletgui.OverviewPanel");
+Clazz_defineMethod (c$, "setAnnotationVisible", 
+function (b) {
+if (!this.av.getWrapAlignment ()) {
+this.annotationSpaceFillerHolder.setVisible (b);
+this.annotationPanelHolder.setVisible (b);
+} else {
+this.annotationSpaceFillerHolder.setVisible (false);
+this.annotationPanelHolder.setVisible (false);
+}this.validate ();
+this.repaint ();
+}, "~B");
+Clazz_overrideMethod (c$, "adjustAnnotationHeight", 
+function () {
+if (this.alignFrame.getSize ().height == 0) {
+System.out.println ("adjustAnnotationHeight frame size zero NEEDS FIXING");
+}this.fontChanged ();
+this.validateAnnotationDimensions (true);
+this.apvscroll.addNotify ();
+this.hscroll.addNotify ();
+this.validate ();
+this.paintAlignment (true);
+});
+Clazz_defineMethod (c$, "validateAnnotationDimensions", 
+function (adjustPanelHeight) {
+var rowHeight = this.av.getCharHeight ();
+var alignmentHeight = rowHeight * this.av.getAlignment ().getHeight ();
+var annotationHeight = this.av.calcPanelHeight ();
+var mheight = annotationHeight;
+var d = this.sequenceHolderPanel.getSize ();
+var availableHeight = d.height - this.scalePanelHolder.getHeight ();
+if (adjustPanelHeight) {
+if (annotationHeight + alignmentHeight > availableHeight) {
+annotationHeight = Math.min (annotationHeight, availableHeight - 2 * rowHeight);
+}} else {
+annotationHeight = this.annotationPanelHolder.getSize ().height;
+}if (availableHeight - annotationHeight < 5) {
+annotationHeight = availableHeight;
+}this.annotationPanel.setSize ( new java.awt.Dimension (d.width, annotationHeight));
+this.annotationPanelHolder.setSize ( new java.awt.Dimension (d.width, annotationHeight));
+this.seqPanel.seqCanvas.setSize (d.width, this.seqPanel.seqCanvas.getSize ().height);
+var e = this.idPanel.getSize ();
+this.alabels.setSize ( new java.awt.Dimension (e.width, annotationHeight));
+this.annotationSpaceFillerHolder.setSize ( new java.awt.Dimension (e.width, annotationHeight));
+var s = this.apvscroll.getValue ();
+if (s > mheight - annotationHeight) {
+s = 0;
+}this.apvscroll.setValues (s, annotationHeight, 0, mheight);
+this.annotationPanel.setScrollOffset (this.apvscroll.getValue (), false);
+this.alabels.setScrollOffset (this.apvscroll.getValue (), false);
+}, "~B");
+Clazz_defineMethod (c$, "setWrapAlignment", 
+function (wrap) {
+this.av.startSeq = 0;
+this.av.startRes = 0;
+this.scalePanelHolder.setVisible (!wrap);
+this.hscroll.setVisible (!wrap);
+this.idwidthAdjuster.setVisible (!wrap);
+if (wrap) {
+this.annotationPanelHolder.setVisible (false);
+this.annotationSpaceFillerHolder.setVisible (false);
+} else if (this.av.isShowAnnotation ()) {
+this.annotationPanelHolder.setVisible (true);
+this.annotationSpaceFillerHolder.setVisible (true);
+}this.idSpaceFillerPanel1.setVisible (!wrap);
+this.fontChanged ();
+this.validate ();
+this.sequenceHolderPanel.validate ();
+this.repaint ();
+}, "~B");
+Clazz_defineMethod (c$, "scrollUp", 
+function (up) {
+if (up) {
+if (this.vscroll.getValue () < 1) {
+return false;
+}this.setScrollValues (this.hscroll.getValue (), this.vscroll.getValue () - 1);
+} else {
+if (this.vextent + this.vscroll.getValue () >= this.av.getAlignment ().getHeight ()) {
+return false;
+}this.setScrollValues (this.hscroll.getValue (), this.vscroll.getValue () + 1);
+}this.repaint ();
+return true;
+}, "~B");
+Clazz_defineMethod (c$, "scrollRight", 
+function (right) {
+if (!right) {
+if (this.hscroll.getValue () < 1) {
+return false;
+}this.setScrollValues (this.hscroll.getValue () - 1, this.vscroll.getValue ());
+} else {
+if (this.hextent + this.hscroll.getValue () >= this.av.getAlignment ().getWidth ()) {
+return false;
+}this.setScrollValues (this.hscroll.getValue () + 1, this.vscroll.getValue ());
+}this.repaint ();
+return true;
+}, "~B");
+Clazz_defineMethod (c$, "setScrollValues", 
+function (x, y) {
+var width = this.av.getAlignment ().getWidth ();
+var height = this.av.getAlignment ().getHeight ();
+if (this.av.hasHiddenColumns ()) {
+width = this.av.getColumnSelection ().findColumnPosition (width);
+}if (x < 0) {
+x = 0;
+};this.hextent = Clazz_doubleToInt (this.seqPanel.seqCanvas.getSize ().width / this.av.getCharWidth ());
+this.vextent = Clazz_doubleToInt (this.seqPanel.seqCanvas.getSize ().height / this.av.getCharHeight ());
+if (this.hextent > width) {
+this.hextent = width;
+}if (this.vextent > height) {
+this.vextent = height;
+}if ((this.hextent + x) > width) {
+System.err.println ("hextent was " + this.hextent + " and x was " + x);
+x = width - this.hextent;
+}if ((this.vextent + y) > height) {
+y = height - this.vextent;
+}if (y < 0) {
+y = 0;
+}if (x < 0) {
+System.err.println ("x was " + x);
+x = 0;
+}this.av.setStartSeq (y);
+var endSeq = y + this.vextent;
+if (endSeq > this.av.getAlignment ().getHeight ()) {
+endSeq = this.av.getAlignment ().getHeight ();
+}this.av.setEndSeq (endSeq);
+this.av.setStartRes (x);
+this.av.setEndRes ((x + (Clazz_doubleToInt (this.seqPanel.seqCanvas.getSize ().width / this.av.getCharWidth ()))) - 1);
+this.hscroll.setValues (x, this.hextent, 0, width);
+this.vscroll.setValues (y, this.vextent, 0, height);
+if (this.overviewPanel != null) {
+this.overviewPanel.setBoxPosition ();
+}this.sendViewPosition ();
+}, "~N,~N");
+Clazz_overrideMethod (c$, "adjustmentValueChanged", 
+function (evt) {
+if (this.annotationPanel == null) return;
+var oldX = this.av.getStartRes ();
+var oldY = this.av.getStartSeq ();
+if (evt == null || evt.getSource () === this.apvscroll) {
+this.annotationPanel.setScrollOffset (this.apvscroll.getValue (), false);
+this.alabels.setScrollOffset (this.apvscroll.getValue (), false);
+}if (evt == null || evt.getSource () === this.hscroll) {
+var x = this.hscroll.getValue ();
+this.av.setStartRes (x);
+this.av.setEndRes (x + Clazz_doubleToInt (this.seqPanel.seqCanvas.getSize ().width / this.av.getCharWidth ()) - 1);
+}if (evt == null || evt.getSource () === this.vscroll) {
+var offy = this.vscroll.getValue ();
+if (this.av.getWrapAlignment ()) {
+var rowSize = this.seqPanel.seqCanvas.getWrappedCanvasWidth (this.seqPanel.seqCanvas.getSize ().width);
+this.av.setStartRes (this.vscroll.getValue () * rowSize);
+this.av.setEndRes ((this.vscroll.getValue () + 1) * rowSize);
+} else {
+this.av.setStartSeq (offy);
+this.av.setEndSeq (offy + Clazz_doubleToInt (this.seqPanel.seqCanvas.getSize ().height / this.av.getCharHeight ()));
+}}if (this.overviewPanel != null) {
+this.overviewPanel.setBoxPosition ();
+}var scrollX = this.av.startRes - oldX;
+var scrollY = this.av.startSeq - oldY;
+if (this.av.getWrapAlignment () || !this.fastPaint || this.av.MAC) {
+this.repaint ();
+} else {
+if (scrollX > this.av.endRes - this.av.startRes) {
+scrollX = this.av.endRes - this.av.startRes;
+} else if (scrollX < this.av.startRes - this.av.endRes) {
+scrollX = this.av.startRes - this.av.endRes;
+}this.idPanel.idCanvas.fastPaint (scrollY);
+this.seqPanel.seqCanvas.fastPaint (scrollX, scrollY);
+this.scalePanel.repaint ();
+if (this.av.isShowAnnotation ()) {
+this.annotationPanel.fastPaint (this.av.getStartRes () - oldX);
+}}this.sendViewPosition ();
+if (this.isFollowingComplementScroll ()) {
+this.setFollowingComplementScroll (false);
+} else {
+var ap = this.getComplementPanel ();
+this.av.scrollComplementaryAlignment (ap);
+}}, "java.awt.event.AdjustmentEvent");
+Clazz_defineMethod (c$, "getComplementPanel", 
+ function () {
+var ap = null;
+if (this.alignFrame != null) {
+var sf = this.alignFrame.getSplitFrame ();
+if (sf != null) {
+var other = sf.getComplement (this.alignFrame);
+if (other != null) {
+ap = other.alignPanel;
+}}}return ap;
+});
+Clazz_defineMethod (c$, "scrollToCentre", 
+function (sr, seqOffset) {
+var mappedTo = sr.getResultSequence (0);
+var seqs = this.av.getAlignment ().getSequences ();
+var sequenceIndex = 0;
+var matched = false;
+for (var seq, $seq = seqs.iterator (); $seq.hasNext () && ((seq = $seq.next ()) || true);) {
+if (mappedTo === seq.getDatasetSequence ()) {
+matched = true;
+break;
+}sequenceIndex++;
+}
+if (!matched) {
+return;
+}sequenceIndex = Math.max (0, sequenceIndex - seqOffset);
+sr.getResults ().get (0).setSequence (this.av.getAlignment ().getSequenceAt (sequenceIndex));
+this.setFollowingComplementScroll (true);
+this.scrollToPosition (sr, true, true);
+}, "jalview.datamodel.SearchResults,~N");
+Clazz_defineMethod (c$, "sendViewPosition", 
+ function () {
+jalview.structure.StructureSelectionManager.getStructureSelectionManager (this.av.applet).sendViewPosition (this, this.av.startRes, this.av.endRes, this.av.startSeq, this.av.endSeq);
+});
+Clazz_overrideMethod (c$, "paintAlignment", 
+function (updateOverview) {
+var sorter =  new jalview.analysis.AnnotationSorter (this.getAlignment (), this.av.isShowAutocalculatedAbove ());
+sorter.sort (this.getAlignment ().getAlignmentAnnotation (), this.av.getSortAnnotationsBy ());
+this.repaint ();
+if (updateOverview) {
+jalview.structure.StructureSelectionManager.getStructureSelectionManager (this.av.applet).sequenceColoursChanged (this);
+if (this.overviewPanel != null) {
+this.overviewPanel.updateOverviewImage ();
+}}}, "~B");
+Clazz_overrideMethod (c$, "paintComponent", 
+function (g) {
+System.out.println ("alignframe paintcomp");
+this.invalidate ();
+var d = this.idPanel.idCanvas.getSize ();
+var canvasHeight = this.seqPanel.seqCanvas.getSize ().height;
+if (canvasHeight != d.height) {
+this.idPanel.idCanvas.setSize (d.width, canvasHeight);
+}if (this.av.getWrapAlignment ()) {
+var maxwidth = this.av.getAlignment ().getWidth ();
+if (this.av.hasHiddenColumns ()) {
+maxwidth = this.av.getColumnSelection ().findColumnPosition (maxwidth) - 1;
+}var canvasWidth = this.seqPanel.seqCanvas.getWrappedCanvasWidth (this.seqPanel.seqCanvas.getSize ().width);
+if (canvasWidth > 0) {
+var max = Clazz_doubleToInt (maxwidth / canvasWidth);
+this.vscroll.setMaximum (1 + max);
+this.vscroll.setUnitIncrement (1);
+this.vscroll.setVisibleAmount (1);
+}} else {
+this.setScrollValues (this.av.getStartRes (), this.av.getStartSeq ());
+}}, "java.awt.Graphics");
+Clazz_defineMethod (c$, "jbInit", 
+ function () {
+this.setLayout ( new java.awt.BorderLayout ());
+this.sequenceHolderPanel.setLayout ( new java.awt.BorderLayout ());
+this.seqPanelHolder.setLayout ( new java.awt.BorderLayout ());
+this.scalePanelHolder.setBackground (java.awt.Color.white);
+this.scalePanelHolder.setLayout ( new java.awt.BorderLayout ());
+this.idPanelHolder.setLayout ( new java.awt.BorderLayout ());
+this.idSpaceFillerPanel1.setBackground (java.awt.Color.white);
+this.idSpaceFillerPanel1.setLayout ( new java.awt.BorderLayout ());
+this.annotationSpaceFillerHolder.setBackground (java.awt.Color.white);
+this.annotationSpaceFillerHolder.setLayout ( new java.awt.BorderLayout ());
+this.hscroll.setOrientation (0);
+var hscrollHolder =  new awt2swing.Panel ();
+hscrollHolder.setLayout ( new java.awt.BorderLayout ());
+this.hscrollFillerPanel.setBackground (java.awt.Color.white);
+this.apvscroll.setOrientation (1);
+this.apvscroll.setVisible (true);
+this.apvscroll.addAdjustmentListener (this);
+this.annotationPanelHolder.setBackground (java.awt.Color.white);
+this.annotationPanelHolder.setLayout ( new java.awt.BorderLayout ());
+this.annotationPanelHolder.add (this.apvscroll, "East");
+hscrollHolder.setBackground (java.awt.Color.white);
+this.seqPanelHolder.setBackground (java.awt.Color.white);
+this.idPanelHolder.setBackground (java.awt.Color.white);
+this.sequenceHolderPanel.add (this.scalePanelHolder, "North");
+this.sequenceHolderPanel.add (this.seqPanelHolder, "Center");
+this.seqPanelHolder.add (this.vscroll, "East");
+this.add (this.idPanelHolder, "West");
+this.idPanelHolder.add (this.idSpaceFillerPanel1, "North");
+this.idPanelHolder.add (this.annotationSpaceFillerHolder, "South");
+this.add (hscrollHolder, "South");
+hscrollHolder.add (this.hscroll, "Center");
+hscrollHolder.add (this.hscrollFillerPanel, "West");
+this.add (this.sequenceHolderPanel, "Center");
+});
+Clazz_defineMethod (c$, "updateAnnotation", 
+function () {
+this.updateAnnotation (false);
+});
+Clazz_defineMethod (c$, "updateAnnotation", 
+function (applyGlobalSettings) {
+this.updateAnnotation (applyGlobalSettings, false);
+}, "~B");
+Clazz_defineMethod (c$, "updateAnnotation", 
+function (applyGlobalSettings, preserveNewGroupSettings) {
+this.av.updateGroupAnnotationSettings (applyGlobalSettings, preserveNewGroupSettings);
+this.adjustAnnotationHeight ();
+}, "~B,~B");
+Clazz_overrideMethod (c$, "getAlignment", 
+function () {
+return this.av.getAlignment ();
+});
+Clazz_overrideMethod (c$, "getViewName", 
+function () {
+return this.getName ();
+});
+Clazz_overrideMethod (c$, "getStructureSelectionManager", 
+function () {
+return jalview.structure.StructureSelectionManager.getStructureSelectionManager (this.av.applet);
+});
+Clazz_overrideMethod (c$, "raiseOOMWarning", 
+function (string, error) {
+System.err.println ("Out of memory whilst '" + string + "'");
+error.printStackTrace ();
+}, "~S,OutOfMemoryError");
+Clazz_defineMethod (c$, "setFollowingComplementScroll", 
+function (b) {
+this.followingComplementScroll = b;
+}, "~B");
+Clazz_defineMethod (c$, "isFollowingComplementScroll", 
+function () {
+return this.followingComplementScroll;
+});
+c$.$AlignmentPanel$1$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_declareAnonymous (jalview.appletgui, "AlignmentPanel$1", java.awt.event.ComponentAdapter);
+Clazz_overrideMethod (c$, "componentResized", 
+function (evt) {
+this.b$["jalview.appletgui.AlignmentPanel"].setScrollValues (this.f$.av.getStartRes (), this.f$.av.getStartSeq ());
+if (this.b$["jalview.appletgui.AlignmentPanel"].getSize ().height > 0 && this.b$["jalview.appletgui.AlignmentPanel"].annotationPanelHolder.getSize ().height > 0) {
+this.b$["jalview.appletgui.AlignmentPanel"].validateAnnotationDimensions (false);
+}this.b$["jalview.appletgui.AlignmentPanel"].repaint ();
+}, "java.awt.event.ComponentEvent");
+c$ = Clazz_p0p ();
+};
+c$.$AlignmentPanel$2$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_declareAnonymous (jalview.appletgui, "AlignmentPanel$2", null, java.beans.PropertyChangeListener);
+Clazz_overrideMethod (c$, "propertyChange", 
+function (evt) {
+if (evt.getPropertyName ().equals ("alignment")) {
+jalview.appletgui.PaintRefresher.Refresh (this.f$.ap, this.f$.av.getSequenceSetId (), true, true);
+this.b$["jalview.appletgui.AlignmentPanel"].alignmentChanged ();
+}}, "java.beans.PropertyChangeEvent");
+c$ = Clazz_p0p ();
+};
+});
+Clazz_declarePackage ("jalview.api");
+Clazz_load (["jalview.api.OOMHandlerI"], "jalview.api.AlignmentViewPanel", null, function () {
+Clazz_declareInterface (jalview.api, "AlignmentViewPanel", jalview.api.OOMHandlerI);
+});
+Clazz_declarePackage ("jalview.api");
+Clazz_declareInterface (jalview.api, "OOMHandlerI");
+Clazz_declarePackage ("awt2swing");
+Clazz_load (["javax.swing.JScrollBar"], "awt2swing.Scrollbar", null, function () {
+c$ = Clazz_declareType (awt2swing, "Scrollbar", javax.swing.JScrollBar);
+Clazz_defineMethod (c$, "addChangeListener", 
+function (l) {
+this.addAdjustmentListener (l);
+}, "javax.swing.event.ChangeListener");
+Clazz_defineMethod (c$, "removeChangeListener", 
+function (l) {
+this.removeAdjustmentListener (l);
+}, "javax.swing.event.ChangeListener");
+});
+Clazz_declarePackage ("javax.swing");
+Clazz_load (["java.awt.Adjustable", "javax.swing.JComponent", "javax.swing.event.ChangeListener"], "javax.swing.JScrollBar", ["java.lang.IllegalArgumentException", "java.awt.Dimension", "java.awt.event.AdjustmentEvent", "$.AdjustmentListener", "javax.swing.BoundedRangeModel", "$.DefaultBoundedRangeModel", "$.UIManager"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.fwdAdjustmentEvents = null;
+this.model = null;
+this.orientation = 0;
+this.unitIncrement = 0;
+this.blockIncrement = 0;
+if (!Clazz_isClassDefined ("javax.swing.JScrollBar.ModelListener")) {
+javax.swing.JScrollBar.$JScrollBar$ModelListener$ ();
+}
+Clazz_instantialize (this, arguments);
+}, javax.swing, "JScrollBar", javax.swing.JComponent, java.awt.Adjustable);
+Clazz_prepareFields (c$, function () {
+this.fwdAdjustmentEvents = Clazz_innerTypeInstance (javax.swing.JScrollBar.ModelListener, this, null);
+});
+Clazz_defineMethod (c$, "checkOrientation", 
+ function (orientation) {
+switch (orientation) {
+case 1:
+case 0:
+break;
+default:
+throw  new IllegalArgumentException ("orientation must be one of: VERTICAL, HORIZONTAL");
+}
+}, "~N");
+Clazz_makeConstructor (c$, 
+function (orientation, value, extent, min, max) {
+Clazz_superConstructor (this, javax.swing.JScrollBar, []);
+this.checkOrientation (orientation);
+this.unitIncrement = 1;
+this.blockIncrement = (extent == 0) ? 1 : extent;
+this.orientation = orientation;
+this.model =  new javax.swing.DefaultBoundedRangeModel (value, extent, min, max);
+this.model.addChangeListener (this.fwdAdjustmentEvents);
+this.setRequestFocusEnabled (false);
+this.updateUI ();
+}, "~N,~N,~N,~N,~N");
+Clazz_makeConstructor (c$, 
+function (orientation) {
+this.construct (orientation, 0, 10, 0, 100);
+}, "~N");
+Clazz_makeConstructor (c$, 
+function () {
+this.construct (1);
+});
+Clazz_overrideMethod (c$, "getUI", 
+function () {
+return this.ui;
+});
+Clazz_overrideMethod (c$, "updateUI", 
+function () {
+this.setUI (javax.swing.UIManager.getUI (this));
+});
+Clazz_overrideMethod (c$, "getUIClassID", 
+function () {
+return "ScrollBarUI";
+});
+Clazz_overrideMethod (c$, "getOrientation", 
+function () {
+return this.orientation;
+});
+Clazz_defineMethod (c$, "setOrientation", 
+function (orientation) {
+this.checkOrientation (orientation);
+var oldValue = this.orientation;
+this.orientation = orientation;
+this.firePropertyChangeInt ("orientation", oldValue, orientation);
+if (orientation != oldValue) {
+this.revalidate ();
+}}, "~N");
+Clazz_defineMethod (c$, "getModel", 
+function () {
+return this.model;
+});
+Clazz_defineMethod (c$, "setModel", 
+function (newModel) {
+var oldModel = this.model;
+if (this.model != null) {
+this.model.removeChangeListener (this.fwdAdjustmentEvents);
+}this.model = newModel;
+if (this.model != null) {
+this.model.addChangeListener (this.fwdAdjustmentEvents);
+}this.firePropertyChangeObject ("model", oldModel, this.model);
+}, "javax.swing.BoundedRangeModel");
+Clazz_defineMethod (c$, "getUnitIncrement", 
+function (direction) {
+return this.unitIncrement;
+}, "~N");
+Clazz_overrideMethod (c$, "setUnitIncrement", 
+function (unitIncrement) {
+var oldValue = this.unitIncrement;
+this.unitIncrement = unitIncrement;
+this.firePropertyChangeInt ("unitIncrement", oldValue, unitIncrement);
+}, "~N");
+Clazz_defineMethod (c$, "getBlockIncrement", 
+function (direction) {
+return this.blockIncrement;
+}, "~N");
+Clazz_overrideMethod (c$, "setBlockIncrement", 
+function (blockIncrement) {
+var oldValue = this.blockIncrement;
+this.blockIncrement = blockIncrement;
+this.firePropertyChangeInt ("blockIncrement", oldValue, blockIncrement);
+}, "~N");
+Clazz_defineMethod (c$, "getUnitIncrement", 
+function () {
+return this.unitIncrement;
+});
+Clazz_defineMethod (c$, "getBlockIncrement", 
+function () {
+return this.blockIncrement;
+});
+Clazz_overrideMethod (c$, "getValue", 
+function () {
+return this.getModel ().getValue ();
+});
+Clazz_overrideMethod (c$, "setValue", 
+function (value) {
+var m = this.getModel ();
+m.setValue (value);
+}, "~N");
+Clazz_overrideMethod (c$, "getVisibleAmount", 
+function () {
+return this.getModel ().getExtent ();
+});
+Clazz_overrideMethod (c$, "setVisibleAmount", 
+function (extent) {
+this.getModel ().setExtent (extent);
+}, "~N");
+Clazz_overrideMethod (c$, "getMinimum", 
+function () {
+return this.getModel ().getMinimum ();
+});
+Clazz_overrideMethod (c$, "setMinimum", 
+function (minimum) {
+this.getModel ().setMinimum (minimum);
+}, "~N");
+Clazz_overrideMethod (c$, "getMaximum", 
+function () {
+return this.getModel ().getMaximum ();
+});
+Clazz_overrideMethod (c$, "setMaximum", 
+function (maximum) {
+this.getModel ().setMaximum (maximum);
+}, "~N");
+Clazz_defineMethod (c$, "getValueIsAdjusting", 
+function () {
+return this.getModel ().getValueIsAdjusting ();
+});
+Clazz_defineMethod (c$, "setValueIsAdjusting", 
+function (b) {
+var m = this.getModel ();
+m.setValueIsAdjusting (b);
+}, "~B");
+Clazz_defineMethod (c$, "setValues", 
+function (newValue, newExtent, newMin, newMax) {
+var m = this.getModel ();
+m.setRangeProperties (newValue, newExtent, newMin, newMax, m.getValueIsAdjusting ());
+}, "~N,~N,~N,~N");
+Clazz_overrideMethod (c$, "addAdjustmentListener", 
+function (l) {
+this.listenerList.add (java.awt.event.AdjustmentListener, l);
+}, "java.awt.event.AdjustmentListener");
+Clazz_overrideMethod (c$, "removeAdjustmentListener", 
+function (l) {
+this.listenerList.remove (java.awt.event.AdjustmentListener, l);
+}, "java.awt.event.AdjustmentListener");
+Clazz_defineMethod (c$, "getAdjustmentListeners", 
+function () {
+return this.listenerList.getListeners (java.awt.event.AdjustmentListener);
+});
+Clazz_defineMethod (c$, "fireAdjustmentValueChanged", 
+function (id, type, value) {
+this.fireAdjustmentValueChanged (id, type, value, this.getValueIsAdjusting ());
+}, "~N,~N,~N");
+Clazz_defineMethod (c$, "fireAdjustmentValueChanged", 
+ function (id, type, value, isAdjusting) {
+var listeners = this.listenerList.getListenerList ();
+var e = null;
+for (var i = listeners.length - 2; i >= 0; i -= 2) {
+if (listeners[i] === java.awt.event.AdjustmentListener) {
+if (e == null) {
+e =  new java.awt.event.AdjustmentEvent (this, id, type, value, isAdjusting);
+}(listeners[i + 1]).adjustmentValueChanged (e);
+}}
+}, "~N,~N,~N,~B");
+Clazz_overrideMethod (c$, "getMinimumSize", 
+function () {
+var pref = this.getPreferredSize ();
+if (this.orientation == 1) {
+return  new java.awt.Dimension (pref.width, 5);
+} else {
+return  new java.awt.Dimension (5, pref.height);
+}});
+Clazz_overrideMethod (c$, "getMaximumSize", 
+function () {
+var pref = this.getPreferredSize ();
+if (this.getOrientation () == 1) {
+return  new java.awt.Dimension (pref.width, 32767);
+} else {
+return  new java.awt.Dimension (32767, pref.height);
+}});
+Clazz_defineMethod (c$, "setEnabled", 
+function (x) {
+Clazz_superCall (this, javax.swing.JScrollBar, "setEnabled", [x]);
+var children = this.getComponents ();
+for (var i = 0; i < children.length; i++) {
+children[i].setEnabled (x);
+}
+}, "~B");
+Clazz_defineMethod (c$, "paramString", 
+function () {
+var orientationString = (this.orientation == 0 ? "HORIZONTAL" : "VERTICAL");
+return Clazz_superCall (this, javax.swing.JScrollBar, "paramString", []) + ",blockIncrement=" + this.blockIncrement + ",orientation=" + orientationString + ",unitIncrement=" + this.unitIncrement;
+});
+c$.$JScrollBar$ModelListener$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_decorateAsClass (function () {
+Clazz_prepareCallback (this, arguments);
+Clazz_instantialize (this, arguments);
+}, javax.swing.JScrollBar, "ModelListener", null, javax.swing.event.ChangeListener);
+Clazz_overrideMethod (c$, "stateChanged", 
+function (a) {
+var b = a.getSource ();
+if (Clazz_instanceOf (b, javax.swing.BoundedRangeModel)) {
+var c = 601;
+var d = 5;
+var e = b;
+var f = e.getValue ();
+var g = e.getValueIsAdjusting ();
+this.b$["javax.swing.JScrollBar"].fireAdjustmentValueChanged (c, d, f, g);
+}}, "javax.swing.event.ChangeEvent");
+c$ = Clazz_p0p ();
+};
+Clazz_defineStatics (c$,
+"$uiClassID", "ScrollBarUI");
+});
+Clazz_declarePackage ("java.awt");
+c$ = Clazz_declareInterface (java.awt, "Adjustable");
+Clazz_defineStatics (c$,
+"HORIZONTAL", 0,
+"VERTICAL", 1,
+"NO_ORIENTATION", 2);
+Clazz_declarePackage ("java.awt.event");
+Clazz_load (["java.awt.AWTEvent"], "java.awt.event.AdjustmentEvent", null, function () {
+c$ = Clazz_decorateAsClass (function () {
+this.adjustable = null;
+this.value = 0;
+this.adjustmentType = 0;
+this.isAdjusting = false;
+Clazz_instantialize (this, arguments);
+}, java.awt.event, "AdjustmentEvent", java.awt.AWTEvent);
+Clazz_makeConstructor (c$, 
+function (source, id, type, value) {
+this.construct (source, id, type, value, false);
+}, "java.awt.Adjustable,~N,~N,~N");
+Clazz_makeConstructor (c$, 
+function (source, id, type, value, isAdjusting) {
+Clazz_superConstructor (this, java.awt.event.AdjustmentEvent, [source, id]);
+this.adjustable = source;
+this.adjustmentType = type;
+this.value = value;
+this.isAdjusting = isAdjusting;
+}, "java.awt.Adjustable,~N,~N,~N,~B");
+Clazz_defineMethod (c$, "getAdjustable", 
+function () {
+return this.adjustable;
+});
+Clazz_defineMethod (c$, "getValue", 
+function () {
+return this.value;
+});
+Clazz_defineMethod (c$, "getAdjustmentType", 
+function () {
+return this.adjustmentType;
+});
+Clazz_defineMethod (c$, "getValueIsAdjusting", 
+function () {
+return this.isAdjusting;
+});
+Clazz_overrideMethod (c$, "paramString", 
+function () {
+var typeStr;
+switch (this.id) {
+case 601:
+typeStr = "ADJUSTMENT_VALUE_CHANGED";
+break;
+default:
+typeStr = "unknown type";
+}
+var adjTypeStr;
+switch (this.adjustmentType) {
+case 1:
+adjTypeStr = "UNIT_INCREMENT";
+break;
+case 2:
+adjTypeStr = "UNIT_DECREMENT";
+break;
+case 4:
+adjTypeStr = "BLOCK_INCREMENT";
+break;
+case 3:
+adjTypeStr = "BLOCK_DECREMENT";
+break;
+case 5:
+adjTypeStr = "TRACK";
+break;
+default:
+adjTypeStr = "unknown type";
+}
+return typeStr + ",adjType=" + adjTypeStr + ",value=" + this.value + ",isAdjusting=" + this.isAdjusting;
+});
+Clazz_defineStatics (c$,
+"ADJUSTMENT_FIRST", 601,
+"ADJUSTMENT_LAST", 601,
+"ADJUSTMENT_VALUE_CHANGED", 601,
+"UNIT_INCREMENT", 1,
+"UNIT_DECREMENT", 2,
+"BLOCK_DECREMENT", 3,
+"BLOCK_INCREMENT", 4,
+"TRACK", 5);
+});
+Clazz_declarePackage ("jalview.appletgui");
+Clazz_load (["awt2swing.Panel", "java.awt.event.ActionListener", "$.MouseListener", "$.MouseMotionListener"], "jalview.appletgui.AnnotationLabels", ["awt2swing.Checkbox", "$.CheckboxMenuItem", "$.Frame", "$.MenuItem", "$.PopupMenu", "$.Util", "jalview.analysis.AlignmentUtils", "jalview.appletgui.AlignFrame", "$.CutAndPasteTransfer", "$.EditNameDialog", "$.PaintRefresher", "$.Tooltip", "jalview.bin.JalviewLite", "jalview.datamodel.AlignmentAnnotation", "$.SequenceGroup", "jalview.util.MessageManager", "$.ParseHtmlBodyAndLinks", "java.awt.Color", "$.Dimension", "$.FlowLayout", "java.awt.event.ItemListener", "java.lang.StringBuffer", "java.util.Arrays", "$.Collections", "$.Vector"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.image = null;
+this.active = false;
+this.ap = null;
+this.av = null;
+this.resizing = false;
+this.oldY = 0;
+this.mouseX = 0;
+this.scrollOffset = 0;
+this.selectedRow = -1;
+this.tooltip = null;
+this.hasHiddenRows = false;
+this.resizePanel = false;
+this.dragEvent = null;
+this.dragCancelled = false;
+Clazz_instantialize (this, arguments);
+}, jalview.appletgui, "AnnotationLabels", awt2swing.Panel, [java.awt.event.ActionListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener]);
+Clazz_makeConstructor (c$, 
+function (ap) {
+Clazz_superConstructor (this, jalview.appletgui.AnnotationLabels, []);
+this.ap = ap;
+this.av = ap.av;
+this.setLayout (null);
+this.addMouseListener (this);
+this.addMouseMotionListener (this);
+}, "jalview.appletgui.AlignmentPanel");
+Clazz_makeConstructor (c$, 
+function (av) {
+Clazz_superConstructor (this, jalview.appletgui.AnnotationLabels, []);
+this.av = av;
+}, "jalview.appletgui.AlignViewport");
+Clazz_defineMethod (c$, "setScrollOffset", 
+function (y, repaint) {
+this.scrollOffset = y;
+if (repaint) {
+this.repaint ();
+}}, "~N,~B");
+Clazz_defineMethod (c$, "getSelectedRow", 
+function (y) {
+var row = -2;
+var aa = this.ap.av.getAlignment ().getAlignmentAnnotation ();
+if (aa == null) {
+return row;
+}var height = 0;
+for (var i = 0; i < aa.length; i++) {
+row = -1;
+if (!aa[i].visible) {
+continue;
+}height += aa[i].height;
+if (y < height) {
+row = i;
+break;
+}}
+return row;
+}, "~N");
+Clazz_overrideMethod (c$, "actionPerformed", 
+function (evt) {
+var aa = this.av.getAlignment ().getAlignmentAnnotation ();
+if (evt.getActionCommand ().equals (jalview.appletgui.AnnotationLabels.ADDNEW)) {
+var newAnnotation =  new jalview.datamodel.AlignmentAnnotation ("", null,  new Array (this.ap.av.getAlignment ().getWidth ()));
+if (!this.editLabelDescription (newAnnotation)) {
+return;
+}this.ap.av.getAlignment ().addAnnotation (newAnnotation);
+this.ap.av.getAlignment ().setAnnotationIndex (newAnnotation, 0);
+} else if (evt.getActionCommand ().equals (jalview.appletgui.AnnotationLabels.EDITNAME)) {
+this.editLabelDescription (aa[this.selectedRow]);
+} else if (evt.getActionCommand ().equals (jalview.appletgui.AnnotationLabels.HIDE)) {
+aa[this.selectedRow].visible = false;
+} else if (evt.getActionCommand ().equals (jalview.appletgui.AnnotationLabels.SHOWALL)) {
+for (var i = 0; i < aa.length; i++) {
+aa[i].visible = (aa[i].annotations == null) ? false : true;
+}
+} else if (evt.getActionCommand ().equals (jalview.appletgui.AnnotationLabels.OUTPUT_TEXT)) {
+var cap =  new jalview.appletgui.CutAndPasteTransfer (false, this.ap.alignFrame);
+var frame =  new awt2swing.Frame ();
+frame.add (cap);
+jalview.bin.JalviewLite.addFrame (frame, this.ap.alignFrame.getTitle () + " - " + aa[this.selectedRow].label, 500, 100);
+cap.setText (aa[this.selectedRow].toString ());
+} else if (evt.getActionCommand ().equals (jalview.appletgui.AnnotationLabels.COPYCONS_SEQ)) {
+var cons = this.av.getConsensusSeq ();
+if (cons != null) {
+this.copy_annotseqtoclipboard (cons);
+}}this.refresh ();
+}, "java.awt.event.ActionEvent");
+Clazz_defineMethod (c$, "refresh", 
+function () {
+this.ap.annotationPanel.adjustPanelHeight ();
+this.setSize (this.getSize ().width, this.ap.annotationPanel.getSize ().height);
+this.ap.validate ();
+this.ap.paintAlignment (true);
+});
+Clazz_defineMethod (c$, "editLabelDescription", 
+function (annotation) {
+var padGaps =  new awt2swing.Checkbox ("Fill Empty Gaps With \"" + this.ap.av.getGapCharacter () + "\"", annotation.padGaps);
+var dialog =  new jalview.appletgui.EditNameDialog (annotation.label, annotation.description, "      Annotation Label", "Annotation Description", this.ap.alignFrame, "Edit Annotation Name / Description", 500, 180, false);
+var empty =  new awt2swing.Panel ( new java.awt.FlowLayout ());
+empty.add (padGaps);
+dialog.add (empty);
+dialog.pack ();
+dialog.setVisible (true);
+if (dialog.accept) {
+annotation.label = dialog.getName ();
+annotation.description = dialog.getDescription ();
+annotation.setPadGaps (padGaps.getState (), this.av.getGapCharacter ());
+this.repaint ();
+return true;
+} else {
+return false;
+}}, "jalview.datamodel.AlignmentAnnotation");
+Clazz_overrideMethod (c$, "mouseMoved", 
+function (evt) {
+this.resizePanel = evt.getY () < 10 && evt.getX () < 14;
+var row = this.getSelectedRow (evt.getY () + this.scrollOffset);
+if (row > -1) {
+var phb =  new jalview.util.ParseHtmlBodyAndLinks (this.av.getAlignment ().getAlignmentAnnotation ()[row].getDescription (true), true, "\n");
+if (this.tooltip == null) {
+this.tooltip =  new jalview.appletgui.Tooltip (phb.getNonHtmlContent (), this);
+} else {
+this.tooltip.setTip (phb.getNonHtmlContent ());
+}} else if (this.tooltip != null) {
+this.tooltip.setTip ("");
+}}, "java.awt.event.MouseEvent");
+Clazz_defineMethod (c$, "cancelDrag", 
+function () {
+this.dragEvent = null;
+this.dragCancelled = true;
+});
+Clazz_overrideMethod (c$, "mouseDragged", 
+function (evt) {
+if (this.dragCancelled) {
+return;
+};this.dragEvent = evt;
+if (this.resizePanel) {
+var d = this.ap.annotationPanelHolder.getSize ();
+var e = this.ap.annotationSpaceFillerHolder.getSize ();
+var f = this.ap.seqPanelHolder.getSize ();
+var dif = evt.getY () - this.oldY;
+dif /= this.ap.av.getCharHeight ();
+dif *= this.ap.av.getCharHeight ();
+if ((d.height - dif) > 20 && (f.height + dif) > 20) {
+this.ap.annotationPanel.setSize (d.width, d.height - dif);
+this.setSize ( new java.awt.Dimension (e.width, d.height - dif));
+this.ap.annotationSpaceFillerHolder.setSize ( new java.awt.Dimension (e.width, d.height - dif));
+this.ap.annotationPanelHolder.setSize ( new java.awt.Dimension (d.width, d.height - dif));
+this.ap.apvscroll.setValues (this.ap.apvscroll.getValue (), d.height - dif, 0, this.av.calcPanelHeight ());
+f.height += dif;
+this.ap.seqPanelHolder.setPreferredSize (f);
+this.ap.setScrollValues (this.av.getStartRes (), this.av.getStartSeq ());
+this.ap.validate ();
+this.ap.addNotify ();
+}} else {
+var diff;
+if ((diff = 6 - evt.getY ()) > 0) {
+this.ap.apvscroll.setValue (this.ap.apvscroll.getValue () - diff);
+this.ap.adjustmentValueChanged (null);
+} else if ((0 < (diff = 6 - this.ap.annotationSpaceFillerHolder.getSize ().height + evt.getY ()))) {
+this.ap.apvscroll.setValue (this.ap.apvscroll.getValue () + diff);
+this.ap.adjustmentValueChanged (null);
+}this.repaint ();
+}}, "java.awt.event.MouseEvent");
+Clazz_overrideMethod (c$, "mouseClicked", 
+function (evt) {
+}, "java.awt.event.MouseEvent");
+Clazz_overrideMethod (c$, "mouseReleased", 
+function (evt) {
+if (!this.resizePanel && !this.dragCancelled) {
+var start = this.selectedRow;
+var end = this.getSelectedRow (evt.getY () + this.scrollOffset);
+if (start > -1 && start != end) {
+var startAA = this.ap.av.getAlignment ().getAlignmentAnnotation ()[start];
+if (end == -1) {
+end = this.ap.av.getAlignment ().getAlignmentAnnotation ().length - 1;
+}var endAA = this.ap.av.getAlignment ().getAlignmentAnnotation ()[end];
+this.ap.av.getAlignment ().getAlignmentAnnotation ()[end] = startAA;
+this.ap.av.getAlignment ().getAlignmentAnnotation ()[start] = endAA;
+}}this.resizePanel = false;
+this.dragEvent = null;
+this.dragCancelled = false;
+this.repaint ();
+this.ap.annotationPanel.repaint ();
+}, "java.awt.event.MouseEvent");
+Clazz_overrideMethod (c$, "mouseEntered", 
+function (evt) {
+if (evt.getY () < 10 && evt.getX () < 14) {
+this.resizePanel = true;
+this.repaint ();
+}}, "java.awt.event.MouseEvent");
+Clazz_overrideMethod (c$, "mouseExited", 
+function (evt) {
+this.dragCancelled = false;
+if (this.dragEvent == null) {
+this.resizePanel = false;
+} else {
+if (!this.resizePanel) {
+this.dragEvent = null;
+}}this.repaint ();
+}, "java.awt.event.MouseEvent");
+Clazz_overrideMethod (c$, "mousePressed", 
+function (evt) {
+this.oldY = evt.getY ();
+if (this.resizePanel) {
+return;
+}this.dragCancelled = false;
+this.selectedRow = this.getSelectedRow (evt.getY () + this.scrollOffset);
+var aa = this.ap.av.getAlignment ().getAlignmentAnnotation ();
+if ((evt.getModifiers () & 4) == 4) {
+var popup =  new awt2swing.PopupMenu (jalview.util.MessageManager.getString ("label.annotations"));
+var item =  new awt2swing.MenuItem (jalview.appletgui.AnnotationLabels.ADDNEW);
+item.addActionListener (this);
+popup.add (item);
+if (this.selectedRow < 0) {
+if (this.hasHiddenRows) {
+item =  new awt2swing.MenuItem (jalview.appletgui.AnnotationLabels.SHOWALL);
+item.addActionListener (this);
+popup.add (item);
+}this.add (popup);
+popup.show (this, evt.getX (), evt.getY ());
+return;
+}item =  new awt2swing.MenuItem (jalview.appletgui.AnnotationLabels.EDITNAME);
+item.addActionListener (this);
+popup.add (item);
+item =  new awt2swing.MenuItem (jalview.appletgui.AnnotationLabels.HIDE);
+item.addActionListener (this);
+popup.add (item);
+if (this.selectedRow < aa.length) {
+if (aa[this.selectedRow].sequenceRef != null) {
+var label = aa[this.selectedRow].label;
+var hideType =  new awt2swing.MenuItem (jalview.util.MessageManager.getString ("label.hide_all") + " " + label);
+hideType.addActionListener (((Clazz_isClassDefined ("jalview.appletgui.AnnotationLabels$1") ? 0 : jalview.appletgui.AnnotationLabels.$AnnotationLabels$1$ ()), Clazz_innerTypeInstance (jalview.appletgui.AnnotationLabels$1, this, Clazz_cloneFinals ("label", label))));
+popup.add (hideType);
+}}if (this.hasHiddenRows) {
+item =  new awt2swing.MenuItem (jalview.appletgui.AnnotationLabels.SHOWALL);
+item.addActionListener (this);
+popup.add (item);
+}this.add (popup);
+item =  new awt2swing.MenuItem (jalview.appletgui.AnnotationLabels.OUTPUT_TEXT);
+item.addActionListener (this);
+popup.add (item);
+if (this.selectedRow < aa.length) {
+if (aa[this.selectedRow].autoCalculated) {
+if (aa[this.selectedRow].label.indexOf ("Consensus") > -1) {
+popup.addSeparator ();
+var cbmi =  new awt2swing.CheckboxMenuItem (jalview.util.MessageManager.getString ("label.ignore_gaps_consensus"), (aa[this.selectedRow].groupRef != null) ? aa[this.selectedRow].groupRef.getIgnoreGapsConsensus () : this.ap.av.isIgnoreGapsConsensus ());
+var aaa = aa[this.selectedRow];
+cbmi.addItemListener (((Clazz_isClassDefined ("jalview.appletgui.AnnotationLabels$2") ? 0 : jalview.appletgui.AnnotationLabels.$AnnotationLabels$2$ ()), Clazz_innerTypeInstance (jalview.appletgui.AnnotationLabels$2, this, Clazz_cloneFinals ("aaa", aaa, "cbmi", cbmi))));
+popup.add (cbmi);
+if (aaa.groupRef != null) {
+var chist =  new awt2swing.CheckboxMenuItem (jalview.util.MessageManager.getString ("label.show_group_histogram"), aa[this.selectedRow].groupRef.isShowConsensusHistogram ());
+chist.addItemListener (((Clazz_isClassDefined ("jalview.appletgui.AnnotationLabels$3") ? 0 : jalview.appletgui.AnnotationLabels.$AnnotationLabels$3$ ()), Clazz_innerTypeInstance (jalview.appletgui.AnnotationLabels$3, this, Clazz_cloneFinals ("aaa", aaa, "chist", chist))));
+popup.add (chist);
+var cprofl =  new awt2swing.CheckboxMenuItem (jalview.util.MessageManager.getString ("label.show_group_logo"), aa[this.selectedRow].groupRef.isShowSequenceLogo ());
+cprofl.addItemListener (((Clazz_isClassDefined ("jalview.appletgui.AnnotationLabels$4") ? 0 : jalview.appletgui.AnnotationLabels.$AnnotationLabels$4$ ()), Clazz_innerTypeInstance (jalview.appletgui.AnnotationLabels$4, this, Clazz_cloneFinals ("aaa", aaa, "cprofl", cprofl))));
+popup.add (cprofl);
+var cprofn =  new awt2swing.CheckboxMenuItem (jalview.util.MessageManager.getString ("label.normalise_group_logo"), aa[this.selectedRow].groupRef.isNormaliseSequenceLogo ());
+cprofn.addItemListener (((Clazz_isClassDefined ("jalview.appletgui.AnnotationLabels$5") ? 0 : jalview.appletgui.AnnotationLabels.$AnnotationLabels$5$ ()), Clazz_innerTypeInstance (jalview.appletgui.AnnotationLabels$5, this, Clazz_cloneFinals ("aaa", aaa, "cprofn", cprofn))));
+popup.add (cprofn);
+} else {
+var chist =  new awt2swing.CheckboxMenuItem (jalview.util.MessageManager.getString ("label.show_histogram"), this.av.isShowConsensusHistogram ());
+chist.addItemListener (((Clazz_isClassDefined ("jalview.appletgui.AnnotationLabels$6") ? 0 : jalview.appletgui.AnnotationLabels.$AnnotationLabels$6$ ()), Clazz_innerTypeInstance (jalview.appletgui.AnnotationLabels$6, this, Clazz_cloneFinals ("chist", chist))));
+popup.add (chist);
+var cprof =  new awt2swing.CheckboxMenuItem (jalview.util.MessageManager.getString ("label.show_logo"), this.av.isShowSequenceLogo ());
+cprof.addItemListener (((Clazz_isClassDefined ("jalview.appletgui.AnnotationLabels$7") ? 0 : jalview.appletgui.AnnotationLabels.$AnnotationLabels$7$ ()), Clazz_innerTypeInstance (jalview.appletgui.AnnotationLabels$7, this, Clazz_cloneFinals ("cprof", cprof))));
+popup.add (cprof);
+var cprofn =  new awt2swing.CheckboxMenuItem (jalview.util.MessageManager.getString ("label.normalise_logo"), this.av.isNormaliseSequenceLogo ());
+cprofn.addItemListener (((Clazz_isClassDefined ("jalview.appletgui.AnnotationLabels$8") ? 0 : jalview.appletgui.AnnotationLabels.$AnnotationLabels$8$ ()), Clazz_innerTypeInstance (jalview.appletgui.AnnotationLabels$8, this, Clazz_cloneFinals ("cprofn", cprofn))));
+popup.add (cprofn);
+}item =  new awt2swing.MenuItem (jalview.appletgui.AnnotationLabels.COPYCONS_SEQ);
+item.addActionListener (this);
+popup.add (item);
+}}}popup.show (this, evt.getX (), evt.getY ());
+} else {
+if (this.selectedRow > -1 && this.selectedRow < aa.length) {
+if (aa[this.selectedRow].groupRef != null) {
+if (evt.getClickCount () >= 2) {
+this.ap.seqPanel.ap.idPanel.highlightSearchResults (null);
+this.ap.av.setSelectionGroup (aa[this.selectedRow].groupRef);
+this.ap.av.sendSelection ();
+this.ap.paintAlignment (false);
+jalview.appletgui.PaintRefresher.Refresh (this.ap, this.ap.av.getSequenceSetId ());
+} else {
+this.ap.seqPanel.ap.idPanel.highlightSearchResults (aa[this.selectedRow].groupRef.getSequences (null));
+}return;
+} else if (aa[this.selectedRow].sequenceRef != null) {
+if (evt.getClickCount () == 1) {
+this.ap.seqPanel.ap.idPanel.highlightSearchResults (java.util.Arrays.asList ( Clazz_newArray (-1, [aa[this.selectedRow].sequenceRef])));
+} else if (evt.getClickCount () >= 2) {
+this.ap.seqPanel.ap.idPanel.highlightSearchResults (null);
+var sg = this.ap.av.getSelectionGroup ();
+if (sg != null) {
+if (!(evt.isControlDown () || evt.isShiftDown ())) {
+sg =  new jalview.datamodel.SequenceGroup (sg);
+sg.clear ();
+sg.addSequence (aa[this.selectedRow].sequenceRef, false);
+} else {
+if (evt.isControlDown ()) {
+sg.addOrRemove (aa[this.selectedRow].sequenceRef, true);
+} else {
+sg.addSequence (aa[this.selectedRow].sequenceRef, true);
+}}} else {
+sg =  new jalview.datamodel.SequenceGroup ();
+sg.setStartRes (0);
+sg.setEndRes (this.ap.av.getAlignment ().getWidth () - 1);
+sg.addSequence (aa[this.selectedRow].sequenceRef, false);
+}this.ap.av.setSelectionGroup (sg);
+this.ap.paintAlignment (false);
+jalview.appletgui.PaintRefresher.Refresh (this.ap, this.ap.av.getSequenceSetId ());
+this.ap.av.sendSelection ();
+}}}}}, "java.awt.event.MouseEvent");
+Clazz_defineMethod (c$, "copy_annotseqtoclipboard", 
+function (sq) {
+if (sq == null || sq.getLength () < 1) {
+return;
+}jalview.appletgui.AlignFrame.copiedSequences =  new StringBuffer ();
+jalview.appletgui.AlignFrame.copiedSequences.append (sq.getName () + "\t" + sq.getStart () + "\t" + sq.getEnd () + "\t" + sq.getSequenceAsString () + "\n");
+if (this.av.hasHiddenColumns ()) {
+jalview.appletgui.AlignFrame.copiedHiddenColumns =  new java.util.Vector ();
+for (var region, $region = this.av.getColumnSelection ().getHiddenColumns ().iterator (); $region.hasNext () && ((region = $region.next ()) || true);) {
+jalview.appletgui.AlignFrame.copiedHiddenColumns.addElement ( Clazz_newIntArray (-1, [region[0], region[1]]));
+}
+}}, "jalview.datamodel.SequenceI");
+Clazz_overrideMethod (c$, "paintComponent", 
+function (g) {
+if (this.av.getWrapAlignment () || !this.av.isShowAnnotation ()) return;
+var w = this.getSize ().width;
+var h = this.getSize ().height;
+if (this.image == null || w != this.image.getWidth (this) || h != this.image.getHeight (this)) {
+this.image = this.createImage (w, this.ap.annotationPanel.getSize ().height);
+}this.drawComponent (this.image.getGraphics (), w);
+g.drawImage (this.image, 0, 0, this);
+}, "java.awt.Graphics");
+Clazz_defineMethod (c$, "drawComponent", 
+function (g, width) {
+g.setFont (this.av.getFont ());
+var fm = g.getFontMetrics (this.av.getFont ());
+g.setColor (java.awt.Color.white);
+g.fillRect (0, 0, this.getSize ().width, this.getSize ().height);
+g.translate (0, -this.scrollOffset);
+g.setColor (java.awt.Color.black);
+var aa = this.av.getAlignment ().getAlignmentAnnotation ();
+var y = 0;
+var fy = g.getFont ().getSize ();
+var x = 0;
+var offset;
+if (aa != null) {
+this.hasHiddenRows = false;
+for (var i = 0; i < aa.length; i++) {
+if (!aa[i].visible) {
+this.hasHiddenRows = true;
+continue;
+}x = width - fm.stringWidth (aa[i].label) - 3;
+y += aa[i].height;
+offset = Clazz_doubleToInt (-(aa[i].height - fy) / 2);
+awt2swing.Util.drawString (g, aa[i].label, x, y + offset);
+}
+}g.translate (0, +this.scrollOffset);
+if (this.resizePanel) {
+g.setColor (java.awt.Color.red);
+g.setPaintMode ();
+g.drawLine (2, 8, 5, 2);
+g.drawLine (5, 2, 8, 8);
+} else if (!this.dragCancelled && this.dragEvent != null && aa != null) {
+g.setColor (java.awt.Color.lightGray);
+awt2swing.Util.drawString (g, aa[this.selectedRow].label, this.dragEvent.getX (), this.dragEvent.getY ());
+}if (!this.av.getWrapAlignment () && ((aa == null) || (aa.length < 1))) {
+g.setColor (java.awt.Color.black);
+awt2swing.Util.drawString (g, jalview.util.MessageManager.getString ("label.right_click"), 2, 8);
+awt2swing.Util.drawString (g, jalview.util.MessageManager.getString ("label.to_add_annotation"), 2, 18);
+}}, "java.awt.Graphics,~N");
+c$.$AnnotationLabels$1$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_declareAnonymous (jalview.appletgui, "AnnotationLabels$1", null, java.awt.event.ActionListener);
+Clazz_overrideMethod (c$, "actionPerformed", 
+function (e) {
+jalview.analysis.AlignmentUtils.showOrHideSequenceAnnotations (this.b$["jalview.appletgui.AnnotationLabels"].ap.av.getAlignment (), java.util.Collections.singleton (this.f$.label), null, false, false);
+this.b$["jalview.appletgui.AnnotationLabels"].refresh ();
+}, "java.awt.event.ActionEvent");
+c$ = Clazz_p0p ();
+};
+c$.$AnnotationLabels$2$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_declareAnonymous (jalview.appletgui, "AnnotationLabels$2", null, java.awt.event.ItemListener);
+Clazz_overrideMethod (c$, "itemStateChanged", 
+function (e) {
+if (this.f$.aaa.groupRef != null) {
+this.f$.aaa.groupRef.setIgnoreGapsConsensus (this.f$.cbmi.getState ());
+} else {
+this.b$["jalview.appletgui.AnnotationLabels"].ap.av.setIgnoreGapsConsensus (this.f$.cbmi.getState (), this.b$["jalview.appletgui.AnnotationLabels"].ap);
+}this.b$["jalview.appletgui.AnnotationLabels"].ap.paintAlignment (true);
+}, "java.awt.event.ItemEvent");
+c$ = Clazz_p0p ();
+};
+c$.$AnnotationLabels$3$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_declareAnonymous (jalview.appletgui, "AnnotationLabels$3", null, java.awt.event.ItemListener);
+Clazz_overrideMethod (c$, "itemStateChanged", 
+function (e) {
+this.f$.aaa.groupRef.setShowConsensusHistogram (this.f$.chist.getState ());
+this.b$["jalview.appletgui.AnnotationLabels"].ap.repaint ();
+}, "java.awt.event.ItemEvent");
+c$ = Clazz_p0p ();
+};
+c$.$AnnotationLabels$4$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_declareAnonymous (jalview.appletgui, "AnnotationLabels$4", null, java.awt.event.ItemListener);
+Clazz_overrideMethod (c$, "itemStateChanged", 
+function (e) {
+this.f$.aaa.groupRef.setshowSequenceLogo (this.f$.cprofl.getState ());
+this.b$["jalview.appletgui.AnnotationLabels"].ap.repaint ();
+}, "java.awt.event.ItemEvent");
+c$ = Clazz_p0p ();
+};
+c$.$AnnotationLabels$5$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_declareAnonymous (jalview.appletgui, "AnnotationLabels$5", null, java.awt.event.ItemListener);
+Clazz_overrideMethod (c$, "itemStateChanged", 
+function (e) {
+this.f$.aaa.groupRef.setshowSequenceLogo (true);
+this.f$.aaa.groupRef.setNormaliseSequenceLogo (this.f$.cprofn.getState ());
+this.b$["jalview.appletgui.AnnotationLabels"].ap.repaint ();
+}, "java.awt.event.ItemEvent");
+c$ = Clazz_p0p ();
+};
+c$.$AnnotationLabels$6$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_declareAnonymous (jalview.appletgui, "AnnotationLabels$6", null, java.awt.event.ItemListener);
+Clazz_overrideMethod (c$, "itemStateChanged", 
+function (e) {
+this.b$["jalview.appletgui.AnnotationLabels"].av.setShowConsensusHistogram (this.f$.chist.getState ());
+this.b$["jalview.appletgui.AnnotationLabels"].ap.alignFrame.showConsensusHistogram.setState (this.f$.chist.getState ());
+this.b$["jalview.appletgui.AnnotationLabels"].ap.repaint ();
+}, "java.awt.event.ItemEvent");
+c$ = Clazz_p0p ();
+};
+c$.$AnnotationLabels$7$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_declareAnonymous (jalview.appletgui, "AnnotationLabels$7", null, java.awt.event.ItemListener);
+Clazz_overrideMethod (c$, "itemStateChanged", 
+function (e) {
+this.b$["jalview.appletgui.AnnotationLabels"].av.setShowSequenceLogo (this.f$.cprof.getState ());
+this.b$["jalview.appletgui.AnnotationLabels"].ap.alignFrame.showSequenceLogo.setState (this.f$.cprof.getState ());
+this.b$["jalview.appletgui.AnnotationLabels"].ap.repaint ();
+}, "java.awt.event.ItemEvent");
+c$ = Clazz_p0p ();
+};
+c$.$AnnotationLabels$8$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_declareAnonymous (jalview.appletgui, "AnnotationLabels$8", null, java.awt.event.ItemListener);
+Clazz_overrideMethod (c$, "itemStateChanged", 
+function (e) {
+this.b$["jalview.appletgui.AnnotationLabels"].av.setShowSequenceLogo (true);
+this.b$["jalview.appletgui.AnnotationLabels"].ap.alignFrame.normSequenceLogo.setState (this.f$.cprofn.getState ());
+this.b$["jalview.appletgui.AnnotationLabels"].av.setNormaliseSequenceLogo (this.f$.cprofn.getState ());
+this.b$["jalview.appletgui.AnnotationLabels"].ap.repaint ();
+}, "java.awt.event.ItemEvent");
+c$ = Clazz_p0p ();
+};
+Clazz_defineStatics (c$,
+"ADDNEW", "Add New Row",
+"EDITNAME", "Edit Label/Description",
+"HIDE", "Hide This Row",
+"SHOWALL", "Show All Hidden Rows",
+"OUTPUT_TEXT", "Show Values In Textbox",
+"COPYCONS_SEQ", "Copy Consensus Sequence");
+});
+Clazz_declarePackage ("awt2swing");
+Clazz_load (["javax.swing.JCheckBox"], "awt2swing.Checkbox", null, function () {
+c$ = Clazz_declareType (awt2swing, "Checkbox", javax.swing.JCheckBox);
+Clazz_defineMethod (c$, "getState", 
+function () {
+return this.isSelected ();
+});
+Clazz_defineMethod (c$, "setState", 
+function (b) {
+this.setSelected (b);
+}, "~B");
+});
+Clazz_declarePackage ("jalview.appletgui");
+Clazz_load (["awt2swing.Panel", "java.awt.event.ActionListener", "$.MouseListener", "awt2swing.Button", "$.TextArea", "java.awt.BorderLayout"], "jalview.appletgui.CutAndPasteTransfer", ["awt2swing.Frame", "$.Label", "jalview.analysis.AlignmentUtils", "jalview.api.ComplexAlignFile", "jalview.appletgui.AlignFrame", "$.AppletJmol", "$.JVDialog", "$.SplitFrame", "jalview.datamodel.PDBEntry", "jalview.io.AnnotationFile", "$.AppletFormatAdapter", "$.IdentifyFile", "$.NewickFile", "jalview.jsdev.GenericFileAdapter", "jalview.schemes.TCoffeeColourScheme", "jalview.util.MessageManager", "java.awt.Font"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.pdbImport = false;
+this.treeImport = false;
+this.annotationImport = false;
+this.seq = null;
+this.alignFrame = null;
+this.source = null;
+this.textarea = null;
+this.accept = null;
+this.addSequences = null;
+this.$cancel = null;
+this.buttonPanel = null;
+this.borderLayout1 = null;
+Clazz_instantialize (this, arguments);
+}, jalview.appletgui, "CutAndPasteTransfer", awt2swing.Panel, [java.awt.event.ActionListener, java.awt.event.MouseListener]);
+Clazz_prepareFields (c$, function () {
+this.textarea =  new awt2swing.TextArea ();
+this.accept =  new awt2swing.Button ("New Window");
+this.addSequences =  new awt2swing.Button ("Add to Current Alignment");
+this.$cancel =  new awt2swing.Button ("Close");
+this.buttonPanel =  new awt2swing.Panel ();
+this.borderLayout1 =  new java.awt.BorderLayout ();
+});
+Clazz_makeConstructor (c$, 
+function (forImport, alignFrame) {
+Clazz_superConstructor (this, jalview.appletgui.CutAndPasteTransfer, []);
+try {
+this.jbInit ();
+} catch (e) {
+if (Clazz_exceptionOf (e, Exception)) {
+e.printStackTrace ();
+} else {
+throw e;
+}
+}
+this.alignFrame = alignFrame;
+if (!forImport) {
+this.buttonPanel.setVisible (false);
+}}, "~B,jalview.appletgui.AlignFrame");
+Clazz_defineMethod (c$, "getText", 
+function () {
+return this.textarea.getText ();
+});
+Clazz_defineMethod (c$, "setText", 
+function (text) {
+this.textarea.setText (text);
+}, "~S");
+Clazz_defineMethod (c$, "setPDBImport", 
+function (seq) {
+this.seq = seq;
+this.accept.setLabel (jalview.util.MessageManager.getString ("action.accept"));
+this.addSequences.setVisible (false);
+this.pdbImport = true;
+}, "jalview.datamodel.SequenceI");
+Clazz_defineMethod (c$, "setTreeImport", 
+function () {
+this.treeImport = true;
+this.accept.setLabel (jalview.util.MessageManager.getString ("action.accept"));
+this.addSequences.setVisible (false);
+});
+Clazz_defineMethod (c$, "setAnnotationImport", 
+function () {
+this.annotationImport = true;
+this.accept.setLabel (jalview.util.MessageManager.getString ("action.accept"));
+this.addSequences.setVisible (false);
+});
+Clazz_overrideMethod (c$, "actionPerformed", 
+function (evt) {
+if (evt.getSource () === this.accept) {
+this.ok (true);
+} else if (evt.getSource () === this.addSequences) {
+this.ok (false);
+} else if (evt.getSource () === this.$cancel) {
+this.cancel ();
+}}, "java.awt.event.ActionEvent");
+Clazz_defineMethod (c$, "ok", 
+function (newWindow) {
+var text = this.getText ();
+var length = text.length;
+this.textarea.append ("\n");
+if (this.textarea.getText ().length == length) {
+var warning = "\n\n#################################################\nWARNING!! THIS IS THE MAXIMUM SIZE OF TEXTAREA!!\n\nCAN\'T INPUT FULL ALIGNMENT\n\nYOU MUST DELETE THIS WARNING TO CONTINUE\n\nMAKE SURE LAST SEQUENCE PASTED IS COMPLETE\n#################################################\n";
+this.textarea.setText (text.substring (0, text.length - warning.length) + warning);
+this.textarea.setCaretPosition (text.length);
+}if (this.pdbImport) {
+this.openPdbViewer (text);
+} else if (this.treeImport) {
+if (!this.loadTree ()) {
+return;
+}} else if (this.annotationImport) {
+this.loadAnnotations ();
+} else if (this.alignFrame != null) {
+this.loadAlignment (text, newWindow, this.alignFrame.getAlignViewport ());
+}if (Clazz_instanceOf (this.getParent (), awt2swing.Frame)) {
+(this.getParent ()).setVisible (false);
+} else {
+(this.getParent ()).setVisible (false);
+}}, "~B");
+Clazz_defineMethod (c$, "loadTree", 
+function () {
+try {
+var fin =  new jalview.io.NewickFile (this.textarea.getText (), "Paste");
+fin.parse ();
+if (fin.getTree () != null) {
+this.alignFrame.loadTree (fin, "Pasted tree file");
+return true;
+}} catch (ex) {
+if (Clazz_exceptionOf (ex, Exception)) {
+this.textarea.setText (jalview.util.MessageManager.formatMessage ("label.could_not_parse_newick_file",  Clazz_newArray (-1, [ex.getMessage ()])));
+return false;
+} else {
+throw ex;
+}
+}
+return false;
+});
+Clazz_defineMethod (c$, "loadAlignment", 
+function (text, newWindow, viewport) {
+var al = null;
+var format =  new jalview.io.IdentifyFile ().Identify (text, jalview.io.AppletFormatAdapter.PASTE);
+var afa =  new jalview.io.AppletFormatAdapter (this.alignFrame.alignPanel);
+try {
+al = afa.readFile (text, jalview.io.AppletFormatAdapter.PASTE, format);
+this.source = afa.getAlignFile ();
+} catch (ex) {
+if (Clazz_exceptionOf (ex, java.io.IOException)) {
+ex.printStackTrace ();
+} else {
+throw ex;
+}
+}
+if (al != null) {
+al.setDataset (null);
+var allowSplitFrame = this.alignFrame.viewport.applet.getDefaultParameter ("enableSplitFrame", false);
+if (allowSplitFrame && this.openSplitFrame (al, format)) {
+return;
+}if (newWindow) {
+var af;
+if (Clazz_instanceOf (this.source, jalview.api.ComplexAlignFile)) {
+var colSel = (this.source).getColumnSelection ();
+var hiddenSeqs = (this.source).getHiddenSequences ();
+var showSeqFeatures = (this.source).isShowSeqFeatures ();
+var cs = (this.source).getColourScheme ();
+af =  new jalview.appletgui.AlignFrame (al, hiddenSeqs, colSel, this.alignFrame.viewport.applet, "Cut & Paste input - " + format, false);
+af.getAlignViewport ().setShowSequenceFeatures (showSeqFeatures);
+af.changeColour (cs);
+} else {
+af =  new jalview.appletgui.AlignFrame (al, this.alignFrame.viewport.applet, "Cut & Paste input - " + format, false);
+}af.setStatus (jalview.util.MessageManager.getString ("label.successfully_pasted_annotation_to_alignment"));
+} else {
+this.alignFrame.addSequences (al.getSequencesArray ());
+this.alignFrame.setStatus (jalview.util.MessageManager.getString ("label.successfully_pasted_alignment_file"));
+}}}, "~S,~B,jalview.appletgui.AlignViewport");
+Clazz_defineMethod (c$, "openSplitFrame", 
+function (al, format) {
+var thisAlignment = this.alignFrame.getAlignViewport ().getAlignment ();
+if (thisAlignment.isNucleotide () == al.isNucleotide ()) {
+return false;
+}var protein = thisAlignment.isNucleotide () ? al : thisAlignment;
+var dna = thisAlignment.isNucleotide () ? thisAlignment : al;
+var mapped = jalview.analysis.AlignmentUtils.mapProteinToCdna (protein, dna);
+if (!mapped) {
+return false;
+}var title = jalview.util.MessageManager.getString ("label.open_split_window");
+var dialog =  new jalview.appletgui.JVDialog (this.getParent (), title, true, 100, 400);
+dialog.ok.setLabel (jalview.util.MessageManager.getString ("action.yes"));
+dialog.cancel.setLabel (jalview.util.MessageManager.getString ("action.no"));
+var question =  new awt2swing.Panel ( new java.awt.BorderLayout ());
+var text = jalview.util.MessageManager.getString ("label.open_split_window?");
+question.add ( new awt2swing.Label (text, 0), "Center");
+dialog.setMainPanel (question);
+dialog.setVisible (true);
+dialog.toFront ();
+if (!dialog.accept) {
+return false;
+}var applet = this.alignFrame.viewport.applet;
+var copyFrame =  new jalview.appletgui.AlignFrame (this.alignFrame.viewport.getAlignment (), applet, this.alignFrame.getTitle (), false, false);
+var newFrame =  new jalview.appletgui.AlignFrame (al, this.alignFrame.viewport.applet, "Cut & Paste input - " + format, false, false);
+var dnaFrame = al.isNucleotide () ? newFrame : copyFrame;
+var proteinFrame = al.isNucleotide () ? copyFrame : newFrame;
+var sf =  new jalview.appletgui.SplitFrame (dnaFrame, proteinFrame);
+sf.addToDisplay (false, applet);
+return true;
+}, "jalview.datamodel.AlignmentI,~S");
+Clazz_defineMethod (c$, "loadAnnotations", 
+function () {
+var tcf = null;
+try {
+tcf = jalview.jsdev.GenericFileAdapter.getFile ("TCoffeeScoreFile", [this.textarea.getText (), jalview.io.AppletFormatAdapter.PASTE]);
+if (tcf.isValid ()) {
+if (tcf.annotateAlignment (this.alignFrame.viewport.getAlignment (), true)) {
+this.alignFrame.tcoffeeColour.setEnabled (true);
+this.alignFrame.alignPanel.fontChanged ();
+this.alignFrame.changeColour ( new jalview.schemes.TCoffeeColourScheme (this.alignFrame.viewport.getAlignment ()));
+this.alignFrame.setStatus (jalview.util.MessageManager.getString ("label.successfully_pasted_tcoffee_scores_to_alignment"));
+} else {
+this.alignFrame.setStatus (jalview.util.MessageManager.formatMessage ("label.failed_add_tcoffee_scores",  Clazz_newArray (-1, [(tcf.getWarningMessage () != null ? tcf.getWarningMessage () : "")])));
+}} else {
+tcf = null;
+}} catch (x) {
+if (Clazz_exceptionOf (x, Exception)) {
+tcf = null;
+} else {
+throw x;
+}
+}
+if (tcf == null) {
+if ( new jalview.io.AnnotationFile ().annotateAlignmentView (this.alignFrame.viewport, this.textarea.getText (), jalview.io.AppletFormatAdapter.PASTE)) {
+this.alignFrame.alignPanel.fontChanged ();
+this.alignFrame.alignPanel.setScrollValues (0, 0);
+this.alignFrame.setStatus (jalview.util.MessageManager.getString ("label.successfully_pasted_annotation_to_alignment"));
+} else {
+if (!this.alignFrame.parseFeaturesFile (this.textarea.getText (), jalview.io.AppletFormatAdapter.PASTE)) {
+this.alignFrame.setStatus (jalview.util.MessageManager.getString ("label.couldnt_parse_pasted_text_as_valid_annotation_feature_GFF_tcoffee_file"));
+}}}});
+Clazz_defineMethod (c$, "openPdbViewer", 
+function (text) {
+var pdb =  new jalview.datamodel.PDBEntry ();
+pdb.setFile (text);
+ new jalview.appletgui.AppletJmol (pdb,  Clazz_newArray (-1, [this.seq]), null, this.alignFrame.alignPanel, jalview.io.AppletFormatAdapter.PASTE);
+}, "~S");
+Clazz_defineMethod (c$, "cancel", 
+function () {
+this.textarea.setText ("");
+if (Clazz_instanceOf (this.getParent (), awt2swing.Frame)) {
+(this.getParent ()).setVisible (false);
+} else {
+(this.getParent ()).setVisible (false);
+}});
+Clazz_defineMethod (c$, "jbInit", 
+ function () {
+this.textarea.setFont ( new java.awt.Font ("Monospaced", 0, 10));
+this.textarea.setText (jalview.util.MessageManager.getString ("label.paste_your_alignment_file"));
+this.textarea.addMouseListener (this);
+this.setLayout (this.borderLayout1);
+this.accept.addActionListener (this);
+this.addSequences.addActionListener (this);
+this.$cancel.addActionListener (this);
+this.add (this.buttonPanel, "South");
+this.buttonPanel.add (this.accept, null);
+this.buttonPanel.add (this.addSequences);
+this.buttonPanel.add (this.$cancel, null);
+this.add (this.textarea, "Center");
+});
+Clazz_overrideMethod (c$, "mousePressed", 
+function (evt) {
+if (this.textarea.getText ().startsWith (jalview.util.MessageManager.getString ("label.paste_your"))) {
+this.textarea.setText ("");
+}}, "java.awt.event.MouseEvent");
+Clazz_overrideMethod (c$, "mouseReleased", 
+function (evt) {
+}, "java.awt.event.MouseEvent");
+Clazz_overrideMethod (c$, "mouseClicked", 
+function (evt) {
+}, "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 ("awt2swing");
+Clazz_load (["javax.swing.JButton"], "awt2swing.Button", null, function () {
+c$ = Clazz_declareType (awt2swing, "Button", javax.swing.JButton);
+});
+Clazz_declarePackage ("awt2swing");
+Clazz_load (["javax.swing.JTextArea"], "awt2swing.TextArea", null, function () {
+c$ = Clazz_declareType (awt2swing, "TextArea", javax.swing.JTextArea);
+});
+Clazz_declarePackage ("javax.swing");
+Clazz_load (["javax.swing.text.JTextComponent"], "javax.swing.JTextArea", ["java.lang.IllegalArgumentException", "java.awt.Dimension", "javax.swing.JComponent", "$.LookAndFeel", "javax.swing.text.BadLocationException", "$.JSMinimalAbstractDocument", "swingjs.JSToolkit"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.rows = 0;
+this.columns = 0;
+this.columnWidth = 0;
+this.rowHeight = 0;
+this.wrap = false;
+this.word = false;
+Clazz_instantialize (this, arguments);
+}, javax.swing, "JTextArea", javax.swing.text.JTextComponent);
+Clazz_makeConstructor (c$, 
+function () {
+this.construct (null, null, 0, 0);
+});
+Clazz_makeConstructor (c$, 
+function (text) {
+this.construct (null, text, 0, 0);
+}, "~S");
+Clazz_makeConstructor (c$, 
+function (rows, columns) {
+this.construct (null, null, rows, columns);
+}, "~N,~N");
+Clazz_makeConstructor (c$, 
+function (text, rows, columns) {
+this.construct (null, text, rows, columns);
+}, "~S,~N,~N");
+Clazz_makeConstructor (c$, 
+function (doc) {
+this.construct (doc, null, 0, 0);
+}, "javax.swing.text.Document");
+Clazz_makeConstructor (c$, 
+function (doc, text, rows, columns) {
+Clazz_superConstructor (this, javax.swing.JTextArea);
+this.rows = rows;
+this.columns = columns;
+if (doc == null) {
+doc = this.createDefaultModel ();
+}this.setDocument (doc);
+if (text != null) {
+this.setText (text);
+this.select (0, 0);
+}if (rows < 0) {
+throw  new IllegalArgumentException ("rows: " + rows);
+}if (columns < 0) {
+throw  new IllegalArgumentException ("columns: " + columns);
+}javax.swing.LookAndFeel.installProperty (this, "focusTraversalKeysForward", javax.swing.JComponent.getManagingFocusForwardTraversalKeys ());
+javax.swing.LookAndFeel.installProperty (this, "focusTraversalKeysBackward", javax.swing.JComponent.getManagingFocusBackwardTraversalKeys ());
+}, "javax.swing.text.Document,~S,~N,~N");
+Clazz_overrideMethod (c$, "getUIClassID", 
+function () {
+return "TextAreaUI";
+});
+Clazz_defineMethod (c$, "createDefaultModel", 
+function () {
+return swingjs.JSToolkit.getPlainDocument (this);
+});
+Clazz_defineMethod (c$, "setTabSize", 
+function (size) {
+var doc = this.getDocument ();
+if (doc != null) {
+var old = this.getTabSize ();
+doc.putProperty ("tabSize",  new Integer (size));
+this.firePropertyChangeInt ("tabSize", old, size);
+}}, "~N");
+Clazz_defineMethod (c$, "getTabSize", 
+function () {
+var size = 8;
+var doc = this.getDocument ();
+if (doc != null) {
+var i = doc.getProperty ("tabSize");
+if (i != null) {
+size = i.intValue ();
+}}return size;
+});
+Clazz_defineMethod (c$, "setLineWrap", 
+function (wrap) {
+var old = this.wrap;
+this.wrap = wrap;
+this.firePropertyChangeBool ("lineWrap", old, wrap);
+}, "~B");
+Clazz_defineMethod (c$, "getLineWrap", 
+function () {
+return this.wrap;
+});
+Clazz_defineMethod (c$, "setWrapStyleWord", 
+function (word) {
+var old = this.word;
+this.word = word;
+this.firePropertyChangeBool ("wrapStyleWord", old, word);
+}, "~B");
+Clazz_defineMethod (c$, "getWrapStyleWord", 
+function () {
+return this.word;
+});
+Clazz_defineMethod (c$, "getLineOfOffset", 
+function (offset) {
+var doc = this.getDocument ();
+if (offset < 0) {
+throw  new javax.swing.text.BadLocationException ("Can't translate offset to line", -1);
+} else if (offset > doc.getLength ()) {
+throw  new javax.swing.text.BadLocationException ("Can't translate offset to line", doc.getLength () + 1);
+} else {
+var map = this.getDocument ().getDefaultRootElement ();
+return map.getElementIndex (offset);
+}}, "~N");
+Clazz_defineMethod (c$, "getLineCount", 
+function () {
+var map = this.getDocument ().getDefaultRootElement ();
+return map.getElementCount ();
+});
+Clazz_defineMethod (c$, "getLineStartOffset", 
+function (line) {
+var lineCount = this.getLineCount ();
+if (line < 0) {
+throw  new javax.swing.text.BadLocationException ("Negative line", -1);
+} else if (line >= lineCount) {
+throw  new javax.swing.text.BadLocationException ("No such line", this.getDocument ().getLength () + 1);
+} else {
+var map = this.getDocument ().getDefaultRootElement ();
+var lineElem = map.getElement (line);
+return lineElem.getStartOffset ();
+}}, "~N");
+Clazz_defineMethod (c$, "getLineEndOffset", 
+function (line) {
+var lineCount = this.getLineCount ();
+if (line < 0) {
+throw  new javax.swing.text.BadLocationException ("Negative line", -1);
+} else if (line >= lineCount) {
+throw  new javax.swing.text.BadLocationException ("No such line", this.getDocument ().getLength () + 1);
+} else {
+var map = this.getDocument ().getDefaultRootElement ();
+var lineElem = map.getElement (line);
+var endOffset = lineElem.getEndOffset ();
+return ((line == lineCount - 1) ? (endOffset - 1) : endOffset);
+}}, "~N");
+Clazz_defineMethod (c$, "insert", 
+function (str, pos) {
+var doc = this.getDocument ();
+if (doc != null) {
+try {
+doc.insertString (pos, str, null);
+} catch (e) {
+if (Clazz_exceptionOf (e, javax.swing.text.BadLocationException)) {
+throw  new IllegalArgumentException (e.getMessage ());
+} else {
+throw e;
+}
+}
+}}, "~S,~N");
+Clazz_defineMethod (c$, "append", 
+function (str) {
+var doc = this.getDocument ();
+if (doc != null) {
+try {
+doc.insertString (doc.getLength (), str, null);
+} catch (e) {
+if (Clazz_exceptionOf (e, javax.swing.text.BadLocationException)) {
+} else {
+throw e;
+}
+}
+}}, "~S");
+Clazz_defineMethod (c$, "replaceRange", 
+function (str, start, end) {
+if (end < start) {
+throw  new IllegalArgumentException ("end before start");
+}var doc = this.getDocument ();
+if (doc != null) {
+try {
+if (Clazz_instanceOf (doc, javax.swing.text.JSMinimalAbstractDocument)) {
+(doc).replace (start, end - start, str, null);
+} else {
+doc.remove (start, end - start);
+doc.insertString (start, str, null);
+}} catch (e) {
+if (Clazz_exceptionOf (e, javax.swing.text.BadLocationException)) {
+throw  new IllegalArgumentException (e.getMessage ());
+} else {
+throw e;
+}
+}
+}}, "~S,~N,~N");
+Clazz_defineMethod (c$, "getRows", 
+function () {
+return this.rows;
+});
+Clazz_defineMethod (c$, "setRows", 
+function (rows) {
+var oldVal = this.rows;
+if (rows < 0) {
+throw  new IllegalArgumentException ("rows less than zero.");
+}if (rows != oldVal) {
+this.rows = rows;
+this.invalidate ();
+}}, "~N");
+Clazz_defineMethod (c$, "getRowHeight", 
+function () {
+if (this.rowHeight == 0) {
+var metrics = this.getFontMetrics (this.getFont ());
+this.rowHeight = metrics.getHeight ();
+}return this.rowHeight;
+});
+Clazz_defineMethod (c$, "getColumns", 
+function () {
+return this.columns;
+});
+Clazz_defineMethod (c$, "setColumns", 
+function (columns) {
+var oldVal = this.columns;
+if (columns < 0) {
+throw  new IllegalArgumentException ("columns less than zero.");
+}if (columns != oldVal) {
+this.columns = columns;
+this.invalidate ();
+}}, "~N");
+Clazz_defineMethod (c$, "getColumnWidth", 
+function () {
+if (this.columnWidth == 0) {
+var metrics = this.getFontMetrics (this.getFont ());
+this.columnWidth = metrics.charWidth ('m');
+}return this.columnWidth;
+});
+Clazz_overrideMethod (c$, "getPreferredSize", 
+function () {
+var d = this.getPrefSizeJComp ();
+d = (d == null) ?  new java.awt.Dimension (400, 400) : d;
+var insets = this.getInsets ();
+if (this.columns != 0) {
+d.width = Math.max (d.width, this.columns * this.getColumnWidth () + insets.left + insets.right);
+}if (this.rows != 0) {
+d.height = Math.max (d.height, this.rows * this.getRowHeight () + insets.top + insets.bottom);
+}return d;
+});
+Clazz_defineMethod (c$, "setFont", 
+function (f) {
+Clazz_superCall (this, javax.swing.JTextArea, "setFont", [f]);
+this.rowHeight = 0;
+this.columnWidth = 0;
+}, "java.awt.Font");
+Clazz_defineMethod (c$, "paramString", 
+function () {
+var wrapString = (this.wrap ? "true" : "false");
+var wordString = (this.word ? "true" : "false");
+return Clazz_superCall (this, javax.swing.JTextArea, "paramString", []) + ",colums=" + this.columns + ",columWidth=" + this.columnWidth + ",rows=" + this.rows + ",rowHeight=" + this.rowHeight + ",word=" + wordString + ",wrap=" + wrapString;
+});
+Clazz_defineMethod (c$, "getScrollableTracksViewportWidth", 
+function () {
+return (this.wrap) ? true : Clazz_superCall (this, javax.swing.JTextArea, "getScrollableTracksViewportWidth", []);
+});
+Clazz_defineMethod (c$, "getPreferredScrollableViewportSize", 
+function () {
+var size = Clazz_superCall (this, javax.swing.JTextArea, "getPreferredScrollableViewportSize", []);
+size = (size == null) ?  new java.awt.Dimension (400, 400) : size;
+var insets = this.getInsets ();
+size.width = (this.columns == 0) ? size.width : this.columns * this.getColumnWidth () + insets.left + insets.right;
+size.height = (this.rows == 0) ? size.height : this.rows * this.getRowHeight () + insets.top + insets.bottom;
+return size;
+});
+Clazz_overrideMethod (c$, "getScrollableUnitIncrement", 
+function (visibleRect, orientation, direction) {
+switch (orientation) {
+case 1:
+return this.getRowHeight ();
+case 0:
+return this.getColumnWidth ();
+default:
+throw  new IllegalArgumentException ("Invalid orientation: " + orientation);
+}
+}, "java.awt.Rectangle,~N,~N");
+Clazz_defineStatics (c$,
+"$uiClassID", "TextAreaUI");
+});
+Clazz_declarePackage ("jalview.api");
+Clazz_declareInterface (jalview.api, "ComplexAlignFile");
+Clazz_declarePackage ("jalview.appletgui");
+Clazz_load (["awt2swing.Panel", "java.awt.Dimension", "java.util.ArrayList"], "jalview.appletgui.AppletJmol", null, function () {
+c$ = Clazz_decorateAsClass (function () {
+this.scriptWindow = null;
+this.inputLine = null;
+this.history = null;
+this.renderPanel = null;
+this.ap = null;
+this._aps = null;
+this.fileLoadingError = null;
+this.loadedInline = false;
+this.fr = null;
+this.jmb = null;
+if (!Clazz_isClassDefined ("jalview.appletgui.AppletJmol.RenderPanel")) {
+jalview.appletgui.AppletJmol.$AppletJmol$RenderPanel$ ();
+}
+Clazz_instantialize (this, arguments);
+}, jalview.appletgui, "AppletJmol");
+Clazz_prepareFields (c$, function () {
+this._aps =  new java.util.ArrayList ();
+});
+Clazz_makeConstructor (c$, 
+function (entry, sequenceIs, object, ap2, uRL) {
+}, "jalview.datamodel.PDBEntry,~A,~O,jalview.appletgui.AlignmentPanel,~S");
+Clazz_defineMethod (c$, "setJalviewColourScheme", 
+function (ucs) {
+}, "jalview.schemes.UserColourScheme");
+c$.$AppletJmol$RenderPanel$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_decorateAsClass (function () {
+Clazz_prepareCallback (this, arguments);
+this.currentSize = null;
+Clazz_instantialize (this, arguments);
+}, jalview.appletgui.AppletJmol, "RenderPanel", awt2swing.Panel);
+Clazz_prepareFields (c$, function () {
+this.currentSize =  new java.awt.Dimension ();
+});
+Clazz_overrideMethod (c$, "update", 
+function (a) {
+this.paint (a);
+}, "java.awt.Graphics");
+Clazz_defineMethod (c$, "PaintComponent", 
+function (a) {
+this.currentSize = this.getSize ();
+}, "java.awt.Graphics");
+c$ = Clazz_p0p ();
+};
+});
+Clazz_declarePackage ("jalview.appletgui");
+Clazz_load (["java.awt.Dialog", "java.awt.event.ActionListener", "awt2swing.Button"], "jalview.appletgui.JVDialog", ["awt2swing.Panel", "java.awt.FlowLayout"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.ap = null;
+this.buttonPanel = null;
+this.ok = null;
+this.cancel = null;
+this.accept = false;
+this.owner = null;
+Clazz_instantialize (this, arguments);
+}, jalview.appletgui, "JVDialog", java.awt.Dialog, java.awt.event.ActionListener);
+Clazz_prepareFields (c$, function () {
+this.ok =  new awt2swing.Button ("Accept");
+this.cancel =  new awt2swing.Button ("Cancel");
+});
+Clazz_makeConstructor (c$, 
+function (owner, title, modal, width, height) {
+Clazz_superConstructor (this, jalview.appletgui.JVDialog, [owner, title, modal]);
+this.owner = owner;
+height += owner.getInsets ().top + this.getInsets ().bottom;
+this.setBounds (owner.getBounds ().x + Clazz_doubleToInt ((owner.getSize ().width - width) / 2), owner.getBounds ().y + Clazz_doubleToInt ((owner.getSize ().height - height) / 2), width, height);
+}, "awt2swing.Frame,~S,~B,~N,~N");
+Clazz_defineMethod (c$, "setMainPanel", 
+function (panel) {
+this.add (panel, "North");
+this.buttonPanel =  new awt2swing.Panel ( new java.awt.FlowLayout ());
+this.buttonPanel.add (this.ok);
+this.buttonPanel.add (this.cancel);
+this.ok.addActionListener (this);
+this.cancel.addActionListener (this);
+this.add (this.buttonPanel, "South");
+this.pack ();
+}, "awt2swing.Panel");
+Clazz_overrideMethod (c$, "actionPerformed", 
+function (evt) {
+if (evt.getSource () === this.ok) {
+this.accept = true;
+}this.setVisible (false);
+}, "java.awt.event.ActionEvent");
+});
+Clazz_declarePackage ("jalview.appletgui");
+Clazz_load (["jalview.appletgui.EmbmenuFrame"], "jalview.appletgui.SplitFrame", ["awt2swing.Panel", "jalview.analysis.AlignmentUtils", "jalview.bin.JalviewLite", "jalview.structure.StructureSelectionManager", "java.awt.BorderLayout", "$.Dimension", "$.GridLayout"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.topFrame = null;
+this.bottomFrame = null;
+this.outermost = null;
+Clazz_instantialize (this, arguments);
+}, jalview.appletgui, "SplitFrame", jalview.appletgui.EmbmenuFrame);
+Clazz_makeConstructor (c$, 
+function (af1, af2) {
+Clazz_superConstructor (this, jalview.appletgui.SplitFrame, []);
+this.topFrame = af1;
+this.bottomFrame = af2;
+this.init ();
+}, "jalview.appletgui.AlignFrame,jalview.appletgui.AlignFrame");
+Clazz_defineMethod (c$, "init", 
+function () {
+var $private = Clazz_checkPrivateMethod (arguments);
+if ($private != null) {
+return $private.apply (this, arguments);
+}
+this.constructSplit ();
+var topViewport = this.topFrame.viewport;
+var bottomViewport = this.bottomFrame.viewport;
+var topAlignment = topViewport.getAlignment ();
+var bottomAlignment = bottomViewport.getAlignment ();
+var cdna = topAlignment.isNucleotide () ? topViewport : (bottomAlignment.isNucleotide () ? bottomViewport : null);
+var protein = !topAlignment.isNucleotide () ? topViewport : (!bottomAlignment.isNucleotide () ? bottomViewport : null);
+var mapped = jalview.analysis.AlignmentUtils.mapProteinToCdna (protein.getAlignment (), cdna.getAlignment ());
+if (mapped) {
+var ssm = jalview.structure.StructureSelectionManager.getStructureSelectionManager (topViewport.applet);
+ssm.addMappings (protein.getAlignment ().getCodonFrames ());
+topViewport.setCodingComplement (bottomViewport);
+ssm.addCommandListener (cdna);
+ssm.addCommandListener (protein);
+}protein.initComplementConsensus ();
+var ap = topAlignment.isNucleotide () ? this.bottomFrame.alignPanel : this.topFrame.alignPanel;
+protein.updateConsensus (ap);
+this.adjustLayout ();
+});
+Clazz_defineMethod (c$, "constructSplit", 
+function () {
+this.unsetMenuBar ();
+this.outermost =  new awt2swing.Panel ( new java.awt.GridLayout (2, 1));
+var topPanel =  new awt2swing.Panel ();
+var bottomPanel =  new awt2swing.Panel ();
+this.outermost.add (topPanel);
+this.outermost.add (bottomPanel);
+this.addAlignFrameComponents (this.topFrame, topPanel);
+this.addAlignFrameComponents (this.bottomFrame, bottomPanel);
+});
+Clazz_defineMethod (c$, "adjustLayout", 
+function () {
+var cdna = this.topFrame.getAlignViewport ().getAlignment ().isNucleotide () ? this.topFrame.viewport : this.bottomFrame.viewport;
+var protein = cdna === this.topFrame.viewport ? this.bottomFrame.viewport : this.topFrame.viewport;
+var w1 = this.topFrame.alignPanel.idPanel.idCanvas.getWidth ();
+var w2 = this.bottomFrame.alignPanel.idPanel.idCanvas.getWidth ();
+var w3 = Math.max (w1, w2);
+if (w1 != w3) {
+var d = this.topFrame.alignPanel.idPanel.idCanvas.getSize ();
+this.topFrame.alignPanel.idPanel.idCanvas.setSize ( new java.awt.Dimension (w3, d.height));
+}if (w2 != w3) {
+var d = this.bottomFrame.alignPanel.idPanel.idCanvas.getSize ();
+this.bottomFrame.alignPanel.idPanel.idCanvas.setSize ( new java.awt.Dimension (w3, d.height));
+}if (protein != null && cdna != null) {
+var vs = protein.getViewStyle ();
+var scale = vs.isScaleProteinAsCdna () ? 3 : 1;
+vs.setCharWidth (scale * cdna.getViewStyle ().getCharWidth ());
+protein.setViewStyle (vs);
+}});
+Clazz_defineMethod (c$, "addAlignFrameComponents", 
+ function (af, panel) {
+panel.setLayout ( new java.awt.BorderLayout ());
+var menuPanel = af.makeEmbeddedPopupMenu (af.getJMenuBar (), true, false);
+panel.add (menuPanel, "North");
+panel.add (af.statusBar, "South");
+panel.add (af.alignPanel, "Center");
+af.setSplitFrame (this);
+}, "jalview.appletgui.AlignFrame,awt2swing.Panel");
+Clazz_defineMethod (c$, "addToDisplay", 
+function (embedded, applet) {
+this.createSplitFrameWindow (embedded, applet);
+this.validate ();
+this.topFrame.alignPanel.adjustAnnotationHeight ();
+this.topFrame.alignPanel.paintAlignment (true);
+this.bottomFrame.alignPanel.adjustAnnotationHeight ();
+this.bottomFrame.alignPanel.paintAlignment (true);
+}, "~B,jalview.bin.JalviewLite");
+Clazz_defineMethod (c$, "createSplitFrameWindow", 
+function (embed, applet) {
+if (embed) {
+applet.add (this.outermost);
+applet.validate ();
+} else {
+this.add (this.outermost);
+var width = Math.max (this.topFrame.frameWidth, this.bottomFrame.frameWidth);
+var height = this.topFrame.frameHeight + this.bottomFrame.frameHeight;
+jalview.bin.JalviewLite.addFrame (this, this.getTitle (), width, height);
+}}, "~B,jalview.bin.JalviewLite");
+Clazz_defineMethod (c$, "getComplement", 
+function (af) {
+if (this.topFrame === af) {
+return this.bottomFrame;
+} else if (this.bottomFrame === af) {
+return this.topFrame;
+}return null;
+}, "jalview.appletgui.AlignFrame");
+});
+Clazz_declarePackage ("java.awt");
+Clazz_load (["java.awt.LayoutManager"], "java.awt.GridLayout", ["java.lang.IllegalArgumentException", "java.awt.Dimension"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.hgap = 0;
+this.vgap = 0;
+this.rows = 0;
+this.cols = 0;
+Clazz_instantialize (this, arguments);
+}, java.awt, "GridLayout", null, [java.awt.LayoutManager, java.io.Serializable]);
+Clazz_makeConstructor (c$, 
+function () {
+this.construct (1, 0, 0, 0);
+});
+Clazz_makeConstructor (c$, 
+function (rows, cols) {
+this.construct (rows, cols, 0, 0);
+}, "~N,~N");
+Clazz_makeConstructor (c$, 
+function (rows, cols, hgap, vgap) {
+if ((rows == 0) && (cols == 0)) {
+throw  new IllegalArgumentException ("rows and cols cannot both be zero");
+}this.rows = rows;
+this.cols = cols;
+this.hgap = hgap;
+this.vgap = vgap;
+}, "~N,~N,~N,~N");
+Clazz_defineMethod (c$, "getRows", 
+function () {
+return this.rows;
+});
+Clazz_defineMethod (c$, "setRows", 
+function (rows) {
+if ((rows == 0) && (this.cols == 0)) {
+throw  new IllegalArgumentException ("rows and cols cannot both be zero");
+}this.rows = rows;
+}, "~N");
+Clazz_defineMethod (c$, "getColumns", 
+function () {
+return this.cols;
+});
+Clazz_defineMethod (c$, "setColumns", 
+function (cols) {
+if ((cols == 0) && (this.rows == 0)) {
+throw  new IllegalArgumentException ("rows and cols cannot both be zero");
+}this.cols = cols;
+}, "~N");
+Clazz_defineMethod (c$, "getHgap", 
+function () {
+return this.hgap;
+});
+Clazz_defineMethod (c$, "setHgap", 
+function (hgap) {
+this.hgap = hgap;
+}, "~N");
+Clazz_defineMethod (c$, "getVgap", 
+function () {
+return this.vgap;
+});
+Clazz_defineMethod (c$, "setVgap", 
+function (vgap) {
+this.vgap = vgap;
+}, "~N");
+Clazz_overrideMethod (c$, "addLayoutComponent", 
+function (name, comp) {
+}, "~S,java.awt.Component");
+Clazz_overrideMethod (c$, "removeLayoutComponent", 
+function (comp) {
+}, "java.awt.Component");
+Clazz_overrideMethod (c$, "preferredLayoutSize", 
+function (parent) {
+{
+var insets = parent.getInsets ();
+var ncomponents = parent.getComponentCount ();
+var nrows = this.rows;
+var ncols = this.cols;
+if (nrows > 0) {
+ncols = Clazz_doubleToInt ((ncomponents + nrows - 1) / nrows);
+} else {
+nrows = Clazz_doubleToInt ((ncomponents + ncols - 1) / ncols);
+}var w = 0;
+var h = 0;
+for (var i = 0; i < ncomponents; i++) {
+var comp = parent.getComponent (i);
+var d = comp.getPreferredSize ();
+if (w < d.width) {
+w = d.width;
+}if (h < d.height) {
+h = d.height;
+}}
+return  new java.awt.Dimension (insets.left + insets.right + ncols * w + (ncols - 1) * this.hgap, insets.top + insets.bottom + nrows * h + (nrows - 1) * this.vgap);
+}}, "java.awt.Container");
+Clazz_overrideMethod (c$, "minimumLayoutSize", 
+function (parent) {
+{
+var insets = parent.getInsets ();
+var ncomponents = parent.getComponentCount ();
+var nrows = this.rows;
+var ncols = this.cols;
+if (nrows > 0) {
+ncols = Clazz_doubleToInt ((ncomponents + nrows - 1) / nrows);
+} else {
+nrows = Clazz_doubleToInt ((ncomponents + ncols - 1) / ncols);
+}var w = 0;
+var h = 0;
+for (var i = 0; i < ncomponents; i++) {
+var comp = parent.getComponent (i);
+var d = comp.getMinimumSize ();
+if (w < d.width) {
+w = d.width;
+}if (h < d.height) {
+h = d.height;
+}}
+return  new java.awt.Dimension (insets.left + insets.right + ncols * w + (ncols - 1) * this.hgap, insets.top + insets.bottom + nrows * h + (nrows - 1) * this.vgap);
+}}, "java.awt.Container");
+Clazz_overrideMethod (c$, "layoutContainer", 
+function (parent) {
+{
+var insets = parent.getInsets ();
+var ncomponents = parent.getComponentCount ();
+var nrows = this.rows;
+var ncols = this.cols;
+var ltr = parent.getComponentOrientation ().isLeftToRight ();
+if (ncomponents == 0) {
+return;
+}if (nrows > 0) {
+ncols = Clazz_doubleToInt ((ncomponents + nrows - 1) / nrows);
+} else {
+nrows = Clazz_doubleToInt ((ncomponents + ncols - 1) / ncols);
+}var totalGapsWidth = (ncols - 1) * this.hgap;
+var widthWOInsets = parent.width - (insets.left + insets.right);
+var widthOnComponent = Clazz_doubleToInt ((widthWOInsets - totalGapsWidth) / ncols);
+var extraWidthAvailable = Clazz_doubleToInt ((widthWOInsets - (widthOnComponent * ncols + totalGapsWidth)) / 2);
+var totalGapsHeight = (nrows - 1) * this.vgap;
+var heightWOInsets = parent.height - (insets.top + insets.bottom);
+var heightOnComponent = Clazz_doubleToInt ((heightWOInsets - totalGapsHeight) / nrows);
+var extraHeightAvailable = Clazz_doubleToInt ((heightWOInsets - (heightOnComponent * nrows + totalGapsHeight)) / 2);
+if (ltr) {
+for (var c = 0, x = insets.left + extraWidthAvailable; c < ncols; c++, x += widthOnComponent + this.hgap) {
+for (var r = 0, y = insets.top + extraHeightAvailable; r < nrows; r++, y += heightOnComponent + this.vgap) {
+var i = r * ncols + c;
+if (i < ncomponents) {
+parent.getComponent (i).setBounds (x, y, widthOnComponent, heightOnComponent);
+}}
+}
+} else {
+for (var c = 0, x = (parent.width - insets.right - widthOnComponent) - extraWidthAvailable; c < ncols; c++, x -= widthOnComponent + this.hgap) {
+for (var r = 0, y = insets.top + extraHeightAvailable; r < nrows; r++, y += heightOnComponent + this.vgap) {
+var i = r * ncols + c;
+if (i < ncomponents) {
+parent.getComponent (i).setBounds (x, y, widthOnComponent, heightOnComponent);
+}}
+}
+}}}, "java.awt.Container");
+Clazz_overrideMethod (c$, "toString", 
+function () {
+return this.getClass ().getName () + "[hgap=" + this.hgap + ",vgap=" + this.vgap + ",rows=" + this.rows + ",cols=" + this.cols + "]";
+});
+});
+Clazz_declarePackage ("jalview.io");
+Clazz_load (null, "jalview.io.AnnotationFile", ["jalview.analysis.Conservation", "jalview.datamodel.AlignmentAnnotation", "$.Annotation", "$.ColumnSelection", "$.GraphLine", "$.SequenceGroup", "jalview.io.AppletFormatAdapter", "jalview.jsdev.GenericFileAdapter", "jalview.schemes.ColourSchemeProperty", "$.ResidueProperties", "$.UserColourScheme", "jalview.util.Comparison", "$.Format", "java.awt.Color", "java.io.BufferedReader", "$.InputStreamReader", "$.StringReader", "java.lang.Boolean", "$.Float", "$.StringBuffer", "java.util.ArrayList", "$.BitSet", "$.Date", "$.Hashtable", "$.StringTokenizer", "$.Vector"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.newline = null;
+this.text = null;
+if (!Clazz_isClassDefined ("jalview.io.AnnotationFile.ViewDef")) {
+jalview.io.AnnotationFile.$AnnotationFile$ViewDef$ ();
+}
+this.refSeq = null;
+this.refSeqId = null;
+this.nlinesread = 0;
+this.lastread = "";
+Clazz_instantialize (this, arguments);
+}, jalview.io, "AnnotationFile");
+Clazz_prepareFields (c$, function () {
+this.newline = System.getProperty ("line.separator");
+});
+Clazz_makeConstructor (c$, 
+function () {
+this.init ();
+});
+Clazz_defineMethod (c$, "setNewlineString", 
+function (nl) {
+this.newline = nl;
+this.init ();
+}, "~S");
+Clazz_defineMethod (c$, "getNewlineString", 
+function () {
+return this.newline;
+});
+Clazz_defineMethod (c$, "init", 
+ function () {
+this.text =  new StringBuffer ("JALVIEW_ANNOTATION" + this.newline + "# Created: " +  new java.util.Date () + this.newline + this.newline);
+this.refSeq = null;
+this.refSeqId = null;
+});
+Clazz_defineMethod (c$, "printAnnotations", 
+function (annotations, list, properties) {
+return this.printAnnotations (annotations, list, properties, null, null, null);
+}, "~A,java.util.List,java.util.Hashtable");
+Clazz_defineMethod (c$, "printAnnotations", 
+function (annotations, list, properties, cs, al, view) {
+if (view != null) {
+if (view.viewname != null) {
+this.text.append ("VIEW_DEF\t" + view.viewname + "\n");
+}if (list == null) {
+list = view.visibleGroups;
+}if (cs == null) {
+cs = view.hiddencols;
+}if (al == null) {
+}}if (al != null && al.hasSeqrep ()) {
+this.text.append ("VIEW_SETREF\t" + al.getSeqrep ().getName () + "\n");
+}if (cs != null && cs.hasHiddenColumns ()) {
+this.text.append ("VIEW_HIDECOLS\t");
+var hc = cs.getHiddenColumns ();
+var comma = false;
+for (var r, $r = hc.iterator (); $r.hasNext () && ((r = $r.next ()) || true);) {
+if (!comma) {
+comma = true;
+} else {
+this.text.append (",");
+}this.text.append ("" + r[0]);
+this.text.append ("-");
+this.text.append ("" + r[1]);
+}
+this.text.append ("\n");
+}if (annotations != null) {
+var oneColour = true;
+var row;
+var comma;
+var refSeq = null;
+var refGroup = null;
+var colours =  new StringBuffer ();
+var graphLine =  new StringBuffer ();
+var rowprops =  new StringBuffer ();
+var graphGroup =  new java.util.Hashtable ();
+var graphGroup_refs =  new java.util.Hashtable ();
+var graphGroupSeen =  new java.util.BitSet ();
+var color;
+for (var i = 0; i < annotations.length; i++) {
+row = annotations[i];
+if (!row.visible && !row.hasScore () && !(row.graphGroup > -1 && graphGroupSeen.get (row.graphGroup))) {
+continue;
+}color = null;
+oneColour = true;
+this.writeSequence_Ref (refSeq, row.sequenceRef);
+refSeq = row.sequenceRef;
+this.writeGroup_Ref (refGroup, row.groupRef);
+refGroup = row.groupRef;
+var hasGlyphs = row.hasIcons;
+var hasLabels = row.hasText;
+var hasValues = row.$hasScore;
+var hasText = false;
+for (var j = 0; row.annotations != null && j < row.annotations.length && (!hasGlyphs || !hasLabels || !hasValues); j++) {
+if (row.annotations[j] != null) {
+hasLabels = new Boolean (hasLabels | (row.annotations[j].displayCharacter != null && row.annotations[j].displayCharacter.length > 0 && !row.annotations[j].displayCharacter.equals (" "))).valueOf ();
+hasGlyphs = new Boolean (hasGlyphs | ((row.annotations[j].secondaryStructure).charCodeAt (0) != 0 && row.annotations[j].secondaryStructure != ' ')).valueOf ();
+hasValues = new Boolean (hasValues | (!Float.isNaN (row.annotations[j].value))).valueOf ();
+hasText = new Boolean (hasText | (row.annotations[j].description != null && row.annotations[j].description.length > 0)).valueOf ();
+}}
+if (row.graph == 0) {
+this.text.append ("NO_GRAPH\t");
+hasValues = false;
+} else {
+if (row.graph == 1) {
+this.text.append ("BAR_GRAPH\t");
+hasGlyphs = false;
+} else if (row.graph == 2) {
+hasGlyphs = false;
+this.text.append ("LINE_GRAPH\t");
+}if (row.getThreshold () != null) {
+graphLine.append ("GRAPHLINE\t");
+graphLine.append (row.label);
+graphLine.append ("\t");
+graphLine.append (row.getThreshold ().value);
+graphLine.append ("\t");
+graphLine.append (row.getThreshold ().label);
+graphLine.append ("\t");
+graphLine.append (jalview.util.Format.getHexString (row.getThreshold ().colour));
+graphLine.append (this.newline);
+}if (row.graphGroup > -1) {
+graphGroupSeen.set (row.graphGroup);
+var key =  new Integer (row.graphGroup);
+if (graphGroup.containsKey (key)) {
+graphGroup.put (key, graphGroup.get (key) + "\t" + row.label);
+} else {
+graphGroup_refs.put (key,  Clazz_newArray (-1, [refSeq, refGroup]));
+graphGroup.put (key, row.label);
+}}}this.text.append (row.label + "\t");
+if (row.description != null) {
+this.text.append (row.description + "\t");
+}for (var j = 0; row.annotations != null && j < row.annotations.length; j++) {
+if (refSeq != null && jalview.util.Comparison.isGap (refSeq.getCharAt (j))) {
+continue;
+}if (row.annotations[j] != null) {
+comma = "";
+if (hasGlyphs) {
+this.text.append (comma);
+if (row.annotations[j].secondaryStructure != ' ') {
+this.text.append (row.annotations[j].secondaryStructure);
+}comma = ",";
+}if (hasValues) {
+if (!Float.isNaN (row.annotations[j].value)) {
+this.text.append (comma + row.annotations[j].value);
+} else {
+System.err.println ("Skipping NaN - not valid value.");
+this.text.append (comma + 0);
+}comma = ",";
+}if (hasLabels) {
+if (row.annotations[j].displayCharacter != null && row.annotations[j].displayCharacter.length > 0 && !row.annotations[j].displayCharacter.equals (" ")) {
+this.text.append (comma + row.annotations[j].displayCharacter);
+comma = ",";
+}}if (hasText) {
+if (row.annotations[j].description != null && row.annotations[j].description.length > 0 && !row.annotations[j].description.equals (row.annotations[j].displayCharacter)) {
+this.text.append (comma + row.annotations[j].description);
+comma = ",";
+}}if (color != null && !color.equals (row.annotations[j].colour)) {
+oneColour = false;
+}color = row.annotations[j].colour;
+if (row.annotations[j].colour != null && row.annotations[j].colour !== java.awt.Color.black) {
+this.text.append (comma + "[" + jalview.util.Format.getHexString (row.annotations[j].colour) + "]");
+comma = ",";
+}}this.text.append ("|");
+}
+if (row.hasScore ()) {
+this.text.append ("\t" + row.score);
+}this.text.append (this.newline);
+if (color != null && color !== java.awt.Color.black && oneColour) {
+colours.append ("COLOUR\t");
+colours.append (row.label);
+colours.append ("\t");
+colours.append (jalview.util.Format.getHexString (color));
+colours.append (this.newline);
+}if (row.scaleColLabel || row.showAllColLabels || row.centreColLabels) {
+rowprops.append ("ROWPROPERTIES\t");
+rowprops.append (row.label);
+rowprops.append ("\tscaletofit=");
+rowprops.append (row.scaleColLabel);
+rowprops.append ("\tshowalllabs=");
+rowprops.append (row.showAllColLabels);
+rowprops.append ("\tcentrelabs=");
+rowprops.append (row.centreColLabels);
+rowprops.append (this.newline);
+}if (graphLine.length () > 0) {
+this.text.append (graphLine.toString ());
+graphLine.setLength (0);
+}}
+this.text.append (this.newline);
+this.text.append (colours.toString ());
+if (graphGroup.size () > 0) {
+var oldRefSeq = refSeq;
+var oldRefGroup = refGroup;
+for (var combine_statement, $combine_statement = graphGroup.entrySet ().iterator (); $combine_statement.hasNext () && ((combine_statement = $combine_statement.next ()) || true);) {
+var seqRefAndGroup = graphGroup_refs.get (combine_statement.getKey ());
+this.writeSequence_Ref (refSeq, seqRefAndGroup[0]);
+refSeq = seqRefAndGroup[0];
+this.writeGroup_Ref (refGroup, seqRefAndGroup[1]);
+refGroup = seqRefAndGroup[1];
+this.text.append ("COMBINE\t");
+this.text.append (combine_statement.getValue ());
+this.text.append (this.newline);
+}
+this.writeSequence_Ref (refSeq, oldRefSeq);
+refSeq = oldRefSeq;
+this.writeGroup_Ref (refGroup, oldRefGroup);
+refGroup = oldRefGroup;
+}this.text.append (rowprops.toString ());
+}if (list != null) {
+this.printGroups (list);
+}if (properties != null) {
+this.text.append (this.newline);
+this.text.append (this.newline);
+this.text.append ("ALIGNMENT");
+var en = properties.keys ();
+while (en.hasMoreElements ()) {
+var key = en.nextElement ().toString ();
+this.text.append ("\t");
+this.text.append (key);
+this.text.append ("=");
+this.text.append (properties.get (key));
+}
+}return this.text.toString ();
+}, "~A,java.util.List,java.util.Hashtable,jalview.datamodel.ColumnSelection,jalview.datamodel.AlignmentI,jalview.io.AnnotationFile.ViewDef");
+Clazz_defineMethod (c$, "writeGroup_Ref", 
+ function (refGroup, next_refGroup) {
+if (next_refGroup == null) {
+if (refGroup != null) {
+this.text.append (this.newline);
+this.text.append ("GROUP_REF\t");
+this.text.append ("ALIGNMENT");
+this.text.append (this.newline);
+}return true;
+} else {
+if (refGroup == null || refGroup !== next_refGroup) {
+this.text.append (this.newline);
+this.text.append ("GROUP_REF\t");
+this.text.append (next_refGroup.getName ());
+this.text.append (this.newline);
+return true;
+}}return false;
+}, "jalview.datamodel.SequenceGroup,jalview.datamodel.SequenceGroup");
+Clazz_defineMethod (c$, "writeSequence_Ref", 
+ function (refSeq, next_refSeq) {
+if (next_refSeq == null) {
+if (refSeq != null) {
+this.text.append (this.newline);
+this.text.append ("SEQUENCE_REF\t");
+this.text.append ("ALIGNMENT");
+this.text.append (this.newline);
+return true;
+}} else {
+if (refSeq == null || refSeq !== next_refSeq) {
+this.text.append (this.newline);
+this.text.append ("SEQUENCE_REF\t");
+this.text.append (next_refSeq.getName ());
+this.text.append (this.newline);
+return true;
+}}return false;
+}, "jalview.datamodel.SequenceI,jalview.datamodel.SequenceI");
+Clazz_defineMethod (c$, "printGroups", 
+function (list) {
+var seqrep = null;
+for (var sg, $sg = list.iterator (); $sg.hasNext () && ((sg = $sg.next ()) || true);) {
+if (!sg.hasSeqrep ()) {
+this.text.append ("SEQUENCE_GROUP\t" + sg.getName () + "\t" + (sg.getStartRes () + 1) + "\t" + (sg.getEndRes () + 1) + "\t" + "-1\t");
+seqrep = null;
+} else {
+seqrep = sg.getSeqrep ();
+this.text.append ("SEQUENCE_REF\t");
+this.text.append (seqrep.getName ());
+this.text.append (this.newline);
+this.text.append ("SEQUENCE_GROUP\t");
+this.text.append (sg.getName ());
+this.text.append ("\t");
+this.text.append ("" + (seqrep.findPosition (sg.getStartRes ())));
+this.text.append ("\t");
+this.text.append ((seqrep.findPosition (sg.getEndRes ())));
+this.text.append ("\t");
+this.text.append ("-1\t");
+}for (var s = 0; s < sg.getSize (); s++) {
+this.text.append (sg.getSequenceAt (s).getName ());
+this.text.append ("\t");
+}
+this.text.append (this.newline);
+this.text.append ("PROPERTIES\t");
+this.text.append (sg.getName ());
+this.text.append ("\t");
+if (sg.getDescription () != null) {
+this.text.append ("description=");
+this.text.append (sg.getDescription ());
+this.text.append ("\t");
+}if (sg.cs != null) {
+this.text.append ("colour=");
+this.text.append (jalview.schemes.ColourSchemeProperty.getColourName (sg.cs));
+this.text.append ("\t");
+if (sg.cs.getThreshold () != 0) {
+this.text.append ("pidThreshold=");
+this.text.append (sg.cs.getThreshold ());
+}if (sg.cs.conservationApplied ()) {
+this.text.append ("consThreshold=");
+this.text.append (sg.cs.getConservationInc ());
+this.text.append ("\t");
+}}this.text.append ("outlineColour=");
+this.text.append (jalview.util.Format.getHexString (sg.getOutlineColour ()));
+this.text.append ("\t");
+this.text.append ("displayBoxes=");
+this.text.append (sg.getDisplayBoxes ());
+this.text.append ("\t");
+this.text.append ("displayText=");
+this.text.append (sg.getDisplayText ());
+this.text.append ("\t");
+this.text.append ("colourText=");
+this.text.append (sg.getColourText ());
+this.text.append ("\t");
+this.text.append ("showUnconserved=");
+this.text.append (sg.getShowNonconserved ());
+this.text.append ("\t");
+if (sg.textColour !== java.awt.Color.black) {
+this.text.append ("textCol1=");
+this.text.append (jalview.util.Format.getHexString (sg.textColour));
+this.text.append ("\t");
+}if (sg.textColour2 !== java.awt.Color.white) {
+this.text.append ("textCol2=");
+this.text.append (jalview.util.Format.getHexString (sg.textColour2));
+this.text.append ("\t");
+}if (sg.thresholdTextColour != 0) {
+this.text.append ("textColThreshold=");
+this.text.append (sg.thresholdTextColour);
+this.text.append ("\t");
+}if (sg.idColour != null) {
+this.text.append ("idColour=");
+this.text.append (jalview.util.Format.getHexString (sg.idColour));
+this.text.append ("\t");
+}if (sg.isHidereps ()) {
+this.text.append ("hide=true\t");
+}if (sg.isHideCols ()) {
+this.text.append ("hidecols=true\t");
+}if (seqrep != null) {
+this.text.append (this.newline);
+this.text.append ("SEQUENCE_REF");
+}this.text.append (this.newline);
+this.text.append (this.newline);
+}
+}, "java.util.List");
+Clazz_defineMethod (c$, "annotateAlignmentView", 
+function (viewport, file, protocol) {
+var colSel = viewport.getColumnSelection ();
+if (colSel == null) {
+colSel =  new jalview.datamodel.ColumnSelection ();
+}var rslt = this.readAnnotationFile (viewport.getAlignment (), colSel, file, protocol);
+if (rslt && (colSel.hasSelectedColumns () || colSel.hasHiddenColumns ())) {
+viewport.setColumnSelection (colSel);
+}return rslt;
+}, "jalview.api.AlignViewportI,~S,~S");
+Clazz_defineMethod (c$, "readAnnotationFile", 
+function (al, file, protocol) {
+return this.readAnnotationFile (al, null, file, protocol);
+}, "jalview.datamodel.AlignmentI,~S,~S");
+Clazz_defineMethod (c$, "readAnnotationFile", 
+function (al, colSel, file, protocol) {
+var $in = null;
+try {
+if (protocol.equals (jalview.io.AppletFormatAdapter.FILE)) {
+$in = jalview.jsdev.GenericFileAdapter.getReader (file, false);
+} else if (protocol.equals (jalview.io.AppletFormatAdapter.URL)) {
+$in = jalview.jsdev.GenericFileAdapter.getReader (file, true);
+} else if (protocol.equals (jalview.io.AppletFormatAdapter.PASTE)) {
+$in =  new java.io.BufferedReader ( new java.io.StringReader (file));
+} else if (protocol.equals (jalview.io.AppletFormatAdapter.CLASSLOADER)) {
+var is = this.getClass ().getResourceAsStream ("/" + file);
+if (is != null) {
+$in =  new java.io.BufferedReader ( new java.io.InputStreamReader (is));
+}}if ($in != null) {
+return this.parseAnnotationFrom (al, colSel, $in);
+}} catch (ex) {
+if (Clazz_exceptionOf (ex, Exception)) {
+ex.printStackTrace ();
+System.out.println ("Problem reading annotation file: " + ex);
+if (this.nlinesread > 0) {
+System.out.println ("Last read line " + this.nlinesread + ": '" + this.lastread + "' (first 80 chars) ...");
+}return false;
+} else {
+throw ex;
+}
+}
+return false;
+}, "jalview.datamodel.AlignmentI,jalview.datamodel.ColumnSelection,~S,~S");
+Clazz_defineMethod (c$, "parseAnnotationFrom", 
+function (al, colSel, $in) {
+this.nlinesread = 0;
+var combineAnnotation_calls =  new java.util.ArrayList ();
+var deferredAnnotation_calls =  new java.util.ArrayList ();
+var modified = false;
+var groupRef = null;
+var groupRefRows =  new java.util.Hashtable ();
+var autoAnnots =  new java.util.Hashtable ();
+{
+var line;
+var label;
+var description;
+var token;
+var graphStyle;
+var index;
+var refSeqIndex = 1;
+var existingAnnotations = 0;
+var overrideAutoAnnot = false;
+if (al.getAlignmentAnnotation () != null) {
+existingAnnotations = al.getAlignmentAnnotation ().length;
+if (existingAnnotations > 0) {
+var aa = al.getAlignmentAnnotation ();
+for (var aai = 0; aai < aa.length; aai++) {
+if (aa[aai].autoCalculated) {
+autoAnnots.put (this.autoAnnotsKey (aa[aai], aa[aai].sequenceRef, (aa[aai].groupRef == null ? null : aa[aai].groupRef.getName ())),  new Integer (1));
+}}
+}}var alWidth = al.getWidth ();
+var st;
+var annotations;
+var annotation = null;
+var jvAnnotationFile = false;
+while ((line = $in.readLine ()) != null) {
+this.nlinesread++;
+this.lastread =  String.instantialize (line);
+if (line.indexOf ("#") == 0) {
+continue;
+}if (line.indexOf ("JALVIEW_ANNOTATION") > -1) {
+jvAnnotationFile = true;
+break;
+}}
+if (!jvAnnotationFile) {
+$in.close ();
+return false;
+}while ((line = $in.readLine ()) != null) {
+this.nlinesread++;
+this.lastread =  String.instantialize (line);
+if (line.indexOf ("#") == 0 || line.indexOf ("JALVIEW_ANNOTATION") > -1 || line.length == 0) {
+continue;
+}st =  new java.util.StringTokenizer (line, "\t");
+token = st.nextToken ();
+if (token.equalsIgnoreCase ("COLOUR")) {
+this.colourAnnotations (al, st.nextToken (), st.nextToken ());
+modified = true;
+continue;
+} else if (token.equalsIgnoreCase (jalview.io.AnnotationFile.COMBINE)) {
+combineAnnotation_calls.add ( Clazz_newArray (-1, [st, this.refSeq, groupRef]));
+modified = true;
+continue;
+} else if (token.equalsIgnoreCase ("ROWPROPERTIES")) {
+this.addRowProperties (al, st);
+modified = true;
+continue;
+} else if (token.equalsIgnoreCase (jalview.io.AnnotationFile.GRAPHLINE)) {
+deferredAnnotation_calls.add ( Clazz_newArray (-1, [jalview.io.AnnotationFile.GRAPHLINE, st, this.refSeq, groupRef]));
+modified = true;
+continue;
+} else if (token.equalsIgnoreCase ("SEQUENCE_REF")) {
+if (st.hasMoreTokens ()) {
+this.refSeq = al.findName (this.refSeqId = st.nextToken ());
+if (this.refSeq == null) {
+this.refSeqId = null;
+}try {
+refSeqIndex = Integer.parseInt (st.nextToken ());
+if (refSeqIndex < 1) {
+refSeqIndex = 1;
+System.out.println ("WARNING: SEQUENCE_REF index must be > 0 in AnnotationFile");
+}} catch (ex) {
+if (Clazz_exceptionOf (ex, Exception)) {
+refSeqIndex = 1;
+} else {
+throw ex;
+}
+}
+} else {
+this.refSeq = null;
+this.refSeqId = null;
+}continue;
+} else if (token.equalsIgnoreCase ("GROUP_REF")) {
+groupRef = null;
+if (st.hasMoreTokens ()) {
+groupRef = st.nextToken ();
+if (groupRef.length < 1) {
+groupRef = null;
+} else {
+if (groupRefRows.get (groupRef) == null) {
+groupRefRows.put (groupRef,  new java.util.Vector ());
+}}}continue;
+} else if (token.equalsIgnoreCase ("SEQUENCE_GROUP")) {
+this.addGroup (al, st);
+modified = true;
+continue;
+} else if (token.equalsIgnoreCase ("PROPERTIES")) {
+this.addProperties (al, st);
+modified = true;
+continue;
+} else if (token.equalsIgnoreCase ("BELOW_ALIGNMENT")) {
+this.setBelowAlignment (al, st);
+modified = true;
+continue;
+} else if (token.equalsIgnoreCase ("ALIGNMENT")) {
+this.addAlignmentDetails (al, st);
+modified = true;
+continue;
+} else if (token.equalsIgnoreCase ("VIEW_SETREF")) {
+if (this.refSeq != null) {
+al.setSeqrep (this.refSeq);
+}modified = true;
+continue;
+} else if (token.equalsIgnoreCase ("VIEW_HIDECOLS")) {
+if (st.hasMoreTokens ()) {
+if (colSel == null) {
+colSel =  new jalview.datamodel.ColumnSelection ();
+}this.parseHideCols (colSel, st.nextToken ());
+}modified = true;
+continue;
+} else if (token.equalsIgnoreCase ("HIDE_INSERTIONS")) {
+var sr = this.refSeq == null ? al.getSeqrep () : this.refSeq;
+if (sr == null) {
+sr = al.getSequenceAt (0);
+}if (sr != null) {
+if (colSel == null) {
+System.err.println ("Cannot process HIDE_INSERTIONS without an alignment view: Ignoring line: " + line);
+} else {
+colSel.hideInsertionsFor (sr);
+}}modified = true;
+continue;
+}graphStyle = jalview.datamodel.AlignmentAnnotation.getGraphValueFromString (token);
+label = st.nextToken ();
+index = 0;
+annotations =  new Array (alWidth);
+description = null;
+var score = NaN;
+if (st.hasMoreTokens ()) {
+line = st.nextToken ();
+if (line.indexOf ("|") == -1) {
+description = line;
+if (st.hasMoreTokens ()) {
+line = st.nextToken ();
+}}if (st.hasMoreTokens ()) {
+score = Float.$valueOf (st.nextToken ()).floatValue ();
+}st =  new java.util.StringTokenizer (line, "|", true);
+var emptyColumn = true;
+var onlyOneElement = (st.countTokens () == 1);
+while (st.hasMoreElements () && index < alWidth) {
+token = st.nextToken ().trim ();
+if (onlyOneElement) {
+try {
+score = Float.$valueOf (token).floatValue ();
+break;
+} catch (ex) {
+if (Clazz_exceptionOf (ex, NumberFormatException)) {
+} else {
+throw ex;
+}
+}
+}if (token.equals ("|")) {
+if (emptyColumn) {
+index++;
+}emptyColumn = true;
+} else {
+annotations[index++] = this.parseAnnotation (token, graphStyle);
+emptyColumn = false;
+}}
+}annotation =  new jalview.datamodel.AlignmentAnnotation (label, description, (index == 0) ? null : annotations, 0, 0, graphStyle);
+annotation.score = score;
+if (!overrideAutoAnnot && autoAnnots.containsKey (this.autoAnnotsKey (annotation, this.refSeq, groupRef))) {
+continue;
+}if (this.refSeq != null) {
+annotation.belowAlignment = false;
+var referedSeq = this.refSeq;
+do {
+var ann =  new jalview.datamodel.AlignmentAnnotation (annotation);
+annotation.createSequenceMapping (referedSeq, refSeqIndex, false);
+annotation.adjustForAlignment ();
+referedSeq.addAlignmentAnnotation (annotation);
+al.addAnnotation (annotation);
+al.setAnnotationIndex (annotation, al.getAlignmentAnnotation ().length - existingAnnotations - 1);
+if (groupRef != null) {
+(groupRefRows.get (groupRef)).addElement (annotation);
+}annotation = ann;
+} while (this.refSeqId != null && (referedSeq = al.findName (referedSeq, this.refSeqId, true)) != null);
+} else {
+al.addAnnotation (annotation);
+al.setAnnotationIndex (annotation, al.getAlignmentAnnotation ().length - existingAnnotations - 1);
+if (groupRef != null) {
+(groupRefRows.get (groupRef)).addElement (annotation);
+}}modified = true;
+}
+var groupRefLookup =  new java.util.Hashtable ();
+var en = groupRefRows.keys ();
+while (en.hasMoreElements ()) {
+groupRef = en.nextElement ();
+var matched = false;
+for (var theGroup, $theGroup = al.getGroups ().iterator (); $theGroup.hasNext () && ((theGroup = $theGroup.next ()) || true);) {
+if (theGroup.getName ().equals (groupRef)) {
+if (matched) {
+System.err.println ("Ignoring 1:many group reference mappings for group name '" + groupRef + "'");
+} else {
+matched = true;
+var rowset = groupRefRows.get (groupRef);
+groupRefLookup.put (groupRef, theGroup);
+if (rowset != null && rowset.size () > 0) {
+var alan = null;
+for (var elm = 0, elmSize = rowset.size (); elm < elmSize; elm++) {
+alan = rowset.elementAt (elm);
+alan.groupRef = theGroup;
+}
+}}}}
+(groupRefRows.get (groupRef)).removeAllElements ();
+}
+for (var _deferred_args, $_deferred_args = deferredAnnotation_calls.iterator (); $_deferred_args.hasNext () && ((_deferred_args = $_deferred_args.next ()) || true);) {
+if (_deferred_args[0] === jalview.io.AnnotationFile.GRAPHLINE) {
+this.addLine (al, _deferred_args[1], _deferred_args[2], (_deferred_args[3] == null) ? null : groupRefLookup.get (_deferred_args[3]));
+}}
+var combinecount = 0;
+for (var _combine_args, $_combine_args = combineAnnotation_calls.iterator (); $_combine_args.hasNext () && ((_combine_args = $_combine_args.next ()) || true);) {
+this.combineAnnotations (al, ++combinecount, _combine_args[0], _combine_args[1], (_combine_args[2] == null) ? null : groupRefLookup.get (_combine_args[2]));
+}
+}return modified;
+}, "jalview.datamodel.AlignmentI,jalview.datamodel.ColumnSelection,java.io.BufferedReader");
+Clazz_defineMethod (c$, "parseHideCols", 
+ function (colSel, nextToken) {
+var inval =  new java.util.StringTokenizer (nextToken, ",");
+while (inval.hasMoreTokens ()) {
+var range = inval.nextToken ().trim ();
+var from;
+var to = range.indexOf ("-");
+if (to == -1) {
+from = to = Integer.parseInt (range);
+if (from >= 0) {
+colSel.hideColumns (from, to);
+}} else {
+from = Integer.parseInt (range.substring (0, to));
+if (to < range.length - 1) {
+to = Integer.parseInt (range.substring (to + 1));
+} else {
+to = from;
+}if (from > 0 && to >= from) {
+colSel.hideColumns (from, to);
+}}}
+}, "jalview.datamodel.ColumnSelection,~S");
+Clazz_defineMethod (c$, "autoAnnotsKey", 
+ function (annotation, refSeq, groupRef) {
+return annotation.graph + "\t" + annotation.label + "\t" + annotation.description + "\t" + (refSeq != null ? refSeq.getDisplayId (true) : "");
+}, "jalview.datamodel.AlignmentAnnotation,jalview.datamodel.SequenceI,~S");
+Clazz_defineMethod (c$, "parseAnnotation", 
+function (string, graphStyle) {
+var hasSymbols = (graphStyle == 0);
+var desc = null;
+var displayChar = null;
+var ss = ' ';
+var value = 0;
+var parsedValue = false;
+var dcset = false;
+var colour = null;
+var i = string.indexOf ("[");
+var j = string.indexOf ("]");
+if (i > -1 && j > -1) {
+var ucs =  new jalview.schemes.UserColourScheme ();
+colour = ucs.getColourFromString (string.substring (i + 1, j));
+if (i > 0 && string.charAt (i - 1) == ',') {
+i--;
+}string = string.substring (0, i) + string.substring (j + 1);
+}var st =  new java.util.StringTokenizer (string, ",", true);
+var token;
+var seenContent = false;
+var pass = 0;
+while (st.hasMoreTokens ()) {
+pass++;
+token = st.nextToken ().trim ();
+if (token.equals (",")) {
+if (!seenContent && parsedValue && !dcset) {
+dcset = true;
+displayChar = " ";
+}seenContent = false;
+continue;
+} else {
+seenContent = true;
+}if (!parsedValue) {
+try {
+displayChar = token;
+value =  new Float (token).floatValue ();
+parsedValue = true;
+continue;
+} catch (ex) {
+if (Clazz_exceptionOf (ex, NumberFormatException)) {
+} else {
+throw ex;
+}
+}
+} else {
+if (token.length == 1) {
+displayChar = token;
+}}if (hasSymbols && (token.equals ("H") || token.equals ("E") || token.equals ("S") || token.equals (" "))) {
+ss = token.charAt (0);
+if (displayChar.equals (token.substring (0, 1))) {
+displayChar = "";
+}} else if (desc == null || (parsedValue && pass > 2)) {
+desc = token;
+}}
+if (displayChar != null && desc != null && desc.length == 1) {
+if (displayChar.length > 1) {
+var tmp = displayChar;
+displayChar = desc;
+desc = tmp;
+} else {
+if (displayChar.equals (desc)) {
+desc = null;
+}}}var anot =  new jalview.datamodel.Annotation (displayChar, desc, ss, value);
+anot.colour = colour;
+return anot;
+}, "~S,~N");
+Clazz_defineMethod (c$, "colourAnnotations", 
+function (al, label, colour) {
+var ucs =  new jalview.schemes.UserColourScheme (colour);
+var annotations;
+for (var i = 0; i < al.getAlignmentAnnotation ().length; i++) {
+if (al.getAlignmentAnnotation ()[i].label.equalsIgnoreCase (label)) {
+annotations = al.getAlignmentAnnotation ()[i].annotations;
+for (var j = 0; j < annotations.length; j++) {
+if (annotations[j] != null) {
+annotations[j].colour = ucs.findColour ('A');
+}}
+}}
+}, "jalview.datamodel.AlignmentI,~S,~S");
+Clazz_defineMethod (c$, "combineAnnotations", 
+function (al, combineCount, st, seqRef, groupRef) {
+var group = st.nextToken ();
+var graphGroup = 0;
+if (al.getAlignmentAnnotation () != null) {
+for (var i = 0; i < al.getAlignmentAnnotation ().length; i++) {
+var aa = al.getAlignmentAnnotation ()[i];
+if (aa.graphGroup > graphGroup) {
+graphGroup = aa.graphGroup + 1;
+}if (aa.sequenceRef === seqRef && aa.groupRef === groupRef && aa.label.equalsIgnoreCase (group)) {
+if (aa.graphGroup > -1) {
+graphGroup = aa.graphGroup;
+} else {
+if (graphGroup <= combineCount) {
+graphGroup = combineCount + 1;
+}aa.graphGroup = graphGroup;
+}break;
+}}
+while (st.hasMoreTokens ()) {
+group = st.nextToken ();
+for (var i = 0; i < al.getAlignmentAnnotation ().length; i++) {
+var aa = al.getAlignmentAnnotation ()[i];
+if (aa.sequenceRef === seqRef && aa.groupRef === groupRef && aa.label.equalsIgnoreCase (group)) {
+aa.graphGroup = graphGroup;
+break;
+}}
+}
+} else {
+System.err.println ("Couldn't combine annotations. None are added to alignment yet!");
+}}, "jalview.datamodel.AlignmentI,~N,java.util.StringTokenizer,jalview.datamodel.SequenceI,jalview.datamodel.SequenceGroup");
+Clazz_defineMethod (c$, "addLine", 
+function (al, st, seqRef, groupRef) {
+var group = st.nextToken ();
+var annotation = null;
+var alannot = al.getAlignmentAnnotation ();
+var value =  new Float (st.nextToken ()).floatValue ();
+var label = st.hasMoreTokens () ? st.nextToken () : null;
+var colour = null;
+if (st.hasMoreTokens ()) {
+var ucs =  new jalview.schemes.UserColourScheme (st.nextToken ());
+colour = ucs.findColour ('A');
+}if (alannot != null) {
+for (var i = 0; i < alannot.length; i++) {
+if (alannot[i].label.equalsIgnoreCase (group) && (seqRef == null || alannot[i].sequenceRef === seqRef) && (groupRef == null || alannot[i].groupRef === groupRef)) {
+alannot[i].setThreshold ( new jalview.datamodel.GraphLine (value, label, colour));
+}}
+}if (annotation == null) {
+return;
+}}, "jalview.datamodel.AlignmentI,java.util.StringTokenizer,jalview.datamodel.SequenceI,jalview.datamodel.SequenceGroup");
+Clazz_defineMethod (c$, "addGroup", 
+function (al, st) {
+var sg =  new jalview.datamodel.SequenceGroup ();
+sg.setName (st.nextToken ());
+var rng = "";
+try {
+rng = st.nextToken ();
+if (rng.length > 0 && !rng.startsWith ("*")) {
+sg.setStartRes (Integer.parseInt (rng) - 1);
+} else {
+sg.setStartRes (0);
+}rng = st.nextToken ();
+if (rng.length > 0 && !rng.startsWith ("*")) {
+sg.setEndRes (Integer.parseInt (rng) - 1);
+} else {
+sg.setEndRes (al.getWidth () - 1);
+}} catch (e) {
+if (Clazz_exceptionOf (e, Exception)) {
+System.err.println ("Couldn't parse Group Start or End Field as '*' or a valid column or sequence index: '" + rng + "' - assuming alignment width for group.");
+sg.setStartRes (0);
+sg.setEndRes (al.getWidth () - 1);
+} else {
+throw e;
+}
+}
+var index = st.nextToken ();
+if (index.equals ("-1")) {
+while (st.hasMoreElements ()) {
+sg.addSequence (al.findName (st.nextToken ()), false);
+}
+} else {
+var st2 =  new java.util.StringTokenizer (index, ",");
+while (st2.hasMoreTokens ()) {
+var tmp = st2.nextToken ();
+if (tmp.equals ("*")) {
+for (var i = 0; i < al.getHeight (); i++) {
+sg.addSequence (al.getSequenceAt (i), false);
+}
+} else if (tmp.indexOf ("-") >= 0) {
+var st3 =  new java.util.StringTokenizer (tmp, "-");
+var start = (Integer.parseInt (st3.nextToken ()));
+var end = (Integer.parseInt (st3.nextToken ()));
+if (end > start) {
+for (var i = start; i <= end; i++) {
+sg.addSequence (al.getSequenceAt (i - 1), false);
+}
+}} else {
+sg.addSequence (al.getSequenceAt (Integer.parseInt (tmp) - 1), false);
+}}
+}if (this.refSeq != null) {
+sg.setStartRes (this.refSeq.findIndex (sg.getStartRes () + 1) - 1);
+sg.setEndRes (this.refSeq.findIndex (sg.getEndRes () + 1) - 1);
+sg.setSeqrep (this.refSeq);
+}if (sg.getSize () > 0) {
+al.addGroup (sg);
+}}, "jalview.datamodel.AlignmentI,java.util.StringTokenizer");
+Clazz_defineMethod (c$, "addRowProperties", 
+function (al, st) {
+var label = st.nextToken ();
+var keyValue;
+var key;
+var value;
+var scaletofit = false;
+var centerlab = false;
+var showalllabs = false;
+while (st.hasMoreTokens ()) {
+keyValue = st.nextToken ();
+key = keyValue.substring (0, keyValue.indexOf ("="));
+value = keyValue.substring (keyValue.indexOf ("=") + 1);
+if (key.equalsIgnoreCase ("scaletofit")) {
+scaletofit = Boolean.$valueOf (value).booleanValue ();
+}if (key.equalsIgnoreCase ("showalllabs")) {
+showalllabs = Boolean.$valueOf (value).booleanValue ();
+}if (key.equalsIgnoreCase ("centrelabs")) {
+centerlab = Boolean.$valueOf (value).booleanValue ();
+}var alr = al.getAlignmentAnnotation ();
+if (alr != null) {
+for (var i = 0; i < alr.length; i++) {
+if (alr[i].label.equalsIgnoreCase (label)) {
+alr[i].centreColLabels = centerlab;
+alr[i].scaleColLabel = scaletofit;
+alr[i].showAllColLabels = showalllabs;
+}}
+}}
+}, "jalview.datamodel.AlignmentI,java.util.StringTokenizer");
+Clazz_defineMethod (c$, "addProperties", 
+function (al, st) {
+if (al.getGroups () == null) {
+return;
+}var name = st.nextToken ();
+var sg = null;
+for (var _sg, $_sg = al.getGroups ().iterator (); $_sg.hasNext () && ((_sg = $_sg.next ()) || true);) {
+if ((sg = _sg).getName ().equals (name)) {
+break;
+} else {
+sg = null;
+}}
+if (sg != null) {
+var keyValue;
+var key;
+var value;
+var def = sg.cs;
+sg.cs = null;
+while (st.hasMoreTokens ()) {
+keyValue = st.nextToken ();
+key = keyValue.substring (0, keyValue.indexOf ("="));
+value = keyValue.substring (keyValue.indexOf ("=") + 1);
+if (key.equalsIgnoreCase ("description")) {
+sg.setDescription (value);
+} else if (key.equalsIgnoreCase ("colour")) {
+sg.cs = jalview.schemes.ColourSchemeProperty.getColour (al, value);
+} else if (key.equalsIgnoreCase ("pidThreshold")) {
+sg.cs.setThreshold (Integer.parseInt (value), true);
+} else if (key.equalsIgnoreCase ("consThreshold")) {
+sg.cs.setConservationInc (Integer.parseInt (value));
+var c =  new jalview.analysis.Conservation ("Group", jalview.schemes.ResidueProperties.propHash, 3, sg.getSequences (null), sg.getStartRes (), sg.getEndRes () + 1);
+c.calculate ();
+c.verdict (false, 25);
+sg.cs.setConservation (c);
+} else if (key.equalsIgnoreCase ("outlineColour")) {
+sg.setOutlineColour ( new jalview.schemes.UserColourScheme (value).findColour ('A'));
+} else if (key.equalsIgnoreCase ("displayBoxes")) {
+sg.setDisplayBoxes (Boolean.$valueOf (value).booleanValue ());
+} else if (key.equalsIgnoreCase ("showUnconserved")) {
+sg.setShowNonconserved (Boolean.$valueOf (value).booleanValue ());
+} else if (key.equalsIgnoreCase ("displayText")) {
+sg.setDisplayText (Boolean.$valueOf (value).booleanValue ());
+} else if (key.equalsIgnoreCase ("colourText")) {
+sg.setColourText (Boolean.$valueOf (value).booleanValue ());
+} else if (key.equalsIgnoreCase ("textCol1")) {
+sg.textColour =  new jalview.schemes.UserColourScheme (value).findColour ('A');
+} else if (key.equalsIgnoreCase ("textCol2")) {
+sg.textColour2 =  new jalview.schemes.UserColourScheme (value).findColour ('A');
+} else if (key.equalsIgnoreCase ("textColThreshold")) {
+sg.thresholdTextColour = Integer.parseInt (value);
+} else if (key.equalsIgnoreCase ("idColour")) {
+sg.setIdColour ((def =  new jalview.schemes.UserColourScheme (value)).findColour ('A'));
+} else if (key.equalsIgnoreCase ("hide")) {
+sg.setHidereps (true);
+} else if (key.equalsIgnoreCase ("hidecols")) {
+sg.setHideCols (true);
+}sg.recalcConservation ();
+}
+if (sg.cs == null) {
+sg.cs = def;
+}}}, "jalview.datamodel.AlignmentI,java.util.StringTokenizer");
+Clazz_defineMethod (c$, "setBelowAlignment", 
+function (al, st) {
+var token;
+var aa;
+var ala = al.getAlignmentAnnotation ();
+if (ala == null) {
+System.err.print ("Warning - no annotation to set below for sequence associated annotation:");
+}while (st.hasMoreTokens ()) {
+token = st.nextToken ();
+if (ala == null) {
+System.err.print (" " + token);
+} else {
+for (var i = 0; i < al.getAlignmentAnnotation ().length; i++) {
+aa = al.getAlignmentAnnotation ()[i];
+if (aa.sequenceRef === this.refSeq && aa.label.equals (token)) {
+aa.belowAlignment = true;
+}}
+}}
+if (ala == null) {
+System.err.print ("\n");
+}}, "jalview.datamodel.AlignmentI,java.util.StringTokenizer");
+Clazz_defineMethod (c$, "addAlignmentDetails", 
+function (al, st) {
+var keyValue;
+var key;
+var value;
+while (st.hasMoreTokens ()) {
+keyValue = st.nextToken ();
+key = keyValue.substring (0, keyValue.indexOf ("="));
+value = keyValue.substring (keyValue.indexOf ("=") + 1);
+al.setProperty (key, value);
+}
+}, "jalview.datamodel.AlignmentI,java.util.StringTokenizer");
+Clazz_defineMethod (c$, "printCSVAnnotations", 
+function (annotations) {
+var sp =  new StringBuffer ();
+for (var i = 0; i < annotations.length; i++) {
+var atos = annotations[i].toString ();
+var p = 0;
+do {
+var cp = atos.indexOf ("\n", p);
+sp.append (annotations[i].label);
+sp.append (",");
+if (cp > p) {
+sp.append (atos.substring (p, cp + 1));
+} else {
+sp.append (atos.substring (p));
+sp.append (this.newline);
+}p = cp + 1;
+} while (p > 0);
+}
+return sp.toString ();
+}, "~A");
+Clazz_defineMethod (c$, "printAnnotationsForView", 
+function (viewport) {
+return this.printAnnotations (viewport.isShowAnnotation () ? viewport.getAlignment ().getAlignmentAnnotation () : null, viewport.getAlignment ().getGroups (), viewport.getAlignment ().getProperties (), viewport.getColumnSelection (), viewport.getAlignment (), null);
+}, "jalview.api.AlignViewportI");
+Clazz_defineMethod (c$, "printAnnotationsForAlignment", 
+function (al) {
+return this.printAnnotations (al.getAlignmentAnnotation (), al.getGroups (), al.getProperties (), null, al, null);
+}, "jalview.datamodel.AlignmentI");
+c$.$AnnotationFile$ViewDef$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_decorateAsClass (function () {
+Clazz_prepareCallback (this, arguments);
+this.viewname = null;
+this.hidseqs = null;
+this.hiddencols = null;
+this.visibleGroups = null;
+this.hiddenRepSeqs = null;
+Clazz_instantialize (this, arguments);
+}, jalview.io.AnnotationFile, "ViewDef");
+Clazz_makeConstructor (c$, 
+function (a, b, c, d) {
+this.viewname = a;
+this.hidseqs = b;
+this.hiddencols = c;
+this.hiddenRepSeqs = d;
+}, "~S,jalview.datamodel.HiddenSequences,jalview.datamodel.ColumnSelection,java.util.Hashtable");
+c$ = Clazz_p0p ();
+};
+Clazz_defineStatics (c$,
+"GRAPHLINE", "GRAPHLINE",
+"COMBINE", "COMBINE");
+});
+Clazz_declarePackage ("jalview.io");
+Clazz_load (["jalview.io.FileParse", "jalview.jsdev.RegExp"], "jalview.io.NewickFile", ["jalview.datamodel.SequenceNode", "jalview.util.MessageManager", "java.io.BufferedReader", "$.IOException", "java.lang.Float", "$.StringBuffer", "java.util.StringTokenizer"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.root = null;
+this.$HasBootstrap = false;
+this.$HasDistances = false;
+this.RootHasDistance = false;
+this.ReplaceUnderscores = false;
+this.printRootInfo = true;
+this.NodeSafeName = null;
+this.QuoteChar = '\'';
+Clazz_instantialize (this, arguments);
+}, jalview.io, "NewickFile", jalview.io.FileParse);
+Clazz_prepareFields (c$, function () {
+this.NodeSafeName =  Clazz_newArray (-1, [jalview.jsdev.RegExp.perlCode ("m/[\\[,:'()]/"), jalview.jsdev.RegExp.perlCode ("s/'/''/"), jalview.jsdev.RegExp.perlCode ("s/\\/w/_/")]);
+});
+Clazz_makeConstructor (c$, 
+function (inStr) {
+Clazz_superConstructor (this, jalview.io.NewickFile, [inStr, "Paste"]);
+}, "~S");
+Clazz_makeConstructor (c$, 
+function (newtree) {
+Clazz_superConstructor (this, jalview.io.NewickFile, []);
+this.root = newtree;
+}, "jalview.datamodel.SequenceNode");
+Clazz_makeConstructor (c$, 
+function (newtree, bootstrap) {
+Clazz_superConstructor (this, jalview.io.NewickFile, []);
+this.$HasBootstrap = bootstrap;
+this.root = newtree;
+}, "jalview.datamodel.SequenceNode,~B");
+Clazz_makeConstructor (c$, 
+function (newtree, bootstrap, distances) {
+Clazz_superConstructor (this, jalview.io.NewickFile, []);
+this.root = newtree;
+this.$HasBootstrap = bootstrap;
+this.$HasDistances = distances;
+}, "jalview.datamodel.SequenceNode,~B,~B");
+Clazz_makeConstructor (c$, 
+function (newtree, bootstrap, distances, rootdistance) {
+Clazz_superConstructor (this, jalview.io.NewickFile, []);
+this.root = newtree;
+this.$HasBootstrap = bootstrap;
+this.$HasDistances = distances;
+this.RootHasDistance = rootdistance;
+}, "jalview.datamodel.SequenceNode,~B,~B,~B");
+Clazz_defineMethod (c$, "ErrorStringrange", 
+ function (Error, Er, r, p, s) {
+return ((Error == null) ? "" : Error) + Er + " at position " + p + " ( " + s.substring (((p - r) < 0) ? 0 : (p - r), ((p + r) > s.length) ? s.length : (p + r)) + " )\n";
+}, "~S,~S,~N,~N,~S");
+Clazz_defineMethod (c$, "HasBootstrap", 
+function () {
+return this.$HasBootstrap;
+});
+Clazz_defineMethod (c$, "HasDistances", 
+function () {
+return this.$HasDistances;
+});
+Clazz_defineMethod (c$, "HasRootDistance", 
+function () {
+return this.RootHasDistance;
+});
+Clazz_defineMethod (c$, "parse", 
+function () {
+var nf;
+{
+var file =  new StringBuffer ();
+while ((nf = this.nextLine ()) != null) {
+file.append (nf);
+}
+nf = file.toString ();
+}this.root =  new jalview.datamodel.SequenceNode ();
+var realroot = null;
+var c = this.root;
+var d = -1;
+var cp = 0;
+var Error = null;
+var nodename = null;
+var commentString2 = null;
+var DefDistance = 0.001;
+var DefBootstrap = -1;
+var distance = DefDistance;
+var bootstrap = DefBootstrap;
+var ascending = false;
+var majorsyms = jalview.jsdev.RegExp.newRegex (["[(\\['),;]"]);
+var nextcp = 0;
+var ncp = cp;
+var parsednodename = false;
+while (majorsyms.searchFrom (nf, cp) && (Error == null)) {
+var fcp = majorsyms.matchedFrom ();
+var schar;
+switch (schar = nf.charAt (fcp)) {
+case '(':
+if (ascending) {
+Error = this.ErrorStringrange (Error, "Unexpected '('", 7, fcp, nf);
+continue;
+};d++;
+if (c.right () == null) {
+c.setRight ( new jalview.datamodel.SequenceNode (null, c, null, DefDistance, DefBootstrap, false));
+c = c.right ();
+} else {
+if (c.left () != null) {
+var tmpn =  new jalview.datamodel.SequenceNode (null, c, null, 0, 0, true);
+tmpn.SetChildren (c.left (), c.right ());
+c.setRight (tmpn);
+}c.setLeft ( new jalview.datamodel.SequenceNode (null, c, null, DefDistance, DefBootstrap, false));
+c = c.left ();
+}if (realroot == null) {
+realroot = c;
+}nodename = null;
+distance = DefDistance;
+bootstrap = DefBootstrap;
+cp = fcp + 1;
+break;
+case '\'':
+var qnodename = jalview.jsdev.RegExp.newRegex (["'([^']|'')+'"]);
+if (qnodename.searchFrom (nf, fcp)) {
+var nl = qnodename.stringMatched ().length;
+nodename =  String.instantialize (qnodename.stringMatched ().substring (1, nl - 1));
+var xpandquotes = jalview.jsdev.RegExp.perlCode ("s/''/'/");
+var widernodename = xpandquotes.replaceAll (nodename);
+nodename = widernodename;
+nextcp = fcp + nl + 1;
+parsednodename = true;
+} else {
+Error = this.ErrorStringrange (Error, "Unterminated quotes for nodename", 7, fcp, nf);
+}break;
+default:
+if (schar == ';') {
+if (d != -1) {
+Error = this.ErrorStringrange (Error, "Wayward semicolon (depth=" + d + ")", 7, fcp, nf);
+}}if (schar == '[') {
+var comment = jalview.jsdev.RegExp.newRegex (["]"]);
+if (comment.searchFrom (nf, fcp)) {
+nextcp = comment.matchedFrom () + 1;
+this.warningMessage = "Tree file contained comments which may confuse input algorithm.";
+break;
+} else {
+Error = this.ErrorStringrange (Error, "Unterminated comment", 3, fcp, nf);
+};}var fstring = nf.substring (ncp, fcp);
+while (fstring.indexOf (']') > -1) {
+var cstart = fstring.indexOf ('[');
+var cend = fstring.indexOf (']');
+commentString2 = fstring.substring (cstart + 1, cend);
+fstring = fstring.substring (0, cstart) + fstring.substring (cend + 1);
+}
+var uqnodename = jalview.jsdev.RegExp.newRegex (["\\b([^' :;\\](),]+)"]);
+var nbootstrap = jalview.jsdev.RegExp.newRegex (["\\s*([0-9+]+)\\s*:"]);
+var ndist = jalview.jsdev.RegExp.newRegex ([":([-0-9Ee.+]+)"]);
+if (!parsednodename && uqnodename.search (fstring) && ((uqnodename.matchedFromI (1) == 0) || (fstring.charAt (uqnodename.matchedFromI (1) - 1) != ':'))) {
+if (nodename == null) {
+if (this.ReplaceUnderscores) {
+nodename = uqnodename.stringMatchedI (1).$replace ('_', ' ');
+} else {
+nodename = uqnodename.stringMatchedI (1);
+}} else {
+Error = this.ErrorStringrange (Error, "File has broken algorithm - overwritten nodename", 10, fcp, nf);
+}}if (nbootstrap.search (fstring)) {
+if (nbootstrap.stringMatchedI (1).equals (uqnodename.stringMatchedI (1))) {
+nodename = null;
+}if (nodename == null || nodename.length == 0 || nbootstrap.matchedFromI (1) > (uqnodename.matchedFromI (1) + uqnodename.stringMatched ().length)) {
+try {
+bootstrap = ( new Integer (nbootstrap.stringMatchedI (1))).intValue ();
+this.$HasBootstrap = true;
+} catch (e) {
+if (Clazz_exceptionOf (e, Exception)) {
+Error = this.ErrorStringrange (Error, "Can't parse bootstrap value", 4, ncp + nbootstrap.matchedFrom (), nf);
+} else {
+throw e;
+}
+}
+}}var nodehasdistance = false;
+if (ndist.search (fstring)) {
+try {
+distance = ( new Float (ndist.stringMatchedI (1))).floatValue ();
+this.$HasDistances = true;
+nodehasdistance = true;
+} catch (e) {
+if (Clazz_exceptionOf (e, Exception)) {
+Error = this.ErrorStringrange (Error, "Can't parse node distance value", 7, ncp + ndist.matchedFrom (), nf);
+} else {
+throw e;
+}
+}
+}if (ascending) {
+c.setName (nodename);
+c.dist = (this.$HasDistances) ? distance : DefDistance;
+c.setBootstrap ((this.$HasBootstrap) ? bootstrap : DefBootstrap);
+if (c === realroot) {
+this.RootHasDistance = nodehasdistance;
+}this.parseNHXNodeProps (c, commentString2);
+commentString2 = null;
+} else {
+var newnode =  new jalview.datamodel.SequenceNode (null, c, nodename, (this.$HasDistances) ? distance : DefDistance, (this.$HasBootstrap) ? bootstrap : DefBootstrap, false);
+this.parseNHXNodeProps (c, commentString2);
+commentString2 = null;
+if (c.right () == null) {
+c.setRight (newnode);
+} else {
+if (c.left () == null) {
+c.setLeft (newnode);
+} else {
+var newdummy =  new jalview.datamodel.SequenceNode (null, c, null, (this.$HasDistances ? 0 : DefDistance), 0, true);
+newdummy.SetChildren (c.left (), newnode);
+c.setLeft (newdummy);
+}}}if (ascending) {
+c = c.AscendTree ();
+if ((d > -1) && (c == null)) {
+Error = this.ErrorStringrange (Error, "File broke algorithm: Lost place in tree (is there an extra ')' ?)", 7, fcp, nf);
+}}if (nf.charAt (fcp) == ')') {
+d--;
+ascending = true;
+} else {
+if (nf.charAt (fcp) == ',') {
+if (ascending) {
+ascending = false;
+} else {
+if ((c.left () != null) && (!c.left ().isLeaf ())) {
+c = c.left ();
+}}}}nodename = null;
+distance = DefDistance;
+bootstrap = DefBootstrap;
+commentString2 = null;
+parsednodename = false;
+}
+if (nextcp == 0) {
+ncp = cp = fcp + 1;
+} else {
+cp = nextcp;
+nextcp = 0;
+}}
+if (Error != null) {
+throw ( new java.io.IOException (jalview.util.MessageManager.formatMessage ("exception.newfile",  Clazz_newArray (-1, [Error.toString ()]))));
+}if (this.root == null) {
+throw ( new java.io.IOException (jalview.util.MessageManager.formatMessage ("exception.newfile",  Clazz_newArray (-1, [jalview.util.MessageManager.getString ("label.no_tree_read_in")]))));
+}this.root = this.root.right ().detach ();
+if (!this.RootHasDistance) {
+this.root.dist = (this.$HasDistances) ? 0 : DefDistance;
+}});
+Clazz_defineMethod (c$, "parseNHXNodeProps", 
+ function (c, commentString) {
+if (commentString != null && commentString.startsWith ("&&NHX")) {
+var st =  new java.util.StringTokenizer (commentString.substring (5), ":");
+while (st.hasMoreTokens ()) {
+var tok = st.nextToken ();
+var colpos = tok.indexOf ("=");
+if (colpos > -1) {
+var code = tok.substring (0, colpos);
+var value = tok.substring (colpos + 1);
+try {
+if (code.toLowerCase ().equals ("b")) {
+var v = -1;
+var iv =  new Float (value);
+v = iv.intValue ();
+c.setBootstrap (v);
+this.$HasBootstrap = true;
+}} catch (e) {
+if (Clazz_exceptionOf (e, Exception)) {
+System.err.println ("Couldn't parse code '" + code + "' = '" + value + "'");
+e.printStackTrace (System.err);
+} else {
+throw e;
+}
+}
+}}
+}}, "jalview.datamodel.SequenceNode,~S");
+Clazz_defineMethod (c$, "getTree", 
+function () {
+return this.root;
+});
+Clazz_defineMethod (c$, "print", 
+function () {
+{
+var tf =  new StringBuffer ();
+this.print (tf, this.root);
+return (tf.append (";").toString ());
+}});
+Clazz_defineMethod (c$, "print", 
+function (withbootstraps) {
+{
+var boots = this.$HasBootstrap;
+this.$HasBootstrap = withbootstraps;
+var rv = this.print ();
+this.$HasBootstrap = boots;
+return rv;
+}}, "~B");
+Clazz_defineMethod (c$, "print", 
+function (withbootstraps, withdists) {
+{
+var dists = this.$HasDistances;
+this.$HasDistances = withdists;
+var rv = this.print (withbootstraps);
+this.$HasDistances = dists;
+return rv;
+}}, "~B,~B");
+Clazz_defineMethod (c$, "print", 
+function (withbootstraps, withdists, printRootInfo) {
+{
+var rootinfo = printRootInfo;
+this.printRootInfo = printRootInfo;
+var rv = this.print (withbootstraps, withdists);
+this.printRootInfo = rootinfo;
+return rv;
+}}, "~B,~B,~B");
+Clazz_defineMethod (c$, "getQuoteChar", 
+function () {
+return this.QuoteChar;
+});
+Clazz_defineMethod (c$, "setQuoteChar", 
+function (c) {
+var old = this.QuoteChar;
+this.QuoteChar = c;
+return old;
+}, "~S");
+Clazz_defineMethod (c$, "nodeName", 
+ function (name) {
+if (this.NodeSafeName[0].search (name)) {
+return this.QuoteChar + this.NodeSafeName[1].replaceAll (name) + this.QuoteChar;
+} else {
+return this.NodeSafeName[2].replaceAll (name);
+}}, "~S");
+Clazz_defineMethod (c$, "printNodeField", 
+ function (c) {
+return ((c.getName () == null) ? "" : this.nodeName (c.getName ())) + ((this.$HasBootstrap) ? ((c.getBootstrap () > -1) ? ((c.getName () != null ? " " : "") + c.getBootstrap ()) : "") : "") + ((this.$HasDistances) ? (":" + c.dist) : "");
+}, "jalview.datamodel.SequenceNode");
+Clazz_defineMethod (c$, "printRootField", 
+ function (root) {
+return (this.printRootInfo) ? (((root.getName () == null) ? "" : this.nodeName (root.getName ())) + ((this.$HasBootstrap) ? ((root.getBootstrap () > -1) ? ((root.getName () != null ? " " : "") + +root.getBootstrap ()) : "") : "") + ((this.RootHasDistance) ? (":" + root.dist) : "")) : "";
+}, "jalview.datamodel.SequenceNode");
+Clazz_defineMethod (c$, "print", 
+function (tf, root) {
+if (root != null) {
+if (root.isLeaf () && this.printRootInfo) {
+tf.append (this.printRootField (root));
+} else {
+if (root.isDummy ()) {
+this._print (tf, root.right ());
+this._print (tf, root.left ());
+} else {
+tf.append ("(");
+this._print (tf, root.right ());
+if (root.left () != null) {
+tf.append (",");
+}this._print (tf, root.left ());
+tf.append (")" + this.printRootField (root));
+}}}}, "StringBuffer,jalview.datamodel.SequenceNode");
+Clazz_defineMethod (c$, "_print", 
+function (tf, c) {
+if (c != null) {
+if (c.isLeaf ()) {
+tf.append (this.printNodeField (c));
+} else {
+if (c.isDummy ()) {
+this._print (tf, c.left ());
+if (c.left () != null) {
+tf.append (",");
+}this._print (tf, c.right ());
+} else {
+tf.append ("(");
+this._print (tf, c.right ());
+if (c.left () != null) {
+tf.append (",");
+}this._print (tf, c.left ());
+tf.append (")" + this.printNodeField (c));
+}}}}, "StringBuffer,jalview.datamodel.SequenceNode");
+c$.main = Clazz_defineMethod (c$, "main", 
+function (args) {
+try {
+if (args == null || args.length != 1) {
+System.err.println ("Takes one argument - file name of a newick tree file.");
+System.exit (0);
+}var fn =  new java.io.File (args[0]);
+var newickfile =  new StringBuffer ();
+var treefile =  new java.io.BufferedReader ( new java.io.FileReader (fn));
+var l;
+while ((l = treefile.readLine ()) != null) {
+newickfile.append (l);
+}
+treefile.close ();
+System.out.println ("Read file :\n");
+var trf =  new jalview.io.NewickFile (args[0], "File");
+trf.parse ();
+System.out.println ("Original file :\n");
+var nonl = jalview.jsdev.RegExp.newRegex (["\n+", ""]);
+System.out.println (nonl.replaceAll (newickfile.toString ()) + "\n");
+System.out.println ("Parsed file.\n");
+System.out.println ("Default output type for original input.\n");
+System.out.println (trf.print ());
+System.out.println ("Without bootstraps.\n");
+System.out.println (trf.print (false));
+System.out.println ("Without distances.\n");
+System.out.println (trf.print (true, false));
+System.out.println ("Without bootstraps but with distanecs.\n");
+System.out.println (trf.print (false, true));
+System.out.println ("Without bootstraps or distanecs.\n");
+System.out.println (trf.print (false, false));
+System.out.println ("With bootstraps and with distances.\n");
+System.out.println (trf.print (true, true));
+} catch (e) {
+if (Clazz_exceptionOf (e, java.io.IOException)) {
+System.err.println ("Exception\n" + e);
+e.printStackTrace ();
+} else {
+throw e;
+}
+}
+}, "~A");
+});
+Clazz_declarePackage ("jalview.datamodel");
+Clazz_load (["jalview.datamodel.BinaryNode", "java.awt.Color"], "jalview.datamodel.SequenceNode", null, function () {
+c$ = Clazz_decorateAsClass (function () {
+this.dist = 0;
+this.count = 0;
+this.height = 0;
+this.ycount = 0;
+this.color = null;
+this.dummy = false;
+this.placeholder = false;
+Clazz_instantialize (this, arguments);
+}, jalview.datamodel, "SequenceNode", jalview.datamodel.BinaryNode);
+Clazz_prepareFields (c$, function () {
+this.color = java.awt.Color.black;
+});
+Clazz_makeConstructor (c$, 
+function (val, parent, dist, name) {
+Clazz_superConstructor (this, jalview.datamodel.SequenceNode, [val, parent, name]);
+this.dist = dist;
+}, "~O,jalview.datamodel.SequenceNode,~N,~S");
+Clazz_makeConstructor (c$, 
+function (val, parent, name, dist, bootstrap, dummy) {
+Clazz_superConstructor (this, jalview.datamodel.SequenceNode, [val, parent, name]);
+this.dist = dist;
+this.bootstrap = bootstrap;
+this.dummy = dummy;
+}, "~O,jalview.datamodel.SequenceNode,~S,~N,~N,~B");
+Clazz_defineMethod (c$, "isDummy", 
+function () {
+return this.dummy;
+});
+Clazz_defineMethod (c$, "isPlaceholder", 
+function () {
+return this.placeholder;
+});
+Clazz_defineMethod (c$, "setDummy", 
+function (newstate) {
+var oldstate = this.dummy;
+this.dummy = newstate;
+return oldstate;
+}, "~B");
+Clazz_defineMethod (c$, "setPlaceholder", 
+function (Placeholder) {
+this.placeholder = Placeholder;
+}, "~B");
+Clazz_defineMethod (c$, "AscendTree", 
+function () {
+var c = this;
+do {
+c = c.parent ();
+} while ((c != null) && c.dummy);
+return c;
+});
+Clazz_defineMethod (c$, "isSequenceLabel", 
+function () {
+if (this.name != null && this.name.length > 0) {
+for (var c = 0, s = this.name.length; c < s; c++) {
+var q = this.name.charAt (c);
+if ('0' <= q && q <= '9') continue;
+return true;
+}
+}return false;
+});
+});
+Clazz_declarePackage ("jalview.datamodel");
+c$ = Clazz_decorateAsClass (function () {
+this.$element = null;
+this.name = null;
+this.$left = null;
+this.$right = null;
+this.$parent = null;
+this.bootstrap = 0;
+Clazz_instantialize (this, arguments);
+}, jalview.datamodel, "BinaryNode");
+Clazz_makeConstructor (c$, 
+function () {
+this.$left = this.$right = this.$parent = null;
+this.bootstrap = 0;
+});
+Clazz_makeConstructor (c$, 
+function (element, parent, name) {
+this.$element = element;
+this.$parent = parent;
+this.name = name;
+this.$left = this.$right = null;
+}, "~O,jalview.datamodel.BinaryNode,~S");
+Clazz_defineMethod (c$, "element", 
+function () {
+return this.$element;
+});
+Clazz_defineMethod (c$, "setElement", 
+function (v) {
+return this.$element = v;
+}, "~O");
+Clazz_defineMethod (c$, "left", 
+function () {
+return this.$left;
+});
+Clazz_defineMethod (c$, "setLeft", 
+function (n) {
+return this.$left = n;
+}, "jalview.datamodel.BinaryNode");
+Clazz_defineMethod (c$, "right", 
+function () {
+return this.$right;
+});
+Clazz_defineMethod (c$, "setRight", 
+function (n) {
+return this.$right = n;
+}, "jalview.datamodel.BinaryNode");
+Clazz_defineMethod (c$, "parent", 
+function () {
+return this.$parent;
+});
+Clazz_defineMethod (c$, "setParent", 
+function (n) {
+return this.$parent = n;
+}, "jalview.datamodel.BinaryNode");
+Clazz_defineMethod (c$, "isLeaf", 
+function () {
+return (this.$left == null) && (this.$right == null);
+});
+Clazz_defineMethod (c$, "SetChildren", 
+function (leftchild, rightchild) {
+if (leftchild != null) {
+this.setLeft (leftchild);
+leftchild.detach ();
+leftchild.setParent (this);
+}if (rightchild != null) {
+this.setRight (rightchild);
+rightchild.detach ();
+rightchild.setParent (this);
+}}, "jalview.datamodel.BinaryNode,jalview.datamodel.BinaryNode");
+Clazz_defineMethod (c$, "detach", 
+function () {
+if (this.$parent != null) {
+if (this.$parent.$left === this) {
+this.$parent.$left = null;
+} else {
+if (this.$parent.$right === this) {
+this.$parent.$right = null;
+}}}this.$parent = null;
+return this;
+});
+Clazz_defineMethod (c$, "ascendLeft", 
+function () {
+var c = this;
+do {
+c = c.parent ();
+} while ((c != null) && (c.left () != null) && !c.left ().isLeaf ());
+return c;
+});
+Clazz_defineMethod (c$, "ascendRight", 
+function () {
+var c = this;
+do {
+c = c.parent ();
+} while ((c != null) && (c.right () != null) && !c.right ().isLeaf ());
+return c;
+});
+Clazz_defineMethod (c$, "setName", 
+function (name) {
+this.name = name;
+}, "~S");
+Clazz_defineMethod (c$, "getName", 
+function () {
+return this.name;
+});
+Clazz_defineMethod (c$, "setBootstrap", 
+function (boot) {
+this.bootstrap = boot;
+}, "~N");
+Clazz_defineMethod (c$, "getBootstrap", 
+function () {
+return this.bootstrap;
+});
+Clazz_declarePackage ("jalview.appletgui");
+Clazz_load (["jalview.appletgui.JVDialog"], "jalview.appletgui.EditNameDialog", ["awt2swing.Label", "$.Panel", "$.TextField", "java.awt.BorderLayout", "$.Font"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.id = null;
+this.description = null;
+Clazz_instantialize (this, arguments);
+}, jalview.appletgui, "EditNameDialog", jalview.appletgui.JVDialog);
+Clazz_overrideMethod (c$, "getName", 
+function () {
+return this.id.getText ();
+});
+Clazz_defineMethod (c$, "getDescription", 
+function () {
+if (this.description.getText ().length < 1) {
+return null;
+} else {
+return this.description.getText ();
+}});
+Clazz_makeConstructor (c$, 
+function (name, desc, label1, label2, owner, title, width, height, display) {
+Clazz_superConstructor (this, jalview.appletgui.EditNameDialog, [owner, title, true, width, height]);
+var mono =  new java.awt.Font ("Monospaced", 0, 12);
+var panel =  new awt2swing.Panel ( new java.awt.BorderLayout ());
+var panel2 =  new awt2swing.Panel ( new java.awt.BorderLayout ());
+this.id =  new awt2swing.TextField (name, 40);
+this.id.setFont (mono);
+var label =  new awt2swing.Label (label1);
+label.setFont (mono);
+panel2.add (label, "West");
+panel2.add (this.id, "Center");
+panel.add (panel2, "North");
+if (label2 != null) {
+panel2 =  new awt2swing.Panel ( new java.awt.BorderLayout ());
+this.description =  new awt2swing.TextField (desc, 40);
+this.description.setFont (mono);
+label =  new awt2swing.Label (label2);
+label.setFont (mono);
+panel2.add (label, "West");
+panel2.add (this.description, "Center");
+panel.add (panel2, "Center");
+}this.setMainPanel (panel);
+this.setVisible (display);
+}, "~S,~S,~S,~S,awt2swing.Frame,~S,~N,~N,~B");
+});
+Clazz_declarePackage ("awt2swing");
+Clazz_load (["javax.swing.JTextField"], "awt2swing.TextField", ["java.awt.event.TextEvent", "javax.swing.event.DocumentListener"], function () {
+c$ = Clazz_declareType (awt2swing, "TextField", javax.swing.JTextField);
+Clazz_defineMethod (c$, "addTextListener", 
+function (textListener) {
+this.getDocument ().addDocumentListener (((Clazz_isClassDefined ("awt2swing.TextField$1") ? 0 : awt2swing.TextField.$TextField$1$ ()), Clazz_innerTypeInstance (awt2swing.TextField$1, this, Clazz_cloneFinals ("textListener", textListener))));
+}, "java.awt.event.TextListener");
+c$.$TextField$1$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_declareAnonymous (awt2swing, "TextField$1", null, javax.swing.event.DocumentListener);
+Clazz_overrideMethod (c$, "insertUpdate", 
+function (e) {
+}, "javax.swing.event.DocumentEvent");
+Clazz_overrideMethod (c$, "removeUpdate", 
+function (e) {
+}, "javax.swing.event.DocumentEvent");
+Clazz_overrideMethod (c$, "changedUpdate", 
+function (e) {
+this.f$.textListener.textValueChanged ( new java.awt.event.TextEvent (this, 0));
+}, "javax.swing.event.DocumentEvent");
+c$ = Clazz_p0p ();
+};
+});
+Clazz_declarePackage ("java.awt.event");
+Clazz_load (["java.awt.AWTEvent"], "java.awt.event.TextEvent", null, function () {
+c$ = Clazz_declareType (java.awt.event, "TextEvent", java.awt.AWTEvent);
+Clazz_overrideMethod (c$, "paramString", 
+function () {
+var typeStr;
+switch (this.id) {
+case 900:
+typeStr = "TEXT_VALUE_CHANGED";
+break;
+default:
+typeStr = "unknown type";
+}
+return typeStr;
+});
+Clazz_defineStatics (c$,
+"TEXT_FIRST", 900,
+"TEXT_LAST", 900,
+"TEXT_VALUE_CHANGED", 900);
+});
+Clazz_declarePackage ("jalview.appletgui");
+Clazz_load (null, "jalview.appletgui.PaintRefresher", ["jalview.appletgui.AlignmentPanel", "java.util.Hashtable", "$.Vector"], function () {
+c$ = Clazz_declareType (jalview.appletgui, "PaintRefresher");
+c$.Register = Clazz_defineMethod (c$, "Register", 
+function (comp, seqSetId) {
+if (jalview.appletgui.PaintRefresher.components == null) {
+jalview.appletgui.PaintRefresher.components =  new java.util.Hashtable ();
+}if (jalview.appletgui.PaintRefresher.components.containsKey (seqSetId)) {
+var comps = jalview.appletgui.PaintRefresher.components.get (seqSetId);
+if (!comps.contains (comp)) {
+comps.addElement (comp);
+}} else {
+var vcoms =  new java.util.Vector ();
+vcoms.addElement (comp);
+jalview.appletgui.PaintRefresher.components.put (seqSetId, vcoms);
+}}, "java.awt.Component,~S");
+c$.RemoveComponent = Clazz_defineMethod (c$, "RemoveComponent", 
+function (comp) {
+if (jalview.appletgui.PaintRefresher.components == null) {
+return;
+}var en = jalview.appletgui.PaintRefresher.components.keys ();
+while (en.hasMoreElements ()) {
+var id = en.nextElement ().toString ();
+var comps = jalview.appletgui.PaintRefresher.components.get (id);
+comps.removeElement (comp);
+if (comps.size () == 0) {
+jalview.appletgui.PaintRefresher.components.remove (id);
+}}
+}, "java.awt.Component");
+c$.Refresh = Clazz_defineMethod (c$, "Refresh", 
+function (source, id) {
+jalview.appletgui.PaintRefresher.Refresh (source, id, false, false);
+}, "java.awt.Component,~S");
+c$.Refresh = Clazz_defineMethod (c$, "Refresh", 
+function (source, id, alignmentChanged, validateSequences) {
+if (jalview.appletgui.PaintRefresher.components == null) {
+return;
+}var comp;
+var comps = jalview.appletgui.PaintRefresher.components.get (id);
+if (comps == null) {
+return;
+}var e = comps.elements ();
+while (e.hasMoreElements ()) {
+comp = e.nextElement ();
+if (comp === source) {
+continue;
+}if (!comp.isValid ()) {
+comps.removeElement (comp);
+} else if (validateSequences && Clazz_instanceOf (comp, jalview.appletgui.AlignmentPanel) && Clazz_instanceOf (source, jalview.appletgui.AlignmentPanel)) {
+jalview.appletgui.PaintRefresher.validateSequences ((source).av.getAlignment (), (comp).av.getAlignment ());
+}if (Clazz_instanceOf (comp, jalview.appletgui.AlignmentPanel) && alignmentChanged) {
+(comp).alignmentChanged ();
+}comp.repaint ();
+}
+}, "java.awt.Component,~S,~B,~B");
+c$.validateSequences = Clazz_defineMethod (c$, "validateSequences", 
+function (source, comp) {
+var a1;
+if (source.getHiddenSequences ().getSize () > 0) {
+a1 = source.getHiddenSequences ().getFullAlignment ().getSequencesArray ();
+} else {
+a1 = source.getSequencesArray ();
+}var a2;
+if (comp.getHiddenSequences ().getSize () > 0) {
+a2 = comp.getHiddenSequences ().getFullAlignment ().getSequencesArray ();
+} else {
+a2 = comp.getSequencesArray ();
+}var i;
+var iSize = a1.length;
+var j;
+var jSize = a2.length;
+if (iSize == jSize) {
+return;
+}var exists = false;
+for (i = 0; i < iSize; i++) {
+exists = false;
+for (j = 0; j < jSize; j++) {
+if (a2[j] === a1[i]) {
+exists = true;
+break;
+}}
+if (!exists) {
+if (i < comp.getHeight ()) {
+var alsq;
+{
+alsq.add (i, a1[i]);
+}} else {
+comp.addSequence (a1[i]);
+}if (comp.getHiddenSequences ().getSize () > 0) {
+a2 = comp.getHiddenSequences ().getFullAlignment ().getSequencesArray ();
+} else {
+a2 = comp.getSequencesArray ();
+}jSize = a2.length;
+}}
+iSize = a1.length;
+jSize = a2.length;
+for (j = 0; j < jSize; j++) {
+exists = false;
+for (i = 0; i < iSize; i++) {
+if (a2[j] === a1[i]) {
+exists = true;
+break;
+}}
+if (!exists) {
+comp.deleteSequence (a2[j]);
+}}
+}, "jalview.datamodel.AlignmentI,jalview.datamodel.AlignmentI");
+c$.getAssociatedPanels = Clazz_defineMethod (c$, "getAssociatedPanels", 
+function (id) {
+var comps = jalview.appletgui.PaintRefresher.components.get (id);
+var tmp =  new java.util.Vector ();
+var i;
+var iSize = comps.size ();
+for (i = 0; i < iSize; i++) {
+if (Clazz_instanceOf (comps.elementAt (i), jalview.appletgui.AlignmentPanel)) {
+tmp.addElement (comps.elementAt (i));
+}}
+var result =  new Array (tmp.size ());
+for (var ix = 0; ix < result.length; ix++) {
+result[ix] = tmp.elementAt (ix);
+}
+return result;
+}, "~S");
+Clazz_defineStatics (c$,
+"components", null);
+});
+Clazz_declarePackage ("jalview.appletgui");
+Clazz_load (null, "jalview.appletgui.Tooltip", ["awt2swing.Frame", "java.applet.Applet", "java.awt.Toolkit"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.tip = null;
+this.lastTip = "";
+this.setPosition = false;
+this.owner = null;
+this.mainContainer = null;
+this.mainLayout = null;
+this.shown = false;
+this.VERTICAL_OFFSET = 20;
+this.HORIZONTAL_ENLARGE = 10;
+this.fontHeight = 0;
+this.linkImage = null;
+this.fm = null;
+Clazz_instantialize (this, arguments);
+}, jalview.appletgui, "Tooltip");
+Clazz_defineMethod (c$, "setVisible", 
+function (b) {
+}, "~B");
+Clazz_makeConstructor (c$, 
+function (tip, owner) {
+this.owner = owner;
+this.setTip (tip);
+var url = this.getClass ().getResource ("/images/link.gif");
+if (url != null) {
+this.linkImage = java.awt.Toolkit.getDefaultToolkit ().getImage (url);
+}}, "~S,java.awt.Component");
+Clazz_defineMethod (c$, "setTip", 
+function (tip) {
+System.err.println ("Tooltip: " + tip);
+}, "~S");
+Clazz_defineMethod (c$, "setTipLocation", 
+function (evt) {
+}, "java.awt.event.MouseEvent");
+Clazz_defineMethod (c$, "removeToolTip", 
+ function () {
+});
+Clazz_defineMethod (c$, "mouseEntered", 
+function (me) {
+this.setTipLocation (me);
+}, "java.awt.event.MouseEvent");
+Clazz_defineMethod (c$, "mouseExited", 
+function (me) {
+this.removeToolTip ();
+}, "java.awt.event.MouseEvent");
+Clazz_defineMethod (c$, "mousePressed", 
+function (me) {
+this.removeToolTip ();
+}, "java.awt.event.MouseEvent");
+Clazz_defineMethod (c$, "mouseReleased", 
+function (me) {
+}, "java.awt.event.MouseEvent");
+Clazz_defineMethod (c$, "mouseClicked", 
+function (me) {
+}, "java.awt.event.MouseEvent");
+Clazz_defineMethod (c$, "mouseMoved", 
+function (me) {
+if (!this.shown) {
+this.setTipLocation (me);
+} else if (this.setPosition) {
+this.setTipLocation (me);
+}}, "java.awt.event.MouseEvent");
+Clazz_defineMethod (c$, "mouseDragged", 
+function (me) {
+}, "java.awt.event.MouseEvent");
+});
+Clazz_declarePackage ("jalview.util");
+Clazz_load (["java.lang.StringBuffer", "java.util.ArrayList", "java.util.regex.Pattern"], "jalview.util.ParseHtmlBodyAndLinks", ["java.util.StringTokenizer"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.orig = null;
+this.htmlContent = true;
+this.links = null;
+this.sb = null;
+Clazz_instantialize (this, arguments);
+}, jalview.util, "ParseHtmlBodyAndLinks");
+Clazz_prepareFields (c$, function () {
+this.links =  new java.util.ArrayList ();
+this.sb =  new StringBuffer ();
+});
+Clazz_defineMethod (c$, "getOrig", 
+function () {
+return this.orig;
+});
+Clazz_defineMethod (c$, "isHtmlContent", 
+function () {
+return this.htmlContent;
+});
+Clazz_defineMethod (c$, "getContent", 
+function () {
+return this.sb.toString ();
+});
+Clazz_defineMethod (c$, "getLinks", 
+function () {
+return this.links;
+});
+Clazz_makeConstructor (c$, 
+function (description, removeHTML, newline) {
+if (description == null || description.length == 0) {
+this.htmlContent = false;
+return;
+}if (description.toUpperCase ().indexOf ("<HTML>") == -1) {
+this.htmlContent = false;
+}this.orig = description;
+var st =  new java.util.StringTokenizer (description, "<");
+var token;
+var link;
+var startTag;
+var tag = null;
+while (st.hasMoreElements ()) {
+token = st.nextToken ("&>");
+if (token.equalsIgnoreCase ("html") || token.startsWith ("/")) {
+continue;
+}tag = null;
+startTag = token.indexOf ("<");
+if (startTag > -1) {
+tag = token.substring (startTag + 1);
+token = token.substring (0, startTag);
+}if (tag != null && tag.toUpperCase ().startsWith ("A HREF=")) {
+if (token.length > 0) {
+this.sb.append (token);
+}link = tag.substring (tag.indexOf ("\"") + 1, tag.length - 1);
+var label = st.nextToken ("<>");
+this.links.add (label + "|" + link);
+this.sb.append (label + "%LINK%");
+} else if (tag != null && tag.equalsIgnoreCase ("br")) {
+this.sb.append (newline);
+} else if (token.startsWith ("lt;")) {
+this.sb.append ("<" + token.substring (3));
+} else if (token.startsWith ("gt;")) {
+this.sb.append (">" + token.substring (3));
+} else if (token.startsWith ("amp;")) {
+this.sb.append ("&" + token.substring (4));
+} else {
+this.sb.append (token);
+}}
+if (removeHTML && !this.htmlContent) {
+this.sb =  new StringBuffer (jalview.util.ParseHtmlBodyAndLinks.LEFT_ANGLE_BRACKET_PATTERN.matcher (description).replaceAll ("&lt;"));
+}}, "~S,~B,~S");
+Clazz_defineMethod (c$, "getNonHtmlContent", 
+function () {
+return this.isHtmlContent () ? this.sb.toString () : this.orig;
+});
+c$.LEFT_ANGLE_BRACKET_PATTERN = c$.prototype.LEFT_ANGLE_BRACKET_PATTERN = java.util.regex.Pattern.compile ("<");
+});
+Clazz_declarePackage ("jalview.appletgui");
+Clazz_load (["awt2swing.Panel", "jalview.renderer.AwtRenderPanelI", "java.awt.event.ActionListener", "$.AdjustmentListener", "$.MouseListener", "$.MouseMotionListener", "java.awt.Color"], "jalview.appletgui.AnnotationPanel", ["awt2swing.MenuItem", "$.PopupMenu", "$.Util", "jalview.appletgui.EditNameDialog", "$.UserDefinedColours", "jalview.datamodel.Annotation", "jalview.renderer.AnnotationRenderer", "jalview.util.MessageManager", "$.Platform", "java.awt.Dimension", "java.lang.StringBuffer"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.av = null;
+this.ap = null;
+this.activeRow = -1;
+this.HELIX = "Helix";
+this.SHEET = "Sheet";
+this.STEM = "RNA Helix";
+this.LABEL = "Label";
+this.REMOVE = "Remove Annotation";
+this.COLOUR = "Colour";
+this.HELIX_COLOUR = null;
+this.SHEET_COLOUR = null;
+this.image = null;
+this.gg = null;
+this.fm = null;
+this.imgWidth = 0;
+this.$fastPaint = false;
+this.graphStretch = -1;
+this.graphStretchY = -1;
+this.mouseDragging = false;
+this.MAC = false;
+this.renderer = null;
+this.needValidating = false;
+this.scrollOffset = 0;
+this.$bounds = null;
+Clazz_instantialize (this, arguments);
+}, jalview.appletgui, "AnnotationPanel", awt2swing.Panel, [jalview.renderer.AwtRenderPanelI, java.awt.event.AdjustmentListener, java.awt.event.ActionListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener]);
+Clazz_prepareFields (c$, function () {
+this.HELIX_COLOUR = java.awt.Color.red.darker ();
+this.SHEET_COLOUR = java.awt.Color.green.darker ().darker ();
+this.$bounds =  Clazz_newIntArray (2, 0);
+});
+Clazz_makeConstructor (c$, 
+function (ap) {
+Clazz_superConstructor (this, jalview.appletgui.AnnotationPanel, []);
+this.MAC = jalview.util.Platform.isAMac ();
+this.ap = ap;
+this.av = ap.av;
+this.setLayout (null);
+var height = this.adjustPanelHeight ();
+ap.apvscroll.setValues (0, this.getSize ().height, 0, height);
+this.addMouseMotionListener (this);
+this.addMouseListener (this);
+this.renderer =  new jalview.renderer.AnnotationRenderer ();
+}, "jalview.appletgui.AlignmentPanel");
+Clazz_makeConstructor (c$, 
+function (av) {
+Clazz_superConstructor (this, jalview.appletgui.AnnotationPanel, []);
+this.av = av;
+this.renderer =  new jalview.renderer.AnnotationRenderer ();
+}, "jalview.appletgui.AlignViewport");
+Clazz_overrideMethod (c$, "adjustmentValueChanged", 
+function (evt) {
+}, "java.awt.event.AdjustmentEvent");
+Clazz_overrideMethod (c$, "actionPerformed", 
+function (evt) {
+var aa = this.av.getAlignment ().getAlignmentAnnotation ();
+if (aa == null) {
+return;
+}var anot = aa[this.activeRow].annotations;
+if (anot.length < this.av.getColumnSelection ().getMax ()) {
+var temp =  new Array (this.av.getColumnSelection ().getMax () + 2);
+System.arraycopy (anot, 0, temp, 0, anot.length);
+anot = temp;
+aa[this.activeRow].annotations = anot;
+}var label = "";
+if (this.av.getColumnSelection () != null && this.av.getColumnSelection ().size () > 0 && anot[this.av.getColumnSelection ().getMin ()] != null) {
+label = anot[this.av.getColumnSelection ().getMin ()].displayCharacter;
+}if (evt.getActionCommand ().equals ("Remove Annotation")) {
+for (var i = 0; i < this.av.getColumnSelection ().size (); i++) {
+anot[this.av.getColumnSelection ().columnAt (i)] = null;
+}
+} else if (evt.getActionCommand ().equals ("Label")) {
+label = this.enterLabel (label, "Enter Label");
+if (label == null) {
+return;
+}if ((label.length > 0) && !aa[this.activeRow].hasText) {
+aa[this.activeRow].hasText = true;
+}for (var i = 0; i < this.av.getColumnSelection ().size (); i++) {
+var index = this.av.getColumnSelection ().columnAt (i);
+if (!this.av.getColumnSelection ().isVisible (index)) {
+continue;
+}if (anot[index] == null) {
+anot[index] =  new jalview.datamodel.Annotation (label, "", ' ', 0);
+}anot[index].displayCharacter = label;
+}
+} else if (evt.getActionCommand ().equals ("Colour")) {
+var udc =  new jalview.appletgui.UserDefinedColours (this, java.awt.Color.black, this.ap.alignFrame);
+var col = udc.getColor ();
+for (var i = 0; i < this.av.getColumnSelection ().size (); i++) {
+var index = this.av.getColumnSelection ().columnAt (i);
+if (!this.av.getColumnSelection ().isVisible (index)) {
+continue;
+}if (anot[index] == null) {
+anot[index] =  new jalview.datamodel.Annotation ("", "", ' ', 0);
+}anot[index].colour = col;
+}
+} else {
+var type = String.fromCharCode (0);
+var symbol = "\u03B1";
+if (evt.getActionCommand ().equals ("Helix")) {
+type = 'H';
+} else if (evt.getActionCommand ().equals ("Sheet")) {
+type = 'E';
+symbol = "\u03B2";
+} else if (evt.getActionCommand ().equals ("RNA Helix")) {
+type = 'S';
+symbol = "\u03C3";
+}if (!aa[this.activeRow].hasIcons) {
+aa[this.activeRow].hasIcons = true;
+}label = this.enterLabel (symbol, "Enter Label");
+if (label == null) {
+return;
+}if ((label.length > 0) && !aa[this.activeRow].hasText) {
+aa[this.activeRow].hasText = true;
+if (evt.getActionCommand ().equals ("RNA Helix")) {
+aa[this.activeRow].showAllColLabels = true;
+}}for (var i = 0; i < this.av.getColumnSelection ().size (); i++) {
+var index = this.av.getColumnSelection ().columnAt (i);
+if (!this.av.getColumnSelection ().isVisible (index)) {
+continue;
+}if (anot[index] == null) {
+anot[index] =  new jalview.datamodel.Annotation (label, "", type, 0);
+}anot[index].secondaryStructure = type != 'S' ? type : label.length == 0 ? ' ' : label.charAt (0);
+anot[index].displayCharacter = label;
+}
+}this.av.getAlignment ().validateAnnotation (aa[this.activeRow]);
+this.ap.alignmentChanged ();
+this.adjustPanelHeight ();
+this.repaint ();
+return;
+}, "java.awt.event.ActionEvent");
+Clazz_defineMethod (c$, "enterLabel", 
+function (text, label) {
+var dialog =  new jalview.appletgui.EditNameDialog (text, null, label, null, this.ap.alignFrame, "Enter Label", 400, 200, true);
+if (dialog.accept) {
+return dialog.getName ();
+} else {
+return null;
+}}, "~S,~S");
+Clazz_overrideMethod (c$, "mousePressed", 
+function (evt) {
+var aa = this.av.getAlignment ().getAlignmentAnnotation ();
+if (aa == null) {
+return;
+}var height = -this.scrollOffset;
+this.activeRow = -1;
+for (var i = 0; i < aa.length; i++) {
+if (aa[i].visible) {
+height += aa[i].height;
+}if (evt.getY () < height) {
+if (aa[i].editable) {
+this.activeRow = i;
+} else if (aa[i].graph > 0) {
+this.graphStretch = i;
+this.graphStretchY = evt.getY ();
+}break;
+}}
+if ((evt.getModifiers () & 4) == 4 && this.activeRow != -1) {
+if (this.av.getColumnSelection () == null) {
+return;
+}var pop =  new awt2swing.PopupMenu (jalview.util.MessageManager.getString ("label.structure_type"));
+var item;
+if (this.av.getAlignment ().isNucleotide () == true) {
+item =  new awt2swing.MenuItem ("RNA Helix");
+item.addActionListener (this);
+pop.add (item);
+} else {
+item =  new awt2swing.MenuItem ("Helix");
+item.addActionListener (this);
+pop.add (item);
+item =  new awt2swing.MenuItem ("Sheet");
+item.addActionListener (this);
+pop.add (item);
+}item =  new awt2swing.MenuItem ("Label");
+item.addActionListener (this);
+pop.add (item);
+item =  new awt2swing.MenuItem ("Colour");
+item.addActionListener (this);
+pop.add (item);
+item =  new awt2swing.MenuItem ("Remove Annotation");
+item.addActionListener (this);
+pop.add (item);
+this.ap.alignFrame.add (pop);
+pop.show (this, evt.getX (), evt.getY ());
+return;
+}this.ap.scalePanel.mousePressed (evt);
+}, "java.awt.event.MouseEvent");
+Clazz_overrideMethod (c$, "mouseReleased", 
+function (evt) {
+this.graphStretch = -1;
+this.graphStretchY = -1;
+this.mouseDragging = false;
+if (this.needValidating) {
+this.ap.validate ();
+this.needValidating = false;
+}this.ap.scalePanel.mouseReleased (evt);
+}, "java.awt.event.MouseEvent");
+Clazz_overrideMethod (c$, "mouseClicked", 
+function (evt) {
+}, "java.awt.event.MouseEvent");
+Clazz_overrideMethod (c$, "mouseDragged", 
+function (evt) {
+if (this.graphStretch > -1) {
+this.av.getAlignment ().getAlignmentAnnotation ()[this.graphStretch].graphHeight += this.graphStretchY - evt.getY ();
+if (this.av.getAlignment ().getAlignmentAnnotation ()[this.graphStretch].graphHeight < 0) {
+this.av.getAlignment ().getAlignmentAnnotation ()[this.graphStretch].graphHeight = 0;
+}this.graphStretchY = evt.getY ();
+this.av.calcPanelHeight ();
+this.needValidating = true;
+this.ap.paintAlignment (true);
+} else {
+this.ap.scalePanel.mouseDragged (evt);
+}}, "java.awt.event.MouseEvent");
+Clazz_overrideMethod (c$, "mouseMoved", 
+function (evt) {
+var aa = this.av.getAlignment ().getAlignmentAnnotation ();
+if (aa == null) {
+return;
+}var row = -1;
+var height = -this.scrollOffset;
+for (var i = 0; i < aa.length; i++) {
+if (aa[i].visible) {
+height += aa[i].height;
+}if (evt.getY () < height) {
+row = i;
+break;
+}}
+var res = Clazz_doubleToInt (evt.getX () / this.av.getCharWidth ()) + this.av.getStartRes ();
+if (this.av.hasHiddenColumns ()) {
+res = this.av.getColumnSelection ().adjustForHiddenColumns (res);
+}if (row > -1 && res < aa[row].annotations.length && aa[row].annotations[res] != null) {
+var text =  new StringBuffer ("Sequence position " + (res + 1));
+if (aa[row].annotations[res].description != null) {
+text.append ("  " + aa[row].annotations[res].description);
+}this.ap.alignFrame.setStatus (text.toString ());
+}}, "java.awt.event.MouseEvent");
+Clazz_overrideMethod (c$, "mouseEntered", 
+function (evt) {
+this.ap.scalePanel.mouseEntered (evt);
+}, "java.awt.event.MouseEvent");
+Clazz_overrideMethod (c$, "mouseExited", 
+function (evt) {
+this.ap.scalePanel.mouseExited (evt);
+}, "java.awt.event.MouseEvent");
+Clazz_defineMethod (c$, "adjustPanelHeight", 
+function () {
+return this.adjustPanelHeight (true);
+});
+Clazz_defineMethod (c$, "adjustPanelHeight", 
+function (repaint) {
+var height = this.av.calcPanelHeight ();
+this.setSize ( new java.awt.Dimension (this.getSize ().width, height));
+if (repaint) {
+this.repaint ();
+}return height;
+}, "~B");
+Clazz_defineMethod (c$, "addEditableColumn", 
+function (i) {
+if (this.activeRow == -1) {
+var aa = this.av.getAlignment ().getAlignmentAnnotation ();
+if (aa == null) {
+return;
+}for (var j = 0; j < aa.length; j++) {
+if (aa[j].editable) {
+this.activeRow = j;
+break;
+}}
+}}, "~N");
+Clazz_overrideMethod (c$, "paintComponent", 
+function (g) {
+if (this.av.getWrapAlignment () || !this.av.isShowAnnotation ()) return;
+var d = this.getSize ();
+this.imgWidth = d.width;
+if (this.imgWidth < 1 || d.height < 1) {
+return;
+}if (this.image == null || this.imgWidth != this.image.getWidth (this) || d.height != this.image.getHeight (this)) {
+this.image = this.createImage (this.imgWidth, d.height);
+this.gg = this.image.getGraphics ();
+this.gg.setFont (this.av.getFont ());
+this.fm = this.gg.getFontMetrics ();
+this.$fastPaint = false;
+}if (this.$fastPaint) {
+g.drawImage (this.image, 0, 0, this);
+this.$fastPaint = false;
+return;
+}this.gg.setColor (java.awt.Color.white);
+this.gg.fillRect (0, 0, this.getSize ().width, this.getSize ().height);
+this.drawComponent (this.gg, this.av.startRes, this.av.endRes + 1);
+g.drawImage (this.image, 0, 0, this);
+}, "java.awt.Graphics");
+Clazz_defineMethod (c$, "fastPaint", 
+function (horizontal) {
+if (horizontal == 0 || this.av.getAlignment ().getAlignmentAnnotation () == null || this.av.getAlignment ().getAlignmentAnnotation ().length < 1) {
+this.repaint ();
+return;
+}this.gg.copyArea (0, 0, this.imgWidth, this.getSize ().height, -horizontal * this.av.getCharWidth (), 0);
+var sr = this.av.startRes;
+var er = this.av.endRes + 1;
+var transX = 0;
+if (horizontal > 0) {
+transX = (er - sr - horizontal) * this.av.getCharWidth ();
+sr = er - horizontal;
+} else if (horizontal < 0) {
+er = sr - horizontal;
+}this.gg.translate (transX, 0);
+this.drawComponent (this.gg, sr, er);
+this.gg.translate (-transX, 0);
+this.$fastPaint = true;
+this.repaint ();
+}, "~N");
+Clazz_defineMethod (c$, "drawComponent", 
+function (g, startRes, endRes) {
+var ofont = this.av.getFont ();
+g.setFont (ofont);
+g.setColor (java.awt.Color.white);
+g.fillRect (0, 0, (endRes - startRes) * this.av.getCharWidth (), this.getSize ().height);
+if (this.fm == null) {
+this.fm = g.getFontMetrics ();
+}if ((this.av.getAlignment ().getAlignmentAnnotation () == null) || (this.av.getAlignment ().getAlignmentAnnotation ().length < 1)) {
+g.setColor (java.awt.Color.white);
+g.fillRect (0, 0, this.getSize ().width, this.getSize ().height);
+g.setColor (java.awt.Color.black);
+if (this.av.validCharWidth) {
+awt2swing.Util.drawString (g, jalview.util.MessageManager.getString ("label.alignment_has_no_annotations"), 20, 15);
+}return;
+}g.translate (0, -this.scrollOffset);
+this.renderer.drawComponent (this, this.av, g, this.activeRow, startRes, endRes);
+g.translate (0, +this.scrollOffset);
+}, "java.awt.Graphics,~N,~N");
+Clazz_defineMethod (c$, "setScrollOffset", 
+function (value, repaint) {
+this.scrollOffset = value;
+if (repaint) {
+this.repaint ();
+}}, "~N,~B");
+Clazz_defineMethod (c$, "getFontMetrics", 
+function () {
+return this.fm;
+});
+Clazz_overrideMethod (c$, "getFadedImage", 
+function () {
+return this.image;
+});
+Clazz_overrideMethod (c$, "getFadedImageWidth", 
+function () {
+return this.imgWidth;
+});
+Clazz_overrideMethod (c$, "getVisibleVRange", 
+function () {
+if (this.ap != null && this.ap.alabels != null) {
+var sOffset = -this.ap.alabels.scrollOffset;
+var visHeight = sOffset + this.ap.annotationPanelHolder.getHeight ();
+this.$bounds[0] = sOffset;
+this.$bounds[1] = visHeight;
+return this.$bounds;
+} else {
+return null;
+}});
+Clazz_defineStatics (c$,
+"GRAPH_HEIGHT", 40);
+});
+Clazz_declarePackage ("jalview.renderer");
+Clazz_load (["java.awt.image.ImageObserver"], "jalview.renderer.AwtRenderPanelI", null, function () {
+Clazz_declareInterface (jalview.renderer, "AwtRenderPanelI", java.awt.image.ImageObserver);
+});
+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$, 
+ 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);
+}, "~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.findColourSeq (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", 
+ 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);
+});
+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(self.c$);
+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 ();
+};
+});
+Clazz_declarePackage ("jalview.appletgui");
+Clazz_load (["awt2swing.Panel", "java.awt.event.ActionListener", "$.AdjustmentListener", "$.ItemListener", "$.MouseListener", "awt2swing.Button", "$.Checkbox", "$.Choice", "$.Scrollbar", "$.TextField", "java.awt.BorderLayout", "$.FlowLayout"], "jalview.appletgui.AnnotationColourChooser", ["awt2swing.Frame", "jalview.appletgui.UserDefinedColours", "jalview.bin.JalviewLite", "jalview.datamodel.GraphLine", "jalview.schemes.AnnotationColourGradient", "$.ColourSchemeI", "jalview.util.MessageManager", "java.awt.Color", "$.Dimension", "$.Font", "java.lang.Error", "$.Float", "java.util.Hashtable", "$.Vector"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.frame = null;
+this.av = null;
+this.ap = null;
+this.oldcs = null;
+this.oldgroupColours = null;
+this.currentAnnotation = null;
+this.adjusting = false;
+this.annotations = null;
+this.minColour = null;
+this.maxColour = null;
+this.ok = null;
+this.cancel = null;
+this.defColours = null;
+this.jPanel1 = null;
+this.jPanel2 = null;
+this.threshold = null;
+this.flowLayout1 = null;
+this.jPanel3 = null;
+this.slider = null;
+this.thresholdValue = null;
+this.currentColours = null;
+this.borderLayout1 = null;
+this.thresholdIsMin = null;
+Clazz_instantialize (this, arguments);
+}, jalview.appletgui, "AnnotationColourChooser", awt2swing.Panel, [java.awt.event.ActionListener, java.awt.event.AdjustmentListener, java.awt.event.ItemListener, java.awt.event.MouseListener]);
+Clazz_prepareFields (c$, function () {
+this.annotations =  new awt2swing.Choice ();
+this.minColour =  new awt2swing.Button ();
+this.maxColour =  new awt2swing.Button ();
+this.ok =  new awt2swing.Button ();
+this.cancel =  new awt2swing.Button ();
+this.defColours =  new awt2swing.Button ();
+this.jPanel1 =  new awt2swing.Panel ();
+this.jPanel2 =  new awt2swing.Panel ();
+this.threshold =  new awt2swing.Choice ();
+this.flowLayout1 =  new java.awt.FlowLayout ();
+this.jPanel3 =  new awt2swing.Panel ();
+this.slider =  new awt2swing.Scrollbar (0);
+this.thresholdValue =  new awt2swing.TextField (20);
+this.currentColours =  new awt2swing.Checkbox ();
+this.borderLayout1 =  new java.awt.BorderLayout ();
+this.thresholdIsMin =  new awt2swing.Checkbox ();
+});
+Clazz_makeConstructor (c$, 
+function (av, ap) {
+Clazz_superConstructor (this, jalview.appletgui.AnnotationColourChooser, []);
+try {
+this.jbInit ();
+} catch (ex) {
+if (Clazz_exceptionOf (ex, Exception)) {
+} else {
+throw ex;
+}
+}
+this.oldcs = av.getGlobalColourScheme ();
+if (av.getAlignment ().getGroups () != null) {
+this.oldgroupColours =  new java.util.Hashtable ();
+for (var sg, $sg = ap.av.getAlignment ().getGroups ().iterator (); $sg.hasNext () && ((sg = $sg.next ()) || true);) {
+if (sg.cs != null) {
+this.oldgroupColours.put (sg, sg.cs);
+} else {
+this.oldgroupColours.put (sg, "null");
+}}
+}this.av = av;
+this.ap = ap;
+this.slider.addAdjustmentListener (this);
+this.slider.addMouseListener (this);
+if (av.getAlignment ().getAlignmentAnnotation () == null) {
+return;
+}this.setDefaultMinMax ();
+this.adjusting = true;
+if (Clazz_instanceOf (this.oldcs, jalview.schemes.AnnotationColourGradient)) {
+var acg = this.oldcs;
+this.currentColours.setState (acg.isPredefinedColours () || acg.getBaseColour () != null);
+if (!acg.isPredefinedColours () && acg.getBaseColour () == null) {
+this.minColour.setBackground (acg.getMinColour ());
+this.maxColour.setBackground (acg.getMaxColour ());
+}}var list =  new java.util.Vector ();
+var index = 1;
+for (var i = 0; i < av.getAlignment ().getAlignmentAnnotation ().length; i++) {
+var label = av.getAlignment ().getAlignmentAnnotation ()[i].label;
+if (!list.contains (label)) {
+list.addElement (label);
+} else {
+list.addElement (label + "_" + (index++));
+}}
+for (var i = 0; i < list.size (); i++) {
+this.annotations.addItem (list.elementAt (i).toString ());
+}
+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"));
+if (Clazz_instanceOf (this.oldcs, jalview.schemes.AnnotationColourGradient)) {
+var acg = this.oldcs;
+this.annotations.select (acg.getAnnotation ());
+switch (acg.getAboveThreshold ()) {
+case -1:
+this.threshold.select (new Integer (0));
+break;
+case 1:
+this.threshold.select (new Integer (1));
+break;
+case 0:
+this.threshold.select (new Integer (1));
+break;
+default:
+throw  new Error (jalview.util.MessageManager.getString ("error.implementation_error_dont_know_thereshold_annotationcolourgradient"));
+}
+this.thresholdIsMin.setState (acg.thresholdIsMinMax);
+this.thresholdValue.setText ("" + acg.getAnnotationThreshold ());
+}this.adjusting = false;
+this.changeColour ();
+this.frame =  new awt2swing.Frame ();
+this.frame.add (this);
+jalview.bin.JalviewLite.addFrame (this.frame, jalview.util.MessageManager.getString ("label.colour_by_annotation"), 560, 175);
+this.validate ();
+}, "jalview.appletgui.AlignViewport,jalview.appletgui.AlignmentPanel");
+Clazz_defineMethod (c$, "setDefaultMinMax", 
+ function () {
+this.minColour.setBackground (this.av.applet.getDefaultColourParameter ("ANNOTATIONCOLOUR_MIN", java.awt.Color.orange));
+this.maxColour.setBackground (this.av.applet.getDefaultColourParameter ("ANNOTATIONCOLOUR_MAX", java.awt.Color.red));
+});
+Clazz_makeConstructor (c$, 
+function () {
+Clazz_superConstructor (this, jalview.appletgui.AnnotationColourChooser, []);
+try {
+this.jbInit ();
+} catch (ex) {
+if (Clazz_exceptionOf (ex, Exception)) {
+ex.printStackTrace ();
+} else {
+throw ex;
+}
+}
+});
+Clazz_defineMethod (c$, "jbInit", 
+ function () {
+this.minColour.setFont ( new java.awt.Font ("Verdana", 0, 11));
+this.minColour.setLabel (jalview.util.MessageManager.getString ("label.min_colour"));
+this.minColour.addActionListener (this);
+this.maxColour.setFont ( new java.awt.Font ("Verdana", 0, 11));
+this.maxColour.setLabel (jalview.util.MessageManager.getString ("label.max_colour"));
+this.maxColour.addActionListener (this);
+this.thresholdIsMin.addItemListener (this);
+this.ok.setLabel (jalview.util.MessageManager.getString ("action.ok"));
+this.ok.addActionListener (this);
+this.cancel.setLabel (jalview.util.MessageManager.getString ("action.cancel"));
+this.cancel.addActionListener (this);
+this.defColours.setLabel (jalview.util.MessageManager.getString ("action.set_defaults"));
+this.defColours.addActionListener (this);
+this.annotations.addItemListener (this);
+this.thresholdValue.addActionListener (this);
+this.slider.setBackground (java.awt.Color.white);
+this.slider.setPreferredSize ( new java.awt.Dimension (193, 21));
+this.slider.setEnabled (false);
+this.thresholdValue.setPreferredSize ( new java.awt.Dimension (79, 22));
+this.thresholdValue.setEnabled (false);
+this.thresholdValue.setColumns (5);
+this.currentColours.setFont ( new java.awt.Font ("Verdana", 0, 11));
+this.currentColours.setLabel (jalview.util.MessageManager.getString ("label.use_original_colours"));
+this.currentColours.addItemListener (this);
+this.thresholdIsMin.setBackground (java.awt.Color.white);
+this.thresholdIsMin.setLabel (jalview.util.MessageManager.getString ("label.threshold_minmax"));
+this.setLayout (this.borderLayout1);
+this.jPanel1.setBackground (java.awt.Color.white);
+this.jPanel2.setLayout ( new java.awt.FlowLayout ());
+this.jPanel2.setBackground (java.awt.Color.white);
+this.threshold.addItemListener (this);
+this.jPanel3.setLayout ( new java.awt.FlowLayout ());
+this.jPanel3.setBackground (java.awt.Color.white);
+var jPanel4 =  new awt2swing.Panel ();
+jPanel4.setLayout ( new java.awt.BorderLayout ());
+jPanel4.setBackground (java.awt.Color.white);
+this.jPanel1.add (this.ok);
+this.jPanel1.add (this.cancel);
+this.jPanel2.add (this.annotations);
+this.jPanel2.add (this.currentColours);
+this.jPanel2.add (this.minColour);
+this.jPanel2.add (this.maxColour);
+jPanel4.add (this.thresholdIsMin, "West");
+jPanel4.add (this.slider, "Center");
+jPanel4.add (this.thresholdValue, "East");
+var jPanel34 =  new awt2swing.Panel ();
+jPanel34.setLayout ( new java.awt.BorderLayout ());
+jPanel34.setBackground (java.awt.Color.white);
+jPanel34.add (this.jPanel2, "North");
+jPanel34.add (this.threshold, "West");
+this.jPanel3.add (this.defColours);
+jPanel34.add (this.jPanel3, "East");
+jPanel34.add (jPanel4, "South");
+this.add (jPanel34, "Center");
+this.add (this.jPanel1, "South");
+});
+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 if (evt.getSource () === this.defColours) {
+this.defColour_actionPerformed ();
+} else if (evt.getSource () === this.ok) {
+this.changeColour ();
+this.frame.setVisible (false);
+} else if (evt.getSource () === this.cancel) {
+this.reset ();
+this.ap.paintAlignment (true);
+this.frame.setVisible (false);
+} else {
+this.changeColour ();
+}}, "java.awt.event.ActionEvent");
+Clazz_overrideMethod (c$, "itemStateChanged", 
+function (evt) {
+if (evt.getSource () === this.currentColours) {
+if (this.currentColours.getState ()) {
+this.reset ();
+}this.maxColour.setEnabled (!this.currentColours.getState ());
+this.minColour.setEnabled (!this.currentColours.getState ());
+}this.changeColour ();
+}, "java.awt.event.ItemEvent");
+Clazz_overrideMethod (c$, "adjustmentValueChanged", 
+function (evt) {
+if (!this.adjusting) {
+this.thresholdValue.setText ((this.slider.getValue () / 1000) + "");
+if (this.currentColours.getState () && !(Clazz_instanceOf (this.av.getGlobalColourScheme (), jalview.schemes.AnnotationColourGradient))) {
+this.changeColour ();
+}this.currentAnnotation.threshold.value = this.slider.getValue () / 1000;
+this.ap.paintAlignment (false);
+}}, "java.awt.event.AdjustmentEvent");
+Clazz_defineMethod (c$, "minColour_actionPerformed", 
+function (newCol) {
+if (newCol != null) {
+this.minColour.setBackground (newCol);
+this.minColour.repaint ();
+this.changeColour ();
+} else {
+ new jalview.appletgui.UserDefinedColours (this, "Min Colour", this.minColour.getBackground ());
+}}, "java.awt.Color");
+Clazz_defineMethod (c$, "maxColour_actionPerformed", 
+function (newCol) {
+if (newCol != null) {
+this.maxColour.setBackground (newCol);
+this.maxColour.repaint ();
+this.changeColour ();
+} else {
+ new jalview.appletgui.UserDefinedColours (this, "Max Colour", this.maxColour.getBackground ());
+}}, "java.awt.Color");
+Clazz_defineMethod (c$, "defColour_actionPerformed", 
+function () {
+this.setDefaultMinMax ();
+this.minColour.repaint ();
+this.maxColour.repaint ();
+this.changeColour ();
+});
+Clazz_defineMethod (c$, "changeColour", 
+function () {
+if (this.adjusting) {
+return;
+}this.currentAnnotation = this.av.getAlignment ().getAlignmentAnnotation ()[this.annotations.getSelectedIndex ()];
+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);
+this.thresholdIsMin.setEnabled (true);
+if (aboveThreshold == -1) {
+this.slider.setEnabled (false);
+this.thresholdValue.setEnabled (false);
+this.thresholdIsMin.setEnabled (false);
+this.thresholdValue.setText ("");
+} else if (aboveThreshold != -1 && this.currentAnnotation.threshold == null) {
+this.currentAnnotation.setThreshold ( new jalview.datamodel.GraphLine ((this.currentAnnotation.graphMax - this.currentAnnotation.graphMin) / 2, "Threshold", java.awt.Color.black));
+}if (aboveThreshold != -1) {
+this.adjusting = true;
+this.slider.setMinimum (Clazz_floatToInt (this.currentAnnotation.graphMin * 1000));
+this.slider.setMaximum (Clazz_floatToInt (this.currentAnnotation.graphMax * 1000));
+this.slider.setValue (Clazz_floatToInt (this.currentAnnotation.threshold.value * 1000));
+this.thresholdValue.setText (this.currentAnnotation.threshold.value + "");
+this.slider.setEnabled (true);
+this.thresholdValue.setEnabled (true);
+this.adjusting = false;
+}var acg = null;
+if (this.currentColours.getState ()) {
+acg =  new jalview.schemes.AnnotationColourGradient (this.currentAnnotation, this.av.getGlobalColourScheme (), aboveThreshold);
+} else {
+acg =  new jalview.schemes.AnnotationColourGradient (this.currentAnnotation, this.minColour.getBackground (), this.maxColour.getBackground (), aboveThreshold);
+}if (this.currentAnnotation.graphMin == 0 && this.currentAnnotation.graphMax == 0) {
+acg.setPredefinedColours (true);
+}acg.thresholdIsMinMax = this.thresholdIsMin.getState ();
+this.av.setGlobalColourScheme (acg);
+if (this.av.getAlignment ().getGroups () != null) {
+for (var sg, $sg = this.ap.av.getAlignment ().getGroups ().iterator (); $sg.hasNext () && ((sg = $sg.next ()) || true);) {
+if (sg.cs == null) {
+continue;
+}if (this.currentColours.getState ()) {
+sg.cs =  new jalview.schemes.AnnotationColourGradient (this.currentAnnotation, sg.cs, aboveThreshold);
+} else {
+sg.cs =  new jalview.schemes.AnnotationColourGradient (this.currentAnnotation, this.minColour.getBackground (), this.maxColour.getBackground (), aboveThreshold);
+}}
+}this.ap.alignmentChanged ();
+this.ap.paintAlignment (true);
+});
+Clazz_defineMethod (c$, "reset", 
+function () {
+this.av.setGlobalColourScheme (this.oldcs);
+if (this.av.getAlignment ().getGroups () != null) {
+for (var sg, $sg = this.ap.av.getAlignment ().getGroups ().iterator (); $sg.hasNext () && ((sg = $sg.next ()) || true);) {
+var cs = this.oldgroupColours.get (sg);
+if (Clazz_instanceOf (cs, jalview.schemes.ColourSchemeI)) {
+sg.cs = cs;
+} else {
+sg.cs = null;
+}}
+}this.ap.paintAlignment (true);
+});
+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) {
+this.ap.paintAlignment (true);
+}, "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 ("awt2swing");
+Clazz_load (["javax.swing.JComboBox"], "awt2swing.Choice", null, function () {
+c$ = Clazz_declareType (awt2swing, "Choice", javax.swing.JComboBox);
+Clazz_defineMethod (c$, "select", 
+function (key) {
+this.setSelectedItem (key);
+}, "~O");
+});
+Clazz_declarePackage ("javax.swing");
+Clazz_load (["java.awt.ItemSelectable", "java.awt.event.ActionListener", "javax.swing.ActionPropertyChangeListener", "$.JComponent", "javax.swing.event.ListDataListener", "javax.swing.JPopupMenu"], "javax.swing.JComboBox", ["java.lang.IllegalArgumentException", "$.RuntimeException", "java.awt.Component", "$.EventQueue", "java.awt.event.ActionEvent", "$.InputEvent", "$.ItemEvent", "$.ItemListener", "javax.swing.AbstractAction", "$.DefaultComboBoxModel", "$.MutableComboBoxModel", "$.SwingUtilities", "$.UIManager", "javax.swing.event.AncestorListener", "$.PopupMenuEvent", "$.PopupMenuListener"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.dataModel = null;
+this.renderer = null;
+this.editor = null;
+this.maximumRowCount = 8;
+this.$isEditable = false;
+this.keySelectionManager = null;
+this.actionCommand = "comboBoxChanged";
+this.lightWeightPopupEnabled = false;
+this.selectedItemReminder = null;
+this.prototypeDisplayValue = null;
+this.firingActionEvent = false;
+this.selectingItem = false;
+this.$action = null;
+this.actionPropertyChangeListener = null;
+if (!Clazz_isClassDefined ("javax.swing.JComboBox.DefaultKeySelectionManager")) {
+javax.swing.JComboBox.$JComboBox$DefaultKeySelectionManager$ ();
+}
+Clazz_instantialize (this, arguments);
+}, javax.swing, "JComboBox", javax.swing.JComponent, [java.awt.ItemSelectable, javax.swing.event.ListDataListener, java.awt.event.ActionListener]);
+Clazz_prepareFields (c$, function () {
+this.lightWeightPopupEnabled = javax.swing.JPopupMenu.getDefaultLightWeightPopupEnabled ();
+});
+Clazz_makeConstructor (c$, 
+function (aModel) {
+Clazz_superConstructor (this, javax.swing.JComboBox);
+this.setModel (aModel);
+this.init ();
+}, "javax.swing.ComboBoxModel");
+Clazz_makeConstructor (c$, 
+function (items) {
+Clazz_superConstructor (this, javax.swing.JComboBox);
+this.setModel ( new javax.swing.DefaultComboBoxModel (items));
+this.init ();
+}, "~A");
+Clazz_makeConstructor (c$, 
+function (items) {
+Clazz_superConstructor (this, javax.swing.JComboBox);
+this.setModel ( new javax.swing.DefaultComboBoxModel (items));
+this.init ();
+}, "java.util.Vector");
+Clazz_makeConstructor (c$, 
+function () {
+Clazz_superConstructor (this, javax.swing.JComboBox);
+this.setModel ( new javax.swing.DefaultComboBoxModel ());
+this.init ();
+});
+Clazz_defineMethod (c$, "init", 
+ function () {
+this.installAncestorListener ();
+this.setUIProperty ("opaque", new Boolean (true));
+this.updateUI ();
+});
+Clazz_defineMethod (c$, "installAncestorListener", 
+function () {
+this.addAncestorListener (((Clazz_isClassDefined ("javax.swing.JComboBox$1") ? 0 : javax.swing.JComboBox.$JComboBox$1$ ()), Clazz_innerTypeInstance (javax.swing.JComboBox$1, this, null)));
+});
+Clazz_overrideMethod (c$, "updateUI", 
+function () {
+this.setUI (javax.swing.UIManager.getUI (this));
+var renderer = this.getRenderer ();
+if (Clazz_instanceOf (renderer, java.awt.Component)) {
+javax.swing.SwingUtilities.updateComponentTreeUI (renderer);
+}});
+Clazz_overrideMethod (c$, "getUIClassID", 
+function () {
+return "ComboBoxUI";
+});
+Clazz_overrideMethod (c$, "getUI", 
+function () {
+return this.ui;
+});
+Clazz_defineMethod (c$, "setModel", 
+function (aModel) {
+var oldModel = this.dataModel;
+if (oldModel != null) {
+oldModel.removeListDataListener (this);
+}this.dataModel = aModel;
+this.dataModel.addListDataListener (this);
+this.selectedItemReminder = this.dataModel.getSelectedItem ();
+this.firePropertyChangeObject ("model", oldModel, this.dataModel);
+}, "javax.swing.ComboBoxModel");
+Clazz_defineMethod (c$, "getModel", 
+function () {
+return this.dataModel;
+});
+Clazz_defineMethod (c$, "setLightWeightPopupEnabled", 
+function (aFlag) {
+var oldFlag = this.lightWeightPopupEnabled;
+this.lightWeightPopupEnabled = aFlag;
+this.firePropertyChangeBool ("lightWeightPopupEnabled", oldFlag, this.lightWeightPopupEnabled);
+}, "~B");
+Clazz_defineMethod (c$, "isLightWeightPopupEnabled", 
+function () {
+return this.lightWeightPopupEnabled;
+});
+Clazz_defineMethod (c$, "setEditable", 
+function (aFlag) {
+var oldFlag = this.$isEditable;
+this.$isEditable = aFlag;
+this.firePropertyChangeBool ("editable", oldFlag, this.$isEditable);
+}, "~B");
+Clazz_defineMethod (c$, "isEditable", 
+function () {
+return this.$isEditable;
+});
+Clazz_defineMethod (c$, "setMaximumRowCount", 
+function (count) {
+var oldCount = this.maximumRowCount;
+this.maximumRowCount = count;
+this.firePropertyChangeInt ("maximumRowCount", oldCount, this.maximumRowCount);
+}, "~N");
+Clazz_defineMethod (c$, "getMaximumRowCount", 
+function () {
+return this.maximumRowCount;
+});
+Clazz_defineMethod (c$, "setRenderer", 
+function (aRenderer) {
+var oldRenderer = this.renderer;
+this.renderer = aRenderer;
+this.firePropertyChangeObject ("renderer", oldRenderer, this.renderer);
+this.invalidate ();
+}, "javax.swing.ListCellRenderer");
+Clazz_defineMethod (c$, "getRenderer", 
+function () {
+return this.renderer;
+});
+Clazz_defineMethod (c$, "setEditor", 
+function (anEditor) {
+var oldEditor = this.editor;
+if (this.editor != null) {
+this.editor.removeActionListener (this);
+}this.editor = anEditor;
+if (this.editor != null) {
+this.editor.addActionListener (this);
+}this.firePropertyChangeObject ("editor", oldEditor, this.editor);
+}, "javax.swing.ComboBoxEditor");
+Clazz_defineMethod (c$, "getEditor", 
+function () {
+return this.editor;
+});
+Clazz_defineMethod (c$, "setSelectedItem", 
+function (anObject) {
+var oldSelection = this.selectedItemReminder;
+var objectToSelect = anObject;
+if (oldSelection == null || !oldSelection.equals (anObject)) {
+if (anObject != null && !this.isEditable ()) {
+var found = false;
+for (var i = 0; i < this.dataModel.getSize (); i++) {
+var element = this.dataModel.getElementAt (i);
+if (anObject.equals (element)) {
+found = true;
+objectToSelect = element;
+break;
+}}
+if (!found) {
+return;
+}}this.selectingItem = true;
+this.dataModel.setSelectedItem (objectToSelect);
+this.selectingItem = false;
+if (this.selectedItemReminder !== this.dataModel.getSelectedItem ()) {
+this.selectedItemChanged ();
+}}this.fireActionEvent ();
+}, "~O");
+Clazz_defineMethod (c$, "getSelectedItem", 
+function () {
+return this.dataModel.getSelectedItem ();
+});
+Clazz_defineMethod (c$, "setSelectedIndex", 
+function (anIndex) {
+var size = this.dataModel.getSize ();
+if (anIndex == -1) {
+this.setSelectedItem (null);
+} else if (anIndex < -1 || anIndex >= size) {
+throw  new IllegalArgumentException ("setSelectedIndex: " + anIndex + " out of bounds");
+} else {
+this.setSelectedItem (this.dataModel.getElementAt (anIndex));
+}}, "~N");
+Clazz_defineMethod (c$, "getSelectedIndex", 
+function () {
+var sObject = this.dataModel.getSelectedItem ();
+var i;
+var c;
+var obj;
+for (i = 0, c = this.dataModel.getSize (); i < c; i++) {
+obj = this.dataModel.getElementAt (i);
+if (obj != null && obj.equals (sObject)) return i;
+}
+return -1;
+});
+Clazz_defineMethod (c$, "getPrototypeDisplayValue", 
+function () {
+return this.prototypeDisplayValue;
+});
+Clazz_defineMethod (c$, "setPrototypeDisplayValue", 
+function (prototypeDisplayValue) {
+var oldValue = this.prototypeDisplayValue;
+this.prototypeDisplayValue = prototypeDisplayValue;
+this.firePropertyChangeObject ("prototypeDisplayValue", oldValue, prototypeDisplayValue);
+}, "~O");
+Clazz_defineMethod (c$, "addItem", 
+function (anObject) {
+this.checkMutableComboBoxModel ();
+(this.dataModel).addElement (anObject);
+}, "~O");
+Clazz_defineMethod (c$, "insertItemAt", 
+function (anObject, index) {
+this.checkMutableComboBoxModel ();
+(this.dataModel).insertElementAt (anObject, index);
+}, "~O,~N");
+Clazz_defineMethod (c$, "removeItem", 
+function (anObject) {
+this.checkMutableComboBoxModel ();
+(this.dataModel).removeElement (anObject);
+}, "~O");
+Clazz_defineMethod (c$, "removeItemAt", 
+function (anIndex) {
+this.checkMutableComboBoxModel ();
+(this.dataModel).removeElementAt (anIndex);
+}, "~N");
+Clazz_defineMethod (c$, "removeAllItems", 
+function () {
+this.checkMutableComboBoxModel ();
+var model = this.dataModel;
+var size = model.getSize ();
+if (Clazz_instanceOf (model, javax.swing.DefaultComboBoxModel)) {
+(model).removeAllElements ();
+} else {
+for (var i = 0; i < size; ++i) {
+var element = model.getElementAt (0);
+model.removeElement (element);
+}
+}this.selectedItemReminder = null;
+if (this.isEditable ()) {
+this.editor.setItem (null);
+}});
+Clazz_defineMethod (c$, "checkMutableComboBoxModel", 
+function () {
+if (!(Clazz_instanceOf (this.dataModel, javax.swing.MutableComboBoxModel))) throw  new RuntimeException ("Cannot use this method with a non-Mutable data model.");
+});
+Clazz_defineMethod (c$, "showPopup", 
+function () {
+this.setPopupVisible (true);
+});
+Clazz_defineMethod (c$, "hidePopup", 
+function () {
+this.setPopupVisible (false);
+});
+Clazz_defineMethod (c$, "setPopupVisible", 
+function (v) {
+this.getUI ().setPopupVisible (this, v);
+}, "~B");
+Clazz_defineMethod (c$, "isPopupVisible", 
+function () {
+return this.getUI ().isPopupVisible (this);
+});
+Clazz_overrideMethod (c$, "addItemListener", 
+function (aListener) {
+this.listenerList.add (java.awt.event.ItemListener, aListener);
+}, "java.awt.event.ItemListener");
+Clazz_overrideMethod (c$, "removeItemListener", 
+function (aListener) {
+this.listenerList.remove (java.awt.event.ItemListener, aListener);
+}, "java.awt.event.ItemListener");
+Clazz_defineMethod (c$, "getItemListeners", 
+function () {
+return this.listenerList.getListeners (java.awt.event.ItemListener);
+});
+Clazz_defineMethod (c$, "addActionListener", 
+function (l) {
+this.listenerList.add (java.awt.event.ActionListener, l);
+}, "java.awt.event.ActionListener");
+Clazz_defineMethod (c$, "removeActionListener", 
+function (l) {
+if ((l != null) && (this.getAction () === l)) {
+this.setAction (null);
+} else {
+this.listenerList.remove (java.awt.event.ActionListener, l);
+}}, "java.awt.event.ActionListener");
+Clazz_defineMethod (c$, "getActionListeners", 
+function () {
+return this.listenerList.getListeners (java.awt.event.ActionListener);
+});
+Clazz_defineMethod (c$, "addPopupMenuListener", 
+function (l) {
+this.listenerList.add (javax.swing.event.PopupMenuListener, l);
+}, "javax.swing.event.PopupMenuListener");
+Clazz_defineMethod (c$, "removePopupMenuListener", 
+function (l) {
+this.listenerList.remove (javax.swing.event.PopupMenuListener, l);
+}, "javax.swing.event.PopupMenuListener");
+Clazz_defineMethod (c$, "getPopupMenuListeners", 
+function () {
+return this.listenerList.getListeners (javax.swing.event.PopupMenuListener);
+});
+Clazz_defineMethod (c$, "firePopupMenuWillBecomeVisible", 
+function () {
+var listeners = this.listenerList.getListenerList ();
+var e = null;
+for (var i = listeners.length - 2; i >= 0; i -= 2) {
+if (listeners[i] === javax.swing.event.PopupMenuListener) {
+if (e == null) e =  new javax.swing.event.PopupMenuEvent (this);
+(listeners[i + 1]).popupMenuWillBecomeVisible (e);
+}}
+});
+Clazz_defineMethod (c$, "firePopupMenuWillBecomeInvisible", 
+function () {
+var listeners = this.listenerList.getListenerList ();
+var e = null;
+for (var i = listeners.length - 2; i >= 0; i -= 2) {
+if (listeners[i] === javax.swing.event.PopupMenuListener) {
+if (e == null) e =  new javax.swing.event.PopupMenuEvent (this);
+(listeners[i + 1]).popupMenuWillBecomeInvisible (e);
+}}
+});
+Clazz_defineMethod (c$, "firePopupMenuCanceled", 
+function () {
+var listeners = this.listenerList.getListenerList ();
+var e = null;
+for (var i = listeners.length - 2; i >= 0; i -= 2) {
+if (listeners[i] === javax.swing.event.PopupMenuListener) {
+if (e == null) e =  new javax.swing.event.PopupMenuEvent (this);
+(listeners[i + 1]).popupMenuCanceled (e);
+}}
+});
+Clazz_defineMethod (c$, "setActionCommand", 
+function (aCommand) {
+this.actionCommand = aCommand;
+}, "~S");
+Clazz_defineMethod (c$, "getActionCommand", 
+function () {
+return this.actionCommand;
+});
+Clazz_defineMethod (c$, "setAction", 
+function (a) {
+var oldValue = this.getAction ();
+if (this.$action == null || !this.$action.equals (a)) {
+this.$action = a;
+if (oldValue != null) {
+this.removeActionListener (oldValue);
+oldValue.removePropertyChangeListener (this.actionPropertyChangeListener);
+this.actionPropertyChangeListener = null;
+}this.configurePropertiesFromAction (this.$action);
+if (this.$action != null) {
+if (!this.isListener (java.awt.event.ActionListener, this.$action)) {
+this.addActionListener (this.$action);
+}this.actionPropertyChangeListener = this.createActionPropertyChangeListener (this.$action);
+this.$action.addPropertyChangeListener (this.actionPropertyChangeListener);
+}this.firePropertyChangeObject ("action", oldValue, this.$action);
+}}, "javax.swing.Action");
+Clazz_defineMethod (c$, "isListener", 
+ function (c, a) {
+var isListener = false;
+var listeners = this.listenerList.getListenerList ();
+for (var i = listeners.length - 2; i >= 0; i -= 2) {
+if (listeners[i] === c && listeners[i + 1] === a) {
+isListener = true;
+}}
+return isListener;
+}, "Class,java.awt.event.ActionListener");
+Clazz_defineMethod (c$, "getAction", 
+function () {
+return this.$action;
+});
+Clazz_defineMethod (c$, "configurePropertiesFromAction", 
+function (a) {
+javax.swing.AbstractAction.setEnabledFromAction (this, a);
+javax.swing.AbstractAction.setToolTipTextFromAction (this, a);
+this.setActionCommandFromAction (a);
+}, "javax.swing.Action");
+Clazz_defineMethod (c$, "createActionPropertyChangeListener", 
+function (a) {
+return  new javax.swing.JComboBox.ComboBoxActionPropertyChangeListener (this, a);
+}, "javax.swing.Action");
+Clazz_defineMethod (c$, "actionPropertyChanged", 
+function (action, propertyName) {
+if (propertyName === "ActionCommandKey") {
+this.setActionCommandFromAction (action);
+} else if (propertyName === "enabled") {
+javax.swing.AbstractAction.setEnabledFromAction (this, action);
+} else if ("ShortDescription" === propertyName) {
+javax.swing.AbstractAction.setToolTipTextFromAction (this, action);
+}}, "javax.swing.Action,~S");
+Clazz_defineMethod (c$, "setActionCommandFromAction", 
+ function (a) {
+this.setActionCommand ((a != null) ? a.getValue ("ActionCommandKey") : null);
+}, "javax.swing.Action");
+Clazz_defineMethod (c$, "fireItemStateChanged", 
+function (e) {
+var listeners = this.listenerList.getListenerList ();
+for (var i = listeners.length - 2; i >= 0; i -= 2) {
+if (listeners[i] === java.awt.event.ItemListener) {
+(listeners[i + 1]).itemStateChanged (e);
+}}
+}, "java.awt.event.ItemEvent");
+Clazz_defineMethod (c$, "fireActionEvent", 
+function () {
+if (!this.firingActionEvent) {
+this.firingActionEvent = true;
+var e = null;
+var listeners = this.listenerList.getListenerList ();
+var mostRecentEventTime = java.awt.EventQueue.getMostRecentEventTime ();
+var modifiers = 0;
+var currentEvent = java.awt.EventQueue.getCurrentEvent ();
+if (Clazz_instanceOf (currentEvent, java.awt.event.InputEvent)) {
+modifiers = (currentEvent).getModifiers ();
+} else if (Clazz_instanceOf (currentEvent, java.awt.event.ActionEvent)) {
+modifiers = (currentEvent).getModifiers ();
+}for (var i = listeners.length - 2; i >= 0; i -= 2) {
+if (listeners[i] === java.awt.event.ActionListener) {
+if (e == null) e =  new java.awt.event.ActionEvent (this, 1001, this.getActionCommand (), mostRecentEventTime, modifiers);
+(listeners[i + 1]).actionPerformed (e);
+}}
+this.firingActionEvent = false;
+}});
+Clazz_defineMethod (c$, "selectedItemChanged", 
+function () {
+if (this.selectedItemReminder != null) {
+this.fireItemStateChanged ( new java.awt.event.ItemEvent (this, 701, this.selectedItemReminder, 2));
+}this.selectedItemReminder = this.dataModel.getSelectedItem ();
+if (this.selectedItemReminder != null) {
+this.fireItemStateChanged ( new java.awt.event.ItemEvent (this, 701, this.selectedItemReminder, 1));
+}});
+Clazz_overrideMethod (c$, "getSelectedObjects", 
+function () {
+var selectedObject = this.getSelectedItem ();
+if (selectedObject == null) return  new Array (0);
+ else {
+var result =  new Array (1);
+result[0] = selectedObject;
+return result;
+}});
+Clazz_defineMethod (c$, "actionPerformed", 
+function (e) {
+var newItem = this.getEditor ().getItem ();
+this.setPopupVisible (false);
+this.getModel ().setSelectedItem (newItem);
+var oldCommand = this.getActionCommand ();
+this.setActionCommand ("comboBoxEdited");
+this.fireActionEvent ();
+this.setActionCommand (oldCommand);
+}, "java.awt.event.ActionEvent");
+Clazz_overrideMethod (c$, "contentsChanged", 
+function (e) {
+var oldSelection = this.selectedItemReminder;
+var newSelection = this.dataModel.getSelectedItem ();
+if (oldSelection == null || !oldSelection.equals (newSelection)) {
+this.selectedItemChanged ();
+if (!this.selectingItem) {
+this.fireActionEvent ();
+}}}, "javax.swing.event.ListDataEvent");
+Clazz_overrideMethod (c$, "intervalAdded", 
+function (e) {
+if (this.selectedItemReminder !== this.dataModel.getSelectedItem ()) {
+this.selectedItemChanged ();
+}}, "javax.swing.event.ListDataEvent");
+Clazz_overrideMethod (c$, "intervalRemoved", 
+function (e) {
+this.contentsChanged (e);
+}, "javax.swing.event.ListDataEvent");
+Clazz_defineMethod (c$, "selectWithKeyChar", 
+function (keyChar) {
+var index;
+if (this.keySelectionManager == null) this.keySelectionManager = this.createDefaultKeySelectionManager ();
+index = this.keySelectionManager.selectionForKey (keyChar, this.getModel ());
+if (index != -1) {
+this.setSelectedIndex (index);
+return true;
+} else return false;
+}, "~S");
+Clazz_defineMethod (c$, "setEnabled", 
+function (b) {
+Clazz_superCall (this, javax.swing.JComboBox, "setEnabled", [b]);
+this.firePropertyChangeBool ("enabled", !this.isEnabled (), this.isEnabled ());
+}, "~B");
+Clazz_defineMethod (c$, "configureEditor", 
+function (anEditor, anItem) {
+anEditor.setItem (anItem);
+}, "javax.swing.ComboBoxEditor,~O");
+Clazz_defineMethod (c$, "processKeyEvent", 
+function (e) {
+if (e.getKeyCode () == 9) {
+this.hidePopup ();
+}Clazz_superCall (this, javax.swing.JComboBox, "processKeyEvent", [e]);
+}, "java.awt.event.KeyEvent");
+Clazz_defineMethod (c$, "setKeySelectionManager", 
+function (aManager) {
+this.keySelectionManager = aManager;
+}, "javax.swing.JComboBox.KeySelectionManager");
+Clazz_defineMethod (c$, "getKeySelectionManager", 
+function () {
+return this.keySelectionManager;
+});
+Clazz_defineMethod (c$, "getItemCount", 
+function () {
+return this.dataModel.getSize ();
+});
+Clazz_defineMethod (c$, "getItemAt", 
+function (index) {
+return this.dataModel.getElementAt (index);
+}, "~N");
+Clazz_defineMethod (c$, "createDefaultKeySelectionManager", 
+function () {
+return Clazz_innerTypeInstance (javax.swing.JComboBox.DefaultKeySelectionManager, this, null);
+});
+Clazz_defineMethod (c$, "paramString", 
+function () {
+var selectedItemReminderString = (this.selectedItemReminder != null ? this.selectedItemReminder.toString () : "");
+var isEditableString = (this.$isEditable ? "true" : "false");
+var lightWeightPopupEnabledString = (this.lightWeightPopupEnabled ? "true" : "false");
+return Clazz_superCall (this, javax.swing.JComboBox, "paramString", []) + ",isEditable=" + isEditableString + ",lightWeightPopupEnabled=" + lightWeightPopupEnabledString + ",maximumRowCount=" + this.maximumRowCount + ",selectedItemReminder=" + selectedItemReminderString;
+});
+c$.$JComboBox$DefaultKeySelectionManager$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_decorateAsClass (function () {
+Clazz_prepareCallback (this, arguments);
+Clazz_instantialize (this, arguments);
+}, javax.swing.JComboBox, "DefaultKeySelectionManager", null, javax.swing.JComboBox.KeySelectionManager);
+Clazz_overrideMethod (c$, "selectionForKey", 
+function (a, b) {
+var c;
+var d;
+var e = -1;
+var f = b.getSelectedItem ();
+var g;
+var h;
+if (f != null) {
+for (c = 0, d = b.getSize (); c < d; c++) {
+if (f === b.getElementAt (c)) {
+e = c;
+break;
+}}
+}h = ("" + a).toLowerCase ();
+a = h.charAt (0);
+for (c = ++e, d = b.getSize (); c < d; c++) {
+var i = b.getElementAt (c);
+if (i != null && i.toString () != null) {
+g = i.toString ().toLowerCase ();
+if (g.length > 0 && g.charAt (0) == a) return c;
+}}
+for (c = 0; c < e; c++) {
+var i = b.getElementAt (c);
+if (i != null && i.toString () != null) {
+g = i.toString ().toLowerCase ();
+if (g.length > 0 && g.charAt (0) == a) return c;
+}}
+return -1;
+}, "~S,javax.swing.ComboBoxModel");
+c$ = Clazz_p0p ();
+};
+c$.$JComboBox$1$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_declareAnonymous (javax.swing, "JComboBox$1", null, javax.swing.event.AncestorListener);
+Clazz_overrideMethod (c$, "ancestorAdded", 
+function (event) {
+this.b$["javax.swing.JComboBox"].hidePopup ();
+}, "javax.swing.event.AncestorEvent");
+Clazz_overrideMethod (c$, "ancestorRemoved", 
+function (event) {
+this.b$["javax.swing.JComboBox"].hidePopup ();
+}, "javax.swing.event.AncestorEvent");
+Clazz_overrideMethod (c$, "ancestorMoved", 
+function (event) {
+if (event.getSource () !== this.b$["javax.swing.JComboBox"]) this.b$["javax.swing.JComboBox"].hidePopup ();
+}, "javax.swing.event.AncestorEvent");
+c$ = Clazz_p0p ();
+};
+Clazz_pu$h(self.c$);
+c$ = Clazz_declareType (javax.swing.JComboBox, "ComboBoxActionPropertyChangeListener", javax.swing.ActionPropertyChangeListener);
+Clazz_overrideMethod (c$, "actionPropertyChanged", 
+function (a, b, c) {
+if (javax.swing.AbstractAction.shouldReconfigure (c)) {
+a.configurePropertiesFromAction (b);
+} else {
+a.actionPropertyChanged (b, c.getPropertyName ());
+}}, "javax.swing.JComboBox,javax.swing.Action,java.beans.PropertyChangeEvent");
+c$ = Clazz_p0p ();
+Clazz_declareInterface (javax.swing.JComboBox, "KeySelectionManager");
+Clazz_defineStatics (c$,
+"$uiClassID", "ComboBoxUI");
+});
+Clazz_declarePackage ("javax.swing.event");
+Clazz_load (["java.util.EventListener"], "javax.swing.event.ListDataListener", null, function () {
+Clazz_declareInterface (javax.swing.event, "ListDataListener", java.util.EventListener);
+});
+Clazz_declarePackage ("javax.swing");
+Clazz_load (["javax.swing.AbstractListModel", "$.MutableComboBoxModel"], "javax.swing.DefaultComboBoxModel", ["java.util.Vector"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.objects = null;
+this.selectedObject = null;
+Clazz_instantialize (this, arguments);
+}, javax.swing, "DefaultComboBoxModel", javax.swing.AbstractListModel, javax.swing.MutableComboBoxModel);
+Clazz_makeConstructor (c$, 
+function () {
+Clazz_superConstructor (this, javax.swing.DefaultComboBoxModel, []);
+this.objects =  new java.util.Vector ();
+});
+Clazz_makeConstructor (c$, 
+function (items) {
+Clazz_superConstructor (this, javax.swing.DefaultComboBoxModel, []);
+this.objects =  new java.util.Vector ();
+this.objects.ensureCapacity (items.length);
+var i;
+var c;
+for (i = 0, c = items.length; i < c; i++) this.objects.addElement (items[i]);
+
+if (this.getSize () > 0) {
+this.selectedObject = this.getElementAt (0);
+}}, "~A");
+Clazz_makeConstructor (c$, 
+function (v) {
+Clazz_superConstructor (this, javax.swing.DefaultComboBoxModel, []);
+this.objects = v;
+if (this.getSize () > 0) {
+this.selectedObject = this.getElementAt (0);
+}}, "java.util.Vector");
+Clazz_overrideMethod (c$, "setSelectedItem", 
+function (anObject) {
+if ((this.selectedObject != null && !this.selectedObject.equals (anObject)) || this.selectedObject == null && anObject != null) {
+this.selectedObject = anObject;
+this.fireContentsChanged (this, -1, -1);
+}}, "~O");
+Clazz_overrideMethod (c$, "getSelectedItem", 
+function () {
+return this.selectedObject;
+});
+Clazz_overrideMethod (c$, "getSize", 
+function () {
+return this.objects.size ();
+});
+Clazz_overrideMethod (c$, "getElementAt", 
+function (index) {
+if (index >= 0 && index < this.objects.size ()) return this.objects.elementAt (index);
+ else return null;
+}, "~N");
+Clazz_defineMethod (c$, "getIndexOf", 
+function (anObject) {
+return this.objects.indexOf (anObject);
+}, "~O");
+Clazz_overrideMethod (c$, "addElement", 
+function (anObject) {
+this.objects.addElement (anObject);
+this.fireIntervalAdded (this, this.objects.size () - 1, this.objects.size () - 1);
+if (this.objects.size () == 1 && this.selectedObject == null && anObject != null) {
+this.setSelectedItem (anObject);
+}}, "~O");
+Clazz_overrideMethod (c$, "insertElementAt", 
+function (anObject, index) {
+this.objects.insertElementAt (anObject, index);
+this.fireIntervalAdded (this, index, index);
+}, "~O,~N");
+Clazz_overrideMethod (c$, "removeElementAt", 
+function (index) {
+if (this.getElementAt (index) === this.selectedObject) {
+if (index == 0) {
+this.setSelectedItem (this.getSize () == 1 ? null : this.getElementAt (index + 1));
+} else {
+this.setSelectedItem (this.getElementAt (index - 1));
+}}this.objects.removeElementAt (index);
+this.fireIntervalRemoved (this, index, index);
+}, "~N");
+Clazz_overrideMethod (c$, "removeElement", 
+function (anObject) {
+var index = this.objects.indexOf (anObject);
+if (index != -1) {
+this.removeElementAt (index);
+}}, "~O");
+Clazz_defineMethod (c$, "removeAllElements", 
+function () {
+if (this.objects.size () > 0) {
+var firstIndex = 0;
+var lastIndex = this.objects.size () - 1;
+this.objects.removeAllElements ();
+this.selectedObject = null;
+this.fireIntervalRemoved (this, firstIndex, lastIndex);
+} else {
+this.selectedObject = null;
+}});
+});
+Clazz_declarePackage ("javax.swing");
+Clazz_load (["javax.swing.ListModel", "javax.swing.event.EventListenerList"], "javax.swing.AbstractListModel", ["javax.swing.event.ListDataEvent", "$.ListDataListener"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.listenerList = null;
+Clazz_instantialize (this, arguments);
+}, javax.swing, "AbstractListModel", null, javax.swing.ListModel);
+Clazz_prepareFields (c$, function () {
+this.listenerList =  new javax.swing.event.EventListenerList ();
+});
+Clazz_overrideMethod (c$, "addListDataListener", 
+function (l) {
+this.listenerList.add (javax.swing.event.ListDataListener, l);
+}, "javax.swing.event.ListDataListener");
+Clazz_overrideMethod (c$, "removeListDataListener", 
+function (l) {
+this.listenerList.remove (javax.swing.event.ListDataListener, l);
+}, "javax.swing.event.ListDataListener");
+Clazz_defineMethod (c$, "getListDataListeners", 
+function () {
+return this.listenerList.getListeners (javax.swing.event.ListDataListener);
+});
+Clazz_defineMethod (c$, "fireContentsChanged", 
+function (source, index0, index1) {
+var listeners = this.listenerList.getListenerList ();
+var e = null;
+for (var i = listeners.length - 2; i >= 0; i -= 2) {
+if (listeners[i] === javax.swing.event.ListDataListener) {
+if (e == null) {
+e =  new javax.swing.event.ListDataEvent (source, 0, index0, index1);
+}(listeners[i + 1]).contentsChanged (e);
+}}
+}, "~O,~N,~N");
+Clazz_defineMethod (c$, "fireIntervalAdded", 
+function (source, index0, index1) {
+var listeners = this.listenerList.getListenerList ();
+var e = null;
+for (var i = listeners.length - 2; i >= 0; i -= 2) {
+if (listeners[i] === javax.swing.event.ListDataListener) {
+if (e == null) {
+e =  new javax.swing.event.ListDataEvent (source, 1, index0, index1);
+}(listeners[i + 1]).intervalAdded (e);
+}}
+}, "~O,~N,~N");
+Clazz_defineMethod (c$, "fireIntervalRemoved", 
+function (source, index0, index1) {
+var listeners = this.listenerList.getListenerList ();
+var e = null;
+for (var i = listeners.length - 2; i >= 0; i -= 2) {
+if (listeners[i] === javax.swing.event.ListDataListener) {
+if (e == null) {
+e =  new javax.swing.event.ListDataEvent (source, 2, index0, index1);
+}(listeners[i + 1]).intervalRemoved (e);
+}}
+}, "~O,~N,~N");
+Clazz_defineMethod (c$, "getListeners", 
+function (listenerType) {
+return this.listenerList.getListeners (listenerType);
+}, "Class");
+});
+Clazz_declarePackage ("javax.swing");
+Clazz_declareInterface (javax.swing, "ListModel");
+Clazz_declarePackage ("javax.swing.event");
+Clazz_load (["java.util.EventObject"], "javax.swing.event.ListDataEvent", null, function () {
+c$ = Clazz_decorateAsClass (function () {
+this.type = 0;
+this.index0 = 0;
+this.index1 = 0;
+Clazz_instantialize (this, arguments);
+}, javax.swing.event, "ListDataEvent", java.util.EventObject);
+Clazz_defineMethod (c$, "getType", 
+function () {
+return this.type;
+});
+Clazz_defineMethod (c$, "getIndex0", 
+function () {
+return this.index0;
+});
+Clazz_defineMethod (c$, "getIndex1", 
+function () {
+return this.index1;
+});
+Clazz_makeConstructor (c$, 
+function (source, type, index0, index1) {
+Clazz_superConstructor (this, javax.swing.event.ListDataEvent, [source]);
+this.type = type;
+this.index0 = Math.min (index0, index1);
+this.index1 = Math.max (index0, index1);
+}, "~O,~N,~N,~N");
+Clazz_overrideMethod (c$, "toString", 
+function () {
+return this.getClass ().getName () + "[type=" + this.type + ",index0=" + this.index0 + ",index1=" + this.index1 + "]";
+});
+Clazz_defineStatics (c$,
+"CONTENTS_CHANGED", 0,
+"INTERVAL_ADDED", 1,
+"INTERVAL_REMOVED", 2);
+});
+Clazz_declarePackage ("javax.swing");
+Clazz_load (["javax.swing.ComboBoxModel"], "javax.swing.MutableComboBoxModel", null, function () {
+Clazz_declareInterface (javax.swing, "MutableComboBoxModel", javax.swing.ComboBoxModel);
+});
+Clazz_declarePackage ("javax.swing");
+Clazz_load (["javax.swing.ListModel"], "javax.swing.ComboBoxModel", null, function () {
+Clazz_declareInterface (javax.swing, "ComboBoxModel", javax.swing.ListModel);
+});
+Clazz_declarePackage ("jalview.schemes");
+Clazz_load (["jalview.schemes.FollowerColourScheme"], "jalview.schemes.AnnotationColourGradient", ["jalview.datamodel.AlignmentI", "$.GraphLine", "jalview.renderer.AnnotationRenderer", "jalview.schemes.ColourSchemeProperty", "jalview.util.Comparison", "java.awt.Color", "java.util.IdentityHashMap"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.annotation = null;
+this.aboveAnnotationThreshold = -1;
+this.thresholdIsMinMax = false;
+this.annotationThreshold = null;
+this.r1 = 0;
+this.g1 = 0;
+this.b1 = 0;
+this.rr = 0;
+this.gg = 0;
+this.bb = 0;
+this.predefinedColours = false;
+this.seqAssociated = false;
+this.noGradient = false;
+this.seqannot = null;
+this.aamin = 0;
+this.aamax = 0;
+Clazz_instantialize (this, arguments);
+}, jalview.schemes, "AnnotationColourGradient", jalview.schemes.FollowerColourScheme);
+Clazz_overrideMethod (c$, "applyTo", 
+function (sg, hiddenRepSequences) {
+var acg =  new jalview.schemes.AnnotationColourGradient (this.annotation, this.colourScheme, this.aboveAnnotationThreshold);
+acg.thresholdIsMinMax = this.thresholdIsMinMax;
+acg.annotationThreshold = (this.annotationThreshold == null) ? null :  new jalview.datamodel.GraphLine (this.annotationThreshold);
+acg.r1 = this.r1;
+acg.g1 = this.g1;
+acg.b1 = this.b1;
+acg.rr = this.rr;
+acg.gg = this.gg;
+acg.bb = this.bb;
+acg.predefinedColours = this.predefinedColours;
+acg.seqAssociated = this.seqAssociated;
+acg.noGradient = this.noGradient;
+return acg;
+}, "jalview.datamodel.AnnotatedCollectionI,java.util.Map");
+Clazz_makeConstructor (c$, 
+function (annotation, originalColour, aboveThreshold) {
+Clazz_superConstructor (this, jalview.schemes.AnnotationColourGradient, []);
+if (Clazz_instanceOf (originalColour, jalview.schemes.AnnotationColourGradient)) {
+this.colourScheme = (originalColour).colourScheme;
+} else {
+this.colourScheme = originalColour;
+}this.annotation = annotation;
+this.aboveAnnotationThreshold = aboveThreshold;
+if (aboveThreshold != -1 && annotation.threshold != null) {
+this.annotationThreshold = annotation.threshold;
+}this.r1 = 254;
+this.g1 = 254;
+this.b1 = 254;
+this.rr = 0;
+this.gg = 0;
+this.bb = 0;
+this.noGradient = true;
+}, "jalview.datamodel.AlignmentAnnotation,jalview.schemes.ColourSchemeI,~N");
+Clazz_makeConstructor (c$, 
+function (annotation, minColour, maxColour, aboveThreshold) {
+Clazz_superConstructor (this, jalview.schemes.AnnotationColourGradient, []);
+this.annotation = annotation;
+this.aboveAnnotationThreshold = aboveThreshold;
+if (aboveThreshold != -1 && annotation.threshold != null) {
+this.annotationThreshold = annotation.threshold;
+}this.r1 = minColour.getRed ();
+this.g1 = minColour.getGreen ();
+this.b1 = minColour.getBlue ();
+this.rr = maxColour.getRed () - this.r1;
+this.gg = maxColour.getGreen () - this.g1;
+this.bb = maxColour.getBlue () - this.b1;
+this.noGradient = false;
+this.aamax = annotation.graphMax;
+this.aamin = annotation.graphMin;
+if (annotation.isRNA ()) {
+jalview.schemes.ColourSchemeProperty.initRnaHelicesShading (1 + Clazz_floatToInt (this.aamax));
+}}, "jalview.datamodel.AlignmentAnnotation,java.awt.Color,java.awt.Color,~N");
+Clazz_defineMethod (c$, "alignmentChanged", 
+function (alignment, hiddenReps) {
+Clazz_superCall (this, jalview.schemes.AnnotationColourGradient, "alignmentChanged", [alignment, hiddenReps]);
+if (this.seqAssociated && this.annotation.getCalcId () != null) {
+if (this.seqannot != null) {
+this.seqannot.clear ();
+} else {
+this.seqannot =  new java.util.IdentityHashMap ();
+}var alcontext = Clazz_instanceOf (alignment, jalview.datamodel.AlignmentI) ? alignment : alignment.getContext ();
+var f = true;
+var rna = false;
+for (var alan, $alan = alcontext.findAnnotation (this.annotation.getCalcId ()).iterator (); $alan.hasNext () && ((alan = $alan.next ()) || true);) {
+if (alan.sequenceRef != null && (alan.label != null && this.annotation != null && alan.label.equals (this.annotation.label))) {
+if (!rna && alan.isRNA ()) {
+rna = true;
+}this.seqannot.put (alan.sequenceRef, alan);
+if (f || alan.graphMax > this.aamax) {
+this.aamax = alan.graphMax;
+}if (f || alan.graphMin < this.aamin) {
+this.aamin = alan.graphMin;
+}f = false;
+}}
+if (rna) {
+jalview.schemes.ColourSchemeProperty.initRnaHelicesShading (1 + Clazz_floatToInt (this.aamax));
+}}}, "jalview.datamodel.AnnotatedCollectionI,java.util.Map");
+Clazz_defineMethod (c$, "getAnnotation", 
+function () {
+return this.annotation.label;
+});
+Clazz_defineMethod (c$, "getAboveThreshold", 
+function () {
+return this.aboveAnnotationThreshold;
+});
+Clazz_defineMethod (c$, "getAnnotationThreshold", 
+function () {
+if (this.annotationThreshold == null) {
+return 0;
+} else {
+return this.annotationThreshold.value;
+}});
+Clazz_defineMethod (c$, "getMinColour", 
+function () {
+return  new java.awt.Color (Clazz_floatToInt (this.r1), Clazz_floatToInt (this.g1), Clazz_floatToInt (this.b1));
+});
+Clazz_defineMethod (c$, "getMaxColour", 
+function () {
+return  new java.awt.Color (Clazz_floatToInt (this.r1 + this.rr), Clazz_floatToInt (this.g1 + this.gg), Clazz_floatToInt (this.b1 + this.bb));
+});
+Clazz_overrideMethod (c$, "findColour", 
+function (c) {
+return java.awt.Color.red;
+}, "~S");
+Clazz_overrideMethod (c$, "findColourSeq", 
+function (c, j, seq) {
+var currentColour = java.awt.Color.white;
+var annotation = (this.seqAssociated && this.seqannot != null ? this.seqannot.get (seq) : this.annotation);
+if (annotation == null) {
+return currentColour;
+}if ((this.threshold == 0) || this.aboveThreshold (c, j)) {
+if (annotation.annotations != null && j < annotation.annotations.length && annotation.annotations[j] != null && !jalview.util.Comparison.isGap (c)) {
+var aj = annotation.annotations[j];
+if (this.aboveAnnotationThreshold == -1 || (this.annotationThreshold != null && (this.aboveAnnotationThreshold == 1 ? aj.value >= this.annotationThreshold.value : aj.value <= this.annotationThreshold.value))) {
+if (this.predefinedColours && aj.colour != null && !aj.colour.equals (java.awt.Color.black)) {
+currentColour = aj.colour;
+} else if (annotation.hasIcons && annotation.graph == 0) {
+if (aj.secondaryStructure > ' ' && aj.secondaryStructure != '.' && aj.secondaryStructure != '-') {
+if (this.colourScheme != null) {
+currentColour = this.colourScheme.findColourSeq (c, j, seq);
+} else {
+if (annotation.isRNA ()) {
+currentColour = jalview.schemes.ColourSchemeProperty.rnaHelices[Clazz_floatToInt (aj.value)];
+} else {
+currentColour = annotation.annotations[j].secondaryStructure == 'H' ? jalview.renderer.AnnotationRenderer.HELIX_COLOUR : annotation.annotations[j].secondaryStructure == 'E' ? jalview.renderer.AnnotationRenderer.SHEET_COLOUR : jalview.renderer.AnnotationRenderer.STEM_COLOUR;
+}}} else {
+return java.awt.Color.white;
+}} else if (this.noGradient) {
+if (this.colourScheme != null) {
+currentColour = this.colourScheme.findColourSeq (c, j, seq);
+} else {
+if (aj.colour != null) {
+currentColour = aj.colour;
+}}} else {
+currentColour = this.shadeCalculation (annotation, j);
+}}if (this.conservationColouring) {
+currentColour = this.applyConservation (currentColour, j);
+}}}return currentColour;
+}, "~S,~N,jalview.datamodel.SequenceI");
+Clazz_defineMethod (c$, "shadeCalculation", 
+ function (annotation, j) {
+var range = 1;
+if (this.thresholdIsMinMax && annotation.threshold != null && this.aboveAnnotationThreshold == 1 && annotation.annotations[j].value >= annotation.threshold.value) {
+range = (annotation.annotations[j].value - annotation.threshold.value) / (annotation.graphMax - annotation.threshold.value);
+} else if (this.thresholdIsMinMax && annotation.threshold != null && this.aboveAnnotationThreshold == 0 && annotation.annotations[j].value >= annotation.graphMin) {
+range = (annotation.annotations[j].value - annotation.graphMin) / (annotation.threshold.value - annotation.graphMin);
+} else {
+if (annotation.graphMax != annotation.graphMin) {
+range = (annotation.annotations[j].value - annotation.graphMin) / (annotation.graphMax - annotation.graphMin);
+} else {
+range = 0;
+}}var dr = Clazz_floatToInt (this.rr * range + this.r1);
+var dg = Clazz_floatToInt (this.gg * range + this.g1);
+var db = Clazz_floatToInt (this.bb * range + this.b1);
+return  new java.awt.Color (dr, dg, db);
+}, "jalview.datamodel.AlignmentAnnotation,~N");
+Clazz_defineMethod (c$, "isPredefinedColours", 
+function () {
+return this.predefinedColours;
+});
+Clazz_defineMethod (c$, "setPredefinedColours", 
+function (predefinedColours) {
+this.predefinedColours = predefinedColours;
+}, "~B");
+Clazz_defineMethod (c$, "isSeqAssociated", 
+function () {
+return this.seqAssociated;
+});
+Clazz_defineMethod (c$, "setSeqAssociated", 
+function (sassoc) {
+this.seqAssociated = sassoc;
+}, "~B");
+Clazz_defineStatics (c$,
+"NO_THRESHOLD", -1,
+"BELOW_THRESHOLD", 0,
+"ABOVE_THRESHOLD", 1);
+});
+Clazz_declarePackage ("jalview.schemes");
+Clazz_load (["jalview.schemes.ResidueColourScheme"], "jalview.schemes.FollowerColourScheme", null, function () {
+c$ = Clazz_decorateAsClass (function () {
+this.colourScheme = null;
+Clazz_instantialize (this, arguments);
+}, jalview.schemes, "FollowerColourScheme", jalview.schemes.ResidueColourScheme);
+Clazz_defineMethod (c$, "getBaseColour", 
+function () {
+return this.colourScheme;
+});
+Clazz_overrideMethod (c$, "setConsensus", 
+function (consensus) {
+if (this.colourScheme != null) {
+this.colourScheme.setConsensus (consensus);
+}}, "~A");
+Clazz_overrideMethod (c$, "setConservation", 
+function (cons) {
+if (this.colourScheme != null) {
+this.colourScheme.setConservation (cons);
+}}, "jalview.analysis.Conservation");
+Clazz_overrideMethod (c$, "setConservationInc", 
+function (i) {
+if (this.colourScheme != null) {
+this.colourScheme.setConservationInc (i);
+}}, "~N");
+});
+Clazz_declarePackage ("jalview.renderer");
+Clazz_load (["jalview.util.Platform", "java.awt.Color"], "jalview.renderer.AnnotationRenderer", ["awt2swing.Util", "jalview.analysis.AAFrequency", "$.CodingUtils", "$.StructureFrequency", "jalview.jsdev.RegExp", "jalview.schemes.NucleotideColourScheme", "$.ResidueProperties", "$.ZappoColourScheme", "java.awt.BasicStroke", "java.awt.geom.AffineTransform", "java.util.BitSet"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.debugRedraw = false;
+this.charWidth = 0;
+this.endRes = 0;
+this.charHeight = 0;
+this.validCharWidth = false;
+this.hasHiddenColumns = false;
+this.fm = null;
+this.MAC = false;
+this.av_renderHistogram = true;
+this.av_renderProfile = true;
+this.av_normaliseProfile = false;
+this.profcolour = null;
+this.columnSelection = null;
+this.hconsensus = null;
+this.complementConsensus = null;
+this.hStrucConsensus = null;
+this.av_ignoreGapsConsensus = false;
+this.fadedImage = null;
+this.annotationPanel = null;
+this.imgWidth = 0;
+this.sOffset = 0;
+this.visHeight = 0;
+this.useClip = true;
+this.canClip = false;
+this.rna = false;
+this.sdNOTCANONICAL_COLOUR = null;
+Clazz_instantialize (this, arguments);
+}, jalview.renderer, "AnnotationRenderer");
+Clazz_prepareFields (c$, function () {
+this.MAC = jalview.util.Platform.isAMac ();
+});
+Clazz_makeConstructor (c$, 
+function () {
+this.construct (false);
+});
+Clazz_makeConstructor (c$, 
+function (debugRedraw) {
+this.debugRedraw = debugRedraw;
+}, "~B");
+Clazz_defineMethod (c$, "drawStemAnnot", 
+function (g, row_annotations, lastSSX, x, y, iconOffset, startRes, column, validRes, validEnd) {
+g.setColor (jalview.renderer.AnnotationRenderer.STEM_COLOUR);
+var sCol = (Clazz_doubleToInt (lastSSX / this.charWidth)) + startRes;
+var x1 = lastSSX;
+var x2 = (x * this.charWidth);
+var closeparen = jalview.jsdev.RegExp.newRegex (["(\\))"]);
+var dc = (column == 0 || row_annotations[column - 1] == null) ? ' ' : row_annotations[column - 1].secondaryStructure;
+var diffupstream = sCol == 0 || row_annotations[sCol - 1] == null || dc != row_annotations[sCol - 1].secondaryStructure;
+var diffdownstream = !validRes || !validEnd || row_annotations[column] == null || dc != row_annotations[column].secondaryStructure;
+if (column > 0 && jalview.schemes.ResidueProperties.isCloseParenRNA (dc)) {
+if (diffupstream) {
+g.fillPolygon ( Clazz_newIntArray (-1, [lastSSX + 5, lastSSX + 5, lastSSX]),  Clazz_newIntArray (-1, [y + iconOffset, y + 14 + iconOffset, y + 8 + iconOffset]), 3);
+x1 += 5;
+}if (diffdownstream) {
+x2 -= 1;
+}} else {
+if (diffdownstream) {
+g.fillPolygon ( Clazz_newIntArray (-1, [x2 - 5, x2 - 5, x2]),  Clazz_newIntArray (-1, [y + iconOffset, y + 14 + iconOffset, y + 8 + iconOffset]), 3);
+x2 -= 5;
+}if (diffupstream) {
+x1 += 1;
+}}g.fillRect (x1, y + 4 + iconOffset, x2 - x1, 7);
+}, "java.awt.Graphics,~A,~N,~N,~N,~N,~N,~N,~B,~B");
+Clazz_defineMethod (c$, "drawNotCanonicalAnnot", 
+function (g, nonCanColor, row_annotations, lastSSX, x, y, iconOffset, startRes, column, validRes, validEnd) {
+g.setColor (nonCanColor);
+var sCol = (Clazz_doubleToInt (lastSSX / this.charWidth)) + startRes;
+var x1 = lastSSX;
+var x2 = (x * this.charWidth);
+var closeparen = jalview.jsdev.RegExp.newRegex (["}|]|<|[a-z]"]);
+var dc = (column == 0 || row_annotations[column - 1] == null) ? "" : row_annotations[column - 1].displayCharacter;
+var diffupstream = sCol == 0 || row_annotations[sCol - 1] == null || !dc.equals (row_annotations[sCol - 1].displayCharacter);
+var diffdownstream = !validRes || !validEnd || row_annotations[column] == null || !dc.equals (row_annotations[column].displayCharacter);
+if (column > 0 && closeparen.search (dc)) {
+if (diffupstream) {
+g.fillPolygon ( Clazz_newIntArray (-1, [lastSSX + 5, lastSSX + 5, lastSSX]),  Clazz_newIntArray (-1, [y + iconOffset, y + 14 + iconOffset, y + 8 + iconOffset]), 3);
+x1 += 5;
+}if (diffdownstream) {
+x2 -= 1;
+}} else {
+if (diffdownstream) {
+g.fillPolygon ( Clazz_newIntArray (-1, [x2 - 5, x2 - 5, x2]),  Clazz_newIntArray (-1, [y + iconOffset, y + 14 + iconOffset, y + 8 + iconOffset]), 3);
+x2 -= 5;
+}if (diffupstream) {
+x1 += 1;
+}}g.fillRect (x1, y + 4 + iconOffset, x2 - x1, 7);
+}, "java.awt.Graphics,java.awt.Color,~A,~N,~N,~N,~N,~N,~N,~B,~B");
+Clazz_defineMethod (c$, "updateFromAwtRenderPanel", 
+function (annotPanel, av) {
+this.fm = annotPanel.getFontMetrics ();
+this.annotationPanel = annotPanel;
+this.fadedImage = annotPanel.getFadedImage ();
+this.imgWidth = annotPanel.getFadedImageWidth ();
+var bounds = annotPanel.getVisibleVRange ();
+if (bounds != null) {
+this.sOffset = bounds[0];
+this.visHeight = bounds[1];
+if (this.visHeight == 0) {
+this.useClip = false;
+} else {
+this.useClip = this.canClip;
+}} else {
+this.useClip = false;
+}this.updateFromAlignViewport (av);
+}, "jalview.renderer.AwtRenderPanelI,jalview.api.AlignViewportI");
+Clazz_defineMethod (c$, "updateFromAlignViewport", 
+function (av) {
+this.charWidth = av.getCharWidth ();
+this.endRes = av.getEndRes ();
+this.charHeight = av.getCharHeight ();
+this.hasHiddenColumns = av.hasHiddenColumns ();
+this.validCharWidth = av.isValidCharWidth ();
+this.av_renderHistogram = av.isShowConsensusHistogram ();
+this.av_renderProfile = av.isShowSequenceLogo ();
+this.av_normaliseProfile = av.isNormaliseSequenceLogo ();
+this.profcolour = av.getGlobalColourScheme ();
+if (this.profcolour == null) {
+this.profcolour = av.getAlignment ().isNucleotide () ?  new jalview.schemes.NucleotideColourScheme () :  new jalview.schemes.ZappoColourScheme ();
+}this.columnSelection = av.getColumnSelection ();
+this.hconsensus = av.getSequenceConsensusHash ();
+this.complementConsensus = av.getComplementConsensusHash ();
+this.hStrucConsensus = av.getRnaStructureConsensusHash ();
+this.av_ignoreGapsConsensus = av.isIgnoreGapsConsensus ();
+}, "jalview.api.AlignViewportI");
+Clazz_defineMethod (c$, "getProfileFor", 
+function (aa, column) {
+if (aa.autoCalculated && (aa.label.startsWith ("Consensus") || aa.label.startsWith ("cDNA Consensus"))) {
+var forComplement = aa.label.startsWith ("cDNA Consensus");
+if (aa.groupRef != null && aa.groupRef.consensusData != null && aa.groupRef.isShowSequenceLogo ()) {
+return jalview.analysis.AAFrequency.extractProfile (aa.groupRef.consensusData[column], aa.groupRef.getIgnoreGapsConsensus ());
+}if (aa.groupRef == null && aa.sequenceRef == null) {
+if (forComplement) {
+return jalview.analysis.AAFrequency.extractCdnaProfile (this.complementConsensus[column], this.av_ignoreGapsConsensus);
+} else {
+return jalview.analysis.AAFrequency.extractProfile (this.hconsensus[column], this.av_ignoreGapsConsensus);
+}}} else {
+if (aa.autoCalculated && aa.label.startsWith ("StrucConsensus")) {
+if (aa.groupRef == null && aa.sequenceRef == null && this.hStrucConsensus != null && this.hStrucConsensus.length > column) {
+return jalview.analysis.StructureFrequency.extractProfile (this.hStrucConsensus[column], this.av_ignoreGapsConsensus);
+}}}return null;
+}, "jalview.datamodel.AlignmentAnnotation,~N");
+Clazz_defineMethod (c$, "drawComponent", 
+function (annotPanel, av, g, activeRow, startRes, endRes) {
+var stime = System.currentTimeMillis ();
+var usedFaded = false;
+this.updateFromAwtRenderPanel (annotPanel, av);
+this.fm = g.getFontMetrics ();
+var aa = av.getAlignment ().getAlignmentAnnotation ();
+var temp = 0;
+if (aa == null) {
+return false;
+}var x = 0;
+var y = 0;
+var column = 0;
+var lastSS;
+var lastSSX;
+var iconOffset = 0;
+var validRes = false;
+var validEnd = false;
+var labelAllCols = false;
+var centreColLabels;
+var centreColLabelsDef = av.isCentreColumnLabels ();
+var scaleColLabel = false;
+var consensusAnnot = av.getAlignmentConsensusAnnotation ();
+var structConsensusAnnot = av.getAlignmentStrucConsensusAnnotation ();
+var complementConsensusAnnot = av.getComplementConsensusAnnotation ();
+var renderHistogram = true;
+var renderProfile = true;
+var normaliseProfile = false;
+var isRNA = this.rna;
+var graphGroupDrawn =  new java.util.BitSet ();
+var charOffset = 0;
+var fmWidth;
+var fmScaling = 1;
+var ofont = g.getFont ();
+var yfrom = 0;
+var f_i = 0;
+var yto = 0;
+var f_to = 0;
+var clipst = false;
+var clipend = false;
+for (var i = 0; i < aa.length; i++) {
+var row = aa[i];
+isRNA = row.isRNA ();
+{
+if (row.groupRef != null && row === row.groupRef.getConsensus ()) {
+renderHistogram = row.groupRef.isShowConsensusHistogram ();
+renderProfile = row.groupRef.isShowSequenceLogo ();
+normaliseProfile = row.groupRef.isNormaliseSequenceLogo ();
+} else if (row === consensusAnnot || row === structConsensusAnnot || row === complementConsensusAnnot) {
+renderHistogram = this.av_renderHistogram;
+renderProfile = this.av_renderProfile;
+normaliseProfile = this.av_normaliseProfile;
+} else {
+renderHistogram = true;
+}}var row_annotations = row.annotations;
+if (!row.visible) {
+continue;
+}centreColLabels = row.centreColLabels || centreColLabelsDef;
+labelAllCols = row.showAllColLabels;
+scaleColLabel = row.scaleColLabel;
+lastSS = ' ';
+lastSSX = 0;
+if (!this.useClip || ((y - this.charHeight) < this.visHeight && (y + row.height + this.charHeight * 2) >= this.sOffset)) {
+if (!clipst) {
+clipst = true;
+yfrom = y;
+f_i = i;
+}yto = y;
+f_to = i;
+if (row.graph > 0) {
+if (row.graphGroup > -1 && graphGroupDrawn.get (row.graphGroup)) {
+continue;
+}y += row.height;
+if (row.hasText) {
+iconOffset = this.charHeight - this.fm.getDescent ();
+y -= this.charHeight;
+}} else if (row.hasText) {
+iconOffset = this.charHeight - this.fm.getDescent ();
+} else {
+iconOffset = 0;
+}if (row.autoCalculated && av.isCalculationInProgress (row)) {
+y += this.charHeight;
+usedFaded = true;
+g.drawImage (this.fadedImage, 0, y - row.height, this.imgWidth, y, 0, y - row.height, this.imgWidth, y, this.annotationPanel);
+g.setColor (java.awt.Color.black);
+continue;
+}x = (startRes == 0) ? 0 : -1;
+while (x < endRes - startRes) {
+if (this.hasHiddenColumns) {
+column = this.columnSelection.adjustForHiddenColumns (startRes + x);
+if (column > row_annotations.length - 1) {
+break;
+}} else {
+column = startRes + x;
+}if ((row_annotations == null) || (row_annotations.length <= column) || (row_annotations[column] == null)) {
+validRes = false;
+} else {
+validRes = true;
+}var displayChar = validRes ? row_annotations[column].displayCharacter : null;
+if (x > -1) {
+if (activeRow == i) {
+g.setColor (java.awt.Color.red);
+if (this.columnSelection != null) {
+for (var n = 0; n < this.columnSelection.size (); n++) {
+var v = this.columnSelection.columnAt (n);
+if (v == column) {
+g.fillRect (x * this.charWidth, y, this.charWidth, this.charHeight);
+}}
+}}if (row.getInvalidStrucPos () > x) {
+g.setColor (java.awt.Color.orange);
+g.fillRect (x * this.charWidth, y, this.charWidth, this.charHeight);
+} else if (row.getInvalidStrucPos () == x) {
+g.setColor (java.awt.Color.orange.darker ());
+g.fillRect (x * this.charWidth, y, this.charWidth, this.charHeight);
+}if (this.validCharWidth && validRes && displayChar != null && (displayChar.length > 0)) {
+fmWidth = this.fm.charsWidth (displayChar.toCharArray (), 0, displayChar.length);
+if (scaleColLabel) {
+if (fmWidth > this.charWidth) {
+fmScaling = this.charWidth;
+fmScaling /= fmWidth;
+g.setFont (ofont.deriveFont (java.awt.geom.AffineTransform.getScaleInstance (fmScaling, 1.0)));
+fmWidth = this.charWidth;
+}}charOffset = Clazz_floatToInt ((this.charWidth - fmWidth) / 2);
+if (row_annotations[column].colour == null) {
+g.setColor (java.awt.Color.black);
+} else {
+g.setColor (row_annotations[column].colour);
+}if (column == 0 || row.graph > 0) {
+awt2swing.Util.drawString (g, displayChar, (x * this.charWidth) + charOffset, y + iconOffset);
+} else if (row_annotations[column - 1] == null || (labelAllCols || !displayChar.equals (row_annotations[column - 1].displayCharacter) || (displayChar.length < 2 && row_annotations[column].secondaryStructure == ' '))) {
+awt2swing.Util.drawString (g, displayChar, x * this.charWidth + charOffset, y + iconOffset);
+}g.setFont (ofont);
+}}if (row.hasIcons) {
+var ss = validRes ? row_annotations[column].secondaryStructure : '-';
+if (ss == '(') {
+if (displayChar.indexOf (')') > -1) {
+ss = ')';
+}}if (ss == '[') {
+if ((displayChar.indexOf (']') > -1)) {
+ss = ']';
+}}if (ss == '{') {
+if (displayChar.indexOf ('}') > -1) {
+ss = '}';
+}}if (ss == '<') {
+if (displayChar.indexOf ('<') > -1) {
+ss = '>';
+}}if (ss.charCodeAt (0) >= 65) {
+if (displayChar.indexOf (ss.charCodeAt (0) + 32) > -1) {
+ss = String.fromCharCode (ss.charCodeAt (0) + 32);
+}}if (!validRes || (ss != lastSS)) {
+if (x > -1) {
+var nb_annot = x - temp;
+switch (lastSS) {
+case '(':
+case ')':
+this.drawStemAnnot (g, row_annotations, lastSSX, x, y, iconOffset, startRes, column, validRes, validEnd);
+temp = x;
+break;
+case 'H':
+if (!isRNA) {
+this.drawHelixAnnot (g, row_annotations, lastSSX, x, y, iconOffset, startRes, column, validRes, validEnd);
+break;
+}case 'E':
+if (!isRNA) {
+this.drawSheetAnnot (g, row_annotations, lastSSX, x, y, iconOffset, startRes, column, validRes, validEnd);
+break;
+}case '{':
+case '}':
+case '[':
+case ']':
+case '>':
+case '<':
+case 'A':
+case 'a':
+case 'B':
+case 'b':
+case 'C':
+case 'c':
+case 'D':
+case 'd':
+case 'e':
+case 'F':
+case 'f':
+case 'G':
+case 'g':
+case 'h':
+case 'I':
+case 'i':
+case 'J':
+case 'j':
+case 'K':
+case 'k':
+case 'L':
+case 'l':
+case 'M':
+case 'm':
+case 'N':
+case 'n':
+case 'O':
+case 'o':
+case 'P':
+case 'p':
+case 'Q':
+case 'q':
+case 'R':
+case 'r':
+case 'S':
+case 's':
+case 'T':
+case 't':
+case 'U':
+case 'u':
+case 'V':
+case 'v':
+case 'W':
+case 'w':
+case 'X':
+case 'x':
+case 'Y':
+case 'y':
+case 'Z':
+case 'z':
+var nonCanColor = this.getNotCanonicalColor (lastSS);
+this.drawNotCanonicalAnnot (g, nonCanColor, row_annotations, lastSSX, x, y, iconOffset, startRes, column, validRes, validEnd);
+temp = x;
+break;
+default:
+g.setColor (java.awt.Color.gray);
+g.fillRect (lastSSX, y + 6 + iconOffset, (x * this.charWidth) - lastSSX, 2);
+temp = x;
+break;
+}
+}if (validRes) {
+lastSS = ss;
+} else {
+lastSS = ' ';
+}if (x > -1) {
+lastSSX = (x * this.charWidth);
+}}}column++;
+x++;
+}
+if (column >= row_annotations.length) {
+column = row_annotations.length - 1;
+validEnd = false;
+} else {
+validEnd = true;
+}if ((row_annotations == null) || (row_annotations.length <= column) || (row_annotations[column] == null)) {
+validRes = false;
+} else {
+validRes = true;
+}if (row.hasIcons) {
+switch (lastSS) {
+case 'H':
+if (!isRNA) {
+this.drawHelixAnnot (g, row_annotations, lastSSX, x, y, iconOffset, startRes, column, validRes, validEnd);
+break;
+}case 'E':
+if (!isRNA) {
+this.drawSheetAnnot (g, row_annotations, lastSSX, x, y, iconOffset, startRes, column, validRes, validEnd);
+break;
+}case '(':
+case ')':
+this.drawStemAnnot (g, row_annotations, lastSSX, x, y, iconOffset, startRes, column, validRes, validEnd);
+break;
+case '{':
+case '}':
+case '[':
+case ']':
+case '>':
+case '<':
+case 'A':
+case 'a':
+case 'B':
+case 'b':
+case 'C':
+case 'c':
+case 'D':
+case 'd':
+case 'e':
+case 'F':
+case 'f':
+case 'G':
+case 'g':
+case 'h':
+case 'I':
+case 'i':
+case 'J':
+case 'j':
+case 'K':
+case 'k':
+case 'L':
+case 'l':
+case 'M':
+case 'm':
+case 'N':
+case 'n':
+case 'O':
+case 'o':
+case 'P':
+case 'p':
+case 'Q':
+case 'q':
+case 'R':
+case 'r':
+case 'T':
+case 't':
+case 'U':
+case 'u':
+case 'V':
+case 'v':
+case 'W':
+case 'w':
+case 'X':
+case 'x':
+case 'Y':
+case 'y':
+case 'Z':
+case 'z':
+var nonCanColor = this.getNotCanonicalColor (lastSS);
+this.drawNotCanonicalAnnot (g, nonCanColor, row_annotations, lastSSX, x, y, iconOffset, startRes, column, validRes, validEnd);
+break;
+default:
+this.drawGlyphLine (g, row_annotations, lastSSX, x, y, iconOffset, startRes, column, validRes, validEnd);
+break;
+}
+}if (row.graph > 0 && row.graphHeight > 0) {
+if (row.graph == 2) {
+if (row.graphGroup > -1 && !graphGroupDrawn.get (row.graphGroup)) {
+var groupmax = -999999;
+var groupmin = 9999999;
+for (var gg = 0; gg < aa.length; gg++) {
+if (aa[gg].graphGroup != row.graphGroup) {
+continue;
+}if (aa[gg] !== row) {
+aa[gg].visible = false;
+}if (aa[gg].graphMax > groupmax) {
+groupmax = aa[gg].graphMax;
+}if (aa[gg].graphMin < groupmin) {
+groupmin = aa[gg].graphMin;
+}}
+for (var gg = 0; gg < aa.length; gg++) {
+if (aa[gg].graphGroup == row.graphGroup) {
+this.drawLineGraph (g, aa[gg], aa[gg].annotations, startRes, endRes, y, groupmin, groupmax, row.graphHeight);
+}}
+graphGroupDrawn.set (row.graphGroup);
+} else {
+this.drawLineGraph (g, row, row_annotations, startRes, endRes, y, row.graphMin, row.graphMax, row.graphHeight);
+}} else if (row.graph == 1) {
+this.drawBarGraph (g, row, row_annotations, startRes, endRes, row.graphMin, row.graphMax, y, renderHistogram, renderProfile, normaliseProfile);
+}}} else {
+if (clipst && !clipend) {
+clipend = true;
+}}if (row.graph > 0 && row.hasText) {
+y += this.charHeight;
+}if (row.graph == 0) {
+y += aa[i].height;
+}}
+if (this.debugRedraw) {
+if (this.canClip) {
+if (clipst) {
+System.err.println ("Start clip at : " + yfrom + " (index " + f_i + ")");
+}if (clipend) {
+System.err.println ("End clip at : " + yto + " (index " + f_to + ")");
+}};System.err.println ("Annotation Rendering time:" + (System.currentTimeMillis () - stime));
+};return !usedFaded;
+}, "jalview.renderer.AwtRenderPanelI,jalview.api.AlignViewportI,java.awt.Graphics,~N,~N,~N");
+Clazz_defineMethod (c$, "drawGlyphLine", 
+function (g, row, lastSSX, x, y, iconOffset, startRes, column, validRes, validEnd) {
+g.setColor (jalview.renderer.AnnotationRenderer.GLYPHLINE_COLOR);
+g.fillRect (lastSSX, y + 6 + iconOffset, (x * this.charWidth) - lastSSX, 2);
+}, "java.awt.Graphics,~A,~N,~N,~N,~N,~N,~N,~B,~B");
+Clazz_defineMethod (c$, "drawSheetAnnot", 
+function (g, row, lastSSX, x, y, iconOffset, startRes, column, validRes, validEnd) {
+g.setColor (jalview.renderer.AnnotationRenderer.SHEET_COLOUR);
+if (!validEnd || !validRes || row == null || row[column] == null || row[column].secondaryStructure != 'E') {
+g.fillRect (lastSSX, y + 4 + iconOffset, (x * this.charWidth) - lastSSX - 4, 7);
+g.fillPolygon ( Clazz_newIntArray (-1, [(x * this.charWidth) - 4, (x * this.charWidth) - 4, (x * this.charWidth)]),  Clazz_newIntArray (-1, [y + iconOffset, y + 14 + iconOffset, y + 7 + iconOffset]), 3);
+} else {
+g.fillRect (lastSSX, y + 4 + iconOffset, (x + 1) * this.charWidth - lastSSX, 7);
+}}, "java.awt.Graphics,~A,~N,~N,~N,~N,~N,~N,~B,~B");
+Clazz_defineMethod (c$, "drawHelixAnnot", 
+function (g, row, lastSSX, x, y, iconOffset, startRes, column, validRes, validEnd) {
+g.setColor (jalview.renderer.AnnotationRenderer.HELIX_COLOUR);
+var sCol = (Clazz_doubleToInt (lastSSX / this.charWidth)) + startRes;
+var x1 = lastSSX;
+var x2 = (x * this.charWidth);
+if (this.MAC) {
+var ofs = Clazz_doubleToInt (this.charWidth / 2);
+g.fillRoundRect (lastSSX, y + 4 + iconOffset, x2 - x1, 8, 8, 8);
+if (sCol == 0 || row[sCol - 1] == null || row[sCol - 1].secondaryStructure != 'H') {
+} else {
+g.fillRoundRect (lastSSX, y + 4 + iconOffset, x2 - x1 - ofs + 1, 8, 0, 0);
+}if (!validRes || row[column] == null || row[column].secondaryStructure != 'H') {
+} else {
+g.fillRoundRect (lastSSX + ofs, y + 4 + iconOffset, x2 - x1 - ofs + 1, 8, 0, 0);
+}return;
+}if (sCol == 0 || row[sCol - 1] == null || row[sCol - 1].secondaryStructure != 'H') {
+g.fillArc (lastSSX, y + 4 + iconOffset, this.charWidth, 8, 90, 180);
+x1 += Clazz_doubleToInt (this.charWidth / 2);
+}if (!validRes || row[column] == null || row[column].secondaryStructure != 'H') {
+g.fillArc ((x * this.charWidth) - this.charWidth, y + 4 + iconOffset, this.charWidth, 8, 270, 180);
+x2 -= Clazz_doubleToInt (this.charWidth / 2);
+}g.fillRect (x1, y + 4 + iconOffset, x2 - x1, 8);
+}, "java.awt.Graphics,~A,~N,~N,~N,~N,~N,~N,~B,~B");
+Clazz_defineMethod (c$, "drawLineGraph", 
+function (g, _aa, aa_annotations, sRes, eRes, y, min, max, graphHeight) {
+if (sRes > aa_annotations.length) {
+return;
+}var x = 0;
+if (eRes < this.endRes) {
+eRes++;
+}eRes = Math.min (eRes, aa_annotations.length);
+if (sRes == 0) {
+x++;
+}var y1 = y;
+var y2 = y;
+var range = max - min;
+if (min < 0) {
+y2 = y - Clazz_floatToInt ((0 - min / range) * graphHeight);
+}g.setColor (java.awt.Color.gray);
+g.drawLine (x - this.charWidth, y2, (eRes - sRes + 1) * this.charWidth, y2);
+eRes = Math.min (eRes, aa_annotations.length);
+var column;
+var aaMax = aa_annotations.length - 1;
+while (x < eRes - sRes) {
+column = sRes + x;
+if (this.hasHiddenColumns) {
+column = this.columnSelection.adjustForHiddenColumns (column);
+}if (column > aaMax) {
+break;
+}if (aa_annotations[column] == null || aa_annotations[column - 1] == null) {
+x++;
+continue;
+}if (aa_annotations[column].colour == null) {
+g.setColor (java.awt.Color.black);
+} else {
+g.setColor (aa_annotations[column].colour);
+}y1 = y - Clazz_floatToInt (((aa_annotations[column - 1].value - min) / range) * graphHeight);
+y2 = y - Clazz_floatToInt (((aa_annotations[column].value - min) / range) * graphHeight);
+g.drawLine (x * this.charWidth - Clazz_doubleToInt (this.charWidth / 2), y1, x * this.charWidth + Clazz_doubleToInt (this.charWidth / 2), y2);
+x++;
+}
+if (_aa.threshold != null) {
+g.setColor (_aa.threshold.colour);
+var g2 = g;
+g2.setStroke ( new java.awt.BasicStroke (1, 2, 1, 3,  Clazz_newFloatArray (-1, [5, 3]), 0));
+y2 = Clazz_floatToInt (y - ((_aa.threshold.value - min) / range) * graphHeight);
+g.drawLine (0, y2, (eRes - sRes) * this.charWidth, y2);
+g2.setStroke ( new java.awt.BasicStroke ());
+}}, "java.awt.Graphics,jalview.datamodel.AlignmentAnnotation,~A,~N,~N,~N,~N,~N,~N");
+Clazz_defineMethod (c$, "drawBarGraph", 
+function (g, _aa, aa_annotations, sRes, eRes, min, max, y, renderHistogram, renderProfile, normaliseProfile) {
+if (sRes > aa_annotations.length) {
+return;
+}var ofont = g.getFont ();
+eRes = Math.min (eRes, aa_annotations.length);
+var x = 0;
+var y1 = y;
+var y2 = y;
+var range = max - min;
+if (min < 0) {
+y2 = y - Clazz_floatToInt ((0 - min / (range)) * _aa.graphHeight);
+}g.setColor (java.awt.Color.gray);
+g.drawLine (x, y2, (eRes - sRes) * this.charWidth, y2);
+var column;
+var aaMax = aa_annotations.length - 1;
+while (x < eRes - sRes) {
+column = sRes + x;
+if (this.hasHiddenColumns) {
+column = this.columnSelection.adjustForHiddenColumns (column);
+}if (column > aaMax) {
+break;
+}if (aa_annotations[column] == null) {
+x++;
+continue;
+}if (aa_annotations[column].colour == null) {
+g.setColor (java.awt.Color.black);
+} else {
+g.setColor (aa_annotations[column].colour);
+}y1 = y - Clazz_floatToInt (((aa_annotations[column].value - min) / (range)) * _aa.graphHeight);
+if (renderHistogram) {
+if (y1 - y2 > 0) {
+g.fillRect (x * this.charWidth, y2, this.charWidth, y1 - y2);
+} else {
+g.fillRect (x * this.charWidth, y1, this.charWidth, y2 - y1);
+}}if (renderProfile) {
+var profl = this.getProfileFor (_aa, column);
+if (profl != null && profl[2] != 0) {
+var isStructureProfile = profl[0] == 1;
+var isCdnaProfile = profl[0] == 2;
+var ht = normaliseProfile ? y - _aa.graphHeight : y1;
+var htn = normaliseProfile ? _aa.graphHeight : (y2 - y1);
+var hght;
+var wdth;
+var ht2 = 0;
+var dc;
+dc =  Clazz_newCharArray (isStructureProfile ? 2 : (isCdnaProfile ? 3 : 1), '\0');
+var lm = g.getFontMetrics (ofont).getLineMetrics ("Q", g);
+var scale = 1 / (normaliseProfile ? profl[2] : 100);
+var ofontHeight = 1 / lm.getAscent ();
+var scl = 0.0;
+var c = 3;
+var valuesProcessed = 0;
+while (valuesProcessed < profl[1]) {
+if (isStructureProfile) {
+dc[0] = String.fromCharCode (profl[c++]);
+dc[1] = String.fromCharCode (profl[c++]);
+} else if (isCdnaProfile) {
+dc = jalview.analysis.CodingUtils.decodeCodon (profl[c++]);
+} else {
+dc[0] = String.fromCharCode (profl[c++]);
+}wdth = this.charWidth;
+wdth /= this.fm.charsWidth (dc, 0, dc.length);
+ht += scl;
+scl = htn * scale * profl[c++];
+lm = ofont.getLineMetrics (dc, 0, 1, g.getFontMetrics ().getFontRenderContext ());
+g.setFont (ofont.deriveFont (java.awt.geom.AffineTransform.getScaleInstance (wdth, scl / lm.getAscent ())));
+lm = g.getFontMetrics ().getLineMetrics (dc, 0, 1, g);
+var colour = null;
+if (isCdnaProfile) {
+var codonTranslation = jalview.schemes.ResidueProperties.codonTranslate ( String.instantialize (dc));
+colour = this.profcolour.findColourSeq (codonTranslation.charAt (0), column, null);
+} else {
+colour = this.profcolour.findColourSeq (dc[0], column, null);
+}g.setColor (colour === java.awt.Color.white ? java.awt.Color.lightGray : colour);
+hght = (ht + (scl - lm.getDescent () - lm.getBaselineOffsets ()[lm.getBaselineIndex ()]));
+g.drawChars (dc, 0, dc.length, x * this.charWidth, Clazz_doubleToInt (hght));
+valuesProcessed++;
+}
+g.setFont (ofont);
+}}x++;
+}
+if (_aa.threshold != null) {
+g.setColor (_aa.threshold.colour);
+var g2 = g;
+g2.setStroke ( new java.awt.BasicStroke (1, 2, 1, 3,  Clazz_newFloatArray (-1, [5, 3]), 0));
+y2 = Clazz_floatToInt (y - ((_aa.threshold.value - min) / range) * _aa.graphHeight);
+g.drawLine (0, y2, (eRes - sRes) * this.charWidth, y2);
+g2.setStroke ( new java.awt.BasicStroke ());
+}}, "java.awt.Graphics,jalview.datamodel.AlignmentAnnotation,~A,~N,~N,~N,~N,~N,~B,~B,~B");
+Clazz_defineMethod (c$, "drawGraph", 
+function (g, _aa, aa_annotations, width, y, sRes, eRes) {
+eRes = Math.min (eRes, aa_annotations.length);
+g.setColor (java.awt.Color.white);
+g.fillRect (0, 0, width, y);
+g.setColor ( new java.awt.Color (0, 0, 180));
+var x = 0;
+var height;
+for (var j = sRes; j < eRes; j++) {
+if (aa_annotations[j] != null) {
+if (aa_annotations[j].colour == null) {
+g.setColor (java.awt.Color.black);
+} else {
+g.setColor (aa_annotations[j].colour);
+}height = Clazz_floatToInt ((aa_annotations[j].value / _aa.graphMax) * y);
+if (height > y) {
+height = y;
+}g.fillRect (x, y - height, this.charWidth, height);
+}x += this.charWidth;
+}
+}, "java.awt.Graphics,jalview.datamodel.AlignmentAnnotation,~A,~N,~N,~N,~N");
+Clazz_defineMethod (c$, "getNotCanonicalColor", 
+function (lastss) {
+switch (lastss) {
+case '{':
+case '}':
+return  new java.awt.Color (255, 125, 5);
+case '[':
+case ']':
+return  new java.awt.Color (245, 115, 10);
+case '>':
+case '<':
+return  new java.awt.Color (235, 135, 15);
+case 'A':
+case 'a':
+return  new java.awt.Color (225, 105, 20);
+case 'B':
+case 'b':
+return  new java.awt.Color (215, 145, 30);
+case 'C':
+case 'c':
+return  new java.awt.Color (205, 95, 35);
+case 'D':
+case 'd':
+return  new java.awt.Color (195, 155, 45);
+case 'E':
+case 'e':
+return  new java.awt.Color (185, 85, 55);
+case 'F':
+case 'f':
+return  new java.awt.Color (175, 165, 65);
+case 'G':
+case 'g':
+return  new java.awt.Color (170, 75, 75);
+case 'H':
+case 'h':
+return  new java.awt.Color (160, 175, 85);
+case 'I':
+case 'i':
+return  new java.awt.Color (150, 65, 95);
+case 'J':
+case 'j':
+return  new java.awt.Color (140, 185, 105);
+case 'K':
+case 'k':
+return  new java.awt.Color (130, 55, 110);
+case 'L':
+case 'l':
+return  new java.awt.Color (120, 195, 120);
+case 'M':
+case 'm':
+return  new java.awt.Color (110, 45, 130);
+case 'N':
+case 'n':
+return  new java.awt.Color (100, 205, 140);
+case 'O':
+case 'o':
+return  new java.awt.Color (90, 35, 150);
+case 'P':
+case 'p':
+return  new java.awt.Color (85, 215, 160);
+case 'Q':
+case 'q':
+return  new java.awt.Color (75, 25, 170);
+case 'R':
+case 'r':
+return  new java.awt.Color (65, 225, 180);
+case 'S':
+case 's':
+return  new java.awt.Color (55, 15, 185);
+case 'T':
+case 't':
+return  new java.awt.Color (45, 235, 195);
+case 'U':
+case 'u':
+return  new java.awt.Color (35, 5, 205);
+case 'V':
+case 'v':
+return  new java.awt.Color (25, 245, 215);
+case 'W':
+case 'w':
+return  new java.awt.Color (15, 0, 225);
+case 'X':
+case 'x':
+return  new java.awt.Color (10, 255, 235);
+case 'Y':
+case 'y':
+return  new java.awt.Color (5, 150, 245);
+case 'Z':
+case 'z':
+return  new java.awt.Color (0, 80, 255);
+default:
+System.out.println ("This is not a interaction : " + lastss);
+return null;
+}
+}, "~S");
+c$.GLYPHLINE_COLOR = c$.prototype.GLYPHLINE_COLOR = java.awt.Color.gray;
+c$.SHEET_COLOUR = c$.prototype.SHEET_COLOUR = java.awt.Color.green;
+c$.HELIX_COLOUR = c$.prototype.HELIX_COLOUR = java.awt.Color.red;
+c$.STEM_COLOUR = c$.prototype.STEM_COLOUR = java.awt.Color.blue;
+});
+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.schemes");
+Clazz_load (null, "jalview.schemes.GraduatedColor", ["jalview.schemes.UserColourScheme", "java.awt.Color", "java.lang.Float"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.thresholdState = -1;
+this.lr = 0;
+this.lg = 0;
+this.lb = 0;
+this.dr = 0;
+this.dg = 0;
+this.db = 0;
+this.base = 0;
+this.range = 0;
+this.thrsh = 0;
+this.tolow = false;
+this.autoScale = true;
+this.ucs = null;
+this.colourByLabel = false;
+Clazz_instantialize (this, arguments);
+}, jalview.schemes, "GraduatedColor");
+Clazz_makeConstructor (c$, 
+function (low, high, min, max) {
+this.thrsh = NaN;
+this.tolow = min >= max;
+this.lr = low.getRed () / 255;
+this.lg = low.getGreen () / 255;
+this.lb = low.getBlue () / 255;
+this.dr = (high.getRed () / 255) - this.lr;
+this.dg = (high.getGreen () / 255) - this.lg;
+this.db = (high.getBlue () / 255) - this.lb;
+if (this.tolow) {
+this.base = max;
+this.range = min - max;
+} else {
+this.base = min;
+this.range = max - min;
+}}, "java.awt.Color,java.awt.Color,~N,~N");
+Clazz_makeConstructor (c$, 
+function (oldcs) {
+this.lr = oldcs.lr;
+this.lg = oldcs.lg;
+this.lb = oldcs.lb;
+this.dr = oldcs.dr;
+this.dg = oldcs.dg;
+this.db = oldcs.db;
+this.base = oldcs.base;
+this.range = oldcs.range;
+this.tolow = oldcs.tolow;
+this.thresholdState = oldcs.thresholdState;
+this.thrsh = oldcs.thrsh;
+this.autoScale = oldcs.autoScale;
+this.colourByLabel = oldcs.colourByLabel;
+}, "jalview.schemes.GraduatedColor");
+Clazz_makeConstructor (c$, 
+function (oldcs, min, max) {
+this.construct (oldcs);
+this.updateBounds (min, max);
+}, "jalview.schemes.GraduatedColor,~N,~N");
+Clazz_defineMethod (c$, "getMinColor", 
+function () {
+return  new java.awt.Color (this.lr, this.lg, this.lb);
+});
+Clazz_defineMethod (c$, "getMaxColor", 
+function () {
+return  new java.awt.Color (this.lr + this.dr, this.lg + this.dg, this.lb + this.db);
+});
+Clazz_defineMethod (c$, "getTolow", 
+function () {
+return this.tolow;
+});
+Clazz_defineMethod (c$, "setTolow", 
+function (tolower) {
+this.tolow = tolower;
+}, "~B");
+Clazz_defineMethod (c$, "isColored", 
+function (feature) {
+var val = feature.getScore ();
+if (Float.isNaN (val)) {
+return true;
+}if (this.thresholdState == -1) {
+return true;
+}if (Float.isNaN (this.thrsh)) {
+return true;
+}var rtn = this.thresholdState == 1;
+if (val <= this.thrsh) {
+return !rtn;
+} else {
+return rtn;
+}}, "jalview.datamodel.SequenceFeature");
+Clazz_defineMethod (c$, "isColourByLabel", 
+function () {
+return this.colourByLabel;
+});
+Clazz_defineMethod (c$, "setColourByLabel", 
+function (colourByLabel) {
+this.colourByLabel = colourByLabel;
+}, "~B");
+Clazz_defineMethod (c$, "findColor", 
+function (feature) {
+if (this.colourByLabel) {
+if (this.ucs == null) {
+this.ucs =  new jalview.schemes.UserColourScheme ();
+}return this.ucs.createColourFromName (feature.getDescription ());
+}if (this.range == 0.0) {
+return this.getMaxColor ();
+}var scr = feature.getScore ();
+if (Float.isNaN (scr)) {
+return this.getMinColor ();
+}var scl = (scr - this.base) / this.range;
+if (this.tolow) {
+scl = -scl;
+}if (scl < 0) {
+scl = 0;
+}if (scl > 1) {
+scl = 1;
+}return  new java.awt.Color (this.lr + scl * this.dr, this.lg + scl * this.dg, this.lb + scl * this.db);
+}, "jalview.datamodel.SequenceFeature");
+Clazz_defineMethod (c$, "setThresh", 
+function (value) {
+this.thrsh = value;
+}, "~N");
+Clazz_defineMethod (c$, "getThresh", 
+function () {
+return this.thrsh;
+});
+Clazz_defineMethod (c$, "setThreshType", 
+function (aboveThreshold) {
+this.thresholdState = aboveThreshold;
+}, "~N");
+Clazz_defineMethod (c$, "getThreshType", 
+function () {
+return this.thresholdState;
+});
+Clazz_defineMethod (c$, "getMax", 
+function () {
+return (this.tolow) ? this.base : (this.base + this.range);
+});
+Clazz_defineMethod (c$, "getMin", 
+function () {
+return (this.tolow) ? (this.base + this.range) : this.base;
+});
+Clazz_defineMethod (c$, "isAutoScale", 
+function () {
+return this.autoScale;
+});
+Clazz_defineMethod (c$, "setAutoScaled", 
+function (autoscale) {
+this.autoScale = autoscale;
+}, "~B");
+Clazz_defineMethod (c$, "updateBounds", 
+function (min, max) {
+if (max < min) {
+this.base = max;
+this.range = min - max;
+this.tolow = true;
+} else {
+this.base = min;
+this.range = max - min;
+this.tolow = false;
+}}, "~N,~N");
+});
+Clazz_declarePackage ("jalview.appletgui");
+Clazz_load (["awt2swing.Panel", "jalview.renderer.seqfeatures.FeatureRenderer"], "jalview.appletgui.FeatureRenderer", ["awt2swing.Button", "$.Choice", "$.Label", "$.ScrollPane", "$.TextArea", "$.TextField", "$.Util", "jalview.appletgui.FeatureColourChooser", "$.JVDialog", "$.UserDefinedColours", "jalview.datamodel.SearchResults", "jalview.io.FeaturesFile", "jalview.schemes.GraduatedColor", "$.UserColourScheme", "jalview.util.MessageManager", "java.awt.BorderLayout", "$.Color", "$.Font", "$.GridLayout", "java.awt.event.ActionListener", "$.ItemListener", "$.MouseAdapter", "java.lang.Error"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.featureLinks = null;
+this.featureIndex = 0;
+this.deleteFeature = false;
+this.colourPanel = null;
+if (!Clazz_isClassDefined ("jalview.appletgui.FeatureRenderer.FeatureColourPanel")) {
+jalview.appletgui.FeatureRenderer.$FeatureRenderer$FeatureColourPanel$ ();
+}
+Clazz_instantialize (this, arguments);
+}, jalview.appletgui, "FeatureRenderer", jalview.renderer.seqfeatures.FeatureRenderer);
+Clazz_makeConstructor (c$, 
+function (av) {
+Clazz_superConstructor (this, jalview.appletgui.FeatureRenderer);
+this.av = av;
+this.setTransparencyAvailable (!System.getProperty ("java.version").startsWith ("1.1"));
+}, "jalview.viewmodel.AlignmentViewport");
+Clazz_defineMethod (c$, "amendFeatures", 
+function (sequences, features, newFeatures, ap) {
+var bigPanel =  new awt2swing.Panel ( new java.awt.BorderLayout ());
+var name =  new awt2swing.TextField (16);
+var source =  new awt2swing.TextField (16);
+var description =  new awt2swing.TextArea (3, 35);
+var start =  new awt2swing.TextField (8);
+var end =  new awt2swing.TextField (8);
+var overlaps;
+var deleteButton =  new awt2swing.Button ("Delete");
+this.deleteFeature = false;
+this.colourPanel = Clazz_innerTypeInstance (jalview.appletgui.FeatureRenderer.FeatureColourPanel, this, null);
+this.colourPanel.setSize (110, 15);
+var fr = this;
+var panel =  new awt2swing.Panel ( new java.awt.GridLayout (3, 1));
+this.featureIndex = 0;
+var tmp;
+if (!newFeatures && features.length > 1) {
+panel =  new awt2swing.Panel ( new java.awt.GridLayout (4, 1));
+tmp =  new awt2swing.Panel ();
+tmp.add ( new awt2swing.Label ("Select Feature: "));
+overlaps =  new awt2swing.Choice ();
+for (var i = 0; i < features.length; i++) {
+var item = features[i].getType () + "/" + features[i].getBegin () + "-" + features[i].getEnd ();
+if (features[i].getFeatureGroup () != null) {
+item += " (" + features[i].getFeatureGroup () + ")";
+}overlaps.addItem (item);
+}
+tmp.add (overlaps);
+overlaps.addItemListener (((Clazz_isClassDefined ("jalview.appletgui.FeatureRenderer$1") ? 0 : jalview.appletgui.FeatureRenderer.$FeatureRenderer$1$ ()), Clazz_innerTypeInstance (jalview.appletgui.FeatureRenderer$1, this, Clazz_cloneFinals ("overlaps", overlaps, "name", name, "features", features, "description", description, "source", source, "start", start, "end", end, "sequences", sequences, "ap", ap))));
+panel.add (tmp);
+}tmp =  new awt2swing.Panel ();
+panel.add (tmp);
+tmp.add ( new awt2swing.Label ("Name: ", 4));
+tmp.add (name);
+tmp =  new awt2swing.Panel ();
+panel.add (tmp);
+tmp.add ( new awt2swing.Label ("Group: ", 4));
+tmp.add (source);
+tmp =  new awt2swing.Panel ();
+panel.add (tmp);
+tmp.add ( new awt2swing.Label ("Colour: ", 4));
+tmp.add (this.colourPanel);
+bigPanel.add (panel, "North");
+panel =  new awt2swing.Panel ();
+panel.add ( new awt2swing.Label ("Description: ", 4));
+panel.add ( new awt2swing.ScrollPane ().add (description));
+if (!newFeatures) {
+bigPanel.add (panel, "South");
+panel =  new awt2swing.Panel ();
+panel.add ( new awt2swing.Label (" Start:", 4));
+panel.add (start);
+panel.add ( new awt2swing.Label ("  End:", 4));
+panel.add (end);
+bigPanel.add (panel, "Center");
+} else {
+bigPanel.add (panel, "Center");
+}if (jalview.appletgui.FeatureRenderer.lastFeatureAdded == null) {
+if (features[0].type != null) {
+jalview.appletgui.FeatureRenderer.lastFeatureAdded = features[0].type;
+} else {
+jalview.appletgui.FeatureRenderer.lastFeatureAdded = "feature_1";
+}}if (jalview.appletgui.FeatureRenderer.lastFeatureGroupAdded == null) {
+if (features[0].featureGroup != null) {
+jalview.appletgui.FeatureRenderer.lastFeatureGroupAdded = features[0].featureGroup;
+} else {
+jalview.appletgui.FeatureRenderer.lastFeatureAdded = "Jalview";
+}}var title = newFeatures ? jalview.util.MessageManager.getString ("label.create_new_sequence_features") : jalview.util.MessageManager.formatMessage ("label.amend_delete_features",  Clazz_newArray (-1, [sequences[0].getName ()]));
+var dialog =  new jalview.appletgui.JVDialog (ap.alignFrame, title, true, 385, 240);
+dialog.setMainPanel (bigPanel);
+if (newFeatures) {
+name.setText (jalview.appletgui.FeatureRenderer.lastFeatureAdded);
+source.setText (jalview.appletgui.FeatureRenderer.lastFeatureGroupAdded);
+} else {
+dialog.ok.setLabel (jalview.util.MessageManager.getString ("label.amend"));
+dialog.buttonPanel.add (deleteButton, 1);
+deleteButton.addActionListener (((Clazz_isClassDefined ("jalview.appletgui.FeatureRenderer$2") ? 0 : jalview.appletgui.FeatureRenderer.$FeatureRenderer$2$ ()), Clazz_innerTypeInstance (jalview.appletgui.FeatureRenderer$2, this, Clazz_cloneFinals ("dialog", dialog))));
+name.setText (features[0].getType ());
+source.setText (features[0].getFeatureGroup ());
+}start.setText (features[0].getBegin () + "");
+end.setText (features[0].getEnd () + "");
+description.setText (features[0].getDescription ());
+var col = this.getColour (name.getText ());
+if (col == null) {
+col =  new jalview.schemes.UserColourScheme ().createColourFromName (name.getText ());
+}var fcol = this.getFeatureStyle (name.getText ());
+this.colourPanel.updateColor (fcol);
+dialog.setResizable (true);
+this.colourPanel.addMouseListener (((Clazz_isClassDefined ("jalview.appletgui.FeatureRenderer$3") ? 0 : jalview.appletgui.FeatureRenderer.$FeatureRenderer$3$ ()), Clazz_innerTypeInstance (jalview.appletgui.FeatureRenderer$3, this, Clazz_cloneFinals ("fr", fr, "ap", ap, "name", name, "dialog", dialog))));
+dialog.setVisible (true);
+var ffile =  new jalview.io.FeaturesFile ();
+if (dialog.accept) {
+this.lastSeq = null;
+jalview.appletgui.FeatureRenderer.lastFeatureAdded = name.getText ().trim ();
+jalview.appletgui.FeatureRenderer.lastFeatureGroupAdded = source.getText ().trim ();
+jalview.appletgui.FeatureRenderer.lastDescriptionAdded = description.getText ().$replace ('\n', ' ');
+}if (jalview.appletgui.FeatureRenderer.lastFeatureGroupAdded != null && jalview.appletgui.FeatureRenderer.lastFeatureGroupAdded.length < 1) {
+jalview.appletgui.FeatureRenderer.lastFeatureGroupAdded = null;
+}if (!newFeatures) {
+var sf = features[this.featureIndex];
+if (dialog.accept) {
+sf.type = jalview.appletgui.FeatureRenderer.lastFeatureAdded;
+sf.featureGroup = jalview.appletgui.FeatureRenderer.lastFeatureGroupAdded;
+sf.description = jalview.appletgui.FeatureRenderer.lastDescriptionAdded;
+if (!this.colourPanel.isGcol) {
+this.setColour (sf.type, this.colourPanel.getBackground ());
+}try {
+sf.begin = Integer.parseInt (start.getText ());
+sf.end = Integer.parseInt (end.getText ());
+} catch (ex) {
+if (Clazz_exceptionOf (ex, NumberFormatException)) {
+} else {
+throw ex;
+}
+}
+ffile.parseDescriptionHTML (sf, false);
+this.setVisible (jalview.appletgui.FeatureRenderer.lastFeatureAdded);
+}if (this.deleteFeature) {
+sequences[0].deleteFeature (sf);
+}} else {
+if (dialog.accept && name.getText ().length > 0) {
+for (var i = 0; i < sequences.length; i++) {
+features[i].type = jalview.appletgui.FeatureRenderer.lastFeatureAdded;
+features[i].featureGroup = jalview.appletgui.FeatureRenderer.lastFeatureGroupAdded;
+features[i].description = jalview.appletgui.FeatureRenderer.lastDescriptionAdded;
+sequences[i].addSequenceFeature (features[i]);
+ffile.parseDescriptionHTML (features[i], false);
+}
+var newColour = this.colourPanel.getBackground ();
+if (jalview.appletgui.FeatureRenderer.lastFeatureGroupAdded != null) {
+this.setGroupVisibility (jalview.appletgui.FeatureRenderer.lastFeatureGroupAdded, true);
+}this.setColour (jalview.appletgui.FeatureRenderer.lastFeatureAdded, newColour);
+this.setVisible (jalview.appletgui.FeatureRenderer.lastFeatureAdded);
+this.findAllFeatures (false);
+} else {
+return false;
+}}if ((this.av).featureSettings != null) {
+(this.av).featureSettings.refreshTable ();
+}ap.paintAlignment (true);
+return true;
+}, "~A,~A,~B,jalview.appletgui.AlignmentPanel");
+c$.$FeatureRenderer$FeatureColourPanel$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_decorateAsClass (function () {
+Clazz_prepareCallback (this, arguments);
+this.label = "";
+this.maxCol = null;
+this.isColourByLabel = false;
+this.isGcol = false;
+Clazz_instantialize (this, arguments);
+}, jalview.appletgui.FeatureRenderer, "FeatureColourPanel", awt2swing.Panel);
+Clazz_defineMethod (c$, "updateColor", 
+function (a) {
+var b;
+var c = null;
+var d = null;
+var e = "";
+if (Clazz_instanceOf (a, java.awt.Color)) {
+this.isGcol = false;
+c = a;
+d = null;
+} else if (Clazz_instanceOf (a, jalview.schemes.GraduatedColor)) {
+this.isGcol = true;
+d = a;
+c = null;
+} else {
+throw  new Error (jalview.util.MessageManager.getString ("error.invalid_colour_for_mycheckbox"));
+}if (c != null) {
+this.setBackground (b = c);
+} else {
+if (d.getThreshType () != -1) {
+e += " " + ((d.getThreshType () == 1) ? "(>)" : "(<)");
+}if (this.isColourByLabel = d.isColourByLabel ()) {
+this.setBackground (b = java.awt.Color.white);
+e += " (by Label)";
+} else {
+this.setBackground (b = d.getMinColor ());
+this.maxCol = d.getMaxColor ();
+}}this.label = e;
+this.setBackground (b);
+this.repaint ();
+}, "~O");
+Clazz_makeConstructor (c$, 
+function () {
+Clazz_superConstructor (this, jalview.appletgui.FeatureRenderer.FeatureColourPanel, [null]);
+});
+Clazz_defineMethod (c$, "PaintComponent", 
+function (a) {
+var b = this.getSize ();
+if (this.isGcol) {
+if (this.isColourByLabel) {
+a.setColor (java.awt.Color.white);
+a.fillRect (Clazz_doubleToInt (b.width / 2), 0, Clazz_doubleToInt (b.width / 2), b.height);
+a.setColor (java.awt.Color.black);
+var c =  new java.awt.Font ("Verdana", 0, 10);
+a.setFont (c);
+awt2swing.Util.drawString (a, jalview.util.MessageManager.getString ("label.label"), 0, 0);
+} else {
+a.setColor (this.maxCol);
+a.fillRect (Clazz_doubleToInt (b.width / 2), 0, Clazz_doubleToInt (b.width / 2), b.height);
+}}}, "java.awt.Graphics");
+c$ = Clazz_p0p ();
+};
+c$.$FeatureRenderer$1$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_declareAnonymous (jalview.appletgui, "FeatureRenderer$1", null, java.awt.event.ItemListener);
+Clazz_overrideMethod (c$, "itemStateChanged", 
+function (e) {
+var index = this.f$.overlaps.getSelectedIndex ();
+if (index != -1) {
+this.b$["jalview.appletgui.FeatureRenderer"].featureIndex = index;
+this.f$.name.setText (this.f$.features[index].getType ());
+this.f$.description.setText (this.f$.features[index].getDescription ());
+this.f$.source.setText (this.f$.features[index].getFeatureGroup ());
+this.f$.start.setText (this.f$.features[index].getBegin () + "");
+this.f$.end.setText (this.f$.features[index].getEnd () + "");
+var highlight =  new jalview.datamodel.SearchResults ();
+highlight.addResult (this.f$.sequences[0], this.f$.features[index].getBegin (), this.f$.features[index].getEnd ());
+this.f$.ap.seqPanel.seqCanvas.highlightSearchResults (highlight);
+}var col = this.b$["jalview.appletgui.FeatureRenderer"].getFeatureStyle (this.f$.name.getText ());
+if (col == null) {
+col =  new jalview.schemes.UserColourScheme ().createColourFromName (this.f$.name.getText ());
+}this.b$["jalview.appletgui.FeatureRenderer"].colourPanel.updateColor (col);
+}, "java.awt.event.ItemEvent");
+c$ = Clazz_p0p ();
+};
+c$.$FeatureRenderer$2$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_declareAnonymous (jalview.appletgui, "FeatureRenderer$2", null, java.awt.event.ActionListener);
+Clazz_overrideMethod (c$, "actionPerformed", 
+function (evt) {
+this.b$["jalview.appletgui.FeatureRenderer"].deleteFeature = true;
+this.f$.dialog.setVisible (false);
+}, "java.awt.event.ActionEvent");
+c$ = Clazz_p0p ();
+};
+c$.$FeatureRenderer$3$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_declareAnonymous (jalview.appletgui, "FeatureRenderer$3", java.awt.event.MouseAdapter);
+Clazz_overrideMethod (c$, "mousePressed", 
+function (evt) {
+if (!this.b$["jalview.appletgui.FeatureRenderer"].colourPanel.isGcol) {
+ new jalview.appletgui.UserDefinedColours (this.f$.fr, this.f$.ap.alignFrame);
+} else {
+var fcc =  new jalview.appletgui.FeatureColourChooser (this.f$.ap.alignFrame, this.f$.name.getText ());
+this.f$.dialog.transferFocus ();
+}}, "java.awt.event.MouseEvent");
+c$ = Clazz_p0p ();
+};
+Clazz_defineStatics (c$,
+"lastFeatureAdded", null,
+"lastFeatureGroupAdded", null,
+"lastDescriptionAdded", null);
+});
+Clazz_declarePackage ("jalview.renderer.seqfeatures");
+Clazz_load (["jalview.viewmodel.seqfeatures.FeatureRendererModel"], "jalview.renderer.seqfeatures.FeatureRenderer", ["awt2swing.Util", "jalview.util.Comparison", "java.awt.AlphaComposite", "$.Color", "java.awt.image.BufferedImage", "java.lang.Float"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.fm = null;
+this.charOffset = 0;
+this.offscreenRender = false;
+this.lastSeq = null;
+this.s = '\0';
+this.i = 0;
+this.av_charHeight = 0;
+this.av_charWidth = 0;
+this.av_validCharWidth = false;
+this.av_isShowSeqFeatureHeight = false;
+this.offscreenImage = null;
+this.lastSequenceFeatures = null;
+this.sfSize = 0;
+this.sfindex = 0;
+this.spos = 0;
+this.epos = 0;
+this.transparencyAvailable = true;
+Clazz_instantialize (this, arguments);
+}, jalview.renderer.seqfeatures, "FeatureRenderer", jalview.viewmodel.seqfeatures.FeatureRendererModel);
+Clazz_defineMethod (c$, "updateAvConfig", 
+function () {
+this.av_charHeight = this.av.getCharHeight ();
+this.av_charWidth = this.av.getCharWidth ();
+this.av_validCharWidth = this.av.isValidCharWidth ();
+this.av_isShowSeqFeatureHeight = this.av.isShowSequenceFeaturesHeight ();
+});
+Clazz_defineMethod (c$, "renderFeature", 
+function (g, seq, fstart, fend, featureColour, start, end, y1) {
+this.updateAvConfig ();
+if (((fstart <= end) && (fend >= start))) {
+if (fstart < start) {
+fstart = start;
+}if (fend >= end) {
+fend = end;
+}var pady = (y1 + this.av_charHeight) - Clazz_doubleToInt (this.av_charHeight / 5);
+for (this.i = fstart; this.i <= fend; this.i++) {
+this.s = seq.getCharAt (this.i);
+if (jalview.util.Comparison.isGap (this.s)) {
+continue;
+}g.setColor (featureColour);
+g.fillRect ((this.i - start) * this.av_charWidth, y1, this.av_charWidth, this.av_charHeight);
+if (this.offscreenRender || !this.av_validCharWidth) {
+continue;
+}g.setColor (java.awt.Color.white);
+this.charOffset = Clazz_doubleToInt ((this.av_charWidth - this.fm.charWidth (this.s)) / 2);
+awt2swing.Util.drawString (g, String.valueOf (this.s), this.charOffset + (this.av_charWidth * (this.i - start)), pady);
+}
+}}, "java.awt.Graphics,jalview.datamodel.SequenceI,~N,~N,java.awt.Color,~N,~N,~N");
+Clazz_defineMethod (c$, "renderScoreFeature", 
+function (g, seq, fstart, fend, featureColour, start, end, y1, bs) {
+this.updateAvConfig ();
+if (((fstart <= end) && (fend >= start))) {
+if (fstart < start) {
+fstart = start;
+}if (fend >= end) {
+fend = end;
+}var pady = (y1 + this.av_charHeight) - Clazz_doubleToInt (this.av_charHeight / 5);
+var ystrt = 0;
+var yend = this.av_charHeight;
+if (bs[0] != 0) {
+if (bs[1] < 128) {
+yend = Clazz_doubleToInt (this.av_charHeight * (128 - bs[1]) / 512);
+ystrt = this.av_charHeight - Clazz_doubleToInt (yend / 2);
+} else {
+ystrt = Clazz_doubleToInt (this.av_charHeight / 2);
+yend = Clazz_doubleToInt (this.av_charHeight * (bs[1] - 128) / 512);
+}} else {
+yend = Clazz_doubleToInt (this.av_charHeight * bs[1] / 255);
+ystrt = this.av_charHeight - yend;
+}for (this.i = fstart; this.i <= fend; this.i++) {
+this.s = seq.getCharAt (this.i);
+if (jalview.util.Comparison.isGap (this.s)) {
+continue;
+}g.setColor (featureColour);
+var x = (this.i - start) * this.av_charWidth;
+g.drawRect (x, y1, this.av_charWidth, this.av_charHeight);
+g.fillRect (x, y1 + ystrt, this.av_charWidth, yend);
+if (this.offscreenRender || !this.av_validCharWidth) {
+continue;
+}g.setColor (java.awt.Color.black);
+this.charOffset = Clazz_doubleToInt ((this.av_charWidth - this.fm.charWidth (this.s)) / 2);
+awt2swing.Util.drawString (g, String.valueOf (this.s), this.charOffset + (this.av_charWidth * (this.i - start)), pady);
+}
+}}, "java.awt.Graphics,jalview.datamodel.SequenceI,~N,~N,java.awt.Color,~N,~N,~N,~A");
+Clazz_defineMethod (c$, "findFeatureColour", 
+function (initialCol, seq, res) {
+return  new java.awt.Color (this.findFeatureColour (initialCol.getRGB (), seq, res));
+}, "java.awt.Color,jalview.datamodel.SequenceI,~N");
+Clazz_defineMethod (c$, "findFeatureColour", 
+function (initialCol, seq, column) {
+if (!this.av.isShowSequenceFeatures ()) {
+return initialCol;
+}var sequenceFeatures = seq.getSequenceFeatures ();
+if (seq !== this.lastSeq) {
+this.lastSeq = seq;
+this.lastSequenceFeatures = sequenceFeatures;
+if (this.lastSequenceFeatures != null) {
+this.sfSize = this.lastSequenceFeatures.length;
+}} else {
+if (this.lastSequenceFeatures !== sequenceFeatures) {
+this.lastSequenceFeatures = sequenceFeatures;
+if (this.lastSequenceFeatures != null) {
+this.sfSize = this.lastSequenceFeatures.length;
+}}}if (this.lastSequenceFeatures == null || this.sfSize == 0) {
+return initialCol;
+}if (jalview.util.Comparison.isGap (this.lastSeq.getCharAt (column))) {
+return java.awt.Color.white.getRGB ();
+}if (this.transparency != 1.0 && this.offscreenImage == null) {
+this.offscreenImage =  new java.awt.image.BufferedImage (1, 1, 2);
+}this.currentColour = null;
+this.offscreenRender = true;
+if (this.offscreenImage != null) {
+this.offscreenImage.setRGB (0, 0, initialCol);
+this.drawSequence (this.offscreenImage.getGraphics (), this.lastSeq, column, column, 0);
+return this.offscreenImage.getRGB (0, 0);
+} else {
+this.drawSequence (null, this.lastSeq, this.lastSeq.findPosition (column), -1, -1);
+if (this.currentColour == null) {
+return initialCol;
+} else {
+return (this.currentColour).intValue ();
+}}}, "~N,jalview.datamodel.SequenceI,~N");
+Clazz_defineMethod (c$, "drawSequence", 
+function (g, seq, start, end, y1) {
+var sequenceFeatures = seq.getSequenceFeatures ();
+if (sequenceFeatures == null || sequenceFeatures.length == 0) {
+return;
+}if (g != null) {
+this.fm = g.getFontMetrics ();
+}this.updateFeatures ();
+if (this.lastSeq == null || seq !== this.lastSeq || sequenceFeatures !== this.lastSequenceFeatures) {
+this.lastSeq = seq;
+this.lastSequenceFeatures = sequenceFeatures;
+}if (this.transparency != 1 && g != null) {
+var g2 = g;
+g2.setComposite (java.awt.AlphaComposite.getInstance (3, this.transparency));
+}if (!this.offscreenRender) {
+this.spos = this.lastSeq.findPosition (start);
+this.epos = this.lastSeq.findPosition (end);
+}this.sfSize = this.lastSequenceFeatures.length;
+var type;
+for (var renderIndex = 0; renderIndex < this.renderOrder.length; renderIndex++) {
+type = this.renderOrder[renderIndex];
+if (type == null || !this.showFeatureOfType (type)) {
+continue;
+}for (this.sfindex = 0; this.sfindex < this.sfSize; this.sfindex++) {
+var sequenceFeature = this.lastSequenceFeatures[this.sfindex];
+if (!sequenceFeature.type.equals (type)) {
+continue;
+}if (this.featureGroups != null && sequenceFeature.featureGroup != null && sequenceFeature.featureGroup.length != 0 && this.featureGroups.containsKey (sequenceFeature.featureGroup) && !this.featureGroups.get (sequenceFeature.featureGroup).booleanValue ()) {
+continue;
+}if (!this.offscreenRender && (sequenceFeature.getBegin () > this.epos || sequenceFeature.getEnd () < this.spos)) {
+continue;
+}if (this.offscreenRender && this.offscreenImage == null) {
+if (sequenceFeature.begin <= start && sequenceFeature.end >= start) {
+this.currentColour =  new Integer (this.getColour (sequenceFeature).getRGB ());
+}} else if (sequenceFeature.type.equals ("disulfide bond")) {
+this.renderFeature (g, seq, seq.findIndex (sequenceFeature.begin) - 1, seq.findIndex (sequenceFeature.begin) - 1, this.getColour (sequenceFeature), start, end, y1);
+this.renderFeature (g, seq, seq.findIndex (sequenceFeature.end) - 1, seq.findIndex (sequenceFeature.end) - 1, this.getColour (sequenceFeature), start, end, y1);
+} else if (this.showFeature (sequenceFeature)) {
+if (this.av_isShowSeqFeatureHeight && !Float.isNaN (sequenceFeature.score)) {
+this.renderScoreFeature (g, seq, seq.findIndex (sequenceFeature.begin) - 1, seq.findIndex (sequenceFeature.end) - 1, this.getColour (sequenceFeature), start, end, y1, this.normaliseScore (sequenceFeature));
+} else {
+this.renderFeature (g, seq, seq.findIndex (sequenceFeature.begin) - 1, seq.findIndex (sequenceFeature.end) - 1, this.getColour (sequenceFeature), start, end, y1);
+}}}
+}
+if (this.transparency != 1.0 && g != null && this.transparencyAvailable) {
+var g2 = g;
+g2.setComposite (java.awt.AlphaComposite.getInstance (3, 1.0));
+}}, "java.awt.Graphics,jalview.datamodel.SequenceI,~N,~N,~N");
+Clazz_defineMethod (c$, "setTransparencyAvailable", 
+function (isTransparencyAvailable) {
+this.transparencyAvailable = isTransparencyAvailable;
+}, "~B");
+Clazz_overrideMethod (c$, "isTransparencyAvailable", 
+function () {
+return this.transparencyAvailable;
+});
+Clazz_overrideMethod (c$, "featuresAdded", 
+function () {
+this.lastSeq = null;
+this.findAllFeatures ();
+});
+});
+Clazz_declarePackage ("jalview.viewmodel.seqfeatures");
+Clazz_load (["jalview.api.FeatureRenderer", "java.beans.PropertyChangeSupport", "java.lang.Boolean", "java.util.Hashtable", "java.util.concurrent.ConcurrentHashMap"], "jalview.viewmodel.seqfeatures.FeatureRendererModel", ["jalview.schemes.GraduatedColor", "$.UserColourScheme", "jalview.util.QuickSort", "jalview.viewmodel.seqfeatures.FeatureRendererSettings", "$.FeaturesDisplayed", "java.awt.Color", "java.lang.Error", "$.Float", "java.util.ArrayList", "$.Arrays"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.transparency = 1.0;
+this.featureColours = null;
+this.featureGroups = null;
+this.currentColour = null;
+this.renderOrder = null;
+this.changeSupport = null;
+this.av = null;
+this.minmax = null;
+this.newFeatureAdded = false;
+this.findingFeatures = false;
+this.firing = null;
+this.featureOrder = null;
+Clazz_instantialize (this, arguments);
+}, jalview.viewmodel.seqfeatures, "FeatureRendererModel", null, jalview.api.FeatureRenderer);
+Clazz_prepareFields (c$, function () {
+this.featureColours =  new java.util.concurrent.ConcurrentHashMap ();
+this.featureGroups =  new java.util.concurrent.ConcurrentHashMap ();
+this.changeSupport =  new java.beans.PropertyChangeSupport (this);
+this.minmax =  new java.util.Hashtable ();
+this.firing = Boolean.FALSE;
+});
+Clazz_overrideMethod (c$, "getViewport", 
+function () {
+return this.av;
+});
+Clazz_defineMethod (c$, "getSettings", 
+function () {
+return  new jalview.viewmodel.seqfeatures.FeatureRendererSettings (this);
+});
+Clazz_defineMethod (c$, "transferSettings", 
+function (fr) {
+this.renderOrder = fr.renderOrder;
+this.featureGroups = fr.featureGroups;
+this.featureColours = fr.featureColours;
+this.transparency = fr.transparency;
+this.featureOrder = fr.featureOrder;
+}, "jalview.viewmodel.seqfeatures.FeatureRendererSettings");
+Clazz_defineMethod (c$, "transferSettings", 
+function (_fr) {
+var fr = _fr;
+var frs =  new jalview.viewmodel.seqfeatures.FeatureRendererSettings (fr);
+this.renderOrder = frs.renderOrder;
+this.featureGroups = frs.featureGroups;
+this.featureColours = frs.featureColours;
+this.transparency = frs.transparency;
+this.featureOrder = frs.featureOrder;
+if (this.av != null && this.av !== fr.getViewport ()) {
+if (_fr.getFeaturesDisplayed () != null) {
+var fd = this.getFeaturesDisplayed ();
+if (fd == null) {
+this.setFeaturesDisplayedFrom (_fr.getFeaturesDisplayed ());
+} else {
+{
+fd.clear ();
+var fdisp = _fr.getFeaturesDisplayed ().getVisibleFeatures ();
+while (fdisp.hasNext ()) {
+fd.setVisible (fdisp.next ());
+}
+}}}}}, "jalview.api.FeatureRenderer");
+Clazz_defineMethod (c$, "setFeaturesDisplayedFrom", 
+function (featuresDisplayed) {
+this.av.setFeaturesDisplayed ( new jalview.viewmodel.seqfeatures.FeaturesDisplayed (featuresDisplayed));
+}, "jalview.api.FeaturesDisplayedI");
+Clazz_overrideMethod (c$, "setVisible", 
+function (featureType) {
+var fdi = this.av.getFeaturesDisplayed ();
+if (fdi == null) {
+this.av.setFeaturesDisplayed (fdi =  new jalview.viewmodel.seqfeatures.FeaturesDisplayed ());
+}if (!fdi.isRegistered (featureType)) {
+this.pushFeatureType (java.util.Arrays.asList ( Clazz_newArray (-1, [featureType])));
+}fdi.setVisible (featureType);
+}, "~S");
+Clazz_overrideMethod (c$, "setAllVisible", 
+function (featureTypes) {
+var fdi = this.av.getFeaturesDisplayed ();
+if (fdi == null) {
+this.av.setFeaturesDisplayed (fdi =  new jalview.viewmodel.seqfeatures.FeaturesDisplayed ());
+}var nft =  new java.util.ArrayList ();
+for (var featureType, $featureType = featureTypes.iterator (); $featureType.hasNext () && ((featureType = $featureType.next ()) || true);) {
+if (!fdi.isRegistered (featureType)) {
+nft.add (featureType);
+}}
+if (nft.size () > 0) {
+this.pushFeatureType (nft);
+}fdi.setAllVisible (featureTypes);
+}, "java.util.List");
+Clazz_defineMethod (c$, "pushFeatureType", 
+ function (types) {
+var ts = types.size ();
+var neworder =  new Array ((this.renderOrder == null ? 0 : this.renderOrder.length) + ts);
+types.toArray (neworder);
+if (this.renderOrder != null) {
+System.arraycopy (neworder, 0, neworder, this.renderOrder.length, ts);
+System.arraycopy (this.renderOrder, 0, neworder, 0, this.renderOrder.length);
+}this.renderOrder = neworder;
+}, "java.util.List");
+Clazz_defineMethod (c$, "getMinMax", 
+function () {
+return this.minmax;
+});
+Clazz_defineMethod (c$, "normaliseScore", 
+function (sequenceFeature) {
+var mm = (this.minmax.get (sequenceFeature.type))[0];
+var r =  Clazz_newByteArray (-1, [0, 255]);
+if (mm != null) {
+if (r[0] != 0 || mm[0] < 0.0) {
+r[0] = 1;
+r[1] = Clazz_doubleToByte (Clazz_doubleToInt (128.0) + 127.0 * (sequenceFeature.score / mm[1]));
+} else {
+r[1] = Clazz_floatToByte (Clazz_doubleToInt (255.0) * (sequenceFeature.score / mm[1]));
+}}return r;
+}, "jalview.datamodel.SequenceFeature");
+Clazz_defineMethod (c$, "updateFeatures", 
+function () {
+if (this.av.getFeaturesDisplayed () == null || this.renderOrder == null || this.newFeatureAdded) {
+this.findAllFeatures ();
+if (this.av.getFeaturesDisplayed ().getVisibleFeatureCount () < 1) {
+return false;
+}}return true;
+});
+Clazz_defineMethod (c$, "findAllFeatures", 
+function () {
+{
+if (this.firing.equals (Boolean.FALSE)) {
+this.firing = Boolean.TRUE;
+this.findAllFeatures (true);
+this.changeSupport.firePropertyChange ("changeSupport", null, null);
+this.firing = Boolean.FALSE;
+}}});
+Clazz_overrideMethod (c$, "findFeaturesAtRes", 
+function (sequence, res) {
+var tmp =  new java.util.ArrayList ();
+var features = sequence.getSequenceFeatures ();
+if (features != null) {
+for (var i = 0; i < features.length; i++) {
+if (!this.av.areFeaturesDisplayed () || !this.av.getFeaturesDisplayed ().isVisible (features[i].getType ())) {
+continue;
+}if (features[i].featureGroup != null && this.featureGroups != null && this.featureGroups.containsKey (features[i].featureGroup) && !this.featureGroups.get (features[i].featureGroup).booleanValue ()) {
+continue;
+}if ((features[i].getBegin () <= res) && (features[i].getEnd () >= res)) {
+tmp.add (features[i]);
+}}
+}return tmp;
+}, "jalview.datamodel.SequenceI,~N");
+Clazz_defineMethod (c$, "findAllFeatures", 
+function (newMadeVisible) {
+this.newFeatureAdded = false;
+if (this.findingFeatures) {
+this.newFeatureAdded = true;
+return;
+}this.findingFeatures = true;
+if (this.av.getFeaturesDisplayed () == null) {
+this.av.setFeaturesDisplayed ( new jalview.viewmodel.seqfeatures.FeaturesDisplayed ());
+}var featuresDisplayed = this.av.getFeaturesDisplayed ();
+var allfeatures =  new java.util.ArrayList ();
+var oldfeatures =  new java.util.ArrayList ();
+if (this.renderOrder != null) {
+for (var i = 0; i < this.renderOrder.length; i++) {
+if (this.renderOrder[i] != null) {
+oldfeatures.add (this.renderOrder[i]);
+}}
+}if (this.minmax == null) {
+this.minmax =  new java.util.Hashtable ();
+}var alignment = this.av.getAlignment ();
+for (var i = 0; i < alignment.getHeight (); i++) {
+var asq = alignment.getSequenceAt (i);
+var features = asq.getSequenceFeatures ();
+if (features == null) {
+continue;
+}var index = 0;
+while (index < features.length) {
+if (!featuresDisplayed.isRegistered (features[index].getType ())) {
+var fgrp = features[index].getFeatureGroup ();
+if (fgrp != null) {
+var groupDisplayed = this.featureGroups.get (fgrp);
+if (groupDisplayed == null) {
+groupDisplayed = Boolean.$valueOf (newMadeVisible);
+this.featureGroups.put (fgrp, groupDisplayed);
+}if (!groupDisplayed.booleanValue ()) {
+index++;
+continue;
+}}if (!(features[index].begin == 0 && features[index].end == 0)) {
+if (newMadeVisible && !oldfeatures.contains (features[index].getType ())) {
+featuresDisplayed.setVisible (features[index].getType ());
+this.setOrder (features[index].getType (), 0);
+}}}if (!allfeatures.contains (features[index].getType ())) {
+allfeatures.add (features[index].getType ());
+}if (!Float.isNaN (features[index].score)) {
+var nonpos = features[index].getBegin () >= 1 ? 0 : 1;
+var mm = this.minmax.get (features[index].getType ());
+if (mm == null) {
+mm =  Clazz_newArray (-1, [null, null]);
+this.minmax.put (features[index].getType (), mm);
+}if (mm[nonpos] == null) {
+mm[nonpos] =  Clazz_newFloatArray (-1, [features[index].score, features[index].score]);
+} else {
+if (mm[nonpos][0] > features[index].score) {
+mm[nonpos][0] = features[index].score;
+}if (mm[nonpos][1] < features[index].score) {
+mm[nonpos][1] = features[index].score;
+}}}index++;
+}
+}
+this.updateRenderOrder (allfeatures);
+this.findingFeatures = false;
+}, "~B");
+Clazz_defineMethod (c$, "updateRenderOrder", 
+ function (allFeatures) {
+var allfeatures =  new java.util.ArrayList (allFeatures);
+var oldRender = this.renderOrder;
+this.renderOrder =  new Array (allfeatures.size ());
+var mmrange;
+var fc = null;
+var initOrders = (this.featureOrder == null);
+var opos = 0;
+if (oldRender != null && oldRender.length > 0) {
+for (var j = 0; j < oldRender.length; j++) {
+if (oldRender[j] != null) {
+if (initOrders) {
+this.setOrder (oldRender[j], (1 - (1 + j) / oldRender.length));
+}if (allfeatures.contains (oldRender[j])) {
+this.renderOrder[opos++] = oldRender[j];
+allfeatures.remove (oldRender[j]);
+if (this.minmax != null) {
+mmrange = this.minmax.get (oldRender[j]);
+if (mmrange != null) {
+fc = this.featureColours.get (oldRender[j]);
+if (fc != null && Clazz_instanceOf (fc, jalview.schemes.GraduatedColor) && (fc).isAutoScale ()) {
+(fc).updateBounds ((mmrange)[0][0], (mmrange)[0][1]);
+}}}}}}
+}if (allfeatures.size () == 0) {
+return;
+}var i = allfeatures.size () - 1;
+var iSize = i;
+var sort = false;
+var newf =  new Array (allfeatures.size ());
+var sortOrder =  Clazz_newFloatArray (allfeatures.size (), 0);
+for (var newfeat, $newfeat = allfeatures.iterator (); $newfeat.hasNext () && ((newfeat = $newfeat.next ()) || true);) {
+newf[i] = newfeat;
+if (this.minmax != null) {
+mmrange = this.minmax.get (newf[i]);
+if (mmrange != null) {
+fc = this.featureColours.get (newf[i]);
+if (fc != null && Clazz_instanceOf (fc, jalview.schemes.GraduatedColor) && (fc).isAutoScale ()) {
+(fc).updateBounds ((mmrange)[0][0], (mmrange)[0][1]);
+}}}if (initOrders || !this.featureOrder.containsKey (newf[i])) {
+var denom = initOrders ? allfeatures.size () : this.featureOrder.size ();
+this.setOrder (newf[i], i / denom);
+}sortOrder[i] = 2 - (this.featureOrder.get (newf[i])).floatValue ();
+if (i < iSize) {
+sort = sort || sortOrder[i] > sortOrder[i + 1];
+}i--;
+}
+if (iSize > 1 && sort) {
+jalview.util.QuickSort.sortFloatObject (sortOrder, newf);
+}sortOrder = null;
+System.arraycopy (newf, 0, this.renderOrder, opos, newf.length);
+}, "java.util.List");
+Clazz_overrideMethod (c$, "getFeatureStyle", 
+function (featureType) {
+var fc = this.featureColours.get (featureType);
+if (fc == null) {
+var ucs =  new jalview.schemes.UserColourScheme ();
+var col = ucs.createColourFromName (featureType);
+this.featureColours.put (featureType, fc = col);
+}return fc;
+}, "~S");
+Clazz_defineMethod (c$, "getColour", 
+function (featureType) {
+var fc = this.getFeatureStyle (featureType);
+if (Clazz_instanceOf (fc, java.awt.Color)) {
+return fc;
+} else {
+if (Clazz_instanceOf (fc, jalview.schemes.GraduatedColor)) {
+return (fc).getMaxColor ();
+}}throw  new Error ("Implementation Error: Unrecognised render object " + fc.getClass () + " for features of type " + featureType);
+}, "~S");
+Clazz_defineMethod (c$, "getColour", 
+function (feature) {
+var fc = this.getFeatureStyle (feature.getType ());
+if (Clazz_instanceOf (fc, java.awt.Color)) {
+return fc;
+} else {
+if (Clazz_instanceOf (fc, jalview.schemes.GraduatedColor)) {
+return (fc).findColor (feature);
+}}throw  new Error ("Implementation Error: Unrecognised render object " + fc.getClass () + " for features of type " + feature.getType ());
+}, "jalview.datamodel.SequenceFeature");
+Clazz_defineMethod (c$, "showFeature", 
+function (sequenceFeature) {
+var fc = this.getFeatureStyle (sequenceFeature.type);
+if (Clazz_instanceOf (fc, jalview.schemes.GraduatedColor)) {
+return (fc).isColored (sequenceFeature);
+} else {
+return true;
+}}, "jalview.datamodel.SequenceFeature");
+Clazz_defineMethod (c$, "showFeatureOfType", 
+function (type) {
+return this.av.getFeaturesDisplayed ().isVisible (type);
+}, "~S");
+Clazz_overrideMethod (c$, "setColour", 
+function (featureType, col) {
+{
+this.featureColours.put (featureType, col);
+}}, "~S,~O");
+Clazz_defineMethod (c$, "setTransparency", 
+function (value) {
+this.transparency = value;
+}, "~N");
+Clazz_defineMethod (c$, "getTransparency", 
+function () {
+return this.transparency;
+});
+Clazz_defineMethod (c$, "setOrder", 
+function (type, position) {
+if (this.featureOrder == null) {
+this.featureOrder =  new java.util.Hashtable ();
+}this.featureOrder.put (type,  new Float (position));
+return position;
+}, "~S,~N");
+Clazz_defineMethod (c$, "getOrder", 
+function (type) {
+if (this.featureOrder != null) {
+if (this.featureOrder.containsKey (type)) {
+return (this.featureOrder.get (type)).floatValue ();
+}}return -1;
+}, "~S");
+Clazz_overrideMethod (c$, "getFeatureColours", 
+function () {
+return  new java.util.concurrent.ConcurrentHashMap (this.featureColours);
+});
+Clazz_defineMethod (c$, "setFeaturePriority", 
+function (data) {
+this.setFeaturePriority (data, true);
+}, "~A");
+Clazz_defineMethod (c$, "setFeaturePriority", 
+function (data, visibleNew) {
+var av_featuresdisplayed = null;
+if (visibleNew) {
+if ((av_featuresdisplayed = this.av.getFeaturesDisplayed ()) != null) {
+this.av.getFeaturesDisplayed ().clear ();
+} else {
+this.av.setFeaturesDisplayed (av_featuresdisplayed =  new jalview.viewmodel.seqfeatures.FeaturesDisplayed ());
+}} else {
+av_featuresdisplayed = this.av.getFeaturesDisplayed ();
+}if (data == null) {
+return;
+}this.renderOrder =  new Array (data.length);
+if (data.length > 0) {
+for (var i = 0; i < data.length; i++) {
+var type = data[i][0].toString ();
+this.setColour (type, data[i][1]);
+if ((data[i][2]).booleanValue ()) {
+av_featuresdisplayed.setVisible (type);
+}this.renderOrder[data.length - i - 1] = type;
+}
+}}, "~A,~B");
+Clazz_defineMethod (c$, "addPropertyChangeListener", 
+function (listener) {
+this.changeSupport.addPropertyChangeListener (listener);
+}, "java.beans.PropertyChangeListener");
+Clazz_defineMethod (c$, "removePropertyChangeListener", 
+function (listener) {
+this.changeSupport.removePropertyChangeListener (listener);
+}, "java.beans.PropertyChangeListener");
+Clazz_defineMethod (c$, "getAllFeatureColours", 
+function () {
+return this.featureColours.keySet ();
+});
+Clazz_defineMethod (c$, "clearRenderOrder", 
+function () {
+this.renderOrder = null;
+});
+Clazz_defineMethod (c$, "hasRenderOrder", 
+function () {
+return this.renderOrder != null;
+});
+Clazz_defineMethod (c$, "getRenderOrder", 
+function () {
+if (this.renderOrder == null) {
+return java.util.Arrays.asList ( Clazz_newArray (-1, []));
+}return java.util.Arrays.asList (this.renderOrder);
+});
+Clazz_defineMethod (c$, "getFeatureGroupsSize", 
+function () {
+return this.featureGroups != null ? 0 : this.featureGroups.size ();
+});
+Clazz_overrideMethod (c$, "getFeatureGroups", 
+function () {
+return (this.featureGroups == null) ? java.util.Arrays.asList ( new Array (0)) : java.util.Arrays.asList (this.featureGroups.keySet ().toArray ( new Array (0)));
+});
+Clazz_defineMethod (c$, "checkGroupVisibility", 
+function (group, newGroupsVisible) {
+if (this.featureGroups == null) {
+}if (this.featureGroups.containsKey (group)) {
+return this.featureGroups.get (group).booleanValue ();
+}if (newGroupsVisible) {
+this.featureGroups.put (group,  new Boolean (true));
+return true;
+}return false;
+}, "~S,~B");
+Clazz_overrideMethod (c$, "getGroups", 
+function (visible) {
+if (this.featureGroups != null) {
+var gp =  new java.util.ArrayList ();
+for (var grp, $grp = this.featureGroups.keySet ().iterator (); $grp.hasNext () && ((grp = $grp.next ()) || true);) {
+var state = this.featureGroups.get (grp);
+if (state.booleanValue () == visible) {
+gp.add (grp);
+}}
+return gp;
+}return null;
+}, "~B");
+Clazz_defineMethod (c$, "setGroupVisibility", 
+function (group, visible) {
+this.featureGroups.put (group,  new Boolean (visible));
+}, "~S,~B");
+Clazz_defineMethod (c$, "setGroupVisibility", 
+function (toset, visible) {
+if (toset != null && toset.size () > 0 && this.featureGroups != null) {
+var rdrw = false;
+for (var gst, $gst = toset.iterator (); $gst.hasNext () && ((gst = $gst.next ()) || true);) {
+var st = this.featureGroups.get (gst);
+this.featureGroups.put (gst,  new Boolean (visible));
+if (st != null) {
+rdrw = rdrw || (visible != st.booleanValue ());
+}}
+if (rdrw) {
+}}}, "java.util.List,~B");
+Clazz_overrideMethod (c$, "getDisplayedFeatureCols", 
+function () {
+var fcols =  new java.util.Hashtable ();
+if (this.getViewport ().getFeaturesDisplayed () == null) {
+return fcols;
+}var en = this.getViewport ().getFeaturesDisplayed ().getVisibleFeatures ();
+while (en.hasNext ()) {
+var col = en.next ();
+fcols.put (col, this.getColour (col));
+}
+return fcols;
+});
+Clazz_defineMethod (c$, "getFeaturesDisplayed", 
+function () {
+return this.av.getFeaturesDisplayed ();
+});
+Clazz_overrideMethod (c$, "getDisplayedFeatureTypes", 
+function () {
+var typ = null;
+typ = this.getRenderOrder ().toArray ( new Array (0));
+var feature_disp = this.av.getFeaturesDisplayed ();
+if (feature_disp != null) {
+{
+for (var i = 0; i < typ.length; i++) {
+if (!feature_disp.isVisible (typ[i])) {
+typ[i] = null;
+}}
+}}return typ;
+});
+Clazz_overrideMethod (c$, "getDisplayedFeatureGroups", 
+function () {
+var gps = null;
+var _gps =  new java.util.ArrayList ();
+var en = this.getFeatureGroups ().iterator ();
+var g = 0;
+var valid = false;
+while (en.hasNext ()) {
+var gp = en.next ();
+if (this.checkGroupVisibility (gp, false)) {
+valid = true;
+_gps.add (gp);
+}if (!valid) {
+return null;
+} else {
+gps =  new Array (_gps.size ());
+_gps.toArray (gps);
+}}
+return gps;
+});
+});
+Clazz_declarePackage ("jalview.api");
+Clazz_declareInterface (jalview.api, "FeatureRenderer");
+// BH concurrent version; copy of java.util.HashMap
+Clazz_declarePackage ("java.util.concurrent");
+Clazz_load(["java.util.AbstractMap","$.AbstractSet","$.Iterator","$.Map","$.MapEntry"],"java.util.concurrent.ConcurrentHashMap",["java.lang.IllegalArgumentException","$.IllegalStateException","java.util.AbstractCollection","$.Arrays","$.ConcurrentModificationException","java.util.MapEntry.Type","java.util.NoSuchElementException"],function(){
+c$=Clazz_decorateAsClass(function(){
+this.elementCount=0;
+this.elementData=null;
+this.loadFactor=0;
+this.threshold=0;
+this.modCount=0;
+Clazz_instantialize(this,arguments);
+},java.util.concurrent,"ConcurrentHashMap",java.util.AbstractMap,[java.util.Map,Cloneable,java.io.Serializable]);
+Clazz_defineMethod(c$,"newElementArray",
+function(s){
+return new Array(s);
+},"~N");
+//Clazz_makeConstructor(c$,
+//function(){
+//this.construct(16);
+//});
+//Clazz_makeConstructor(c$,
+//function(capacity){
+//Clazz_superConstructor(this,java.util.ConcurrentHashMap,[]);
+//if(capacity>=0){
+//this.elementCount=0;
+//this.elementData=this.newElementArray(capacity==0?1:capacity);
+//this.loadFactor=0.75;
+//this.computeMaxSize();
+//}else{
+//throw new IllegalArgumentException();
+//}},"~N");
+Clazz_makeConstructor(c$,
+function(){
+this.construct(16);
+});
+Clazz_makeConstructor(c$,
+function(capacity){
+Clazz_superConstructor(this,java.util.concurrent.ConcurrentHashMap,[]);
+if(capacity>=0){
+this.elementCount=0;
+this.elementData=this.newElementArray(capacity==0?1:capacity);
+this.loadFactor=0.75;
+this.computeMaxSize();
+}else{
+throw new IllegalArgumentException();
+}},"~N");
+Clazz_makeConstructor(c$,
+function(capacity,loadFactor){
+Clazz_superConstructor(this,java.util.concurrent.ConcurrentHashMap,[]);
+if(capacity>=0&&loadFactor>0){
+this.elementCount=0;
+this.elementData=this.newElementArray(capacity==0?1:capacity);
+this.loadFactor=loadFactor;
+this.computeMaxSize();
+}else{
+throw new IllegalArgumentException();
+}},"~N,~N");
+Clazz_makeConstructor(c$,
+function(map){
+this.construct(map.size()<6?11:map.size()*2);
+Clazz_superCall(this,java.util.concurrent.ConcurrentHashMap,"putAll",[map]);
+},"java.util.Map");
+
+
+/*
+Clazz_makeConstructor(c$,
+function(capacity,loadFactor){
+this.doConstruct(capacity,loadFactor);
+},"~N,~N");
+
+Clazz_defineMethod(c$, "doConstruct",
+function(capacity,loadFactor) {
+capacity || (capacity = 16);
+loadFactor || (loadFactor = 0.75);
+if (typeof capacity != "number") {
+ var map = capacity;
+ this.loadFactor=loadFactor;
+ this.elementData=this.newElementArray(map.size()<6?11:map.size()*2);
+ this.computeMaxSize();
+ this.putAllHM(map);
+ return;
+}
+
+//Clazz_superConstructor(this,java.util.ConcurrentHashMap,[]);
+if(capacity>=0&&loadFactor>0){
+this.elementData=this.newElementArray(capacity==0?1:capacity);
+this.loadFactor=loadFactor;
+this.computeMaxSize();
+}else{
+throw new IllegalArgumentException();
+}
+},"~N,~N");
+
+//Clazz_makeConstructor(c$,
+//function(map){
+//this.construct(map.size()<6?11:map.size()*2);
+//Clazz_superCall(this,java.util.ConcurrentHashMap,"putAll",[map]);
+//},"java.util.Map");
+
+*/
+Clazz_overrideMethod(c$,"clear",
+function(){
+if(this.elementCount>0){
+this.elementCount=0;
+java.util.Arrays.fill(this.elementData,null);
+this.modCount++;
+}});
+Clazz_defineMethod(c$,"clone",
+function(){
+  return this.cloneHM();
+});
+
+Clazz_defineMethod(c$,"cloneHM",
+function(){
+try{
+var map=this.cloneAM();//Clazz_superCall(this,java.util.concurrent.ConcurrentHashMap,"clone",[]);
+map.elementData=this.newElementArray(this.elementData.length);
+var entry;
+for(var i=0;i<this.elementData.length;i++){
+if((entry=this.elementData[i])!=null){
+map.elementData[i]=entry.clone();
+}}
+return map;
+}catch(e){
+if(Clazz_instanceOf(e,CloneNotSupportedException)){
+return null;
+}else{
+throw e;
+}
+}
+});
+
+Clazz_defineMethod(c$,"computeMaxSize",
+($fz=function(){
+this.threshold=Math.round((this.elementData.length*this.loadFactor));
+},$fz.isPrivate=true,$fz));
+Clazz_overrideMethod(c$,"containsKey",
+function(key){
+return this.getEntry(key)!=null;
+},"~O");
+Clazz_defineMethod(c$,"keysEqual",
+function(k1,entry){
+var k1Hash=k1==null?0:k1.hashCode();
+if(k1Hash!=entry.origKeyHash){
+return false;
+}if(k1==null&&entry.key==null){
+return true;
+}return k1.equals(entry.key);
+},"~O,java.util.concurrent.ConcurrentHashMap.Entry");
+Clazz_overrideMethod(c$,"containsValue",
+function(value){
+if(value!=null){
+for(var i=this.elementData.length;--i>=0;){
+var entry=this.elementData[i];
+while(entry!=null){
+if(value.equals(entry.value)){
+return true;
+}entry=entry.next;
+}
+}
+}else{
+for(var i=this.elementData.length;--i>=0;){
+var entry=this.elementData[i];
+while(entry!=null){
+if(entry.value==null){
+return true;
+}entry=entry.next;
+}
+}
+}return false;
+},"~O");
+Clazz_overrideMethod(c$,"entrySet",
+function(){
+return new java.util.concurrent.ConcurrentHashMap.ConcurrentHashMapEntrySet(this);
+});
+Clazz_overrideMethod(c$,"get",
+function(key){
+var m=this.getEntry(key);
+if(m!=null){
+return m.value;
+}return null;
+},"~O");
+Clazz_defineMethod(c$,"getEntry",
+function(key){
+var index=this.getModuloHash(key);
+return this.findEntry(key,index);
+},"~O");
+Clazz_defineMethod(c$,"getModuloHash",
+function(key){
+if(key==null){
+return 0;
+}return(key.hashCode()&0x7FFFFFFF)%this.elementData.length;
+},"~O");
+Clazz_defineMethod(c$,"findEntry",
+function(key,index){
+var m;
+m=this.elementData[index];
+if(key!=null){
+while(m!=null&&!this.keysEqual(key,m)){
+m=m.next;
+}
+}else{
+while(m!=null&&m.key!=null){
+m=m.next;
+}
+}return m;
+},"~O,~N");
+Clazz_overrideMethod(c$,"isEmpty",
+function(){
+return this.elementCount==0;
+});
+Clazz_overrideMethod(c$,"keySet",
+function(){
+if(this.$keySet==null){
+this.$keySet=((Clazz_isClassDefined("java.util.concurrent.ConcurrentHashMap$1")?0:java.util.concurrent.ConcurrentHashMap.$ConcurrentHashMap$1$()),Clazz_innerTypeInstance(java.util.concurrent.ConcurrentHashMap$1,this,null));
+}return this.$keySet;
+});
+Clazz_overrideMethod(c$,"put",
+function(key,value){
+var index=this.getModuloHash(key);
+var entry=this.findEntry(key,index);
+if(entry==null){
+this.modCount++;
+if(++this.elementCount>this.threshold){
+this.rehash();
+index=key==null?0:(key.hashCode()&0x7FFFFFFF)%this.elementData.length;
+}entry=this.createEntry(key,index,value);
+return null;
+}var result=entry.value;
+entry.value=value;
+return result;
+},"~O,~O");
+Clazz_defineMethod(c$,"createEntry",
+function(key,index,value){
+var entry=new java.util.concurrent.ConcurrentHashMap.Entry(key,value);
+entry.next=this.elementData[index];
+this.elementData[index]=entry;
+return entry;
+},"~O,~N,~O");
+Clazz_defineMethod(c$,"putAll",
+function(map){
+if(!map.isEmpty()){
+var capacity=this.elementCount+map.size();
+if(capacity>this.threshold){
+this.rehash(capacity);
+}
+this.putAllHM(map);
+
+}},"java.util.Map");
+Clazz_defineMethod(c$,"rehash",
+function(capacity){
+var length=(capacity==0?1:capacity<<1);
+var newData=this.newElementArray(length);
+for(var i=0;i<this.elementData.length;i++){
+var entry=this.elementData[i];
+while(entry!=null){
+var key=entry.key;
+var index=key==null?0:(key.hashCode()&0x7FFFFFFF)%length;
+var next=entry.next;
+entry.next=newData[index];
+newData[index]=entry;
+entry=next;
+}
+}
+this.elementData=newData;
+this.computeMaxSize();
+},"~N");
+Clazz_defineMethod(c$,"rehash",
+function(){
+this.rehash(this.elementData.length);
+});
+Clazz_overrideMethod(c$,"remove",
+function(key){
+var entry=this.removeEntry(key);
+if(entry!=null){
+return entry.value;
+}return null;
+},"~O");
+Clazz_defineMethod(c$,"removeEntry",
+function(key){
+var index=0;
+var entry;
+var last=null;
+if(key!=null){
+index=(key.hashCode()&0x7FFFFFFF)%this.elementData.length;
+entry=this.elementData[index];
+while(entry!=null&&!this.keysEqual(key,entry)){
+last=entry;
+entry=entry.next;
+}
+}else{
+entry=this.elementData[0];
+while(entry!=null&&entry.key!=null){
+last=entry;
+entry=entry.next;
+}
+}if(entry==null){
+return null;
+}if(last==null){
+this.elementData[index]=entry.next;
+}else{
+last.next=entry.next;
+}this.modCount++;
+this.elementCount--;
+return entry;
+},"~O");
+Clazz_overrideMethod(c$,"size",
+function(){
+return this.elementCount;
+});
+Clazz_overrideMethod(c$,"values",
+function(){
+if(this.valuesCollection==null){
+this.valuesCollection=((Clazz_isClassDefined("java.util.concurrent.ConcurrentHashMap$2")?0:java.util.concurrent.ConcurrentHashMap.$ConcurrentHashMap$2$()),Clazz_innerTypeInstance(java.util.concurrent.ConcurrentHashMap$2,this,null));
+}return this.valuesCollection;
+});
+c$.$ConcurrentHashMap$1$=function(){
+Clazz_pu$h(self.c$);
+c$=Clazz_declareAnonymous(java.util.concurrent,"ConcurrentHashMap$1",java.util.AbstractSet);
+Clazz_overrideMethod(c$,"contains",
+function(object){
+return this.b$["java.util.concurrent.ConcurrentHashMap"].containsKey(object);
+},"~O");
+Clazz_overrideMethod(c$,"size",
+function(){
+return this.b$["java.util.concurrent.ConcurrentHashMap"].size();
+});
+Clazz_overrideMethod(c$,"clear",
+function(){
+this.b$["java.util.concurrent.ConcurrentHashMap"].clear();
+});
+Clazz_overrideMethod(c$,"remove",
+function(key){
+if(this.b$["java.util.concurrent.ConcurrentHashMap"].containsKey(key)){
+this.b$["java.util.concurrent.ConcurrentHashMap"].remove(key);
+return true;
+}return false;
+},"~O");
+Clazz_overrideMethod(c$,"iterator",
+function(){
+return new java.util.concurrent.ConcurrentHashMap.ConcurrentHashMapIterator(((Clazz_isClassDefined("java.util.concurrent.ConcurrentHashMap$1$1")?0:java.util.concurrent.ConcurrentHashMap.$ConcurrentHashMap$1$1$()),Clazz_innerTypeInstance(java.util.concurrent.ConcurrentHashMap$1$1,this,null)),this.b$["java.util.concurrent.ConcurrentHashMap"]);
+});
+c$=Clazz_p0p();
+};
+c$.$ConcurrentHashMap$1$1$=function(){
+Clazz_pu$h(self.c$);
+c$=Clazz_declareAnonymous(java.util.concurrent,"ConcurrentHashMap$1$1",null,java.util.MapEntry.Type);
+Clazz_overrideMethod(c$,"get",
+function(entry){
+return entry.key;
+},"java.util.MapEntry");
+c$=Clazz_p0p();
+};
+c$.$ConcurrentHashMap$2$=function(){
+Clazz_pu$h(self.c$);
+c$=Clazz_declareAnonymous(java.util.concurrent,"ConcurrentHashMap$2",java.util.AbstractCollection);
+Clazz_overrideMethod(c$,"contains",
+function(object){
+return this.b$["java.util.concurrent.ConcurrentHashMap"].containsValue(object);
+},"~O");
+Clazz_overrideMethod(c$,"size",
+function(){
+return this.b$["java.util.concurrent.ConcurrentHashMap"].size();
+});
+Clazz_overrideMethod(c$,"clear",
+function(){
+this.b$["java.util.concurrent.ConcurrentHashMap"].clear();
+});
+Clazz_overrideMethod(c$,"iterator",
+function(){
+return new java.util.concurrent.ConcurrentHashMap.ConcurrentHashMapIterator(((Clazz_isClassDefined("java.util.concurrent.ConcurrentHashMap$2$1")?0:java.util.concurrent.ConcurrentHashMap.$ConcurrentHashMap$2$1$()),Clazz_innerTypeInstance(java.util.concurrent.ConcurrentHashMap$2$1,this,null)),this.b$["java.util.concurrent.ConcurrentHashMap"]);
+});
+c$=Clazz_p0p();
+};
+c$.$ConcurrentHashMap$2$1$=function(){
+Clazz_pu$h(self.c$);
+c$=Clazz_declareAnonymous(java.util.concurrent,"ConcurrentHashMap$2$1",null,java.util.MapEntry.Type);
+Clazz_overrideMethod(c$,"get",
+function(entry){
+return entry.value;
+},"java.util.MapEntry");
+c$=Clazz_p0p();
+};
+Clazz_pu$h(self.c$);
+c$=Clazz_decorateAsClass(function(){
+this.origKeyHash=0;
+this.next=null;
+Clazz_instantialize(this,arguments);
+},java.util.concurrent.ConcurrentHashMap,"Entry",java.util.MapEntry);
+Clazz_makeConstructor(c$,
+function(a,b){
+Clazz_superConstructor(this,java.util.concurrent.ConcurrentHashMap.Entry,[a,b]);
+this.origKeyHash=(a==null?0:a.hashCode());
+},"~O,~O");
+Clazz_defineMethod(c$,"clone",
+function(){
+var a=Clazz_superCall(this,java.util.concurrent.ConcurrentHashMap.Entry,"clone",[]);
+if(this.next!=null){
+a.next=this.next.clone();
+}return a;
+});
+c$=Clazz_p0p();
+Clazz_pu$h(self.c$);
+c$=Clazz_decorateAsClass(function(){
+this.position=0;
+this.expectedModCount=0;
+this.type=null;
+this.canRemove=false;
+this.entry=null;
+this.lastEntry=null;
+this.associatedMap=null;
+Clazz_instantialize(this,arguments);
+},java.util.concurrent.ConcurrentHashMap,"ConcurrentHashMapIterator",null,java.util.Iterator);
+Clazz_makeConstructor(c$,
+function(a,b){
+this.associatedMap=b;
+this.type=a;
+this.expectedModCount=b.modCount;
+},"java.util.MapEntry.Type,java.util.concurrent.ConcurrentHashMap");
+Clazz_overrideMethod(c$,"hasNext",
+function(){
+if(this.entry!=null){
+return true;
+}while(this.position<this.associatedMap.elementData.length){
+if(this.associatedMap.elementData[this.position]==null){
+this.position++;
+}else{
+return true;
+}}
+return false;
+});
+Clazz_defineMethod(c$,"checkConcurrentMod",
+function(){
+if(this.expectedModCount!=this.associatedMap.modCount){
+throw new java.util.ConcurrentModificationException();
+}});
+Clazz_overrideMethod(c$,"next",
+function(){
+this.checkConcurrentMod();
+if(!this.hasNext()){
+throw new java.util.NoSuchElementException();
+}var a;
+if(this.entry==null){
+a=this.lastEntry=this.associatedMap.elementData[this.position++];
+this.entry=this.lastEntry.next;
+}else{
+if(this.lastEntry.next!==this.entry){
+this.lastEntry=this.lastEntry.next;
+}a=this.entry;
+this.entry=this.entry.next;
+}this.canRemove=true;
+return this.type.get(a);
+});
+Clazz_overrideMethod(c$,"remove",
+function(){
+this.checkConcurrentMod();
+if(!this.canRemove){
+throw new IllegalStateException();
+}this.canRemove=false;
+this.associatedMap.modCount++;
+if(this.lastEntry.next===this.entry){
+while(this.associatedMap.elementData[--this.position]==null){
+;}
+this.associatedMap.elementData[this.position]=this.associatedMap.elementData[this.position].next;
+this.entry=null;
+}else{
+this.lastEntry.next=this.entry;
+}this.associatedMap.elementCount--;
+this.expectedModCount++;
+});
+c$=Clazz_p0p();
+Clazz_pu$h(self.c$);
+c$=Clazz_decorateAsClass(function(){
+this.associatedMap=null;
+Clazz_instantialize(this,arguments);
+},java.util.concurrent.ConcurrentHashMap,"ConcurrentHashMapEntrySet",java.util.AbstractSet);
+Clazz_makeConstructor(c$,
+function(a){
+Clazz_superConstructor(this,java.util.concurrent.ConcurrentHashMap.ConcurrentHashMapEntrySet,[]);
+this.associatedMap=a;
+},"java.util.concurrent.ConcurrentHashMap");
+Clazz_defineMethod(c$,"hashMap",
+function(){
+return this.associatedMap;
+});
+Clazz_overrideMethod(c$,"size",
+function(){
+return this.associatedMap.elementCount;
+});
+Clazz_overrideMethod(c$,"clear",
+function(){
+this.associatedMap.clear();
+});
+Clazz_overrideMethod(c$,"remove",
+function(a){
+if(this.contains(a)){
+this.associatedMap.remove((a).getKey());
+return true;
+}return false;
+},"~O");
+Clazz_overrideMethod(c$,"contains",
+function(a){
+if(Clazz_instanceOf(a,java.util.Map.Entry)){
+var b=this.associatedMap.getEntry((a).getKey());
+return a.equals(b);
+}return false;
+},"~O");
+Clazz_overrideMethod(c$,"iterator",
+function(){
+return new java.util.concurrent.ConcurrentHashMap.ConcurrentHashMapIterator(((Clazz_isClassDefined("java.util.concurrent.ConcurrentHashMap$ConcurrentHashMapEntrySet$1")?0:java.util.concurrent.ConcurrentHashMap.ConcurrentHashMapEntrySet.$ConcurrentHashMap$ConcurrentHashMapEntrySet$1$()),Clazz_innerTypeInstance(java.util.concurrent.ConcurrentHashMap$ConcurrentHashMapEntrySet$1,this,null)),this.associatedMap);
+});
+c$.$ConcurrentHashMap$ConcurrentHashMapEntrySet$1$=function(){
+Clazz_pu$h(self.c$);
+c$=Clazz_declareAnonymous(java.util.concurrent,"ConcurrentHashMap$ConcurrentHashMapEntrySet$1",null,java.util.MapEntry.Type);
+Clazz_overrideMethod(c$,"get",
+function(a){
+return a;
+},"java.util.MapEntry");
+c$=Clazz_p0p();
+};
+c$=Clazz_p0p();
+Clazz_defineStatics(c$,
+"DEFAULT_SIZE",16);
+});
+Clazz_declarePackage ("jalview.viewmodel.seqfeatures");
+Clazz_load (null, "jalview.viewmodel.seqfeatures.FeatureRendererSettings", ["jalview.schemes.GraduatedColor", "java.util.Arrays", "java.util.concurrent.ConcurrentHashMap"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.renderOrder = null;
+this.featureGroups = null;
+this.featureColours = null;
+this.transparency = 0;
+this.featureOrder = null;
+Clazz_instantialize (this, arguments);
+}, jalview.viewmodel.seqfeatures, "FeatureRendererSettings", null, Cloneable);
+Clazz_makeConstructor (c$, 
+function (renderOrder, featureGroups, featureColours, transparency, featureOrder) {
+this.renderOrder = java.util.Arrays.copyOf (renderOrder, renderOrder.length);
+this.featureGroups =  new java.util.concurrent.ConcurrentHashMap (featureGroups);
+this.featureColours =  new java.util.concurrent.ConcurrentHashMap (featureColours);
+this.transparency = transparency;
+this.featureOrder =  new java.util.concurrent.ConcurrentHashMap (featureOrder);
+}, "~A,java.util.Hashtable,java.util.Hashtable,~N,java.util.Hashtable");
+Clazz_makeConstructor (c$, 
+function (fr) {
+this.renderOrder = null;
+this.featureGroups =  new java.util.concurrent.ConcurrentHashMap ();
+this.featureColours =  new java.util.concurrent.ConcurrentHashMap ();
+this.featureOrder =  new java.util.concurrent.ConcurrentHashMap ();
+if (fr.renderOrder != null) {
+this.renderOrder =  new Array (fr.renderOrder.length);
+System.arraycopy (fr.renderOrder, 0, this.renderOrder, 0, fr.renderOrder.length);
+}if (fr.featureGroups != null) {
+this.featureGroups =  new java.util.concurrent.ConcurrentHashMap (fr.featureGroups);
+}if (fr.featureColours != null) {
+this.featureColours =  new java.util.concurrent.ConcurrentHashMap (fr.featureColours);
+}var en = fr.featureColours.keySet ().iterator ();
+while (en.hasNext ()) {
+var next = en.next ();
+var val = this.featureColours.get (next);
+if (Clazz_instanceOf (val, jalview.schemes.GraduatedColor)) {
+this.featureColours.put (next,  new jalview.schemes.GraduatedColor (val));
+}}
+this.transparency = fr.transparency;
+if (fr.featureOrder != null) {
+this.featureOrder =  new java.util.concurrent.ConcurrentHashMap (fr.featureOrder);
+}}, "jalview.viewmodel.seqfeatures.FeatureRendererModel");
+});
+Clazz_declarePackage ("jalview.viewmodel.seqfeatures");
+Clazz_load (["jalview.api.FeaturesDisplayedI", "java.util.HashSet"], "jalview.viewmodel.seqfeatures.FeaturesDisplayed", null, function () {
+c$ = Clazz_decorateAsClass (function () {
+this.featuresDisplayed = null;
+this.featuresRegistered = null;
+Clazz_instantialize (this, arguments);
+}, jalview.viewmodel.seqfeatures, "FeaturesDisplayed", null, jalview.api.FeaturesDisplayedI);
+Clazz_prepareFields (c$, function () {
+this.featuresDisplayed =  new java.util.HashSet ();
+this.featuresRegistered =  new java.util.HashSet ();
+});
+Clazz_makeConstructor (c$, 
+function (featuresDisplayed2) {
+var fdisp = featuresDisplayed2.getVisibleFeatures ();
+var ftype;
+while (fdisp.hasNext ()) {
+ftype = fdisp.next ();
+this.featuresDisplayed.add (ftype);
+this.featuresRegistered.add (ftype);
+}
+}, "jalview.api.FeaturesDisplayedI");
+Clazz_makeConstructor (c$, 
+function () {
+});
+Clazz_defineMethod (c$, "getVisibleFeatures", 
+function () {
+return this.featuresDisplayed.iterator ();
+});
+Clazz_overrideMethod (c$, "isVisible", 
+function (featureType) {
+return this.featuresDisplayed.contains (featureType);
+}, "~S");
+Clazz_overrideMethod (c$, "areVisible", 
+function (featureTypes) {
+return this.featuresDisplayed.containsAll (featureTypes);
+}, "java.util.Collection");
+Clazz_overrideMethod (c$, "clear", 
+function () {
+this.featuresDisplayed.clear ();
+this.featuresRegistered.clear ();
+});
+Clazz_overrideMethod (c$, "setAllVisible", 
+function (makeVisible) {
+this.featuresDisplayed.addAll (makeVisible);
+this.featuresRegistered.addAll (makeVisible);
+}, "java.util.Collection");
+Clazz_overrideMethod (c$, "setAllRegisteredVisible", 
+function () {
+this.featuresDisplayed.addAll (this.featuresRegistered);
+});
+Clazz_overrideMethod (c$, "setVisible", 
+function (featureType) {
+this.featuresDisplayed.add (featureType);
+this.featuresRegistered.add (featureType);
+}, "~S");
+Clazz_overrideMethod (c$, "isRegistered", 
+function (type) {
+return this.featuresRegistered.contains (type);
+}, "~S");
+Clazz_overrideMethod (c$, "getVisibleFeatureCount", 
+function () {
+return this.featuresDisplayed.size ();
+});
+Clazz_overrideMethod (c$, "getRegisterdFeaturesCount", 
+function () {
+return this.featuresRegistered.size ();
+});
+});
+Clazz_declarePackage ("jalview.api");
+Clazz_declareInterface (jalview.api, "FeaturesDisplayedI");
+Clazz_declarePackage ("java.awt");
+Clazz_load (["java.awt.Composite"], "java.awt.AlphaComposite", ["java.lang.Float", "$.IllegalArgumentException", "jssun.java2d.SunCompositeContext"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.extraAlpha = 0;
+this.rule = 0;
+Clazz_instantialize (this, arguments);
+}, java.awt, "AlphaComposite", null, java.awt.Composite);
+Clazz_makeConstructor (c$, 
+ function (rule) {
+this.construct (rule, 1.0);
+}, "~N");
+Clazz_makeConstructor (c$, 
+ function (rule, alpha) {
+if (alpha < 0.0 || alpha > 1.0) {
+throw  new IllegalArgumentException ("alpha value out of range");
+}if (rule < 1 || rule > 12) {
+throw  new IllegalArgumentException ("unknown composite rule");
+}this.rule = rule;
+this.extraAlpha = alpha;
+}, "~N,~N");
+c$.getInstance = Clazz_defineMethod (c$, "getInstance", 
+function (rule) {
+switch (rule) {
+case 1:
+return java.awt.AlphaComposite.Clear;
+case 2:
+return java.awt.AlphaComposite.Src;
+case 9:
+return java.awt.AlphaComposite.Dst;
+case 3:
+return java.awt.AlphaComposite.SrcOver;
+case 4:
+return java.awt.AlphaComposite.DstOver;
+case 5:
+return java.awt.AlphaComposite.SrcIn;
+case 6:
+return java.awt.AlphaComposite.DstIn;
+case 7:
+return java.awt.AlphaComposite.SrcOut;
+case 8:
+return java.awt.AlphaComposite.DstOut;
+case 10:
+return java.awt.AlphaComposite.SrcAtop;
+case 11:
+return java.awt.AlphaComposite.DstAtop;
+case 12:
+return java.awt.AlphaComposite.Xor;
+default:
+throw  new IllegalArgumentException ("unknown composite rule");
+}
+}, "~N");
+c$.getInstance = Clazz_defineMethod (c$, "getInstance", 
+function (rule, alpha) {
+if (alpha == 1.0) {
+return java.awt.AlphaComposite.getInstance (rule);
+}return  new java.awt.AlphaComposite (rule, alpha);
+}, "~N,~N");
+Clazz_overrideMethod (c$, "createContext", 
+function (srcColorModel, dstColorModel, hints) {
+return  new jssun.java2d.SunCompositeContext (this, srcColorModel, dstColorModel);
+}, "java.awt.image.ColorModel,java.awt.image.ColorModel,java.awt.RenderingHints");
+Clazz_defineMethod (c$, "getAlpha", 
+function () {
+return this.extraAlpha;
+});
+Clazz_defineMethod (c$, "getRule", 
+function () {
+return this.rule;
+});
+Clazz_defineMethod (c$, "derive", 
+function (rule) {
+return (this.rule == rule) ? this : java.awt.AlphaComposite.getInstance (rule, this.extraAlpha);
+}, "~N");
+Clazz_defineMethod (c$, "derive", 
+function (alpha) {
+return (this.extraAlpha == alpha) ? this : java.awt.AlphaComposite.getInstance (this.rule, alpha);
+}, "~N");
+Clazz_overrideMethod (c$, "hashCode", 
+function () {
+return (Float.floatToIntBits (this.extraAlpha) * 31 + this.rule);
+});
+Clazz_overrideMethod (c$, "equals", 
+function (obj) {
+if (!(Clazz_instanceOf (obj, java.awt.AlphaComposite))) {
+return false;
+}var ac = obj;
+if (this.rule != ac.rule) {
+return false;
+}if (this.extraAlpha != ac.extraAlpha) {
+return false;
+}return true;
+}, "~O");
+Clazz_defineStatics (c$,
+"CLEAR", 1,
+"SRC", 2,
+"DST", 9,
+"SRC_OVER", 3,
+"DST_OVER", 4,
+"SRC_IN", 5,
+"DST_IN", 6,
+"SRC_OUT", 7,
+"DST_OUT", 8,
+"SRC_ATOP", 10,
+"DST_ATOP", 11,
+"XOR", 12);
+c$.Clear = c$.prototype.Clear =  new java.awt.AlphaComposite (1);
+c$.Src = c$.prototype.Src =  new java.awt.AlphaComposite (2);
+c$.Dst = c$.prototype.Dst =  new java.awt.AlphaComposite (9);
+c$.SrcOver = c$.prototype.SrcOver =  new java.awt.AlphaComposite (3);
+c$.DstOver = c$.prototype.DstOver =  new java.awt.AlphaComposite (4);
+c$.SrcIn = c$.prototype.SrcIn =  new java.awt.AlphaComposite (5);
+c$.DstIn = c$.prototype.DstIn =  new java.awt.AlphaComposite (6);
+c$.SrcOut = c$.prototype.SrcOut =  new java.awt.AlphaComposite (7);
+c$.DstOut = c$.prototype.DstOut =  new java.awt.AlphaComposite (8);
+c$.SrcAtop = c$.prototype.SrcAtop =  new java.awt.AlphaComposite (10);
+c$.DstAtop = c$.prototype.DstAtop =  new java.awt.AlphaComposite (11);
+c$.Xor = c$.prototype.Xor =  new java.awt.AlphaComposite (12);
+Clazz_defineStatics (c$,
+"MIN_RULE", 1,
+"MAX_RULE", 12);
+});
+Clazz_declarePackage ("java.awt");
+Clazz_declareInterface (java.awt, "Composite");
+Clazz_declarePackage ("jssun.java2d");
+Clazz_load (["java.awt.CompositeContext"], "jssun.java2d.SunCompositeContext", ["java.lang.NullPointerException", "java.awt.image.BufferedImage", "$.WritableRaster", "jssun.java2d.loops.CompositeType"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.srcCM = null;
+this.dstCM = null;
+this.composite = null;
+this.comptype = null;
+Clazz_instantialize (this, arguments);
+}, jssun.java2d, "SunCompositeContext", null, java.awt.CompositeContext);
+Clazz_makeConstructor (c$, 
+function (ac, s, d) {
+if (s == null) {
+throw  new NullPointerException ("Source color model cannot be null");
+}if (d == null) {
+throw  new NullPointerException ("Destination color model cannot be null");
+}this.srcCM = s;
+this.dstCM = d;
+this.composite = ac;
+this.comptype = jssun.java2d.loops.CompositeType.forAlphaComposite (ac);
+}, "java.awt.AlphaComposite,java.awt.image.ColorModel,java.awt.image.ColorModel");
+Clazz_overrideMethod (c$, "dispose", 
+function () {
+});
+Clazz_overrideMethod (c$, "compose", 
+function (srcArg, dstIn, dstOut) {
+var src;
+var w;
+var h;
+if (dstIn !== dstOut) {
+dstOut.setDataElementsRaster (0, 0, dstIn);
+}if (Clazz_instanceOf (srcArg, java.awt.image.WritableRaster)) {
+src = srcArg;
+} else {
+src = srcArg.createCompatibleWritableRaster ();
+src.setDataElements (0, 0, srcArg);
+}w = Math.min (src.getWidth (), dstIn.getWidth ());
+h = Math.min (src.getHeight (), dstIn.getHeight ());
+var srcImg =  new java.awt.image.BufferedImage (this.srcCM, src, this.srcCM.isAlphaPremultiplied (), null);
+var dstImg =  new java.awt.image.BufferedImage (this.dstCM, dstOut, this.dstCM.isAlphaPremultiplied (), null);
+}, "java.awt.image.Raster,java.awt.image.Raster,java.awt.image.WritableRaster");
+});
+Clazz_declarePackage ("java.awt");
+Clazz_declareInterface (java.awt, "CompositeContext");
+Clazz_declarePackage ("java.awt.image");
+Clazz_load (["java.awt.Image", "$.Transparency"], "java.awt.image.BufferedImage", ["java.awt.Image", "java.lang.IllegalArgumentException", "$.NullPointerException", "java.util.Hashtable", "java.awt.GraphicsEnvironment", "$.Point", "$.Rectangle", "java.awt.image.ColorModel", "$.DirectColorModel", "$.Raster", "jssun.awt.image.OffScreenImageSource"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.imageType = 0;
+this.colorModel = null;
+this.raster = null;
+this.osis = null;
+this.properties = null;
+this.$isAlphaPremultiplied = false;
+Clazz_instantialize (this, arguments);
+}, java.awt.image, "BufferedImage", java.awt.Image, java.awt.Transparency);
+Clazz_makeConstructor (c$, 
+function (width, height, imageType) {
+Clazz_superConstructor (this, java.awt.image.BufferedImage, []);
+switch (imageType) {
+case 1:
+{
+this.colorModel =  new java.awt.image.DirectColorModel (24, 0x00ff0000, 0x0000ff00, 0x000000ff, 0x0);
+this.raster = this.colorModel.createCompatibleWritableRaster (width, height);
+}break;
+case 2:
+{
+this.colorModel = java.awt.image.ColorModel.getRGBdefault ();
+this.raster = this.colorModel.createCompatibleWritableRaster (width, height);
+}break;
+default:
+throw  new IllegalArgumentException ("Unknown image type " + imageType);
+}
+this.imageType = imageType;
+}, "~N,~N,~N");
+Clazz_makeConstructor (c$, 
+function (cm, raster, isRasterPremultiplied, properties) {
+Clazz_superConstructor (this, java.awt.image.BufferedImage, []);
+if ((raster.minX != 0) || (raster.minY != 0)) {
+throw  new IllegalArgumentException ("Raster " + raster + " has minX or minY not equal to zero: " + raster.minX + " " + raster.minY);
+}this.colorModel = cm;
+this.raster = raster;
+this.properties = properties;
+var cs;
+cs = cm.getColorSpace ();
+}, "java.awt.image.ColorModel,java.awt.image.WritableRaster,~B,java.util.Hashtable");
+Clazz_defineMethod (c$, "getType", 
+function () {
+return this.imageType;
+});
+Clazz_defineMethod (c$, "getColorModel", 
+function () {
+return this.colorModel;
+});
+Clazz_defineMethod (c$, "getRaster", 
+function () {
+return this.raster;
+});
+Clazz_defineMethod (c$, "getRGB", 
+function (x, y) {
+return 0;
+}, "~N,~N");
+Clazz_defineMethod (c$, "getRGB", 
+function (startX, startY, w, h, rgbArray, offset, scansize) {
+return rgbArray;
+}, "~N,~N,~N,~N,~A,~N,~N");
+Clazz_defineMethod (c$, "setRGB", 
+function (x, y, rgb) {
+}, "~N,~N,~N");
+Clazz_defineMethod (c$, "setRGB", 
+function (startX, startY, w, h, rgbArray, offset, scansize) {
+}, "~N,~N,~N,~N,~A,~N,~N");
+Clazz_defineMethod (c$, "getWidth", 
+function () {
+return this.raster.getWidth ();
+});
+Clazz_defineMethod (c$, "getHeight", 
+function () {
+return this.raster.getHeight ();
+});
+Clazz_defineMethod (c$, "getWidth", 
+function (observer) {
+return this.raster.getWidth ();
+}, "java.awt.image.ImageObserver");
+Clazz_defineMethod (c$, "getHeight", 
+function (observer) {
+return this.raster.getHeight ();
+}, "java.awt.image.ImageObserver");
+Clazz_overrideMethod (c$, "getSource", 
+function () {
+if (this.osis == null) {
+if (this.properties == null) {
+this.properties =  new java.util.Hashtable ();
+}this.osis =  new jssun.awt.image.OffScreenImageSource (this, this.properties);
+}return this.osis;
+});
+Clazz_defineMethod (c$, "getProperty", 
+function (name, observer) {
+return this.getProperty (name);
+}, "~S,java.awt.image.ImageObserver");
+Clazz_defineMethod (c$, "getProperty", 
+function (name) {
+if (name == null) {
+throw  new NullPointerException ("null property name is not allowed");
+}if (this.properties == null) {
+return java.awt.Image.UndefinedProperty;
+}var o = this.properties.get (name);
+if (o == null) {
+o = java.awt.Image.UndefinedProperty;
+}return o;
+}, "~S");
+Clazz_overrideMethod (c$, "getGraphics", 
+function () {
+return this.createGraphics ();
+});
+Clazz_defineMethod (c$, "createGraphics", 
+function () {
+var env = java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment ();
+return env.createGraphics (this);
+});
+Clazz_defineMethod (c$, "getSubimage", 
+function (x, y, w, h) {
+return  new java.awt.image.BufferedImage (this.colorModel, this.raster.createWritableChild (x, y, w, h, 0, 0, null), this.colorModel.isAlphaPremultiplied (), this.properties);
+}, "~N,~N,~N,~N");
+Clazz_defineMethod (c$, "isAlphaPremultiplied", 
+function () {
+return false;
+});
+Clazz_overrideMethod (c$, "toString", 
+function () {
+return  String.instantialize ("BufferedImage@" + Integer.toHexString (this.hashCode ()) + ": type = " + this.imageType + " " + this.colorModel + " " + this.raster);
+});
+Clazz_defineMethod (c$, "getSources", 
+function () {
+return null;
+});
+Clazz_defineMethod (c$, "getPropertyNames", 
+function () {
+return null;
+});
+Clazz_defineMethod (c$, "getMinX", 
+function () {
+return this.raster.getMinX ();
+});
+Clazz_defineMethod (c$, "getMinY", 
+function () {
+return this.raster.getMinY ();
+});
+Clazz_defineMethod (c$, "getSampleModel", 
+function () {
+return this.raster.getSampleModel ();
+});
+Clazz_defineMethod (c$, "getNumXTiles", 
+function () {
+return 1;
+});
+Clazz_defineMethod (c$, "getNumYTiles", 
+function () {
+return 1;
+});
+Clazz_defineMethod (c$, "getMinTileX", 
+function () {
+return 0;
+});
+Clazz_defineMethod (c$, "getMinTileY", 
+function () {
+return 0;
+});
+Clazz_defineMethod (c$, "getTileWidth", 
+function () {
+return this.raster.getWidth ();
+});
+Clazz_defineMethod (c$, "getTileHeight", 
+function () {
+return this.raster.getHeight ();
+});
+Clazz_defineMethod (c$, "getTileGridXOffset", 
+function () {
+return 0;
+});
+Clazz_defineMethod (c$, "getTileGridYOffset", 
+function () {
+return 0;
+});
+Clazz_defineMethod (c$, "getTile", 
+function (tileX, tileY) {
+return this.raster;
+}, "~N,~N");
+Clazz_defineMethod (c$, "getData", 
+function () {
+var width = this.raster.getWidth ();
+var height = this.raster.getHeight ();
+var startX = this.raster.getMinX ();
+var startY = this.raster.getMinY ();
+var wr = java.awt.image.Raster.createWritableRaster (this.raster.getSampleModel (),  new java.awt.Point (this.raster.getSampleModelTranslateX (), this.raster.getSampleModelTranslateY ()));
+var tdata = null;
+for (var i = startY; i < startY + height; i++) {
+tdata = this.raster.getDataElements (startX, i, width, 1, tdata);
+wr.setDataElements (startX, i, width, 1, tdata);
+}
+return wr;
+});
+Clazz_defineMethod (c$, "getData", 
+function (rect) {
+var sm = this.raster.getSampleModel ();
+var nsm = sm.createCompatibleSampleModel (rect.width, rect.height);
+var wr = java.awt.image.Raster.createWritableRaster (nsm, rect.getLocation ());
+var width = rect.width;
+var height = rect.height;
+var startX = rect.x;
+var startY = rect.y;
+var tdata = null;
+for (var i = startY; i < startY + height; i++) {
+tdata = this.raster.getDataElements (startX, i, width, 1, tdata);
+wr.setDataElements (startX, i, width, 1, tdata);
+}
+return wr;
+}, "java.awt.Rectangle");
+Clazz_defineMethod (c$, "copyData", 
+function (outRaster) {
+if (outRaster == null) {
+return this.getData ();
+}var width = outRaster.getWidth ();
+var height = outRaster.getHeight ();
+var startX = outRaster.getMinX ();
+var startY = outRaster.getMinY ();
+var tdata = null;
+for (var i = startY; i < startY + height; i++) {
+tdata = this.raster.getDataElements (startX, i, width, 1, tdata);
+outRaster.setDataElements (startX, i, width, 1, tdata);
+}
+return outRaster;
+}, "java.awt.image.WritableRaster");
+Clazz_defineMethod (c$, "setData", 
+function (r) {
+var width = r.getWidth ();
+var height = r.getHeight ();
+var startX = r.getMinX ();
+var startY = r.getMinY ();
+var tdata = null;
+var rclip =  new java.awt.Rectangle (startX, startY, width, height);
+var bclip =  new java.awt.Rectangle (0, 0, this.raster.width, this.raster.height);
+var intersect = rclip.intersection (bclip);
+if (intersect.isEmpty ()) {
+return;
+}width = intersect.width;
+height = intersect.height;
+startX = intersect.x;
+startY = intersect.y;
+for (var i = startY; i < startY + height; i++) {
+tdata = r.getPixels (startX, i, width, 1, tdata);
+this.raster.setPixels (startX, i, width, 1, tdata);
+}
+}, "java.awt.image.Raster");
+Clazz_overrideMethod (c$, "getTransparency", 
+function () {
+return this.colorModel.getTransparency ();
+});
+Clazz_defineStatics (c$,
+"TYPE_CUSTOM", 0,
+"TYPE_INT_RGB", 1,
+"TYPE_INT_ARGB", 2);
+});
+Clazz_declarePackage ("java.awt");
+c$ = Clazz_decorateAsClass (function () {
+this.accelerationPriority = .5;
+Clazz_instantialize (this, arguments);
+}, java.awt, "Image");
+Clazz_defineMethod (c$, "getScaledInstance", 
+function (width, height, hints) {
+return null;
+}, "~N,~N,~N");
+Clazz_defineMethod (c$, "flush", 
+function () {
+});
+Clazz_defineMethod (c$, "setAccelerationPriority", 
+function (priority) {
+}, "~N");
+Clazz_defineMethod (c$, "getAccelerationPriority", 
+function () {
+return this.accelerationPriority;
+});
+c$.UndefinedProperty = c$.prototype.UndefinedProperty =  new Clazz._O ();
+Clazz_defineStatics (c$,
+"SCALE_DEFAULT", 1,
+"SCALE_FAST", 2,
+"SCALE_SMOOTH", 4,
+"SCALE_REPLICATE", 8,
+"SCALE_AREA_AVERAGING", 16);
+Clazz_declarePackage ("java.awt.image");
+Clazz_load (["java.awt.image.PackedColorModel"], "java.awt.image.DirectColorModel", ["java.lang.ClassCastException", "$.IllegalArgumentException", "$.UnsupportedOperationException", "java.awt.color.ColorSpace", "java.awt.image.ColorModel", "$.Raster"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.red_mask = 0;
+this.green_mask = 0;
+this.blue_mask = 0;
+this.alpha_mask = 0;
+this.is_LinearRGB = false;
+this.lRGBprecision = 0;
+this.tosRGB8LUT = null;
+this.fromsRGB8LUT8 = null;
+this.fromsRGB8LUT16 = null;
+Clazz_instantialize (this, arguments);
+}, java.awt.image, "DirectColorModel", java.awt.image.PackedColorModel);
+Clazz_makeConstructor (c$, 
+function (bits, rmask, gmask, bmask) {
+this.construct (bits, rmask, gmask, bmask, 0);
+}, "~N,~N,~N,~N");
+Clazz_makeConstructor (c$, 
+function (bits, rmask, gmask, bmask, amask) {
+Clazz_superConstructor (this, java.awt.image.DirectColorModel, [java.awt.color.ColorSpace.getInstance (1000), bits, rmask, gmask, bmask, amask, false, amask == 0 ? 1 : 3, java.awt.image.ColorModel.getDefaultTransferType (bits)]);
+}, "~N,~N,~N,~N,~N");
+Clazz_makeConstructor (c$, 
+function (space, bits, rmask, gmask, bmask, amask, isAlphaPremultiplied, transferType) {
+Clazz_superConstructor (this, java.awt.image.DirectColorModel, [space, bits, rmask, gmask, bmask, amask, isAlphaPremultiplied, amask == 0 ? 1 : 3, transferType]);
+}, "java.awt.color.ColorSpace,~N,~N,~N,~N,~N,~B,~N");
+Clazz_defineMethod (c$, "getRedMask", 
+function () {
+return this.maskArray[0];
+});
+Clazz_defineMethod (c$, "getGreenMask", 
+function () {
+return this.maskArray[1];
+});
+Clazz_defineMethod (c$, "getBlueMask", 
+function () {
+return this.maskArray[2];
+});
+Clazz_defineMethod (c$, "getAlphaMask", 
+function () {
+if (this.supportsAlpha) {
+return this.maskArray[3];
+} else {
+return 0;
+}});
+Clazz_defineMethod (c$, "getDefaultRGBComponents", 
+ function (pixel) {
+var components = this.getComponents (pixel, null, 0);
+var norm = this.getNormalizedComponents (components, 0, null, 0);
+return this.colorSpace.toRGB (norm);
+}, "~N");
+Clazz_defineMethod (c$, "getsRGBComponentFromsRGB", 
+ function (pixel, idx) {
+var c = ((pixel & this.maskArray[idx]) >>> this.maskOffsets[idx]);
+if (this.$isAlphaPremultiplied) {
+var a = ((pixel & this.maskArray[3]) >>> this.maskOffsets[3]);
+c = (a == 0) ? 0 : Clazz_floatToInt (((c * this.scaleFactors[idx]) * 255.0 / (a * this.scaleFactors[3])) + 0.5);
+} else if (this.scaleFactors[idx] != 1.0) {
+c = Clazz_floatToInt ((c * this.scaleFactors[idx]) + 0.5);
+}return c;
+}, "~N,~N");
+Clazz_defineMethod (c$, "getsRGBComponentFromLinearRGB", 
+ function (pixel, idx) {
+var c = ((pixel & this.maskArray[idx]) >>> this.maskOffsets[idx]);
+if (this.$isAlphaPremultiplied) {
+var factor = ((1 << this.lRGBprecision) - 1);
+var a = ((pixel & this.maskArray[3]) >>> this.maskOffsets[3]);
+c = (a == 0) ? 0 : Clazz_floatToInt (((c * this.scaleFactors[idx]) * factor / (a * this.scaleFactors[3])) + 0.5);
+} else if (this.nBits[idx] != this.lRGBprecision) {
+if (this.lRGBprecision == 16) {
+c = Clazz_floatToInt ((c * this.scaleFactors[idx] * 257.0) + 0.5);
+} else {
+c = Clazz_floatToInt ((c * this.scaleFactors[idx]) + 0.5);
+}}return this.tosRGB8LUT[c] & 0xff;
+}, "~N,~N");
+Clazz_defineMethod (c$, "getRed", 
+function (pixel) {
+if (this.is_sRGB) {
+return this.getsRGBComponentFromsRGB (pixel, 0);
+} else if (this.is_LinearRGB) {
+return this.getsRGBComponentFromLinearRGB (pixel, 0);
+}var rgb = this.getDefaultRGBComponents (pixel);
+return Clazz_floatToInt (rgb[0] * 255.0 + 0.5);
+}, "~N");
+Clazz_defineMethod (c$, "getGreen", 
+function (pixel) {
+if (this.is_sRGB) {
+return this.getsRGBComponentFromsRGB (pixel, 1);
+} else if (this.is_LinearRGB) {
+return this.getsRGBComponentFromLinearRGB (pixel, 1);
+}var rgb = this.getDefaultRGBComponents (pixel);
+return Clazz_floatToInt (rgb[1] * 255.0 + 0.5);
+}, "~N");
+Clazz_defineMethod (c$, "getBlue", 
+function (pixel) {
+if (this.is_sRGB) {
+return this.getsRGBComponentFromsRGB (pixel, 2);
+} else if (this.is_LinearRGB) {
+return this.getsRGBComponentFromLinearRGB (pixel, 2);
+}var rgb = this.getDefaultRGBComponents (pixel);
+return Clazz_floatToInt (rgb[2] * 255.0 + 0.5);
+}, "~N");
+Clazz_defineMethod (c$, "getAlpha", 
+function (pixel) {
+if (!this.supportsAlpha) return 255;
+var a = ((pixel & this.maskArray[3]) >>> this.maskOffsets[3]);
+if (this.scaleFactors[3] != 1.0) {
+a = Clazz_floatToInt (a * this.scaleFactors[3] + 0.5);
+}return a;
+}, "~N");
+Clazz_defineMethod (c$, "getRGB", 
+function (pixel) {
+if (this.is_sRGB || this.is_LinearRGB) {
+return (this.getAlpha (pixel) << 24) | (this.getRed (pixel) << 16) | (this.getGreen (pixel) << 8) | (this.getBlue (pixel) << 0);
+}var rgb = this.getDefaultRGBComponents (pixel);
+return (this.getAlpha (pixel) << 24) | ((Clazz_floatToInt (rgb[0] * 255.0 + 0.5)) << 16) | ((Clazz_floatToInt (rgb[1] * 255.0 + 0.5)) << 8) | ((Clazz_floatToInt (rgb[2] * 255.0 + 0.5)) << 0);
+}, "~N");
+Clazz_defineMethod (c$, "getRed", 
+function (inData) {
+var pixel = 0;
+switch (this.transferType) {
+case 0:
+var bdata = inData;
+pixel = bdata[0] & 0xff;
+break;
+case 3:
+var idata = inData;
+pixel = idata[0];
+break;
+default:
+throw  new UnsupportedOperationException ("This method has not been " + "implemented for transferType " + this.transferType);
+}
+return this.getRed (pixel);
+}, "~O");
+Clazz_defineMethod (c$, "getGreen", 
+function (inData) {
+var pixel = 0;
+switch (this.transferType) {
+case 0:
+var bdata = inData;
+pixel = bdata[0] & 0xff;
+break;
+case 3:
+var idata = inData;
+pixel = idata[0];
+break;
+default:
+throw  new UnsupportedOperationException ("This method has not been " + "implemented for transferType " + this.transferType);
+}
+return this.getGreen (pixel);
+}, "~O");
+Clazz_defineMethod (c$, "getBlue", 
+function (inData) {
+var pixel = 0;
+switch (this.transferType) {
+case 0:
+var bdata = inData;
+pixel = bdata[0] & 0xff;
+break;
+case 3:
+var idata = inData;
+pixel = idata[0];
+break;
+default:
+throw  new UnsupportedOperationException ("This method has not been " + "implemented for transferType " + this.transferType);
+}
+return this.getBlue (pixel);
+}, "~O");
+Clazz_defineMethod (c$, "getAlpha", 
+function (inData) {
+var pixel = 0;
+switch (this.transferType) {
+case 0:
+var bdata = inData;
+pixel = bdata[0] & 0xff;
+break;
+case 3:
+var idata = inData;
+pixel = idata[0];
+break;
+default:
+throw  new UnsupportedOperationException ("This method has not been " + "implemented for transferType " + this.transferType);
+}
+return this.getAlpha (pixel);
+}, "~O");
+Clazz_defineMethod (c$, "getRGB", 
+function (inData) {
+var pixel = 0;
+switch (this.transferType) {
+case 0:
+var bdata = inData;
+pixel = bdata[0] & 0xff;
+break;
+case 3:
+var idata = inData;
+pixel = idata[0];
+break;
+default:
+throw  new UnsupportedOperationException ("This method has not been " + "implemented for transferType " + this.transferType);
+}
+return this.getRGB (pixel);
+}, "~O");
+Clazz_defineMethod (c$, "getDataElements", 
+function (rgb, pixel) {
+var intpixel = null;
+if (this.transferType == 3 && pixel != null) {
+intpixel = pixel;
+intpixel[0] = 0;
+} else {
+intpixel =  Clazz_newIntArray (1, 0);
+}var defaultCM = java.awt.image.ColorModel.getRGBdefault ();
+if (this === defaultCM || this.equals (defaultCM)) {
+intpixel[0] = rgb;
+return intpixel;
+}var red;
+var grn;
+var blu;
+var alp;
+red = (rgb >> 16) & 0xff;
+grn = (rgb >> 8) & 0xff;
+blu = rgb & 0xff;
+if (this.is_sRGB || this.is_LinearRGB) {
+var precision;
+var factor;
+if (this.is_LinearRGB) {
+if (this.lRGBprecision == 8) {
+red = this.fromsRGB8LUT8[red] & 0xff;
+grn = this.fromsRGB8LUT8[grn] & 0xff;
+blu = this.fromsRGB8LUT8[blu] & 0xff;
+precision = 8;
+factor = 0.003921569;
+} else {
+red = this.fromsRGB8LUT16[red] & 0xffff;
+grn = this.fromsRGB8LUT16[grn] & 0xffff;
+blu = this.fromsRGB8LUT16[blu] & 0xffff;
+precision = 16;
+factor = 1.5259022E-5;
+}} else {
+precision = 8;
+factor = 0.003921569;
+}if (this.supportsAlpha) {
+alp = (rgb >> 24) & 0xff;
+if (this.$isAlphaPremultiplied) {
+factor *= (alp * (0.003921569));
+precision = -1;
+}if (this.nBits[3] != 8) {
+alp = Clazz_floatToInt ((alp * (0.003921569) * ((1 << this.nBits[3]) - 1)) + 0.5);
+if (alp > ((1 << this.nBits[3]) - 1)) {
+alp = (1 << this.nBits[3]) - 1;
+}}intpixel[0] = alp << this.maskOffsets[3];
+}if (this.nBits[0] != precision) {
+red = Clazz_floatToInt ((red * factor * ((1 << this.nBits[0]) - 1)) + 0.5);
+}if (this.nBits[1] != precision) {
+grn = Clazz_floatToInt ((grn * factor * ((1 << this.nBits[1]) - 1)) + 0.5);
+}if (this.nBits[2] != precision) {
+blu = Clazz_floatToInt ((blu * factor * ((1 << this.nBits[2]) - 1)) + 0.5);
+}} else {
+var norm =  Clazz_newFloatArray (3, 0);
+var factor = 0.003921569;
+norm[0] = red * factor;
+norm[1] = grn * factor;
+norm[2] = blu * factor;
+norm = this.colorSpace.fromRGB (norm);
+if (this.supportsAlpha) {
+alp = (rgb >> 24) & 0xff;
+if (this.$isAlphaPremultiplied) {
+factor *= alp;
+for (var i = 0; i < 3; i++) {
+norm[i] *= factor;
+}
+}if (this.nBits[3] != 8) {
+alp = Clazz_floatToInt ((alp * (0.003921569) * ((1 << this.nBits[3]) - 1)) + 0.5);
+if (alp > ((1 << this.nBits[3]) - 1)) {
+alp = (1 << this.nBits[3]) - 1;
+}}intpixel[0] = alp << this.maskOffsets[3];
+}red = Clazz_floatToInt ((norm[0] * ((1 << this.nBits[0]) - 1)) + 0.5);
+grn = Clazz_floatToInt ((norm[1] * ((1 << this.nBits[1]) - 1)) + 0.5);
+blu = Clazz_floatToInt ((norm[2] * ((1 << this.nBits[2]) - 1)) + 0.5);
+}if (this.maxBits > 23) {
+if (red > ((1 << this.nBits[0]) - 1)) {
+red = (1 << this.nBits[0]) - 1;
+}if (grn > ((1 << this.nBits[1]) - 1)) {
+grn = (1 << this.nBits[1]) - 1;
+}if (blu > ((1 << this.nBits[2]) - 1)) {
+blu = (1 << this.nBits[2]) - 1;
+}}intpixel[0] |= (red << this.maskOffsets[0]) | (grn << this.maskOffsets[1]) | (blu << this.maskOffsets[2]);
+switch (this.transferType) {
+case 0:
+{
+var bdata;
+if (pixel == null) {
+bdata =  Clazz_newByteArray (1, 0);
+} else {
+bdata = pixel;
+}bdata[0] = (0xff & intpixel[0]);
+return bdata;
+}case 3:
+return intpixel;
+}
+throw  new UnsupportedOperationException ("This method has not been " + "implemented for transferType " + this.transferType);
+}, "~N,~O");
+Clazz_defineMethod (c$, "getComponents", 
+function (pixel, components, offset) {
+if (components == null) {
+components =  Clazz_newIntArray (offset + this.numComponents, 0);
+}for (var i = 0; i < this.numComponents; i++) {
+components[offset + i] = (pixel & this.maskArray[i]) >>> this.maskOffsets[i];
+}
+return components;
+}, "~N,~A,~N");
+Clazz_defineMethod (c$, "getComponents", 
+function (pixel, components, offset) {
+var intpixel = 0;
+switch (this.transferType) {
+case 0:
+var bdata = pixel;
+intpixel = bdata[0] & 0xff;
+break;
+case 3:
+var idata = pixel;
+intpixel = idata[0];
+break;
+default:
+throw  new UnsupportedOperationException ("This method has not been " + "implemented for transferType " + this.transferType);
+}
+return this.getComponents (intpixel, components, offset);
+}, "~O,~A,~N");
+Clazz_overrideMethod (c$, "createCompatibleWritableRaster", 
+function (w, h) {
+if ((w <= 0) || (h <= 0)) {
+throw  new IllegalArgumentException ("Width (" + w + ") and height (" + h + ") cannot be <= 0");
+}var bandmasks;
+if (this.supportsAlpha) {
+bandmasks =  Clazz_newIntArray (4, 0);
+bandmasks[3] = this.alpha_mask;
+} else {
+bandmasks =  Clazz_newIntArray (3, 0);
+}bandmasks[0] = this.red_mask;
+bandmasks[1] = this.green_mask;
+bandmasks[2] = this.blue_mask;
+if (this.pixel_bits > 8) {
+return java.awt.image.Raster.createPackedRaster (3, w, h, bandmasks, null);
+} else {
+return java.awt.image.Raster.createPackedRaster (0, w, h, bandmasks, null);
+}}, "~N,~N");
+Clazz_defineMethod (c$, "getDataElement", 
+function (components, offset) {
+var pixel = 0;
+for (var i = 0; i < this.numComponents; i++) {
+pixel |= ((components[offset + i] << this.maskOffsets[i]) & this.maskArray[i]);
+}
+return pixel;
+}, "~A,~N");
+Clazz_defineMethod (c$, "getDataElements", 
+function (components, offset, obj) {
+var pixel = 0;
+for (var i = 0; i < this.numComponents; i++) {
+pixel |= ((components[offset + i] << this.maskOffsets[i]) & this.maskArray[i]);
+}
+switch (this.transferType) {
+case 0:
+if (Clazz_instanceOf (obj, Array)) {
+var bdata = obj;
+bdata[0] = (pixel & 0xff);
+return bdata;
+} else {
+var bdata =  Clazz_newByteArray (-1, [(pixel & 0xff)]);
+return bdata;
+}case 3:
+if (Clazz_instanceOf (obj, Array)) {
+var idata = obj;
+idata[0] = pixel;
+return idata;
+} else {
+var idata =  Clazz_newIntArray (-1, [pixel]);
+return idata;
+}default:
+throw  new ClassCastException ("This method has not been " + "implemented for transferType " + this.transferType);
+}
+}, "~A,~N,~O");
+Clazz_overrideMethod (c$, "toString", 
+function () {
+return  String.instantialize ("DirectColorModel: rmask=" + Integer.toHexString (this.red_mask) + " gmask=" + Integer.toHexString (this.green_mask) + " bmask=" + Integer.toHexString (this.blue_mask) + " amask=" + Integer.toHexString (this.alpha_mask));
+});
+});
+Clazz_declarePackage ("java.awt.image");
+Clazz_load (["java.awt.image.ColorModel"], "java.awt.image.PackedColorModel", ["java.lang.IllegalArgumentException"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.maskArray = null;
+this.maskOffsets = null;
+this.scaleFactors = null;
+Clazz_instantialize (this, arguments);
+}, java.awt.image, "PackedColorModel", java.awt.image.ColorModel);
+Clazz_makeConstructor (c$, 
+function (space, bits, colorMaskArray, alphaMask, isAlphaPremultiplied, trans, transferType) {
+Clazz_superConstructor (this, java.awt.image.PackedColorModel, [bits, java.awt.image.PackedColorModel.createBitsArray (colorMaskArray, alphaMask), space, (alphaMask == 0 ? false : true), isAlphaPremultiplied, trans, transferType]);
+if (bits < 1 || bits > 32) {
+throw  new IllegalArgumentException ("Number of bits must be between 1 and 32.");
+}this.maskArray =  Clazz_newIntArray (this.numComponents, 0);
+this.maskOffsets =  Clazz_newIntArray (this.numComponents, 0);
+this.scaleFactors =  Clazz_newFloatArray (this.numComponents, 0);
+for (var i = 0; i < this.numColorComponents; i++) {
+this.DecomposeMask (colorMaskArray[i], i, space.getName (i));
+}
+if (alphaMask != 0) {
+this.DecomposeMask (alphaMask, this.numColorComponents, "alpha");
+if (this.nBits[this.numComponents - 1] == 1) {
+this.transparency = 2;
+}}}, "java.awt.color.ColorSpace,~N,~A,~N,~B,~N,~N");
+Clazz_makeConstructor (c$, 
+function (space, bits, rmask, gmask, bmask, amask, isAlphaPremultiplied, trans, transferType) {
+Clazz_superConstructor (this, java.awt.image.PackedColorModel, [bits, java.awt.image.PackedColorModel.createBitsArray (rmask, gmask, bmask, amask), space, (amask == 0 ? false : true), isAlphaPremultiplied, trans, transferType]);
+if (space.getType () != 5) {
+throw  new IllegalArgumentException ("ColorSpace must be TYPE_RGB.");
+}this.maskArray =  Clazz_newIntArray (this.numComponents, 0);
+this.maskOffsets =  Clazz_newIntArray (this.numComponents, 0);
+this.scaleFactors =  Clazz_newFloatArray (this.numComponents, 0);
+this.DecomposeMask (rmask, 0, "red");
+this.DecomposeMask (gmask, 1, "green");
+this.DecomposeMask (bmask, 2, "blue");
+if (amask != 0) {
+this.DecomposeMask (amask, 3, "alpha");
+if (this.nBits[3] == 1) {
+this.transparency = 2;
+}}}, "java.awt.color.ColorSpace,~N,~N,~N,~N,~N,~B,~N,~N");
+Clazz_defineMethod (c$, "getMask", 
+function (index) {
+return this.maskArray[index];
+}, "~N");
+Clazz_defineMethod (c$, "getMasks", 
+function () {
+return this.maskArray.clone ();
+});
+Clazz_defineMethod (c$, "DecomposeMask", 
+ function (mask, idx, componentName) {
+var off = 0;
+var count = this.nBits[idx];
+this.maskArray[idx] = mask;
+if (mask != 0) {
+while ((mask & 1) == 0) {
+mask >>>= 1;
+off++;
+}
+}if (off + count > this.pixel_bits) {
+throw  new IllegalArgumentException (componentName + " mask " + Integer.toHexString (this.maskArray[idx]) + " overflows pixel (expecting " + this.pixel_bits + " bits");
+}this.maskOffsets[idx] = off;
+if (count == 0) {
+this.scaleFactors[idx] = 256.0;
+} else {
+this.scaleFactors[idx] = 255.0 / ((1 << count) - 1);
+}}, "~N,~N,~S");
+Clazz_defineMethod (c$, "equals", 
+function (obj) {
+if (!(Clazz_instanceOf (obj, java.awt.image.PackedColorModel))) {
+return false;
+}if (!Clazz_superCall (this, java.awt.image.PackedColorModel, "equals", [obj])) {
+return false;
+}var cm = obj;
+var numC = cm.getNumComponents ();
+if (numC != this.numComponents) {
+return false;
+}for (var i = 0; i < numC; i++) {
+if (this.maskArray[i] != cm.getMask (i)) {
+return false;
+}}
+return true;
+}, "~O");
+c$.createBitsArray = Clazz_defineMethod (c$, "createBitsArray", 
+ function (colorMaskArray, alphaMask) {
+var numColors = colorMaskArray.length;
+var numAlpha = (alphaMask == 0 ? 0 : 1);
+var arr =  Clazz_newIntArray (numColors + numAlpha, 0);
+for (var i = 0; i < numColors; i++) {
+arr[i] = java.awt.image.PackedColorModel.countBits (colorMaskArray[i]);
+if (arr[i] < 0) {
+throw  new IllegalArgumentException ("Noncontiguous color mask (" + Integer.toHexString (colorMaskArray[i]) + "at index " + i);
+}}
+if (alphaMask != 0) {
+arr[numColors] = java.awt.image.PackedColorModel.countBits (alphaMask);
+if (arr[numColors] < 0) {
+throw  new IllegalArgumentException ("Noncontiguous alpha mask (" + Integer.toHexString (alphaMask));
+}}return arr;
+}, "~A,~N");
+c$.createBitsArray = Clazz_defineMethod (c$, "createBitsArray", 
+ function (rmask, gmask, bmask, amask) {
+var arr =  Clazz_newIntArray (3 + (amask == 0 ? 0 : 1), 0);
+arr[0] = java.awt.image.PackedColorModel.countBits (rmask);
+arr[1] = java.awt.image.PackedColorModel.countBits (gmask);
+arr[2] = java.awt.image.PackedColorModel.countBits (bmask);
+if (arr[0] < 0) {
+throw  new IllegalArgumentException ("Noncontiguous red mask (" + Integer.toHexString (rmask));
+} else if (arr[1] < 0) {
+throw  new IllegalArgumentException ("Noncontiguous green mask (" + Integer.toHexString (gmask));
+} else if (arr[2] < 0) {
+throw  new IllegalArgumentException ("Noncontiguous blue mask (" + Integer.toHexString (bmask));
+}if (amask != 0) {
+arr[3] = java.awt.image.PackedColorModel.countBits (amask);
+if (arr[3] < 0) {
+throw  new IllegalArgumentException ("Noncontiguous alpha mask (" + Integer.toHexString (amask));
+}}return arr;
+}, "~N,~N,~N,~N");
+c$.countBits = Clazz_defineMethod (c$, "countBits", 
+ function (mask) {
+var count = 0;
+if (mask != 0) {
+while ((mask & 1) == 0) {
+mask >>>= 1;
+}
+while ((mask & 1) == 1) {
+mask >>>= 1;
+count++;
+}
+}if (mask != 0) {
+return -1;
+}return count;
+}, "~N");
+});
+Clazz_declarePackage ("java.awt.image");
+Clazz_load (["java.awt.image.MultiPixelPackedSampleModel", "$.SinglePixelPackedSampleModel"], "java.awt.image.Raster", ["java.lang.IllegalArgumentException", "$.NullPointerException", "java.awt.Point", "$.Rectangle", "java.awt.image.DataBuffer", "$.DataBufferByte", "$.DataBufferInt", "$.RasterFormatException", "swingjs.api.Interface"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.sampleModel = null;
+this.dataBuffer = null;
+this.minX = 0;
+this.minY = 0;
+this.width = 0;
+this.height = 0;
+this.sampleModelTranslateX = 0;
+this.sampleModelTranslateY = 0;
+this.numBands = 0;
+this.numDataElements = 0;
+this.parent = null;
+Clazz_instantialize (this, arguments);
+}, java.awt.image, "Raster");
+c$.createPackedRaster = Clazz_defineMethod (c$, "createPackedRaster", 
+function (dataType, w, h, bandMasks, location) {
+var d;
+switch (dataType) {
+case 0:
+d =  new java.awt.image.DataBufferByte (w * h);
+break;
+case 3:
+d =  new java.awt.image.DataBufferInt (w * h);
+break;
+default:
+throw  new IllegalArgumentException ("Unsupported data type " + dataType);
+}
+return java.awt.image.Raster.createPackedRaster (d, w, h, w, bandMasks, location);
+}, "~N,~N,~N,~A,java.awt.Point");
+c$.createPackedRaster = Clazz_defineMethod (c$, "createPackedRaster", 
+function (dataType, w, h, bands, bitsPerBand, location) {
+var d;
+if (bands <= 0) {
+throw  new IllegalArgumentException ("Number of bands (" + bands + ") must be greater than 0");
+}if (bitsPerBand <= 0) {
+throw  new IllegalArgumentException ("Bits per band (" + bitsPerBand + ") must be greater than 0");
+}if (bands != 1) {
+var masks =  Clazz_newIntArray (bands, 0);
+var mask = (1 << bitsPerBand) - 1;
+var shift = (bands - 1) * bitsPerBand;
+if (shift + bitsPerBand > java.awt.image.DataBuffer.getDataTypeSize (dataType)) {
+throw  new IllegalArgumentException ("bitsPerBand(" + bitsPerBand + ") * bands is " + " greater than data type " + "size.");
+}switch (dataType) {
+case 0:
+case 3:
+break;
+default:
+throw  new IllegalArgumentException ("Unsupported data type " + dataType);
+}
+for (var i = 0; i < bands; i++) {
+masks[i] = mask << shift;
+shift = shift - bitsPerBand;
+}
+return java.awt.image.Raster.createPackedRaster (dataType, w, h, masks, location);
+} else {
+var fw = w;
+switch (dataType) {
+case 0:
+d =  new java.awt.image.DataBufferByte (Clazz_doubleToInt (Math.ceil (fw / (Clazz_doubleToInt (8 / bitsPerBand)))) * h);
+break;
+case 3:
+d =  new java.awt.image.DataBufferInt (Clazz_doubleToInt (Math.ceil (fw / (Clazz_doubleToInt (32 / bitsPerBand)))) * h);
+break;
+default:
+throw  new IllegalArgumentException ("Unsupported data type " + dataType);
+}
+return java.awt.image.Raster.createPackedRaster (d, w, h, bitsPerBand, location);
+}}, "~N,~N,~N,~N,~N,java.awt.Point");
+c$.createPackedRaster = Clazz_defineMethod (c$, "createPackedRaster", 
+function (dataBuffer, w, h, scanlineStride, bandMasks, location) {
+if (dataBuffer == null) {
+throw  new NullPointerException ("DataBuffer cannot be null");
+}if (location == null) {
+location =  new java.awt.Point (0, 0);
+}var dataType = dataBuffer.getDataType ();
+var sppsm =  new java.awt.image.SinglePixelPackedSampleModel (dataType, w, h, scanlineStride, bandMasks);
+switch (dataType) {
+case 0:
+case 3:
+break;
+default:
+throw  new IllegalArgumentException ("Unsupported data type " + dataType);
+}
+var r = swingjs.api.Interface.getInstance ("jssun.awt.image." + (dataType == 0 ? "Byte" : "Integer") + "InterleavedRaster", true);
+r.setParams (sppsm, dataBuffer, location);
+return r;
+}, "java.awt.image.DataBuffer,~N,~N,~N,~A,java.awt.Point");
+c$.createPackedRaster = Clazz_defineMethod (c$, "createPackedRaster", 
+function (dataBuffer, w, h, bitsPerPixel, location) {
+if (dataBuffer == null) {
+throw  new NullPointerException ("DataBuffer cannot be null");
+}if (location == null) {
+location =  new java.awt.Point (0, 0);
+}var dataType = dataBuffer.getDataType ();
+if (dataType != 0 && dataType != 3) {
+throw  new IllegalArgumentException ("Unsupported data type " + dataType);
+}if (dataBuffer.getNumBanks () != 1) {
+throw  new java.awt.image.RasterFormatException ("DataBuffer for packed Rasters must only have 1 bank.");
+}var mppsm =  new java.awt.image.MultiPixelPackedSampleModel (dataType, w, h, bitsPerPixel);
+if (dataType == 0 && (bitsPerPixel == 1 || bitsPerPixel == 2 || bitsPerPixel == 4)) {
+return  new jssun.awt.image.BytePackedRaster (mppsm, dataBuffer, location);
+} else {
+return  new jssun.awt.image.SunWritableRaster (mppsm, dataBuffer, location);
+}}, "java.awt.image.DataBuffer,~N,~N,~N,java.awt.Point");
+c$.createRaster = Clazz_defineMethod (c$, "createRaster", 
+function (sm, db, location) {
+if ((sm == null) || (db == null)) {
+throw  new NullPointerException ("SampleModel and DataBuffer cannot be null");
+}if (location == null) {
+location =  new java.awt.Point (0, 0);
+}var dataType = sm.getDataType ();
+if (Clazz_instanceOf (sm, java.awt.image.MultiPixelPackedSampleModel) && dataType == 0 && sm.getSampleSize (0) < 8) {
+return  new jssun.awt.image.BytePackedRaster (sm, db, location);
+}return  new java.awt.image.Raster (sm, db, location);
+}, "java.awt.image.SampleModel,java.awt.image.DataBuffer,java.awt.Point");
+c$.createWritableRaster = Clazz_defineMethod (c$, "createWritableRaster", 
+function (sm, location) {
+if (location == null) {
+location =  new java.awt.Point (0, 0);
+}return java.awt.image.Raster.createWritableRaster (sm, sm.createDataBuffer (), location);
+}, "java.awt.image.SampleModel,java.awt.Point");
+c$.createWritableRaster = Clazz_defineMethod (c$, "createWritableRaster", 
+function (sm, db, location) {
+if ((sm == null) || (db == null)) {
+throw  new NullPointerException ("SampleModel and DataBuffer cannot be null");
+}if (location == null) {
+location =  new java.awt.Point (0, 0);
+}var dataType = sm.getDataType ();
+if (Clazz_instanceOf (sm, java.awt.image.MultiPixelPackedSampleModel) && dataType == 0 && sm.getSampleSize (0) < 8) {
+return  new jssun.awt.image.BytePackedRaster (sm, db, location);
+}return  new jssun.awt.image.SunWritableRaster (sm, db, location);
+}, "java.awt.image.SampleModel,java.awt.image.DataBuffer,java.awt.Point");
+Clazz_makeConstructor (c$, 
+function (sampleModel, origin) {
+this.setRaster (sampleModel, sampleModel.createDataBuffer (),  new java.awt.Rectangle (origin.x, origin.y, sampleModel.getWidth (), sampleModel.getHeight ()), origin, null);
+}, "java.awt.image.SampleModel,java.awt.Point");
+Clazz_makeConstructor (c$, 
+function (sampleModel, dataBuffer, origin) {
+this.setRaster (sampleModel, dataBuffer,  new java.awt.Rectangle (origin.x, origin.y, sampleModel.getWidth (), sampleModel.getHeight ()), origin, null);
+}, "java.awt.image.SampleModel,java.awt.image.DataBuffer,java.awt.Point");
+Clazz_makeConstructor (c$, 
+function () {
+});
+Clazz_makeConstructor (c$, 
+function (sampleModel, dataBuffer, aRegion, sampleModelTranslate, parent) {
+this.setRaster (sampleModel, dataBuffer, aRegion, sampleModelTranslate, parent);
+}, "java.awt.image.SampleModel,java.awt.image.DataBuffer,java.awt.Rectangle,java.awt.Point,java.awt.image.Raster");
+Clazz_defineMethod (c$, "setRaster", 
+function (sampleModel, dataBuffer, aRegion, sampleModelTranslate, parent) {
+if ((sampleModel == null) || (dataBuffer == null) || (aRegion == null) || (sampleModelTranslate == null)) {
+throw  new NullPointerException ("SampleModel, dataBuffer, aRegion and sampleModelTranslate cannot be null");
+}this.sampleModel = sampleModel;
+this.dataBuffer = dataBuffer;
+this.minX = aRegion.x;
+this.minY = aRegion.y;
+this.width = aRegion.width;
+this.height = aRegion.height;
+if (this.width <= 0 || this.height <= 0) {
+throw  new java.awt.image.RasterFormatException ("negative or zero " + ((this.width <= 0) ? "width" : "height"));
+}if ((this.minX + this.width) < this.minX) {
+throw  new java.awt.image.RasterFormatException ("overflow condition for X coordinates of Raster");
+}if ((this.minY + this.height) < this.minY) {
+throw  new java.awt.image.RasterFormatException ("overflow condition for Y coordinates of Raster");
+}this.sampleModelTranslateX = sampleModelTranslate.x;
+this.sampleModelTranslateY = sampleModelTranslate.y;
+this.numBands = sampleModel.getNumBands ();
+this.numDataElements = sampleModel.getNumDataElements ();
+this.parent = parent;
+}, "java.awt.image.SampleModel,java.awt.image.DataBuffer,java.awt.Rectangle,java.awt.Point,java.awt.image.Raster");
+Clazz_defineMethod (c$, "getParent", 
+function () {
+return this.parent;
+});
+Clazz_defineMethod (c$, "getSampleModelTranslateX", 
+function () {
+return this.sampleModelTranslateX;
+});
+Clazz_defineMethod (c$, "getSampleModelTranslateY", 
+function () {
+return this.sampleModelTranslateY;
+});
+Clazz_defineMethod (c$, "createCompatibleWritableRaster", 
+function () {
+return  new jssun.awt.image.SunWritableRaster (this.sampleModel,  new java.awt.Point (0, 0));
+});
+Clazz_defineMethod (c$, "createCompatibleWritableRaster", 
+function (w, h) {
+if (w <= 0 || h <= 0) {
+throw  new java.awt.image.RasterFormatException ("negative " + ((w <= 0) ? "width" : "height"));
+}var sm = this.sampleModel.createCompatibleSampleModel (w, h);
+return  new jssun.awt.image.SunWritableRaster (sm,  new java.awt.Point (0, 0));
+}, "~N,~N");
+Clazz_defineMethod (c$, "createCompatibleWritableRaster", 
+function (rect) {
+if (rect == null) {
+throw  new NullPointerException ("Rect cannot be null");
+}return this.createCompatibleWritableRaster (rect.x, rect.y, rect.width, rect.height);
+}, "java.awt.Rectangle");
+Clazz_defineMethod (c$, "createCompatibleWritableRaster", 
+function (x, y, w, h) {
+var ret = this.createCompatibleWritableRaster (w, h);
+return ret.createWritableChild (0, 0, w, h, x, y, null);
+}, "~N,~N,~N,~N");
+Clazz_defineMethod (c$, "createTranslatedChild", 
+function (childMinX, childMinY) {
+return this.createChild (this.minX, this.minY, this.width, this.height, childMinX, childMinY, null);
+}, "~N,~N");
+Clazz_defineMethod (c$, "createChild", 
+function (parentX, parentY, width, height, childMinX, childMinY, bandList) {
+if (parentX < this.minX) {
+throw  new java.awt.image.RasterFormatException ("parentX lies outside raster");
+}if (parentY < this.minY) {
+throw  new java.awt.image.RasterFormatException ("parentY lies outside raster");
+}if ((parentX + width < parentX) || (parentX + width > this.width + this.minX)) {
+throw  new java.awt.image.RasterFormatException ("(parentX + width) is outside raster");
+}if ((parentY + height < parentY) || (parentY + height > this.height + this.minY)) {
+throw  new java.awt.image.RasterFormatException ("(parentY + height) is outside raster");
+}var subSampleModel;
+if (bandList == null) {
+subSampleModel = this.sampleModel;
+} else {
+subSampleModel = this.sampleModel.createSubsetSampleModel (bandList);
+}var deltaX = childMinX - parentX;
+var deltaY = childMinY - parentY;
+return  new java.awt.image.Raster (subSampleModel, this.getDataBuffer (),  new java.awt.Rectangle (childMinX, childMinY, width, height),  new java.awt.Point (this.sampleModelTranslateX + deltaX, this.sampleModelTranslateY + deltaY), this);
+}, "~N,~N,~N,~N,~N,~N,~A");
+Clazz_defineMethod (c$, "getBounds", 
+function () {
+return  new java.awt.Rectangle (this.minX, this.minY, this.width, this.height);
+});
+Clazz_defineMethod (c$, "getMinX", 
+function () {
+return this.minX;
+});
+Clazz_defineMethod (c$, "getMinY", 
+function () {
+return this.minY;
+});
+Clazz_defineMethod (c$, "getWidth", 
+function () {
+return this.width;
+});
+Clazz_defineMethod (c$, "getHeight", 
+function () {
+return this.height;
+});
+Clazz_defineMethod (c$, "getNumBands", 
+function () {
+return this.numBands;
+});
+Clazz_defineMethod (c$, "getNumDataElements", 
+function () {
+return this.sampleModel.getNumDataElements ();
+});
+Clazz_defineMethod (c$, "getTransferType", 
+function () {
+return this.sampleModel.getTransferType ();
+});
+Clazz_defineMethod (c$, "getDataBuffer", 
+function () {
+return this.dataBuffer;
+});
+Clazz_defineMethod (c$, "getSampleModel", 
+function () {
+return this.sampleModel;
+});
+Clazz_defineMethod (c$, "getDataElements", 
+function (x, y, outData) {
+return this.sampleModel.getDataElements (x - this.sampleModelTranslateX, y - this.sampleModelTranslateY, outData, this.dataBuffer);
+}, "~N,~N,~O");
+Clazz_defineMethod (c$, "getDataElements", 
+function (x, y, w, h, outData) {
+return this.sampleModel.getDataElements (x - this.sampleModelTranslateX, y - this.sampleModelTranslateY, w, h, outData, this.dataBuffer);
+}, "~N,~N,~N,~N,~O");
+Clazz_defineMethod (c$, "getPixel", 
+function (x, y, iArray) {
+return this.sampleModel.getPixel (x - this.sampleModelTranslateX, y - this.sampleModelTranslateY, iArray, this.dataBuffer);
+}, "~N,~N,~A");
+Clazz_defineMethod (c$, "getPixel", 
+function (x, y, fArray) {
+return this.sampleModel.getPixel (x - this.sampleModelTranslateX, y - this.sampleModelTranslateY, fArray, this.dataBuffer);
+}, "~N,~N,~A");
+Clazz_defineMethod (c$, "getPixel", 
+function (x, y, dArray) {
+return this.sampleModel.getPixel (x - this.sampleModelTranslateX, y - this.sampleModelTranslateY, dArray, this.dataBuffer);
+}, "~N,~N,~A");
+Clazz_defineMethod (c$, "getPixels", 
+function (x, y, w, h, iArray) {
+return this.sampleModel.getPixels (x - this.sampleModelTranslateX, y - this.sampleModelTranslateY, w, h, iArray, this.dataBuffer);
+}, "~N,~N,~N,~N,~A");
+Clazz_defineMethod (c$, "getPixels", 
+function (x, y, w, h, fArray) {
+return this.sampleModel.getPixels (x - this.sampleModelTranslateX, y - this.sampleModelTranslateY, w, h, fArray, this.dataBuffer);
+}, "~N,~N,~N,~N,~A");
+Clazz_defineMethod (c$, "getPixels", 
+function (x, y, w, h, dArray) {
+return this.sampleModel.getPixels (x - this.sampleModelTranslateX, y - this.sampleModelTranslateY, w, h, dArray, this.dataBuffer);
+}, "~N,~N,~N,~N,~A");
+Clazz_defineMethod (c$, "getSample", 
+function (x, y, b) {
+return this.sampleModel.getSample (x - this.sampleModelTranslateX, y - this.sampleModelTranslateY, b, this.dataBuffer);
+}, "~N,~N,~N");
+Clazz_defineMethod (c$, "getSampleFloat", 
+function (x, y, b) {
+return this.sampleModel.getSampleFloat (x - this.sampleModelTranslateX, y - this.sampleModelTranslateY, b, this.dataBuffer);
+}, "~N,~N,~N");
+Clazz_defineMethod (c$, "getSampleDouble", 
+function (x, y, b) {
+return this.sampleModel.getSampleDouble (x - this.sampleModelTranslateX, y - this.sampleModelTranslateY, b, this.dataBuffer);
+}, "~N,~N,~N");
+Clazz_defineMethod (c$, "getSamples", 
+function (x, y, w, h, b, iArray) {
+return this.sampleModel.getSamples (x - this.sampleModelTranslateX, y - this.sampleModelTranslateY, w, h, b, iArray, this.dataBuffer);
+}, "~N,~N,~N,~N,~N,~A");
+Clazz_defineMethod (c$, "getSamples", 
+function (x, y, w, h, b, fArray) {
+return this.sampleModel.getSamples (x - this.sampleModelTranslateX, y - this.sampleModelTranslateY, w, h, b, fArray, this.dataBuffer);
+}, "~N,~N,~N,~N,~N,~A");
+Clazz_defineMethod (c$, "getSamples", 
+function (x, y, w, h, b, dArray) {
+return this.sampleModel.getSamples (x - this.sampleModelTranslateX, y - this.sampleModelTranslateY, w, h, b, dArray, this.dataBuffer);
+}, "~N,~N,~N,~N,~N,~A");
+});
+Clazz_declarePackage ("java.awt.image");
+Clazz_load (["java.awt.image.SampleModel"], "java.awt.image.MultiPixelPackedSampleModel", ["java.lang.ArrayIndexOutOfBoundsException", "$.IllegalArgumentException", "java.awt.image.DataBuffer", "$.DataBufferByte", "$.DataBufferInt", "$.RasterFormatException"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.pixelBitStride = 0;
+this.bitMask = 0;
+this.pixelsPerDataElement = 0;
+this.dataElementSize = 0;
+this.dataBitOffset = 0;
+this.scanlineStride = 0;
+Clazz_instantialize (this, arguments);
+}, java.awt.image, "MultiPixelPackedSampleModel", java.awt.image.SampleModel);
+Clazz_makeConstructor (c$, 
+function (dataType, w, h, numberOfBits) {
+this.construct (dataType, w, h, numberOfBits, Clazz_doubleToInt ((w * numberOfBits + java.awt.image.DataBuffer.getDataTypeSize (dataType) - 1) / java.awt.image.DataBuffer.getDataTypeSize (dataType)), 0);
+if (dataType != 0 && dataType != 3) {
+throw  new IllegalArgumentException ("Unsupported data type " + dataType);
+}}, "~N,~N,~N,~N");
+Clazz_makeConstructor (c$, 
+function (dataType, w, h, numberOfBits, scanlineStride, dataBitOffset) {
+Clazz_superConstructor (this, java.awt.image.MultiPixelPackedSampleModel, [dataType, w, h, 1]);
+if (dataType != 0 && dataType != 3) {
+throw  new IllegalArgumentException ("Unsupported data type " + dataType);
+}this.dataType = dataType;
+this.pixelBitStride = numberOfBits;
+this.scanlineStride = scanlineStride;
+this.dataBitOffset = dataBitOffset;
+this.dataElementSize = java.awt.image.DataBuffer.getDataTypeSize (dataType);
+this.pixelsPerDataElement = Clazz_doubleToInt (this.dataElementSize / numberOfBits);
+if (this.pixelsPerDataElement * numberOfBits != this.dataElementSize) {
+throw  new java.awt.image.RasterFormatException ("MultiPixelPackedSampleModel does not allow pixels to span data element boundaries");
+}this.bitMask = (1 << numberOfBits) - 1;
+}, "~N,~N,~N,~N,~N,~N");
+Clazz_overrideMethod (c$, "createCompatibleSampleModel", 
+function (w, h) {
+var sampleModel =  new java.awt.image.MultiPixelPackedSampleModel (this.dataType, w, h, this.pixelBitStride);
+return sampleModel;
+}, "~N,~N");
+Clazz_overrideMethod (c$, "createDataBuffer", 
+function () {
+var dataBuffer = null;
+var size = this.scanlineStride * this.height;
+switch (this.dataType) {
+case 0:
+dataBuffer =  new java.awt.image.DataBufferByte (size + Clazz_doubleToInt ((this.dataBitOffset + 7) / 8));
+break;
+case 3:
+dataBuffer =  new java.awt.image.DataBufferInt (size + Clazz_doubleToInt ((this.dataBitOffset + 31) / 32));
+break;
+}
+return dataBuffer;
+});
+Clazz_overrideMethod (c$, "getNumDataElements", 
+function () {
+return 1;
+});
+Clazz_defineMethod (c$, "getSampleSize", 
+function () {
+var sampleSize =  Clazz_newIntArray (-1, [this.pixelBitStride]);
+return sampleSize;
+});
+Clazz_defineMethod (c$, "getSampleSize", 
+function (band) {
+return this.pixelBitStride;
+}, "~N");
+Clazz_defineMethod (c$, "getOffset", 
+function (x, y) {
+var offset = y * this.scanlineStride;
+offset += Clazz_doubleToInt ((x * this.pixelBitStride + this.dataBitOffset) / this.dataElementSize);
+return offset;
+}, "~N,~N");
+Clazz_defineMethod (c$, "getBitOffset", 
+function (x) {
+return (x * this.pixelBitStride + this.dataBitOffset) % this.dataElementSize;
+}, "~N");
+Clazz_defineMethod (c$, "getScanlineStride", 
+function () {
+return this.scanlineStride;
+});
+Clazz_defineMethod (c$, "getPixelBitStride", 
+function () {
+return this.pixelBitStride;
+});
+Clazz_defineMethod (c$, "getDataBitOffset", 
+function () {
+return this.dataBitOffset;
+});
+Clazz_overrideMethod (c$, "getTransferType", 
+function () {
+return 3;
+});
+Clazz_overrideMethod (c$, "createSubsetSampleModel", 
+function (bands) {
+if (bands != null) {
+if (bands.length != 1) throw  new java.awt.image.RasterFormatException ("MultiPixelPackedSampleModel has only one band.");
+}var sm = this.createCompatibleSampleModel (this.width, this.height);
+return sm;
+}, "~A");
+Clazz_overrideMethod (c$, "getSample", 
+function (x, y, b, data) {
+if ((x < 0) || (y < 0) || (x >= this.width) || (y >= this.height) || (b != 0)) {
+throw  new ArrayIndexOutOfBoundsException ("Coordinate out of bounds!");
+}var bitnum = this.dataBitOffset + x * this.pixelBitStride;
+var element = data.getElem (y * this.scanlineStride + Clazz_doubleToInt (bitnum / this.dataElementSize));
+var shift = this.dataElementSize - (bitnum & (this.dataElementSize - 1)) - this.pixelBitStride;
+return (element >> shift) & this.bitMask;
+}, "~N,~N,~N,java.awt.image.DataBuffer");
+Clazz_defineMethod (c$, "setSample", 
+function (x, y, b, s, data) {
+if ((x < 0) || (y < 0) || (x >= this.width) || (y >= this.height) || (b != 0)) {
+throw  new ArrayIndexOutOfBoundsException ("Coordinate out of bounds!");
+}var bitnum = this.dataBitOffset + x * this.pixelBitStride;
+var index = y * this.scanlineStride + (Clazz_doubleToInt (bitnum / this.dataElementSize));
+var shift = this.dataElementSize - (bitnum & (this.dataElementSize - 1)) - this.pixelBitStride;
+var element = data.getElem (index);
+element &= ~(this.bitMask << shift);
+element |= (s & this.bitMask) << shift;
+data.setElem (index, element);
+}, "~N,~N,~N,~N,java.awt.image.DataBuffer");
+Clazz_defineMethod (c$, "getDataElements", 
+function (x, y, obj, data) {
+if ((x < 0) || (y < 0) || (x >= this.width) || (y >= this.height)) {
+throw  new ArrayIndexOutOfBoundsException ("Coordinate out of bounds!");
+}var type = this.getTransferType ();
+var bitnum = this.dataBitOffset + x * this.pixelBitStride;
+var shift = this.dataElementSize - (bitnum & (this.dataElementSize - 1)) - this.pixelBitStride;
+var element = 0;
+switch (type) {
+case 0:
+var bdata;
+if (obj == null) bdata =  Clazz_newByteArray (1, 0);
+ else bdata = obj;
+element = data.getElem (y * this.scanlineStride + Clazz_doubleToInt (bitnum / this.dataElementSize));
+bdata[0] = ((element >> shift) & this.bitMask);
+obj = bdata;
+break;
+case 3:
+var idata;
+if (obj == null) idata =  Clazz_newIntArray (1, 0);
+ else idata = obj;
+element = data.getElem (y * this.scanlineStride + Clazz_doubleToInt (bitnum / this.dataElementSize));
+idata[0] = (element >> shift) & this.bitMask;
+obj = idata;
+break;
+}
+return obj;
+}, "~N,~N,~O,java.awt.image.DataBuffer");
+Clazz_defineMethod (c$, "getPixel", 
+function (x, y, iArray, data) {
+if ((x < 0) || (y < 0) || (x >= this.width) || (y >= this.height)) {
+throw  new ArrayIndexOutOfBoundsException ("Coordinate out of bounds!");
+}var pixels;
+if (iArray != null) {
+pixels = iArray;
+} else {
+pixels =  Clazz_newIntArray (this.numBands, 0);
+}var bitnum = this.dataBitOffset + x * this.pixelBitStride;
+var element = data.getElem (y * this.scanlineStride + Clazz_doubleToInt (bitnum / this.dataElementSize));
+var shift = this.dataElementSize - (bitnum & (this.dataElementSize - 1)) - this.pixelBitStride;
+pixels[0] = (element >> shift) & this.bitMask;
+return pixels;
+}, "~N,~N,~A,java.awt.image.DataBuffer");
+Clazz_defineMethod (c$, "setDataElements", 
+function (x, y, obj, data) {
+if ((x < 0) || (y < 0) || (x >= this.width) || (y >= this.height)) {
+throw  new ArrayIndexOutOfBoundsException ("Coordinate out of bounds!");
+}var type = this.getTransferType ();
+var bitnum = this.dataBitOffset + x * this.pixelBitStride;
+var index = y * this.scanlineStride + (Clazz_doubleToInt (bitnum / this.dataElementSize));
+var shift = this.dataElementSize - (bitnum & (this.dataElementSize - 1)) - this.pixelBitStride;
+var element = data.getElem (index);
+element &= ~(this.bitMask << shift);
+switch (type) {
+case 0:
+var barray = obj;
+element |= (((barray[0]) & 0xff) & this.bitMask) << shift;
+data.setElem (index, element);
+break;
+case 3:
+var iarray = obj;
+element |= (iarray[0] & this.bitMask) << shift;
+data.setElem (index, element);
+break;
+}
+}, "~N,~N,~O,java.awt.image.DataBuffer");
+Clazz_defineMethod (c$, "setPixel", 
+function (x, y, iArray, data) {
+if ((x < 0) || (y < 0) || (x >= this.width) || (y >= this.height)) {
+throw  new ArrayIndexOutOfBoundsException ("Coordinate out of bounds!");
+}var bitnum = this.dataBitOffset + x * this.pixelBitStride;
+var index = y * this.scanlineStride + (Clazz_doubleToInt (bitnum / this.dataElementSize));
+var shift = this.dataElementSize - (bitnum & (this.dataElementSize - 1)) - this.pixelBitStride;
+var element = data.getElem (index);
+element &= ~(this.bitMask << shift);
+element |= (iArray[0] & this.bitMask) << shift;
+data.setElem (index, element);
+}, "~N,~N,~A,java.awt.image.DataBuffer");
+Clazz_overrideMethod (c$, "equals", 
+function (o) {
+if ((o == null) || !(Clazz_instanceOf (o, java.awt.image.MultiPixelPackedSampleModel))) {
+return false;
+}var that = o;
+return this.width == that.width && this.height == that.height && this.numBands == that.numBands && this.dataType == that.dataType && this.pixelBitStride == that.pixelBitStride && this.bitMask == that.bitMask && this.pixelsPerDataElement == that.pixelsPerDataElement && this.dataElementSize == that.dataElementSize && this.dataBitOffset == that.dataBitOffset && this.scanlineStride == that.scanlineStride;
+}, "~O");
+Clazz_overrideMethod (c$, "hashCode", 
+function () {
+var hash = 0;
+hash = this.width;
+hash <<= 8;
+hash ^= this.height;
+hash <<= 8;
+hash ^= this.numBands;
+hash <<= 8;
+hash ^= this.dataType;
+hash <<= 8;
+hash ^= this.pixelBitStride;
+hash <<= 8;
+hash ^= this.bitMask;
+hash <<= 8;
+hash ^= this.pixelsPerDataElement;
+hash <<= 8;
+hash ^= this.dataElementSize;
+hash <<= 8;
+hash ^= this.dataBitOffset;
+hash <<= 8;
+hash ^= this.scanlineStride;
+return hash;
+});
+});
+Clazz_declarePackage ("java.awt.image");
+Clazz_load (null, "java.awt.image.SampleModel", ["java.lang.IllegalArgumentException"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.width = 0;
+this.height = 0;
+this.numBands = 0;
+this.dataType = 0;
+Clazz_instantialize (this, arguments);
+}, java.awt.image, "SampleModel");
+Clazz_makeConstructor (c$, 
+function (dataType, w, h, numBands) {
+var size = w * h;
+if (w <= 0 || h <= 0) {
+throw  new IllegalArgumentException ("Width (" + w + ") and height (" + h + ") must be > 0");
+}if (size >= 2147483647) {
+throw  new IllegalArgumentException ("Dimensions (width=" + w + " height=" + h + ") are too large");
+}if (dataType < 0 || (dataType > 3 && dataType != 32)) {
+throw  new IllegalArgumentException ("Unsupported dataType: " + dataType);
+}if (numBands <= 0) {
+throw  new IllegalArgumentException ("Number of bands must be > 0");
+}this.dataType = dataType;
+this.width = w;
+this.height = h;
+this.numBands = numBands;
+}, "~N,~N,~N,~N");
+Clazz_defineMethod (c$, "getWidth", 
+function () {
+return this.width;
+});
+Clazz_defineMethod (c$, "getHeight", 
+function () {
+return this.height;
+});
+Clazz_defineMethod (c$, "getNumBands", 
+function () {
+return this.numBands;
+});
+Clazz_defineMethod (c$, "getDataType", 
+function () {
+return this.dataType;
+});
+Clazz_defineMethod (c$, "getTransferType", 
+function () {
+return this.dataType;
+});
+Clazz_defineMethod (c$, "getPixel", 
+function (x, y, iArray, data) {
+var pixels;
+if (iArray != null) pixels = iArray;
+ else pixels =  Clazz_newIntArray (this.numBands, 0);
+for (var i = 0; i < this.numBands; i++) {
+pixels[i] = this.getSample (x, y, i, data);
+}
+return pixels;
+}, "~N,~N,~A,java.awt.image.DataBuffer");
+Clazz_defineMethod (c$, "getDataElements", 
+function (x, y, w, h, obj, data) {
+var type = this.getTransferType ();
+var numDataElems = this.getNumDataElements ();
+var cnt = 0;
+var o = null;
+switch (type) {
+case 0:
+var btemp;
+var bdata;
+if (obj == null) bdata =  Clazz_newByteArray (numDataElems * w * h, 0);
+ else bdata = obj;
+for (var i = y; i < y + h; i++) {
+for (var j = x; j < x + w; j++) {
+o = this.getDataElements (j, i, o, data);
+btemp = o;
+for (var k = 0; k < numDataElems; k++) {
+bdata[cnt++] = btemp[k];
+}
+}
+}
+obj = bdata;
+break;
+case 2:
+var sdata;
+var stemp;
+if (obj == null) sdata =  Clazz_newShortArray (numDataElems * w * h, 0);
+ else sdata = obj;
+for (var i = y; i < y + h; i++) {
+for (var j = x; j < x + w; j++) {
+o = this.getDataElements (j, i, o, data);
+stemp = o;
+for (var k = 0; k < numDataElems; k++) {
+sdata[cnt++] = stemp[k];
+}
+}
+}
+obj = sdata;
+break;
+case 3:
+var idata;
+var itemp;
+if (obj == null) idata =  Clazz_newIntArray (numDataElems * w * h, 0);
+ else idata = obj;
+for (var i = y; i < y + h; i++) {
+for (var j = x; j < x + w; j++) {
+o = this.getDataElements (j, i, o, data);
+itemp = o;
+for (var k = 0; k < numDataElems; k++) {
+idata[cnt++] = itemp[k];
+}
+}
+}
+obj = idata;
+break;
+}
+return obj;
+}, "~N,~N,~N,~N,~O,java.awt.image.DataBuffer");
+Clazz_defineMethod (c$, "setDataElements", 
+function (x, y, w, h, obj, data) {
+var cnt = 0;
+var type = this.getTransferType ();
+var numDataElems = this.getNumDataElements ();
+switch (type) {
+case 0:
+var barray = obj;
+var btemp =  Clazz_newByteArray (numDataElems, 0);
+for (var i = y; i < y + h; i++) {
+for (var j = x; j < x + w; j++) {
+for (var k = 0; k < numDataElems; k++) {
+btemp[k] = barray[cnt++];
+}
+this.setDataElements (j, i, btemp, data);
+}
+}
+break;
+case 3:
+var iArray = obj;
+var itemp =  Clazz_newIntArray (numDataElems, 0);
+for (var i = y; i < y + h; i++) {
+for (var j = x; j < x + w; j++) {
+for (var k = 0; k < numDataElems; k++) {
+itemp[k] = iArray[cnt++];
+}
+this.setDataElements (j, i, itemp, data);
+}
+}
+break;
+}
+}, "~N,~N,~N,~N,~O,java.awt.image.DataBuffer");
+Clazz_defineMethod (c$, "getPixels", 
+function (x, y, w, h, iArray, data) {
+var pixels;
+var Offset = 0;
+if (iArray != null) pixels = iArray;
+ else pixels =  Clazz_newIntArray (this.numBands * w * h, 0);
+for (var i = y; i < (h + y); i++) {
+for (var j = x; j < (w + x); j++) {
+for (var k = 0; k < this.numBands; k++) {
+pixels[Offset++] = this.getSample (j, i, k, data);
+}
+}
+}
+return pixels;
+}, "~N,~N,~N,~N,~A,java.awt.image.DataBuffer");
+Clazz_defineMethod (c$, "getSampleFloat", 
+function (x, y, b, data) {
+var sample;
+sample = this.getSample (x, y, b, data);
+return sample;
+}, "~N,~N,~N,java.awt.image.DataBuffer");
+Clazz_defineMethod (c$, "getSampleDouble", 
+function (x, y, b, data) {
+var sample;
+sample = this.getSample (x, y, b, data);
+return sample;
+}, "~N,~N,~N,java.awt.image.DataBuffer");
+Clazz_defineMethod (c$, "getSamples", 
+function (x, y, w, h, b, iArray, data) {
+var pixels;
+var Offset = 0;
+if (iArray != null) pixels = iArray;
+ else pixels =  Clazz_newIntArray (w * h, 0);
+for (var i = y; i < (h + y); i++) {
+for (var j = x; j < (w + x); j++) {
+pixels[Offset++] = this.getSample (j, i, b, data);
+}
+}
+return pixels;
+}, "~N,~N,~N,~N,~N,~A,java.awt.image.DataBuffer");
+Clazz_defineMethod (c$, "setPixel", 
+function (x, y, iArray, data) {
+for (var i = 0; i < this.numBands; i++) this.setSample (x, y, i, iArray[i], data);
+
+}, "~N,~N,~A,java.awt.image.DataBuffer");
+Clazz_defineMethod (c$, "setPixel", 
+function (x, y, fArray, data) {
+for (var i = 0; i < this.numBands; i++) this.setSample (x, y, i, fArray[i], data);
+
+}, "~N,~N,~A,java.awt.image.DataBuffer");
+Clazz_defineMethod (c$, "setPixels", 
+function (x, y, w, h, iArray, data) {
+var Offset = 0;
+for (var i = y; i < (y + h); i++) {
+for (var j = x; j < (x + w); j++) {
+for (var k = 0; k < this.numBands; k++) {
+this.setSample (j, i, k, iArray[Offset++], data);
+}
+}
+}
+}, "~N,~N,~N,~N,~A,java.awt.image.DataBuffer");
+Clazz_defineMethod (c$, "setSamples", 
+function (x, y, w, h, b, iArray, data) {
+var Offset = 0;
+for (var i = y; i < (y + h); i++) {
+for (var j = x; j < (x + w); j++) {
+this.setSample (j, i, b, iArray[Offset++], data);
+}
+}
+}, "~N,~N,~N,~N,~N,~A,java.awt.image.DataBuffer");
+});
+Clazz_declarePackage ("java.awt.image");
+Clazz_load (null, "java.awt.image.DataBuffer", ["java.lang.ArrayIndexOutOfBoundsException", "$.IllegalArgumentException", "jssun.java2d.StateTrackable", "$.StateTrackableDelegate"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.dataType = 0;
+this.banks = 0;
+this.offset = 0;
+this.size = 0;
+this.offsets = null;
+this.theTrackable = null;
+Clazz_instantialize (this, arguments);
+}, java.awt.image, "DataBuffer");
+c$.getDataTypeSize = Clazz_defineMethod (c$, "getDataTypeSize", 
+function (type) {
+if (type < 0 || type > 3) {
+throw  new IllegalArgumentException ("Unknown data type " + type);
+}return java.awt.image.DataBuffer.dataTypeSize[type];
+}, "~N");
+Clazz_makeConstructor (c$, 
+function (dataType, size) {
+this.construct (jssun.java2d.StateTrackable.State.UNTRACKABLE, dataType, size);
+}, "~N,~N");
+Clazz_makeConstructor (c$, 
+function (initialState, dataType, size) {
+this.theTrackable = jssun.java2d.StateTrackableDelegate.createInstance (initialState);
+this.dataType = dataType;
+this.banks = 1;
+this.size = size;
+this.offset = 0;
+this.offsets =  Clazz_newIntArray (1, 0);
+}, "jssun.java2d.StateTrackable.State,~N,~N");
+Clazz_makeConstructor (c$, 
+function (dataType, size, numBanks) {
+this.construct (jssun.java2d.StateTrackable.State.UNTRACKABLE, dataType, size, numBanks);
+}, "~N,~N,~N");
+Clazz_makeConstructor (c$, 
+function (initialState, dataType, size, numBanks) {
+this.theTrackable = jssun.java2d.StateTrackableDelegate.createInstance (initialState);
+this.dataType = dataType;
+this.banks = numBanks;
+this.size = size;
+this.offset = 0;
+this.offsets =  Clazz_newIntArray (this.banks, 0);
+}, "jssun.java2d.StateTrackable.State,~N,~N,~N");
+Clazz_makeConstructor (c$, 
+function (dataType, size, numBanks, offset) {
+this.construct (jssun.java2d.StateTrackable.State.UNTRACKABLE, dataType, size, numBanks, offset);
+}, "~N,~N,~N,~N");
+Clazz_makeConstructor (c$, 
+function (initialState, dataType, size, numBanks, offset) {
+this.theTrackable = jssun.java2d.StateTrackableDelegate.createInstance (initialState);
+this.dataType = dataType;
+this.banks = numBanks;
+this.size = size;
+this.offset = offset;
+this.offsets =  Clazz_newIntArray (numBanks, 0);
+for (var i = 0; i < numBanks; i++) {
+this.offsets[i] = offset;
+}
+}, "jssun.java2d.StateTrackable.State,~N,~N,~N,~N");
+Clazz_makeConstructor (c$, 
+function (dataType, size, numBanks, offsets) {
+this.construct (jssun.java2d.StateTrackable.State.UNTRACKABLE, dataType, size, numBanks, offsets);
+}, "~N,~N,~N,~A");
+Clazz_makeConstructor (c$, 
+function (initialState, dataType, size, numBanks, offsets) {
+if (numBanks != offsets.length) {
+throw  new ArrayIndexOutOfBoundsException ("Number of banks does not match number of bank offsets");
+}this.theTrackable = jssun.java2d.StateTrackableDelegate.createInstance (initialState);
+this.dataType = dataType;
+this.banks = numBanks;
+this.size = size;
+this.offset = offsets[0];
+this.offsets = offsets.clone ();
+}, "jssun.java2d.StateTrackable.State,~N,~N,~N,~A");
+Clazz_defineMethod (c$, "getDataType", 
+function () {
+return this.dataType;
+});
+Clazz_defineMethod (c$, "getSize", 
+function () {
+return this.size;
+});
+Clazz_defineMethod (c$, "getOffset", 
+function () {
+return this.offset;
+});
+Clazz_defineMethod (c$, "getOffsets", 
+function () {
+return this.offsets.clone ();
+});
+Clazz_defineMethod (c$, "getNumBanks", 
+function () {
+return this.banks;
+});
+Clazz_defineMethod (c$, "getElem", 
+function (i) {
+return this.getElem (0, i);
+}, "~N");
+Clazz_defineMethod (c$, "setElem", 
+function (i, val) {
+this.setElem (0, i, val);
+}, "~N,~N");
+Clazz_defineMethod (c$, "getElemFloat", 
+function (i) {
+return this.getElem (i);
+}, "~N");
+Clazz_defineMethod (c$, "getElemFloat", 
+function (bank, i) {
+return this.getElem (bank, i);
+}, "~N,~N");
+Clazz_defineMethod (c$, "setElemFloat", 
+function (i, val) {
+this.setElem (i, Clazz_floatToInt (val));
+}, "~N,~N");
+Clazz_defineMethod (c$, "setElemFloat", 
+function (bank, i, val) {
+this.setElem (bank, i, Clazz_floatToInt (val));
+}, "~N,~N,~N");
+Clazz_defineMethod (c$, "getElemDouble", 
+function (i) {
+return this.getElem (i);
+}, "~N");
+Clazz_defineMethod (c$, "getElemDouble", 
+function (bank, i) {
+return this.getElem (bank, i);
+}, "~N,~N");
+Clazz_defineMethod (c$, "setElemDouble", 
+function (i, val) {
+this.setElem (i, Clazz_doubleToInt (val));
+}, "~N,~N");
+Clazz_defineMethod (c$, "setElemDouble", 
+function (bank, i, val) {
+this.setElem (bank, i, Clazz_doubleToInt (val));
+}, "~N,~N,~N");
+c$.toIntArray = Clazz_defineMethod (c$, "toIntArray", 
+function (obj) {
+if (Clazz_instanceOf (obj, Array)) {
+return obj;
+} else if (obj == null) {
+return null;
+} else if (Clazz_instanceOf (obj, Array)) {
+var sdata = obj;
+var idata =  Clazz_newIntArray (sdata.length, 0);
+for (var i = 0; i < sdata.length; i++) {
+idata[i] = sdata[i] & 0xffff;
+}
+return idata;
+} else if (Clazz_instanceOf (obj, Array)) {
+var bdata = obj;
+var idata =  Clazz_newIntArray (bdata.length, 0);
+for (var i = 0; i < bdata.length; i++) {
+idata[i] = 0xff & bdata[i];
+}
+return idata;
+}return null;
+}, "~O");
+Clazz_defineStatics (c$,
+"TYPE_BYTE", 0,
+"TYPE_SHORT", 2,
+"TYPE_INT", 3,
+"TYPE_UNDEFINED", 32,
+"dataTypeSize",  Clazz_newIntArray (-1, [8, 16, 16, 32, 32, 64]));
+});
+Clazz_declarePackage ("jssun.java2d");
+Clazz_load (["java.lang.Enum"], "jssun.java2d.StateTrackable", null, function () {
+Clazz_declareInterface (jssun.java2d, "StateTrackable");
+Clazz_pu$h(self.c$);
+c$ = Clazz_declareType (jssun.java2d.StateTrackable, "State", Enum);
+Clazz_defineEnumConstant (c$, "IMMUTABLE", 0, []);
+Clazz_defineEnumConstant (c$, "STABLE", 1, []);
+Clazz_defineEnumConstant (c$, "DYNAMIC", 2, []);
+Clazz_defineEnumConstant (c$, "UNTRACKABLE", 3, []);
+c$ = Clazz_p0p ();
+});
+Clazz_declarePackage ("jssun.java2d");
+Clazz_load (["jssun.java2d.StateTrackable"], "jssun.java2d.StateTrackableDelegate", ["java.lang.IllegalStateException", "$.InternalError", "jssun.java2d.StateTracker"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.theState = null;
+this.theTracker = null;
+this.numDynamicAgents = 0;
+Clazz_instantialize (this, arguments);
+}, jssun.java2d, "StateTrackableDelegate", null, jssun.java2d.StateTrackable);
+c$.createInstance = Clazz_defineMethod (c$, "createInstance", 
+function (state) {
+switch (state) {
+case jssun.java2d.StateTrackable.State.UNTRACKABLE:
+return jssun.java2d.StateTrackableDelegate.UNTRACKABLE_DELEGATE;
+case jssun.java2d.StateTrackable.State.STABLE:
+return  new jssun.java2d.StateTrackableDelegate (jssun.java2d.StateTrackable.State.STABLE);
+case jssun.java2d.StateTrackable.State.DYNAMIC:
+return  new jssun.java2d.StateTrackableDelegate (jssun.java2d.StateTrackable.State.DYNAMIC);
+case jssun.java2d.StateTrackable.State.IMMUTABLE:
+return jssun.java2d.StateTrackableDelegate.IMMUTABLE_DELEGATE;
+default:
+throw  new InternalError ("unknown state");
+}
+}, "jssun.java2d.StateTrackable.State");
+Clazz_makeConstructor (c$, 
+ function (state) {
+this.theState = state;
+}, "jssun.java2d.StateTrackable.State");
+Clazz_overrideMethod (c$, "getState", 
+function () {
+return this.theState;
+});
+Clazz_overrideMethod (c$, "getStateTracker", 
+function () {
+var st = this.theTracker;
+if (st == null) {
+switch (this.theState) {
+case jssun.java2d.StateTrackable.State.IMMUTABLE:
+st = jssun.java2d.StateTracker.ALWAYS_CURRENT;
+break;
+case jssun.java2d.StateTrackable.State.STABLE:
+st = ((Clazz_isClassDefined ("jssun.java2d.StateTrackableDelegate$1") ? 0 : jssun.java2d.StateTrackableDelegate.$StateTrackableDelegate$1$ ()), Clazz_innerTypeInstance (jssun.java2d.StateTrackableDelegate$1, this, null));
+break;
+case jssun.java2d.StateTrackable.State.DYNAMIC:
+case jssun.java2d.StateTrackable.State.UNTRACKABLE:
+st = jssun.java2d.StateTracker.NEVER_CURRENT;
+break;
+}
+this.theTracker = st;
+}return st;
+});
+Clazz_defineMethod (c$, "setImmutable", 
+function () {
+if (this.theState === jssun.java2d.StateTrackable.State.UNTRACKABLE || this.theState === jssun.java2d.StateTrackable.State.DYNAMIC) {
+throw  new IllegalStateException ("UNTRACKABLE or DYNAMIC objects cannot become IMMUTABLE");
+}this.theState = jssun.java2d.StateTrackable.State.IMMUTABLE;
+this.theTracker = null;
+});
+Clazz_defineMethod (c$, "setUntrackable", 
+function () {
+if (this.theState === jssun.java2d.StateTrackable.State.IMMUTABLE) {
+throw  new IllegalStateException ("IMMUTABLE objects cannot become UNTRACKABLE");
+}this.theState = jssun.java2d.StateTrackable.State.UNTRACKABLE;
+this.theTracker = null;
+});
+Clazz_defineMethod (c$, "addDynamicAgent", 
+function () {
+if (this.theState === jssun.java2d.StateTrackable.State.IMMUTABLE) {
+throw  new IllegalStateException ("Cannot change state from IMMUTABLE");
+}++this.numDynamicAgents;
+if (this.theState === jssun.java2d.StateTrackable.State.STABLE) {
+this.theState = jssun.java2d.StateTrackable.State.DYNAMIC;
+this.theTracker = null;
+}});
+Clazz_defineMethod (c$, "removeDynamicAgent", 
+function () {
+if (--this.numDynamicAgents == 0 && this.theState === jssun.java2d.StateTrackable.State.DYNAMIC) {
+this.theState = jssun.java2d.StateTrackable.State.STABLE;
+this.theTracker = null;
+}});
+Clazz_defineMethod (c$, "markDirty", 
+function () {
+this.theTracker = null;
+});
+c$.$StateTrackableDelegate$1$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_declareAnonymous (jssun.java2d, "StateTrackableDelegate$1", null, jssun.java2d.StateTracker);
+Clazz_overrideMethod (c$, "isCurrent", 
+function () {
+return (this.b$["jssun.java2d.StateTrackableDelegate"].theTracker === this);
+});
+c$ = Clazz_p0p ();
+};
+c$.UNTRACKABLE_DELEGATE = c$.prototype.UNTRACKABLE_DELEGATE =  new jssun.java2d.StateTrackableDelegate (jssun.java2d.StateTrackable.State.UNTRACKABLE);
+c$.IMMUTABLE_DELEGATE = c$.prototype.IMMUTABLE_DELEGATE =  new jssun.java2d.StateTrackableDelegate (jssun.java2d.StateTrackable.State.IMMUTABLE);
+});
+Clazz_declarePackage ("jssun.java2d");
+c$ = Clazz_declareInterface (jssun.java2d, "StateTracker");
+c$.$StateTracker$1$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_declareAnonymous (jssun.java2d, "StateTracker$1", null, jssun.java2d.StateTracker);
+Clazz_overrideMethod (c$, "isCurrent", 
+function () {
+return true;
+});
+c$ = Clazz_p0p ();
+};
+c$.$StateTracker$2$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_declareAnonymous (jssun.java2d, "StateTracker$2", null, jssun.java2d.StateTracker);
+Clazz_overrideMethod (c$, "isCurrent", 
+function () {
+return false;
+});
+c$ = Clazz_p0p ();
+};
+c$.ALWAYS_CURRENT = c$.prototype.ALWAYS_CURRENT = ((Clazz_isClassDefined ("jssun.java2d.StateTracker$1") ? 0 : jssun.java2d.StateTracker.$StateTracker$1$ ()), Clazz_innerTypeInstance (jssun.java2d.StateTracker$1, this, null));
+c$.NEVER_CURRENT = c$.prototype.NEVER_CURRENT = ((Clazz_isClassDefined ("jssun.java2d.StateTracker$2") ? 0 : jssun.java2d.StateTracker.$StateTracker$2$ ()), Clazz_innerTypeInstance (jssun.java2d.StateTracker$2, this, null));
+Clazz_declarePackage ("java.awt.image");
+Clazz_load (["java.awt.image.DataBuffer"], "java.awt.image.DataBufferByte", ["JU.AU", "jssun.java2d.StateTrackable"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.data = null;
+this.bankdata = null;
+Clazz_instantialize (this, arguments);
+}, java.awt.image, "DataBufferByte", java.awt.image.DataBuffer);
+Clazz_makeConstructor (c$, 
+function (size) {
+Clazz_superConstructor (this, java.awt.image.DataBufferByte, [jssun.java2d.StateTrackable.State.STABLE, 0, size]);
+this.data =  Clazz_newByteArray (size, 0);
+this.bankdata =  Clazz_newByteArray (1, 0);
+this.bankdata[0] = this.data;
+}, "~N");
+Clazz_makeConstructor (c$, 
+function (size, numBanks) {
+Clazz_superConstructor (this, java.awt.image.DataBufferByte, [jssun.java2d.StateTrackable.State.STABLE, 0, size, numBanks]);
+this.bankdata =  Clazz_newByteArray (numBanks, 0);
+for (var i = 0; i < numBanks; i++) {
+this.bankdata[i] =  Clazz_newByteArray (size, 0);
+}
+this.data = this.bankdata[0];
+}, "~N,~N");
+Clazz_makeConstructor (c$, 
+function (dataArray, size) {
+Clazz_superConstructor (this, java.awt.image.DataBufferByte, [jssun.java2d.StateTrackable.State.UNTRACKABLE, 0, size]);
+if (JU.AU.isAI (dataArray)) {
+this.data = dataArray;
+this.bankdata =  Clazz_newByteArray (1, 0);
+this.bankdata[0] = this.data;
+} else {
+this.banks = dataArray.length;
+this.bankdata = dataArray.clone ();
+this.data = this.bankdata[0];
+}}, "~A,~N");
+Clazz_makeConstructor (c$, 
+function (dataArray, size, offset) {
+Clazz_superConstructor (this, java.awt.image.DataBufferByte, [jssun.java2d.StateTrackable.State.UNTRACKABLE, 0, size, 1, offset]);
+this.data = dataArray;
+this.bankdata =  Clazz_newByteArray (1, 0);
+this.bankdata[0] = this.data;
+}, "~A,~N,~N");
+Clazz_makeConstructor (c$, 
+function (dataArray, size, offsets) {
+Clazz_superConstructor (this, java.awt.image.DataBufferByte, [jssun.java2d.StateTrackable.State.UNTRACKABLE, 0, size, dataArray.length, offsets]);
+this.bankdata = dataArray.clone ();
+this.data = this.bankdata[0];
+}, "~A,~N,~A");
+Clazz_defineMethod (c$, "getData", 
+function () {
+this.theTrackable.setUntrackable ();
+return this.data;
+});
+Clazz_defineMethod (c$, "getData", 
+function (bank) {
+this.theTrackable.setUntrackable ();
+return this.bankdata[bank];
+}, "~N");
+Clazz_defineMethod (c$, "getBankData", 
+function () {
+this.theTrackable.setUntrackable ();
+return this.bankdata.clone ();
+});
+Clazz_defineMethod (c$, "getElem", 
+function (i) {
+return (this.data[i + this.offset]) & 0xff;
+}, "~N");
+Clazz_defineMethod (c$, "getElem", 
+function (bank, i) {
+return (this.bankdata[bank][i + this.offsets[bank]]) & 0xff;
+}, "~N,~N");
+Clazz_defineMethod (c$, "setElem", 
+function (i, val) {
+this.data[i + this.offset] = val;
+this.theTrackable.markDirty ();
+}, "~N,~N");
+Clazz_defineMethod (c$, "setElem", 
+function (bank, i, val) {
+this.bankdata[bank][i + this.offsets[bank]] = val;
+this.theTrackable.markDirty ();
+}, "~N,~N,~N");
+});
+Clazz_declarePackage ("java.awt.image");
+Clazz_load (["java.awt.image.DataBuffer"], "java.awt.image.DataBufferInt", ["JU.AU", "jssun.java2d.StateTrackable"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.data = null;
+this.bankdata = null;
+Clazz_instantialize (this, arguments);
+}, java.awt.image, "DataBufferInt", java.awt.image.DataBuffer);
+Clazz_makeConstructor (c$, 
+function (size) {
+Clazz_superConstructor (this, java.awt.image.DataBufferInt, [jssun.java2d.StateTrackable.State.STABLE, 3, size]);
+this.data =  Clazz_newIntArray (size, 0);
+this.bankdata =  Clazz_newIntArray (1, 0);
+this.bankdata[0] = this.data;
+}, "~N");
+Clazz_makeConstructor (c$, 
+function (size, numBanks) {
+Clazz_superConstructor (this, java.awt.image.DataBufferInt, [jssun.java2d.StateTrackable.State.STABLE, 3, size, numBanks]);
+this.bankdata =  Clazz_newIntArray (numBanks, 0);
+for (var i = 0; i < numBanks; i++) {
+this.bankdata[i] =  Clazz_newIntArray (size, 0);
+}
+this.data = this.bankdata[0];
+}, "~N,~N");
+Clazz_makeConstructor (c$, 
+function (dataArray, size) {
+Clazz_superConstructor (this, java.awt.image.DataBufferInt, [jssun.java2d.StateTrackable.State.UNTRACKABLE, 3, size]);
+if (JU.AU.isAI (dataArray)) {
+this.data = dataArray;
+this.bankdata =  Clazz_newIntArray (1, 0);
+this.bankdata[0] = this.data;
+} else {
+this.banks = dataArray.length;
+this.bankdata = dataArray.clone ();
+this.data = this.bankdata[0];
+}}, "~A,~N");
+Clazz_makeConstructor (c$, 
+function (dataArray, size, offset) {
+Clazz_superConstructor (this, java.awt.image.DataBufferInt, [jssun.java2d.StateTrackable.State.UNTRACKABLE, 3, size, 1, offset]);
+this.data = dataArray;
+this.bankdata =  Clazz_newIntArray (1, 0);
+this.bankdata[0] = this.data;
+}, "~A,~N,~N");
+Clazz_makeConstructor (c$, 
+function (dataArray, size, offsets) {
+Clazz_superConstructor (this, java.awt.image.DataBufferInt, [jssun.java2d.StateTrackable.State.UNTRACKABLE, 3, size, dataArray.length, offsets]);
+this.bankdata = dataArray.clone ();
+this.data = this.bankdata[0];
+}, "~A,~N,~A");
+Clazz_defineMethod (c$, "getData", 
+function () {
+this.theTrackable.setUntrackable ();
+return this.data;
+});
+Clazz_defineMethod (c$, "getData", 
+function (bank) {
+this.theTrackable.setUntrackable ();
+return this.bankdata[bank];
+}, "~N");
+Clazz_defineMethod (c$, "getBankData", 
+function () {
+this.theTrackable.setUntrackable ();
+return this.bankdata.clone ();
+});
+Clazz_defineMethod (c$, "getElem", 
+function (i) {
+return this.data[i + this.offset];
+}, "~N");
+Clazz_defineMethod (c$, "getElem", 
+function (bank, i) {
+return this.bankdata[bank][i + this.offsets[bank]];
+}, "~N,~N");
+Clazz_defineMethod (c$, "setElem", 
+function (i, val) {
+this.data[i + this.offset] = val;
+this.theTrackable.markDirty ();
+}, "~N,~N");
+Clazz_defineMethod (c$, "setElem", 
+function (bank, i, val) {
+this.bankdata[bank][i + this.offsets[bank]] = val;
+this.theTrackable.markDirty ();
+}, "~N,~N,~N");
+});
+Clazz_declarePackage ("java.awt.image");
+Clazz_load (["java.lang.RuntimeException"], "java.awt.image.RasterFormatException", null, function () {
+c$ = Clazz_declareType (java.awt.image, "RasterFormatException", RuntimeException);
+});
+Clazz_declarePackage ("java.awt.image");
+Clazz_load (["java.awt.image.SampleModel"], "java.awt.image.SinglePixelPackedSampleModel", ["java.lang.ArrayIndexOutOfBoundsException", "$.IllegalArgumentException", "java.util.Arrays", "java.awt.image.DataBufferByte", "$.DataBufferInt", "$.RasterFormatException"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.bitMasks = null;
+this.bitOffsets = null;
+this.bitSizes = null;
+this.maxBitSize = 0;
+this.scanlineStride = 0;
+Clazz_instantialize (this, arguments);
+}, java.awt.image, "SinglePixelPackedSampleModel", java.awt.image.SampleModel);
+Clazz_makeConstructor (c$, 
+function (dataType, w, h, bitMasks) {
+this.construct (dataType, w, h, w, bitMasks);
+if (dataType != 0 && dataType != 3) {
+throw  new IllegalArgumentException ("Unsupported data type " + dataType);
+}}, "~N,~N,~N,~A");
+Clazz_makeConstructor (c$, 
+function (dataType, w, h, scanlineStride, bitMasks) {
+Clazz_superConstructor (this, java.awt.image.SinglePixelPackedSampleModel, [dataType, w, h, bitMasks.length]);
+if (dataType != 0 && dataType != 3) {
+throw  new IllegalArgumentException ("Unsupported data type " + dataType);
+}this.dataType = dataType;
+this.bitMasks = bitMasks.clone ();
+this.scanlineStride = scanlineStride;
+this.bitOffsets =  Clazz_newIntArray (this.numBands, 0);
+this.bitSizes =  Clazz_newIntArray (this.numBands, 0);
+this.maxBitSize = 0;
+for (var i = 0; i < this.numBands; i++) {
+var bitOffset = 0;
+var bitSize = 0;
+var mask;
+mask = bitMasks[i];
+if (mask != 0) {
+while ((mask & 1) == 0) {
+mask = mask >>> 1;
+bitOffset++;
+}
+while ((mask & 1) == 1) {
+mask = mask >>> 1;
+bitSize++;
+}
+if (mask != 0) {
+throw  new IllegalArgumentException ("Mask " + bitMasks[i] + " must be contiguous");
+}}this.bitOffsets[i] = bitOffset;
+this.bitSizes[i] = bitSize;
+if (bitSize > this.maxBitSize) {
+this.maxBitSize = bitSize;
+}}
+}, "~N,~N,~N,~N,~A");
+Clazz_overrideMethod (c$, "getNumDataElements", 
+function () {
+return 1;
+});
+Clazz_defineMethod (c$, "getBufferSize", 
+ function () {
+var size = this.scanlineStride * (this.height - 1) + this.width;
+return size;
+});
+Clazz_overrideMethod (c$, "createCompatibleSampleModel", 
+function (w, h) {
+var sampleModel =  new java.awt.image.SinglePixelPackedSampleModel (this.dataType, w, h, this.bitMasks);
+return sampleModel;
+}, "~N,~N");
+Clazz_overrideMethod (c$, "createDataBuffer", 
+function () {
+var dataBuffer = null;
+var size = this.getBufferSize ();
+switch (this.dataType) {
+case 0:
+dataBuffer =  new java.awt.image.DataBufferByte (size);
+break;
+case 3:
+dataBuffer =  new java.awt.image.DataBufferInt (size);
+break;
+}
+return dataBuffer;
+});
+Clazz_defineMethod (c$, "getSampleSize", 
+function () {
+var mask;
+var sampleSize =  Clazz_newIntArray (this.numBands, 0);
+for (var i = 0; i < this.numBands; i++) {
+sampleSize[i] = 0;
+mask = this.bitMasks[i] >>> this.bitOffsets[i];
+while ((mask & 1) != 0) {
+sampleSize[i]++;
+mask = mask >>> 1;
+}
+}
+return sampleSize;
+});
+Clazz_defineMethod (c$, "getSampleSize", 
+function (band) {
+var sampleSize = 0;
+var mask = this.bitMasks[band] >>> this.bitOffsets[band];
+while ((mask & 1) != 0) {
+sampleSize++;
+mask = mask >>> 1;
+}
+return sampleSize;
+}, "~N");
+Clazz_defineMethod (c$, "getOffset", 
+function (x, y) {
+var offset = y * this.scanlineStride + x;
+return offset;
+}, "~N,~N");
+Clazz_defineMethod (c$, "getBitOffsets", 
+function () {
+return this.bitOffsets.clone ();
+});
+Clazz_defineMethod (c$, "getBitMasks", 
+function () {
+return this.bitMasks.clone ();
+});
+Clazz_defineMethod (c$, "getScanlineStride", 
+function () {
+return this.scanlineStride;
+});
+Clazz_overrideMethod (c$, "createSubsetSampleModel", 
+function (bands) {
+if (bands.length > this.numBands) throw  new java.awt.image.RasterFormatException ("There are only " + this.numBands + " bands");
+var newBitMasks =  Clazz_newIntArray (bands.length, 0);
+for (var i = 0; i < bands.length; i++) newBitMasks[i] = this.bitMasks[bands[i]];
+
+return  new java.awt.image.SinglePixelPackedSampleModel (this.dataType, this.width, this.height, this.scanlineStride, newBitMasks);
+}, "~A");
+Clazz_defineMethod (c$, "getDataElements", 
+function (x, y, obj, data) {
+if ((x < 0) || (y < 0) || (x >= this.width) || (y >= this.height)) {
+throw  new ArrayIndexOutOfBoundsException ("Coordinate out of bounds!");
+}var type = this.getTransferType ();
+switch (type) {
+case 0:
+var bdata;
+if (obj == null) bdata =  Clazz_newByteArray (1, 0);
+ else bdata = obj;
+bdata[0] = data.getElem (y * this.scanlineStride + x);
+obj = bdata;
+break;
+case 3:
+var idata;
+if (obj == null) idata =  Clazz_newIntArray (1, 0);
+ else idata = obj;
+idata[0] = data.getElem (y * this.scanlineStride + x);
+obj = idata;
+break;
+}
+return obj;
+}, "~N,~N,~O,java.awt.image.DataBuffer");
+Clazz_defineMethod (c$, "getPixel", 
+function (x, y, iArray, data) {
+if ((x < 0) || (y < 0) || (x >= this.width) || (y >= this.height)) {
+throw  new ArrayIndexOutOfBoundsException ("Coordinate out of bounds!");
+}var pixels;
+if (iArray == null) {
+pixels =  Clazz_newIntArray (this.numBands, 0);
+} else {
+pixels = iArray;
+}var value = data.getElem (y * this.scanlineStride + x);
+for (var i = 0; i < this.numBands; i++) {
+pixels[i] = (value & this.bitMasks[i]) >>> this.bitOffsets[i];
+}
+return pixels;
+}, "~N,~N,~A,java.awt.image.DataBuffer");
+Clazz_defineMethod (c$, "getPixels", 
+function (x, y, w, h, iArray, data) {
+if ((x < 0) || (y < 0) || (x + w > this.width) || (y + h > this.height)) {
+throw  new ArrayIndexOutOfBoundsException ("Coordinate out of bounds!");
+}var pixels;
+if (iArray != null) {
+pixels = iArray;
+} else {
+pixels =  Clazz_newIntArray (w * h * this.numBands, 0);
+}var lineOffset = y * this.scanlineStride + x;
+var dstOffset = 0;
+for (var i = 0; i < h; i++) {
+for (var j = 0; j < w; j++) {
+var value = data.getElem (lineOffset + j);
+for (var k = 0; k < this.numBands; k++) {
+pixels[dstOffset++] = ((value & this.bitMasks[k]) >>> this.bitOffsets[k]);
+}
+}
+lineOffset += this.scanlineStride;
+}
+return pixels;
+}, "~N,~N,~N,~N,~A,java.awt.image.DataBuffer");
+Clazz_overrideMethod (c$, "getSample", 
+function (x, y, b, data) {
+if ((x < 0) || (y < 0) || (x >= this.width) || (y >= this.height)) {
+throw  new ArrayIndexOutOfBoundsException ("Coordinate out of bounds!");
+}var sample = data.getElem (y * this.scanlineStride + x);
+return ((sample & this.bitMasks[b]) >>> this.bitOffsets[b]);
+}, "~N,~N,~N,java.awt.image.DataBuffer");
+Clazz_defineMethod (c$, "getSamples", 
+function (x, y, w, h, b, iArray, data) {
+if ((x < 0) || (y < 0) || (x + w > this.width) || (y + h > this.height)) {
+throw  new ArrayIndexOutOfBoundsException ("Coordinate out of bounds!");
+}var samples;
+if (iArray != null) {
+samples = iArray;
+} else {
+samples =  Clazz_newIntArray (w * h, 0);
+}var lineOffset = y * this.scanlineStride + x;
+var dstOffset = 0;
+for (var i = 0; i < h; i++) {
+for (var j = 0; j < w; j++) {
+var value = data.getElem (lineOffset + j);
+samples[dstOffset++] = ((value & this.bitMasks[b]) >>> this.bitOffsets[b]);
+}
+lineOffset += this.scanlineStride;
+}
+return samples;
+}, "~N,~N,~N,~N,~N,~A,java.awt.image.DataBuffer");
+Clazz_defineMethod (c$, "setDataElements", 
+function (x, y, obj, data) {
+if ((x < 0) || (y < 0) || (x >= this.width) || (y >= this.height)) {
+throw  new ArrayIndexOutOfBoundsException ("Coordinate out of bounds!");
+}var type = this.getTransferType ();
+switch (type) {
+case 0:
+var barray = obj;
+data.setElem (y * this.scanlineStride + x, (barray[0]) & 0xff);
+break;
+case 3:
+var iarray = obj;
+data.setElem (y * this.scanlineStride + x, iarray[0]);
+break;
+}
+}, "~N,~N,~O,java.awt.image.DataBuffer");
+Clazz_defineMethod (c$, "setPixel", 
+function (x, y, iArray, data) {
+if ((x < 0) || (y < 0) || (x >= this.width) || (y >= this.height)) {
+throw  new ArrayIndexOutOfBoundsException ("Coordinate out of bounds!");
+}var lineOffset = y * this.scanlineStride + x;
+var value = data.getElem (lineOffset);
+for (var i = 0; i < this.numBands; i++) {
+value &= ~this.bitMasks[i];
+value |= ((iArray[i] << this.bitOffsets[i]) & this.bitMasks[i]);
+}
+data.setElem (lineOffset, value);
+}, "~N,~N,~A,java.awt.image.DataBuffer");
+Clazz_defineMethod (c$, "setPixels", 
+function (x, y, w, h, iArray, data) {
+if ((x < 0) || (y < 0) || (x + w > this.width) || (y + h > this.height)) {
+throw  new ArrayIndexOutOfBoundsException ("Coordinate out of bounds!");
+}var lineOffset = y * this.scanlineStride + x;
+var srcOffset = 0;
+for (var i = 0; i < h; i++) {
+for (var j = 0; j < w; j++) {
+var value = data.getElem (lineOffset + j);
+for (var k = 0; k < this.numBands; k++) {
+value &= ~this.bitMasks[k];
+var srcValue = iArray[srcOffset++];
+value |= ((srcValue << this.bitOffsets[k]) & this.bitMasks[k]);
+}
+data.setElem (lineOffset + j, value);
+}
+lineOffset += this.scanlineStride;
+}
+}, "~N,~N,~N,~N,~A,java.awt.image.DataBuffer");
+Clazz_defineMethod (c$, "setSample", 
+function (x, y, b, s, data) {
+if ((x < 0) || (y < 0) || (x >= this.width) || (y >= this.height)) {
+throw  new ArrayIndexOutOfBoundsException ("Coordinate out of bounds!");
+}var value = data.getElem (y * this.scanlineStride + x);
+value &= ~this.bitMasks[b];
+value |= (s << this.bitOffsets[b]) & this.bitMasks[b];
+data.setElem (y * this.scanlineStride + x, value);
+}, "~N,~N,~N,~N,java.awt.image.DataBuffer");
+Clazz_defineMethod (c$, "setSamples", 
+function (x, y, w, h, b, iArray, data) {
+if ((x < 0) || (y < 0) || (x + w > this.width) || (y + h > this.height)) {
+throw  new ArrayIndexOutOfBoundsException ("Coordinate out of bounds!");
+}var lineOffset = y * this.scanlineStride + x;
+var srcOffset = 0;
+for (var i = 0; i < h; i++) {
+for (var j = 0; j < w; j++) {
+var value = data.getElem (lineOffset + j);
+value &= ~this.bitMasks[b];
+var sample = iArray[srcOffset++];
+value |= (sample << this.bitOffsets[b]) & this.bitMasks[b];
+data.setElem (lineOffset + j, value);
+}
+lineOffset += this.scanlineStride;
+}
+}, "~N,~N,~N,~N,~N,~A,java.awt.image.DataBuffer");
+Clazz_overrideMethod (c$, "equals", 
+function (o) {
+if ((o == null) || !(Clazz_instanceOf (o, java.awt.image.SinglePixelPackedSampleModel))) {
+return false;
+}var that = o;
+return this.width == that.width && this.height == that.height && this.numBands == that.numBands && this.dataType == that.dataType && java.util.Arrays.equals (this.bitMasks, that.bitMasks) && java.util.Arrays.equals (this.bitOffsets, that.bitOffsets) && java.util.Arrays.equals (this.bitSizes, that.bitSizes) && this.maxBitSize == that.maxBitSize && this.scanlineStride == that.scanlineStride;
+}, "~O");
+Clazz_overrideMethod (c$, "hashCode", 
+function () {
+var hash = 0;
+hash = this.width;
+hash <<= 8;
+hash ^= this.height;
+hash <<= 8;
+hash ^= this.numBands;
+hash <<= 8;
+hash ^= this.dataType;
+hash <<= 8;
+for (var i = 0; i < this.bitMasks.length; i++) {
+hash ^= this.bitMasks[i];
+hash <<= 8;
+}
+for (var i = 0; i < this.bitOffsets.length; i++) {
+hash ^= this.bitOffsets[i];
+hash <<= 8;
+}
+for (var i = 0; i < this.bitSizes.length; i++) {
+hash ^= this.bitSizes[i];
+hash <<= 8;
+}
+hash ^= this.maxBitSize;
+hash <<= 8;
+hash ^= this.scanlineStride;
+return hash;
+});
+});
+Clazz_declarePackage ("jssun.awt.image");
+Clazz_load (["java.awt.image.ImageProducer"], "jssun.awt.image.OffScreenImageSource", ["java.util.Hashtable"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.image = null;
+this.width = 0;
+this.height = 0;
+this.properties = null;
+this.theConsumer = null;
+Clazz_instantialize (this, arguments);
+}, jssun.awt.image, "OffScreenImageSource", null, java.awt.image.ImageProducer);
+Clazz_makeConstructor (c$, 
+function (image, properties) {
+this.image = image;
+if (properties != null) {
+this.properties = properties;
+} else {
+this.properties =  new java.util.Hashtable ();
+}this.width = image.getWidth ();
+this.height = image.getHeight ();
+}, "java.awt.image.BufferedImage,java.util.Hashtable");
+Clazz_makeConstructor (c$, 
+function (image) {
+this.construct (image, null);
+}, "java.awt.image.BufferedImage");
+Clazz_overrideMethod (c$, "addConsumer", 
+function (ic) {
+this.theConsumer = ic;
+this.produce ();
+}, "java.awt.image.ImageConsumer");
+Clazz_overrideMethod (c$, "isConsumer", 
+function (ic) {
+return (ic === this.theConsumer);
+}, "java.awt.image.ImageConsumer");
+Clazz_overrideMethod (c$, "removeConsumer", 
+function (ic) {
+if (this.theConsumer === ic) {
+this.theConsumer = null;
+}}, "java.awt.image.ImageConsumer");
+Clazz_overrideMethod (c$, "startProduction", 
+function (ic) {
+this.addConsumer (ic);
+}, "java.awt.image.ImageConsumer");
+Clazz_overrideMethod (c$, "requestTopDownLeftRightResend", 
+function (ic) {
+}, "java.awt.image.ImageConsumer");
+Clazz_defineMethod (c$, "sendPixels", 
+ function () {
+var cm = this.image.getColorModel ();
+});
+Clazz_defineMethod (c$, "produce", 
+ function () {
+try {
+this.theConsumer.setDimensions (this.image.getWidth (), this.image.getHeight ());
+this.theConsumer.setProperties (this.properties);
+this.sendPixels ();
+this.theConsumer.imageComplete (2);
+} catch (e) {
+if (Clazz_exceptionOf (e, NullPointerException)) {
+if (this.theConsumer != null) {
+this.theConsumer.imageComplete (1);
+}} else {
+throw e;
+}
+}
+});
+});
+Clazz_declarePackage ("java.awt.image");
+Clazz_load (["java.awt.image.Raster"], "java.awt.image.WritableRaster", ["java.lang.ArrayIndexOutOfBoundsException", "java.awt.Point", "$.Rectangle", "java.awt.image.RasterFormatException"], function () {
+c$ = Clazz_declareType (java.awt.image, "WritableRaster", java.awt.image.Raster);
+Clazz_defineMethod (c$, "setParams", 
+function (model, dataBuffer, origin) {
+}, "java.awt.image.SampleModel,java.awt.image.DataBuffer,java.awt.Point");
+Clazz_makeConstructor (c$, 
+function () {
+Clazz_superConstructor (this, java.awt.image.WritableRaster, []);
+});
+Clazz_makeConstructor (c$, 
+function (sampleModel, origin) {
+Clazz_superConstructor (this, java.awt.image.WritableRaster, []);
+this.setRaster (sampleModel, sampleModel.createDataBuffer (),  new java.awt.Rectangle (origin.x, origin.y, sampleModel.getWidth (), sampleModel.getHeight ()), origin, null);
+}, "java.awt.image.SampleModel,java.awt.Point");
+Clazz_makeConstructor (c$, 
+function (sampleModel, dataBuffer, origin) {
+Clazz_superConstructor (this, java.awt.image.WritableRaster, []);
+this.setRaster (sampleModel, dataBuffer,  new java.awt.Rectangle (origin.x, origin.y, sampleModel.getWidth (), sampleModel.getHeight ()), origin, null);
+}, "java.awt.image.SampleModel,java.awt.image.DataBuffer,java.awt.Point");
+Clazz_makeConstructor (c$, 
+function (sampleModel, dataBuffer, aRegion, sampleModelTranslate, parent) {
+Clazz_superConstructor (this, java.awt.image.WritableRaster, []);
+this.setRaster (sampleModel, dataBuffer, aRegion, sampleModelTranslate, parent);
+}, "java.awt.image.SampleModel,java.awt.image.DataBuffer,java.awt.Rectangle,java.awt.Point,java.awt.image.Raster");
+Clazz_defineMethod (c$, "getWritableParent", 
+function () {
+return this.parent;
+});
+Clazz_defineMethod (c$, "createWritableTranslatedChild", 
+function (childMinX, childMinY) {
+return this.createWritableChild (this.minX, this.minY, this.width, this.height, childMinX, childMinY, null);
+}, "~N,~N");
+Clazz_defineMethod (c$, "createWritableChild", 
+function (parentX, parentY, w, h, childMinX, childMinY, bandList) {
+if (parentX < this.minX) {
+throw  new java.awt.image.RasterFormatException ("parentX lies outside raster");
+}if (parentY < this.minY) {
+throw  new java.awt.image.RasterFormatException ("parentY lies outside raster");
+}if ((parentX + w < parentX) || (parentX + w > this.width + this.minX)) {
+throw  new java.awt.image.RasterFormatException ("(parentX + width) is outside raster");
+}if ((parentY + h < parentY) || (parentY + h > this.height + this.minY)) {
+throw  new java.awt.image.RasterFormatException ("(parentY + height) is outside raster");
+}var sm;
+if (bandList != null) {
+sm = this.sampleModel.createSubsetSampleModel (bandList);
+} else {
+sm = this.sampleModel;
+}var deltaX = childMinX - parentX;
+var deltaY = childMinY - parentY;
+return  new java.awt.image.WritableRaster (sm, this.getDataBuffer (),  new java.awt.Rectangle (childMinX, childMinY, w, h),  new java.awt.Point (this.sampleModelTranslateX + deltaX, this.sampleModelTranslateY + deltaY), this);
+}, "~N,~N,~N,~N,~N,~N,~A");
+Clazz_defineMethod (c$, "setDataElements", 
+function (x, y, inData) {
+if (Clazz_instanceOf (inData, java.awt.image.Raster)) {
+this.setDataElementsRaster (x, y, inData);
+} else {
+this.sampleModel.setDataElements (x - this.sampleModelTranslateX, y - this.sampleModelTranslateY, inData, this.dataBuffer);
+}}, "~N,~N,~O");
+Clazz_defineMethod (c$, "setDataElementsRaster", 
+function (x, y, inRaster) {
+var dstOffX = x + inRaster.getMinX ();
+var dstOffY = y + inRaster.getMinY ();
+var width = inRaster.getWidth ();
+var height = inRaster.getHeight ();
+if ((dstOffX < this.minX) || (dstOffY < this.minY) || (dstOffX + width > this.minX + this.width) || (dstOffY + height > this.minY + this.height)) {
+throw  new ArrayIndexOutOfBoundsException ("Coordinate out of bounds!");
+}var srcOffX = inRaster.getMinX ();
+var srcOffY = inRaster.getMinY ();
+var tdata = null;
+for (var startY = 0; startY < height; startY++) {
+tdata = inRaster.getDataElements (srcOffX, srcOffY + startY, width, 1, tdata);
+this.setDataElements (dstOffX, dstOffY + startY, width, 1, tdata);
+}
+}, "~N,~N,java.awt.image.Raster");
+Clazz_defineMethod (c$, "setDataElements", 
+function (x, y, w, h, inData) {
+this.sampleModel.setDataElements (x - this.sampleModelTranslateX, y - this.sampleModelTranslateY, w, h, inData, this.dataBuffer);
+}, "~N,~N,~N,~N,~O");
+Clazz_defineMethod (c$, "setRect", 
+function (srcRaster) {
+this.setRect (0, 0, srcRaster);
+}, "java.awt.image.Raster");
+Clazz_defineMethod (c$, "setRect", 
+function (dx, dy, srcRaster) {
+var width = srcRaster.getWidth ();
+var height = srcRaster.getHeight ();
+var srcOffX = srcRaster.getMinX ();
+var srcOffY = srcRaster.getMinY ();
+var dstOffX = dx + srcOffX;
+var dstOffY = dy + srcOffY;
+if (dstOffX < this.minX) {
+var skipX = this.minX - dstOffX;
+width -= skipX;
+srcOffX += skipX;
+dstOffX = this.minX;
+}if (dstOffY < this.minY) {
+var skipY = this.minY - dstOffY;
+height -= skipY;
+srcOffY += skipY;
+dstOffY = this.minY;
+}if (dstOffX + width > this.minX + this.width) {
+width = this.minX + this.width - dstOffX;
+}if (dstOffY + height > this.minY + this.height) {
+height = this.minY + this.height - dstOffY;
+}if (width <= 0 || height <= 0) {
+return;
+}switch (srcRaster.getSampleModel ().getDataType ()) {
+case 0:
+case 3:
+var iData = null;
+for (var startY = 0; startY < height; startY++) {
+iData = srcRaster.getPixels (srcOffX, srcOffY + startY, width, 1, iData);
+this.setPixels (dstOffX, dstOffY + startY, width, 1, iData);
+}
+break;
+}
+}, "~N,~N,java.awt.image.Raster");
+Clazz_defineMethod (c$, "setPixel", 
+function (x, y, iArray) {
+this.sampleModel.setPixel (x - this.sampleModelTranslateX, y - this.sampleModelTranslateY, iArray, this.dataBuffer);
+}, "~N,~N,~A");
+Clazz_defineMethod (c$, "setPixel", 
+function (x, y, fArray) {
+this.sampleModel.setPixel (x - this.sampleModelTranslateX, y - this.sampleModelTranslateY, fArray, this.dataBuffer);
+}, "~N,~N,~A");
+Clazz_defineMethod (c$, "setPixel", 
+function (x, y, dArray) {
+this.sampleModel.setPixel (x - this.sampleModelTranslateX, y - this.sampleModelTranslateY, dArray, this.dataBuffer);
+}, "~N,~N,~A");
+Clazz_defineMethod (c$, "setPixels", 
+function (x, y, w, h, iArray) {
+this.sampleModel.setPixels (x - this.sampleModelTranslateX, y - this.sampleModelTranslateY, w, h, iArray, this.dataBuffer);
+}, "~N,~N,~N,~N,~A");
+Clazz_defineMethod (c$, "setPixels", 
+function (x, y, w, h, fArray) {
+this.sampleModel.setPixels (x - this.sampleModelTranslateX, y - this.sampleModelTranslateY, w, h, fArray, this.dataBuffer);
+}, "~N,~N,~N,~N,~A");
+Clazz_defineMethod (c$, "setPixels", 
+function (x, y, w, h, dArray) {
+this.sampleModel.setPixels (x - this.sampleModelTranslateX, y - this.sampleModelTranslateY, w, h, dArray, this.dataBuffer);
+}, "~N,~N,~N,~N,~A");
+Clazz_defineMethod (c$, "setSample", 
+function (x, y, b, s) {
+this.sampleModel.setSample (x - this.sampleModelTranslateX, y - this.sampleModelTranslateY, b, s, this.dataBuffer);
+}, "~N,~N,~N,~N");
+Clazz_defineMethod (c$, "setSample", 
+function (x, y, b, s) {
+this.sampleModel.setSample (x - this.sampleModelTranslateX, y - this.sampleModelTranslateY, b, s, this.dataBuffer);
+}, "~N,~N,~N,~N");
+Clazz_defineMethod (c$, "setSample", 
+function (x, y, b, s) {
+this.sampleModel.setSample (x - this.sampleModelTranslateX, y - this.sampleModelTranslateY, b, s, this.dataBuffer);
+}, "~N,~N,~N,~N");
+Clazz_defineMethod (c$, "setSamples", 
+function (x, y, w, h, b, iArray) {
+this.sampleModel.setSamples (x - this.sampleModelTranslateX, y - this.sampleModelTranslateY, w, h, b, iArray, this.dataBuffer);
+}, "~N,~N,~N,~N,~N,~A");
+Clazz_defineMethod (c$, "setSamples", 
+function (x, y, w, h, b, fArray) {
+this.sampleModel.setSamples (x - this.sampleModelTranslateX, y - this.sampleModelTranslateY, w, h, b, fArray, this.dataBuffer);
+}, "~N,~N,~N,~N,~N,~A");
+Clazz_defineMethod (c$, "setSamples", 
+function (x, y, w, h, b, dArray) {
+this.sampleModel.setSamples (x - this.sampleModelTranslateX, y - this.sampleModelTranslateY, w, h, b, dArray, this.dataBuffer);
+}, "~N,~N,~N,~N,~N,~A");
+});
+Clazz_declarePackage ("jssun.java2d.loops");
+Clazz_load (null, "jssun.java2d.loops.CompositeType", ["java.lang.InternalError"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.uniqueID = 0;
+this.desc = null;
+this.next = null;
+Clazz_instantialize (this, arguments);
+}, jssun.java2d.loops, "CompositeType");
+Clazz_defineMethod (c$, "deriveSubType", 
+function (desc) {
+return  new jssun.java2d.loops.CompositeType (this, desc);
+}, "~S");
+c$.forAlphaComposite = Clazz_defineMethod (c$, "forAlphaComposite", 
+function (ac) {
+switch (ac.getRule ()) {
+case 1:
+return jssun.java2d.loops.CompositeType.Clear;
+case 2:
+if (ac.getAlpha () >= 1.0) {
+return jssun.java2d.loops.CompositeType.SrcNoEa;
+} else {
+return jssun.java2d.loops.CompositeType.Src;
+}case 9:
+return jssun.java2d.loops.CompositeType.Dst;
+case 3:
+if (ac.getAlpha () >= 1.0) {
+return jssun.java2d.loops.CompositeType.SrcOverNoEa;
+} else {
+return jssun.java2d.loops.CompositeType.SrcOver;
+}case 4:
+return jssun.java2d.loops.CompositeType.DstOver;
+case 5:
+return jssun.java2d.loops.CompositeType.SrcIn;
+case 6:
+return jssun.java2d.loops.CompositeType.DstIn;
+case 7:
+return jssun.java2d.loops.CompositeType.SrcOut;
+case 8:
+return jssun.java2d.loops.CompositeType.DstOut;
+case 10:
+return jssun.java2d.loops.CompositeType.SrcAtop;
+case 11:
+return jssun.java2d.loops.CompositeType.DstAtop;
+case 12:
+return jssun.java2d.loops.CompositeType.AlphaXor;
+default:
+throw  new InternalError ("Unrecognized alpha rule");
+}
+}, "java.awt.AlphaComposite");
+Clazz_makeConstructor (c$, 
+ function (parent, desc) {
+this.next = parent;
+this.desc = desc;
+this.uniqueID = jssun.java2d.loops.CompositeType.makeUniqueID ();
+}, "jssun.java2d.loops.CompositeType,~S");
+c$.makeUniqueID = Clazz_defineMethod (c$, "makeUniqueID", 
+ function () {
+if (jssun.java2d.loops.CompositeType.unusedUID > 255) {
+throw  new InternalError ("composite type id overflow");
+}return jssun.java2d.loops.CompositeType.unusedUID++;
+});
+Clazz_defineMethod (c$, "getUniqueID", 
+function () {
+return this.uniqueID;
+});
+Clazz_defineMethod (c$, "getDescriptor", 
+function () {
+return this.desc;
+});
+Clazz_defineMethod (c$, "getSuperType", 
+function () {
+return this.next;
+});
+Clazz_overrideMethod (c$, "hashCode", 
+function () {
+return this.desc.hashCode ();
+});
+Clazz_defineMethod (c$, "isDerivedFrom", 
+function (other) {
+var comptype = this;
+do {
+if (comptype.desc === other.desc) {
+return true;
+}comptype = comptype.next;
+} while (comptype != null);
+return false;
+}, "jssun.java2d.loops.CompositeType");
+Clazz_overrideMethod (c$, "equals", 
+function (o) {
+if (Clazz_instanceOf (o, jssun.java2d.loops.CompositeType)) {
+return ((o).uniqueID == this.uniqueID);
+}return false;
+}, "~O");
+Clazz_overrideMethod (c$, "toString", 
+function () {
+return this.desc;
+});
+Clazz_defineStatics (c$,
+"DESC_ANY", "Any CompositeContext",
+"DESC_XOR", "XOR mode",
+"DESC_CLEAR", "Porter-Duff Clear",
+"DESC_SRC", "Porter-Duff Src",
+"DESC_DST", "Porter-Duff Dst",
+"DESC_SRC_OVER", "Porter-Duff Src Over Dst",
+"DESC_DST_OVER", "Porter-Duff Dst Over Src",
+"DESC_SRC_IN", "Porter-Duff Src In Dst",
+"DESC_DST_IN", "Porter-Duff Dst In Src",
+"DESC_SRC_OUT", "Porter-Duff Src HeldOutBy Dst",
+"DESC_DST_OUT", "Porter-Duff Dst HeldOutBy Src",
+"DESC_SRC_ATOP", "Porter-Duff Src Atop Dst",
+"DESC_DST_ATOP", "Porter-Duff Dst Atop Src",
+"DESC_ALPHA_XOR", "Porter-Duff Xor",
+"DESC_SRC_NO_EA", "Porter-Duff Src, No Extra Alpha",
+"DESC_SRC_OVER_NO_EA", "Porter-Duff SrcOverDst, No Extra Alpha",
+"DESC_ANY_ALPHA", "Any AlphaComposite Rule");
+c$.Any = c$.prototype.Any =  new jssun.java2d.loops.CompositeType (null, "Any CompositeContext");
+c$.General = c$.prototype.General = jssun.java2d.loops.CompositeType.Any;
+c$.AnyAlpha = c$.prototype.AnyAlpha = jssun.java2d.loops.CompositeType.General.deriveSubType ("Any AlphaComposite Rule");
+c$.Xor = c$.prototype.Xor = jssun.java2d.loops.CompositeType.General.deriveSubType ("XOR mode");
+c$.Clear = c$.prototype.Clear = jssun.java2d.loops.CompositeType.AnyAlpha.deriveSubType ("Porter-Duff Clear");
+c$.Src = c$.prototype.Src = jssun.java2d.loops.CompositeType.AnyAlpha.deriveSubType ("Porter-Duff Src");
+c$.Dst = c$.prototype.Dst = jssun.java2d.loops.CompositeType.AnyAlpha.deriveSubType ("Porter-Duff Dst");
+c$.SrcOver = c$.prototype.SrcOver = jssun.java2d.loops.CompositeType.AnyAlpha.deriveSubType ("Porter-Duff Src Over Dst");
+c$.DstOver = c$.prototype.DstOver = jssun.java2d.loops.CompositeType.AnyAlpha.deriveSubType ("Porter-Duff Dst Over Src");
+c$.SrcIn = c$.prototype.SrcIn = jssun.java2d.loops.CompositeType.AnyAlpha.deriveSubType ("Porter-Duff Src In Dst");
+c$.DstIn = c$.prototype.DstIn = jssun.java2d.loops.CompositeType.AnyAlpha.deriveSubType ("Porter-Duff Dst In Src");
+c$.SrcOut = c$.prototype.SrcOut = jssun.java2d.loops.CompositeType.AnyAlpha.deriveSubType ("Porter-Duff Src HeldOutBy Dst");
+c$.DstOut = c$.prototype.DstOut = jssun.java2d.loops.CompositeType.AnyAlpha.deriveSubType ("Porter-Duff Dst HeldOutBy Src");
+c$.SrcAtop = c$.prototype.SrcAtop = jssun.java2d.loops.CompositeType.AnyAlpha.deriveSubType ("Porter-Duff Src Atop Dst");
+c$.DstAtop = c$.prototype.DstAtop = jssun.java2d.loops.CompositeType.AnyAlpha.deriveSubType ("Porter-Duff Dst Atop Src");
+c$.AlphaXor = c$.prototype.AlphaXor = jssun.java2d.loops.CompositeType.AnyAlpha.deriveSubType ("Porter-Duff Xor");
+c$.SrcNoEa = c$.prototype.SrcNoEa = jssun.java2d.loops.CompositeType.Src.deriveSubType ("Porter-Duff Src, No Extra Alpha");
+c$.SrcOverNoEa = c$.prototype.SrcOverNoEa = jssun.java2d.loops.CompositeType.SrcOver.deriveSubType ("Porter-Duff SrcOverDst, No Extra Alpha");
+Clazz_defineStatics (c$,
+"unusedUID", 1);
+});
+Clazz_declarePackage ("awt2swing");
+Clazz_load (["javax.swing.JScrollPane"], "awt2swing.ScrollPane", null, function () {
+c$ = Clazz_declareType (awt2swing, "ScrollPane", javax.swing.JScrollPane);
+});
+Clazz_declarePackage ("javax.swing");
+Clazz_load (["javax.swing.JComponent", "$.JScrollBar", "$.ScrollPaneConstants", "javax.swing.plaf.UIResource"], "javax.swing.JScrollPane", ["java.lang.Boolean", "$.ClassCastException", "$.IllegalArgumentException", "java.awt.Point", "$.Rectangle", "javax.swing.JViewport", "$.ScrollPaneLayout", "$.Scrollable", "$.SwingUtilities", "$.UIManager"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.viewportBorder = null;
+this.verticalScrollBarPolicy = 20;
+this.horizontalScrollBarPolicy = 30;
+this.viewport = null;
+this.verticalScrollBar = null;
+this.horizontalScrollBar = null;
+this.rowHeader = null;
+this.columnHeader = null;
+this.lowerLeft = null;
+this.lowerRight = null;
+this.upperLeft = null;
+this.upperRight = null;
+this.wheelScrollState = true;
+if (!Clazz_isClassDefined ("javax.swing.JScrollPane.ScrollBar")) {
+javax.swing.JScrollPane.$JScrollPane$ScrollBar$ ();
+}
+Clazz_instantialize (this, arguments);
+}, javax.swing, "JScrollPane", javax.swing.JComponent, javax.swing.ScrollPaneConstants);
+Clazz_makeConstructor (c$, 
+function (view, vsbPolicy, hsbPolicy) {
+Clazz_superConstructor (this, javax.swing.JScrollPane, []);
+this.setLayout ( new javax.swing.ScrollPaneLayout.UIResource ());
+this.setVerticalScrollBarPolicy (vsbPolicy);
+this.setHorizontalScrollBarPolicy (hsbPolicy);
+this.setViewport (this.createViewport ());
+this.setVerticalScrollBar (this.createVerticalScrollBar ());
+this.setHorizontalScrollBar (this.createHorizontalScrollBar ());
+if (view != null) {
+this.setViewportView (view);
+}this.setUIProperty ("opaque", new Boolean (true));
+this.updateUI ();
+if (!this.getComponentOrientation ().isLeftToRight ()) {
+this.viewport.setViewPosition ( new java.awt.Point (2147483647, 0));
+}}, "java.awt.Component,~N,~N");
+Clazz_makeConstructor (c$, 
+function (view) {
+this.construct (view, 20, 30);
+}, "java.awt.Component");
+Clazz_makeConstructor (c$, 
+function (vsbPolicy, hsbPolicy) {
+this.construct (null, vsbPolicy, hsbPolicy);
+}, "~N,~N");
+Clazz_makeConstructor (c$, 
+function () {
+this.construct (null, 20, 30);
+});
+Clazz_overrideMethod (c$, "getUI", 
+function () {
+return this.ui;
+});
+Clazz_overrideMethod (c$, "updateUI", 
+function () {
+this.setUI (javax.swing.UIManager.getUI (this));
+});
+Clazz_overrideMethod (c$, "getUIClassID", 
+function () {
+return "ScrollPaneUI";
+});
+Clazz_defineMethod (c$, "setLayout", 
+function (layout) {
+if (Clazz_instanceOf (layout, javax.swing.ScrollPaneLayout)) {
+Clazz_superCall (this, javax.swing.JScrollPane, "setLayout", [layout]);
+(layout).syncWithScrollPane (this);
+} else if (layout == null) {
+Clazz_superCall (this, javax.swing.JScrollPane, "setLayout", [layout]);
+} else {
+var s = "layout of JScrollPane must be a ScrollPaneLayout";
+throw  new ClassCastException (s);
+}}, "java.awt.LayoutManager");
+Clazz_overrideMethod (c$, "isValidateRoot", 
+function () {
+return true;
+});
+Clazz_defineMethod (c$, "getVerticalScrollBarPolicy", 
+function () {
+return this.verticalScrollBarPolicy;
+});
+Clazz_defineMethod (c$, "setVerticalScrollBarPolicy", 
+function (policy) {
+switch (policy) {
+case 20:
+case 21:
+case 22:
+break;
+default:
+throw  new IllegalArgumentException ("invalid verticalScrollBarPolicy");
+}
+var old = this.verticalScrollBarPolicy;
+this.verticalScrollBarPolicy = policy;
+this.firePropertyChangeInt ("verticalScrollBarPolicy", old, policy);
+this.revalidate ();
+this.repaint ();
+}, "~N");
+Clazz_defineMethod (c$, "getHorizontalScrollBarPolicy", 
+function () {
+return this.horizontalScrollBarPolicy;
+});
+Clazz_defineMethod (c$, "setHorizontalScrollBarPolicy", 
+function (policy) {
+switch (policy) {
+case 30:
+case 31:
+case 32:
+break;
+default:
+throw  new IllegalArgumentException ("invalid horizontalScrollBarPolicy");
+}
+var old = this.horizontalScrollBarPolicy;
+this.horizontalScrollBarPolicy = policy;
+this.firePropertyChangeInt ("horizontalScrollBarPolicy", old, policy);
+this.revalidate ();
+this.repaint ();
+}, "~N");
+Clazz_defineMethod (c$, "getViewportBorder", 
+function () {
+return this.viewportBorder;
+});
+Clazz_defineMethod (c$, "setViewportBorder", 
+function (viewportBorder) {
+var oldValue = this.viewportBorder;
+this.viewportBorder = viewportBorder;
+this.firePropertyChangeObject ("viewportBorder", oldValue, viewportBorder);
+}, "javax.swing.border.Border");
+Clazz_defineMethod (c$, "getViewportBorderBounds", 
+function () {
+var borderR =  new java.awt.Rectangle (this.getSize ());
+var insets = this.getInsets ();
+borderR.x = insets.left;
+borderR.y = insets.top;
+borderR.width -= insets.left + insets.right;
+borderR.height -= insets.top + insets.bottom;
+var leftToRight = javax.swing.SwingUtilities.isLeftToRight (this);
+var colHead = this.getColumnHeader ();
+if ((colHead != null) && (colHead.isVisible ())) {
+var colHeadHeight = colHead.getHeight ();
+borderR.y += colHeadHeight;
+borderR.height -= colHeadHeight;
+}var rowHead = this.getRowHeader ();
+if ((rowHead != null) && (rowHead.isVisible ())) {
+var rowHeadWidth = rowHead.getWidth ();
+if (leftToRight) {
+borderR.x += rowHeadWidth;
+}borderR.width -= rowHeadWidth;
+}var vsb = this.getVerticalScrollBar ();
+if ((vsb != null) && (vsb.isVisible ())) {
+var vsbWidth = vsb.getWidth ();
+if (!leftToRight) {
+borderR.x += vsbWidth;
+}borderR.width -= vsbWidth;
+}var hsb = this.getHorizontalScrollBar ();
+if ((hsb != null) && (hsb.isVisible ())) {
+borderR.height -= hsb.getHeight ();
+}return borderR;
+});
+Clazz_defineMethod (c$, "createHorizontalScrollBar", 
+function () {
+return Clazz_innerTypeInstance (javax.swing.JScrollPane.ScrollBar, this, null, 0);
+});
+Clazz_defineMethod (c$, "getHorizontalScrollBar", 
+function () {
+return this.horizontalScrollBar;
+});
+Clazz_defineMethod (c$, "setHorizontalScrollBar", 
+function (horizontalScrollBar) {
+var old = this.getHorizontalScrollBar ();
+this.horizontalScrollBar = horizontalScrollBar;
+if (horizontalScrollBar != null) {
+this.add (horizontalScrollBar, "HORIZONTAL_SCROLLBAR");
+} else if (old != null) {
+this.remove (old);
+}this.firePropertyChangeObject ("horizontalScrollBar", old, horizontalScrollBar);
+this.revalidate ();
+this.repaint ();
+}, "javax.swing.JScrollBar");
+Clazz_defineMethod (c$, "createVerticalScrollBar", 
+function () {
+return Clazz_innerTypeInstance (javax.swing.JScrollPane.ScrollBar, this, null, 1);
+});
+Clazz_defineMethod (c$, "getVerticalScrollBar", 
+function () {
+return this.verticalScrollBar;
+});
+Clazz_defineMethod (c$, "setVerticalScrollBar", 
+function (verticalScrollBar) {
+var old = this.getVerticalScrollBar ();
+this.verticalScrollBar = verticalScrollBar;
+this.add (verticalScrollBar, "VERTICAL_SCROLLBAR");
+this.firePropertyChangeObject ("verticalScrollBar", old, verticalScrollBar);
+this.revalidate ();
+this.repaint ();
+}, "javax.swing.JScrollBar");
+Clazz_defineMethod (c$, "createViewport", 
+function () {
+return  new javax.swing.JViewport ();
+});
+Clazz_defineMethod (c$, "getViewport", 
+function () {
+return this.viewport;
+});
+Clazz_defineMethod (c$, "setViewport", 
+function (viewport) {
+var old = this.getViewport ();
+this.viewport = viewport;
+if (viewport != null) {
+this.add (viewport, "VIEWPORT");
+} else if (old != null) {
+this.remove (old);
+}this.firePropertyChangeObject ("viewport", old, viewport);
+this.revalidate ();
+this.repaint ();
+}, "javax.swing.JViewport");
+Clazz_defineMethod (c$, "setViewportView", 
+function (view) {
+if (this.getViewport () == null) {
+this.setViewport (this.createViewport ());
+}this.getViewport ().setView (view);
+}, "java.awt.Component");
+Clazz_defineMethod (c$, "getRowHeader", 
+function () {
+return this.rowHeader;
+});
+Clazz_defineMethod (c$, "setRowHeader", 
+function (rowHeader) {
+var old = this.getRowHeader ();
+this.rowHeader = rowHeader;
+if (rowHeader != null) {
+this.add (rowHeader, "ROW_HEADER");
+} else if (old != null) {
+this.remove (old);
+}this.firePropertyChangeObject ("rowHeader", old, rowHeader);
+this.revalidate ();
+this.repaint ();
+}, "javax.swing.JViewport");
+Clazz_defineMethod (c$, "setRowHeaderView", 
+function (view) {
+if (this.getRowHeader () == null) {
+this.setRowHeader (this.createViewport ());
+}this.getRowHeader ().setView (view);
+}, "java.awt.Component");
+Clazz_defineMethod (c$, "getColumnHeader", 
+function () {
+return this.columnHeader;
+});
+Clazz_defineMethod (c$, "setColumnHeader", 
+function (columnHeader) {
+var old = this.getColumnHeader ();
+this.columnHeader = columnHeader;
+if (columnHeader != null) {
+this.add (columnHeader, "COLUMN_HEADER");
+} else if (old != null) {
+this.remove (old);
+}this.firePropertyChangeObject ("columnHeader", old, columnHeader);
+this.revalidate ();
+this.repaint ();
+}, "javax.swing.JViewport");
+Clazz_defineMethod (c$, "setColumnHeaderView", 
+function (view) {
+if (this.getColumnHeader () == null) {
+this.setColumnHeader (this.createViewport ());
+}this.getColumnHeader ().setView (view);
+}, "java.awt.Component");
+Clazz_defineMethod (c$, "getCorner", 
+function (key) {
+var isLeftToRight = this.getComponentOrientation ().isLeftToRight ();
+if (key.equals ("LOWER_LEADING_CORNER")) {
+key = isLeftToRight ? "LOWER_LEFT_CORNER" : "LOWER_RIGHT_CORNER";
+} else if (key.equals ("LOWER_TRAILING_CORNER")) {
+key = isLeftToRight ? "LOWER_RIGHT_CORNER" : "LOWER_LEFT_CORNER";
+} else if (key.equals ("UPPER_LEADING_CORNER")) {
+key = isLeftToRight ? "UPPER_LEFT_CORNER" : "UPPER_RIGHT_CORNER";
+} else if (key.equals ("UPPER_TRAILING_CORNER")) {
+key = isLeftToRight ? "UPPER_RIGHT_CORNER" : "UPPER_LEFT_CORNER";
+}if (key.equals ("LOWER_LEFT_CORNER")) {
+return this.lowerLeft;
+} else if (key.equals ("LOWER_RIGHT_CORNER")) {
+return this.lowerRight;
+} else if (key.equals ("UPPER_LEFT_CORNER")) {
+return this.upperLeft;
+} else if (key.equals ("UPPER_RIGHT_CORNER")) {
+return this.upperRight;
+} else {
+return null;
+}}, "~S");
+Clazz_defineMethod (c$, "setCorner", 
+function (key, corner) {
+var old;
+var isLeftToRight = this.getComponentOrientation ().isLeftToRight ();
+if (key.equals ("LOWER_LEADING_CORNER")) {
+key = isLeftToRight ? "LOWER_LEFT_CORNER" : "LOWER_RIGHT_CORNER";
+} else if (key.equals ("LOWER_TRAILING_CORNER")) {
+key = isLeftToRight ? "LOWER_RIGHT_CORNER" : "LOWER_LEFT_CORNER";
+} else if (key.equals ("UPPER_LEADING_CORNER")) {
+key = isLeftToRight ? "UPPER_LEFT_CORNER" : "UPPER_RIGHT_CORNER";
+} else if (key.equals ("UPPER_TRAILING_CORNER")) {
+key = isLeftToRight ? "UPPER_RIGHT_CORNER" : "UPPER_LEFT_CORNER";
+}if (key.equals ("LOWER_LEFT_CORNER")) {
+old = this.lowerLeft;
+this.lowerLeft = corner;
+} else if (key.equals ("LOWER_RIGHT_CORNER")) {
+old = this.lowerRight;
+this.lowerRight = corner;
+} else if (key.equals ("UPPER_LEFT_CORNER")) {
+old = this.upperLeft;
+this.upperLeft = corner;
+} else if (key.equals ("UPPER_RIGHT_CORNER")) {
+old = this.upperRight;
+this.upperRight = corner;
+} else {
+throw  new IllegalArgumentException ("invalid corner key");
+}if (old != null) {
+this.remove (old);
+}if (corner != null) {
+this.add (corner, key);
+}this.firePropertyChangeObject (key, old, corner);
+this.revalidate ();
+this.repaint ();
+}, "~S,java.awt.Component");
+Clazz_defineMethod (c$, "setComponentOrientation", 
+function (co) {
+Clazz_superCall (this, javax.swing.JScrollPane, "setComponentOrientation", [co]);
+if (this.verticalScrollBar != null) this.verticalScrollBar.setComponentOrientation (co);
+if (this.horizontalScrollBar != null) this.horizontalScrollBar.setComponentOrientation (co);
+}, "java.awt.ComponentOrientation");
+Clazz_defineMethod (c$, "isWheelScrollingEnabled", 
+function () {
+return this.wheelScrollState;
+});
+Clazz_defineMethod (c$, "setWheelScrollingEnabled", 
+function (handleWheel) {
+var old = this.wheelScrollState;
+this.wheelScrollState = handleWheel;
+this.firePropertyChangeBool ("wheelScrollingEnabled", old, handleWheel);
+}, "~B");
+Clazz_defineMethod (c$, "paramString", 
+function () {
+var viewportBorderString = (this.viewportBorder != null ? this.viewportBorder.toString () : "");
+var viewportString = (this.viewport != null ? this.viewport.toString () : "");
+var verticalScrollBarPolicyString;
+if (this.verticalScrollBarPolicy == 20) {
+verticalScrollBarPolicyString = "VERTICAL_SCROLLBAR_AS_NEEDED";
+} else if (this.verticalScrollBarPolicy == 21) {
+verticalScrollBarPolicyString = "VERTICAL_SCROLLBAR_NEVER";
+} else if (this.verticalScrollBarPolicy == 22) {
+verticalScrollBarPolicyString = "VERTICAL_SCROLLBAR_ALWAYS";
+} else verticalScrollBarPolicyString = "";
+var horizontalScrollBarPolicyString;
+if (this.horizontalScrollBarPolicy == 30) {
+horizontalScrollBarPolicyString = "HORIZONTAL_SCROLLBAR_AS_NEEDED";
+} else if (this.horizontalScrollBarPolicy == 31) {
+horizontalScrollBarPolicyString = "HORIZONTAL_SCROLLBAR_NEVER";
+} else if (this.horizontalScrollBarPolicy == 32) {
+horizontalScrollBarPolicyString = "HORIZONTAL_SCROLLBAR_ALWAYS";
+} else horizontalScrollBarPolicyString = "";
+var horizontalScrollBarString = (this.horizontalScrollBar != null ? this.horizontalScrollBar.toString () : "");
+var verticalScrollBarString = (this.verticalScrollBar != null ? this.verticalScrollBar.toString () : "");
+var columnHeaderString = (this.columnHeader != null ? this.columnHeader.toString () : "");
+var rowHeaderString = (this.rowHeader != null ? this.rowHeader.toString () : "");
+var lowerLeftString = (this.lowerLeft != null ? this.lowerLeft.toString () : "");
+var lowerRightString = (this.lowerRight != null ? this.lowerRight.toString () : "");
+var upperLeftString = (this.upperLeft != null ? this.upperLeft.toString () : "");
+var upperRightString = (this.upperRight != null ? this.upperRight.toString () : "");
+return Clazz_superCall (this, javax.swing.JScrollPane, "paramString", []) + ",columnHeader=" + columnHeaderString + ",horizontalScrollBar=" + horizontalScrollBarString + ",horizontalScrollBarPolicy=" + horizontalScrollBarPolicyString + ",lowerLeft=" + lowerLeftString + ",lowerRight=" + lowerRightString + ",rowHeader=" + rowHeaderString + ",upperLeft=" + upperLeftString + ",upperRight=" + upperRightString + ",verticalScrollBar=" + verticalScrollBarString + ",verticalScrollBarPolicy=" + verticalScrollBarPolicyString + ",viewport=" + viewportString + ",viewportBorder=" + viewportBorderString;
+});
+c$.$JScrollPane$ScrollBar$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_decorateAsClass (function () {
+Clazz_prepareCallback (this, arguments);
+this.unitIncrementSet = false;
+this.blockIncrementSet = false;
+Clazz_instantialize (this, arguments);
+}, javax.swing.JScrollPane, "ScrollBar", javax.swing.JScrollBar, javax.swing.plaf.UIResource);
+Clazz_makeConstructor (c$, 
+function (a) {
+Clazz_superConstructor (this, javax.swing.JScrollPane.ScrollBar, [a]);
+this.putClientProperty ("JScrollBar.fastWheelScrolling", Boolean.TRUE);
+}, "~N");
+Clazz_defineMethod (c$, "setUnitIncrement", 
+function (a) {
+this.unitIncrementSet = true;
+this.putClientProperty ("JScrollBar.fastWheelScrolling", null);
+Clazz_superCall (this, javax.swing.JScrollPane.ScrollBar, "setUnitIncrement", [a]);
+}, "~N");
+Clazz_defineMethod (c$, "getUnitIncrement", 
+function (a) {
+var b = this.b$["javax.swing.JScrollPane"].getViewport ();
+if (!this.unitIncrementSet && (b != null) && (Clazz_instanceOf (b.getView (), javax.swing.Scrollable))) {
+var c = (b.getView ());
+var d = b.getViewRect ();
+return c.getScrollableUnitIncrement (d, this.getOrientation (), a);
+} else {
+return Clazz_superCall (this, javax.swing.JScrollPane.ScrollBar, "getUnitIncrement", [a]);
+}}, "~N");
+Clazz_defineMethod (c$, "setBlockIncrement", 
+function (a) {
+this.blockIncrementSet = true;
+this.putClientProperty ("JScrollBar.fastWheelScrolling", null);
+Clazz_superCall (this, javax.swing.JScrollPane.ScrollBar, "setBlockIncrement", [a]);
+}, "~N");
+Clazz_defineMethod (c$, "getBlockIncrement", 
+function (a) {
+var b = this.b$["javax.swing.JScrollPane"].getViewport ();
+if (this.blockIncrementSet || b == null) {
+return Clazz_superCall (this, javax.swing.JScrollPane.ScrollBar, "getBlockIncrement", [a]);
+} else if (Clazz_instanceOf (b.getView (), javax.swing.Scrollable)) {
+var c = (b.getView ());
+var d = b.getViewRect ();
+return c.getScrollableBlockIncrement (d, this.getOrientation (), a);
+} else if (this.getOrientation () == 1) {
+return b.getExtentSize ().height;
+} else {
+return b.getExtentSize ().width;
+}}, "~N");
+c$ = Clazz_p0p ();
+};
+Clazz_defineStatics (c$,
+"$uiClassID", "ScrollPaneUI");
+});
+Clazz_declarePackage ("javax.swing");
+c$ = Clazz_declareInterface (javax.swing, "ScrollPaneConstants");
+Clazz_defineStatics (c$,
+"VIEWPORT", "VIEWPORT",
+"VERTICAL_SCROLLBAR", "VERTICAL_SCROLLBAR",
+"HORIZONTAL_SCROLLBAR", "HORIZONTAL_SCROLLBAR",
+"ROW_HEADER", "ROW_HEADER",
+"COLUMN_HEADER", "COLUMN_HEADER",
+"LOWER_LEFT_CORNER", "LOWER_LEFT_CORNER",
+"LOWER_RIGHT_CORNER", "LOWER_RIGHT_CORNER",
+"UPPER_LEFT_CORNER", "UPPER_LEFT_CORNER",
+"UPPER_RIGHT_CORNER", "UPPER_RIGHT_CORNER",
+"LOWER_LEADING_CORNER", "LOWER_LEADING_CORNER",
+"LOWER_TRAILING_CORNER", "LOWER_TRAILING_CORNER",
+"UPPER_LEADING_CORNER", "UPPER_LEADING_CORNER",
+"UPPER_TRAILING_CORNER", "UPPER_TRAILING_CORNER",
+"VERTICAL_SCROLLBAR_POLICY", "VERTICAL_SCROLLBAR_POLICY",
+"HORIZONTAL_SCROLLBAR_POLICY", "HORIZONTAL_SCROLLBAR_POLICY",
+"VERTICAL_SCROLLBAR_AS_NEEDED", 20,
+"VERTICAL_SCROLLBAR_NEVER", 21,
+"VERTICAL_SCROLLBAR_ALWAYS", 22,
+"HORIZONTAL_SCROLLBAR_AS_NEEDED", 30,
+"HORIZONTAL_SCROLLBAR_NEVER", 31,
+"HORIZONTAL_SCROLLBAR_ALWAYS", 32);
+Clazz_declarePackage ("javax.swing");
+Clazz_load (["java.awt.LayoutManager", "javax.swing.ScrollPaneConstants", "javax.swing.plaf.UIResource"], "javax.swing.ScrollPaneLayout", ["java.lang.IllegalArgumentException", "java.awt.Dimension", "$.Insets", "$.Rectangle", "javax.swing.Scrollable", "$.SwingUtilities", "$.UIManager"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.viewport = null;
+this.vsb = null;
+this.hsb = null;
+this.rowHead = null;
+this.colHead = null;
+this.lowerLeft = null;
+this.lowerRight = null;
+this.upperLeft = null;
+this.upperRight = null;
+this.vsbPolicy = 20;
+this.hsbPolicy = 30;
+Clazz_instantialize (this, arguments);
+}, javax.swing, "ScrollPaneLayout", null, [java.awt.LayoutManager, javax.swing.ScrollPaneConstants]);
+Clazz_defineMethod (c$, "syncWithScrollPane", 
+function (sp) {
+this.viewport = sp.getViewport ();
+this.vsb = sp.getVerticalScrollBar ();
+this.hsb = sp.getHorizontalScrollBar ();
+this.rowHead = sp.getRowHeader ();
+this.colHead = sp.getColumnHeader ();
+this.lowerLeft = sp.getCorner ("LOWER_LEFT_CORNER");
+this.lowerRight = sp.getCorner ("LOWER_RIGHT_CORNER");
+this.upperLeft = sp.getCorner ("UPPER_LEFT_CORNER");
+this.upperRight = sp.getCorner ("UPPER_RIGHT_CORNER");
+this.vsbPolicy = sp.getVerticalScrollBarPolicy ();
+this.hsbPolicy = sp.getHorizontalScrollBarPolicy ();
+}, "javax.swing.JScrollPane");
+Clazz_defineMethod (c$, "addSingletonComponent", 
+function (oldC, newC) {
+if ((oldC != null) && (oldC !== newC)) {
+oldC.getParent ().remove (oldC);
+}return newC;
+}, "java.awt.Component,java.awt.Component");
+Clazz_overrideMethod (c$, "addLayoutComponent", 
+function (s, c) {
+if (s.equals ("VIEWPORT")) {
+this.viewport = this.addSingletonComponent (this.viewport, c);
+} else if (s.equals ("VERTICAL_SCROLLBAR")) {
+this.vsb = this.addSingletonComponent (this.vsb, c);
+} else if (s.equals ("HORIZONTAL_SCROLLBAR")) {
+this.hsb = this.addSingletonComponent (this.hsb, c);
+} else if (s.equals ("ROW_HEADER")) {
+this.rowHead = this.addSingletonComponent (this.rowHead, c);
+} else if (s.equals ("COLUMN_HEADER")) {
+this.colHead = this.addSingletonComponent (this.colHead, c);
+} else if (s.equals ("LOWER_LEFT_CORNER")) {
+this.lowerLeft = this.addSingletonComponent (this.lowerLeft, c);
+} else if (s.equals ("LOWER_RIGHT_CORNER")) {
+this.lowerRight = this.addSingletonComponent (this.lowerRight, c);
+} else if (s.equals ("UPPER_LEFT_CORNER")) {
+this.upperLeft = this.addSingletonComponent (this.upperLeft, c);
+} else if (s.equals ("UPPER_RIGHT_CORNER")) {
+this.upperRight = this.addSingletonComponent (this.upperRight, c);
+} else {
+throw  new IllegalArgumentException ("invalid layout key " + s);
+}}, "~S,java.awt.Component");
+Clazz_overrideMethod (c$, "removeLayoutComponent", 
+function (c) {
+if (c === this.viewport) {
+this.viewport = null;
+} else if (c === this.vsb) {
+this.vsb = null;
+} else if (c === this.hsb) {
+this.hsb = null;
+} else if (c === this.rowHead) {
+this.rowHead = null;
+} else if (c === this.colHead) {
+this.colHead = null;
+} else if (c === this.lowerLeft) {
+this.lowerLeft = null;
+} else if (c === this.lowerRight) {
+this.lowerRight = null;
+} else if (c === this.upperLeft) {
+this.upperLeft = null;
+} else if (c === this.upperRight) {
+this.upperRight = null;
+}}, "java.awt.Component");
+Clazz_defineMethod (c$, "getVerticalScrollBarPolicy", 
+function () {
+return this.vsbPolicy;
+});
+Clazz_defineMethod (c$, "setVerticalScrollBarPolicy", 
+function (x) {
+switch (x) {
+case 20:
+case 21:
+case 22:
+this.vsbPolicy = x;
+break;
+default:
+throw  new IllegalArgumentException ("invalid verticalScrollBarPolicy");
+}
+}, "~N");
+Clazz_defineMethod (c$, "getHorizontalScrollBarPolicy", 
+function () {
+return this.hsbPolicy;
+});
+Clazz_defineMethod (c$, "setHorizontalScrollBarPolicy", 
+function (x) {
+switch (x) {
+case 30:
+case 31:
+case 32:
+this.hsbPolicy = x;
+break;
+default:
+throw  new IllegalArgumentException ("invalid horizontalScrollBarPolicy");
+}
+}, "~N");
+Clazz_defineMethod (c$, "getViewport", 
+function () {
+return this.viewport;
+});
+Clazz_defineMethod (c$, "getHorizontalScrollBar", 
+function () {
+return this.hsb;
+});
+Clazz_defineMethod (c$, "getVerticalScrollBar", 
+function () {
+return this.vsb;
+});
+Clazz_defineMethod (c$, "getRowHeader", 
+function () {
+return this.rowHead;
+});
+Clazz_defineMethod (c$, "getColumnHeader", 
+function () {
+return this.colHead;
+});
+Clazz_defineMethod (c$, "getCorner", 
+function (key) {
+if (key.equals ("LOWER_LEFT_CORNER")) {
+return this.lowerLeft;
+} else if (key.equals ("LOWER_RIGHT_CORNER")) {
+return this.lowerRight;
+} else if (key.equals ("UPPER_LEFT_CORNER")) {
+return this.upperLeft;
+} else if (key.equals ("UPPER_RIGHT_CORNER")) {
+return this.upperRight;
+} else {
+return null;
+}}, "~S");
+Clazz_overrideMethod (c$, "preferredLayoutSize", 
+function (parent) {
+var scrollPane = parent;
+this.vsbPolicy = scrollPane.getVerticalScrollBarPolicy ();
+this.hsbPolicy = scrollPane.getHorizontalScrollBarPolicy ();
+var insets = parent.getInsets ();
+var prefWidth = insets.left + insets.right;
+var prefHeight = insets.top + insets.bottom;
+var extentSize = null;
+var viewSize = null;
+var view = null;
+if (this.viewport != null) {
+extentSize = this.viewport.getPreferredSize ();
+view = this.viewport.getView ();
+if (view != null) {
+viewSize = view.getPreferredSize ();
+} else {
+viewSize =  new java.awt.Dimension (0, 0);
+}}if (extentSize != null) {
+prefWidth += extentSize.width;
+prefHeight += extentSize.height;
+}var viewportBorder = scrollPane.getViewportBorder ();
+if (viewportBorder != null) {
+var vpbInsets = viewportBorder.getBorderInsets (parent);
+prefWidth += vpbInsets.left + vpbInsets.right;
+prefHeight += vpbInsets.top + vpbInsets.bottom;
+}if ((this.rowHead != null) && this.rowHead.isVisible ()) {
+prefWidth += this.rowHead.getPreferredSize ().width;
+}if ((this.colHead != null) && this.colHead.isVisible ()) {
+prefHeight += this.colHead.getPreferredSize ().height;
+}if ((this.vsb != null) && (this.vsbPolicy != 21)) {
+if (this.vsbPolicy == 22) {
+prefWidth += this.vsb.getPreferredSize ().width;
+} else if ((viewSize != null) && (extentSize != null)) {
+var canScroll = true;
+if (Clazz_instanceOf (view, javax.swing.Scrollable)) {
+canScroll = !(view).getScrollableTracksViewportHeight ();
+}if (canScroll && (viewSize.height > extentSize.height)) {
+prefWidth += this.vsb.getPreferredSize ().width;
+}}}if ((this.hsb != null) && (this.hsbPolicy != 31)) {
+if (this.hsbPolicy == 32) {
+prefHeight += this.hsb.getPreferredSize ().height;
+} else if ((viewSize != null) && (extentSize != null)) {
+var canScroll = true;
+if (Clazz_instanceOf (view, javax.swing.Scrollable)) {
+canScroll = !(view).getScrollableTracksViewportWidth ();
+}if (canScroll && (viewSize.width > extentSize.width)) {
+prefHeight += this.hsb.getPreferredSize ().height;
+}}}return  new java.awt.Dimension (prefWidth, prefHeight);
+}, "java.awt.Container");
+Clazz_overrideMethod (c$, "minimumLayoutSize", 
+function (parent) {
+var scrollPane = parent;
+this.vsbPolicy = scrollPane.getVerticalScrollBarPolicy ();
+this.hsbPolicy = scrollPane.getHorizontalScrollBarPolicy ();
+var insets = parent.getInsets ();
+var minWidth = insets.left + insets.right;
+var minHeight = insets.top + insets.bottom;
+if (this.viewport != null) {
+var size = this.viewport.getMinimumSize ();
+minWidth += size.width;
+minHeight += size.height;
+}var viewportBorder = scrollPane.getViewportBorder ();
+if (viewportBorder != null) {
+var vpbInsets = viewportBorder.getBorderInsets (parent);
+minWidth += vpbInsets.left + vpbInsets.right;
+minHeight += vpbInsets.top + vpbInsets.bottom;
+}if ((this.rowHead != null) && this.rowHead.isVisible ()) {
+var size = this.rowHead.getMinimumSize ();
+minWidth += size.width;
+minHeight = Math.max (minHeight, size.height);
+}if ((this.colHead != null) && this.colHead.isVisible ()) {
+var size = this.colHead.getMinimumSize ();
+minWidth = Math.max (minWidth, size.width);
+minHeight += size.height;
+}if ((this.vsb != null) && (this.vsbPolicy != 21)) {
+var size = this.vsb.getMinimumSize ();
+minWidth += size.width;
+minHeight = Math.max (minHeight, size.height);
+}if ((this.hsb != null) && (this.hsbPolicy != 31)) {
+var size = this.hsb.getMinimumSize ();
+minWidth = Math.max (minWidth, size.width);
+minHeight += size.height;
+}return  new java.awt.Dimension (minWidth, minHeight);
+}, "java.awt.Container");
+Clazz_overrideMethod (c$, "layoutContainer", 
+function (parent) {
+var scrollPane = parent;
+this.vsbPolicy = scrollPane.getVerticalScrollBarPolicy ();
+this.hsbPolicy = scrollPane.getHorizontalScrollBarPolicy ();
+var availR = scrollPane.getBounds ();
+availR.x = availR.y = 0;
+var insets = parent.getInsets ();
+availR.x = insets.left;
+availR.y = insets.top;
+availR.width -= insets.left + insets.right;
+availR.height -= insets.top + insets.bottom;
+var leftToRight = javax.swing.SwingUtilities.isLeftToRight (scrollPane);
+var colHeadR =  new java.awt.Rectangle (0, availR.y, 0, 0);
+if ((this.colHead != null) && (this.colHead.isVisible ())) {
+var colHeadHeight = Math.min (availR.height, this.colHead.getPreferredSize ().height);
+colHeadR.height = colHeadHeight;
+availR.y += colHeadHeight;
+availR.height -= colHeadHeight;
+}var rowHeadR =  new java.awt.Rectangle (0, 0, 0, 0);
+if ((this.rowHead != null) && (this.rowHead.isVisible ())) {
+var rowHeadWidth = Math.min (availR.width, this.rowHead.getPreferredSize ().width);
+rowHeadR.width = rowHeadWidth;
+availR.width -= rowHeadWidth;
+if (leftToRight) {
+rowHeadR.x = availR.x;
+availR.x += rowHeadWidth;
+} else {
+rowHeadR.x = availR.x + availR.width;
+}}var viewportBorder = scrollPane.getViewportBorder ();
+var vpbInsets;
+if (viewportBorder != null) {
+vpbInsets = viewportBorder.getBorderInsets (parent);
+availR.x += vpbInsets.left;
+availR.y += vpbInsets.top;
+availR.width -= vpbInsets.left + vpbInsets.right;
+availR.height -= vpbInsets.top + vpbInsets.bottom;
+} else {
+vpbInsets =  new java.awt.Insets (0, 0, 0, 0);
+}var view = (this.viewport != null) ? this.viewport.getView () : null;
+var viewPrefSize = (view != null) ? view.getPreferredSize () :  new java.awt.Dimension (0, 0);
+var extentSize = (this.viewport != null) ? this.viewport.toViewCoordinates (availR.getSize ()) :  new java.awt.Dimension (0, 0);
+var viewTracksViewportWidth = false;
+var viewTracksViewportHeight = false;
+var isEmpty = (availR.width < 0 || availR.height < 0);
+var sv;
+if (!isEmpty && Clazz_instanceOf (view, javax.swing.Scrollable)) {
+sv = view;
+viewTracksViewportWidth = sv.getScrollableTracksViewportWidth ();
+viewTracksViewportHeight = sv.getScrollableTracksViewportHeight ();
+} else {
+sv = null;
+}var vsbR =  new java.awt.Rectangle (0, availR.y - vpbInsets.top, 0, 0);
+var vsbNeeded;
+if (isEmpty) {
+vsbNeeded = false;
+} else if (this.vsbPolicy == 22) {
+vsbNeeded = true;
+} else if (this.vsbPolicy == 21) {
+vsbNeeded = false;
+} else {
+vsbNeeded = !viewTracksViewportHeight && (viewPrefSize.height > extentSize.height);
+}if ((this.vsb != null) && vsbNeeded) {
+this.adjustForVSB (true, availR, vsbR, vpbInsets, leftToRight);
+extentSize = this.viewport.toViewCoordinates (availR.getSize ());
+}var hsbR =  new java.awt.Rectangle (availR.x - vpbInsets.left, 0, 0, 0);
+var hsbNeeded;
+if (isEmpty) {
+hsbNeeded = false;
+} else if (this.hsbPolicy == 32) {
+hsbNeeded = true;
+} else if (this.hsbPolicy == 31) {
+hsbNeeded = false;
+} else {
+hsbNeeded = !viewTracksViewportWidth && (viewPrefSize.width > extentSize.width);
+}if ((this.hsb != null) && hsbNeeded) {
+this.adjustForHSB (true, availR, hsbR, vpbInsets);
+if ((this.vsb != null) && !vsbNeeded && (this.vsbPolicy != 21)) {
+extentSize = this.viewport.toViewCoordinates (availR.getSize ());
+vsbNeeded = viewPrefSize.height > extentSize.height;
+if (vsbNeeded) {
+this.adjustForVSB (true, availR, vsbR, vpbInsets, leftToRight);
+}}}if (this.viewport != null) {
+this.viewport.setBounds (availR);
+if (sv != null) {
+extentSize = this.viewport.toViewCoordinates (availR.getSize ());
+var oldHSBNeeded = hsbNeeded;
+var oldVSBNeeded = vsbNeeded;
+viewTracksViewportWidth = sv.getScrollableTracksViewportWidth ();
+viewTracksViewportHeight = sv.getScrollableTracksViewportHeight ();
+if (this.vsb != null && this.vsbPolicy == 20) {
+var newVSBNeeded = !viewTracksViewportHeight && (viewPrefSize.height > extentSize.height);
+if (newVSBNeeded != vsbNeeded) {
+vsbNeeded = newVSBNeeded;
+this.adjustForVSB (vsbNeeded, availR, vsbR, vpbInsets, leftToRight);
+extentSize = this.viewport.toViewCoordinates (availR.getSize ());
+}}if (this.hsb != null && this.hsbPolicy == 30) {
+var newHSBbNeeded = !viewTracksViewportWidth && (viewPrefSize.width > extentSize.width);
+if (newHSBbNeeded != hsbNeeded) {
+hsbNeeded = newHSBbNeeded;
+this.adjustForHSB (hsbNeeded, availR, hsbR, vpbInsets);
+if ((this.vsb != null) && !vsbNeeded && (this.vsbPolicy != 21)) {
+extentSize = this.viewport.toViewCoordinates (availR.getSize ());
+vsbNeeded = viewPrefSize.height > extentSize.height;
+if (vsbNeeded) {
+this.adjustForVSB (true, availR, vsbR, vpbInsets, leftToRight);
+}}}}if (oldHSBNeeded != hsbNeeded || oldVSBNeeded != vsbNeeded) {
+this.viewport.setBounds (availR);
+}}}vsbR.height = availR.height + vpbInsets.top + vpbInsets.bottom;
+hsbR.width = availR.width + vpbInsets.left + vpbInsets.right;
+rowHeadR.height = availR.height + vpbInsets.top + vpbInsets.bottom;
+rowHeadR.y = availR.y - vpbInsets.top;
+colHeadR.width = availR.width + vpbInsets.left + vpbInsets.right;
+colHeadR.x = availR.x - vpbInsets.left;
+if (this.rowHead != null) {
+this.rowHead.setBounds (rowHeadR);
+}if (this.colHead != null) {
+this.colHead.setBounds (colHeadR);
+}if (this.vsb != null) {
+if (vsbNeeded) {
+if (this.colHead != null && javax.swing.UIManager.getBoolean ("ScrollPane.fillUpperCorner")) {
+if ((leftToRight && this.upperRight == null) || (!leftToRight && this.upperLeft == null)) {
+vsbR.y = colHeadR.y;
+vsbR.height += colHeadR.height;
+}}this.vsb.setVisible (true);
+this.vsb.setBounds (vsbR);
+} else {
+this.vsb.setVisible (false);
+}}if (this.hsb != null) {
+if (hsbNeeded) {
+if (this.rowHead != null && javax.swing.UIManager.getBoolean ("ScrollPane.fillLowerCorner")) {
+if ((leftToRight && this.lowerLeft == null) || (!leftToRight && this.lowerRight == null)) {
+if (leftToRight) {
+hsbR.x = rowHeadR.x;
+}hsbR.width += rowHeadR.width;
+}}this.hsb.setVisible (true);
+this.hsb.setBounds (hsbR);
+} else {
+this.hsb.setVisible (false);
+}}if (this.lowerLeft != null) {
+this.lowerLeft.setBounds (leftToRight ? rowHeadR.x : vsbR.x, hsbR.y, leftToRight ? rowHeadR.width : vsbR.width, hsbR.height);
+}if (this.lowerRight != null) {
+this.lowerRight.setBounds (leftToRight ? vsbR.x : rowHeadR.x, hsbR.y, leftToRight ? vsbR.width : rowHeadR.width, hsbR.height);
+}if (this.upperLeft != null) {
+this.upperLeft.setBounds (leftToRight ? rowHeadR.x : vsbR.x, colHeadR.y, leftToRight ? rowHeadR.width : vsbR.width, colHeadR.height);
+}if (this.upperRight != null) {
+this.upperRight.setBounds (leftToRight ? vsbR.x : rowHeadR.x, colHeadR.y, leftToRight ? vsbR.width : rowHeadR.width, colHeadR.height);
+}}, "java.awt.Container");
+Clazz_defineMethod (c$, "adjustForVSB", 
+ function (wantsVSB, available, vsbR, vpbInsets, leftToRight) {
+var oldWidth = vsbR.width;
+if (wantsVSB) {
+var vsbWidth = Math.max (0, Math.min (this.vsb.getPreferredSize ().width, available.width));
+available.width -= vsbWidth;
+vsbR.width = vsbWidth;
+if (leftToRight) {
+vsbR.x = available.x + available.width + vpbInsets.right;
+} else {
+vsbR.x = available.x - vpbInsets.left;
+available.x += vsbWidth;
+}} else {
+available.width += oldWidth;
+}}, "~B,java.awt.Rectangle,java.awt.Rectangle,java.awt.Insets,~B");
+Clazz_defineMethod (c$, "adjustForHSB", 
+ function (wantsHSB, available, hsbR, vpbInsets) {
+var oldHeight = hsbR.height;
+if (wantsHSB) {
+var hsbHeight = Math.max (0, Math.min (available.height, this.hsb.getPreferredSize ().height));
+available.height -= hsbHeight;
+hsbR.y = available.y + available.height + vpbInsets.bottom;
+hsbR.height = hsbHeight;
+} else {
+available.height += oldHeight;
+}}, "~B,java.awt.Rectangle,java.awt.Rectangle,java.awt.Insets");
+Clazz_defineMethod (c$, "getViewportBorderBounds", 
+function (scrollpane) {
+return scrollpane.getViewportBorderBounds ();
+}, "javax.swing.JScrollPane");
+Clazz_pu$h(self.c$);
+c$ = Clazz_declareType (javax.swing.ScrollPaneLayout, "UIResource", javax.swing.ScrollPaneLayout, javax.swing.plaf.UIResource);
+c$ = Clazz_p0p ();
+});
+Clazz_declarePackage ("jalview.io");
+Clazz_load (["jalview.io.AlignFile", "java.lang.Enum", "$.Exception"], "jalview.io.FeaturesFile", ["jalview.analysis.SequenceIdMatcher", "jalview.datamodel.AlignedCodonFrame", "$.SequenceDummy", "$.SequenceFeature", "jalview.jsdev.GenericFileAdapter", "jalview.schemes.GraduatedColor", "$.UserColourScheme", "jalview.util.Format", "$.MapList", "$.ParseHtmlBodyAndLinks", "java.awt.Color", "java.lang.Float", "$.StringBuffer", "java.util.ArrayList", "$.Arrays", "$.HashMap", "$.Hashtable", "$.StringTokenizer", "$.Vector"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.doGffSource = true;
+this.gffversion = 0;
+if (!Clazz_isClassDefined ("jalview.io.FeaturesFile.InvalidGFF3FieldException")) {
+jalview.io.FeaturesFile.$FeaturesFile$InvalidGFF3FieldException$ ();
+}
+this.lastmatchedAl = null;
+this.matcher = null;
+Clazz_instantialize (this, arguments);
+}, jalview.io, "FeaturesFile", jalview.io.AlignFile);
+Clazz_makeConstructor (c$, 
+function () {
+Clazz_superConstructor (this, jalview.io.FeaturesFile, []);
+});
+Clazz_defineMethod (c$, "parse", 
+function (align, colours, removeHTML) {
+return this.parse (align, colours, null, removeHTML, false);
+}, "jalview.datamodel.AlignmentI,java.util.Hashtable,~B");
+Clazz_defineMethod (c$, "parse", 
+function (align, colours, removeHTML, relaxedIdMatching) {
+return this.parse (align, colours, null, removeHTML, relaxedIdMatching);
+}, "jalview.datamodel.AlignmentI,java.util.Map,~B,~B");
+Clazz_defineMethod (c$, "parse", 
+function (align, colours, featureLink, removeHTML) {
+return this.parse (align, colours, featureLink, removeHTML, false);
+}, "jalview.datamodel.AlignmentI,java.util.Map,java.util.Map,~B");
+Clazz_defineMethod (c$, "parse", 
+function (align, colours, featureLink, removeHTML, relaxedIdmatching) {
+var line = null;
+try {
+var seq = null;
+var newseqs =  new java.util.ArrayList ();
+var type;
+var desc;
+var token = null;
+var index;
+var start;
+var end;
+var score;
+var st;
+var sf;
+var featureGroup = null;
+var groupLink = null;
+var typeLink =  new java.util.Hashtable ();
+var GFFFile = true;
+var gffProps =  new java.util.HashMap ();
+while ((line = this.nextLine ()) != null) {
+if (line.startsWith ("#")) {
+if (line.startsWith ("##")) {
+this.processGffPragma (line, gffProps, align, newseqs);
+line = "";
+}continue;
+}st =  new java.util.StringTokenizer (line, "\t");
+if (st.countTokens () == 1) {
+if (line.trim ().equalsIgnoreCase ("GFF")) {
+GFFFile = true;
+continue;
+}}if (st.countTokens () > 1 && st.countTokens () < 4) {
+GFFFile = false;
+type = st.nextToken ();
+if (type.equalsIgnoreCase ("startgroup")) {
+featureGroup = st.nextToken ();
+if (st.hasMoreElements ()) {
+groupLink = st.nextToken ();
+featureLink.put (featureGroup, groupLink);
+}} else if (type.equalsIgnoreCase ("endgroup")) {
+st.nextToken ();
+featureGroup = null;
+groupLink = null;
+} else {
+var colour = null;
+var colscheme = st.nextToken ();
+if (colscheme.indexOf ("|") > -1 || colscheme.trim ().equalsIgnoreCase ("label")) {
+var gcol =  new java.util.StringTokenizer (colscheme, "|", true);
+var threshtype = -1;
+var min = 1.4E-45;
+var max = 3.4028235E38;
+var threshval = NaN;
+var labelCol = false;
+var mincol = gcol.nextToken ();
+if (mincol === "|") {
+System.err.println ("Expected either 'label' or a colour specification in the line: " + line);
+continue;
+}var maxcol = null;
+if (mincol.toLowerCase ().indexOf ("label") == 0) {
+labelCol = true;
+mincol = (gcol.hasMoreTokens () ? gcol.nextToken () : null);
+mincol = (gcol.hasMoreTokens () ? gcol.nextToken () : null);
+}var abso = null;
+var minval;
+var maxval;
+if (mincol != null) {
+if (mincol.equals ("|")) {
+mincol = "";
+} else {
+gcol.nextToken ();
+}maxcol = gcol.nextToken ();
+if (maxcol.equals ("|")) {
+maxcol = "";
+} else {
+gcol.nextToken ();
+}abso = gcol.nextToken ();
+gcol.nextToken ();
+if (abso.toLowerCase ().indexOf ("abso") != 0) {
+minval = abso;
+abso = null;
+} else {
+minval = gcol.nextToken ();
+gcol.nextToken ();
+}maxval = gcol.nextToken ();
+if (gcol.hasMoreTokens ()) {
+gcol.nextToken ();
+}try {
+if (minval.length > 0) {
+min =  new Float (minval).floatValue ();
+}} catch (e) {
+if (Clazz_exceptionOf (e, Exception)) {
+System.err.println ("Couldn't parse the minimum value for graduated colour for type (" + colscheme + ") - did you misspell 'auto' for the optional automatic colour switch ?");
+e.printStackTrace ();
+} else {
+throw e;
+}
+}
+try {
+if (maxval.length > 0) {
+max =  new Float (maxval).floatValue ();
+}} catch (e) {
+if (Clazz_exceptionOf (e, Exception)) {
+System.err.println ("Couldn't parse the maximum value for graduated colour for type (" + colscheme + ")");
+e.printStackTrace ();
+} else {
+throw e;
+}
+}
+} else {
+mincol = "FFFFFF";
+maxcol = "000000";
+}try {
+colour =  new jalview.schemes.GraduatedColor ( new jalview.schemes.UserColourScheme (mincol).findColour ('A'),  new jalview.schemes.UserColourScheme (maxcol).findColour ('A'), min, max);
+} catch (e) {
+if (Clazz_exceptionOf (e, Exception)) {
+System.err.println ("Couldn't parse the graduated colour scheme (" + colscheme + ")");
+e.printStackTrace ();
+} else {
+throw e;
+}
+}
+if (colour != null) {
+(colour).setColourByLabel (labelCol);
+(colour).setAutoScaled (abso == null);
+var ttype = null;
+var tval = null;
+if (gcol.hasMoreTokens ()) {
+ttype = gcol.nextToken ();
+if (ttype.toLowerCase ().startsWith ("below")) {
+(colour).setThreshType (0);
+} else if (ttype.toLowerCase ().startsWith ("above")) {
+(colour).setThreshType (1);
+} else {
+(colour).setThreshType (-1);
+if (!ttype.toLowerCase ().startsWith ("no")) {
+System.err.println ("Ignoring unrecognised threshold type : " + ttype);
+}}}if ((colour).getThreshType () != -1) {
+try {
+gcol.nextToken ();
+tval = gcol.nextToken ();
+(colour).setThresh ( new Float (tval).floatValue ());
+} catch (e) {
+if (Clazz_exceptionOf (e, Exception)) {
+System.err.println ("Couldn't parse threshold value as a float: (" + tval + ")");
+e.printStackTrace ();
+} else {
+throw e;
+}
+}
+}if (gcol.hasMoreTokens ()) {
+System.err.println ("Ignoring additional tokens in parameters in graduated colour specification\n");
+while (gcol.hasMoreTokens ()) {
+System.err.println ("|" + gcol.nextToken ());
+}
+System.err.println ("\n");
+}}} else {
+var ucs =  new jalview.schemes.UserColourScheme (colscheme);
+colour = ucs.findColour ('A');
+}if (colour != null) {
+colours.put (type, colour);
+}if (st.hasMoreElements ()) {
+var link = st.nextToken ();
+typeLink.put (type, link);
+if (featureLink == null) {
+featureLink =  new java.util.Hashtable ();
+}featureLink.put (type, link);
+}}continue;
+}var seqId = "";
+while (st.hasMoreElements ()) {
+if (GFFFile) {
+seqId = token = st.nextToken ();
+seq = this.findName (align, seqId, relaxedIdmatching, newseqs);
+if (seq != null) {
+desc = st.nextToken ();
+var group = null;
+if (this.doGffSource && desc.indexOf (' ') == -1) {
+group =  String.instantialize (desc);
+}type = st.nextToken ();
+try {
+var stt = st.nextToken ();
+if (stt.length == 0 || stt.equals ("-")) {
+start = 0;
+} else {
+start = Integer.parseInt (stt);
+}} catch (ex) {
+if (Clazz_exceptionOf (ex, NumberFormatException)) {
+start = 0;
+} else {
+throw ex;
+}
+}
+try {
+var stt = st.nextToken ();
+if (stt.length == 0 || stt.equals ("-")) {
+end = 0;
+} else {
+end = Integer.parseInt (stt);
+}} catch (ex) {
+if (Clazz_exceptionOf (ex, NumberFormatException)) {
+end = 0;
+} else {
+throw ex;
+}
+}
+if (end == 0) {
+start = 0;
+}try {
+score =  new Float (st.nextToken ()).floatValue ();
+} catch (ex) {
+if (Clazz_exceptionOf (ex, NumberFormatException)) {
+score = 0;
+} else {
+throw ex;
+}
+}
+sf =  new jalview.datamodel.SequenceFeature (type, desc, start, end, score, group);
+try {
+sf.setValue ("STRAND", st.nextToken ());
+sf.setValue ("FRAME", st.nextToken ());
+} catch (ex) {
+if (Clazz_exceptionOf (ex, Exception)) {
+} else {
+throw ex;
+}
+}
+if (st.hasMoreTokens ()) {
+var attributes =  new StringBuffer ();
+var sep = false;
+while (st.hasMoreTokens ()) {
+attributes.append ((sep ? "\t" : "") + st.nextElement ());
+sep = true;
+}
+sf.setValue ("ATTRIBUTES", attributes.toString ());
+}if (this.processOrAddSeqFeature (align, newseqs, seq, sf, GFFFile, relaxedIdmatching)) {
+while ((seq = align.findName (seq, seqId, true)) != null) {
+seq.addSequenceFeature ( new jalview.datamodel.SequenceFeature (sf));
+}
+}break;
+}}if (GFFFile && seq == null) {
+desc = token;
+} else {
+desc = st.nextToken ();
+}if (!st.hasMoreTokens ()) {
+System.err.println ("DEBUG: Run out of tokens when trying to identify the destination for the feature.. giving up.");
+return false;
+}token = st.nextToken ();
+if (!token.equals ("ID_NOT_SPECIFIED")) {
+seq = this.findName (align, seqId = token, relaxedIdmatching, null);
+st.nextToken ();
+} else {
+seqId = null;
+try {
+index = Integer.parseInt (st.nextToken ());
+seq = align.getSequenceAt (index);
+} catch (ex) {
+if (Clazz_exceptionOf (ex, NumberFormatException)) {
+seq = null;
+} else {
+throw ex;
+}
+}
+}if (seq == null) {
+System.out.println ("Sequence not found: " + line);
+break;
+}start = Integer.parseInt (st.nextToken ());
+end = Integer.parseInt (st.nextToken ());
+type = st.nextToken ();
+if (!colours.containsKey (type)) {
+var ucs =  new jalview.schemes.UserColourScheme (type);
+colours.put (type, ucs.findColour ('A'));
+}sf =  new jalview.datamodel.SequenceFeature (type, desc, "", start, end, featureGroup);
+if (st.hasMoreTokens ()) {
+try {
+score =  new Float (st.nextToken ()).floatValue ();
+} catch (ex) {
+if (Clazz_exceptionOf (ex, NumberFormatException)) {
+score = 0;
+} else {
+throw ex;
+}
+}
+sf.setScore (score);
+}if (groupLink != null && removeHTML) {
+sf.addLink (groupLink);
+sf.description += "%LINK%";
+}if (typeLink.containsKey (type) && removeHTML) {
+sf.addLink (typeLink.get (type).toString ());
+sf.description += "%LINK%";
+}this.parseDescriptionHTML (sf, removeHTML);
+seq.addSequenceFeature (sf);
+while (seqId != null && (seq = align.findName (seq, seqId, false)) != null) {
+seq.addSequenceFeature ( new jalview.datamodel.SequenceFeature (sf));
+}
+GFFFile = false;
+}
+}
+this.resetMatcher ();
+} catch (ex) {
+if (Clazz_exceptionOf (ex, Exception)) {
+this.warningMessage = ((this.warningMessage == null) ? "" : this.warningMessage) + "Parsing error at\n" + line;
+System.out.println ("Error parsing feature file: " + ex + "\n" + line);
+ex.printStackTrace (System.err);
+this.resetMatcher ();
+return false;
+} else {
+throw ex;
+}
+}
+return true;
+}, "jalview.datamodel.AlignmentI,java.util.Map,java.util.Map,~B,~B");
+Clazz_defineMethod (c$, "processGffPragma", 
+ function (line, gffProps, align, newseqs) {
+var spacepos = line.indexOf (' ');
+var pragma = spacepos == -1 ? line.substring (2).trim () : line.substring (2, spacepos);
+var gffpragma = jalview.io.FeaturesFile.GFFPRAGMA.get (pragma.toLowerCase ());
+if (gffpragma == null) {
+return;
+}switch (gffpragma) {
+case jalview.io.FeaturesFile.GffPragmas.gff_version:
+try {
+this.gffversion = Integer.parseInt (line.substring (spacepos + 1));
+} finally {
+}
+break;
+case jalview.io.FeaturesFile.GffPragmas.feature_ontology:
+break;
+case jalview.io.FeaturesFile.GffPragmas.attribute_ontology:
+break;
+case jalview.io.FeaturesFile.GffPragmas.source_ontology:
+break;
+case jalview.io.FeaturesFile.GffPragmas.species_build:
+break;
+case jalview.io.FeaturesFile.GffPragmas.hash:
+break;
+case jalview.io.FeaturesFile.GffPragmas.fasta:
+this.process_as_fasta (align, newseqs);
+break;
+default:
+System.err.println ("Ignoring unknown pragma:\n" + line);
+}
+}, "~S,java.util.Map,jalview.datamodel.AlignmentI,java.util.ArrayList");
+Clazz_defineMethod (c$, "process_as_fasta", 
+ function (align, newseqs) {
+try {
+this.mark ();
+} catch (q) {
+if (Clazz_exceptionOf (q, java.io.IOException)) {
+} else {
+throw q;
+}
+}
+var parser = jalview.jsdev.GenericFileAdapter.getFile ("FastaFile", []);
+var includedseqs = parser.getSeqs ();
+var smatcher =  new jalview.analysis.SequenceIdMatcher (newseqs);
+for (var p = 0, pSize = includedseqs.size (); p < pSize; p++) {
+var dummyseq = smatcher.findIdMatch (includedseqs.get (p));
+if (dummyseq != null) {
+var mseq = includedseqs.get (p);
+if (Clazz_instanceOf (dummyseq, jalview.datamodel.SequenceDummy)) {
+(dummyseq).become (mseq);
+includedseqs.set (p, dummyseq);
+}}}
+for (var seq, $seq = includedseqs.iterator (); $seq.hasNext () && ((seq = $seq.next ()) || true);) {
+align.addSequence (seq);
+}
+}, "jalview.datamodel.AlignmentI,java.util.List");
+Clazz_defineMethod (c$, "processOrAddSeqFeature", 
+function (align, newseqs, seq, sf, gFFFile, relaxedIdMatching) {
+var attr = sf.getValue ("ATTRIBUTES");
+var add = true;
+if (gFFFile && attr != null) {
+var nattr = 8;
+for (var attset, $attset = 0, $$attset = attr.$plit ("\t"); $attset < $$attset.length && ((attset = $$attset[$attset]) || true); $attset++) {
+if (attset == null || attset.trim ().length == 0) {
+continue;
+}nattr++;
+var set =  new java.util.HashMap ();
+for (var pair, $pair = 0, $$pair = attset.trim ().$plit (";"); $pair < $$pair.length && ((pair = $$pair[$pair]) || true); $pair++) {
+pair = pair.trim ();
+if (pair.length == 0) {
+continue;
+}var eqpos = pair.indexOf ('=');
+var sppos = pair.indexOf (' ');
+var key = null;
+var value = null;
+if (sppos > -1 && (eqpos == -1 || sppos < eqpos)) {
+key = pair.substring (0, sppos);
+value = pair.substring (sppos + 1);
+} else {
+if (eqpos > -1 && (sppos == -1 || eqpos < sppos)) {
+key = pair.substring (0, eqpos);
+value = pair.substring (eqpos + 1);
+} else {
+key = pair;
+}}if (key != null) {
+var vals = set.get (key);
+if (vals == null) {
+vals =  new java.util.ArrayList ();
+set.put (key, vals);
+}if (value != null) {
+vals.add (value.trim ());
+}}}
+try {
+add = new Boolean (add & this.processGffKey (set, nattr, seq, sf, align, newseqs, relaxedIdMatching)).valueOf ();
+} catch (ivfe) {
+if (Clazz_exceptionOf (ivfe, jalview.io.FeaturesFile.InvalidGFF3FieldException)) {
+System.err.println (ivfe);
+} else {
+throw ivfe;
+}
+}
+}
+}if (add) {
+seq.addSequenceFeature (sf);
+}return add;
+}, "jalview.datamodel.AlignmentI,java.util.List,jalview.datamodel.SequenceI,jalview.datamodel.SequenceFeature,~B,~B");
+Clazz_defineMethod (c$, "processGffKey", 
+function (set, nattr, seq, sf, align, newseqs, relaxedIdMatching) {
+var attr;
+if (sf.getType ().equals ("similarity")) {
+var strand = sf.getStrand ();
+var querySeq = this.findNames (align, newseqs, relaxedIdMatching, set.get (attr = "Query"));
+if (querySeq == null || querySeq.size () != 1) {
+throw Clazz_innerTypeInstance (jalview.io.FeaturesFile.InvalidGFF3FieldException, this, null, attr, set, "Expecting exactly one sequence in Query field (got " + set.get (attr) + ")");
+}if (set.containsKey (attr = "Align")) {
+var alco =  new jalview.datamodel.AlignedCodonFrame ();
+var codonmapping = this.constructCodonMappingFromAlign (set, attr, strand);
+alco.addMap (seq, querySeq.get (0), codonmapping);
+align.addCodonFrame (alco);
+return false;
+}}return true;
+}, "java.util.Map,~N,jalview.datamodel.SequenceI,jalview.datamodel.SequenceFeature,jalview.datamodel.AlignmentI,java.util.List,~B");
+Clazz_defineMethod (c$, "constructCodonMappingFromAlign", 
+ function (set, attr, strand) {
+if (strand == 0) {
+throw Clazz_innerTypeInstance (jalview.io.FeaturesFile.InvalidGFF3FieldException, this, null, attr, set, "Invalid strand for a codon mapping (cannot be 0)");
+}var fromrange =  new java.util.ArrayList ();
+var torange =  new java.util.ArrayList ();
+var lastppos = 0;
+var lastpframe = 0;
+for (var range, $range = set.get (attr).iterator (); $range.hasNext () && ((range = $range.next ()) || true);) {
+var ints =  new java.util.ArrayList ();
+var st =  new java.util.StringTokenizer (range, " ");
+while (st.hasMoreTokens ()) {
+var num = st.nextToken ();
+try {
+ints.add ( new Integer (num));
+} catch (nfe) {
+if (Clazz_exceptionOf (nfe, NumberFormatException)) {
+throw Clazz_innerTypeInstance (jalview.io.FeaturesFile.InvalidGFF3FieldException, this, null, attr, set, "Invalid number in field " + num);
+} else {
+throw nfe;
+}
+}
+}
+if (ints.size () != 3) {
+throw Clazz_innerTypeInstance (jalview.io.FeaturesFile.InvalidGFF3FieldException, this, null, attr, set, "Invalid number of fields for this attribute (" + ints.size () + ")");
+}fromrange.add ( new Integer (ints.get (0).intValue ()));
+fromrange.add ( new Integer (ints.get (0).intValue () + strand * ints.get (2).intValue ()));
+if (ints.get (1).equals (new Integer (lastppos)) && lastpframe > 0) {
+lastppos += (ints.get (2)).intValue () / 3;
+lastpframe = (ints.get (2)).intValue () % 3;
+torange.set (torange.size () - 1,  new Integer (lastppos));
+} else {
+torange.add (ints.get (1));
+lastppos = (ints.get (1)).intValue () + (ints.get (2)).intValue () / 3;
+lastpframe = (ints.get (2)).intValue () % 3;
+torange.add ( new Integer (lastppos));
+}}
+if (fromrange.size () % 2 == 1) {
+throw Clazz_innerTypeInstance (jalview.io.FeaturesFile.InvalidGFF3FieldException, this, null, attr, set, "Couldn't parse the DNA alignment range correctly");
+}if (torange.size () % 2 == 1) {
+throw Clazz_innerTypeInstance (jalview.io.FeaturesFile.InvalidGFF3FieldException, this, null, attr, set, "Couldn't parse the protein alignment range correctly");
+}var frommap =  Clazz_newIntArray (fromrange.size (), 0);
+var tomap =  Clazz_newIntArray (torange.size (), 0);
+var p = 0;
+for (var ip, $ip = fromrange.iterator (); $ip.hasNext () && ((ip = $ip.next ()) || true);) {
+frommap[p++] = ip.intValue ();
+}
+p = 0;
+for (var ip, $ip = torange.iterator (); $ip.hasNext () && ((ip = $ip.next ()) || true);) {
+tomap[p++] = ip.intValue ();
+}
+return  new jalview.util.MapList (frommap, tomap, 3, 1);
+}, "java.util.Map,~S,~N");
+Clazz_defineMethod (c$, "findNames", 
+ function (align, newseqs, relaxedIdMatching, list) {
+var found =  new java.util.ArrayList ();
+for (var seqId, $seqId = list.iterator (); $seqId.hasNext () && ((seqId = $seqId.next ()) || true);) {
+var seq = this.findName (align, seqId, relaxedIdMatching, newseqs);
+if (seq != null) {
+found.add (seq);
+}}
+return found;
+}, "jalview.datamodel.AlignmentI,java.util.List,~B,java.util.List");
+Clazz_defineMethod (c$, "resetMatcher", 
+ function () {
+this.lastmatchedAl = null;
+this.matcher = null;
+});
+Clazz_defineMethod (c$, "findName", 
+ function (align, seqId, relaxedIdMatching, newseqs) {
+var match = null;
+if (relaxedIdMatching) {
+if (this.lastmatchedAl !== align) {
+this.matcher =  new jalview.analysis.SequenceIdMatcher ((this.lastmatchedAl = align).getSequencesArray ());
+if (newseqs != null) {
+this.matcher.addAll (newseqs);
+}}match = this.matcher.findIdMatch (seqId);
+} else {
+match = align.findName (seqId, true);
+if (match == null && newseqs != null) {
+for (var m, $m = newseqs.iterator (); $m.hasNext () && ((m = $m.next ()) || true);) {
+if (seqId.equals (m.getName ())) {
+return m;
+}}
+}}if (match == null && newseqs != null) {
+match =  new jalview.datamodel.SequenceDummy (seqId);
+if (relaxedIdMatching) {
+this.matcher.addAll (java.util.Arrays.asList ( Clazz_newArray (-1, [match])));
+}newseqs.add (match);
+}return match;
+}, "jalview.datamodel.AlignmentI,~S,~B,java.util.List");
+Clazz_defineMethod (c$, "parseDescriptionHTML", 
+function (sf, removeHTML) {
+if (sf.getDescription () == null) {
+return;
+}var parsed =  new jalview.util.ParseHtmlBodyAndLinks (sf.getDescription (), removeHTML, this.newline);
+sf.description = (removeHTML) ? parsed.getNonHtmlContent () : sf.description;
+for (var link, $link = parsed.getLinks ().iterator (); $link.hasNext () && ((link = $link.next ()) || true);) {
+sf.addLink (link);
+}
+}, "jalview.datamodel.SequenceFeature,~B");
+Clazz_defineMethod (c$, "printJalviewFormat", 
+function (seqs, visible) {
+return this.printJalviewFormat (seqs, visible, true, true);
+}, "~A,java.util.Map");
+Clazz_defineMethod (c$, "printJalviewFormat", 
+function (seqs, visible, visOnly, nonpos) {
+var out =  new StringBuffer ();
+var next;
+var featuresGen = false;
+if (visOnly && !nonpos && (visible == null || visible.size () < 1)) {
+return "No Features Visible";
+}if (visible != null && visOnly) {
+var en = visible.keySet ().iterator ();
+var type;
+var color;
+while (en.hasNext ()) {
+type = en.next ().toString ();
+if (Clazz_instanceOf (visible.get (type), jalview.schemes.GraduatedColor)) {
+var gc = visible.get (type);
+color = (gc.isColourByLabel () ? "label|" : "") + jalview.util.Format.getHexString (gc.getMinColor ()) + "|" + jalview.util.Format.getHexString (gc.getMaxColor ()) + (gc.isAutoScale () ? "|" : "|abso|") + gc.getMin () + "|" + gc.getMax () + "|";
+if (gc.getThreshType () != -1) {
+if (gc.getThreshType () == 0) {
+color += "below";
+} else {
+if (gc.getThreshType () != 1) {
+System.err.println ("WARNING: Unsupported threshold type (" + gc.getThreshType () + ") : Assuming 'above'");
+}color += "above";
+}color += "|" + gc.getThresh ();
+} else {
+color += "none";
+}} else if (Clazz_instanceOf (visible.get (type), java.awt.Color)) {
+color = jalview.util.Format.getHexString (visible.get (type));
+} else {
+color = jalview.util.Format.getHexString ( new java.awt.Color (Integer.parseInt (visible.get (type).toString ())));
+}out.append (type);
+out.append ("\t");
+out.append (color);
+out.append (this.newline);
+}
+}var groups =  new java.util.Vector ();
+var groupIndex = 0;
+var isnonpos = false;
+for (var i = 0; i < seqs.length; i++) {
+next = seqs[i].getSequenceFeatures ();
+if (next != null) {
+for (var j = 0; j < next.length; j++) {
+isnonpos = next[j].begin == 0 && next[j].end == 0;
+if ((!nonpos && isnonpos) || (!isnonpos && visOnly && !visible.containsKey (next[j].type))) {
+continue;
+}if (next[j].featureGroup != null && !groups.contains (next[j].featureGroup)) {
+groups.addElement (next[j].featureGroup);
+}}
+}}
+var group = null;
+do {
+if (groups.size () > 0 && groupIndex < groups.size ()) {
+group = groups.elementAt (groupIndex).toString ();
+out.append (this.newline);
+out.append ("STARTGROUP\t");
+out.append (group);
+out.append (this.newline);
+} else {
+group = null;
+}for (var i = 0; i < seqs.length; i++) {
+next = seqs[i].getSequenceFeatures ();
+if (next != null) {
+for (var j = 0; j < next.length; j++) {
+isnonpos = next[j].begin == 0 && next[j].end == 0;
+if ((!nonpos && isnonpos) || (!isnonpos && visOnly && !visible.containsKey (next[j].type))) {
+continue;
+}if (group != null && (next[j].featureGroup == null || !next[j].featureGroup.equals (group))) {
+continue;
+}if (group == null && next[j].featureGroup != null) {
+continue;
+}featuresGen = true;
+if (next[j].description == null || next[j].description.equals ("")) {
+out.append (next[j].type + "\t");
+} else {
+if (next[j].links != null && next[j].getDescription ().indexOf ("<html>") == -1) {
+out.append ("<html>");
+}out.append (next[j].description + " ");
+if (next[j].links != null) {
+for (var l = 0; l < next[j].links.size (); l++) {
+var label = next[j].links.elementAt (l).toString ();
+var href = label.substring (label.indexOf ("|") + 1);
+label = label.substring (0, label.indexOf ("|"));
+if (next[j].description.indexOf (href) == -1) {
+out.append ("<a href=\"" + href + "\">" + label + "</a>");
+}}
+if (next[j].getDescription ().indexOf ("</html>") == -1) {
+out.append ("</html>");
+}}out.append ("\t");
+}out.append (seqs[i].getName ());
+out.append ("\t-1\t");
+out.append ("" + next[j].begin);
+out.append ("\t");
+out.append ("" + next[j].end);
+out.append ("\t");
+out.append (next[j].type);
+if (!Float.isNaN (next[j].score)) {
+out.append ("\t");
+out.append (next[j].score);
+}out.append (this.newline);
+}
+}}
+if (group != null) {
+out.append ("ENDGROUP\t");
+out.append (group);
+out.append (this.newline);
+groupIndex++;
+} else {
+break;
+}} while (groupIndex < groups.size () + 1);
+if (!featuresGen) {
+return "No Features Visible";
+}return out.toString ();
+}, "~A,java.util.Map,~B,~B");
+Clazz_defineMethod (c$, "printGFFFormat", 
+function (seqs, visible) {
+return this.printGFFFormat (seqs, visible, true, true);
+}, "~A,java.util.Map");
+Clazz_defineMethod (c$, "printGFFFormat", 
+function (seqs, visible, visOnly, nonpos) {
+var out =  new StringBuffer ();
+var next;
+var source;
+var isnonpos;
+for (var i = 0; i < seqs.length; i++) {
+if (seqs[i].getSequenceFeatures () != null) {
+next = seqs[i].getSequenceFeatures ();
+for (var j = 0; j < next.length; j++) {
+isnonpos = next[j].begin == 0 && next[j].end == 0;
+if ((!nonpos && isnonpos) || (!isnonpos && visOnly && !visible.containsKey (next[j].type))) {
+continue;
+}source = next[j].featureGroup;
+if (source == null) {
+source = next[j].getDescription ();
+}out.append (seqs[i].getName ());
+out.append ("\t");
+out.append (source);
+out.append ("\t");
+out.append (next[j].type);
+out.append ("\t");
+out.append ("" + next[j].begin);
+out.append ("\t");
+out.append ("" + next[j].end);
+out.append ("\t");
+out.append (next[j].score);
+out.append ("\t");
+if (next[j].getValue ("STRAND") != null) {
+out.append (next[j].getValue ("STRAND"));
+out.append ("\t");
+} else {
+out.append (".\t");
+}if (next[j].getValue ("FRAME") != null) {
+out.append (next[j].getValue ("FRAME"));
+} else {
+out.append (".");
+}if (next[j].getValue ("ATTRIBUTES") != null) {
+out.append (next[j].getValue ("ATTRIBUTES"));
+}out.append (this.newline);
+}
+}}
+return out.toString ();
+}, "~A,java.util.Map,~B,~B");
+Clazz_defineMethod (c$, "parse", 
+function () {
+});
+Clazz_overrideMethod (c$, "print", 
+function () {
+return "USE printGFFFormat() or printJalviewFormat()";
+});
+c$.$FeaturesFile$InvalidGFF3FieldException$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_decorateAsClass (function () {
+Clazz_prepareCallback (this, arguments);
+this.field = null;
+this.value = null;
+Clazz_instantialize (this, arguments);
+}, jalview.io.FeaturesFile, "InvalidGFF3FieldException", Exception);
+Clazz_makeConstructor (c$, 
+function (a, b, c) {
+Clazz_superConstructor (this, jalview.io.FeaturesFile.InvalidGFF3FieldException, [c + " (Field was " + a + " and value was " + b.get (a).toString ()]);
+this.field = a;
+this.value = b.get (a).toString ();
+}, "~S,java.util.Map,~S");
+c$ = Clazz_p0p ();
+};
+Clazz_pu$h(self.c$);
+c$ = Clazz_declareType (jalview.io.FeaturesFile, "GffPragmas", Enum);
+Clazz_defineEnumConstant (c$, "gff_version", 0, []);
+Clazz_defineEnumConstant (c$, "sequence_region", 1, []);
+Clazz_defineEnumConstant (c$, "feature_ontology", 2, []);
+Clazz_defineEnumConstant (c$, "attribute_ontology", 3, []);
+Clazz_defineEnumConstant (c$, "source_ontology", 4, []);
+Clazz_defineEnumConstant (c$, "species_build", 5, []);
+Clazz_defineEnumConstant (c$, "fasta", 6, []);
+Clazz_defineEnumConstant (c$, "hash", 7, []);
+c$ = Clazz_p0p ();
+Clazz_defineStatics (c$,
+"GFFPRAGMA", null);
+{
+jalview.io.FeaturesFile.GFFPRAGMA =  new java.util.HashMap ();
+jalview.io.FeaturesFile.GFFPRAGMA.put ("sequence-region", jalview.io.FeaturesFile.GffPragmas.sequence_region);
+jalview.io.FeaturesFile.GFFPRAGMA.put ("feature-ontology", jalview.io.FeaturesFile.GffPragmas.feature_ontology);
+jalview.io.FeaturesFile.GFFPRAGMA.put ("#", jalview.io.FeaturesFile.GffPragmas.hash);
+jalview.io.FeaturesFile.GFFPRAGMA.put ("fasta", jalview.io.FeaturesFile.GffPragmas.fasta);
+jalview.io.FeaturesFile.GFFPRAGMA.put ("species-build", jalview.io.FeaturesFile.GffPragmas.species_build);
+jalview.io.FeaturesFile.GFFPRAGMA.put ("source-ontology", jalview.io.FeaturesFile.GffPragmas.source_ontology);
+jalview.io.FeaturesFile.GFFPRAGMA.put ("attribute-ontology", jalview.io.FeaturesFile.GffPragmas.attribute_ontology);
+}});
+Clazz_declarePackage ("jalview.datamodel");
+Clazz_load (["jalview.datamodel.Sequence", "$.SequenceI"], "jalview.datamodel.SequenceDummy", null, function () {
+c$ = Clazz_decorateAsClass (function () {
+this.dummy = true;
+Clazz_instantialize (this, arguments);
+}, jalview.datamodel, "SequenceDummy", jalview.datamodel.Sequence, jalview.datamodel.SequenceI);
+Clazz_makeConstructor (c$, 
+function (sequenceId) {
+Clazz_superConstructor (this, jalview.datamodel.SequenceDummy, [sequenceId, "THISAPLACEHOLDER"]);
+}, "~S");
+Clazz_defineMethod (c$, "become", 
+function (mseq) {
+this.initSeqFrom (mseq, null);
+this.dummy = false;
+}, "jalview.datamodel.SequenceI");
+Clazz_defineMethod (c$, "isDummy", 
+function () {
+return this.dummy;
+});
+});
+Clazz_declarePackage ("java.awt.event");
+Clazz_load (["java.awt.event.MouseListener", "$.MouseMotionListener", "$.MouseWheelListener"], "java.awt.event.MouseAdapter", null, function () {
+c$ = Clazz_declareType (java.awt.event, "MouseAdapter", null, [java.awt.event.MouseListener, java.awt.event.MouseWheelListener, java.awt.event.MouseMotionListener]);
+Clazz_overrideMethod (c$, "mouseClicked", 
+function (e) {
+}, "java.awt.event.MouseEvent");
+Clazz_overrideMethod (c$, "mousePressed", 
+function (e) {
+}, "java.awt.event.MouseEvent");
+Clazz_overrideMethod (c$, "mouseReleased", 
+function (e) {
+}, "java.awt.event.MouseEvent");
+Clazz_overrideMethod (c$, "mouseEntered", 
+function (e) {
+}, "java.awt.event.MouseEvent");
+Clazz_overrideMethod (c$, "mouseExited", 
+function (e) {
+}, "java.awt.event.MouseEvent");
+Clazz_overrideMethod (c$, "mouseWheelMoved", 
+function (e) {
+}, "java.awt.event.MouseWheelEvent");
+Clazz_overrideMethod (c$, "mouseDragged", 
+function (e) {
+}, "java.awt.event.MouseEvent");
+Clazz_overrideMethod (c$, "mouseMoved", 
+function (e) {
+}, "java.awt.event.MouseEvent");
+});
+Clazz_declarePackage ("jalview.appletgui");
+Clazz_load (["awt2swing.Checkbox", "$.Panel", "jalview.api.FeatureSettingsControllerI", "java.awt.event.ActionListener", "$.AdjustmentListener", "$.ItemListener", "$.MouseListener", "$.MouseMotionListener"], "jalview.appletgui.FeatureSettings", ["awt2swing.Button", "$.Frame", "$.Label", "$.MenuItem", "$.PopupMenu", "$.ScrollPane", "$.Scrollbar", "$.Util", "jalview.appletgui.FeatureColourChooser", "$.UserDefinedColours", "jalview.bin.JalviewLite", "jalview.schemes.GraduatedColor", "jalview.util.MessageManager", "java.awt.BorderLayout", "$.Color", "$.Font", "$.GridLayout", "$.Toolkit", "java.awt.event.WindowAdapter", "java.lang.Boolean", "$.Error", "java.util.Vector"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.fr = null;
+this.ap = null;
+this.av = null;
+this.frame = null;
+this.groupPanel = null;
+this.featurePanel = null;
+this.scrollPane = null;
+this.linkImage = null;
+this.transparency = null;
+this.groupItemListener = null;
+this.selectedCheck = null;
+this.dragging = false;
+if (!Clazz_isClassDefined ("jalview.appletgui.FeatureSettings.MyCheckbox")) {
+jalview.appletgui.FeatureSettings.$FeatureSettings$MyCheckbox$ ();
+}
+Clazz_instantialize (this, arguments);
+}, jalview.appletgui, "FeatureSettings", awt2swing.Panel, [java.awt.event.ItemListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.event.ActionListener, java.awt.event.AdjustmentListener, jalview.api.FeatureSettingsControllerI]);
+Clazz_prepareFields (c$, function () {
+this.featurePanel =  new awt2swing.Panel ();
+this.groupItemListener = ((Clazz_isClassDefined ("jalview.appletgui.FeatureSettings$1") ? 0 : jalview.appletgui.FeatureSettings.$FeatureSettings$1$ ()), Clazz_innerTypeInstance (jalview.appletgui.FeatureSettings$1, this, null));
+});
+Clazz_makeConstructor (c$, 
+function (ap) {
+Clazz_superConstructor (this, jalview.appletgui.FeatureSettings, []);
+this.ap = ap;
+this.av = ap.av;
+ap.av.featureSettings = this;
+this.fr = ap.seqPanel.seqCanvas.getFeatureRenderer ();
+this.transparency =  new awt2swing.Scrollbar (0, 100 - Clazz_floatToInt (this.fr.getTransparency () * 100), 1, 1, 100);
+if (this.fr.isTransparencyAvailable ()) {
+this.transparency.addAdjustmentListener (this);
+} else {
+this.transparency.setEnabled (false);
+}var url = this.getClass ().getResource ("/images/link.gif");
+if (url != null) {
+this.linkImage = java.awt.Toolkit.getDefaultToolkit ().getImage (url);
+}if (this.av.isShowSequenceFeatures () || !this.fr.hasRenderOrder ()) {
+this.fr.findAllFeatures (true);
+}this.discoverAllFeatureData ();
+this.setLayout ( new java.awt.BorderLayout ());
+this.scrollPane =  new awt2swing.ScrollPane ();
+this.scrollPane.add (this.featurePanel);
+if (this.fr.getAllFeatureColours () != null && this.fr.getAllFeatureColours ().size () > 0) {
+this.add (this.scrollPane, "Center");
+}var invert =  new awt2swing.Button ("Invert Selection");
+invert.addActionListener (this);
+var lowerPanel =  new awt2swing.Panel ( new java.awt.GridLayout (2, 1, 5, 10));
+lowerPanel.add (invert);
+var tPanel =  new awt2swing.Panel ( new java.awt.BorderLayout ());
+if (this.fr.isTransparencyAvailable ()) {
+tPanel.add (this.transparency, "Center");
+tPanel.add ( new awt2swing.Label ("Transparency"), "East");
+} else {
+tPanel.add ( new awt2swing.Label ("Transparency not available in this web browser"), "Center");
+}lowerPanel.add (tPanel, "South");
+this.add (lowerPanel, "South");
+if (this.groupPanel != null) {
+this.groupPanel.setLayout ( new java.awt.GridLayout (Clazz_doubleToInt ((this.fr.getFeatureGroupsSize ()) / 4) + 1, 4));
+this.groupPanel.validate ();
+this.add (this.groupPanel, "North");
+}this.frame =  new awt2swing.Frame ();
+this.frame.add (this);
+var me = this;
+this.frame.addWindowListener (((Clazz_isClassDefined ("jalview.appletgui.FeatureSettings$2") ? 0 : jalview.appletgui.FeatureSettings.$FeatureSettings$2$ ()), Clazz_innerTypeInstance (jalview.appletgui.FeatureSettings$2, this, Clazz_cloneFinals ("me", me))));
+var height = this.featurePanel.getComponentCount () * 50 + 60;
+height = Math.max (200, height);
+height = Math.min (400, height);
+var width = 300;
+jalview.bin.JalviewLite.addFrame (this.frame, jalview.util.MessageManager.getString ("label.feature_settings"), width, height);
+}, "jalview.appletgui.AlignmentPanel");
+Clazz_defineMethod (c$, "PaintComponent", 
+function (g) {
+g.setColor (java.awt.Color.black);
+awt2swing.Util.drawString (g, jalview.util.MessageManager.getString ("label.no_features_added_to_this_alignment"), 10, 20);
+awt2swing.Util.drawString (g, jalview.util.MessageManager.getString ("label.features_can_be_added_from_searches_1"), 10, 40);
+awt2swing.Util.drawString (g, jalview.util.MessageManager.getString ("label.features_can_be_added_from_searches_2"), 10, 60);
+}, "java.awt.Graphics");
+Clazz_defineMethod (c$, "popupSort", 
+function (check, minmax, x, y) {
+var type = check.type;
+var typeCol = this.fr.getFeatureStyle (type);
+var men =  new awt2swing.PopupMenu (jalview.util.MessageManager.formatMessage ("label.settings_for_type",  Clazz_newArray (-1, [type])));
+var scr =  new awt2swing.MenuItem (jalview.util.MessageManager.getString ("label.sort_by_score"));
+men.add (scr);
+var me = this;
+scr.addActionListener (((Clazz_isClassDefined ("jalview.appletgui.FeatureSettings$3") ? 0 : jalview.appletgui.FeatureSettings.$FeatureSettings$3$ ()), Clazz_innerTypeInstance (jalview.appletgui.FeatureSettings$3, this, Clazz_cloneFinals ("me", me, "type", type))));
+var dens =  new awt2swing.MenuItem (jalview.util.MessageManager.getString ("label.sort_by_density"));
+dens.addActionListener (((Clazz_isClassDefined ("jalview.appletgui.FeatureSettings$4") ? 0 : jalview.appletgui.FeatureSettings.$FeatureSettings$4$ ()), Clazz_innerTypeInstance (jalview.appletgui.FeatureSettings$4, this, Clazz_cloneFinals ("me", me, "type", type))));
+men.add (dens);
+if (minmax != null) {
+var typeMinMax = minmax.get (type);
+if (typeMinMax != null && (typeMinMax)[0] != null) {
+var mxcol =  new awt2swing.MenuItem ((Clazz_instanceOf (typeCol, java.awt.Color)) ? "Graduated Colour" : "Single Colour");
+men.add (mxcol);
+mxcol.addActionListener (((Clazz_isClassDefined ("jalview.appletgui.FeatureSettings$5") ? 0 : jalview.appletgui.FeatureSettings.$FeatureSettings$5$ ()), Clazz_innerTypeInstance (jalview.appletgui.FeatureSettings$5, this, Clazz_cloneFinals ("typeCol", typeCol, "me", me, "type", type, "check", check))));
+}}this.featurePanel.add (men);
+men.show (this.featurePanel, x, y);
+}, "jalview.appletgui.FeatureSettings.MyCheckbox,java.util.Hashtable,~N,~N");
+Clazz_overrideMethod (c$, "discoverAllFeatureData", 
+function () {
+if (this.fr.getAllFeatureColours () != null && this.fr.getAllFeatureColours ().size () > 0) {
+this.rebuildGroups ();
+}this.resetTable (false);
+});
+Clazz_defineMethod (c$, "rebuildGroups", 
+function () {
+var rdrw = false;
+if (this.groupPanel == null) {
+this.groupPanel =  new awt2swing.Panel ();
+} else {
+rdrw = true;
+this.groupPanel.removeAll ();
+}for (var group, $group = this.fr.getFeatureGroups ().iterator (); $group.hasNext () && ((group = $group.next ()) || true);) {
+var vis = this.fr.checkGroupVisibility (group, false);
+var check = Clazz_innerTypeInstance (jalview.appletgui.FeatureSettings.MyCheckbox, this, null, group, vis, (this.fr.featureLinks != null && this.fr.featureLinks.containsKey (group)));
+check.addMouseListener (this);
+check.setFont ( new java.awt.Font ("Serif", 1, 12));
+check.addItemListener (this.groupItemListener);
+check.setVisible (vis);
+this.groupPanel.add (check);
+}
+if (rdrw) {
+this.groupPanel.validate ();
+}});
+Clazz_defineMethod (c$, "resetTable", 
+function (groupsChanged) {
+var tmpfeatures;
+var group = null;
+var type;
+var visibleChecks =  new java.util.Vector ();
+var alignment = this.av.getAlignment ();
+for (var i = 0; i < alignment.getHeight (); i++) {
+if (alignment.getSequenceAt (i).getSequenceFeatures () == null) {
+continue;
+}tmpfeatures = alignment.getSequenceAt (i).getSequenceFeatures ();
+var index = 0;
+while (index < tmpfeatures.length) {
+group = tmpfeatures[index].featureGroup;
+if (group == null || this.fr.checkGroupVisibility (group, true)) {
+type = tmpfeatures[index].getType ();
+if (!visibleChecks.contains (type)) {
+visibleChecks.addElement (type);
+}}index++;
+}
+}
+var comps;
+var cSize = this.featurePanel.getComponentCount ();
+var check;
+for (var i = 0; i < cSize; i++) {
+comps = this.featurePanel.getComponents ();
+check = comps[i];
+if (!visibleChecks.contains (check.type)) {
+this.featurePanel.remove (i);
+cSize--;
+i--;
+}}
+if (this.fr.getRenderOrder () != null) {
+var rol = this.fr.getRenderOrder ();
+for (var ro = rol.size () - 1; ro > -1; ro--) {
+var item = rol.get (ro);
+if (!visibleChecks.contains (item)) {
+continue;
+}visibleChecks.removeElement (item);
+this.addCheck (false, item);
+}
+}var en = visibleChecks.elements ();
+while (en.hasMoreElements ()) {
+this.addCheck (groupsChanged, en.nextElement ().toString ());
+}
+this.featurePanel.setLayout ( new java.awt.GridLayout (this.featurePanel.getComponentCount (), 1, 10, 5));
+this.featurePanel.validate ();
+if (this.scrollPane != null) {
+this.scrollPane.validate ();
+}this.itemStateChanged (null);
+}, "~B");
+Clazz_defineMethod (c$, "addCheck", 
+function (groupsChanged, type) {
+var addCheck;
+var comps = this.featurePanel.getComponents ();
+var check;
+addCheck = true;
+for (var i = 0; i < this.featurePanel.getComponentCount (); i++) {
+check = comps[i];
+if (check.type.equals (type)) {
+addCheck = false;
+break;
+}}
+if (addCheck) {
+var selected = false;
+if (groupsChanged || this.av.getFeaturesDisplayed ().isVisible (type)) {
+selected = true;
+}check = Clazz_innerTypeInstance (jalview.appletgui.FeatureSettings.MyCheckbox, this, null, type, selected, (this.fr.featureLinks != null && this.fr.featureLinks.containsKey (type)), this.fr.getFeatureStyle (type));
+check.addMouseListener (this);
+check.addMouseMotionListener (this);
+check.addItemListener (this);
+if (groupsChanged) {
+this.featurePanel.add (check, 0);
+} else {
+this.featurePanel.add (check);
+}}}, "~B,~S");
+Clazz_overrideMethod (c$, "actionPerformed", 
+function (evt) {
+for (var i = 0; i < this.featurePanel.getComponentCount (); i++) {
+var check = this.featurePanel.getComponent (i);
+check.setState (!check.getState ());
+}
+this.selectionChanged ();
+}, "java.awt.event.ActionEvent");
+Clazz_overrideMethod (c$, "itemStateChanged", 
+function (evt) {
+this.selectionChanged ();
+}, "java.awt.event.ItemEvent");
+Clazz_defineMethod (c$, "selectionChanged", 
+function () {
+var comps = this.featurePanel.getComponents ();
+var cSize = comps.length;
+var tmp =  Clazz_newArray (cSize, 3, null);
+var tmpSize = 0;
+for (var i = 0; i < cSize; i++) {
+var check = comps[i];
+tmp[tmpSize][0] = check.type;
+tmp[tmpSize][1] = this.fr.getFeatureStyle (check.type);
+tmp[tmpSize][2] =  new Boolean (check.getState ());
+tmpSize++;
+}
+var data =  Clazz_newArray (tmpSize, 3, null);
+System.arraycopy (tmp, 0, data, 0, tmpSize);
+this.fr.setFeaturePriority (data);
+this.ap.paintAlignment (true);
+});
+Clazz_overrideMethod (c$, "mousePressed", 
+function (evt) {
+this.selectedCheck = evt.getSource ();
+if (this.fr.featureLinks != null && this.fr.featureLinks.containsKey (this.selectedCheck.type)) {
+if (evt.getX () > this.selectedCheck.stringWidth + 20) {
+evt.consume ();
+}}}, "java.awt.event.MouseEvent");
+Clazz_overrideMethod (c$, "mouseDragged", 
+function (evt) {
+if ((evt.getSource ()).getParent () !== this.featurePanel) {
+return;
+}this.dragging = true;
+}, "java.awt.event.MouseEvent");
+Clazz_overrideMethod (c$, "mouseReleased", 
+function (evt) {
+if ((evt.getSource ()).getParent () !== this.featurePanel) {
+return;
+}var comp = null;
+var target = null;
+var height = evt.getY () + evt.getComponent ().getLocation ().y;
+if (height > this.featurePanel.getSize ().height) {
+comp = this.featurePanel.getComponent (this.featurePanel.getComponentCount () - 1);
+} else if (height < 0) {
+comp = this.featurePanel.getComponent (0);
+} else {
+comp = this.featurePanel.getComponentAt (evt.getX (), evt.getY () + evt.getComponent ().getLocation ().y);
+}if (comp != null && Clazz_instanceOf (comp, awt2swing.Checkbox)) {
+target = comp;
+}if (this.selectedCheck != null && target != null && this.selectedCheck !== target) {
+var targetIndex = -1;
+for (var i = 0; i < this.featurePanel.getComponentCount (); i++) {
+if (target === this.featurePanel.getComponent (i)) {
+targetIndex = i;
+break;
+}}
+this.featurePanel.remove (this.selectedCheck);
+this.featurePanel.add (this.selectedCheck, targetIndex);
+this.featurePanel.validate ();
+this.itemStateChanged (null);
+}}, "java.awt.event.MouseEvent");
+Clazz_defineMethod (c$, "setUserColour", 
+function (feature, originalColour) {
+if (Clazz_instanceOf (originalColour, java.awt.Color) || Clazz_instanceOf (originalColour, jalview.schemes.GraduatedColor)) {
+this.fr.setColour (feature, originalColour);
+} else {
+throw  new Error (jalview.util.MessageManager.getString ("error.implementation_error_unsupported_feature_colour_object"));
+}this.refreshTable ();
+}, "~S,~O");
+Clazz_defineMethod (c$, "refreshTable", 
+function () {
+this.featurePanel.removeAll ();
+this.resetTable (false);
+this.ap.paintAlignment (true);
+});
+Clazz_overrideMethod (c$, "mouseEntered", 
+function (evt) {
+}, "java.awt.event.MouseEvent");
+Clazz_overrideMethod (c$, "mouseExited", 
+function (evt) {
+}, "java.awt.event.MouseEvent");
+Clazz_overrideMethod (c$, "mouseClicked", 
+function (evt) {
+var check = evt.getSource ();
+if ((evt.getModifiers () & 4) != 0) {
+this.popupSort (check, this.fr.getMinMax (), evt.getX (), evt.getY ());
+}if (this.fr.featureLinks != null && this.fr.featureLinks.containsKey (check.type)) {
+if (evt.getX () > check.stringWidth + 20) {
+evt.consume ();
+var link = this.fr.featureLinks.get (check.type).toString ();
+this.ap.alignFrame.showURL (link.substring (link.indexOf ("|") + 1), link.substring (0, link.indexOf ("|")));
+}}if (check.getParent () !== this.featurePanel) {
+return;
+}if (evt.getClickCount () > 1) {
+var fcol = this.fr.getFeatureStyle (check.type);
+if (Clazz_instanceOf (fcol, java.awt.Color)) {
+ new jalview.appletgui.UserDefinedColours (this, check.type, fcol);
+} else {
+ new jalview.appletgui.FeatureColourChooser (this, check.type);
+check.updateColor (this.fr.getFeatureStyle (check.type));
+}}}, "java.awt.event.MouseEvent");
+Clazz_overrideMethod (c$, "mouseMoved", 
+function (evt) {
+}, "java.awt.event.MouseEvent");
+Clazz_overrideMethod (c$, "adjustmentValueChanged", 
+function (evt) {
+this.fr.setTransparency ((100 - this.transparency.getValue ()) / 100);
+this.ap.seqPanel.seqCanvas.repaint ();
+}, "java.awt.event.AdjustmentEvent");
+c$.$FeatureSettings$MyCheckbox$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_decorateAsClass (function () {
+Clazz_prepareCallback (this, arguments);
+this.type = null;
+this.stringWidth = 0;
+this.hasLink = false;
+this.gcol = null;
+this.col = null;
+Clazz_instantialize (this, arguments);
+}, jalview.appletgui.FeatureSettings, "MyCheckbox", awt2swing.Checkbox);
+Clazz_defineMethod (c$, "updateColor", 
+function (a) {
+if (Clazz_instanceOf (a, java.awt.Color)) {
+this.col = a;
+this.gcol = null;
+} else if (Clazz_instanceOf (a, jalview.schemes.GraduatedColor)) {
+this.gcol = a;
+this.col = null;
+} else {
+throw  new Error (jalview.util.MessageManager.getString ("error.invalid_colour_for_mycheckbox"));
+}if (this.col != null) {
+this.setBackground (this.col);
+} else {
+var b = this.type;
+if (this.gcol.getThreshType () != -1) {
+b += " " + ((this.gcol.getThreshType () == 1) ? "(>)" : "(<)");
+}if (this.gcol.isColourByLabel ()) {
+this.setBackground (java.awt.Color.white);
+b += " (by Label)";
+} else {
+this.setBackground (this.gcol.getMinColor ());
+}this.setLabel (b);
+}this.repaint ();
+}, "~O");
+Clazz_makeConstructor (c$, 
+function (a, b, c) {
+Clazz_superConstructor (this, jalview.appletgui.FeatureSettings.MyCheckbox, [a, b]);
+this.type = a;
+var d = this.b$["jalview.appletgui.FeatureSettings"].av.nullFrame.getFontMetrics (this.b$["jalview.appletgui.FeatureSettings"].av.nullFrame.getFont ());
+this.stringWidth = d.stringWidth (a);
+this.hasLink = c;
+}, "~S,~B,~B");
+Clazz_makeConstructor (c$, 
+function (a, b, c, d) {
+this.construct (a, b, c);
+this.updateColor (d);
+}, "~S,~B,~B,~O");
+Clazz_defineMethod (c$, "PaintComponent", 
+function (a) {
+var b = this.getSize ();
+if (this.gcol != null) {
+if (this.gcol.isColourByLabel ()) {
+a.setColor (java.awt.Color.white);
+a.fillRect (Clazz_doubleToInt (b.width / 2), 0, Clazz_doubleToInt (b.width / 2), b.height);
+} else {
+var c = this.gcol.getMaxColor ();
+a.setColor (c);
+a.fillRect (Clazz_doubleToInt (b.width / 2), 0, Clazz_doubleToInt (b.width / 2), b.height);
+}}if (this.hasLink) {
+a.drawImage (this.b$["jalview.appletgui.FeatureSettings"].linkImage, this.stringWidth + 25, Clazz_doubleToInt ((this.getSize ().height - this.b$["jalview.appletgui.FeatureSettings"].linkImage.getHeight (this)) / 2), this);
+}}, "java.awt.Graphics");
+c$ = Clazz_p0p ();
+};
+c$.$FeatureSettings$1$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_declareAnonymous (jalview.appletgui, "FeatureSettings$1", null, java.awt.event.ItemListener);
+Clazz_overrideMethod (c$, "itemStateChanged", 
+function (evt) {
+var source = evt.getSource ();
+this.b$["jalview.appletgui.FeatureSettings"].fr.setGroupVisibility (source.getLabel (), source.getState ());
+this.b$["jalview.appletgui.FeatureSettings"].ap.seqPanel.seqCanvas.repaint ();
+if (this.b$["jalview.appletgui.FeatureSettings"].ap.overviewPanel != null) {
+this.b$["jalview.appletgui.FeatureSettings"].ap.overviewPanel.updateOverviewImage ();
+}this.b$["jalview.appletgui.FeatureSettings"].resetTable (true);
+return;
+}, "java.awt.event.ItemEvent");
+c$ = Clazz_p0p ();
+};
+c$.$FeatureSettings$2$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_declareAnonymous (jalview.appletgui, "FeatureSettings$2", java.awt.event.WindowAdapter);
+Clazz_overrideMethod (c$, "windowClosing", 
+function (e) {
+if (this.f$.me.av.featureSettings === this.f$.me) {
+this.f$.me.av.featureSettings = null;
+this.f$.me.ap = null;
+this.f$.me.av = null;
+}}, "java.awt.event.WindowEvent");
+c$ = Clazz_p0p ();
+};
+c$.$FeatureSettings$3$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_declareAnonymous (jalview.appletgui, "FeatureSettings$3", null, java.awt.event.ActionListener);
+Clazz_overrideMethod (c$, "actionPerformed", 
+function (e) {
+this.f$.me.ap.alignFrame.avc.sortAlignmentByFeatureScore ( Clazz_newArray (-1, [this.f$.type]));
+}, "java.awt.event.ActionEvent");
+c$ = Clazz_p0p ();
+};
+c$.$FeatureSettings$4$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_declareAnonymous (jalview.appletgui, "FeatureSettings$4", null, java.awt.event.ActionListener);
+Clazz_overrideMethod (c$, "actionPerformed", 
+function (e) {
+this.f$.me.ap.alignFrame.avc.sortAlignmentByFeatureDensity ( Clazz_newArray (-1, [this.f$.type]));
+}, "java.awt.event.ActionEvent");
+c$ = Clazz_p0p ();
+};
+c$.$FeatureSettings$5$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_declareAnonymous (jalview.appletgui, "FeatureSettings$5", null, java.awt.event.ActionListener);
+Clazz_overrideMethod (c$, "actionPerformed", 
+function (e) {
+if (Clazz_instanceOf (this.f$.typeCol, java.awt.Color)) {
+ new jalview.appletgui.FeatureColourChooser (this.f$.me, this.f$.type);
+this.f$.check.updateColor (this.b$["jalview.appletgui.FeatureSettings"].fr.getFeatureStyle (this.f$.type));
+} else {
+ new jalview.appletgui.UserDefinedColours (this.f$.me, this.f$.check.type, (this.f$.typeCol));
+}}, "java.awt.event.ActionEvent");
+c$ = Clazz_p0p ();
+};
+});
+Clazz_declarePackage ("jalview.api");
+Clazz_declareInterface (jalview.api, "FeatureSettingsControllerI");
+Clazz_declarePackage ("jalview.appletgui");
+Clazz_load (["awt2swing.Panel", "java.awt.event.MouseListener", "$.MouseMotionListener", "java.lang.Thread", "java.util.Vector"], "jalview.appletgui.IdPanel", ["jalview.appletgui.APopupMenu", "$.IdCanvas", "$.PaintRefresher", "$.Tooltip", "jalview.datamodel.SequenceGroup", "jalview.util.UrlLink", "java.awt.BorderLayout", "java.lang.Float", "$.StringBuffer"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.idCanvas = null;
+this.av = null;
+this.alignPanel = null;
+this.scrollThread = null;
+this.lastid = -1;
+this.mouseDragging = false;
+this.links = null;
+this.tooltip = null;
+if (!Clazz_isClassDefined ("jalview.appletgui.IdPanel.ScrollThread")) {
+jalview.appletgui.IdPanel.$IdPanel$ScrollThread$ ();
+}
+Clazz_instantialize (this, arguments);
+}, jalview.appletgui, "IdPanel", awt2swing.Panel, [java.awt.event.MouseListener, java.awt.event.MouseMotionListener]);
+Clazz_prepareFields (c$, function () {
+this.links =  new java.util.Vector ();
+});
+Clazz_makeConstructor (c$, 
+function (av, parent) {
+Clazz_superConstructor (this, jalview.appletgui.IdPanel, []);
+this.setName ("idPanel");
+this.av = av;
+this.alignPanel = parent;
+this.idCanvas =  new jalview.appletgui.IdCanvas (av);
+this.setLayout ( new java.awt.BorderLayout ());
+this.add (this.idCanvas, "Center");
+this.idCanvas.addMouseListener (this);
+this.idCanvas.addMouseMotionListener (this);
+if (av.applet != null) {
+av.applet.getLinkParams (this.links);
+}{
+var srsPos = this.links.indexOf ("SRS|http://srs.ebi.ac.uk/srsbin/cgi-bin/wgetz?-newId+(([uniprot-all:$SEQUENCE_ID$]))+-view+SwissEntry");
+if (srsPos > -1) {
+this.links.setElementAt ("EMBL-EBI Search|http://www.ebi.ac.uk/ebisearch/search.ebi?db=allebi&query=$SEQUENCE_ID$", srsPos);
+}}if (this.links.size () < 1) {
+this.links =  new java.util.Vector ();
+this.links.addElement ("EMBL-EBI Search|http://www.ebi.ac.uk/ebisearch/search.ebi?db=allebi&query=$SEQUENCE_ID$");
+}}, "jalview.appletgui.AlignViewport,jalview.appletgui.AlignmentPanel");
+Clazz_overrideMethod (c$, "mouseMoved", 
+function (e) {
+var seq = this.alignPanel.seqPanel.findSeq (e);
+var sequence = this.av.getAlignment ().getSequenceAt (seq);
+var tooltiptext =  new StringBuffer ();
+if (sequence != null) {
+if (sequence.getDescription () != null) {
+tooltiptext.append (sequence.getDescription ());
+tooltiptext.append ("\n");
+}var sf = sequence.getSequenceFeatures ();
+for (var sl = 0; sf != null && sl < sf.length; sl++) {
+if (sf[sl].begin == sf[sl].end && sf[sl].begin == 0) {
+var nl = false;
+if (sf[sl].getFeatureGroup () != null) {
+tooltiptext.append (sf[sl].getFeatureGroup ());
+nl = true;
+};if (sf[sl].getType () != null) {
+tooltiptext.append (" ");
+tooltiptext.append (sf[sl].getType ());
+nl = true;
+};if (sf[sl].getDescription () != null) {
+tooltiptext.append (" ");
+tooltiptext.append (sf[sl].getDescription ());
+nl = true;
+};if (!Float.isNaN (sf[sl].getScore ()) && sf[sl].getScore () != 0) {
+tooltiptext.append (" Score = ");
+tooltiptext.append (sf[sl].getScore ());
+nl = true;
+};if (sf[sl].getStatus () != null && sf[sl].getStatus ().length > 0) {
+tooltiptext.append (" (");
+tooltiptext.append (sf[sl].getStatus ());
+tooltiptext.append (")");
+nl = true;
+};if (nl) {
+tooltiptext.append ("\n");
+}}}
+}if (tooltiptext.length () == 0) {
+if (this.tooltip != null) {
+this.tooltip.setVisible (false);
+}this.tooltip = null;
+tooltiptext = null;
+return;
+}if (this.tooltip == null) {
+this.tooltip =  new jalview.appletgui.Tooltip (sequence.getDisplayId (true) + "\n" + tooltiptext.toString (), this.idCanvas);
+} else {
+this.tooltip.setTip (sequence.getDisplayId (true) + "\n" + tooltiptext.toString ());
+}tooltiptext = null;
+}, "java.awt.event.MouseEvent");
+Clazz_overrideMethod (c$, "mouseDragged", 
+function (e) {
+this.mouseDragging = true;
+var seq = Math.max (0, this.alignPanel.seqPanel.findSeq (e));
+if (seq < this.lastid) {
+this.selectSeqs (this.lastid - 1, seq);
+} else if (seq > this.lastid) {
+this.selectSeqs (this.lastid + 1, seq);
+}this.lastid = seq;
+this.alignPanel.paintAlignment (false);
+}, "java.awt.event.MouseEvent");
+Clazz_overrideMethod (c$, "mouseClicked", 
+function (e) {
+if (e.getClickCount () < 2) {
+return;
+}var seq = this.alignPanel.seqPanel.findSeq (e);
+var sq = this.av.getAlignment ().getSequenceAt (seq);
+if (sq == null) {
+return;
+}var id = sq.getName ();
+var target = null;
+var url = null;
+var i = 0;
+while (url == null && i < this.links.size ()) {
+url = this.links.elementAt (i++).toString ();
+var urlLink = null;
+try {
+urlLink =  new jalview.util.UrlLink (url);
+target = urlLink.getTarget ();
+} catch (foo) {
+if (Clazz_exceptionOf (foo, Exception)) {
+System.err.println ("Exception for URLLink '" + url + "'");
+foo.printStackTrace ();
+url = null;
+continue;
+} else {
+throw foo;
+}
+}
+;if (!urlLink.isValid ()) {
+System.err.println (urlLink.getInvalidMessage ());
+url = null;
+continue;
+}var urls = urlLink.makeUrls (id, true);
+if (urls == null || urls[0] == null || urls[0].length < 1) {
+url = null;
+continue;
+}url = urls[1];
+}
+try {
+this.alignPanel.alignFrame.showURL (url, target);
+} catch (ex) {
+if (Clazz_exceptionOf (ex, Exception)) {
+ex.printStackTrace ();
+} else {
+throw ex;
+}
+}
+}, "java.awt.event.MouseEvent");
+Clazz_overrideMethod (c$, "mouseEntered", 
+function (e) {
+if (this.scrollThread != null) {
+this.scrollThread.running = false;
+}}, "java.awt.event.MouseEvent");
+Clazz_overrideMethod (c$, "mouseExited", 
+function (e) {
+if (this.av.getWrapAlignment ()) {
+return;
+}if (this.mouseDragging && e.getY () < 0 && this.av.getStartSeq () > 0) {
+this.scrollThread = Clazz_innerTypeInstance (jalview.appletgui.IdPanel.ScrollThread, this, null, true);
+}if (this.mouseDragging && e.getY () >= this.getSize ().height && this.av.getAlignment ().getHeight () > this.av.getEndSeq ()) {
+this.scrollThread = Clazz_innerTypeInstance (jalview.appletgui.IdPanel.ScrollThread, this, null, false);
+}}, "java.awt.event.MouseEvent");
+Clazz_overrideMethod (c$, "mousePressed", 
+function (e) {
+if (e.getClickCount () > 1) {
+return;
+}var y = e.getY ();
+if (this.av.getWrapAlignment ()) {
+y -= 2 * this.av.getCharHeight ();
+}var seq = this.alignPanel.seqPanel.findSeq (e);
+if ((e.getModifiers () & 4) == 4) {
+var sq = this.av.getAlignment ().getSequenceAt (seq);
+var nlinks =  new java.util.Vector ();
+for (var l = 0, lSize = this.links.size (); l < lSize; l++) {
+nlinks.addElement (this.links.elementAt (l));
+}
+var sf = sq == null ? null : sq.getSequenceFeatures ();
+for (var sl = 0; sf != null && sl < sf.length; sl++) {
+if (sf[sl].begin == sf[sl].end && sf[sl].begin == 0) {
+if (sf[sl].links != null && sf[sl].links.size () > 0) {
+for (var l = 0, lSize = sf[sl].links.size (); l < lSize; l++) {
+nlinks.addElement (sf[sl].links.elementAt (l));
+}
+}}}
+var popup =  new jalview.appletgui.APopupMenu (this.alignPanel, sq, nlinks);
+this.add (popup);
+popup.show (this, e.getX (), e.getY ());
+return;
+}if ((this.av.getSelectionGroup () == null) || ((!e.isControlDown () && !e.isShiftDown ()) && this.av.getSelectionGroup () != null)) {
+this.av.setSelectionGroup ( new jalview.datamodel.SequenceGroup ());
+this.av.getSelectionGroup ().setStartRes (0);
+this.av.getSelectionGroup ().setEndRes (this.av.getAlignment ().getWidth () - 1);
+}if (e.isShiftDown () && this.lastid != -1) {
+this.selectSeqs (this.lastid, seq);
+} else {
+this.selectSeq (seq);
+}this.alignPanel.paintAlignment (false);
+}, "java.awt.event.MouseEvent");
+Clazz_defineMethod (c$, "selectSeq", 
+function (seq) {
+this.lastid = seq;
+var pickedSeq = this.av.getAlignment ().getSequenceAt (seq);
+this.av.getSelectionGroup ().addOrRemove (pickedSeq, true);
+}, "~N");
+Clazz_defineMethod (c$, "selectSeqs", 
+function (start, end) {
+this.lastid = start;
+if (end >= this.av.getAlignment ().getHeight ()) {
+end = this.av.getAlignment ().getHeight () - 1;
+}if (end < start) {
+var tmp = start;
+start = end;
+end = tmp;
+this.lastid = end;
+}if (this.av.getSelectionGroup () == null) {
+this.av.setSelectionGroup ( new jalview.datamodel.SequenceGroup ());
+}for (var i = start; i <= end; i++) {
+this.av.getSelectionGroup ().addSequence (this.av.getAlignment ().getSequenceAt (i), i == end);
+}
+}, "~N,~N");
+Clazz_overrideMethod (c$, "mouseReleased", 
+function (e) {
+if (this.scrollThread != null) {
+this.scrollThread.running = false;
+}if (this.av.getSelectionGroup () != null) {
+this.av.getSelectionGroup ().recalcConservation ();
+}this.mouseDragging = false;
+jalview.appletgui.PaintRefresher.Refresh (this, this.av.getSequenceSetId ());
+this.av.sendSelection ();
+}, "java.awt.event.MouseEvent");
+Clazz_defineMethod (c$, "highlightSearchResults", 
+function (list) {
+this.idCanvas.setHighlighted (list);
+if (list == null) {
+return;
+}var index = this.av.getAlignment ().findIndex (list.get (0));
+if (this.av.getStartSeq () > index || this.av.getEndSeq () < index) {
+this.alignPanel.setScrollValues (this.av.getStartRes (), index);
+}}, "java.util.List");
+c$.$IdPanel$ScrollThread$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_decorateAsClass (function () {
+Clazz_prepareCallback (this, arguments);
+this.running = false;
+this.up = true;
+Clazz_instantialize (this, arguments);
+}, jalview.appletgui.IdPanel, "ScrollThread", Thread);
+Clazz_makeConstructor (c$, 
+function (a) {
+Clazz_superConstructor (this, jalview.appletgui.IdPanel.ScrollThread, []);
+this.up = a;
+this.start ();
+}, "~B");
+Clazz_defineMethod (c$, "stopScrolling", 
+function () {
+this.running = false;
+});
+Clazz_overrideMethod (c$, "run", 
+function () {
+this.running = true;
+while (this.running) {
+if (this.b$["jalview.appletgui.IdPanel"].alignPanel.scrollUp (this.up)) {
+var a = this.b$["jalview.appletgui.IdPanel"].av.getStartSeq ();
+if (!this.up) {
+a = this.b$["jalview.appletgui.IdPanel"].av.getEndSeq ();
+}if (a < this.b$["jalview.appletgui.IdPanel"].lastid) {
+this.b$["jalview.appletgui.IdPanel"].selectSeqs (this.b$["jalview.appletgui.IdPanel"].lastid - 1, a);
+} else if (a > this.b$["jalview.appletgui.IdPanel"].lastid && a < this.b$["jalview.appletgui.IdPanel"].av.getAlignment ().getHeight ()) {
+this.b$["jalview.appletgui.IdPanel"].selectSeqs (this.b$["jalview.appletgui.IdPanel"].lastid + 1, a);
+}this.b$["jalview.appletgui.IdPanel"].lastid = a;
+} else {
+this.running = false;
+}this.b$["jalview.appletgui.IdPanel"].alignPanel.paintAlignment (true);
+try {
+Thread.sleep (100);
+} catch (ex) {
+if (Clazz_exceptionOf (ex, Exception)) {
+} else {
+throw ex;
+}
+}
+}
+});
+c$ = Clazz_p0p ();
+};
+});
+Clazz_declarePackage ("jalview.appletgui");
+Clazz_load (["awt2swing.PopupMenu", "java.awt.event.ActionListener", "$.ItemListener", "awt2swing.CheckboxMenuItem", "$.Menu", "$.MenuItem", "jalview.util.MessageManager"], "jalview.appletgui.APopupMenu", ["awt2swing.Frame", "jalview.analysis.AAFrequency", "$.AlignmentAnnotationUtils", "$.AlignmentUtils", "$.Conservation", "jalview.appletgui.AppletJmol", "$.CutAndPasteTransfer", "$.EditNameDialog", "$.SliderPanel", "$.UserDefinedColours", "jalview.bin.JalviewLite", "jalview.commands.ChangeCaseCommand", "$.EditCommand", "jalview.datamodel.SequenceFeature", "jalview.io.AppletFormatAdapter", "$.SequenceAnnotationReport", "jalview.schemes.Blosum62ColourScheme", "$.BuriedColourScheme", "$.ClustalxColourScheme", "$.HelixColourScheme", "$.HydrophobicColourScheme", "$.NucleotideColourScheme", "$.PIDColourScheme", "$.ResidueProperties", "$.StrandColourScheme", "$.TaylorColourScheme", "$.TurnColourScheme", "$.ZappoColourScheme", "jalview.util.DBRefUtils", "$.UrlLink", "java.lang.StringBuffer", "$.StringBuilder", "java.util.Arrays", "$.Collections", "$.LinkedHashMap", "$.TreeMap"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.groupMenu = null;
+this.editGroupName = null;
+this.clustalColour = null;
+this.zappoColour = null;
+this.taylorColour = null;
+this.hydrophobicityColour = null;
+this.helixColour = null;
+this.strandColour = null;
+this.turnColour = null;
+this.buriedColour = null;
+this.abovePIDColour = null;
+this.userDefinedColour = null;
+this.PIDColour = null;
+this.BLOSUM62Colour = null;
+this.noColourmenuItem = null;
+this.conservationMenuItem = null;
+this.ap = null;
+this.unGroupMenuItem = null;
+this.createGroupMenuItem = null;
+this.nucleotideMenuItem = null;
+this.colourMenu = null;
+this.showBoxes = null;
+this.showText = null;
+this.showColourText = null;
+this.displayNonconserved = null;
+this.seqShowAnnotationsMenu = null;
+this.seqHideAnnotationsMenu = null;
+this.seqAddReferenceAnnotations = null;
+this.groupShowAnnotationsMenu = null;
+this.groupHideAnnotationsMenu = null;
+this.groupAddReferenceAnnotations = null;
+this.editMenu = null;
+this.copy = null;
+this.cut = null;
+this.toUpper = null;
+this.toLower = null;
+this.toggleCase = null;
+this.outputmenu = null;
+this.seqMenu = null;
+this.pdb = null;
+this.hideSeqs = null;
+this.repGroup = null;
+this.sequenceName = null;
+this.sequenceFeature = null;
+this.editSequence = null;
+this.sequenceDetails = null;
+this.selSeqDetails = null;
+this.makeReferenceSeq = null;
+this.seq = null;
+this.revealAll = null;
+this.revealSeq = null;
+this.revealSeq_index = -1;
+this.menu1 = null;
+Clazz_instantialize (this, arguments);
+}, jalview.appletgui, "APopupMenu", awt2swing.PopupMenu, [java.awt.event.ActionListener, java.awt.event.ItemListener]);
+Clazz_prepareFields (c$, function () {
+this.groupMenu =  new awt2swing.Menu ();
+this.editGroupName =  new awt2swing.MenuItem ();
+this.clustalColour =  new awt2swing.MenuItem ();
+this.zappoColour =  new awt2swing.MenuItem ();
+this.taylorColour =  new awt2swing.MenuItem ();
+this.hydrophobicityColour =  new awt2swing.MenuItem ();
+this.helixColour =  new awt2swing.MenuItem ();
+this.strandColour =  new awt2swing.MenuItem ();
+this.turnColour =  new awt2swing.MenuItem ();
+this.buriedColour =  new awt2swing.MenuItem ();
+this.abovePIDColour =  new awt2swing.CheckboxMenuItem ();
+this.userDefinedColour =  new awt2swing.MenuItem ();
+this.PIDColour =  new awt2swing.MenuItem ();
+this.BLOSUM62Colour =  new awt2swing.MenuItem ();
+this.noColourmenuItem =  new awt2swing.MenuItem ();
+this.conservationMenuItem =  new awt2swing.CheckboxMenuItem ();
+this.unGroupMenuItem =  new awt2swing.MenuItem ();
+this.createGroupMenuItem =  new awt2swing.MenuItem ();
+this.nucleotideMenuItem =  new awt2swing.MenuItem ();
+this.colourMenu =  new awt2swing.Menu ();
+this.showBoxes =  new awt2swing.CheckboxMenuItem ();
+this.showText =  new awt2swing.CheckboxMenuItem ();
+this.showColourText =  new awt2swing.CheckboxMenuItem ();
+this.displayNonconserved =  new awt2swing.CheckboxMenuItem ();
+this.seqShowAnnotationsMenu =  new awt2swing.Menu (jalview.util.MessageManager.getString ("label.show_annotations"));
+this.seqHideAnnotationsMenu =  new awt2swing.Menu (jalview.util.MessageManager.getString ("label.hide_annotations"));
+this.seqAddReferenceAnnotations =  new awt2swing.MenuItem (jalview.util.MessageManager.getString ("label.add_reference_annotations"));
+this.groupShowAnnotationsMenu =  new awt2swing.Menu (jalview.util.MessageManager.getString ("label.show_annotations"));
+this.groupHideAnnotationsMenu =  new awt2swing.Menu (jalview.util.MessageManager.getString ("label.hide_annotations"));
+this.groupAddReferenceAnnotations =  new awt2swing.MenuItem (jalview.util.MessageManager.getString ("label.add_reference_annotations"));
+this.editMenu =  new awt2swing.Menu (jalview.util.MessageManager.getString ("action.edit"));
+this.copy =  new awt2swing.MenuItem (jalview.util.MessageManager.getString ("action.copy"));
+this.cut =  new awt2swing.MenuItem (jalview.util.MessageManager.getString ("action.cut"));
+this.toUpper =  new awt2swing.MenuItem (jalview.util.MessageManager.getString ("label.to_upper_case"));
+this.toLower =  new awt2swing.MenuItem (jalview.util.MessageManager.getString ("label.to_lower_case"));
+this.toggleCase =  new awt2swing.MenuItem (jalview.util.MessageManager.getString ("label.toggle_case"));
+this.outputmenu =  new awt2swing.Menu ();
+this.seqMenu =  new awt2swing.Menu ();
+this.pdb =  new awt2swing.MenuItem ();
+this.hideSeqs =  new awt2swing.MenuItem ();
+this.repGroup =  new awt2swing.MenuItem ();
+this.sequenceName =  new awt2swing.MenuItem (jalview.util.MessageManager.getString ("label.edit_name_description"));
+this.sequenceFeature =  new awt2swing.MenuItem (jalview.util.MessageManager.getString ("label.create_sequence_feature"));
+this.editSequence =  new awt2swing.MenuItem (jalview.util.MessageManager.getString ("label.edit_sequence"));
+this.sequenceDetails =  new awt2swing.MenuItem (jalview.util.MessageManager.getString ("label.sequence_details") + "...");
+this.selSeqDetails =  new awt2swing.MenuItem (jalview.util.MessageManager.getString ("label.sequence_details") + "...");
+this.makeReferenceSeq =  new awt2swing.MenuItem ();
+this.revealAll =  new awt2swing.MenuItem ();
+this.revealSeq =  new awt2swing.MenuItem ();
+this.menu1 =  new awt2swing.Menu ();
+});
+Clazz_makeConstructor (c$, 
+function (apanel, seq, links) {
+Clazz_superConstructor (this, jalview.appletgui.APopupMenu, []);
+this.ap = apanel;
+this.seq = seq;
+try {
+this.jbInit ();
+} catch (e) {
+if (Clazz_exceptionOf (e, Exception)) {
+e.printStackTrace ();
+} else {
+throw e;
+}
+}
+for (var i = 0; i < jalview.io.AppletFormatAdapter.WRITEABLE_FORMATS.length; i++) {
+var item =  new awt2swing.MenuItem (jalview.io.AppletFormatAdapter.WRITEABLE_FORMATS[i]);
+item.addActionListener (this);
+this.outputmenu.add (item);
+}
+this.buildAnnotationSubmenus ();
+var sg = this.ap.av.getSelectionGroup ();
+if (sg != null && sg.getSize () > 0) {
+this.editGroupName.setLabel (jalview.util.MessageManager.formatMessage ("label.name_param",  Clazz_newArray (-1, [sg.getName ()])));
+this.showText.setState (sg.getDisplayText ());
+this.showColourText.setState (sg.getColourText ());
+this.showBoxes.setState (sg.getDisplayBoxes ());
+this.displayNonconserved.setState (sg.getShowNonconserved ());
+if (!this.ap.av.getAlignment ().getGroups ().contains (sg)) {
+this.menu1.setLabel (jalview.util.MessageManager.getString ("action.edit_new_group"));
+this.groupMenu.remove (this.unGroupMenuItem);
+} else {
+this.menu1.setLabel (jalview.util.MessageManager.getString ("action.edit_group"));
+this.groupMenu.remove (this.createGroupMenuItem);
+}} else {
+this.remove (this.hideSeqs);
+this.remove (this.groupMenu);
+}if (links != null && links.size () > 0) {
+var linkMenu =  new awt2swing.Menu (jalview.util.MessageManager.getString ("action.link"));
+for (var i = 0; i < links.size (); i++) {
+var link = links.elementAt (i);
+var urlLink =  new jalview.util.UrlLink (link);
+if (!urlLink.isValid ()) {
+System.err.println (urlLink.getInvalidMessage ());
+continue;
+}var target = urlLink.getTarget ();
+var label = urlLink.getLabel ();
+if (seq != null && urlLink.isDynamic ()) {
+var dbr = jalview.util.DBRefUtils.selectRefs (seq.getDBRef (),  Clazz_newArray (-1, [target]));
+var id = seq.getName ();
+var descr = seq.getDescription ();
+if (descr != null && descr.length < 1) {
+descr = null;
+}if (dbr != null) {
+for (var r = 0; r < dbr.length; r++) {
+if (id != null && dbr[r].getAccessionId ().equals (id)) {
+id = null;
+}var urls = urlLink.makeUrls (dbr[r].getAccessionId (), true);
+if (urls != null) {
+for (var u = 0; u < urls.length; u += 2) {
+this.addshowLink (linkMenu, label + "|" + urls[u], urls[u + 1]);
+}
+}}
+}if (id != null) {
+var urls = urlLink.makeUrls (id, true);
+if (urls != null) {
+for (var u = 0; u < urls.length; u += 2) {
+this.addshowLink (linkMenu, label, urls[u + 1]);
+}
+}}if (descr != null && urlLink.getRegexReplace () != null) {
+var urls = urlLink.makeUrls (descr, true);
+if (urls != null) {
+for (var u = 0; u < urls.length; u += 2) {
+this.addshowLink (linkMenu, label, urls[u + 1]);
+}
+}}} else {
+this.addshowLink (linkMenu, target, urlLink.getUrl_prefix ());
+}}
+if (linkMenu.getItemCount () > 0) {
+if (seq != null) {
+this.seqMenu.add (linkMenu);
+} else {
+this.add (linkMenu);
+}}}if (seq != null) {
+this.seqMenu.setLabel (seq.getName ());
+if (seq === this.ap.av.getAlignment ().getSeqrep ()) {
+this.makeReferenceSeq.setLabel (jalview.util.MessageManager.getString ("action.unmark_as_reference"));
+} else {
+this.makeReferenceSeq.setLabel (jalview.util.MessageManager.getString ("action.set_as_reference"));
+}this.repGroup.setLabel (jalview.util.MessageManager.formatMessage ("label.represent_group_with",  Clazz_newArray (-1, [seq.getName ()])));
+} else {
+this.remove (this.seqMenu);
+}if (!this.ap.av.hasHiddenRows ()) {
+this.remove (this.revealAll);
+this.remove (this.revealSeq);
+} else {
+var index = this.ap.av.getAlignment ().findIndex (seq);
+if (this.ap.av.adjustForHiddenSeqs (index) - this.ap.av.adjustForHiddenSeqs (index - 1) > 1) {
+this.revealSeq_index = index;
+} else {
+this.remove (this.revealSeq);
+}}}, "jalview.appletgui.AlignmentPanel,jalview.datamodel.SequenceI,java.util.Vector");
+Clazz_defineMethod (c$, "buildAnnotationSubmenus", 
+ function () {
+var selectedSequence = (this.seq == null ? java.util.Collections.emptyList () : java.util.Arrays.asList ([this.seq]));
+this.buildAnnotationTypesMenus (this.seqShowAnnotationsMenu, this.seqHideAnnotationsMenu, selectedSequence);
+this.configureReferenceAnnotationsMenu (this.seqAddReferenceAnnotations, selectedSequence);
+var selectedGroup = (this.ap.av.getSelectionGroup () == null ? java.util.Collections.emptyList () : this.ap.av.getSelectionGroup ().getSequences ());
+this.buildAnnotationTypesMenus (this.groupShowAnnotationsMenu, this.groupHideAnnotationsMenu, selectedGroup);
+this.configureReferenceAnnotationsMenu (this.groupAddReferenceAnnotations, selectedGroup);
+});
+Clazz_defineMethod (c$, "configureReferenceAnnotationsMenu", 
+ function (menuItem, forSequences) {
+menuItem.setEnabled (false);
+var tipEntries =  new java.util.TreeMap ();
+var candidates =  new java.util.LinkedHashMap ();
+var al = this.ap.av.getAlignment ();
+jalview.analysis.AlignmentUtils.findAddableReferenceAnnotations (forSequences, tipEntries, candidates, al);
+if (!candidates.isEmpty ()) {
+var tooltip =  new StringBuilder (64);
+tooltip.append (jalview.util.MessageManager.getString ("label.add_annotations_for"));
+menuItem.setEnabled (true);
+menuItem.addActionListener (((Clazz_isClassDefined ("jalview.appletgui.APopupMenu$1") ? 0 : jalview.appletgui.APopupMenu.$APopupMenu$1$ ()), Clazz_innerTypeInstance (jalview.appletgui.APopupMenu$1, this, Clazz_cloneFinals ("candidates", candidates))));
+}}, "awt2swing.MenuItem,java.util.List");
+Clazz_defineMethod (c$, "addReferenceAnnotations_actionPerformed", 
+function (candidates) {
+var selectionGroup = this.ap.av.getSelectionGroup ();
+var alignment = this.ap.getAlignment ();
+jalview.analysis.AlignmentUtils.addReferenceAnnotations (candidates, alignment, selectionGroup);
+this.refresh ();
+}, "java.util.Map");
+Clazz_defineMethod (c$, "addshowLink", 
+ function (linkMenu, target, url) {
+this.addshowLink (linkMenu, target, target, url);
+}, "awt2swing.Menu,~S,~S");
+Clazz_defineMethod (c$, "addshowLink", 
+ function (linkMenu, target, label, url) {
+var item =  new awt2swing.MenuItem (label);
+item.addActionListener (((Clazz_isClassDefined ("jalview.appletgui.APopupMenu$2") ? 0 : jalview.appletgui.APopupMenu.$APopupMenu$2$ ()), Clazz_innerTypeInstance (jalview.appletgui.APopupMenu$2, this, Clazz_cloneFinals ("url", url, "target", target))));
+linkMenu.add (item);
+}, "awt2swing.Menu,~S,~S,~S");
+Clazz_overrideMethod (c$, "itemStateChanged", 
+function (evt) {
+if (evt.getSource () === this.abovePIDColour) {
+this.abovePIDColour_itemStateChanged ();
+} else if (evt.getSource () === this.showColourText) {
+this.showColourText_itemStateChanged ();
+} else if (evt.getSource () === this.showText) {
+this.showText_itemStateChanged ();
+} else if (evt.getSource () === this.showBoxes) {
+this.showBoxes_itemStateChanged ();
+} else if (evt.getSource () === this.displayNonconserved) {
+this.showNonconserved_itemStateChanged ();
+}}, "java.awt.event.ItemEvent");
+Clazz_overrideMethod (c$, "actionPerformed", 
+function (evt) {
+var source = evt.getSource ();
+if (source === this.clustalColour) {
+this.clustalColour_actionPerformed ();
+} else if (source === this.zappoColour) {
+this.zappoColour_actionPerformed ();
+} else if (source === this.taylorColour) {
+this.taylorColour_actionPerformed ();
+} else if (source === this.hydrophobicityColour) {
+this.hydrophobicityColour_actionPerformed ();
+} else if (source === this.helixColour) {
+this.helixColour_actionPerformed ();
+} else if (source === this.strandColour) {
+this.strandColour_actionPerformed ();
+} else if (source === this.turnColour) {
+this.turnColour_actionPerformed ();
+} else if (source === this.buriedColour) {
+this.buriedColour_actionPerformed ();
+} else if (source === this.nucleotideMenuItem) {
+this.nucleotideMenuItem_actionPerformed ();
+} else if (source === this.userDefinedColour) {
+this.userDefinedColour_actionPerformed ();
+} else if (source === this.PIDColour) {
+this.PIDColour_actionPerformed ();
+} else if (source === this.BLOSUM62Colour) {
+this.BLOSUM62Colour_actionPerformed ();
+} else if (source === this.noColourmenuItem) {
+this.noColourmenuItem_actionPerformed ();
+} else if (source === this.conservationMenuItem) {
+this.conservationMenuItem_itemStateChanged ();
+} else if (source === this.unGroupMenuItem) {
+this.unGroupMenuItem_actionPerformed ();
+} else if (source === this.createGroupMenuItem) {
+this.createGroupMenuItem_actionPerformed ();
+} else if (source === this.sequenceName) {
+this.editName ();
+} else if (source === this.makeReferenceSeq) {
+this.makeReferenceSeq_actionPerformed ();
+} else if (source === this.sequenceDetails) {
+this.showSequenceDetails ();
+} else if (source === this.selSeqDetails) {
+this.showSequenceSelectionDetails ();
+} else if (source === this.pdb) {
+this.addPDB ();
+} else if (source === this.hideSeqs) {
+this.hideSequences (false);
+} else if (source === this.repGroup) {
+this.hideSequences (true);
+} else if (source === this.revealSeq) {
+this.ap.av.showSequence (this.revealSeq_index);
+} else if (source === this.revealAll) {
+this.ap.av.showAllHiddenSeqs ();
+} else if (source === this.editGroupName) {
+var dialog =  new jalview.appletgui.EditNameDialog (this.getGroup ().getName (), this.getGroup ().getDescription (), "       Group Name", "Group Description", this.ap.alignFrame, "Edit Group Name / Description", 500, 100, true);
+if (dialog.accept) {
+this.getGroup ().setName (dialog.getName ().$replace (' ', '_'));
+this.getGroup ().setDescription (dialog.getDescription ());
+}} else if (source === this.copy) {
+this.ap.alignFrame.copy_actionPerformed ();
+} else if (source === this.cut) {
+this.ap.alignFrame.cut_actionPerformed ();
+} else if (source === this.editSequence) {
+var sg = this.ap.av.getSelectionGroup ();
+if (sg != null) {
+if (this.seq == null) {
+this.seq = sg.getSequenceAt (0);
+}var dialog =  new jalview.appletgui.EditNameDialog (this.seq.getSequenceAsString (sg.getStartRes (), sg.getEndRes () + 1), null, "Edit Sequence ", null, this.ap.alignFrame, "Edit Sequence", 500, 100, true);
+if (dialog.accept) {
+var editCommand =  new jalview.commands.EditCommand (jalview.util.MessageManager.getString ("label.edit_sequences"), jalview.commands.EditCommand.Action.REPLACE, dialog.getName ().$replace (' ', this.ap.av.getGapCharacter ()), sg.getSequencesAsArray (this.ap.av.getHiddenRepSequences ()), sg.getStartRes (), sg.getEndRes () + 1, this.ap.av.getAlignment ());
+this.ap.alignFrame.addHistoryItem (editCommand);
+this.ap.av.firePropertyChange ("alignment", null, this.ap.av.getAlignment ().getSequences ());
+}}} else if (source === this.toUpper || source === this.toLower || source === this.toggleCase) {
+var sg = this.ap.av.getSelectionGroup ();
+if (sg != null) {
+var startEnd = this.ap.av.getVisibleRegionBoundaries (sg.getStartRes (), sg.getEndRes () + 1);
+var description;
+var caseChange;
+if (source === this.toggleCase) {
+description = "Toggle Case";
+caseChange = jalview.commands.ChangeCaseCommand.TOGGLE_CASE;
+} else if (source === this.toUpper) {
+description = "To Upper Case";
+caseChange = jalview.commands.ChangeCaseCommand.TO_UPPER;
+} else {
+description = "To Lower Case";
+caseChange = jalview.commands.ChangeCaseCommand.TO_LOWER;
+}var caseCommand =  new jalview.commands.ChangeCaseCommand (description, sg.getSequencesAsArray (this.ap.av.getHiddenRepSequences ()), startEnd, caseChange);
+this.ap.alignFrame.addHistoryItem (caseCommand);
+this.ap.av.firePropertyChange ("alignment", null, this.ap.av.getAlignment ().getSequences ());
+}} else if (source === this.sequenceFeature) {
+var sg = this.ap.av.getSelectionGroup ();
+if (sg == null) {
+return;
+}var rsize = 0;
+var gSize = sg.getSize ();
+var rseqs;
+var seqs =  new Array (gSize);
+var tfeatures;
+var features =  new Array (gSize);
+for (var i = 0; i < gSize; i++) {
+var start = sg.getSequenceAt (i).findPosition (sg.getStartRes ());
+var end = sg.findEndRes (sg.getSequenceAt (i));
+if (start <= end) {
+seqs[rsize] = sg.getSequenceAt (i);
+features[rsize] =  new jalview.datamodel.SequenceFeature (null, null, null, start, end, "Jalview");
+rsize++;
+}}
+rseqs =  new Array (rsize);
+tfeatures =  new Array (rsize);
+System.arraycopy (seqs, 0, rseqs, 0, rsize);
+System.arraycopy (features, 0, tfeatures, 0, rsize);
+features = tfeatures;
+seqs = rseqs;
+if (this.ap.seqPanel.seqCanvas.getFeatureRenderer ().amendFeatures (seqs, features, true, this.ap)) {
+this.ap.alignFrame.sequenceFeatures.setState (true);
+this.ap.av.setShowSequenceFeatures (true);
+;this.ap.highlightSearchResults (null);
+}} else {
+this.outputText (evt);
+}}, "java.awt.event.ActionEvent");
+Clazz_defineMethod (c$, "outputText", 
+function (e) {
+var cap =  new jalview.appletgui.CutAndPasteTransfer (true, this.ap.alignFrame);
+var frame =  new awt2swing.Frame ();
+frame.add (cap);
+jalview.bin.JalviewLite.addFrame (frame, jalview.util.MessageManager.formatMessage ("label.selection_output_command",  Clazz_newArray (-1, [e.getActionCommand ()])), 600, 500);
+cap.setText ( new jalview.io.AppletFormatAdapter ().formatSequences (e.getActionCommand (), this.ap.av.getShowJVSuffix (), this.ap, true));
+}, "java.awt.event.ActionEvent");
+Clazz_defineMethod (c$, "showSequenceSelectionDetails", 
+function () {
+this.createSequenceDetailsReport (this.ap.av.getSequenceSelection ());
+});
+Clazz_defineMethod (c$, "showSequenceDetails", 
+function () {
+this.createSequenceDetailsReport ( Clazz_newArray (-1, [this.seq]));
+});
+Clazz_defineMethod (c$, "createSequenceDetailsReport", 
+function (sequences) {
+var cap =  new jalview.appletgui.CutAndPasteTransfer (false, this.ap.alignFrame);
+var contents =  new StringBuffer ();
+for (var seq, $seq = 0, $$seq = sequences; $seq < $$seq.length && ((seq = $$seq[$seq]) || true); $seq++) {
+contents.append (jalview.util.MessageManager.formatMessage ("label.annotation_for_displayid",  Clazz_newArray (-1, [seq.getDisplayId (true)])));
+ new jalview.io.SequenceAnnotationReport (null).createSequenceAnnotationReport (contents, seq, true, true, false, (this.ap.seqPanel.seqCanvas.fr != null) ? this.ap.seqPanel.seqCanvas.fr.getMinMax () : null);
+contents.append ("</p>");
+}
+var frame =  new awt2swing.Frame ();
+frame.add (cap);
+jalview.bin.JalviewLite.addFrame (frame, "Sequence Details for " + (sequences.length == 1 ? sequences[0].getDisplayId (true) : "Selection"), 600, 500);
+cap.setText (jalview.util.MessageManager.formatMessage ("label.html_content",  Clazz_newArray (-1, [contents.toString ()])));
+}, "~A");
+Clazz_defineMethod (c$, "editName", 
+function () {
+var dialog =  new jalview.appletgui.EditNameDialog (this.seq.getName (), this.seq.getDescription (), "       Sequence Name", "Sequence Description", this.ap.alignFrame, "Edit Sequence Name / Description", 500, 100, true);
+if (dialog.accept) {
+this.seq.setName (dialog.getName ());
+this.seq.setDescription (dialog.getDescription ());
+this.ap.paintAlignment (false);
+}});
+Clazz_defineMethod (c$, "addPDB", 
+function () {
+if (this.seq.getPDBId () != null) {
+var entry = this.seq.getPDBId ().firstElement ();
+if (this.ap.av.applet.jmolAvailable) {
+ new jalview.appletgui.AppletJmol (entry,  Clazz_newArray (-1, [this.seq]), null, this.ap, jalview.io.AppletFormatAdapter.URL);
+}} else {
+var cap =  new jalview.appletgui.CutAndPasteTransfer (true, this.ap.alignFrame);
+cap.setText (jalview.util.MessageManager.getString ("label.paste_pdb_file"));
+cap.setPDBImport (this.seq);
+var frame =  new awt2swing.Frame ();
+frame.add (cap);
+jalview.bin.JalviewLite.addFrame (frame, jalview.util.MessageManager.formatMessage ("label.paste_pdb_file_for_sequence",  Clazz_newArray (-1, [this.seq.getName ()])), 400, 300);
+}});
+Clazz_defineMethod (c$, "jbInit", 
+ function () {
+this.groupMenu.setLabel (jalview.util.MessageManager.getString ("label.selection"));
+this.sequenceFeature.addActionListener (this);
+this.editGroupName.addActionListener (this);
+this.unGroupMenuItem.setLabel (jalview.util.MessageManager.getString ("action.remove_group"));
+this.unGroupMenuItem.addActionListener (this);
+this.createGroupMenuItem.setLabel (jalview.util.MessageManager.getString ("action.create_group"));
+this.createGroupMenuItem.addActionListener (this);
+this.nucleotideMenuItem.setLabel (jalview.util.MessageManager.getString ("label.nucleotide"));
+this.nucleotideMenuItem.addActionListener (this);
+this.conservationMenuItem.addItemListener (this);
+this.abovePIDColour.addItemListener (this);
+this.colourMenu.setLabel (jalview.util.MessageManager.getString ("label.group_colour"));
+this.showBoxes.setLabel (jalview.util.MessageManager.getString ("action.boxes"));
+this.showBoxes.setState (true);
+this.showBoxes.addItemListener (this);
+this.sequenceName.addActionListener (this);
+this.sequenceDetails.addActionListener (this);
+this.selSeqDetails.addActionListener (this);
+this.displayNonconserved.setLabel (jalview.util.MessageManager.getString ("label.show_non_conversed"));
+this.displayNonconserved.setState (false);
+this.displayNonconserved.addItemListener (this);
+this.showText.setLabel (jalview.util.MessageManager.getString ("action.text"));
+this.showText.addItemListener (this);
+this.showColourText.setLabel (jalview.util.MessageManager.getString ("label.colour_text"));
+this.showColourText.addItemListener (this);
+this.outputmenu.setLabel (jalview.util.MessageManager.getString ("label.out_to_textbox"));
+this.seqMenu.setLabel (jalview.util.MessageManager.getString ("label.sequence"));
+this.pdb.setLabel (jalview.util.MessageManager.getString ("label.view_pdb_structure"));
+this.hideSeqs.setLabel (jalview.util.MessageManager.getString ("action.hide_sequences"));
+this.repGroup.setLabel (jalview.util.MessageManager.formatMessage ("label.represent_group_with",  Clazz_newArray (-1, [""])));
+this.revealAll.setLabel (jalview.util.MessageManager.getString ("action.reveal_all"));
+this.revealSeq.setLabel (jalview.util.MessageManager.getString ("action.reveal_sequences"));
+this.menu1.setLabel (jalview.util.MessageManager.getString ("label.group") + ":");
+this.add (this.groupMenu);
+this.add (this.seqMenu);
+this.add (this.hideSeqs);
+this.add (this.revealSeq);
+this.add (this.revealAll);
+this.groupMenu.add (this.groupShowAnnotationsMenu);
+this.groupMenu.add (this.groupHideAnnotationsMenu);
+this.groupMenu.add (this.groupAddReferenceAnnotations);
+this.groupMenu.add (this.editMenu);
+this.groupMenu.add (this.outputmenu);
+this.groupMenu.add (this.sequenceFeature);
+this.groupMenu.add (this.createGroupMenuItem);
+this.groupMenu.add (this.unGroupMenuItem);
+this.groupMenu.add (this.menu1);
+this.colourMenu.add (this.noColourmenuItem);
+this.colourMenu.add (this.clustalColour);
+this.colourMenu.add (this.BLOSUM62Colour);
+this.colourMenu.add (this.PIDColour);
+this.colourMenu.add (this.zappoColour);
+this.colourMenu.add (this.taylorColour);
+this.colourMenu.add (this.hydrophobicityColour);
+this.colourMenu.add (this.helixColour);
+this.colourMenu.add (this.strandColour);
+this.colourMenu.add (this.turnColour);
+this.colourMenu.add (this.buriedColour);
+this.colourMenu.add (this.nucleotideMenuItem);
+this.colourMenu.add (this.userDefinedColour);
+this.colourMenu.addSeparator ();
+this.colourMenu.add (this.abovePIDColour);
+this.colourMenu.add (this.conservationMenuItem);
+this.noColourmenuItem.setLabel (jalview.util.MessageManager.getString ("label.none"));
+this.noColourmenuItem.addActionListener (this);
+this.clustalColour.setLabel (jalview.util.MessageManager.getString ("label.clustalx_colours"));
+this.clustalColour.addActionListener (this);
+this.zappoColour.setLabel (jalview.util.MessageManager.getString ("label.zappo"));
+this.zappoColour.addActionListener (this);
+this.taylorColour.setLabel (jalview.util.MessageManager.getString ("label.taylor"));
+this.taylorColour.addActionListener (this);
+this.hydrophobicityColour.setLabel (jalview.util.MessageManager.getString ("label.hydrophobicity"));
+this.hydrophobicityColour.addActionListener (this);
+this.helixColour.setLabel (jalview.util.MessageManager.getString ("label.helix_propensity"));
+this.helixColour.addActionListener (this);
+this.strandColour.setLabel (jalview.util.MessageManager.getString ("label.strand_propensity"));
+this.strandColour.addActionListener (this);
+this.turnColour.setLabel (jalview.util.MessageManager.getString ("label.turn_propensity"));
+this.turnColour.addActionListener (this);
+this.buriedColour.setLabel (jalview.util.MessageManager.getString ("label.buried_index"));
+this.buriedColour.addActionListener (this);
+this.abovePIDColour.setLabel (jalview.util.MessageManager.getString ("label.above_identity_percentage"));
+this.userDefinedColour.setLabel (jalview.util.MessageManager.getString ("action.user_defined"));
+this.userDefinedColour.addActionListener (this);
+this.PIDColour.setLabel (jalview.util.MessageManager.getString ("action.percentage_identity"));
+this.PIDColour.addActionListener (this);
+this.BLOSUM62Colour.setLabel ("BLOSUM62");
+this.BLOSUM62Colour.addActionListener (this);
+this.conservationMenuItem.setLabel (jalview.util.MessageManager.getString ("label.conservation"));
+this.editMenu.add (this.copy);
+this.copy.addActionListener (this);
+this.editMenu.add (this.cut);
+this.cut.addActionListener (this);
+this.editMenu.add (this.editSequence);
+this.editSequence.addActionListener (this);
+this.editMenu.add (this.toUpper);
+this.toUpper.addActionListener (this);
+this.editMenu.add (this.toLower);
+this.toLower.addActionListener (this);
+this.editMenu.add (this.toggleCase);
+this.seqMenu.add (this.seqShowAnnotationsMenu);
+this.seqMenu.add (this.seqHideAnnotationsMenu);
+this.seqMenu.add (this.seqAddReferenceAnnotations);
+this.seqMenu.add (this.sequenceName);
+this.seqMenu.add (this.makeReferenceSeq);
+if (!this.ap.av.applet.useXtrnalSviewer) {
+this.seqMenu.add (this.pdb);
+}this.seqMenu.add (this.repGroup);
+this.menu1.add (this.editGroupName);
+this.menu1.add (this.colourMenu);
+this.menu1.add (this.showBoxes);
+this.menu1.add (this.showText);
+this.menu1.add (this.showColourText);
+this.menu1.add (this.displayNonconserved);
+this.toggleCase.addActionListener (this);
+this.pdb.addActionListener (this);
+this.hideSeqs.addActionListener (this);
+this.repGroup.addActionListener (this);
+this.revealAll.addActionListener (this);
+this.revealSeq.addActionListener (this);
+this.makeReferenceSeq.addActionListener (this);
+});
+Clazz_defineMethod (c$, "refresh", 
+function () {
+this.ap.paintAlignment (true);
+});
+Clazz_defineMethod (c$, "clustalColour_actionPerformed", 
+function () {
+var sg = this.getGroup ();
+sg.cs =  new jalview.schemes.ClustalxColourScheme (sg, this.ap.av.getHiddenRepSequences ());
+this.refresh ();
+});
+Clazz_defineMethod (c$, "zappoColour_actionPerformed", 
+function () {
+this.getGroup ().cs =  new jalview.schemes.ZappoColourScheme ();
+this.refresh ();
+});
+Clazz_defineMethod (c$, "taylorColour_actionPerformed", 
+function () {
+this.getGroup ().cs =  new jalview.schemes.TaylorColourScheme ();
+this.refresh ();
+});
+Clazz_defineMethod (c$, "hydrophobicityColour_actionPerformed", 
+function () {
+this.getGroup ().cs =  new jalview.schemes.HydrophobicColourScheme ();
+this.refresh ();
+});
+Clazz_defineMethod (c$, "helixColour_actionPerformed", 
+function () {
+this.getGroup ().cs =  new jalview.schemes.HelixColourScheme ();
+this.refresh ();
+});
+Clazz_defineMethod (c$, "strandColour_actionPerformed", 
+function () {
+this.getGroup ().cs =  new jalview.schemes.StrandColourScheme ();
+this.refresh ();
+});
+Clazz_defineMethod (c$, "turnColour_actionPerformed", 
+function () {
+this.getGroup ().cs =  new jalview.schemes.TurnColourScheme ();
+this.refresh ();
+});
+Clazz_defineMethod (c$, "buriedColour_actionPerformed", 
+function () {
+this.getGroup ().cs =  new jalview.schemes.BuriedColourScheme ();
+this.refresh ();
+});
+Clazz_defineMethod (c$, "nucleotideMenuItem_actionPerformed", 
+function () {
+this.getGroup ().cs =  new jalview.schemes.NucleotideColourScheme ();
+this.refresh ();
+});
+Clazz_defineMethod (c$, "abovePIDColour_itemStateChanged", 
+function () {
+var sg = this.getGroup ();
+if (sg.cs == null) {
+return;
+}if (this.abovePIDColour.getState ()) {
+sg.cs.setConsensus (jalview.analysis.AAFrequency.calculate (sg.getSequences (this.ap.av.getHiddenRepSequences ()), 0, this.ap.av.getAlignment ().getWidth ()));
+var threshold = jalview.appletgui.SliderPanel.setPIDSliderSource (this.ap, sg.cs, this.getGroup ().getName ());
+sg.cs.setThreshold (threshold, this.ap.av.isIgnoreGapsConsensus ());
+jalview.appletgui.SliderPanel.showPIDSlider ();
+} else {
+sg.cs.setThreshold (0, this.ap.av.isIgnoreGapsConsensus ());
+}this.refresh ();
+});
+Clazz_defineMethod (c$, "userDefinedColour_actionPerformed", 
+function () {
+ new jalview.appletgui.UserDefinedColours (this.ap, this.getGroup ());
+});
+Clazz_defineMethod (c$, "PIDColour_actionPerformed", 
+function () {
+var sg = this.getGroup ();
+sg.cs =  new jalview.schemes.PIDColourScheme ();
+sg.cs.setConsensus (jalview.analysis.AAFrequency.calculate (sg.getSequences (this.ap.av.getHiddenRepSequences ()), 0, this.ap.av.getAlignment ().getWidth ()));
+this.refresh ();
+});
+Clazz_defineMethod (c$, "BLOSUM62Colour_actionPerformed", 
+function () {
+var sg = this.getGroup ();
+sg.cs =  new jalview.schemes.Blosum62ColourScheme ();
+sg.cs.setConsensus (jalview.analysis.AAFrequency.calculate (sg.getSequences (this.ap.av.getHiddenRepSequences ()), 0, this.ap.av.getAlignment ().getWidth ()));
+this.refresh ();
+});
+Clazz_defineMethod (c$, "noColourmenuItem_actionPerformed", 
+function () {
+this.getGroup ().cs = null;
+this.refresh ();
+});
+Clazz_defineMethod (c$, "conservationMenuItem_itemStateChanged", 
+function () {
+var sg = this.getGroup ();
+if (sg.cs == null) {
+return;
+}if (this.conservationMenuItem.getState ()) {
+sg.cs.setConservation (jalview.analysis.Conservation.calculateConservation ("Group", jalview.schemes.ResidueProperties.propHash, 3, sg.getSequences (this.ap.av.getHiddenRepSequences ()), 0, this.ap.av.getAlignment ().getWidth (), false, this.ap.av.getConsPercGaps (), false));
+jalview.appletgui.SliderPanel.setConservationSlider (this.ap, sg.cs, sg.getName ());
+jalview.appletgui.SliderPanel.showConservationSlider ();
+} else {
+sg.cs.setConservation (null);
+}this.refresh ();
+});
+Clazz_defineMethod (c$, "getGroup", 
+function () {
+var sg = this.ap.av.getSelectionGroup ();
+if (sg != null) {
+this.ap.av.getAlignment ().addGroup (sg);
+}return sg;
+});
+Clazz_defineMethod (c$, "unGroupMenuItem_actionPerformed", 
+function () {
+var sg = this.ap.av.getSelectionGroup ();
+this.ap.av.getAlignment ().deleteGroup (sg);
+this.ap.av.setSelectionGroup (null);
+this.ap.paintAlignment (true);
+});
+Clazz_defineMethod (c$, "createGroupMenuItem_actionPerformed", 
+function () {
+this.getGroup ();
+this.refresh ();
+});
+Clazz_defineMethod (c$, "showColourText_itemStateChanged", 
+function () {
+this.getGroup ().setColourText (this.showColourText.getState ());
+this.refresh ();
+});
+Clazz_defineMethod (c$, "showText_itemStateChanged", 
+function () {
+this.getGroup ().setDisplayText (this.showText.getState ());
+this.refresh ();
+});
+Clazz_defineMethod (c$, "makeReferenceSeq_actionPerformed", 
+function () {
+if (!this.ap.av.getAlignment ().hasSeqrep ()) {
+this.ap.av.setDisplayReferenceSeq (true);
+this.ap.av.setColourByReferenceSeq (true);
+this.ap.av.getAlignment ().setSeqrep (this.seq);
+} else {
+if (this.ap.av.getAlignment ().getSeqrep () === this.seq) {
+this.ap.av.getAlignment ().setSeqrep (null);
+} else {
+this.ap.av.getAlignment ().setSeqrep (this.seq);
+}}this.refresh ();
+});
+Clazz_defineMethod (c$, "showNonconserved_itemStateChanged", 
+function () {
+this.getGroup ().setShowNonconserved (this.displayNonconserved.getState ());
+this.refresh ();
+});
+Clazz_defineMethod (c$, "showBoxes_itemStateChanged", 
+function () {
+this.getGroup ().setDisplayBoxes (this.showBoxes.getState ());
+this.refresh ();
+});
+Clazz_defineMethod (c$, "hideSequences", 
+function (representGroup) {
+var sg = this.ap.av.getSelectionGroup ();
+if (sg == null || sg.getSize () < 1) {
+this.ap.av.hideSequence ( Clazz_newArray (-1, [this.seq]));
+return;
+}this.ap.av.setSelectionGroup (null);
+if (representGroup) {
+this.ap.av.hideRepSequences (this.seq, sg);
+return;
+}var gsize = sg.getSize ();
+var hseqs;
+hseqs =  new Array (gsize);
+var index = 0;
+for (var i = 0; i < gsize; i++) {
+hseqs[index++] = sg.getSequenceAt (i);
+}
+this.ap.av.hideSequence (hseqs);
+this.ap.av.sendSelection ();
+}, "~B");
+Clazz_defineMethod (c$, "buildAnnotationTypesMenus", 
+function (showMenu, hideMenu, forSequences) {
+showMenu.removeAll ();
+hideMenu.removeAll ();
+var all = java.util.Arrays.asList (["All"]);
+this.addAnnotationTypeToShowHide (showMenu, forSequences, "", all, true, true);
+this.addAnnotationTypeToShowHide (hideMenu, forSequences, "", all, true, false);
+showMenu.addSeparator ();
+hideMenu.addSeparator ();
+var annotations = this.ap.getAlignment ().getAlignmentAnnotation ();
+var shownTypes =  new java.util.LinkedHashMap ();
+var hiddenTypes =  new java.util.LinkedHashMap ();
+jalview.analysis.AlignmentAnnotationUtils.getShownHiddenTypes (shownTypes, hiddenTypes, jalview.analysis.AlignmentAnnotationUtils.asList (annotations), forSequences);
+for (var calcId, $calcId = hiddenTypes.keySet ().iterator (); $calcId.hasNext () && ((calcId = $calcId.next ()) || true);) {
+for (var type, $type = hiddenTypes.get (calcId).iterator (); $type.hasNext () && ((type = $type.next ()) || true);) {
+this.addAnnotationTypeToShowHide (showMenu, forSequences, calcId, type, false, true);
+}
+}
+showMenu.setEnabled (!hiddenTypes.isEmpty ());
+for (var calcId, $calcId = shownTypes.keySet ().iterator (); $calcId.hasNext () && ((calcId = $calcId.next ()) || true);) {
+for (var type, $type = shownTypes.get (calcId).iterator (); $type.hasNext () && ((type = $type.next ()) || true);) {
+this.addAnnotationTypeToShowHide (hideMenu, forSequences, calcId, type, false, false);
+}
+}
+hideMenu.setEnabled (!shownTypes.isEmpty ());
+}, "awt2swing.Menu,awt2swing.Menu,java.util.List");
+Clazz_defineMethod (c$, "addAnnotationTypeToShowHide", 
+function (showOrHideMenu, forSequences, calcId, types, allTypes, actionIsShow) {
+var label = types.toString ();
+label = label.substring (1, label.length - 1);
+var item =  new awt2swing.MenuItem (label);
+item.addActionListener (((Clazz_isClassDefined ("jalview.appletgui.APopupMenu$3") ? 0 : jalview.appletgui.APopupMenu.$APopupMenu$3$ ()), Clazz_innerTypeInstance (jalview.appletgui.APopupMenu$3, this, Clazz_cloneFinals ("types", types, "forSequences", forSequences, "allTypes", allTypes, "actionIsShow", actionIsShow))));
+showOrHideMenu.add (item);
+}, "awt2swing.Menu,java.util.List,~S,java.util.List,~B,~B");
+c$.$APopupMenu$1$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_declareAnonymous (jalview.appletgui, "APopupMenu$1", null, java.awt.event.ActionListener);
+Clazz_overrideMethod (c$, "actionPerformed", 
+function (e) {
+this.b$["jalview.appletgui.APopupMenu"].addReferenceAnnotations_actionPerformed (this.f$.candidates);
+}, "java.awt.event.ActionEvent");
+c$ = Clazz_p0p ();
+};
+c$.$APopupMenu$2$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_declareAnonymous (jalview.appletgui, "APopupMenu$2", null, java.awt.event.ActionListener);
+Clazz_overrideMethod (c$, "actionPerformed", 
+function (e) {
+this.b$["jalview.appletgui.APopupMenu"].ap.alignFrame.showURL (this.f$.url, this.f$.target);
+}, "java.awt.event.ActionEvent");
+c$ = Clazz_p0p ();
+};
+c$.$APopupMenu$3$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_declareAnonymous (jalview.appletgui, "APopupMenu$3", null, java.awt.event.ActionListener);
+Clazz_overrideMethod (c$, "actionPerformed", 
+function (e) {
+jalview.analysis.AlignmentUtils.showOrHideSequenceAnnotations (this.b$["jalview.appletgui.APopupMenu"].ap.getAlignment (), this.f$.types, this.f$.forSequences, this.f$.allTypes, this.f$.actionIsShow);
+this.b$["jalview.appletgui.APopupMenu"].refresh ();
+}, "java.awt.event.ActionEvent");
+c$ = Clazz_p0p ();
+};
+Clazz_defineStatics (c$,
+"ALL_ANNOTATIONS", "All");
+});
+Clazz_declarePackage ("jalview.analysis");
+Clazz_load (null, "jalview.analysis.AlignmentAnnotationUtils", ["java.util.ArrayList", "$.Arrays", "$.BitSet", "$.Collections", "$.HashMap"], function () {
+c$ = Clazz_declareType (jalview.analysis, "AlignmentAnnotationUtils");
+c$.getShownHiddenTypes = Clazz_defineMethod (c$, "getShownHiddenTypes", 
+function (shownTypes, hiddenTypes, annotations, forSequences) {
+var visibleGraphGroups = jalview.analysis.AlignmentAnnotationUtils.getVisibleLineGraphGroups (annotations);
+var groupLabels =  new java.util.HashMap ();
+var addedToShown =  new java.util.ArrayList ();
+var addedToHidden =  new java.util.ArrayList ();
+for (var aa, $aa = annotations.iterator (); $aa.hasNext () && ((aa = $aa.next ()) || true);) {
+if (aa.annotations == null) {
+continue;
+}if (forSequences != null && (aa.sequenceRef != null && forSequences.contains (aa.sequenceRef))) {
+var calcId = aa.getCalcId ();
+var labelAsList =  new java.util.ArrayList ();
+var displayLabel = aa.label;
+labelAsList.add (displayLabel);
+if (aa.graph == 2 && aa.graphGroup > -1) {
+if (!groupLabels.containsKey (calcId)) {
+groupLabels.put (calcId,  new java.util.HashMap ());
+}var groupLabelsForCalcId = groupLabels.get (calcId);
+if (groupLabelsForCalcId.containsKey (new Integer (aa.graphGroup))) {
+if (!groupLabelsForCalcId.get (new Integer (aa.graphGroup)).contains (displayLabel)) {
+groupLabelsForCalcId.get (new Integer (aa.graphGroup)).add (displayLabel);
+}} else {
+groupLabelsForCalcId.put (new Integer (aa.graphGroup), labelAsList);
+}} else {
+var rememberAs = calcId + "!" + displayLabel;
+if (aa.visible && !addedToShown.contains (rememberAs)) {
+if (!shownTypes.containsKey (calcId)) {
+shownTypes.put (calcId,  new java.util.ArrayList ());
+}shownTypes.get (calcId).add (labelAsList);
+addedToShown.add (rememberAs);
+} else {
+if (!aa.visible && !addedToHidden.contains (rememberAs)) {
+if (!hiddenTypes.containsKey (calcId)) {
+hiddenTypes.put (calcId,  new java.util.ArrayList ());
+}hiddenTypes.get (calcId).add (labelAsList);
+addedToHidden.add (rememberAs);
+}}}}}
+for (var calcId, $calcId = groupLabels.keySet ().iterator (); $calcId.hasNext () && ((calcId = $calcId.next ()) || true);) {
+for (var group, $group = groupLabels.get (calcId).keySet ().iterator (); $group.hasNext () && ((group = $group.next ()) || true);) {
+var groupLabel = groupLabels.get (calcId).get (new Integer (group));
+java.util.Collections.sort (groupLabel);
+if (visibleGraphGroups.get (group)) {
+if (!shownTypes.containsKey (calcId)) {
+shownTypes.put (calcId,  new java.util.ArrayList ());
+}if (!shownTypes.get (calcId).contains (groupLabel)) {
+shownTypes.get (calcId).add (groupLabel);
+}} else {
+if (!hiddenTypes.containsKey (calcId)) {
+hiddenTypes.put (calcId,  new java.util.ArrayList ());
+}if (!hiddenTypes.get (calcId).contains (groupLabel)) {
+hiddenTypes.get (calcId).add (groupLabel);
+}}}
+}
+}, "java.util.Map,java.util.Map,java.util.List,java.util.List");
+c$.getVisibleLineGraphGroups = Clazz_defineMethod (c$, "getVisibleLineGraphGroups", 
+function (annotations) {
+var result =  new java.util.BitSet ();
+for (var ann, $ann = annotations.iterator (); $ann.hasNext () && ((ann = $ann.next ()) || true);) {
+if (ann.graph == 2 && ann.visible) {
+var gg = ann.graphGroup;
+if (gg > -1) {
+result.set (gg);
+}}}
+return result;
+}, "java.util.List");
+c$.asList = Clazz_defineMethod (c$, "asList", 
+function (anns) {
+return (anns == null ? java.util.Collections.emptyList () : java.util.Arrays.asList (anns));
+}, "~A");
+});
+Clazz_declarePackage ("jalview.appletgui");
+Clazz_load (["awt2swing.Panel", "java.awt.event.ActionListener", "$.AdjustmentListener", "$.MouseListener", "awt2swing.Button", "$.Checkbox", "$.Label", "$.Scrollbar", "$.TextField", "java.awt.BorderLayout", "$.FlowLayout"], "jalview.appletgui.SliderPanel", ["awt2swing.Frame", "jalview.bin.JalviewLite", "jalview.util.MessageManager", "java.awt.Color", "$.Font", "java.awt.event.WindowAdapter"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.ap = null;
+this.forConservation = true;
+this.cs = null;
+this.slider = null;
+this.valueField = null;
+this.label = null;
+this.jPanel1 = null;
+this.jPanel2 = null;
+this.applyButton = null;
+this.undoButton = null;
+this.flowLayout1 = null;
+this.allGroupsCheck = null;
+this.borderLayout1 = null;
+this.borderLayout2 = null;
+this.flowLayout2 = null;
+Clazz_instantialize (this, arguments);
+}, jalview.appletgui, "SliderPanel", awt2swing.Panel, [java.awt.event.ActionListener, java.awt.event.AdjustmentListener, java.awt.event.MouseListener]);
+Clazz_prepareFields (c$, function () {
+this.slider =  new awt2swing.Scrollbar ();
+this.valueField =  new awt2swing.TextField ();
+this.label =  new awt2swing.Label ();
+this.jPanel1 =  new awt2swing.Panel ();
+this.jPanel2 =  new awt2swing.Panel ();
+this.applyButton =  new awt2swing.Button ();
+this.undoButton =  new awt2swing.Button ();
+this.flowLayout1 =  new java.awt.FlowLayout ();
+this.allGroupsCheck =  new awt2swing.Checkbox ();
+this.borderLayout1 =  new java.awt.BorderLayout ();
+this.borderLayout2 =  new java.awt.BorderLayout ();
+this.flowLayout2 =  new java.awt.FlowLayout ();
+});
+c$.setConservationSlider = Clazz_defineMethod (c$, "setConservationSlider", 
+function (ap, cs, source) {
+var sp = null;
+if (jalview.appletgui.SliderPanel.conservationSlider == null) {
+sp =  new jalview.appletgui.SliderPanel (ap, cs.getConservationInc (), true, cs);
+jalview.appletgui.SliderPanel.conservationSlider =  new awt2swing.Frame ();
+jalview.appletgui.SliderPanel.conservationSlider.add (sp);
+} else {
+sp = jalview.appletgui.SliderPanel.conservationSlider.getComponent (0);
+sp.cs = cs;
+}jalview.appletgui.SliderPanel.conservationSlider.setTitle (jalview.util.MessageManager.formatMessage ("label.conservation_colour_increment",  Clazz_newArray (-1, [source])));
+if (ap.av.getAlignment ().getGroups () != null) {
+sp.setAllGroupsCheckEnabled (true);
+} else {
+sp.setAllGroupsCheckEnabled (false);
+}return sp.getValue ();
+}, "jalview.appletgui.AlignmentPanel,jalview.schemes.ColourSchemeI,~S");
+c$.showConservationSlider = Clazz_defineMethod (c$, "showConservationSlider", 
+function () {
+try {
+jalview.appletgui.SliderPanel.PIDSlider.setVisible (false);
+jalview.appletgui.SliderPanel.PIDSlider = null;
+} catch (ex) {
+if (Clazz_exceptionOf (ex, Exception)) {
+} else {
+throw ex;
+}
+}
+if (!jalview.appletgui.SliderPanel.conservationSlider.isVisible ()) {
+jalview.bin.JalviewLite.addFrame (jalview.appletgui.SliderPanel.conservationSlider, jalview.appletgui.SliderPanel.conservationSlider.getTitle (), 420, 100);
+jalview.appletgui.SliderPanel.conservationSlider.addWindowListener (((Clazz_isClassDefined ("jalview.appletgui.SliderPanel$1") ? 0 : jalview.appletgui.SliderPanel.$SliderPanel$1$ ()), Clazz_innerTypeInstance (jalview.appletgui.SliderPanel$1, this, null)));
+}});
+c$.setPIDSliderSource = Clazz_defineMethod (c$, "setPIDSliderSource", 
+function (ap, cs, source) {
+var pid = null;
+if (jalview.appletgui.SliderPanel.PIDSlider == null) {
+pid =  new jalview.appletgui.SliderPanel (ap, 50, false, cs);
+jalview.appletgui.SliderPanel.PIDSlider =  new awt2swing.Frame ();
+jalview.appletgui.SliderPanel.PIDSlider.add (pid);
+} else {
+pid = jalview.appletgui.SliderPanel.PIDSlider.getComponent (0);
+pid.cs = cs;
+}jalview.appletgui.SliderPanel.PIDSlider.setTitle (jalview.util.MessageManager.formatMessage ("label.percentage_identity_thereshold",  Clazz_newArray (-1, [source])));
+if (ap.av.getAlignment ().getGroups () != null) {
+pid.setAllGroupsCheckEnabled (true);
+} else {
+pid.setAllGroupsCheckEnabled (false);
+}return pid.getValue ();
+}, "jalview.appletgui.AlignmentPanel,jalview.schemes.ColourSchemeI,~S");
+c$.showPIDSlider = Clazz_defineMethod (c$, "showPIDSlider", 
+function () {
+try {
+jalview.appletgui.SliderPanel.conservationSlider.setVisible (false);
+jalview.appletgui.SliderPanel.conservationSlider = null;
+} catch (ex) {
+if (Clazz_exceptionOf (ex, Exception)) {
+} else {
+throw ex;
+}
+}
+if (!jalview.appletgui.SliderPanel.PIDSlider.isVisible ()) {
+jalview.bin.JalviewLite.addFrame (jalview.appletgui.SliderPanel.PIDSlider, jalview.appletgui.SliderPanel.PIDSlider.getTitle (), 420, 100);
+jalview.appletgui.SliderPanel.PIDSlider.addWindowListener (((Clazz_isClassDefined ("jalview.appletgui.SliderPanel$2") ? 0 : jalview.appletgui.SliderPanel.$SliderPanel$2$ ()), Clazz_innerTypeInstance (jalview.appletgui.SliderPanel$2, this, null)));
+}});
+Clazz_makeConstructor (c$, 
+function (ap, value, forConserve, cs) {
+Clazz_superConstructor (this, jalview.appletgui.SliderPanel, []);
+try {
+this.jbInit ();
+} catch (e) {
+if (Clazz_exceptionOf (e, Exception)) {
+e.printStackTrace ();
+} else {
+throw e;
+}
+}
+this.ap = ap;
+this.cs = cs;
+this.forConservation = forConserve;
+this.undoButton.setVisible (false);
+this.applyButton.setVisible (false);
+if (this.forConservation) {
+this.label.setText (jalview.util.MessageManager.getString ("label.modify_conservation_visibility"));
+this.slider.setMinimum (0);
+this.slider.setMaximum (50 + this.slider.getVisibleAmount ());
+this.slider.setUnitIncrement (1);
+} else {
+this.label.setText (jalview.util.MessageManager.getString ("label.colour_residues_above_occurence"));
+this.slider.setMinimum (0);
+this.slider.setMaximum (100 + this.slider.getVisibleAmount ());
+this.slider.setBlockIncrement (1);
+}this.slider.addAdjustmentListener (this);
+this.slider.addMouseListener (this);
+this.slider.setValue (value);
+this.valueField.setText (value + "");
+}, "jalview.appletgui.AlignmentPanel,~N,~B,jalview.schemes.ColourSchemeI");
+Clazz_defineMethod (c$, "valueChanged", 
+function (i) {
+if (this.cs == null) {
+return;
+}var toChange = this.cs;
+var allGroups = null;
+if (this.allGroupsCheck.getState ()) {
+allGroups = this.ap.av.getAlignment ().getGroups ().listIterator ();
+}while (toChange != null) {
+if (this.forConservation) {
+toChange.setConservationInc (i);
+} else {
+toChange.setThreshold (i, this.ap.av.isIgnoreGapsConsensus ());
+}if (allGroups != null && allGroups.hasNext ()) {
+while ((toChange = allGroups.next ().cs) == null && allGroups.hasNext ()) {
+;}
+} else {
+toChange = null;
+}}
+this.ap.seqPanel.seqCanvas.repaint ();
+}, "~N");
+Clazz_defineMethod (c$, "setAllGroupsCheckEnabled", 
+function (b) {
+this.allGroupsCheck.setEnabled (b);
+}, "~B");
+Clazz_overrideMethod (c$, "actionPerformed", 
+function (evt) {
+if (evt.getSource () === this.applyButton) {
+this.applyButton_actionPerformed ();
+} else if (evt.getSource () === this.undoButton) {
+this.undoButton_actionPerformed ();
+} else if (evt.getSource () === this.valueField) {
+this.valueField_actionPerformed ();
+}}, "java.awt.event.ActionEvent");
+Clazz_overrideMethod (c$, "adjustmentValueChanged", 
+function (evt) {
+this.valueField.setText (this.slider.getValue () + "");
+this.valueChanged (this.slider.getValue ());
+}, "java.awt.event.AdjustmentEvent");
+Clazz_defineMethod (c$, "valueField_actionPerformed", 
+function () {
+try {
+var i = Integer.parseInt (this.valueField.getText ());
+this.slider.setValue (i);
+} catch (ex) {
+if (Clazz_exceptionOf (ex, Exception)) {
+this.valueField.setText (this.slider.getValue () + "");
+} else {
+throw ex;
+}
+}
+});
+Clazz_defineMethod (c$, "setValue", 
+function (value) {
+this.slider.setValue (value);
+}, "~N");
+Clazz_defineMethod (c$, "getValue", 
+function () {
+return Integer.parseInt (this.valueField.getText ());
+});
+Clazz_defineMethod (c$, "jbInit", 
+ function () {
+this.setLayout (this.borderLayout2);
+this.slider.setBackground (java.awt.Color.white);
+this.slider.setFont ( new java.awt.Font ("Verdana", 0, 11));
+this.slider.setOrientation (0);
+this.valueField.setFont ( new java.awt.Font ("Verdana", 0, 11));
+this.valueField.setText ("   ");
+this.valueField.addActionListener (this);
+this.valueField.setColumns (3);
+this.label.setFont ( new java.awt.Font ("Verdana", 0, 11));
+this.label.setText (jalview.util.MessageManager.getString ("label.set_this_label_text"));
+this.jPanel1.setLayout (this.borderLayout1);
+this.jPanel2.setLayout (this.flowLayout1);
+this.applyButton.setFont ( new java.awt.Font ("Verdana", 0, 11));
+this.applyButton.setLabel (jalview.util.MessageManager.getString ("action.apply"));
+this.applyButton.addActionListener (this);
+this.undoButton.setEnabled (false);
+this.undoButton.setFont ( new java.awt.Font ("Verdana", 0, 11));
+this.undoButton.setLabel (jalview.util.MessageManager.getString ("action.undo"));
+this.undoButton.addActionListener (this);
+this.allGroupsCheck.setEnabled (false);
+this.allGroupsCheck.setFont ( new java.awt.Font ("Verdana", 0, 11));
+this.allGroupsCheck.setLabel (jalview.util.MessageManager.getString ("action.apply_threshold_all_groups"));
+this.allGroupsCheck.setName (jalview.util.MessageManager.getString ("action.apply_all_groups"));
+this.setBackground (java.awt.Color.white);
+this.setForeground (java.awt.Color.black);
+this.jPanel2.add (this.label, null);
+this.jPanel2.add (this.applyButton, null);
+this.jPanel2.add (this.undoButton, null);
+this.jPanel2.add (this.allGroupsCheck);
+this.jPanel1.add (this.valueField, "East");
+this.jPanel1.add (this.slider, "Center");
+this.add (this.jPanel1, "South");
+this.add (this.jPanel2, "Center");
+});
+Clazz_defineMethod (c$, "applyButton_actionPerformed", 
+function () {
+});
+Clazz_defineMethod (c$, "undoButton_actionPerformed", 
+function () {
+});
+Clazz_overrideMethod (c$, "mousePressed", 
+function (evt) {
+}, "java.awt.event.MouseEvent");
+Clazz_overrideMethod (c$, "mouseReleased", 
+function (evt) {
+this.ap.paintAlignment (true);
+}, "java.awt.event.MouseEvent");
+Clazz_overrideMethod (c$, "mouseClicked", 
+function (evt) {
+}, "java.awt.event.MouseEvent");
+Clazz_overrideMethod (c$, "mouseEntered", 
+function (evt) {
+}, "java.awt.event.MouseEvent");
+Clazz_overrideMethod (c$, "mouseExited", 
+function (evt) {
+}, "java.awt.event.MouseEvent");
+c$.$SliderPanel$1$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_declareAnonymous (jalview.appletgui, "SliderPanel$1", java.awt.event.WindowAdapter);
+Clazz_overrideMethod (c$, "windowClosing", 
+function (e) {
+jalview.appletgui.SliderPanel.conservationSlider = null;
+}, "java.awt.event.WindowEvent");
+c$ = Clazz_p0p ();
+};
+c$.$SliderPanel$2$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_declareAnonymous (jalview.appletgui, "SliderPanel$2", java.awt.event.WindowAdapter);
+Clazz_overrideMethod (c$, "windowClosing", 
+function (e) {
+jalview.appletgui.SliderPanel.PIDSlider = null;
+}, "java.awt.event.WindowEvent");
+c$ = Clazz_p0p ();
+};
+Clazz_defineStatics (c$,
+"conservationSlider", null,
+"PIDSlider", null);
+});
+Clazz_declarePackage ("jalview.commands");
+Clazz_load (["jalview.commands.CommandI"], "jalview.commands.ChangeCaseCommand", ["java.lang.StringBuffer"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.description = null;
+this.caseChange = -1;
+this.seqs = null;
+this.regions = null;
+Clazz_instantialize (this, arguments);
+}, jalview.commands, "ChangeCaseCommand", null, jalview.commands.CommandI);
+Clazz_makeConstructor (c$, 
+function (description, seqs, regions, caseChange) {
+this.description = description;
+this.seqs = seqs;
+this.regions = regions;
+this.caseChange = caseChange;
+this.doCommand (null);
+}, "~S,~A,java.util.List,~N");
+Clazz_overrideMethod (c$, "getDescription", 
+function () {
+return this.description;
+});
+Clazz_overrideMethod (c$, "getSize", 
+function () {
+return 1;
+});
+Clazz_overrideMethod (c$, "doCommand", 
+function (views) {
+this.changeCase (true);
+}, "~A");
+Clazz_overrideMethod (c$, "undoCommand", 
+function (views) {
+this.changeCase (false);
+}, "~A");
+Clazz_defineMethod (c$, "changeCase", 
+function (doCommand) {
+var sequence;
+var start;
+var end;
+var nextChar;
+for (var r, $r = this.regions.iterator (); $r.hasNext () && ((r = $r.next ()) || true);) {
+start = r[0];
+for (var s = 0; s < this.seqs.length; s++) {
+sequence = this.seqs[s].getSequenceAsString ();
+var newSeq =  new StringBuffer ();
+if (r[1] > sequence.length) {
+end = sequence.length;
+} else {
+end = r[1];
+}if (start > 0) {
+newSeq.append (sequence.substring (0, start));
+}if ((this.caseChange == jalview.commands.ChangeCaseCommand.TO_UPPER && doCommand) || (this.caseChange == jalview.commands.ChangeCaseCommand.TO_LOWER && !doCommand)) {
+newSeq.append (sequence.substring (start, end).toUpperCase ());
+} else if ((this.caseChange == jalview.commands.ChangeCaseCommand.TO_LOWER && doCommand) || (this.caseChange == jalview.commands.ChangeCaseCommand.TO_UPPER && !doCommand)) {
+newSeq.append (sequence.substring (start, end).toLowerCase ());
+} else {
+for (var c = start; c < end; c++) {
+nextChar = sequence.charAt (c);
+if ('a' <= nextChar && nextChar <= 'z') {
+nextChar = String.fromCharCode (nextChar.charCodeAt (0) - (32));
+} else if ('A' <= nextChar && nextChar <= 'Z') {
+nextChar = String.fromCharCode (nextChar.charCodeAt (0) + (32));
+}newSeq.append (nextChar);
+}
+}if (end < sequence.length) {
+newSeq.append (sequence.substring (end));
+}this.seqs[s].setSequence (newSeq.toString ());
+}
+}
+}, "~B");
+Clazz_defineStatics (c$,
+"TO_LOWER", 0,
+"TO_UPPER", 1,
+"TOGGLE_CASE", 2);
+});
+Clazz_declarePackage ("jalview.io");
+Clazz_load (null, "jalview.io.SequenceAnnotationReport", ["jalview.util.DBRefUtils", "$.UrlLink", "java.lang.Float", "java.util.ArrayList"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.linkImageURL = null;
+Clazz_instantialize (this, arguments);
+}, jalview.io, "SequenceAnnotationReport");
+Clazz_makeConstructor (c$, 
+function (linkImageURL) {
+this.linkImageURL = linkImageURL;
+}, "~S");
+Clazz_defineMethod (c$, "appendFeatures", 
+function (tooltipText2, rpos, features) {
+this.appendFeatures (tooltipText2, rpos, features, null);
+}, "StringBuffer,~N,java.util.List");
+Clazz_defineMethod (c$, "appendFeatures", 
+function (tooltipText2, rpos, features, minmax) {
+var tmpString;
+if (features != null) {
+for (var feature, $feature = features.iterator (); $feature.hasNext () && ((feature = $feature.next ()) || true);) {
+if (feature.getType ().equals ("disulfide bond")) {
+if (feature.getBegin () == rpos || feature.getEnd () == rpos) {
+if (tooltipText2.length () > 6) {
+tooltipText2.append ("<br>");
+}tooltipText2.append ("disulfide bond " + feature.getBegin () + ":" + feature.getEnd ());
+}} else {
+if (tooltipText2.length () > 6) {
+tooltipText2.append ("<br>");
+}var linkOnly = feature.getValue ("linkonly") != null;
+if (!linkOnly) {
+tooltipText2.append (feature.getType () + " ");
+if (rpos != 0) {
+tooltipText2.append ("" + feature.begin);
+}if (feature.begin != feature.end) {
+tooltipText2.append (" " + feature.end);
+}if (feature.getDescription () != null && !feature.description.equals (feature.getType ())) {
+tmpString = feature.getDescription ();
+var tmp2up = tmpString.toUpperCase ();
+var startTag = tmp2up.indexOf ("<HTML>");
+if (startTag > -1) {
+tmpString = tmpString.substring (startTag + 6);
+tmp2up = tmp2up.substring (startTag + 6);
+}var endTag = tmp2up.indexOf ("</BODY>");
+if (endTag > -1) {
+tmpString = tmpString.substring (0, endTag);
+tmp2up = tmp2up.substring (0, endTag);
+}endTag = tmp2up.indexOf ("</HTML>");
+if (endTag > -1) {
+tmpString = tmpString.substring (0, endTag);
+}if (startTag > -1) {
+tooltipText2.append ("; " + tmpString);
+} else {
+if (tmpString.indexOf ("<") > -1 || tmpString.indexOf (">") > -1) {
+tmpString = tmpString.replaceAll ("<", "&lt;");
+tmpString = tmpString.replaceAll (">", "&gt;");
+tooltipText2.append ("; ");
+tooltipText2.append (tmpString);
+} else {
+tooltipText2.append ("; " + tmpString);
+}}}if (!Float.isNaN (feature.getScore ())) {
+var rng = (minmax == null) ? null : (minmax.get (feature.getType ()));
+if (rng != null && rng[0] != null && rng[0][0] != rng[0][1]) {
+tooltipText2.append (" Score=" + feature.getScore ());
+}}if (feature.getValue ("status") != null) {
+var status = feature.getValue ("status").toString ();
+if (status.length > 0) {
+tooltipText2.append ("; (" + feature.getValue ("status") + ")");
+}}}}if (feature.links != null) {
+if (this.linkImageURL != null) {
+tooltipText2.append (" <img src=\"" + this.linkImageURL + "\">");
+} else {
+for (var urlstring, $urlstring = feature.links.iterator (); $urlstring.hasNext () && ((urlstring = $urlstring.next ()) || true);) {
+try {
+for (var urllink, $urllink = 0, $$urllink = this.createLinksFrom (null, urlstring); $urllink < $$urllink.length && ((urllink = $$urllink[$urllink]) || true); $urllink++) {
+tooltipText2.append ("<br/> <a href=\"" + urllink[3] + "\" target=\"" + urllink[0] + "\">" + (urllink[0].toLowerCase ().equals (urllink[1].toLowerCase ()) ? urllink[0] : (urllink[0] + ":" + urllink[1])) + "</a></br>");
+}
+} catch (x) {
+if (Clazz_exceptionOf (x, Exception)) {
+System.err.println ("problem when creating links from " + urlstring);
+x.printStackTrace ();
+} else {
+throw x;
+}
+}
+}
+}}}
+}}, "StringBuffer,~N,java.util.List,java.util.Hashtable");
+Clazz_defineMethod (c$, "createLinksFrom", 
+function (seq, link) {
+var urlSets =  new java.util.ArrayList ();
+var uniques =  new java.util.ArrayList ();
+var urlLink =  new jalview.util.UrlLink (link);
+if (!urlLink.isValid ()) {
+System.err.println (urlLink.getInvalidMessage ());
+return null;
+}var target = urlLink.getTarget ();
+var label = urlLink.getLabel ();
+if (seq != null && urlLink.isDynamic ()) {
+var dbr = jalview.util.DBRefUtils.selectRefs (seq.getDBRef (),  Clazz_newArray (-1, [target]));
+var id = seq.getName ();
+var descr = seq.getDescription ();
+if (descr != null && descr.length < 1) {
+descr = null;
+}if (dbr != null) {
+for (var r = 0; r < dbr.length; r++) {
+if (id != null && dbr[r].getAccessionId ().equals (id)) {
+id = null;
+}var urls = urlLink.makeUrls (dbr[r].getAccessionId (), true);
+if (urls != null) {
+for (var u = 0; u < urls.length; u += 2) {
+var unq = urls[u] + "|" + urls[u + 1];
+if (!uniques.contains (unq)) {
+urlSets.add ( Clazz_newArray (-1, [target, label, urls[u], urls[u + 1]]));
+uniques.add (unq);
+}}
+}}
+}if (id != null) {
+var urls = urlLink.makeUrls (id, true);
+if (urls != null) {
+for (var u = 0; u < urls.length; u += 2) {
+var unq = urls[u] + "|" + urls[u + 1];
+if (!uniques.contains (unq)) {
+urlSets.add ( Clazz_newArray (-1, [target, label, urls[u], urls[u + 1]]));
+uniques.add (unq);
+}}
+}}if (descr != null && urlLink.getRegexReplace () != null) {
+var urls = urlLink.makeUrls (descr, true);
+if (urls != null) {
+for (var u = 0; u < urls.length; u += 2) {
+var unq = urls[u] + "|" + urls[u + 1];
+if (!uniques.contains (unq)) {
+urlSets.add ( Clazz_newArray (-1, [target, label, urls[u], urls[u + 1]]));
+uniques.add (unq);
+}}
+}}} else {
+var unq = label + "|" + urlLink.getUrl_prefix ();
+if (!uniques.contains (unq)) {
+uniques.add (unq);
+urlSets.add ( Clazz_newArray (-1, [target, label, null, urlLink.getUrl_prefix ()]));
+}}return urlSets.toArray ( Clazz_newArray (-1, []));
+}, "jalview.datamodel.SequenceI,~S");
+Clazz_defineMethod (c$, "createSequenceAnnotationReport", 
+function (tip, sequence, showDbRefs, showNpFeats, minmax) {
+this.createSequenceAnnotationReport (tip, sequence, showDbRefs, showNpFeats, true, minmax);
+}, "StringBuffer,jalview.datamodel.SequenceI,~B,~B,java.util.Hashtable");
+Clazz_defineMethod (c$, "createSequenceAnnotationReport", 
+function (tip, sequence, showDbRefs, showNpFeats, tableWrap, minmax) {
+var tmp;
+tip.append ("<i>");
+var maxWidth = 0;
+if (sequence.getDescription () != null) {
+tmp = sequence.getDescription ();
+tip.append ("<br>" + tmp);
+maxWidth = Math.max (maxWidth, tmp.length);
+}var ds = sequence;
+while (ds.getDatasetSequence () != null) {
+ds = ds.getDatasetSequence ();
+}
+var dbrefs = ds.getDBRef ();
+if (showDbRefs && dbrefs != null) {
+for (var i = 0; i < dbrefs.length; i++) {
+tip.append ("<br>");
+tmp = dbrefs[i].getSource () + " " + dbrefs[i].getAccessionId ();
+tip.append (tmp);
+maxWidth = Math.max (maxWidth, tmp.length);
+}
+}var features = sequence.getSequenceFeatures ();
+if (showNpFeats && features != null) {
+for (var i = 0; i < features.length; i++) {
+if (features[i].begin == 0 && features[i].end == 0) {
+var sz = -tip.length ();
+var tfeat =  new java.util.ArrayList ();
+tfeat.add (features[i]);
+this.appendFeatures (tip, 0, tfeat, minmax);
+sz += tip.length ();
+maxWidth = Math.max (maxWidth, sz);
+}}
+}if (tableWrap && maxWidth > 60) {
+tip.insert (0, "<table width=350 border=0><tr><td><i>");
+tip.append ("</i></td></tr></table>");
+}}, "StringBuffer,jalview.datamodel.SequenceI,~B,~B,~B,java.util.Hashtable");
+});
+Clazz_declarePackage ("jalview.util");
+Clazz_load (null, "jalview.util.UrlLink", ["jalview.jsdev.RegExp", "java.util.Vector"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.url_suffix = null;
+this.url_prefix = null;
+this.target = null;
+this.label = null;
+this.regexReplace = null;
+this.dynamic = false;
+this.invalidMessage = null;
+Clazz_instantialize (this, arguments);
+}, jalview.util, "UrlLink");
+Clazz_makeConstructor (c$, 
+function (link) {
+var sep = link.indexOf ("|");
+var psqid = link.indexOf ("$SEQUENCE_ID");
+if (psqid > -1) {
+this.dynamic = true;
+var p = sep;
+do {
+sep = p;
+p = link.indexOf ("|", sep + 1);
+} while (p > sep && p < psqid);
+this.label = link.substring (0, sep);
+if (this.label.indexOf ("|") > -1) {
+this.target = this.label.substring (0, this.label.indexOf ("|"));
+} else if (this.label.indexOf (" ") > 2) {
+this.target = this.label.substring (0, this.label.indexOf (" "));
+} else {
+this.target = this.label;
+}this.url_prefix = link.substring (sep + 1, psqid);
+if (link.indexOf ("$SEQUENCE_ID=/") == psqid && (p = link.indexOf ("/=$", psqid + 14)) > psqid + 14) {
+this.url_suffix = link.substring (p + 3);
+this.regexReplace = link.substring (psqid + 14, p);
+try {
+var rg = jalview.jsdev.RegExp.perlCode ("/" + this.regexReplace + "/");
+if (rg == null) {
+this.invalidMessage = "Invalid Regular Expression : '" + this.regexReplace + "'\n";
+}} catch (e) {
+if (Clazz_exceptionOf (e, Exception)) {
+this.invalidMessage = "Invalid Regular Expression : '" + this.regexReplace + "'\n";
+} else {
+throw e;
+}
+}
+} else {
+this.regexReplace = null;
+if (link.indexOf ("$SEQUENCE_ID$") == psqid) {
+this.url_suffix = link.substring (psqid + 13);
+this.regexReplace = null;
+} else {
+this.invalidMessage = "Warning: invalid regex structure for URL link : " + link;
+}}} else {
+this.target = link.substring (0, sep);
+this.label = link.substring (0, sep = link.lastIndexOf ("|"));
+this.url_prefix = link.substring (sep + 1);
+this.regexReplace = null;
+this.url_suffix = null;
+}}, "~S");
+Clazz_defineMethod (c$, "getUrl_suffix", 
+function () {
+return this.url_suffix;
+});
+Clazz_defineMethod (c$, "getUrl_prefix", 
+function () {
+return this.url_prefix;
+});
+Clazz_defineMethod (c$, "getTarget", 
+function () {
+return this.target;
+});
+Clazz_defineMethod (c$, "getLabel", 
+function () {
+return this.label;
+});
+Clazz_defineMethod (c$, "getRegexReplace", 
+function () {
+return this.regexReplace;
+});
+Clazz_defineMethod (c$, "getInvalidMessage", 
+function () {
+return this.invalidMessage;
+});
+Clazz_defineMethod (c$, "isValid", 
+function () {
+return this.invalidMessage == null;
+});
+Clazz_defineMethod (c$, "makeUrls", 
+function (idstring, onlyIfMatches) {
+if (this.dynamic) {
+if (this.regexReplace != null) {
+var rg = jalview.jsdev.RegExp.perlCode ("/" + this.regexReplace + "/");
+if (rg.search (idstring)) {
+var ns = rg.numSubs ();
+if (ns == 0) {
+return  Clazz_newArray (-1, [rg.stringMatchedI (ns), this.url_prefix + rg.stringMatched () + this.url_suffix]);
+} else {
+for (var s = 0; s <= rg.numSubs (); s++) {
+System.err.println ("Sub " + s + " : " + rg.matchedFromI (s) + " : " + rg.matchedToI (s) + " : '" + rg.stringMatchedI (s) + "'");
+}
+var subs =  new java.util.Vector ();
+var s = 0;
+while (s <= ns) {
+if (s + 1 <= ns && rg.matchedToI (s) > -1 && rg.matchedToI (s + 1) > -1 && rg.matchedToI (s + 1) < rg.matchedToI (s)) {
+var r = s + 1;
+var mtch = "";
+while (r <= ns && rg.matchedToI (r) <= rg.matchedToI (s)) {
+if (rg.matchedFromI (r) > -1) {
+mtch += rg.stringMatchedI (r);
+}r++;
+}
+if (mtch.length > 0) {
+subs.addElement (mtch);
+subs.addElement (this.url_prefix + mtch + this.url_suffix);
+}s = r;
+} else {
+if (rg.matchedFromI (s) > -1) {
+subs.addElement (rg.stringMatchedI (s));
+subs.addElement (this.url_prefix + rg.stringMatchedI (s) + this.url_suffix);
+}s++;
+}}
+var res =  new Array (subs.size ());
+for (var r = 0, rs = subs.size (); r < rs; r++) {
+res[r] = subs.elementAt (r);
+}
+subs.removeAllElements ();
+return res;
+}}if (onlyIfMatches) {
+return null;
+}}if (idstring.indexOf ("|") > -1) {
+idstring = idstring.substring (idstring.lastIndexOf ("|") + 1);
+}return  Clazz_newArray (-1, [idstring, this.url_prefix + idstring + this.url_suffix]);
+} else {
+return  Clazz_newArray (-1, ["", this.url_prefix]);
+}}, "~S,~B");
+Clazz_overrideMethod (c$, "toString", 
+function () {
+return this.label + "|" + this.url_prefix + (this.dynamic ? ("$SEQUENCE_ID" + ((this.regexReplace != null) ? "=" + this.regexReplace + "=$" : "$")) : "") + ((this.url_suffix == null) ? "" : this.url_suffix);
+});
+Clazz_defineMethod (c$, "isDynamic", 
+function () {
+return this.dynamic;
+});
+Clazz_defineMethod (c$, "setLabel", 
+function (newlabel) {
+this.label = newlabel;
+}, "~S");
+});
+Clazz_declarePackage ("jalview.appletgui");
+Clazz_load (["awt2swing.Panel"], "jalview.appletgui.IdCanvas", ["awt2swing.Util", "jalview.appletgui.AnnotationLabels", "$.AnnotationPanel", "$.PaintRefresher", "java.awt.Color", "$.Font"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.av = null;
+this.showScores = true;
+this.maxIdLength = -1;
+this.maxIdStr = null;
+this.image = null;
+this.gg = null;
+this.imgHeight = 0;
+this.$fastPaint = false;
+this.searchResults = null;
+this.avcharHeight = 0;
+Clazz_instantialize (this, arguments);
+}, jalview.appletgui, "IdCanvas", awt2swing.Panel);
+Clazz_makeConstructor (c$, 
+function (av) {
+Clazz_superConstructor (this, jalview.appletgui.IdCanvas, []);
+this.setLayout (null);
+this.av = av;
+jalview.appletgui.PaintRefresher.Register (this, av.getSequenceSetId ());
+}, "jalview.appletgui.AlignViewport");
+Clazz_defineMethod (c$, "drawIdString", 
+function (gg, hiddenRows, s, i, starty, ypos) {
+var charHeight = this.av.getCharHeight ();
+if (this.searchResults != null && this.searchResults.contains (s)) {
+gg.setColor (java.awt.Color.black);
+gg.fillRect (0, ((i - starty) * charHeight) + ypos, this.getSize ().width, charHeight);
+gg.setColor (java.awt.Color.white);
+} else if (this.av.getSelectionGroup () != null && this.av.getSelectionGroup ().getSequences (null).contains (s)) {
+gg.setColor (java.awt.Color.lightGray);
+gg.fillRect (0, ((i - starty) * charHeight) + ypos, this.getSize ().width, charHeight);
+gg.setColor (java.awt.Color.white);
+} else {
+gg.setColor (this.av.getSequenceColour (s));
+gg.fillRect (0, ((i - starty) * charHeight) + ypos, this.getSize ().width, charHeight);
+gg.setColor (java.awt.Color.black);
+}awt2swing.Util.drawString (gg, s.getDisplayId (this.av.getShowJVSuffix ()), 0, ((i - starty) * charHeight) + ypos + charHeight - (Clazz_doubleToInt (charHeight / 5)));
+if (hiddenRows) {
+this.drawMarker (i, starty, ypos);
+}}, "java.awt.Graphics,~B,jalview.datamodel.SequenceI,~N,~N,~N");
+Clazz_defineMethod (c$, "fastPaint", 
+function (vertical) {
+if (this.gg == null) {
+this.repaint ();
+return;
+}this.gg.copyArea (0, 0, this.getSize ().width, this.imgHeight, 0, -vertical * this.av.getCharHeight ());
+var ss = this.av.startSeq;
+var es = this.av.endSeq;
+var transY = 0;
+if (vertical > 0) {
+ss = es - vertical;
+if (ss < this.av.startSeq) {
+ss = this.av.startSeq;
+} else {
+transY = this.imgHeight - vertical * this.av.getCharHeight ();
+}} else if (vertical < 0) {
+es = ss - vertical;
+if (es > this.av.endSeq) {
+es = this.av.endSeq;
+}}this.gg.translate (0, transY);
+this.drawIds (ss, es);
+this.gg.translate (0, -transY);
+this.$fastPaint = true;
+this.repaint ();
+}, "~N");
+Clazz_overrideMethod (c$, "paintComponent", 
+function (g) {
+if (this.getSize ().height < 0 || this.getSize ().width < 0) {
+return;
+}if (this.$fastPaint) {
+this.$fastPaint = false;
+g.drawImage (this.image, 0, 0, this);
+return;
+}this.imgHeight = this.getSize ().height;
+this.imgHeight -= this.imgHeight % this.av.getCharHeight ();
+if (this.imgHeight < 1) {
+return;
+}if (this.image == null || this.imgHeight != this.image.getHeight (this)) {
+this.image = this.createImage (this.getSize ().width, this.imgHeight);
+this.gg = this.image.getGraphics ();
+this.gg.setFont (this.av.getFont ());
+}this.gg.setColor (java.awt.Color.white);
+var italic =  new java.awt.Font (this.av.getFont ().getName (), 2, this.av.getFont ().getSize ());
+this.gg.setFont (italic);
+this.gg.fillRect (0, 0, this.getSize ().width, this.getSize ().height);
+this.drawIds (this.av.startSeq, this.av.endSeq);
+g.drawImage (this.image, 0, 0, this);
+}, "java.awt.Graphics");
+Clazz_defineMethod (c$, "drawIds", 
+function (starty, endy) {
+var italic =  new java.awt.Font (this.av.getFont ().getName (), 2, this.av.getFont ().getSize ());
+this.avcharHeight = this.av.getCharHeight ();
+this.gg.setFont (italic);
+var currentColor = java.awt.Color.white;
+var currentTextColor = java.awt.Color.black;
+var doHiddenCheck = this.av.isDisplayReferenceSeq () || this.av.hasHiddenRows ();
+var hiddenRows = this.av.hasHiddenRows () && this.av.getShowHiddenMarkers ();
+if (this.av.getWrapAlignment ()) {
+var maxwidth = this.av.getAlignment ().getWidth ();
+var alheight = this.av.getAlignment ().getHeight ();
+if (this.av.hasHiddenColumns ()) {
+maxwidth = this.av.getColumnSelection ().findColumnPosition (maxwidth) - 1;
+}var annotationHeight = 0;
+var labels = null;
+if (this.av.isShowAnnotation ()) {
+var ap =  new jalview.appletgui.AnnotationPanel (this.av);
+annotationHeight = ap.adjustPanelHeight ();
+labels =  new jalview.appletgui.AnnotationLabels (this.av);
+}var hgap = this.avcharHeight;
+if (this.av.getScaleAboveWrapped ()) {
+hgap += this.avcharHeight;
+}var cHeight = alheight * this.avcharHeight + hgap + annotationHeight;
+var rowSize = this.av.getEndRes () - this.av.getStartRes ();
+for (var ypos = hgap, row = this.av.startRes; (ypos <= this.getSize ().height) && (row < maxwidth); ypos += cHeight, row += rowSize) {
+for (var i = starty; i < alheight; i++) {
+var s = this.av.getAlignment ().getSequenceAt (i);
+this.gg.setFont (italic);
+if (doHiddenCheck) {
+this.setHiddenFont (s);
+}this.drawIdString (this.gg, hiddenRows, s, i, 0, ypos);
+}
+if (labels != null) {
+this.gg.translate (0, ypos + (alheight * this.avcharHeight));
+labels.drawComponent (this.gg, this.getSize ().width);
+this.gg.translate (0, -ypos - (alheight * this.avcharHeight));
+}}
+} else {
+var seq;
+for (var i = starty; i < endy; i++) {
+seq = this.av.getAlignment ().getSequenceAt (i);
+if (seq == null) {
+continue;
+}this.gg.setFont (italic);
+if (doHiddenCheck) {
+this.setHiddenFont (seq);
+}if ((this.searchResults != null) && this.searchResults.contains (seq)) {
+currentColor = java.awt.Color.black;
+currentTextColor = java.awt.Color.white;
+} else if ((this.av.getSelectionGroup () != null) && this.av.getSelectionGroup ().getSequences (null).contains (seq)) {
+currentColor = java.awt.Color.lightGray;
+currentTextColor = java.awt.Color.black;
+} else {
+currentColor = this.av.getSequenceColour (seq);
+currentTextColor = java.awt.Color.black;
+}this.gg.setColor (currentColor);
+this.gg.fillRect (0, (i - starty) * this.avcharHeight, this.getSize ().width, this.avcharHeight);
+this.gg.setColor (currentTextColor);
+awt2swing.Util.drawString (this.gg, seq.getDisplayId (this.av.getShowJVSuffix ()), 0, (((i - starty) * this.avcharHeight) + this.avcharHeight) - (Clazz_doubleToInt (this.avcharHeight / 5)));
+if (hiddenRows) {
+this.drawMarker (i, starty, 0);
+}}
+}}, "~N,~N");
+Clazz_defineMethod (c$, "setHighlighted", 
+function (list) {
+this.searchResults = list;
+this.repaint ();
+}, "java.util.List");
+Clazz_defineMethod (c$, "drawMarker", 
+function (i, starty, yoffset) {
+var hseqs = this.av.getAlignment ().getHiddenSequences ().hiddenSequences;
+var hSize = hseqs.length;
+var hiddenIndex = i;
+var lastIndex = i - 1;
+var nextIndex = i + 1;
+for (var j = 0; j < hSize; j++) {
+if (hseqs[j] != null) {
+if (j - 1 < hiddenIndex) {
+hiddenIndex++;
+}if (j - 1 < lastIndex) {
+lastIndex++;
+}if (j - 1 < nextIndex) {
+nextIndex++;
+}}}
+var below = (hiddenIndex > lastIndex + 1);
+var above = (nextIndex > hiddenIndex + 1);
+this.gg.setColor (java.awt.Color.blue);
+if (below) {
+this.gg.fillPolygon ( Clazz_newIntArray (-1, [this.getSize ().width - this.avcharHeight, this.getSize ().width - this.avcharHeight, this.getSize ().width]),  Clazz_newIntArray (-1, [(i - starty) * this.avcharHeight + yoffset, (i - starty) * this.avcharHeight + yoffset + Clazz_doubleToInt (this.avcharHeight / 4), (i - starty) * this.avcharHeight + yoffset]), 3);
+}if (above) {
+this.gg.fillPolygon ( Clazz_newIntArray (-1, [this.getSize ().width - this.avcharHeight, this.getSize ().width - this.avcharHeight, this.getSize ().width]),  Clazz_newIntArray (-1, [(i - starty + 1) * this.avcharHeight + yoffset, (i - starty + 1) * this.avcharHeight + yoffset - Clazz_doubleToInt (this.avcharHeight / 4), (i - starty + 1) * this.avcharHeight + yoffset]), 3);
+}}, "~N,~N,~N");
+Clazz_defineMethod (c$, "setHiddenFont", 
+function (seq) {
+var bold =  new java.awt.Font (this.av.getFont ().getName (), 1, this.av.getFont ().getSize ());
+if (this.av.isHiddenRepSequence (seq)) {
+this.gg.setFont (bold);
+return true;
+}return false;
+}, "jalview.datamodel.SequenceI");
+});
+Clazz_declarePackage ("jalview.appletgui");
+Clazz_load (["awt2swing.Panel", "java.awt.event.MouseListener", "$.MouseMotionListener"], "jalview.appletgui.IdwidthAdjuster", ["java.awt.Color", "$.Toolkit"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.active = false;
+this.oldX = 0;
+this.image = null;
+this.ap = null;
+Clazz_instantialize (this, arguments);
+}, jalview.appletgui, "IdwidthAdjuster", awt2swing.Panel, [java.awt.event.MouseListener, java.awt.event.MouseMotionListener]);
+Clazz_makeConstructor (c$, 
+function (ap) {
+Clazz_superConstructor (this, jalview.appletgui.IdwidthAdjuster, []);
+this.setName ("IdwidthAdjuster");
+this.setLayout (null);
+this.ap = ap;
+var url = this.getClass ().getResource ("/images/idwidth.gif");
+if (url != null) {
+this.image = java.awt.Toolkit.getDefaultToolkit ().getImage (url);
+}this.addMouseListener (this);
+this.addMouseMotionListener (this);
+}, "jalview.appletgui.AlignmentPanel");
+Clazz_overrideMethod (c$, "mousePressed", 
+function (evt) {
+this.oldX = evt.getX ();
+}, "java.awt.event.MouseEvent");
+Clazz_overrideMethod (c$, "mouseReleased", 
+function (evt) {
+this.active = false;
+this.repaint ();
+}, "java.awt.event.MouseEvent");
+Clazz_overrideMethod (c$, "mouseEntered", 
+function (evt) {
+this.active = true;
+this.repaint ();
+}, "java.awt.event.MouseEvent");
+Clazz_overrideMethod (c$, "mouseExited", 
+function (evt) {
+this.active = false;
+this.repaint ();
+}, "java.awt.event.MouseEvent");
+Clazz_overrideMethod (c$, "mouseDragged", 
+function (evt) {
+this.active = true;
+var d = this.ap.idPanel.idCanvas.getSize ();
+var dif = evt.getX () - this.oldX;
+var newWidth = d.width + dif;
+if (newWidth > 20 || dif > 0) {
+this.ap.setIdWidth (newWidth, d.height);
+this.setSize (newWidth, this.getSize ().height);
+this.oldX = evt.getX ();
+}}, "java.awt.event.MouseEvent");
+Clazz_overrideMethod (c$, "mouseMoved", 
+function (evt) {
+}, "java.awt.event.MouseEvent");
+Clazz_overrideMethod (c$, "mouseClicked", 
+function (evt) {
+}, "java.awt.event.MouseEvent");
+Clazz_defineMethod (c$, "PaintComponent", 
+function (g) {
+g.setColor (java.awt.Color.white);
+g.fillRect (0, 0, this.getSize ().width, this.getSize ().height);
+if (this.active) {
+if (this.image != null) {
+g.drawImage (this.image, this.getSize ().width - 20, 2, this);
+}}}, "java.awt.Graphics");
+});
+Clazz_declarePackage ("jalview.appletgui");
+Clazz_load (["awt2swing.Panel", "java.awt.event.MouseListener", "$.MouseMotionListener"], "jalview.appletgui.ScalePanel", ["awt2swing.MenuItem", "$.PopupMenu", "$.Util", "jalview.datamodel.SequenceGroup", "jalview.util.MessageManager", "java.awt.Color", "java.awt.event.ActionListener"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.offy = 4;
+this.$width = 0;
+this.av = null;
+this.ap = null;
+this.stretchingGroup = false;
+this.min = 0;
+this.max = 0;
+this.mouseDragging = false;
+this.reveal = null;
+Clazz_instantialize (this, arguments);
+}, jalview.appletgui, "ScalePanel", awt2swing.Panel, [java.awt.event.MouseMotionListener, java.awt.event.MouseListener]);
+Clazz_makeConstructor (c$, 
+function (av, ap) {
+Clazz_superConstructor (this, jalview.appletgui.ScalePanel, []);
+this.setName ("scalePanel");
+this.setLayout (null);
+this.av = av;
+this.ap = ap;
+this.addMouseListener (this);
+this.addMouseMotionListener (this);
+}, "jalview.appletgui.AlignViewport,jalview.appletgui.AlignmentPanel");
+Clazz_overrideMethod (c$, "mousePressed", 
+function (evt) {
+var x = (Clazz_doubleToInt (evt.getX () / this.av.getCharWidth ())) + this.av.getStartRes ();
+var res;
+if (this.av.hasHiddenColumns ()) {
+res = this.av.getColumnSelection ().adjustForHiddenColumns (x);
+} else {
+res = x;
+}this.min = res;
+this.max = res;
+if ((evt.getModifiers () & 4) == 4) {
+var pop =  new awt2swing.PopupMenu ();
+if (this.reveal != null) {
+var item =  new awt2swing.MenuItem (jalview.util.MessageManager.getString ("label.reveal"));
+item.addActionListener (((Clazz_isClassDefined ("jalview.appletgui.ScalePanel$1") ? 0 : jalview.appletgui.ScalePanel.$ScalePanel$1$ ()), Clazz_innerTypeInstance (jalview.appletgui.ScalePanel$1, this, null)));
+pop.add (item);
+if (this.av.getColumnSelection ().hasManyHiddenColumns ()) {
+item =  new awt2swing.MenuItem (jalview.util.MessageManager.getString ("action.reveal_all"));
+item.addActionListener (((Clazz_isClassDefined ("jalview.appletgui.ScalePanel$2") ? 0 : jalview.appletgui.ScalePanel.$ScalePanel$2$ ()), Clazz_innerTypeInstance (jalview.appletgui.ScalePanel$2, this, null)));
+pop.add (item);
+}this.add (pop);
+pop.show (this, evt.getX (), evt.getY ());
+} else if (this.av.getColumnSelection ().contains (res)) {
+var item =  new awt2swing.MenuItem (jalview.util.MessageManager.getString ("label.hide_columns"));
+item.addActionListener (((Clazz_isClassDefined ("jalview.appletgui.ScalePanel$3") ? 0 : jalview.appletgui.ScalePanel.$ScalePanel$3$ ()), Clazz_innerTypeInstance (jalview.appletgui.ScalePanel$3, this, Clazz_cloneFinals ("res", res))));
+pop.add (item);
+this.add (pop);
+pop.show (this, evt.getX (), evt.getY ());
+}} else {
+if (!evt.isControlDown () && !evt.isShiftDown ()) {
+this.av.getColumnSelection ().clear ();
+}this.av.getColumnSelection ().addElement (res);
+var sg =  new jalview.datamodel.SequenceGroup ();
+for (var i = 0; i < this.av.getAlignment ().getSequences ().size (); i++) {
+sg.addSequence (this.av.getAlignment ().getSequenceAt (i), false);
+}
+sg.setStartRes (res);
+sg.setEndRes (res);
+this.av.setSelectionGroup (sg);
+if (evt.isShiftDown ()) {
+var min = Math.min (this.av.getColumnSelection ().getMin (), res);
+var max = Math.max (this.av.getColumnSelection ().getMax (), res);
+for (var i = min; i < max; i++) {
+this.av.getColumnSelection ().addElement (i);
+}
+sg.setStartRes (min);
+sg.setEndRes (max);
+}}this.ap.paintAlignment (true);
+this.av.sendSelection ();
+}, "java.awt.event.MouseEvent");
+Clazz_overrideMethod (c$, "mouseReleased", 
+function (evt) {
+this.mouseDragging = false;
+var res = (Clazz_doubleToInt (evt.getX () / this.av.getCharWidth ())) + this.av.getStartRes ();
+if (res > this.av.getAlignment ().getWidth ()) {
+res = this.av.getAlignment ().getWidth () - 1;
+}if (this.av.hasHiddenColumns ()) {
+res = this.av.getColumnSelection ().adjustForHiddenColumns (res);
+}if (!this.stretchingGroup) {
+this.ap.paintAlignment (false);
+return;
+}var sg = this.av.getSelectionGroup ();
+if (res > sg.getStartRes ()) {
+sg.setEndRes (res);
+} else if (res < sg.getStartRes ()) {
+sg.setStartRes (res);
+}this.stretchingGroup = false;
+this.ap.paintAlignment (false);
+this.av.sendSelection ();
+}, "java.awt.event.MouseEvent");
+Clazz_overrideMethod (c$, "mouseDragged", 
+function (evt) {
+this.mouseDragging = true;
+var res = (Clazz_doubleToInt (evt.getX () / this.av.getCharWidth ())) + this.av.getStartRes ();
+if (res < 0) {
+res = 0;
+}if (this.av.hasHiddenColumns ()) {
+res = this.av.getColumnSelection ().adjustForHiddenColumns (res);
+}if (res > this.av.getAlignment ().getWidth ()) {
+res = this.av.getAlignment ().getWidth () - 1;
+}if (res < this.min) {
+this.min = res;
+}if (res > this.max) {
+this.max = res;
+}var sg = this.av.getSelectionGroup ();
+if (sg != null) {
+this.stretchingGroup = true;
+if (!this.av.getColumnSelection ().contains (res)) {
+this.av.getColumnSelection ().addElement (res);
+}if (res > sg.getStartRes ()) {
+sg.setEndRes (res);
+}if (res < sg.getStartRes ()) {
+sg.setStartRes (res);
+}var col;
+for (var i = this.min; i <= this.max; i++) {
+col = this.av.getColumnSelection ().adjustForHiddenColumns (i);
+if ((col < sg.getStartRes ()) || (col > sg.getEndRes ())) {
+this.av.getColumnSelection ().removeElement (col);
+} else {
+this.av.getColumnSelection ().addElement (col);
+}}
+this.ap.paintAlignment (false);
+}}, "java.awt.event.MouseEvent");
+Clazz_overrideMethod (c$, "mouseEntered", 
+function (evt) {
+if (this.mouseDragging) {
+this.ap.seqPanel.scrollCanvas (null);
+}}, "java.awt.event.MouseEvent");
+Clazz_overrideMethod (c$, "mouseExited", 
+function (evt) {
+if (this.mouseDragging) {
+this.ap.seqPanel.scrollCanvas (evt);
+}}, "java.awt.event.MouseEvent");
+Clazz_overrideMethod (c$, "mouseClicked", 
+function (evt) {
+}, "java.awt.event.MouseEvent");
+Clazz_overrideMethod (c$, "mouseMoved", 
+function (evt) {
+if (!this.av.hasHiddenColumns ()) {
+return;
+}var res = (Clazz_doubleToInt (evt.getX () / this.av.getCharWidth ())) + this.av.getStartRes ();
+res = this.av.getColumnSelection ().adjustForHiddenColumns (res);
+this.reveal = null;
+for (var region, $region = this.av.getColumnSelection ().getHiddenColumns ().iterator (); $region.hasNext () && ((region = $region.next ()) || true);) {
+if (res + 1 == region[0] || res - 1 == region[1]) {
+this.reveal = region;
+break;
+}}
+this.repaint ();
+}, "java.awt.event.MouseEvent");
+Clazz_overrideMethod (c$, "paintComponent", 
+function (g) {
+if (this.av.getWrapAlignment ()) return;
+this.drawScale (g, this.av.getStartRes (), this.av.getEndRes (), this.getSize ().width, this.getSize ().height);
+}, "java.awt.Graphics");
+Clazz_defineMethod (c$, "drawScale", 
+function (gg, startx, endx, width, height) {
+gg.setFont (this.av.getFont ());
+gg.setColor (java.awt.Color.white);
+gg.fillRect (0, 0, width, height);
+gg.setColor (java.awt.Color.black);
+var cs = this.av.getColumnSelection ();
+gg.setColor ( new java.awt.Color (220, 0, 0));
+var avcharWidth = this.av.getCharWidth ();
+var avcharHeight = this.av.getCharHeight ();
+for (var i = 0; i < cs.size (); i++) {
+var sel = cs.columnAt (i);
+if (this.av.hasHiddenColumns ()) {
+sel = this.av.getColumnSelection ().findColumnPosition (sel);
+}if ((sel >= startx) && (sel <= endx)) {
+gg.fillRect ((sel - startx) * avcharWidth, 0, avcharWidth, this.getSize ().height);
+}}
+gg.setColor (java.awt.Color.black);
+var scalestartx = (Clazz_doubleToInt (startx / 10)) * 10;
+var fm = gg.getFontMetrics (this.av.getFont ());
+var y = avcharHeight - fm.getDescent ();
+if ((scalestartx % 10) == 0) {
+scalestartx += 5;
+}var string;
+var maxX = 0;
+for (var i = scalestartx; i < endx; i += 5) {
+if ((i % 10) == 0) {
+string = String.valueOf (this.av.getColumnSelection ().adjustForHiddenColumns (i));
+if ((i - startx - 1) * avcharWidth > maxX) {
+awt2swing.Util.drawString (gg, string, (i - startx - 1) * avcharWidth, y);
+maxX = (i - startx + 1) * avcharWidth + fm.stringWidth (string);
+}gg.drawLine (((i - startx - 1) * avcharWidth) + (Clazz_doubleToInt (avcharWidth / 2)), y + 2, ((i - startx - 1) * avcharWidth) + (Clazz_doubleToInt (avcharWidth / 2)), y + (fm.getDescent () * 2));
+} else {
+gg.drawLine (((i - startx - 1) * avcharWidth) + (Clazz_doubleToInt (avcharWidth / 2)), y + fm.getDescent (), ((i - startx - 1) * avcharWidth) + (Clazz_doubleToInt (avcharWidth / 2)), y + (fm.getDescent () * 2));
+}}
+if (this.av.hasHiddenColumns ()) {
+gg.setColor (java.awt.Color.blue);
+var res;
+if (this.av.getShowHiddenMarkers ()) {
+for (var i = 0; i < this.av.getColumnSelection ().getHiddenColumns ().size (); i++) {
+res = this.av.getColumnSelection ().findHiddenRegionPosition (i) - startx;
+if (res < 0 || res > endx - scalestartx) {
+continue;
+}gg.fillPolygon ( Clazz_newIntArray (-1, [res * avcharWidth - Clazz_doubleToInt (avcharHeight / 4), res * avcharWidth + Clazz_doubleToInt (avcharHeight / 4), res * avcharWidth]),  Clazz_newIntArray (-1, [y - Clazz_doubleToInt (avcharHeight / 2), y - Clazz_doubleToInt (avcharHeight / 2), y + 8]), 3);
+}
+}if (this.reveal != null && this.reveal[0] > startx && this.reveal[0] < endx) {
+awt2swing.Util.drawString (gg, jalview.util.MessageManager.getString ("label.reveal_columns"), this.reveal[0] * avcharWidth, 0);
+}}}, "java.awt.Graphics,~N,~N,~N,~N");
+c$.$ScalePanel$1$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_declareAnonymous (jalview.appletgui, "ScalePanel$1", null, java.awt.event.ActionListener);
+Clazz_overrideMethod (c$, "actionPerformed", 
+function (e) {
+this.b$["jalview.appletgui.ScalePanel"].av.showColumn (this.b$["jalview.appletgui.ScalePanel"].reveal[0]);
+this.b$["jalview.appletgui.ScalePanel"].reveal = null;
+this.b$["jalview.appletgui.ScalePanel"].ap.paintAlignment (true);
+if (this.b$["jalview.appletgui.ScalePanel"].ap.overviewPanel != null) {
+this.b$["jalview.appletgui.ScalePanel"].ap.overviewPanel.updateOverviewImage ();
+}}, "java.awt.event.ActionEvent");
+c$ = Clazz_p0p ();
+};
+c$.$ScalePanel$2$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_declareAnonymous (jalview.appletgui, "ScalePanel$2", null, java.awt.event.ActionListener);
+Clazz_overrideMethod (c$, "actionPerformed", 
+function (e) {
+this.b$["jalview.appletgui.ScalePanel"].av.showAllHiddenColumns ();
+this.b$["jalview.appletgui.ScalePanel"].reveal = null;
+this.b$["jalview.appletgui.ScalePanel"].ap.paintAlignment (true);
+if (this.b$["jalview.appletgui.ScalePanel"].ap.overviewPanel != null) {
+this.b$["jalview.appletgui.ScalePanel"].ap.overviewPanel.updateOverviewImage ();
+}}, "java.awt.event.ActionEvent");
+c$ = Clazz_p0p ();
+};
+c$.$ScalePanel$3$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_declareAnonymous (jalview.appletgui, "ScalePanel$3", null, java.awt.event.ActionListener);
+Clazz_overrideMethod (c$, "actionPerformed", 
+function (e) {
+this.b$["jalview.appletgui.ScalePanel"].av.hideColumns (this.f$.res, this.f$.res);
+if (this.b$["jalview.appletgui.ScalePanel"].av.getSelectionGroup () != null && this.b$["jalview.appletgui.ScalePanel"].av.getSelectionGroup ().getSize () == this.b$["jalview.appletgui.ScalePanel"].av.getAlignment ().getHeight ()) {
+this.b$["jalview.appletgui.ScalePanel"].av.setSelectionGroup (null);
+}this.b$["jalview.appletgui.ScalePanel"].ap.paintAlignment (true);
+if (this.b$["jalview.appletgui.ScalePanel"].ap.overviewPanel != null) {
+this.b$["jalview.appletgui.ScalePanel"].ap.overviewPanel.updateOverviewImage ();
+}}, "java.awt.event.ActionEvent");
+c$ = Clazz_p0p ();
+};
+});
+Clazz_declarePackage ("jalview.appletgui");
+Clazz_load (["awt2swing.Panel", "jalview.structure.SelectionListener", "$.SequenceListener", "java.awt.event.MouseListener", "$.MouseMotionListener", "java.lang.Thread"], "jalview.appletgui.SeqPanel", ["jalview.api.AlignViewportI", "jalview.appletgui.APopupMenu", "$.AlignViewport", "$.PaintRefresher", "$.SeqCanvas", "$.SliderPanel", "$.Tooltip", "jalview.commands.EditCommand", "jalview.datamodel.ColumnSelection", "$.SearchResults", "$.SequenceGroup", "jalview.schemes.ResidueProperties", "jalview.structure.StructureSelectionManager", "jalview.util.Comparison", "$.MappingUtils", "$.MessageManager", "java.awt.BorderLayout", "$.Font", "java.lang.StringBuffer", "$.StringBuilder", "java.util.Vector"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.seqCanvas = null;
+this.ap = null;
+this.lastres = 0;
+this.startseq = 0;
+this.av = null;
+this.seqEditOccurred = false;
+this.scrollThread = null;
+this.mouseDragging = false;
+this.editingSeqs = false;
+this.groupEditing = false;
+this.oldSeq = -1;
+this.changeEndSeq = false;
+this.changeStartSeq = false;
+this.changeEndRes = false;
+this.changeStartRes = false;
+this.stretchGroup = null;
+this.keyboardNo1 = null;
+this.keyboardNo2 = null;
+this.mouseWheelPressed = false;
+this.lastMousePress = null;
+this.editCommand = null;
+this.ssm = null;
+this.startWrapBlock = -1;
+this.wrappedBlock = -1;
+this.lastMessage = null;
+this.tooltip = null;
+if (!Clazz_isClassDefined ("jalview.appletgui.SeqPanel.ScrollThread")) {
+jalview.appletgui.SeqPanel.$SeqPanel$ScrollThread$ ();
+}
+Clazz_instantialize (this, arguments);
+}, jalview.appletgui, "SeqPanel", awt2swing.Panel, [java.awt.event.MouseMotionListener, java.awt.event.MouseListener, jalview.structure.SequenceListener, jalview.structure.SelectionListener]);
+Clazz_makeConstructor (c$, 
+function (avp, p) {
+Clazz_superConstructor (this, jalview.appletgui.SeqPanel, []);
+this.av = avp;
+this.setName ("seqPanel");
+this.seqCanvas =  new jalview.appletgui.SeqCanvas (avp);
+this.setLayout ( new java.awt.BorderLayout ());
+this.add (this.seqCanvas);
+this.ap = p;
+this.seqCanvas.addMouseMotionListener (this);
+this.seqCanvas.addMouseListener (this);
+this.ssm = jalview.structure.StructureSelectionManager.getStructureSelectionManager (this.av.applet);
+this.ssm.addStructureViewerListener (this);
+this.ssm.addSelectionListener (this);
+this.seqCanvas.repaint ();
+}, "jalview.appletgui.AlignViewport,jalview.appletgui.AlignmentPanel");
+Clazz_defineMethod (c$, "endEditing", 
+function () {
+if (this.editCommand != null && this.editCommand.getSize () > 0) {
+this.ap.alignFrame.addHistoryItem (this.editCommand);
+this.av.firePropertyChange ("alignment", null, this.av.getAlignment ().getSequences ());
+}this.startseq = -1;
+this.lastres = -1;
+this.editingSeqs = false;
+this.groupEditing = false;
+this.keyboardNo1 = null;
+this.keyboardNo2 = null;
+this.editCommand = null;
+});
+Clazz_defineMethod (c$, "setCursorRow", 
+function () {
+this.seqCanvas.cursorY = this.getKeyboardNo1 () - 1;
+this.scrollToVisible ();
+});
+Clazz_defineMethod (c$, "setCursorColumn", 
+function () {
+this.seqCanvas.cursorX = this.getKeyboardNo1 () - 1;
+this.scrollToVisible ();
+});
+Clazz_defineMethod (c$, "setCursorRowAndColumn", 
+function () {
+if (this.keyboardNo2 == null) {
+this.keyboardNo2 =  new StringBuffer ();
+} else {
+this.seqCanvas.cursorX = this.getKeyboardNo1 () - 1;
+this.seqCanvas.cursorY = this.getKeyboardNo2 () - 1;
+this.scrollToVisible ();
+}});
+Clazz_defineMethod (c$, "setCursorPosition", 
+function () {
+var sequence = this.av.getAlignment ().getSequenceAt (this.seqCanvas.cursorY);
+this.seqCanvas.cursorX = sequence.findIndex (this.getKeyboardNo1 ()) - 1;
+this.scrollToVisible ();
+});
+Clazz_defineMethod (c$, "moveCursor", 
+function (dx, dy) {
+this.seqCanvas.cursorX += dx;
+this.seqCanvas.cursorY += dy;
+if (this.av.hasHiddenColumns () && !this.av.getColumnSelection ().isVisible (this.seqCanvas.cursorX)) {
+var original = this.seqCanvas.cursorX - dx;
+var maxWidth = this.av.getAlignment ().getWidth ();
+while (!this.av.getColumnSelection ().isVisible (this.seqCanvas.cursorX) && this.seqCanvas.cursorX < maxWidth && this.seqCanvas.cursorX > 0) {
+this.seqCanvas.cursorX += dx;
+}
+if (this.seqCanvas.cursorX >= maxWidth || !this.av.getColumnSelection ().isVisible (this.seqCanvas.cursorX)) {
+this.seqCanvas.cursorX = original;
+}}this.scrollToVisible ();
+}, "~N,~N");
+Clazz_defineMethod (c$, "scrollToVisible", 
+function () {
+if (this.seqCanvas.cursorX < 0) {
+this.seqCanvas.cursorX = 0;
+} else if (this.seqCanvas.cursorX > this.av.getAlignment ().getWidth () - 1) {
+this.seqCanvas.cursorX = this.av.getAlignment ().getWidth () - 1;
+}if (this.seqCanvas.cursorY < 0) {
+this.seqCanvas.cursorY = 0;
+} else if (this.seqCanvas.cursorY > this.av.getAlignment ().getHeight () - 1) {
+this.seqCanvas.cursorY = this.av.getAlignment ().getHeight () - 1;
+}this.endEditing ();
+if (this.av.getWrapAlignment ()) {
+this.ap.scrollToWrappedVisible (this.seqCanvas.cursorX);
+} else {
+while (this.seqCanvas.cursorY < this.av.startSeq) {
+this.ap.scrollUp (true);
+}
+while (this.seqCanvas.cursorY + 1 > this.av.endSeq) {
+this.ap.scrollUp (false);
+}
+while (this.seqCanvas.cursorX < this.av.getColumnSelection ().adjustForHiddenColumns (this.av.startRes)) {
+if (!this.ap.scrollRight (false)) {
+break;
+}}
+while (this.seqCanvas.cursorX > this.av.getColumnSelection ().adjustForHiddenColumns (this.av.endRes)) {
+if (!this.ap.scrollRight (true)) {
+break;
+}}
+}this.setStatusMessage (this.av.getAlignment ().getSequenceAt (this.seqCanvas.cursorY), this.seqCanvas.cursorX, this.seqCanvas.cursorY);
+this.seqCanvas.repaint ();
+});
+Clazz_defineMethod (c$, "setSelectionAreaAtCursor", 
+function (topLeft) {
+var sequence = this.av.getAlignment ().getSequenceAt (this.seqCanvas.cursorY);
+if (this.av.getSelectionGroup () != null) {
+var sg = this.av.getSelectionGroup ();
+var min = this.av.getAlignment ().getHeight ();
+var max = 0;
+for (var i = 0; i < sg.getSize (); i++) {
+var index = this.av.getAlignment ().findIndex (sg.getSequenceAt (i));
+if (index > max) {
+max = index;
+}if (index < min) {
+min = index;
+}}
+max++;
+if (topLeft) {
+sg.setStartRes (this.seqCanvas.cursorX);
+if (sg.getEndRes () < this.seqCanvas.cursorX) {
+sg.setEndRes (this.seqCanvas.cursorX);
+}min = this.seqCanvas.cursorY;
+} else {
+sg.setEndRes (this.seqCanvas.cursorX);
+if (sg.getStartRes () > this.seqCanvas.cursorX) {
+sg.setStartRes (this.seqCanvas.cursorX);
+}max = this.seqCanvas.cursorY + 1;
+}if (min > max) {
+this.av.setSelectionGroup (null);
+} else {
+sg.clear ();
+for (var i = min; i < max; i++) {
+sg.addSequence (this.av.getAlignment ().getSequenceAt (i), false);
+}
+}}if (this.av.getSelectionGroup () == null) {
+var sg =  new jalview.datamodel.SequenceGroup ();
+sg.setStartRes (this.seqCanvas.cursorX);
+sg.setEndRes (this.seqCanvas.cursorX);
+sg.addSequence (sequence, false);
+this.av.setSelectionGroup (sg);
+}this.ap.paintAlignment (false);
+this.av.sendSelection ();
+}, "~B");
+Clazz_defineMethod (c$, "insertGapAtCursor", 
+function (group) {
+this.groupEditing = group;
+this.startseq = this.seqCanvas.cursorY;
+this.lastres = this.seqCanvas.cursorX;
+this.editSequence (true, this.seqCanvas.cursorX + this.getKeyboardNo1 ());
+this.endEditing ();
+}, "~B");
+Clazz_defineMethod (c$, "deleteGapAtCursor", 
+function (group) {
+this.groupEditing = group;
+this.startseq = this.seqCanvas.cursorY;
+this.lastres = this.seqCanvas.cursorX + this.getKeyboardNo1 ();
+this.editSequence (false, this.seqCanvas.cursorX);
+this.endEditing ();
+}, "~B");
+Clazz_defineMethod (c$, "numberPressed", 
+function (value) {
+if (this.keyboardNo1 == null) {
+this.keyboardNo1 =  new StringBuffer ();
+}if (this.keyboardNo2 != null) {
+this.keyboardNo2.append (value);
+} else {
+this.keyboardNo1.append (value);
+}}, "~S");
+Clazz_defineMethod (c$, "getKeyboardNo1", 
+function () {
+try {
+if (this.keyboardNo1 != null) {
+var value = Integer.parseInt (this.keyboardNo1.toString ());
+this.keyboardNo1 = null;
+return value;
+}} catch (x) {
+if (Clazz_exceptionOf (x, Exception)) {
+} else {
+throw x;
+}
+}
+this.keyboardNo1 = null;
+return 1;
+});
+Clazz_defineMethod (c$, "getKeyboardNo2", 
+function () {
+try {
+if (this.keyboardNo2 != null) {
+var value = Integer.parseInt (this.keyboardNo2.toString ());
+this.keyboardNo2 = null;
+return value;
+}} catch (x) {
+if (Clazz_exceptionOf (x, Exception)) {
+} else {
+throw x;
+}
+}
+this.keyboardNo2 = null;
+return 1;
+});
+Clazz_defineMethod (c$, "setStatusMessage", 
+function (sequence, res, seq) {
+var text =  new StringBuilder (32);
+var seqno = seq == -1 ? "" : " " + (seq + 1);
+text.append ("Sequence" + seqno + " ID: " + sequence.getName ());
+var residue = null;
+var displayChar = String.valueOf (sequence.getCharAt (res));
+if (this.av.getAlignment ().isNucleotide ()) {
+residue = jalview.schemes.ResidueProperties.nucleotideName.get (displayChar);
+if (residue != null) {
+text.append (" Nucleotide: ").append (residue);
+}} else {
+residue = "X".equalsIgnoreCase (displayChar) ? "X" : jalview.schemes.ResidueProperties.aa2Triplet.get (displayChar);
+if (residue != null) {
+text.append (" Residue: ").append (residue);
+}}var pos = -1;
+if (residue != null) {
+pos = sequence.findPosition (res);
+text.append (" (").append (Integer.toString (pos)).append (")");
+}this.ap.alignFrame.setStatus (text.toString ());
+}, "jalview.datamodel.SequenceI,~N,~N");
+Clazz_defineMethod (c$, "setStatusMessage", 
+ function (results) {
+var matches = results.getResults ();
+if (!matches.isEmpty ()) {
+var m = matches.get (0);
+var seq = m.getSequence ();
+var sequenceIndex = this.av.getAlignment ().findIndex (seq);
+var start = m.getStart () - 1;
+this.setStatusMessage (seq, start, sequenceIndex);
+}}, "jalview.datamodel.SearchResults");
+Clazz_overrideMethod (c$, "mousePressed", 
+function (evt) {
+this.lastMousePress = evt.getPoint ();
+if ((evt.getModifiers () & 8) == 8 && !this.av.MAC) {
+this.mouseWheelPressed = true;
+return;
+}if (evt.isShiftDown () || evt.isControlDown () || evt.isAltDown ()) {
+if (evt.isControlDown () || evt.isAltDown ()) {
+this.groupEditing = true;
+}this.editingSeqs = true;
+} else {
+this.doMousePressedDefineMode (evt);
+return;
+}var seq = this.findSeq (evt);
+var res = this.findRes (evt);
+if (seq < 0 || res < 0) {
+return;
+}if ((seq < this.av.getAlignment ().getHeight ()) && (res < this.av.getAlignment ().getSequenceAt (seq).getLength ())) {
+this.startseq = seq;
+this.lastres = res;
+} else {
+this.startseq = -1;
+this.lastres = -1;
+}return;
+}, "java.awt.event.MouseEvent");
+Clazz_overrideMethod (c$, "mouseClicked", 
+function (evt) {
+var sequence = this.av.getAlignment ().getSequenceAt (this.findSeq (evt));
+if (evt.getClickCount () > 1) {
+if (this.av.getSelectionGroup () != null && this.av.getSelectionGroup ().getSize () == 1 && this.av.getSelectionGroup ().getEndRes () - this.av.getSelectionGroup ().getStartRes () < 2) {
+this.av.setSelectionGroup (null);
+}var features = this.findFeaturesAtRes (sequence, sequence.findPosition (this.findRes (evt)));
+if (features != null && features.length > 0) {
+var highlight =  new jalview.datamodel.SearchResults ();
+highlight.addResult (sequence, features[0].getBegin (), features[0].getEnd ());
+this.seqCanvas.highlightSearchResults (highlight);
+}if (features != null && features.length > 0) {
+this.seqCanvas.getFeatureRenderer ().amendFeatures ( Clazz_newArray (-1, [sequence]), features, false, this.ap);
+this.seqCanvas.highlightSearchResults (null);
+}}}, "java.awt.event.MouseEvent");
+Clazz_overrideMethod (c$, "mouseReleased", 
+function (evt) {
+this.mouseDragging = false;
+this.mouseWheelPressed = false;
+this.ap.paintAlignment (true);
+if (!this.editingSeqs) {
+this.doMouseReleasedDefineMode (evt);
+return;
+}this.endEditing ();
+}, "java.awt.event.MouseEvent");
+Clazz_defineMethod (c$, "findRes", 
+function (evt) {
+var res = 0;
+var x = evt.getX ();
+if (this.av.getWrapAlignment ()) {
+var hgap = this.av.getCharHeight ();
+if (this.av.getScaleAboveWrapped ()) {
+hgap += this.av.getCharHeight ();
+}var cHeight = this.av.getAlignment ().getHeight () * this.av.getCharHeight () + hgap + this.seqCanvas.getAnnotationHeight ();
+var y = evt.getY ();
+y -= hgap;
+x -= this.seqCanvas.LABEL_WEST;
+var cwidth = this.seqCanvas.getWrappedCanvasWidth (this.getSize ().width);
+if (cwidth < 1) {
+return 0;
+}this.wrappedBlock = Clazz_doubleToInt (y / cHeight);
+this.wrappedBlock += Clazz_doubleToInt (this.av.getStartRes () / cwidth);
+res = this.wrappedBlock * cwidth + Clazz_doubleToInt (x / this.av.getCharWidth ());
+} else {
+res = (Clazz_doubleToInt (x / this.av.getCharWidth ())) + this.av.getStartRes ();
+}if (this.av.hasHiddenColumns ()) {
+res = this.av.getColumnSelection ().adjustForHiddenColumns (res);
+}return res;
+}, "java.awt.event.MouseEvent");
+Clazz_defineMethod (c$, "findSeq", 
+function (evt) {
+var sqnum = this.findAlRow (evt);
+return (sqnum < 0) ? 0 : sqnum;
+}, "java.awt.event.MouseEvent");
+Clazz_defineMethod (c$, "findAlRow", 
+ function (evt) {
+var seq = 0;
+var y = evt.getY ();
+if (this.av.getWrapAlignment ()) {
+var hgap = this.av.getCharHeight ();
+if (this.av.getScaleAboveWrapped ()) {
+hgap += this.av.getCharHeight ();
+}var cHeight = this.av.getAlignment ().getHeight () * this.av.getCharHeight () + hgap + this.seqCanvas.getAnnotationHeight ();
+y -= hgap;
+seq = Math.min (Clazz_doubleToInt ((y % cHeight) / this.av.getCharHeight ()), this.av.getAlignment ().getHeight () - 1);
+if (seq < 0) {
+seq = -1;
+}} else {
+seq = Math.min ((Clazz_doubleToInt (y / this.av.getCharHeight ())) + this.av.getStartSeq (), this.av.getAlignment ().getHeight () - 1);
+if (seq < 0) {
+seq = -1;
+}}return seq;
+}, "java.awt.event.MouseEvent");
+Clazz_defineMethod (c$, "doMousePressed", 
+function (evt) {
+var seq = this.findSeq (evt);
+var res = this.findRes (evt);
+if (seq < this.av.getAlignment ().getHeight () && res < this.av.getAlignment ().getSequenceAt (seq).getLength ()) {
+this.startseq = seq;
+this.lastres = res;
+} else {
+this.startseq = -1;
+this.lastres = -1;
+}return;
+}, "java.awt.event.MouseEvent");
+Clazz_overrideMethod (c$, "mouseOverSequence", 
+function (sequence, index, pos) {
+var tmp = sequence.hashCode () + index + "";
+if (this.lastMessage == null || !this.lastMessage.equals (tmp)) {
+this.ssm.mouseOverSequence (sequence, index, pos, this.av);
+}this.lastMessage = tmp;
+}, "jalview.datamodel.SequenceI,~N,~N");
+Clazz_overrideMethod (c$, "highlightSequence", 
+function (results) {
+if (this.av.isFollowHighlight ()) {
+if (this.ap.scrollToPosition (results, true)) {
+this.ap.alignFrame.repaint ();
+}}this.setStatusMessage (results);
+this.seqCanvas.highlightSearchResults (results);
+}, "jalview.datamodel.SearchResults");
+Clazz_overrideMethod (c$, "getVamsasSource", 
+function () {
+return this.ap == null ? null : this.ap.av;
+});
+Clazz_overrideMethod (c$, "updateColours", 
+function (seq, index) {
+System.out.println ("update the seqPanel colours");
+}, "jalview.datamodel.SequenceI,~N");
+Clazz_overrideMethod (c$, "mouseMoved", 
+function (evt) {
+var res = this.findRes (evt);
+var seq = this.findSeq (evt);
+if (seq >= this.av.getAlignment ().getHeight () || seq < 0 || res < 0) {
+if (this.tooltip != null) {
+this.tooltip.setTip ("");
+}return;
+}var sequence = this.av.getAlignment ().getSequenceAt (seq);
+if (res > sequence.getLength ()) {
+if (this.tooltip != null) {
+this.tooltip.setTip ("");
+}return;
+}var respos = sequence.findPosition (res);
+if (this.ssm != null) {
+this.mouseOverSequence (sequence, res, respos);
+}var text =  new StringBuilder ();
+text.append ("Sequence ").append (Integer.toString (seq + 1)).append (" ID: ").append (sequence.getName ());
+var obj = null;
+var ch = String.valueOf (sequence.getCharAt (res));
+if (this.av.getAlignment ().isNucleotide ()) {
+obj = jalview.schemes.ResidueProperties.nucleotideName.get (ch);
+if (obj != null) {
+text.append (" Nucleotide: ").append (obj);
+}} else {
+obj = "X".equalsIgnoreCase (ch) ? "X" : jalview.schemes.ResidueProperties.aa2Triplet.get (ch);
+if (obj != null) {
+text.append (" Residue: ").append (obj);
+}}if (obj != null) {
+text.append (" (").append (Integer.toString (respos)).append (")");
+}this.ap.alignFrame.setStatus (text.toString ());
+var tooltipText =  new StringBuilder ();
+var groups = this.av.getAlignment ().findAllGroups (sequence);
+if (groups != null) {
+for (var g = 0; g < groups.length; g++) {
+if (groups[g].getStartRes () <= res && groups[g].getEndRes () >= res) {
+if (!groups[g].getName ().startsWith ("JTreeGroup") && !groups[g].getName ().startsWith ("JGroup")) {
+tooltipText.append (groups[g].getName ()).append (" ");
+}if (groups[g].getDescription () != null) {
+tooltipText.append (groups[g].getDescription ());
+}tooltipText.append ("\n");
+}}
+}var allFeatures = this.findFeaturesAtRes (sequence, sequence.findPosition (res));
+var index = 0;
+while (index < allFeatures.length) {
+var sf = allFeatures[index];
+tooltipText.append (sf.getType () + " " + sf.begin + ":" + sf.end);
+if (sf.getDescription () != null) {
+tooltipText.append (" " + sf.getDescription ());
+}if (sf.getValue ("status") != null) {
+var status = sf.getValue ("status").toString ();
+if (status.length > 0) {
+tooltipText.append (" (" + sf.getValue ("status") + ")");
+}}tooltipText.append ("\n");
+index++;
+}
+if (this.tooltip == null) {
+this.tooltip =  new jalview.appletgui.Tooltip (tooltipText.toString (), this.seqCanvas);
+} else {
+this.tooltip.setTip (tooltipText.toString ());
+}}, "java.awt.event.MouseEvent");
+Clazz_defineMethod (c$, "findFeaturesAtRes", 
+function (sequence, res) {
+var tmp =  new java.util.Vector ();
+var features = sequence.getSequenceFeatures ();
+if (features != null) {
+for (var i = 0; i < features.length; i++) {
+if (this.av.getFeaturesDisplayed () == null || !this.av.getFeaturesDisplayed ().isVisible (features[i].getType ())) {
+continue;
+}if (features[i].featureGroup != null && !this.seqCanvas.fr.checkGroupVisibility (features[i].featureGroup, false)) {
+continue;
+}if ((features[i].getBegin () <= res) && (features[i].getEnd () >= res)) {
+tmp.addElement (features[i]);
+}}
+}features =  new Array (tmp.size ());
+tmp.copyInto (features);
+return features;
+}, "jalview.datamodel.SequenceI,~N");
+Clazz_overrideMethod (c$, "mouseDragged", 
+function (evt) {
+if (this.mouseWheelPressed) {
+var oldWidth = this.av.getCharWidth ();
+if (Math.abs (evt.getY () - this.lastMousePress.y) > Math.abs (evt.getX () - this.lastMousePress.x)) {
+var fontSize = this.av.font.getSize ();
+if (evt.getY () < this.lastMousePress.y && this.av.getCharHeight () > 1) {
+fontSize--;
+} else if (evt.getY () > this.lastMousePress.y) {
+fontSize++;
+}if (fontSize < 1) {
+fontSize = 1;
+}this.av.setFont ( new java.awt.Font (this.av.font.getName (), this.av.font.getStyle (), fontSize));
+this.av.setCharWidth (oldWidth);
+} else {
+if (evt.getX () < this.lastMousePress.x && this.av.getCharWidth () > 1) {
+this.av.setCharWidth (this.av.getCharWidth () - 1);
+} else if (evt.getX () > this.lastMousePress.x) {
+this.av.setCharWidth (this.av.getCharWidth () + 1);
+}if (this.av.getCharWidth () < 1) {
+this.av.setCharWidth (1);
+}}this.ap.fontChanged ();
+var fm = this.getFontMetrics (this.av.getFont ());
+this.av.validCharWidth = fm.charWidth ('M') <= this.av.getCharWidth ();
+this.lastMousePress = evt.getPoint ();
+this.ap.paintAlignment (false);
+this.ap.annotationPanel.image = null;
+return;
+}if (!this.editingSeqs) {
+this.doMouseDraggedDefineMode (evt);
+return;
+}var res = this.findRes (evt);
+if (res < 0) {
+res = 0;
+}if ((this.lastres == -1) || (this.lastres == res)) {
+return;
+}if ((res < this.av.getAlignment ().getWidth ()) && (res < this.lastres)) {
+this.editSequence (false, res);
+} else {
+this.editSequence (true, res);
+}this.mouseDragging = true;
+if (this.scrollThread != null) {
+this.scrollThread.setEvent (evt);
+}}, "java.awt.event.MouseEvent");
+Clazz_defineMethod (c$, "editSequence", 
+function (insertGap, startres) {
+var fixedLeft = -1;
+var fixedRight = -1;
+var fixedColumns = false;
+var sg = this.av.getSelectionGroup ();
+var seq = this.av.getAlignment ().getSequenceAt (this.startseq);
+if (!this.groupEditing && this.av.hasHiddenRows ()) {
+if (this.av.isHiddenRepSequence (seq)) {
+sg = this.av.getRepresentedSequences (seq);
+this.groupEditing = true;
+}}var message =  new StringBuffer ();
+if (this.groupEditing) {
+message.append (jalview.util.MessageManager.getString ("action.edit_group")).append (":");
+if (this.editCommand == null) {
+this.editCommand =  new jalview.commands.EditCommand (jalview.util.MessageManager.getString ("action.edit_group"));
+}} else {
+message.append (jalview.util.MessageManager.getString ("label.edit_sequence")).append (" " + seq.getName ());
+var label = seq.getName ();
+if (label.length > 10) {
+label = label.substring (0, 10);
+}if (this.editCommand == null) {
+this.editCommand =  new jalview.commands.EditCommand (jalview.util.MessageManager.formatMessage ("label.edit_params",  Clazz_newArray (-1, [label])));
+}}if (insertGap) {
+message.append (" insert ");
+} else {
+message.append (" delete ");
+}message.append (Math.abs (startres - this.lastres) + " gaps.");
+this.ap.alignFrame.setStatus (message.toString ());
+if (this.groupEditing || (sg != null && sg.getSequences (this.av.getHiddenRepSequences ()).contains (seq))) {
+fixedColumns = true;
+if (sg == null) {
+if (!this.av.isHiddenRepSequence (seq)) {
+this.endEditing ();
+return;
+}sg = this.av.getRepresentedSequences (seq);
+}fixedLeft = sg.getStartRes ();
+fixedRight = sg.getEndRes ();
+if ((startres < fixedLeft && this.lastres >= fixedLeft) || (startres >= fixedLeft && this.lastres < fixedLeft) || (startres > fixedRight && this.lastres <= fixedRight) || (startres <= fixedRight && this.lastres > fixedRight)) {
+this.endEditing ();
+return;
+}if (fixedLeft > startres) {
+fixedRight = fixedLeft - 1;
+fixedLeft = 0;
+} else if (fixedRight < startres) {
+fixedLeft = fixedRight;
+fixedRight = -1;
+}}if (this.av.hasHiddenColumns ()) {
+fixedColumns = true;
+var y1 = this.av.getColumnSelection ().getHiddenBoundaryLeft (startres);
+var y2 = this.av.getColumnSelection ().getHiddenBoundaryRight (startres);
+if ((insertGap && startres > y1 && this.lastres < y1) || (!insertGap && startres < y2 && this.lastres > y2)) {
+this.endEditing ();
+return;
+}if (fixedLeft < y1 && (fixedRight > y2 || fixedRight == -1)) {
+if (startres >= y2) {
+fixedLeft = y2;
+} else {
+fixedRight = y2 - 1;
+}}}if (this.groupEditing) {
+var groupSeqs = sg.getSequences (this.av.getHiddenRepSequences ()).toArray ( new Array (0));
+if (insertGap) {
+if (sg.getStartRes () == 0 && sg.getEndRes () == fixedRight && sg.getEndRes () == this.av.getAlignment ().getWidth () - 1) {
+sg.setEndRes (this.av.getAlignment ().getWidth () + startres - this.lastres);
+fixedRight = sg.getEndRes ();
+}var blank = false;
+for (fixedRight = fixedRight; fixedRight > this.lastres; fixedRight--) {
+blank = true;
+for (var gs, $gs = 0, $$gs = groupSeqs; $gs < $$gs.length && ((gs = $$gs[$gs]) || true); $gs++) {
+for (var j = 0; j < startres - this.lastres; j++) {
+if (!jalview.util.Comparison.isGap (gs.getCharAt (fixedRight - j))) {
+blank = false;
+break;
+}}
+}
+if (blank) {
+break;
+}}
+if (!blank) {
+if (sg.getSize () == this.av.getAlignment ().getHeight ()) {
+if ((this.av.hasHiddenColumns () && startres < this.av.getColumnSelection ().getHiddenBoundaryRight (startres))) {
+this.endEditing ();
+return;
+}var alWidth = this.av.getAlignment ().getWidth ();
+if (this.av.hasHiddenRows ()) {
+var hwidth = this.av.getAlignment ().getHiddenSequences ().getWidth ();
+if (hwidth > alWidth) {
+alWidth = hwidth;
+}}sg.setEndRes (sg.getEndRes () + startres - this.lastres);
+fixedRight = alWidth + startres - this.lastres;
+} else {
+this.endEditing ();
+return;
+}}} else if (!insertGap) {
+for (var gs, $gs = 0, $$gs = groupSeqs; $gs < $$gs.length && ((gs = $$gs[$gs]) || true); $gs++) {
+for (var j = startres; j < this.lastres; j++) {
+if (gs.getLength () <= j) {
+continue;
+}if (!jalview.util.Comparison.isGap (gs.getCharAt (j))) {
+this.endEditing ();
+return;
+}}
+}
+}if (insertGap) {
+if (fixedColumns && fixedRight != -1) {
+for (var j = this.lastres; j < startres; j++) {
+this.insertChar (j, groupSeqs, fixedRight);
+}
+} else {
+this.editCommand.appendEdit (jalview.commands.EditCommand.Action.INSERT_GAP, groupSeqs, startres, startres - this.lastres, this.av.getAlignment (), true);
+}} else {
+if (fixedColumns && fixedRight != -1) {
+for (var j = this.lastres; j > startres; j--) {
+this.deleteChar (startres, groupSeqs, fixedRight);
+}
+} else {
+this.editCommand.appendEdit (jalview.commands.EditCommand.Action.DELETE_GAP, groupSeqs, startres, this.lastres - startres, this.av.getAlignment (), true);
+}}} else {
+if (insertGap) {
+if (fixedColumns && fixedRight != -1) {
+for (var j = this.lastres; j < startres; j++) {
+this.insertChar (j,  Clazz_newArray (-1, [seq]), fixedRight);
+}
+} else {
+this.editCommand.appendEdit (jalview.commands.EditCommand.Action.INSERT_GAP,  Clazz_newArray (-1, [seq]), this.lastres, startres - this.lastres, this.av.getAlignment (), true);
+}} else {
+if (fixedColumns && fixedRight != -1) {
+for (var j = this.lastres; j > startres; j--) {
+if (!jalview.util.Comparison.isGap (seq.getCharAt (startres))) {
+this.endEditing ();
+break;
+}this.deleteChar (startres,  Clazz_newArray (-1, [seq]), fixedRight);
+}
+} else {
+var max = 0;
+for (var m = startres; m < this.lastres; m++) {
+if (!jalview.util.Comparison.isGap (seq.getCharAt (m))) {
+break;
+}max++;
+}
+if (max > 0) {
+this.editCommand.appendEdit (jalview.commands.EditCommand.Action.DELETE_GAP,  Clazz_newArray (-1, [seq]), startres, max, this.av.getAlignment (), true);
+}}}}this.lastres = startres;
+this.seqCanvas.repaint ();
+}, "~B,~N");
+Clazz_defineMethod (c$, "insertChar", 
+function (j, seq, fixedColumn) {
+var blankColumn = fixedColumn;
+for (var s = 0; s < seq.length; s++) {
+for (blankColumn = fixedColumn; blankColumn > j; blankColumn--) {
+if (jalview.util.Comparison.isGap (seq[s].getCharAt (blankColumn))) {
+break;
+}}
+if (blankColumn <= j) {
+blankColumn = fixedColumn;
+this.endEditing ();
+return;
+}}
+this.editCommand.appendEdit (jalview.commands.EditCommand.Action.DELETE_GAP, seq, blankColumn, 1, this.av.getAlignment (), true);
+this.editCommand.appendEdit (jalview.commands.EditCommand.Action.INSERT_GAP, seq, j, 1, this.av.getAlignment (), true);
+}, "~N,~A,~N");
+Clazz_defineMethod (c$, "deleteChar", 
+function (j, seq, fixedColumn) {
+this.editCommand.appendEdit (jalview.commands.EditCommand.Action.DELETE_GAP, seq, j, 1, this.av.getAlignment (), true);
+this.editCommand.appendEdit (jalview.commands.EditCommand.Action.INSERT_GAP, seq, fixedColumn, 1, this.av.getAlignment (), true);
+}, "~N,~A,~N");
+Clazz_defineMethod (c$, "doMousePressedDefineMode", 
+function (evt) {
+if (this.scrollThread != null) {
+this.scrollThread.running = false;
+this.scrollThread = null;
+}var res = this.findRes (evt);
+var seq = this.findSeq (evt);
+this.oldSeq = seq;
+this.startWrapBlock = this.wrappedBlock;
+if (seq == -1) {
+return;
+}var sequence = this.av.getAlignment ().getSequenceAt (seq);
+if (sequence == null || res > sequence.getLength ()) {
+return;
+}this.stretchGroup = this.av.getSelectionGroup ();
+if (this.stretchGroup == null) {
+this.stretchGroup = this.av.getAlignment ().findGroup (sequence);
+if (this.stretchGroup != null && res > this.stretchGroup.getStartRes () && res < this.stretchGroup.getEndRes ()) {
+this.av.setSelectionGroup (this.stretchGroup);
+} else {
+this.stretchGroup = null;
+}} else if (!this.stretchGroup.getSequences (null).contains (sequence) || this.stretchGroup.getStartRes () > res || this.stretchGroup.getEndRes () < res) {
+this.stretchGroup = null;
+var allGroups = this.av.getAlignment ().findAllGroups (sequence);
+if (allGroups != null) {
+for (var i = 0; i < allGroups.length; i++) {
+if (allGroups[i].getStartRes () <= res && allGroups[i].getEndRes () >= res) {
+this.stretchGroup = allGroups[i];
+break;
+}}
+}this.av.setSelectionGroup (this.stretchGroup);
+}if ((evt.getModifiers () & 4) == 4) {
+var allFeatures = this.findFeaturesAtRes (sequence, sequence.findPosition (res));
+var links = null;
+if (allFeatures != null) {
+for (var i = 0; i < allFeatures.length; i++) {
+if (allFeatures[i].links != null) {
+if (links == null) {
+links =  new java.util.Vector ();
+}for (var j = 0; j < allFeatures[i].links.size (); j++) {
+links.addElement (allFeatures[i].links.elementAt (j));
+}
+}}
+}var popup =  new jalview.appletgui.APopupMenu (this.ap, null, links);
+this.add (popup);
+popup.show (this, evt.getX (), evt.getY ());
+return;
+}if (this.av.cursorMode) {
+this.seqCanvas.cursorX = this.findRes (evt);
+this.seqCanvas.cursorY = this.findSeq (evt);
+this.seqCanvas.repaint ();
+return;
+}if (this.stretchGroup == null) {
+var sg =  new jalview.datamodel.SequenceGroup ();
+sg.setStartRes (res);
+sg.setEndRes (res);
+sg.addSequence (sequence, false);
+this.av.setSelectionGroup (sg);
+this.stretchGroup = sg;
+if (this.av.getConservationSelected ()) {
+jalview.appletgui.SliderPanel.setConservationSlider (this.ap, this.av.getGlobalColourScheme (), "Background");
+}if (this.av.getAbovePIDThreshold ()) {
+jalview.appletgui.SliderPanel.setPIDSliderSource (this.ap, this.av.getGlobalColourScheme (), "Background");
+}}}, "java.awt.event.MouseEvent");
+Clazz_defineMethod (c$, "doMouseReleasedDefineMode", 
+function (evt) {
+if (this.stretchGroup == null) {
+return;
+}this.stretchGroup.recalcConservation ();
+if (this.stretchGroup.cs != null) {
+this.stretchGroup.cs.alignmentChanged (this.stretchGroup, this.av.getHiddenRepSequences ());
+if (this.stretchGroup.cs.conservationApplied ()) {
+jalview.appletgui.SliderPanel.setConservationSlider (this.ap, this.stretchGroup.cs, this.stretchGroup.getName ());
+} else {
+jalview.appletgui.SliderPanel.setPIDSliderSource (this.ap, this.stretchGroup.cs, this.stretchGroup.getName ());
+}}this.changeEndRes = false;
+this.changeStartRes = false;
+this.stretchGroup = null;
+jalview.appletgui.PaintRefresher.Refresh (this.ap, this.av.getSequenceSetId ());
+this.ap.paintAlignment (true);
+this.av.sendSelection ();
+}, "java.awt.event.MouseEvent");
+Clazz_defineMethod (c$, "doMouseDraggedDefineMode", 
+function (evt) {
+var res = this.findRes (evt);
+var y = this.findSeq (evt);
+if (this.wrappedBlock != this.startWrapBlock) {
+return;
+}if (this.stretchGroup == null) {
+return;
+}this.mouseDragging = true;
+if (y > this.av.getAlignment ().getHeight ()) {
+y = this.av.getAlignment ().getHeight () - 1;
+}if (res >= this.av.getAlignment ().getWidth ()) {
+res = this.av.getAlignment ().getWidth () - 1;
+}if (this.stretchGroup.getEndRes () == res) {
+this.changeEndRes = true;
+} else if (this.stretchGroup.getStartRes () == res) {
+this.changeStartRes = true;
+}if (res < 0) {
+res = 0;
+}if (this.changeEndRes) {
+if (res > (this.stretchGroup.getStartRes () - 1)) {
+this.stretchGroup.setEndRes (res);
+}} else if (this.changeStartRes) {
+if (res < (this.stretchGroup.getEndRes () + 1)) {
+this.stretchGroup.setStartRes (res);
+}}var dragDirection = 0;
+if (y > this.oldSeq) {
+dragDirection = 1;
+} else if (y < this.oldSeq) {
+dragDirection = -1;
+}while ((y != this.oldSeq) && (this.oldSeq > -1) && (y < this.av.getAlignment ().getHeight ())) {
+var seq = this.av.getAlignment ().getSequenceAt (this.oldSeq);
+this.oldSeq += dragDirection;
+if (this.oldSeq < 0) {
+break;
+}var nextSeq = this.av.getAlignment ().getSequenceAt (this.oldSeq);
+if (this.stretchGroup.getSequences (null).contains (nextSeq)) {
+this.stretchGroup.deleteSequence (seq, false);
+} else {
+if (seq != null) {
+this.stretchGroup.addSequence (seq, false);
+}this.stretchGroup.addSequence (nextSeq, false);
+}}
+if (this.oldSeq < 0) {
+this.oldSeq = -1;
+}if (res > this.av.endRes || res < this.av.startRes || y < this.av.startSeq || y > this.av.endSeq) {
+this.mouseExited (evt);
+}if (this.scrollThread != null) {
+this.scrollThread.setEvent (evt);
+}this.seqCanvas.repaint ();
+}, "java.awt.event.MouseEvent");
+Clazz_overrideMethod (c$, "mouseEntered", 
+function (e) {
+if (this.oldSeq < 0) {
+this.oldSeq = 0;
+}if (this.scrollThread != null) {
+this.scrollThread.running = false;
+this.scrollThread = null;
+}}, "java.awt.event.MouseEvent");
+Clazz_overrideMethod (c$, "mouseExited", 
+function (e) {
+if (this.av.getWrapAlignment ()) {
+return;
+}if (this.mouseDragging && this.scrollThread == null) {
+this.scrollThread = Clazz_innerTypeInstance (jalview.appletgui.SeqPanel.ScrollThread, this, null);
+}}, "java.awt.event.MouseEvent");
+Clazz_defineMethod (c$, "scrollCanvas", 
+function (evt) {
+if (evt == null) {
+if (this.scrollThread != null) {
+this.scrollThread.running = false;
+this.scrollThread = null;
+}this.mouseDragging = false;
+} else {
+if (this.scrollThread == null) {
+this.scrollThread = Clazz_innerTypeInstance (jalview.appletgui.SeqPanel.ScrollThread, this, null);
+}this.mouseDragging = true;
+this.scrollThread.setEvent (evt);
+}}, "java.awt.event.MouseEvent");
+Clazz_overrideMethod (c$, "selection", 
+function (seqsel, colsel, source) {
+if (this.av != null && (this.av === source || !this.av.followSelection || (Clazz_instanceOf (source, jalview.appletgui.AlignViewport) && (source).getSequenceSetId ().equals (this.av.getSequenceSetId ())))) {
+return;
+}if (this.selectionFromTranslation (seqsel, colsel, source)) {
+return;
+}var repaint = false;
+var copycolsel = true;
+if (this.av.getSelectionGroup () == null || !this.av.isSelectionGroupChanged (true)) {
+var sgroup = null;
+if (seqsel != null && seqsel.getSize () > 0) {
+if (this.av.getAlignment () == null) {
+System.out.println ("Selection message: alignviewport av SeqSetId=" + this.av.getSequenceSetId () + " ViewId=" + this.av.getViewId () + " 's alignment is NULL! returning immediatly.");
+return;
+}sgroup = seqsel.intersect (this.av.getAlignment (), (this.av.hasHiddenRows ()) ? this.av.getHiddenRepSequences () : null);
+if ((sgroup == null || sgroup.getSize () == 0) && (colsel == null || colsel.size () == 0)) {
+copycolsel = false;
+}}if (sgroup != null && sgroup.getSize () > 0) {
+this.av.setSelectionGroup (sgroup);
+} else {
+this.av.setSelectionGroup (null);
+}repaint = this.av.isSelectionGroupChanged (true);
+}if (copycolsel && (this.av.getColumnSelection () == null || !this.av.isColSelChanged (true))) {
+if (colsel == null || colsel.size () == 0) {
+if (this.av.getColumnSelection () != null) {
+this.av.getColumnSelection ().clear ();
+}} else {
+if (this.av.getColumnSelection () == null) {
+this.av.setColumnSelection ( new jalview.datamodel.ColumnSelection (colsel));
+} else {
+this.av.getColumnSelection ().setElementsFrom (colsel);
+}}repaint = new Boolean (repaint | this.av.isColSelChanged (true)).valueOf ();
+}if (copycolsel && this.av.hasHiddenColumns () && (this.av.getColumnSelection () == null || this.av.getColumnSelection ().getHiddenColumns () == null)) {
+System.err.println ("Bad things");
+}if (repaint) {
+this.ap.scalePanelHolder.repaint ();
+this.ap.repaint ();
+}}, "jalview.datamodel.SequenceGroup,jalview.datamodel.ColumnSelection,jalview.structure.SelectionSource");
+Clazz_defineMethod (c$, "scrollTo", 
+function (row, column) {
+row = row < 0 ? this.ap.av.startSeq : row;
+column = column < 0 ? this.ap.av.startRes : column;
+this.ap.scrollTo (column, column, row, true, true);
+}, "~N,~N");
+Clazz_defineMethod (c$, "scrollToRow", 
+function (row) {
+row = row < 0 ? this.ap.av.startSeq : row;
+this.ap.scrollTo (this.ap.av.startRes, this.ap.av.startRes, row, true, true);
+}, "~N");
+Clazz_defineMethod (c$, "scrollToColumn", 
+function (column) {
+column = column < 0 ? this.ap.av.startRes : column;
+this.ap.scrollTo (column, column, this.ap.av.startSeq, true, true);
+}, "~N");
+Clazz_defineMethod (c$, "selectionFromTranslation", 
+function (seqsel, colsel, source) {
+if (!(Clazz_instanceOf (source, jalview.api.AlignViewportI))) {
+return false;
+}var sourceAv = source;
+if (sourceAv.getCodingComplement () !== this.av && this.av.getCodingComplement () !== sourceAv) {
+return false;
+}var sg = jalview.util.MappingUtils.mapSequenceGroup (seqsel, sourceAv, this.av);
+this.av.setSelectionGroup (sg);
+this.av.isSelectionGroupChanged (true);
+var cs = jalview.util.MappingUtils.mapColumnSelection (colsel, sourceAv, this.av);
+this.av.setColumnSelection (cs);
+this.av.isColSelChanged (true);
+this.ap.scalePanelHolder.repaint ();
+this.ap.repaint ();
+return true;
+}, "jalview.datamodel.SequenceGroup,jalview.datamodel.ColumnSelection,jalview.structure.SelectionSource");
+c$.$SeqPanel$ScrollThread$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_decorateAsClass (function () {
+Clazz_prepareCallback (this, arguments);
+this.evt = null;
+this.running = false;
+Clazz_instantialize (this, arguments);
+}, jalview.appletgui.SeqPanel, "ScrollThread", Thread);
+Clazz_makeConstructor (c$, 
+function () {
+Clazz_superConstructor (this, jalview.appletgui.SeqPanel.ScrollThread, []);
+this.start ();
+});
+Clazz_defineMethod (c$, "setEvent", 
+function (a) {
+this.evt = a;
+}, "java.awt.event.MouseEvent");
+Clazz_defineMethod (c$, "stopScrolling", 
+function () {
+this.running = false;
+});
+Clazz_overrideMethod (c$, "run", 
+function () {
+this.running = true;
+while (this.running) {
+if (this.evt != null) {
+if (this.b$["jalview.appletgui.SeqPanel"].mouseDragging && this.evt.getY () < 0 && this.b$["jalview.appletgui.SeqPanel"].av.getStartSeq () > 0) {
+this.running = this.b$["jalview.appletgui.SeqPanel"].ap.scrollUp (true);
+}if (this.b$["jalview.appletgui.SeqPanel"].mouseDragging && this.evt.getY () >= this.b$["jalview.appletgui.SeqPanel"].getSize ().height && this.b$["jalview.appletgui.SeqPanel"].av.getAlignment ().getHeight () > this.b$["jalview.appletgui.SeqPanel"].av.getEndSeq ()) {
+this.running = this.b$["jalview.appletgui.SeqPanel"].ap.scrollUp (false);
+}if (this.b$["jalview.appletgui.SeqPanel"].mouseDragging && this.evt.getX () < 0) {
+this.running = this.b$["jalview.appletgui.SeqPanel"].ap.scrollRight (false);
+} else if (this.b$["jalview.appletgui.SeqPanel"].mouseDragging && this.evt.getX () >= this.b$["jalview.appletgui.SeqPanel"].getSize ().width) {
+this.running = this.b$["jalview.appletgui.SeqPanel"].ap.scrollRight (true);
+}}try {
+Thread.sleep (75);
+} catch (ex) {
+if (Clazz_exceptionOf (ex, Exception)) {
+} else {
+throw ex;
+}
+}
+}
+});
+c$ = Clazz_p0p ();
+};
+});
+Clazz_declarePackage ("jalview.structure");
+Clazz_declareInterface (jalview.structure, "SelectionListener");
+Clazz_declarePackage ("jalview.appletgui");
+Clazz_load (["awt2swing.Panel"], "jalview.appletgui.SeqCanvas", ["awt2swing.Util", "jalview.appletgui.AnnotationPanel", "$.FeatureRenderer", "$.PaintRefresher", "$.SequenceRenderer", "jalview.util.Comparison", "java.awt.Color"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.fr = null;
+this.sr = null;
+this.img = null;
+this.gg = null;
+this.imgWidth = 0;
+this.imgHeight = 0;
+this.av = null;
+this.searchResults = null;
+this.$fastPaint = false;
+this.cursorX = 0;
+this.cursorY = 0;
+this.avcharHeight = 0;
+this.avcharWidth = 0;
+this.lastsr = 0;
+this.LABEL_WEST = 0;
+this.LABEL_EAST = 0;
+this.annotations = null;
+Clazz_instantialize (this, arguments);
+}, jalview.appletgui, "SeqCanvas", awt2swing.Panel);
+Clazz_makeConstructor (c$, 
+function (av) {
+Clazz_superConstructor (this, jalview.appletgui.SeqCanvas, []);
+this.av = av;
+this.fr =  new jalview.appletgui.FeatureRenderer (av);
+this.sr =  new jalview.appletgui.SequenceRenderer (av);
+jalview.appletgui.PaintRefresher.Register (this, av.getSequenceSetId ());
+this.updateViewport ();
+}, "jalview.appletgui.AlignViewport");
+Clazz_defineMethod (c$, "updateViewport", 
+ function () {
+this.avcharHeight = this.av.getCharHeight ();
+this.avcharWidth = this.av.getCharWidth ();
+});
+Clazz_defineMethod (c$, "getViewport", 
+function () {
+return this.av;
+});
+Clazz_defineMethod (c$, "getFeatureRenderer", 
+function () {
+return this.fr;
+});
+Clazz_defineMethod (c$, "getSequenceRenderer", 
+function () {
+return this.sr;
+});
+Clazz_defineMethod (c$, "drawNorthScale", 
+ function (g, startx, endx, ypos) {
+var scalestartx = startx - startx % 10 + 10;
+g.setColor (java.awt.Color.black);
+for (var i = scalestartx; i < endx; i += 10) {
+var value = i;
+if (this.av.hasHiddenColumns ()) {
+value = this.av.getColumnSelection ().adjustForHiddenColumns (value);
+}awt2swing.Util.drawString (g, String.valueOf (value), (i - startx - 1) * this.avcharWidth, ypos - (Clazz_doubleToInt (this.avcharHeight / 2)));
+g.drawLine (((i - startx - 1) * this.avcharWidth) + (Clazz_doubleToInt (this.avcharWidth / 2)), (ypos + 2) - (Clazz_doubleToInt (this.avcharHeight / 2)), ((i - startx - 1) * this.avcharWidth) + (Clazz_doubleToInt (this.avcharWidth / 2)), ypos - 2);
+}
+}, "java.awt.Graphics,~N,~N,~N");
+Clazz_defineMethod (c$, "drawWestScale", 
+ function (g, startx, endx, ypos) {
+var fm = this.getFontMetrics (this.av.getFont ());
+ypos += this.avcharHeight;
+if (this.av.hasHiddenColumns ()) {
+startx = this.av.getColumnSelection ().adjustForHiddenColumns (startx);
+endx = this.av.getColumnSelection ().adjustForHiddenColumns (endx);
+}var maxwidth = this.av.getAlignment ().getWidth ();
+if (this.av.hasHiddenColumns ()) {
+maxwidth = this.av.getColumnSelection ().findColumnPosition (maxwidth) - 1;
+}for (var i = 0; i < this.av.getAlignment ().getHeight (); i++) {
+var seq = this.av.getAlignment ().getSequenceAt (i);
+var index = startx;
+var value = -1;
+while (index < endx) {
+if (jalview.util.Comparison.isGap (seq.getCharAt (index))) {
+index++;
+continue;
+}value = this.av.getAlignment ().getSequenceAt (i).findPosition (index);
+break;
+}
+if (value != -1) {
+var x = this.LABEL_WEST - fm.stringWidth (String.valueOf (value)) - Clazz_doubleToInt (this.avcharWidth / 2);
+awt2swing.Util.drawString (g, value + "", x, (ypos + (i * this.avcharHeight)) - (Clazz_doubleToInt (this.avcharHeight / 5)));
+}}
+}, "java.awt.Graphics,~N,~N,~N");
+Clazz_defineMethod (c$, "drawEastScale", 
+ function (g, startx, endx, ypos) {
+ypos += this.avcharHeight;
+if (this.av.hasHiddenColumns ()) {
+endx = this.av.getColumnSelection ().adjustForHiddenColumns (endx);
+}var seq;
+for (var i = 0; i < this.av.getAlignment ().getHeight (); i++) {
+seq = this.av.getAlignment ().getSequenceAt (i);
+var index = endx;
+var value = -1;
+while (index > startx) {
+if (jalview.util.Comparison.isGap (seq.getCharAt (index))) {
+index--;
+continue;
+}value = seq.findPosition (index);
+break;
+}
+if (value != -1) {
+awt2swing.Util.drawString (g, String.valueOf (value), 0, (ypos + (i * this.avcharHeight)) - (Clazz_doubleToInt (this.avcharHeight / 5)));
+}}
+}, "java.awt.Graphics,~N,~N,~N");
+Clazz_defineMethod (c$, "fastPaint", 
+function (horizontal, vertical) {
+if (this.$fastPaint || this.gg == null) {
+return;
+}this.updateViewport ();
+if (this.lastsr + horizontal != this.av.startRes) {
+horizontal = this.av.startRes - this.lastsr;
+}this.lastsr = this.av.startRes;
+this.$fastPaint = true;
+this.gg.copyArea (horizontal * this.avcharWidth, vertical * this.avcharHeight, this.imgWidth - horizontal * this.avcharWidth, this.imgHeight - vertical * this.avcharHeight, -horizontal * this.avcharWidth, -vertical * this.avcharHeight);
+var sr = this.av.startRes;
+var er = this.av.endRes;
+var ss = this.av.startSeq;
+var es = this.av.endSeq;
+var transX = 0;
+var transY = 0;
+if (horizontal > 0) {
+transX = (er - sr - horizontal) * this.avcharWidth;
+sr = er - horizontal;
+} else if (horizontal < 0) {
+er = sr - horizontal;
+} else if (vertical > 0) {
+ss = es - vertical;
+if (ss < this.av.startSeq) {
+ss = this.av.startSeq;
+} else {
+transY = this.imgHeight - vertical * this.avcharHeight;
+}} else if (vertical < 0) {
+es = ss - vertical;
+if (es > this.av.endSeq) {
+es = this.av.endSeq;
+}}this.gg.translate (transX, transY);
+this.drawPanel (this.gg, sr, er, ss, es, 0);
+this.gg.translate (-transX, -transY);
+this.repaint ();
+}, "~N,~N");
+Clazz_overrideMethod (c$, "paintComponent", 
+function (g) {
+if (this.img != null && (this.$fastPaint || (this.getSize ().width != g.getClipBounds ().width) || (this.getSize ().height != g.getClipBounds ().height))) {
+g.drawImage (this.img, 0, 0, this);
+this.$fastPaint = false;
+return;
+}if (this.$fastPaint) {
+g.drawImage (this.img, 0, 0, this);
+this.$fastPaint = false;
+return;
+}this.updateViewport ();
+this.imgWidth = this.getSize ().width;
+this.imgHeight = this.getSize ().height;
+this.imgWidth -= this.imgWidth % this.avcharWidth;
+this.imgHeight -= this.imgHeight % this.avcharHeight;
+if (this.imgWidth < 1 || this.imgHeight < 1) {
+return;
+}if (this.img == null || this.imgWidth != this.img.getWidth (this) || this.imgHeight != this.img.getHeight (this)) {
+this.img = this.createImage (this.imgWidth, this.imgHeight);
+this.gg = this.img.getGraphics ();
+this.gg.setFont (this.av.getFont ());
+}this.gg.setColor (java.awt.Color.white);
+this.gg.fillRect (0, 0, this.imgWidth, this.imgHeight);
+if (this.av.getWrapAlignment ()) {
+this.drawWrappedPanel (this.gg, this.imgWidth, this.imgHeight, this.av.startRes);
+} else {
+this.drawPanel (this.gg, this.av.startRes, this.av.endRes, this.av.startSeq, this.av.endSeq, 0);
+}g.drawImage (this.img, 0, 0, this);
+}, "java.awt.Graphics");
+Clazz_defineMethod (c$, "getWrappedCanvasWidth", 
+function (cwidth) {
+cwidth -= cwidth % this.av.getCharWidth ();
+var fm = this.getFontMetrics (this.av.getFont ());
+this.LABEL_EAST = 0;
+this.LABEL_WEST = 0;
+if (this.av.getScaleRightWrapped ()) {
+this.LABEL_EAST = fm.stringWidth (this.getMask ());
+}if (this.av.getScaleLeftWrapped ()) {
+this.LABEL_WEST = fm.stringWidth (this.getMask ());
+}return Clazz_doubleToInt ((cwidth - this.LABEL_EAST - this.LABEL_WEST) / this.av.getCharWidth ());
+}, "~N");
+Clazz_defineMethod (c$, "getMask", 
+function () {
+var mask = "0";
+var maxWidth = 0;
+var tmp;
+var alignment = this.av.getAlignment ();
+for (var i = 0; i < alignment.getHeight (); i++) {
+tmp = alignment.getSequenceAt (i).getEnd ();
+if (tmp > maxWidth) {
+maxWidth = tmp;
+}}
+for (var i = maxWidth; i > 0; i /= 10) {
+mask += "0";
+}
+return mask;
+});
+Clazz_defineMethod (c$, "drawWrappedPanel", 
+ function (g, canvasWidth, canvasHeight, startRes) {
+var al = this.av.getAlignment ();
+var fm = this.getFontMetrics (this.av.getFont ());
+if (this.av.getScaleRightWrapped ()) {
+this.LABEL_EAST = fm.stringWidth (this.getMask ());
+}if (this.av.getScaleLeftWrapped ()) {
+this.LABEL_WEST = fm.stringWidth (this.getMask ());
+}var hgap = this.avcharHeight;
+if (this.av.getScaleAboveWrapped ()) {
+hgap += this.avcharHeight;
+}var cWidth = Clazz_doubleToInt ((canvasWidth - this.LABEL_EAST - this.LABEL_WEST) / this.avcharWidth);
+var cHeight = this.av.getAlignment ().getHeight () * this.avcharHeight;
+this.av.setWrappedWidth (cWidth);
+this.av.endRes = this.av.startRes + cWidth;
+var endx;
+var ypos = hgap;
+var maxwidth = this.av.getAlignment ().getWidth () - 1;
+if (this.av.hasHiddenColumns ()) {
+maxwidth = this.av.getColumnSelection ().findColumnPosition (maxwidth) - 1;
+}while ((ypos <= canvasHeight) && (startRes < maxwidth)) {
+endx = startRes + cWidth - 1;
+if (endx > maxwidth) {
+endx = maxwidth;
+}g.setColor (java.awt.Color.black);
+if (this.av.getScaleLeftWrapped ()) {
+this.drawWestScale (g, startRes, endx, ypos);
+}if (this.av.getScaleRightWrapped ()) {
+g.translate (canvasWidth - this.LABEL_EAST, 0);
+this.drawEastScale (g, startRes, endx, ypos);
+g.translate (-(canvasWidth - this.LABEL_EAST), 0);
+}g.translate (this.LABEL_WEST, 0);
+if (this.av.getScaleAboveWrapped ()) {
+this.drawNorthScale (g, startRes, endx, ypos);
+}if (this.av.hasHiddenColumns () && this.av.getShowHiddenMarkers ()) {
+g.setColor (java.awt.Color.blue);
+var res;
+for (var i = 0; i < this.av.getColumnSelection ().getHiddenColumns ().size (); i++) {
+res = this.av.getColumnSelection ().findHiddenRegionPosition (i) - startRes;
+if (res < 0 || res > endx - startRes) {
+continue;
+}this.gg.fillPolygon ( Clazz_newIntArray (-1, [res * this.avcharWidth - Clazz_doubleToInt (this.avcharHeight / 4), res * this.avcharWidth + Clazz_doubleToInt (this.avcharHeight / 4), res * this.avcharWidth]),  Clazz_newIntArray (-1, [ypos - (Clazz_doubleToInt (this.avcharHeight / 2)), ypos - (Clazz_doubleToInt (this.avcharHeight / 2)), ypos - (Clazz_doubleToInt (this.avcharHeight / 2)) + 8]), 3);
+}
+}if (g.getClip () == null) {
+g.setClip (0, 0, cWidth * this.avcharWidth, canvasHeight);
+}this.drawPanel (g, startRes, endx, 0, al.getHeight (), ypos);
+g.setClip (null);
+if (this.av.isShowAnnotation ()) {
+g.translate (0, cHeight + ypos + 4);
+if (this.annotations == null) {
+this.annotations =  new jalview.appletgui.AnnotationPanel (this.av);
+}this.annotations.drawComponent (g, startRes, endx + 1);
+g.translate (0, -cHeight - ypos - 4);
+}g.translate (-this.LABEL_WEST, 0);
+ypos += cHeight + this.getAnnotationHeight () + hgap;
+startRes += cWidth;
+}
+}, "java.awt.Graphics,~N,~N,~N");
+Clazz_defineMethod (c$, "getAnnotationHeight", 
+function () {
+if (!this.av.isShowAnnotation ()) {
+return 0;
+}if (this.annotations == null) {
+this.annotations =  new jalview.appletgui.AnnotationPanel (this.av);
+}return this.annotations.adjustPanelHeight ();
+});
+Clazz_defineMethod (c$, "drawPanel", 
+ function (g1, startRes, endRes, startSeq, endSeq, offset) {
+if (!this.av.hasHiddenColumns ()) {
+this.draw (g1, startRes, endRes, startSeq, endSeq, offset);
+} else {
+var screenY = 0;
+var blockStart = startRes;
+var blockEnd = endRes;
+if (this.av.hasHiddenColumns ()) {
+for (var region, $region = this.av.getColumnSelection ().getHiddenColumns ().iterator (); $region.hasNext () && ((region = $region.next ()) || true);) {
+var hideStart = region[0];
+var hideEnd = region[1];
+if (hideStart <= blockStart) {
+blockStart += (hideEnd - hideStart) + 1;
+continue;
+}blockEnd = hideStart - 1;
+g1.translate (screenY * this.avcharWidth, 0);
+this.draw (g1, blockStart, blockEnd, startSeq, endSeq, offset);
+if (this.av.getShowHiddenMarkers ()) {
+g1.setColor (java.awt.Color.blue);
+g1.drawLine ((blockEnd - blockStart + 1) * this.avcharWidth - 1, 0 + offset, (blockEnd - blockStart + 1) * this.avcharWidth - 1, (endSeq - startSeq) * this.avcharHeight + offset);
+}g1.translate (-screenY * this.avcharWidth, 0);
+screenY += blockEnd - blockStart + 1;
+blockStart = hideEnd + 1;
+}
+}if (screenY <= (endRes - startRes)) {
+blockEnd = blockStart + (endRes - startRes) - screenY;
+g1.translate (screenY * this.avcharWidth, 0);
+this.draw (g1, blockStart, blockEnd, startSeq, endSeq, offset);
+g1.translate (-screenY * this.avcharWidth, 0);
+}}}, "java.awt.Graphics,~N,~N,~N,~N,~N");
+Clazz_defineMethod (c$, "draw", 
+function (g, startRes, endRes, startSeq, endSeq, offset) {
+g.setFont (this.av.getFont ());
+this.sr.prepare (g, this.av.isRenderGaps ());
+this.updateViewport ();
+var nextSeq;
+for (var i = startSeq; i < endSeq; i++) {
+nextSeq = this.av.getAlignment ().getSequenceAt (i);
+if (nextSeq == null) {
+continue;
+}this.sr.drawSequence (nextSeq, this.av.getAlignment ().findAllGroups (nextSeq), startRes, endRes, offset + ((i - startSeq) * this.avcharHeight));
+if (this.av.isShowSequenceFeatures ()) {
+this.fr.drawSequence (g, nextSeq, startRes, endRes, offset + ((i - startSeq) * this.avcharHeight));
+}if (this.searchResults != null) {
+var visibleResults = this.searchResults.getResults (nextSeq, startRes, endRes);
+if (visibleResults != null) {
+for (var r = 0; r < visibleResults.length; r += 2) {
+this.sr.drawHighlightedText (nextSeq, visibleResults[r], visibleResults[r + 1], (visibleResults[r] - startRes) * this.avcharWidth, offset + ((i - startSeq) * this.avcharHeight));
+}
+}}if (this.av.cursorMode && this.cursorY == i && this.cursorX >= startRes && this.cursorX <= endRes) {
+this.sr.drawCursor (nextSeq, this.cursorX, (this.cursorX - startRes) * this.avcharWidth, offset + ((i - startSeq) * this.avcharHeight));
+}}
+if (this.av.getSelectionGroup () != null || this.av.getAlignment ().getGroups ().size () > 0) {
+this.drawGroupsBoundaries (g, startRes, endRes, startSeq, endSeq, offset);
+}}, "java.awt.Graphics,~N,~N,~N,~N,~N");
+Clazz_defineMethod (c$, "drawGroupsBoundaries", 
+ function (g, startRes, endRes, startSeq, endSeq, offset) {
+var group = this.av.getSelectionGroup ();
+var sx = -1;
+var sy = -1;
+var ex = -1;
+var groupIndex = -1;
+if ((group == null) && (this.av.getAlignment ().getGroups ().size () > 0)) {
+group = this.av.getAlignment ().getGroups ().get (0);
+groupIndex = 0;
+}if (group != null) {
+do {
+var oldY = -1;
+var i = 0;
+var inGroup = false;
+var top = -1;
+var bottom = -1;
+var alHeight = this.av.getAlignment ().getHeight () - 1;
+for (i = startSeq; i < endSeq; i++) {
+sx = (group.getStartRes () - startRes) * this.avcharWidth;
+sy = offset + ((i - startSeq) * this.avcharHeight);
+ex = (((group.getEndRes () + 1) - group.getStartRes ()) * this.avcharWidth) - 1;
+if (sx + ex < 0 || sx > this.imgWidth) {
+continue;
+}if ((sx <= (endRes - startRes) * this.avcharWidth) && group.getSequences (null).contains (this.av.getAlignment ().getSequenceAt (i))) {
+if ((bottom == -1) && (i >= alHeight || !group.getSequences (null).contains (this.av.getAlignment ().getSequenceAt (i + 1)))) {
+bottom = sy + this.avcharHeight;
+}if (!inGroup) {
+if (((top == -1) && (i == 0)) || !group.getSequences (null).contains (this.av.getAlignment ().getSequenceAt (i - 1))) {
+top = sy;
+}oldY = sy;
+inGroup = true;
+if (group === this.av.getSelectionGroup ()) {
+g.setColor (java.awt.Color.red);
+} else {
+g.setColor (group.getOutlineColour ());
+}}} else {
+if (inGroup) {
+if (sx >= 0 && sx < this.imgWidth) {
+g.drawLine (sx, oldY, sx, sy);
+}if (sx + ex < this.imgWidth) {
+g.drawLine (sx + ex, oldY, sx + ex, sy);
+}if (sx < 0) {
+ex += sx;
+sx = 0;
+}if (sx + ex > this.imgWidth) {
+ex = this.imgWidth;
+} else if (sx + ex >= (endRes - startRes + 1) * this.avcharWidth) {
+ex = (endRes - startRes + 1) * this.avcharWidth;
+}if (top != -1) {
+g.drawLine (sx, top, sx + ex, top);
+top = -1;
+}if (bottom != -1) {
+g.drawLine (sx, bottom, sx + ex, bottom);
+bottom = -1;
+}inGroup = false;
+}}}
+if (inGroup) {
+sy = offset + ((i - startSeq) * this.avcharHeight);
+if (sx >= 0 && sx < this.imgWidth) {
+g.drawLine (sx, oldY, sx, sy);
+}if (sx + ex < this.imgWidth) {
+g.drawLine (sx + ex, oldY, sx + ex, sy);
+}if (sx < 0) {
+ex += sx;
+sx = 0;
+}if (sx + ex > this.imgWidth) {
+ex = this.imgWidth;
+} else if (sx + ex >= (endRes - startRes + 1) * this.avcharWidth) {
+ex = (endRes - startRes + 1) * this.avcharWidth;
+}if (top != -1) {
+g.drawLine (sx, top, sx + ex, top);
+top = -1;
+}if (bottom != -1) {
+g.drawLine (sx, bottom - 1, sx + ex, bottom - 1);
+bottom = -1;
+}inGroup = false;
+}groupIndex++;
+if (groupIndex >= this.av.getAlignment ().getGroups ().size ()) {
+break;
+}group = this.av.getAlignment ().getGroups ().get (groupIndex);
+} while (groupIndex < this.av.getAlignment ().getGroups ().size ());
+}}, "java.awt.Graphics,~N,~N,~N,~N,~N");
+Clazz_defineMethod (c$, "highlightSearchResults", 
+function (results) {
+this.searchResults = results;
+this.repaint ();
+}, "jalview.datamodel.SearchResults");
+});
+Clazz_declarePackage ("jalview.appletgui");
+Clazz_load (["jalview.api.SequenceRenderer"], "jalview.appletgui.SequenceRenderer", ["awt2swing.Util", "jalview.util.Comparison", "java.awt.Color", "$.Font"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.av = null;
+this.fm = null;
+this.renderGaps = true;
+this.currentSequenceGroup = null;
+this.allGroups = null;
+this.resBoxColour = null;
+this.graphics = null;
+this.forOverview = false;
+Clazz_instantialize (this, arguments);
+}, jalview.appletgui, "SequenceRenderer", null, jalview.api.SequenceRenderer);
+Clazz_makeConstructor (c$, 
+function (av) {
+this.av = av;
+}, "jalview.appletgui.AlignViewport");
+Clazz_defineMethod (c$, "prepare", 
+function (g, renderGaps) {
+this.graphics = g;
+this.fm = g.getFontMetrics ();
+this.renderGaps = renderGaps;
+}, "java.awt.Graphics,~B");
+Clazz_overrideMethod (c$, "getResidueBoxColour", 
+function (seq, i) {
+this.allGroups = this.av.getAlignment ().findAllGroups (seq);
+if (this.inCurrentSequenceGroup (i)) {
+if (this.currentSequenceGroup.getDisplayBoxes ()) {
+this.getBoxColour (this.currentSequenceGroup.cs, seq, i);
+}} else if (this.av.getShowBoxes ()) {
+this.getBoxColour (this.av.getGlobalColourScheme (), seq, i);
+}return this.resBoxColour;
+}, "jalview.datamodel.SequenceI,~N");
+Clazz_overrideMethod (c$, "getResidueColour", 
+function (seq, position, fr) {
+var col = this.getResidueBoxColour (seq, position);
+if (fr != null) {
+col = fr.findFeatureColour (col, seq, position);
+}return col;
+}, "jalview.datamodel.SequenceI,~N,jalview.api.FeatureRenderer");
+Clazz_defineMethod (c$, "getBoxColour", 
+function (cs, seq, i) {
+if (cs != null) {
+this.resBoxColour = cs.findColourSeq (seq.getCharAt (i), i, seq);
+} else if (this.forOverview && !jalview.util.Comparison.isGap (seq.getCharAt (i))) {
+this.resBoxColour = java.awt.Color.lightGray;
+} else {
+this.resBoxColour = java.awt.Color.white;
+}}, "jalview.schemes.ColourSchemeI,jalview.datamodel.SequenceI,~N");
+Clazz_defineMethod (c$, "findSequenceColour", 
+function (seq, i) {
+this.allGroups = this.av.getAlignment ().findAllGroups (seq);
+this.drawBoxes (seq, i, i, 0);
+return this.resBoxColour;
+}, "jalview.datamodel.SequenceI,~N");
+Clazz_defineMethod (c$, "drawSequence", 
+function (seq, sg, start, end, y1) {
+if (seq == null) {
+return;
+}this.allGroups = sg;
+this.drawBoxes (seq, start, end, y1);
+if (this.av.validCharWidth) {
+this.drawText (seq, start, end, y1);
+}}, "jalview.datamodel.SequenceI,~A,~N,~N,~N");
+Clazz_defineMethod (c$, "drawBoxes", 
+function (seq, start, end, y1) {
+var i = start;
+var length = seq.getLength ();
+var curStart = -1;
+var curWidth = this.av.getCharWidth ();
+var avCharWidth = this.av.getCharWidth ();
+var avCharHeight = this.av.getCharHeight ();
+var tempColour = null;
+while (i <= end) {
+this.resBoxColour = java.awt.Color.white;
+if (i < length) {
+if (this.inCurrentSequenceGroup (i)) {
+if (this.currentSequenceGroup.getDisplayBoxes ()) {
+this.getBoxColour (this.currentSequenceGroup.cs, seq, i);
+}} else if (this.av.getShowBoxes ()) {
+this.getBoxColour (this.av.getGlobalColourScheme (), seq, i);
+}}if (this.resBoxColour !== tempColour) {
+if (tempColour != null) {
+this.graphics.fillRect (avCharWidth * (curStart - start), y1, curWidth, avCharHeight);
+}this.graphics.setColor (this.resBoxColour);
+curStart = i;
+curWidth = avCharWidth;
+tempColour = this.resBoxColour;
+} else {
+curWidth += avCharWidth;
+}i++;
+}
+this.graphics.fillRect (avCharWidth * (curStart - start), y1, curWidth, avCharHeight);
+}, "jalview.datamodel.SequenceI,~N,~N,~N");
+Clazz_defineMethod (c$, "drawText", 
+function (seq, start, end, y1) {
+var avCharWidth = this.av.getCharWidth ();
+var avCharHeight = this.av.getCharHeight ();
+var boldFont = null;
+var bold = false;
+if (this.av.isUpperCasebold ()) {
+boldFont =  new java.awt.Font (this.av.getFont ().getName (), 1, avCharHeight);
+this.graphics.setFont (this.av.getFont ());
+}y1 += avCharHeight - Clazz_doubleToInt (avCharHeight / 5);
+var charOffset = 0;
+if (end + 1 >= seq.getLength ()) {
+end = seq.getLength () - 1;
+}var s = ' ';
+var srep = this.av.isDisplayReferenceSeq ();
+for (var i = start; i <= end; i++) {
+this.graphics.setColor (java.awt.Color.black);
+s = seq.getCharAt (i);
+if (!this.renderGaps && jalview.util.Comparison.isGap (s)) {
+continue;
+}if (this.inCurrentSequenceGroup (i)) {
+if (!this.currentSequenceGroup.getDisplayText ()) {
+continue;
+}if (this.currentSequenceGroup.getColourText ()) {
+this.getBoxColour (this.currentSequenceGroup.cs, seq, i);
+this.graphics.setColor (this.resBoxColour.darker ());
+}if (this.currentSequenceGroup.getShowNonconserved ()) {
+s = this.getDisplayChar (srep, i, s, '.');
+}} else {
+if (!this.av.getShowText ()) {
+continue;
+}if (this.av.getColourText ()) {
+this.getBoxColour (this.av.getGlobalColourScheme (), seq, i);
+if (this.av.getShowBoxes ()) {
+this.graphics.setColor (this.resBoxColour.darker ());
+} else {
+this.graphics.setColor (this.resBoxColour);
+}}if (this.av.getShowUnconserved ()) {
+s = this.getDisplayChar (srep, i, s, '.');
+}}if (this.av.isUpperCasebold ()) {
+this.fm = this.graphics.getFontMetrics ();
+if ('A' <= s && s <= 'Z') {
+if (!bold) {
+this.graphics.setFont (boldFont);
+}bold = true;
+} else if (bold) {
+this.graphics.setFont (this.av.font);
+bold = false;
+}}charOffset = Clazz_doubleToInt ((avCharWidth - this.fm.charWidth (s)) / 2);
+awt2swing.Util.drawString (this.graphics, String.valueOf (s), charOffset + avCharWidth * (i - start), y1);
+}
+}, "jalview.datamodel.SequenceI,~N,~N,~N");
+Clazz_defineMethod (c$, "getDisplayChar", 
+ function (usesrep, position, s, c) {
+var conschar = (usesrep) ? this.av.getAlignment ().getSeqrep ().getCharAt (position) : this.av.getAlignmentConsensusAnnotation ().annotations[position].displayCharacter.charAt (0);
+if (conschar != '-' && s == conschar) {
+s = c;
+}return s;
+}, "~B,~N,~S,~S");
+Clazz_defineMethod (c$, "inCurrentSequenceGroup", 
+function (res) {
+if (this.allGroups == null) {
+return false;
+}for (var i = 0; i < this.allGroups.length; i++) {
+if (this.allGroups[i].getStartRes () <= res && this.allGroups[i].getEndRes () >= res) {
+this.currentSequenceGroup = this.allGroups[i];
+return true;
+}}
+return false;
+}, "~N");
+Clazz_defineMethod (c$, "drawHighlightedText", 
+function (seq, start, end, x1, y1) {
+var avCharWidth = this.av.getCharWidth ();
+var avCharHeight = this.av.getCharHeight ();
+var pady = Clazz_doubleToInt (avCharHeight / 5);
+var charOffset = 0;
+this.graphics.setColor (java.awt.Color.black);
+this.graphics.fillRect (x1, y1, avCharWidth * (end - start + 1), avCharHeight);
+this.graphics.setColor (java.awt.Color.white);
+var s = '~';
+if (this.av.validCharWidth) {
+for (var i = start; i <= end; i++) {
+if (i < seq.getLength ()) {
+s = seq.getCharAt (i);
+}charOffset = Clazz_doubleToInt ((avCharWidth - this.fm.charWidth (s)) / 2);
+awt2swing.Util.drawString (this.graphics, String.valueOf (s), charOffset + x1 + avCharWidth * (i - start), y1 + avCharHeight - pady);
+}
+}}, "jalview.datamodel.SequenceI,~N,~N,~N,~N");
+Clazz_defineMethod (c$, "drawCursor", 
+function (seq, res, x1, y1) {
+var pady = Clazz_doubleToInt (this.av.getCharHeight () / 5);
+var charOffset = 0;
+this.graphics.setColor (java.awt.Color.black);
+this.graphics.fillRect (x1, y1, this.av.getCharWidth (), this.av.getCharHeight ());
+this.graphics.setColor (java.awt.Color.white);
+this.graphics.setColor (java.awt.Color.white);
+var s = seq.getCharAt (res);
+if (this.av.validCharWidth) {
+charOffset = Clazz_doubleToInt ((this.av.getCharWidth () - this.fm.charWidth (s)) / 2);
+awt2swing.Util.drawString (this.graphics, String.valueOf (s), charOffset + x1, (y1 + this.av.getCharHeight ()) - pady);
+}}, "jalview.datamodel.SequenceI,~N,~N,~N");
+});
+Clazz_declarePackage ("jalview.api");
+Clazz_declareInterface (jalview.api, "SequenceRenderer");
+Clazz_declarePackage ("jalview.appletgui");
+Clazz_load (["awt2swing.Panel", "jalview.appletgui.AnnotationRowFilter", "$.TitledPanel", "java.awt.event.ActionListener", "$.AdjustmentListener", "$.ItemListener", "$.MouseListener", "awt2swing.Checkbox", "$.Choice", "$.TextField", "java.awt.BorderLayout", "$.CardLayout"], "jalview.appletgui.AnnotationColumnChooser", ["awt2swing.Frame", "jalview.bin.JalviewLite", "jalview.datamodel.ColumnSelection", "$.GraphLine", "jalview.util.MessageManager", "jalview.viewmodel.annotationfilter.AnnotationFilterParameter", "java.awt.Color", "$.Dimension", "java.awt.event.MouseAdapter", "$.TextListener", "java.lang.Float", "java.util.Vector", "javax.swing.JPanel"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.annotations = null;
+this.actionPanel = null;
+this.thresholdPanel = null;
+this.switchableViewsPanel = null;
+this.switchableViewsLayout = null;
+this.noGraphFilterView = null;
+this.graphFilterView = null;
+this.annotationComboBoxPanel = null;
+this.borderLayout1 = null;
+this.gBorderLayout = null;
+this.ngBorderLayout = null;
+this.threshold = null;
+this.gStructureFilterPanel = null;
+this.ngStructureFilterPanel = null;
+this.currentStructureFilterPanel = null;
+this.currentSearchPanel = null;
+this.gSearchPanel = null;
+this.ngSearchPanel = null;
+this.currentFurtherActionPanel = null;
+this.gFurtherActionPanel = null;
+this.ngFurtherActionPanel = null;
+this.actionOption = 1;
+this.oldColumnSelection = null;
+if (!Clazz_isClassDefined ("jalview.appletgui.AnnotationColumnChooser.FurtherActionPanel")) {
+jalview.appletgui.AnnotationColumnChooser.$AnnotationColumnChooser$FurtherActionPanel$ ();
+}
+if (!Clazz_isClassDefined ("jalview.appletgui.AnnotationColumnChooser.StructureFilterPanel")) {
+jalview.appletgui.AnnotationColumnChooser.$AnnotationColumnChooser$StructureFilterPanel$ ();
+}
+if (!Clazz_isClassDefined ("jalview.appletgui.AnnotationColumnChooser.SearchPanel")) {
+jalview.appletgui.AnnotationColumnChooser.$AnnotationColumnChooser$SearchPanel$ ();
+}
+Clazz_instantialize (this, arguments);
+}, jalview.appletgui, "AnnotationColumnChooser", jalview.appletgui.AnnotationRowFilter, [java.awt.event.ActionListener, java.awt.event.AdjustmentListener, java.awt.event.ItemListener, java.awt.event.MouseListener]);
+Clazz_prepareFields (c$, function () {
+this.annotations =  new awt2swing.Choice ();
+this.actionPanel =  new awt2swing.Panel ();
+this.thresholdPanel =  new jalview.appletgui.TitledPanel ();
+this.switchableViewsPanel =  new awt2swing.Panel ( new java.awt.CardLayout ());
+this.switchableViewsLayout = (this.switchableViewsPanel.getLayout ());
+this.noGraphFilterView =  new awt2swing.Panel ();
+this.graphFilterView =  new awt2swing.Panel ();
+this.annotationComboBoxPanel =  new awt2swing.Panel ();
+this.borderLayout1 =  new java.awt.BorderLayout ();
+this.gBorderLayout =  new java.awt.BorderLayout ();
+this.ngBorderLayout =  new java.awt.BorderLayout ();
+this.threshold =  new awt2swing.Choice ();
+});
+Clazz_makeConstructor (c$, 
+function () {
+Clazz_superConstructor (this, jalview.appletgui.AnnotationColumnChooser, []);
+try {
+this.jbInit ();
+} catch (ex) {
+if (Clazz_exceptionOf (ex, Exception)) {
+ex.printStackTrace ();
+} else {
+throw ex;
+}
+}
+});
+Clazz_makeConstructor (c$, 
+function (av, ap) {
+Clazz_superConstructor (this, jalview.appletgui.AnnotationColumnChooser, [av, ap]);
+this.frame =  new awt2swing.Frame ();
+this.frame.add (this);
+jalview.bin.JalviewLite.addFrame (this.frame, jalview.util.MessageManager.getString ("label.select_by_annotation"), 520, 215);
+this.slider.addAdjustmentListener (this);
+this.slider.addMouseListener (this);
+if (av.getAlignment ().getAlignmentAnnotation () == null) {
+return;
+}this.setOldColumnSelection (av.getColumnSelection ());
+this.adjusting = true;
+var list =  new java.util.Vector ();
+var index = 1;
+for (var i = 0; i < av.getAlignment ().getAlignmentAnnotation ().length; i++) {
+var label = av.getAlignment ().getAlignmentAnnotation ()[i].label;
+if (!list.contains (label)) {
+list.addElement (label);
+} else {
+list.addElement (label + "_" + (index++));
+}}
+for (var i = 0; i < list.size (); i++) {
+this.annotations.addItem (list.elementAt (i).toString ());
+}
+this.populateThresholdComboBox (this.threshold);
+if (av.getAnnotationColumnSelectionState () != null) {
+this.currentSearchPanel = av.getAnnotationColumnSelectionState ().getCurrentSearchPanel ();
+this.currentStructureFilterPanel = av.getAnnotationColumnSelectionState ().getCurrentStructureFilterPanel ();
+this.annotations.select (new Integer (av.getAnnotationColumnSelectionState ().getAnnotations ().getSelectedIndex ()));
+this.threshold.select (new Integer (av.getAnnotationColumnSelectionState ().getThreshold ().getSelectedIndex ()));
+this.actionOption = av.getAnnotationColumnSelectionState ().getActionOption ();
+}try {
+this.jbInit ();
+} catch (ex) {
+if (Clazz_exceptionOf (ex, Exception)) {
+} else {
+throw ex;
+}
+}
+this.adjusting = false;
+this.updateView ();
+this.frame.invalidate ();
+this.frame.pack ();
+}, "jalview.appletgui.AlignViewport,jalview.appletgui.AlignmentPanel");
+Clazz_defineMethod (c$, "jbInit", 
+ function () {
+this.ok.setLabel (jalview.util.MessageManager.getString ("action.ok"));
+this.cancel.setLabel (jalview.util.MessageManager.getString ("action.cancel"));
+this.thresholdValue.setEnabled (false);
+this.thresholdValue.setColumns (7);
+this.ok.addActionListener (this);
+this.cancel.addActionListener (this);
+this.annotations.addItemListener (this);
+this.thresholdValue.addActionListener (this);
+this.threshold.addItemListener (this);
+this.slider.setBackground (java.awt.Color.white);
+this.slider.setEnabled (false);
+this.slider.setPreferredSize ( new java.awt.Dimension (100, 32));
+this.thresholdPanel.setBackground (java.awt.Color.white);
+this.actionPanel.setBackground (java.awt.Color.white);
+this.graphFilterView.setLayout (this.gBorderLayout);
+this.graphFilterView.setBackground (java.awt.Color.white);
+this.noGraphFilterView.setLayout (this.ngBorderLayout);
+this.noGraphFilterView.setBackground (java.awt.Color.white);
+this.annotationComboBoxPanel.setBackground (java.awt.Color.white);
+this.gSearchPanel = Clazz_innerTypeInstance (jalview.appletgui.AnnotationColumnChooser.SearchPanel, this, null, this);
+this.ngSearchPanel = Clazz_innerTypeInstance (jalview.appletgui.AnnotationColumnChooser.SearchPanel, this, null, this);
+this.gFurtherActionPanel = Clazz_innerTypeInstance (jalview.appletgui.AnnotationColumnChooser.FurtherActionPanel, this, null, this);
+this.ngFurtherActionPanel = Clazz_innerTypeInstance (jalview.appletgui.AnnotationColumnChooser.FurtherActionPanel, this, null, this);
+this.gStructureFilterPanel = Clazz_innerTypeInstance (jalview.appletgui.AnnotationColumnChooser.StructureFilterPanel, this, null, this);
+this.ngStructureFilterPanel = Clazz_innerTypeInstance (jalview.appletgui.AnnotationColumnChooser.StructureFilterPanel, this, null, this);
+this.thresholdPanel.setTitle ("Threshold Filter");
+this.thresholdPanel.add (this.getThreshold ());
+this.thresholdPanel.add (this.slider);
+this.thresholdPanel.add (this.thresholdValue);
+this.actionPanel.add (this.ok);
+this.actionPanel.add (this.cancel);
+var staticPanel =  new javax.swing.JPanel ();
+staticPanel.setLayout ( new java.awt.BorderLayout ());
+staticPanel.setBackground (java.awt.Color.white);
+staticPanel.add (this.gSearchPanel, "North");
+staticPanel.add (this.gStructureFilterPanel, "South");
+this.graphFilterView.add (staticPanel, "North");
+this.graphFilterView.add (this.thresholdPanel, "Center");
+this.graphFilterView.add (this.gFurtherActionPanel, "South");
+this.noGraphFilterView.add (this.ngSearchPanel, "First");
+this.noGraphFilterView.add (this.ngStructureFilterPanel, "Center");
+this.noGraphFilterView.add (this.ngFurtherActionPanel, "Center");
+this.annotationComboBoxPanel.add (this.getAnnotations ());
+this.switchableViewsPanel.add (this.noGraphFilterView, jalview.appletgui.AnnotationColumnChooser.NO_GRAPH_VIEW);
+this.switchableViewsPanel.add (this.graphFilterView, jalview.appletgui.AnnotationColumnChooser.GRAPH_VIEW);
+this.setLayout (this.borderLayout1);
+this.add (this.annotationComboBoxPanel, "First");
+this.add (this.switchableViewsPanel, "Center");
+this.add (this.actionPanel, "South");
+this.selectedAnnotationChanged ();
+this.validate ();
+});
+Clazz_overrideMethod (c$, "reset", 
+function () {
+if (this.getOldColumnSelection () != null) {
+this.av.getColumnSelection ().clear ();
+if (this.av.getAnnotationColumnSelectionState () != null) {
+var oldSelection = this.av.getAnnotationColumnSelectionState ().getOldColumnSelection ();
+if (oldSelection != null && oldSelection.getHiddenColumns () != null && !oldSelection.getHiddenColumns ().isEmpty ()) {
+for (var itr = oldSelection.getHiddenColumns ().iterator (); itr.hasNext (); ) {
+var positions = itr.next ();
+this.av.hideColumns (positions[0], positions[1]);
+}
+}this.av.setColumnSelection (oldSelection);
+}this.ap.paintAlignment (true);
+}});
+Clazz_overrideMethod (c$, "adjustmentValueChanged", 
+function (evt) {
+if (!this.adjusting) {
+this.thresholdValue.setText ((this.slider.getValue () / 1000) + "");
+this.valueChanged (!this.sliderDragging);
+}}, "java.awt.event.AdjustmentEvent");
+Clazz_defineMethod (c$, "addSliderMouseListeners", 
+function () {
+this.slider.addMouseListener (((Clazz_isClassDefined ("jalview.appletgui.AnnotationColumnChooser$1") ? 0 : jalview.appletgui.AnnotationColumnChooser.$AnnotationColumnChooser$1$ ()), Clazz_innerTypeInstance (jalview.appletgui.AnnotationColumnChooser$1, this, null)));
+});
+Clazz_overrideMethod (c$, "valueChanged", 
+function (updateAllAnnotation) {
+if (this.slider.isEnabled ()) {
+this.getCurrentAnnotation ().threshold.value = this.slider.getValue () / 1000;
+this.updateView ();
+this.ap.paintAlignment (false);
+}}, "~B");
+Clazz_defineMethod (c$, "getThreshold", 
+function () {
+return this.threshold;
+});
+Clazz_defineMethod (c$, "setThreshold", 
+function (threshold) {
+this.threshold = threshold;
+}, "awt2swing.Choice");
+Clazz_defineMethod (c$, "getAnnotations", 
+function () {
+return this.annotations;
+});
+Clazz_defineMethod (c$, "setAnnotations", 
+function (annotations) {
+this.annotations = annotations;
+}, "awt2swing.Choice");
+Clazz_overrideMethod (c$, "updateView", 
+function () {
+if (this.adjusting) {
+return;
+}var filterParams =  new jalview.viewmodel.annotationfilter.AnnotationFilterParameter ();
+this.setCurrentAnnotation (this.av.getAlignment ().getAlignmentAnnotation ()[this.getAnnotations ().getSelectedIndex ()]);
+var selectedThresholdItem = this.getSelectedThresholdItem (this.getThreshold ().getSelectedIndex ());
+this.slider.setEnabled (true);
+this.thresholdValue.setEnabled (true);
+if (selectedThresholdItem == -1) {
+this.slider.setEnabled (false);
+this.thresholdValue.setEnabled (false);
+this.thresholdValue.setText ("");
+} else if (selectedThresholdItem != -1) {
+if (this.getCurrentAnnotation ().threshold == null) {
+this.getCurrentAnnotation ().setThreshold ( new jalview.datamodel.GraphLine ((this.getCurrentAnnotation ().graphMax - this.getCurrentAnnotation ().graphMin) / 2, "Threshold", java.awt.Color.black));
+}this.adjusting = true;
+var range = this.getCurrentAnnotation ().graphMax * 1000 - this.getCurrentAnnotation ().graphMin * 1000;
+this.slider.setMinimum (Clazz_floatToInt (this.getCurrentAnnotation ().graphMin * 1000));
+this.slider.setMaximum (Clazz_floatToInt (this.getCurrentAnnotation ().graphMax * 1000));
+this.slider.setValue (Clazz_floatToInt (this.getCurrentAnnotation ().threshold.value * 1000));
+this.thresholdValue.setText (this.getCurrentAnnotation ().threshold.value + "");
+this.slider.setEnabled (true);
+this.thresholdValue.setEnabled (true);
+this.adjusting = false;
+filterParams.setThresholdType (jalview.viewmodel.annotationfilter.AnnotationFilterParameter.ThresholdType.NO_THRESHOLD);
+if (this.getCurrentAnnotation ().graph != 0) {
+filterParams.setThresholdValue (this.getCurrentAnnotation ().threshold.value);
+if (selectedThresholdItem == 1) {
+filterParams.setThresholdType (jalview.viewmodel.annotationfilter.AnnotationFilterParameter.ThresholdType.ABOVE_THRESHOLD);
+} else if (selectedThresholdItem == 0) {
+filterParams.setThresholdType (jalview.viewmodel.annotationfilter.AnnotationFilterParameter.ThresholdType.BELOW_THRESHOLD);
+}}}if (this.currentStructureFilterPanel != null) {
+if (this.currentStructureFilterPanel.alphaHelix.getState ()) {
+filterParams.setFilterAlphaHelix (true);
+}if (this.currentStructureFilterPanel.betaStrand.getState ()) {
+filterParams.setFilterBetaSheet (true);
+}if (this.currentStructureFilterPanel.turn.getState ()) {
+filterParams.setFilterTurn (true);
+}}if (this.currentSearchPanel != null) {
+if (!this.currentSearchPanel.searchBox.getText ().isEmpty ()) {
+this.currentSearchPanel.description.setEnabled (true);
+this.currentSearchPanel.displayName.setEnabled (true);
+filterParams.setRegexString (this.currentSearchPanel.searchBox.getText ());
+if (this.currentSearchPanel.displayName.getState ()) {
+filterParams.addRegexSearchField (jalview.viewmodel.annotationfilter.AnnotationFilterParameter.SearchableAnnotationField.DISPLAY_STRING);
+}if (this.currentSearchPanel.description.getState ()) {
+filterParams.addRegexSearchField (jalview.viewmodel.annotationfilter.AnnotationFilterParameter.SearchableAnnotationField.DESCRIPTION);
+}} else {
+this.currentSearchPanel.description.setEnabled (false);
+this.currentSearchPanel.displayName.setEnabled (false);
+}}this.av.getColumnSelection ().filterAnnotations (this.getCurrentAnnotation ().annotations, filterParams);
+this.av.showAllHiddenColumns ();
+if (this.getActionOption () == jalview.appletgui.AnnotationColumnChooser.ACTION_OPTION_HIDE) {
+this.av.hideSelectedColumns ();
+}filterParams = null;
+this.av.setAnnotationColumnSelectionState (this);
+this.ap.paintAlignment (true);
+});
+Clazz_defineMethod (c$, "getOldColumnSelection", 
+function () {
+return this.oldColumnSelection;
+});
+Clazz_defineMethod (c$, "setOldColumnSelection", 
+function (currentColumnSelection) {
+if (currentColumnSelection != null) {
+this.oldColumnSelection =  new jalview.datamodel.ColumnSelection (currentColumnSelection);
+}}, "jalview.datamodel.ColumnSelection");
+Clazz_defineMethod (c$, "getCurrentFutherActionPanel", 
+function () {
+return this.currentFurtherActionPanel;
+});
+Clazz_defineMethod (c$, "setCurrentFutherActionPanel", 
+function (currentFutherActionPanel) {
+this.currentFurtherActionPanel = currentFutherActionPanel;
+}, "jalview.appletgui.AnnotationColumnChooser.FurtherActionPanel");
+Clazz_defineMethod (c$, "getCurrentSearchPanel", 
+function () {
+return this.currentSearchPanel;
+});
+Clazz_defineMethod (c$, "setCurrentSearchPanel", 
+function (currentSearchPanel) {
+this.currentSearchPanel = currentSearchPanel;
+}, "jalview.appletgui.AnnotationColumnChooser.SearchPanel");
+Clazz_defineMethod (c$, "getActionOption", 
+function () {
+return this.actionOption;
+});
+Clazz_defineMethod (c$, "setActionOption", 
+function (actionOption) {
+this.actionOption = actionOption;
+}, "~N");
+Clazz_defineMethod (c$, "getCurrentStructureFilterPanel", 
+function () {
+return this.currentStructureFilterPanel;
+});
+Clazz_defineMethod (c$, "setCurrentStructureFilterPanel", 
+function (currentStructureFilterPanel) {
+this.currentStructureFilterPanel = currentStructureFilterPanel;
+}, "jalview.appletgui.AnnotationColumnChooser.StructureFilterPanel");
+Clazz_overrideMethod (c$, "itemStateChanged", 
+function (e) {
+if (e.getSource () === this.annotations) {
+this.selectedAnnotationChanged ();
+} else if (e.getSource () === this.threshold) {
+this.threshold_actionPerformed (null);
+}}, "java.awt.event.ItemEvent");
+Clazz_defineMethod (c$, "selectedAnnotationChanged", 
+function () {
+var currentView = jalview.appletgui.AnnotationColumnChooser.NO_GRAPH_VIEW;
+if (this.av.getAlignment ().getAlignmentAnnotation ()[this.getAnnotations ().getSelectedIndex ()].graph != 0) {
+currentView = jalview.appletgui.AnnotationColumnChooser.GRAPH_VIEW;
+}this.gSearchPanel.syncState ();
+this.gFurtherActionPanel.syncState ();
+this.gStructureFilterPanel.syncState ();
+this.ngSearchPanel.syncState ();
+this.ngFurtherActionPanel.syncState ();
+this.ngStructureFilterPanel.syncState ();
+this.switchableViewsLayout.show (this.switchableViewsPanel, currentView);
+this.updateView ();
+});
+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.ok) {
+this.ok_actionPerformed (null);
+} else if (evt.getSource () === this.cancel) {
+this.cancel_actionPerformed (null);
+} else if (evt.getSource () === this.thresholdValue) {
+this.thresholdValue_actionPerformed (null);
+} else {
+this.updateView ();
+}}, "java.awt.event.ActionEvent");
+Clazz_overrideMethod (c$, "mouseClicked", 
+function (e) {
+}, "java.awt.event.MouseEvent");
+Clazz_overrideMethod (c$, "mousePressed", 
+function (e) {
+if (e.getSource () === this.slider) {
+this.updateView ();
+}}, "java.awt.event.MouseEvent");
+Clazz_overrideMethod (c$, "mouseReleased", 
+function (e) {
+if (e.getSource () === this.slider) {
+this.updateView ();
+}}, "java.awt.event.MouseEvent");
+Clazz_overrideMethod (c$, "mouseEntered", 
+function (e) {
+if (e.getSource () === this.slider) {
+this.updateView ();
+}}, "java.awt.event.MouseEvent");
+Clazz_overrideMethod (c$, "mouseExited", 
+function (e) {
+if (e.getSource () === this.slider) {
+this.updateView ();
+}}, "java.awt.event.MouseEvent");
+c$.$AnnotationColumnChooser$FurtherActionPanel$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_decorateAsClass (function () {
+Clazz_prepareCallback (this, arguments);
+this.aColChooser = null;
+this.furtherAction = null;
+Clazz_instantialize (this, arguments);
+}, jalview.appletgui.AnnotationColumnChooser, "FurtherActionPanel", awt2swing.Panel, java.awt.event.ItemListener);
+Clazz_prepareFields (c$, function () {
+this.furtherAction =  new awt2swing.Choice ();
+});
+Clazz_makeConstructor (c$, 
+function (a) {
+Clazz_superConstructor (this, jalview.appletgui.AnnotationColumnChooser.FurtherActionPanel, []);
+this.aColChooser = a;
+this.furtherAction.addItem ("Select");
+this.furtherAction.addItem ("Hide");
+this.furtherAction.addItemListener (this);
+this.syncState ();
+this.add (this.furtherAction);
+}, "jalview.appletgui.AnnotationColumnChooser");
+Clazz_defineMethod (c$, "syncState", 
+function () {
+if (this.aColChooser.getActionOption () == jalview.appletgui.AnnotationColumnChooser.ACTION_OPTION_HIDE) {
+this.furtherAction.select ("Hide");
+} else {
+this.furtherAction.select ("Select");
+}});
+Clazz_overrideMethod (c$, "itemStateChanged", 
+function (a) {
+this.aColChooser.setCurrentFutherActionPanel (this);
+if (this.furtherAction.getSelectedItem ().toString ().equalsIgnoreCase ("Select")) {
+this.b$["jalview.appletgui.AnnotationColumnChooser"].setActionOption (1);
+this.b$["jalview.appletgui.AnnotationColumnChooser"].updateView ();
+} else {
+this.b$["jalview.appletgui.AnnotationColumnChooser"].setActionOption (jalview.appletgui.AnnotationColumnChooser.ACTION_OPTION_HIDE);
+this.b$["jalview.appletgui.AnnotationColumnChooser"].updateView ();
+}}, "java.awt.event.ItemEvent");
+c$ = Clazz_p0p ();
+};
+c$.$AnnotationColumnChooser$StructureFilterPanel$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_decorateAsClass (function () {
+Clazz_prepareCallback (this, arguments);
+this.aColChooser = null;
+this.alphaHelix = null;
+this.betaStrand = null;
+this.turn = null;
+this.all = null;
+Clazz_instantialize (this, arguments);
+}, jalview.appletgui.AnnotationColumnChooser, "StructureFilterPanel", jalview.appletgui.TitledPanel, java.awt.event.ItemListener);
+Clazz_prepareFields (c$, function () {
+this.alphaHelix =  new awt2swing.Checkbox ();
+this.betaStrand =  new awt2swing.Checkbox ();
+this.turn =  new awt2swing.Checkbox ();
+this.all =  new awt2swing.Checkbox ();
+});
+Clazz_makeConstructor (c$, 
+function (a) {
+Clazz_superConstructor (this, jalview.appletgui.AnnotationColumnChooser.StructureFilterPanel, []);
+this.aColChooser = a;
+this.alphaHelix.setLabel (jalview.util.MessageManager.getString ("label.alpha_helix"));
+this.alphaHelix.setBackground (java.awt.Color.white);
+this.alphaHelix.addItemListener (this);
+this.betaStrand.setLabel (jalview.util.MessageManager.getString ("label.beta_strand"));
+this.betaStrand.setBackground (java.awt.Color.white);
+this.betaStrand.addItemListener (this);
+this.turn.setLabel (jalview.util.MessageManager.getString ("label.turn"));
+this.turn.setBackground (java.awt.Color.white);
+this.turn.addItemListener (this);
+this.all.setLabel (jalview.util.MessageManager.getString ("label.select_all"));
+this.all.setBackground (java.awt.Color.white);
+this.all.addItemListener (this);
+this.setBackground (java.awt.Color.white);
+this.setTitle ("Structure Filter");
+this.add (this.all);
+this.add (this.alphaHelix);
+this.add (this.betaStrand);
+this.add (this.turn);
+}, "jalview.appletgui.AnnotationColumnChooser");
+Clazz_defineMethod (c$, "alphaHelix_actionPerformed", 
+function () {
+this.updateSelectAllState ();
+this.aColChooser.setCurrentStructureFilterPanel (this);
+this.aColChooser.updateView ();
+});
+Clazz_defineMethod (c$, "betaStrand_actionPerformed", 
+function () {
+this.updateSelectAllState ();
+this.aColChooser.setCurrentStructureFilterPanel (this);
+this.aColChooser.updateView ();
+});
+Clazz_defineMethod (c$, "turn_actionPerformed", 
+function () {
+this.updateSelectAllState ();
+this.aColChooser.setCurrentStructureFilterPanel (this);
+this.aColChooser.updateView ();
+});
+Clazz_defineMethod (c$, "all_actionPerformed", 
+function () {
+if (this.all.getState ()) {
+this.alphaHelix.setState (true);
+this.betaStrand.setState (true);
+this.turn.setState (true);
+} else {
+this.alphaHelix.setState (false);
+this.betaStrand.setState (false);
+this.turn.setState (false);
+}this.aColChooser.setCurrentStructureFilterPanel (this);
+this.aColChooser.updateView ();
+});
+Clazz_defineMethod (c$, "updateSelectAllState", 
+function () {
+if (this.alphaHelix.getState () && this.betaStrand.getState () && this.turn.getState ()) {
+this.all.setState (true);
+} else {
+this.all.setState (false);
+}});
+Clazz_defineMethod (c$, "syncState", 
+function () {
+var a = this.aColChooser.getCurrentStructureFilterPanel ();
+if (a != null) {
+this.alphaHelix.setState (a.alphaHelix.getState ());
+this.betaStrand.setState (a.betaStrand.getState ());
+this.turn.setState (a.turn.getState ());
+if (a.all.getState ()) {
+this.all.setState (true);
+this.alphaHelix.setState (true);
+this.betaStrand.setState (true);
+this.turn.setState (true);
+}}});
+Clazz_overrideMethod (c$, "itemStateChanged", 
+function (a) {
+if (a.getSource () === this.alphaHelix) {
+this.alphaHelix_actionPerformed ();
+} else if (a.getSource () === this.betaStrand) {
+this.betaStrand_actionPerformed ();
+} else if (a.getSource () === this.turn) {
+this.turn_actionPerformed ();
+} else if (a.getSource () === this.all) {
+this.all_actionPerformed ();
+}}, "java.awt.event.ItemEvent");
+c$ = Clazz_p0p ();
+};
+c$.$AnnotationColumnChooser$SearchPanel$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_decorateAsClass (function () {
+Clazz_prepareCallback (this, arguments);
+this.aColChooser = null;
+this.displayName = null;
+this.description = null;
+this.searchBox = null;
+Clazz_instantialize (this, arguments);
+}, jalview.appletgui.AnnotationColumnChooser, "SearchPanel", jalview.appletgui.TitledPanel, java.awt.event.ItemListener);
+Clazz_prepareFields (c$, function () {
+this.displayName =  new awt2swing.Checkbox ();
+this.description =  new awt2swing.Checkbox ();
+this.searchBox =  new awt2swing.TextField (10);
+});
+Clazz_makeConstructor (c$, 
+function (a) {
+Clazz_superConstructor (this, jalview.appletgui.AnnotationColumnChooser.SearchPanel, []);
+this.aColChooser = a;
+this.searchBox.addTextListener (((Clazz_isClassDefined ("jalview.appletgui.AnnotationColumnChooser$SearchPanel$1") ? 0 : jalview.appletgui.AnnotationColumnChooser.SearchPanel.$AnnotationColumnChooser$SearchPanel$1$ ()), Clazz_innerTypeInstance (jalview.appletgui.AnnotationColumnChooser$SearchPanel$1, this, null)));
+this.displayName.setLabel (jalview.util.MessageManager.getString ("label.display_name"));
+this.displayName.setEnabled (false);
+this.displayName.addItemListener (this);
+this.description.setLabel (jalview.util.MessageManager.getString ("label.description"));
+this.description.setEnabled (false);
+this.description.addItemListener (this);
+this.setTitle ("Search Filter");
+this.syncState ();
+this.add (this.searchBox);
+this.add (this.displayName);
+this.add (this.description);
+}, "jalview.appletgui.AnnotationColumnChooser");
+Clazz_defineMethod (c$, "displayNameCheckboxAction", 
+function () {
+this.aColChooser.setCurrentSearchPanel (this);
+this.aColChooser.updateView ();
+});
+Clazz_defineMethod (c$, "discriptionCheckboxAction", 
+function () {
+this.aColChooser.setCurrentSearchPanel (this);
+this.aColChooser.updateView ();
+});
+Clazz_defineMethod (c$, "searchStringAction", 
+function () {
+this.aColChooser.setCurrentSearchPanel (this);
+this.aColChooser.updateView ();
+});
+Clazz_defineMethod (c$, "syncState", 
+function () {
+var a = this.aColChooser.getCurrentSearchPanel ();
+if (a != null) {
+this.description.setEnabled (a.description.isEnabled ());
+this.description.setState (a.description.getState ());
+this.displayName.setEnabled (a.displayName.isEnabled ());
+this.displayName.setState (a.displayName.getState ());
+this.searchBox.setText (a.searchBox.getText ());
+}});
+Clazz_overrideMethod (c$, "itemStateChanged", 
+function (a) {
+if (a.getSource () === this.displayName) {
+this.displayNameCheckboxAction ();
+} else if (a.getSource () === this.description) {
+this.discriptionCheckboxAction ();
+}}, "java.awt.event.ItemEvent");
+c$.$AnnotationColumnChooser$SearchPanel$1$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_declareAnonymous (jalview.appletgui, "AnnotationColumnChooser$SearchPanel$1", null, java.awt.event.TextListener);
+Clazz_overrideMethod (c$, "textValueChanged", 
+function (a) {
+this.b$["jalview.appletgui.AnnotationColumnChooser.SearchPanel"].searchStringAction ();
+}, "java.awt.event.TextEvent");
+c$ = Clazz_p0p ();
+};
+c$ = Clazz_p0p ();
+};
+c$.$AnnotationColumnChooser$1$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_declareAnonymous (jalview.appletgui, "AnnotationColumnChooser$1", java.awt.event.MouseAdapter);
+Clazz_defineMethod (c$, "mousePressed", 
+function (e) {
+this.b$["jalview.appletgui.AnnotationColumnChooser"].sliderDragging = true;
+Clazz_superCall (this, jalview.appletgui.AnnotationColumnChooser$1, "mousePressed", [e]);
+}, "java.awt.event.MouseEvent");
+Clazz_defineMethod (c$, "mouseDragged", 
+function (e) {
+this.b$["jalview.appletgui.AnnotationColumnChooser"].sliderDragging = true;
+Clazz_superCall (this, jalview.appletgui.AnnotationColumnChooser$1, "mouseDragged", [e]);
+}, "java.awt.event.MouseEvent");
+Clazz_overrideMethod (c$, "mouseReleased", 
+function (evt) {
+if (this.b$["jalview.appletgui.AnnotationColumnChooser"].sliderDragging) {
+this.b$["jalview.appletgui.AnnotationColumnChooser"].sliderDragging = false;
+this.b$["jalview.appletgui.AnnotationColumnChooser"].valueChanged (true);
+}this.b$["jalview.appletgui.AnnotationColumnChooser"].ap.paintAlignment (true);
+}, "java.awt.event.MouseEvent");
+c$ = Clazz_p0p ();
+};
+Clazz_defineStatics (c$,
+"ACTION_OPTION_SELECT", 1,
+"ACTION_OPTION_HIDE", 2,
+"NO_GRAPH_VIEW", "0",
+"GRAPH_VIEW", "1");
+});
+Clazz_declarePackage ("jalview.appletgui");
+Clazz_load (["awt2swing.Panel", "$.Button", "$.Checkbox", "$.Scrollbar", "$.TextField"], "jalview.appletgui.AnnotationRowFilter", ["jalview.util.MessageManager", "java.lang.Float", "java.util.Vector"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.av = null;
+this.ap = null;
+this.annmap = null;
+this.enableSeqAss = false;
+this.currentAnnotation = null;
+this.adjusting = false;
+this.currentColours = null;
+this.minColour = null;
+this.maxColour = null;
+this.seqAssociated = null;
+this.thresholdIsMin = null;
+this.slider = null;
+this.thresholdValue = null;
+this.frame = null;
+this.ok = null;
+this.cancel = null;
+this.sliderDragging = false;
+Clazz_instantialize (this, arguments);
+}, jalview.appletgui, "AnnotationRowFilter", awt2swing.Panel);
+Clazz_prepareFields (c$, function () {
+this.currentColours =  new awt2swing.Checkbox ();
+this.minColour =  new awt2swing.Panel ();
+this.maxColour =  new awt2swing.Panel ();
+this.seqAssociated =  new awt2swing.Checkbox ();
+this.thresholdIsMin =  new awt2swing.Checkbox ();
+this.slider =  new awt2swing.Scrollbar (0);
+this.thresholdValue =  new awt2swing.TextField (20);
+this.ok =  new awt2swing.Button ();
+this.cancel =  new awt2swing.Button ();
+});
+Clazz_makeConstructor (c$, 
+function (av, ap) {
+Clazz_superConstructor (this, jalview.appletgui.AnnotationRowFilter, []);
+this.av = av;
+this.ap = ap;
+}, "jalview.appletgui.AlignViewport,jalview.appletgui.AlignmentPanel");
+Clazz_makeConstructor (c$, 
+function () {
+Clazz_superConstructor (this, jalview.appletgui.AnnotationRowFilter, []);
+});
+Clazz_defineMethod (c$, "getAnnotationItems", 
+function (isSeqAssociated) {
+var list =  new java.util.Vector ();
+var index = 1;
+var anmap =  Clazz_newIntArray (this.av.getAlignment ().getAlignmentAnnotation ().length, 0);
+for (var i = 0; i < this.av.getAlignment ().getAlignmentAnnotation ().length; i++) {
+if (this.av.getAlignment ().getAlignmentAnnotation ()[i].sequenceRef == null) {
+if (isSeqAssociated) {
+continue;
+}} else {
+this.enableSeqAss = true;
+}var label = this.av.getAlignment ().getAlignmentAnnotation ()[i].label;
+if (!list.contains (label)) {
+anmap[list.size ()] = i;
+list.add (label);
+} else {
+if (!isSeqAssociated) {
+anmap[list.size ()] = i;
+list.add (label + "_" + (index++));
+}}}
+this.annmap =  Clazz_newIntArray (list.size (), 0);
+System.arraycopy (anmap, 0, this.annmap, 0, this.annmap.length);
+return list;
+}, "~B");
+Clazz_defineMethod (c$, "getSelectedThresholdItem", 
+function (indexValue) {
+var selectedThresholdItem = -1;
+if (indexValue == 1) {
+selectedThresholdItem = 1;
+} else if (indexValue == 2) {
+selectedThresholdItem = 0;
+}return selectedThresholdItem;
+}, "~N");
+Clazz_defineMethod (c$, "modelChanged", 
+function () {
+this.seqAssociated.setEnabled (this.enableSeqAss);
+});
+Clazz_defineMethod (c$, "ok_actionPerformed", 
+function (e) {
+this.updateView ();
+this.frame.setVisible (false);
+}, "java.awt.event.ActionEvent");
+Clazz_defineMethod (c$, "cancel_actionPerformed", 
+function (e) {
+this.reset ();
+this.ap.paintAlignment (true);
+this.frame.setVisible (false);
+}, "java.awt.event.ActionEvent");
+Clazz_defineMethod (c$, "thresholdCheck_actionPerformed", 
+function (e) {
+this.updateView ();
+}, "java.awt.event.ActionEvent");
+Clazz_defineMethod (c$, "annotations_actionPerformed", 
+function (e) {
+this.updateView ();
+}, "java.awt.event.ActionEvent");
+Clazz_defineMethod (c$, "threshold_actionPerformed", 
+function (e) {
+this.updateView ();
+}, "java.awt.event.ActionEvent");
+Clazz_defineMethod (c$, "thresholdValue_actionPerformed", 
+function (e) {
+try {
+var f = Float.parseFloat (this.thresholdValue.getText ());
+this.slider.setValue (Clazz_floatToInt (f * 1000));
+this.updateView ();
+} catch (ex) {
+if (Clazz_exceptionOf (ex, NumberFormatException)) {
+} else {
+throw ex;
+}
+}
+}, "java.awt.event.ActionEvent");
+Clazz_defineMethod (c$, "populateThresholdComboBox", 
+function (threshold) {
+threshold.addItem (jalview.util.MessageManager.getString ("label.threshold_feature_no_thereshold"));
+threshold.addItem (jalview.util.MessageManager.getString ("label.threshold_feature_above_thereshold"));
+threshold.addItem (jalview.util.MessageManager.getString ("label.threshold_feature_below_thereshold"));
+}, "awt2swing.Choice");
+Clazz_defineMethod (c$, "getCurrentAnnotation", 
+function () {
+return this.currentAnnotation;
+});
+Clazz_defineMethod (c$, "setCurrentAnnotation", 
+function (currentAnnotation) {
+this.currentAnnotation = currentAnnotation;
+}, "jalview.datamodel.AlignmentAnnotation");
+});
+Clazz_declarePackage ("jalview.appletgui");
+Clazz_load (["awt2swing.Panel", "java.awt.Insets"], "jalview.appletgui.TitledPanel", ["awt2swing.Util"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.title = null;
+this.$insets = null;
+Clazz_instantialize (this, arguments);
+}, jalview.appletgui, "TitledPanel", awt2swing.Panel);
+Clazz_prepareFields (c$, function () {
+this.$insets =  new java.awt.Insets (10, 10, 10, 10);
+});
+Clazz_makeConstructor (c$, 
+function () {
+this.construct ("");
+});
+Clazz_makeConstructor (c$, 
+function (title) {
+Clazz_superConstructor (this, jalview.appletgui.TitledPanel, []);
+this.setTitle (title);
+}, "~S");
+Clazz_defineMethod (c$, "getInsets", 
+function () {
+return this.$insets;
+});
+Clazz_defineMethod (c$, "paintComponent", 
+function (g) {
+Clazz_superCall (this, jalview.appletgui.TitledPanel, "paintComponent", [g]);
+g.setColor (this.getForeground ());
+g.drawRect (5, 5, this.getWidth () - 10, this.getHeight () - 10);
+var width = g.getFontMetrics ().stringWidth (this.getTitle ());
+g.setColor (this.getBackground ());
+g.fillRect (10, 0, width, 10);
+g.setColor (this.getForeground ());
+awt2swing.Util.drawString (g, this.getTitle (), 10, 10);
+}, "java.awt.Graphics");
+Clazz_defineMethod (c$, "getTitle", 
+function () {
+return this.title;
+});
+Clazz_defineMethod (c$, "setTitle", 
+function (title) {
+this.title = title;
+}, "~S");
+});
+Clazz_declarePackage ("java.awt");
+Clazz_load (["java.awt.LayoutManager2", "java.io.ObjectStreamField", "java.util.Hashtable", "$.Vector"], "java.awt.CardLayout", ["java.lang.IllegalArgumentException", "java.awt.Dimension"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.vector = null;
+if (!Clazz_isClassDefined ("java.awt.CardLayout.Card")) {
+java.awt.CardLayout.$CardLayout$Card$ ();
+}
+this.currentCard = 0;
+this.hgap = 0;
+this.vgap = 0;
+Clazz_instantialize (this, arguments);
+}, java.awt, "CardLayout", null, [java.awt.LayoutManager2, java.io.Serializable]);
+Clazz_prepareFields (c$, function () {
+this.vector =  new java.util.Vector ();
+});
+Clazz_makeConstructor (c$, 
+function () {
+this.construct (0, 0);
+});
+Clazz_makeConstructor (c$, 
+function (hgap, vgap) {
+this.hgap = hgap;
+this.vgap = vgap;
+}, "~N,~N");
+Clazz_defineMethod (c$, "getHgap", 
+function () {
+return this.hgap;
+});
+Clazz_defineMethod (c$, "setHgap", 
+function (hgap) {
+this.hgap = hgap;
+}, "~N");
+Clazz_defineMethod (c$, "getVgap", 
+function () {
+return this.vgap;
+});
+Clazz_defineMethod (c$, "setVgap", 
+function (vgap) {
+this.vgap = vgap;
+}, "~N");
+Clazz_defineMethod (c$, "addLayoutComponent", 
+function (comp, constraints) {
+{
+if (constraints == null) {
+constraints = "";
+}if (Clazz_instanceOf (constraints, String)) {
+this.addLayoutComponent (constraints, comp);
+} else {
+throw  new IllegalArgumentException ("cannot add to layout: constraint must be a string");
+}}}, "java.awt.Component,~O");
+Clazz_defineMethod (c$, "addLayoutComponent", 
+function (name, comp) {
+{
+if (!this.vector.isEmpty ()) {
+comp.setVisible (false);
+}for (var i = 0; i < this.vector.size (); i++) {
+if ((this.vector.get (i)).name.equals (name)) {
+(this.vector.get (i)).comp = comp;
+return;
+}}
+this.vector.add (Clazz_innerTypeInstance (java.awt.CardLayout.Card, this, null, name, comp));
+}}, "~S,java.awt.Component");
+Clazz_overrideMethod (c$, "removeLayoutComponent", 
+function (comp) {
+{
+for (var i = 0; i < this.vector.size (); i++) {
+if ((this.vector.get (i)).comp === comp) {
+if (comp.isVisible () && (comp.getParent () != null)) {
+this.next (comp.getParent ());
+}this.vector.remove (i);
+if (this.currentCard > i) {
+this.currentCard--;
+}break;
+}}
+}}, "java.awt.Component");
+Clazz_overrideMethod (c$, "preferredLayoutSize", 
+function (parent) {
+{
+var insets = parent.getInsets ();
+var ncomponents = parent.getComponentCount ();
+var w = 0;
+var h = 0;
+for (var i = 0; i < ncomponents; i++) {
+var comp = parent.getComponent (i);
+var d = comp.getPreferredSize ();
+if (d.width > w) {
+w = d.width;
+}if (d.height > h) {
+h = d.height;
+}}
+return  new java.awt.Dimension (insets.left + insets.right + w + this.hgap * 2, insets.top + insets.bottom + h + this.vgap * 2);
+}}, "java.awt.Container");
+Clazz_overrideMethod (c$, "minimumLayoutSize", 
+function (parent) {
+{
+var insets = parent.getInsets ();
+var ncomponents = parent.getComponentCount ();
+var w = 0;
+var h = 0;
+for (var i = 0; i < ncomponents; i++) {
+var comp = parent.getComponent (i);
+var d = comp.getMinimumSize ();
+if (d.width > w) {
+w = d.width;
+}if (d.height > h) {
+h = d.height;
+}}
+return  new java.awt.Dimension (insets.left + insets.right + w + this.hgap * 2, insets.top + insets.bottom + h + this.vgap * 2);
+}}, "java.awt.Container");
+Clazz_overrideMethod (c$, "maximumLayoutSize", 
+function (target) {
+return  new java.awt.Dimension (2147483647, 2147483647);
+}, "java.awt.Container");
+Clazz_overrideMethod (c$, "getLayoutAlignmentX", 
+function (parent) {
+return 0.5;
+}, "java.awt.Container");
+Clazz_overrideMethod (c$, "getLayoutAlignmentY", 
+function (parent) {
+return 0.5;
+}, "java.awt.Container");
+Clazz_overrideMethod (c$, "invalidateLayout", 
+function (target) {
+}, "java.awt.Container");
+Clazz_overrideMethod (c$, "layoutContainer", 
+function (parent) {
+{
+var insets = parent.getInsets ();
+var ncomponents = parent.getComponentCount ();
+var comp = null;
+var currentFound = false;
+for (var i = 0; i < ncomponents; i++) {
+comp = parent.getComponent (i);
+comp.setBounds (this.hgap + insets.left, this.vgap + insets.top, parent.width - (this.hgap * 2 + insets.left + insets.right), parent.height - (this.vgap * 2 + insets.top + insets.bottom));
+if (comp.isVisible ()) {
+currentFound = true;
+}}
+if (!currentFound && ncomponents > 0) {
+parent.getComponent (0).setVisible (true);
+}}}, "java.awt.Container");
+Clazz_defineMethod (c$, "checkLayout", 
+function (parent) {
+if (parent.getLayout () !== this) {
+throw  new IllegalArgumentException ("wrong parent for CardLayout");
+}}, "java.awt.Container");
+Clazz_defineMethod (c$, "first", 
+function (parent) {
+{
+this.checkLayout (parent);
+var ncomponents = parent.getComponentCount ();
+for (var i = 0; i < ncomponents; i++) {
+var comp = parent.getComponent (i);
+if (comp.isVisible ()) {
+comp.setVisible (false);
+break;
+}}
+if (ncomponents > 0) {
+this.currentCard = 0;
+parent.getComponent (0).setVisible (true);
+parent.validate ();
+}}}, "java.awt.Container");
+Clazz_defineMethod (c$, "next", 
+function (parent) {
+{
+this.checkLayout (parent);
+var ncomponents = parent.getComponentCount ();
+for (var i = 0; i < ncomponents; i++) {
+var comp = parent.getComponent (i);
+if (comp.isVisible ()) {
+comp.setVisible (false);
+this.currentCard = (i + 1) % ncomponents;
+comp = parent.getComponent (this.currentCard);
+comp.setVisible (true);
+parent.validate ();
+return;
+}}
+this.showDefaultComponent (parent);
+}}, "java.awt.Container");
+Clazz_defineMethod (c$, "previous", 
+function (parent) {
+{
+this.checkLayout (parent);
+var ncomponents = parent.getComponentCount ();
+for (var i = 0; i < ncomponents; i++) {
+var comp = parent.getComponent (i);
+if (comp.isVisible ()) {
+comp.setVisible (false);
+this.currentCard = ((i > 0) ? i - 1 : ncomponents - 1);
+comp = parent.getComponent (this.currentCard);
+comp.setVisible (true);
+parent.validate ();
+return;
+}}
+this.showDefaultComponent (parent);
+}}, "java.awt.Container");
+Clazz_defineMethod (c$, "showDefaultComponent", 
+function (parent) {
+if (parent.getComponentCount () > 0) {
+this.currentCard = 0;
+parent.getComponent (0).setVisible (true);
+parent.validate ();
+}}, "java.awt.Container");
+Clazz_defineMethod (c$, "last", 
+function (parent) {
+{
+this.checkLayout (parent);
+var ncomponents = parent.getComponentCount ();
+for (var i = 0; i < ncomponents; i++) {
+var comp = parent.getComponent (i);
+if (comp.isVisible ()) {
+comp.setVisible (false);
+break;
+}}
+if (ncomponents > 0) {
+this.currentCard = ncomponents - 1;
+parent.getComponent (this.currentCard).setVisible (true);
+parent.validate ();
+}}}, "java.awt.Container");
+Clazz_defineMethod (c$, "show", 
+function (parent, name) {
+{
+this.checkLayout (parent);
+var next = null;
+var ncomponents = this.vector.size ();
+for (var i = 0; i < ncomponents; i++) {
+var card = this.vector.get (i);
+if (card.name.equals (name)) {
+next = card.comp;
+this.currentCard = i;
+break;
+}}
+if ((next != null) && !next.isVisible ()) {
+ncomponents = parent.getComponentCount ();
+for (var i = 0; i < ncomponents; i++) {
+var comp = parent.getComponent (i);
+if (comp.isVisible ()) {
+comp.setVisible (false);
+break;
+}}
+next.setVisible (true);
+parent.validate ();
+}}}, "java.awt.Container,~S");
+Clazz_overrideMethod (c$, "toString", 
+function () {
+return this.getClass ().getName () + "[hgap=" + this.hgap + ",vgap=" + this.vgap + "]";
+});
+c$.$CardLayout$Card$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_decorateAsClass (function () {
+Clazz_prepareCallback (this, arguments);
+this.name = null;
+this.comp = null;
+Clazz_instantialize (this, arguments);
+}, java.awt.CardLayout, "Card", null, java.io.Serializable);
+Clazz_makeConstructor (c$, 
+function (a, b) {
+this.name = a;
+this.comp = b;
+}, "~S,java.awt.Component");
+c$ = Clazz_p0p ();
+};
+c$.serialPersistentFields = c$.prototype.serialPersistentFields =  Clazz_newArray (-1, [ new java.io.ObjectStreamField ("tab", java.util.Hashtable),  new java.io.ObjectStreamField ("hgap", Integer.TYPE),  new java.io.ObjectStreamField ("vgap", Integer.TYPE),  new java.io.ObjectStreamField ("vector", java.util.Vector),  new java.io.ObjectStreamField ("currentCard", Integer.TYPE)]);
+});
+Clazz_load(null,"java.io.ObjectStreamField",["java.lang.Boolean","$.Byte","$.Character","$.Double","$.Float","$.Long","$.NullPointerException","$.Short","java.util.Arrays"],function(){
+c$=Clazz_decorateAsClass(function(){
+this.name=null;
+this.type=null;
+this.offset=0;
+this.typeString=null;
+this.unshared=false;
+this.isDeserialized=false;
+Clazz_instantialize(this,arguments);
+},java.io,"ObjectStreamField",null,Comparable);
+Clazz_makeConstructor(c$,
+function(name,cl){
+if(name==null||cl==null){
+throw new NullPointerException();
+}this.name=name;
+this.type=cl;
+},"~S,Class");
+Clazz_makeConstructor(c$,
+function(name,cl,unshared){
+if(name==null||cl==null){
+throw new NullPointerException();
+}this.name=name;
+this.type=cl;
+this.unshared=unshared;
+},"~S,Class,~B");
+Clazz_makeConstructor(c$,
+function(signature,name){
+if(name==null){
+throw new NullPointerException();
+}this.name=name;
+this.typeString=signature.$replace('.', '/');
+this.isDeserialized=true;
+},"~S,~S");
+Clazz_overrideMethod(c$,"compareTo",
+function(o){
+var f=o;
+var thisPrimitive=this.isPrimitive();
+var fPrimitive=f.isPrimitive();
+if(thisPrimitive!=fPrimitive){
+return thisPrimitive?-1:1;
+}return this.getName().compareTo(f.getName());
+},"~O");
+Clazz_overrideMethod(c$,"equals",
+function(arg0){
+return this.compareTo(arg0)==0;
+},"~O");
+Clazz_overrideMethod(c$,"hashCode",
+function(){
+return this.getName().hashCode();
+});
+Clazz_defineMethod(c$,"getName",
+function(){
+return this.name;
+});
+Clazz_defineMethod(c$,"getOffset",
+function(){
+return this.offset;
+});
+Clazz_defineMethod(c$,"getTypeInternal",
+($fz=function(){
+return this.type;
+},$fz.isPrivate=true,$fz));
+Clazz_defineMethod(c$,"getType",
+function(){
+var cl=this.getTypeInternal();
+if(this.isDeserialized&&!cl.isPrimitive()){
+return Clazz._O;
+}return cl;
+});
+Clazz_defineMethod(c$,"getTypeCode",
+function(){
+var t=this.getTypeInternal();
+if(t===Integer.TYPE){
+return'I';
+}if(t===Byte.TYPE){
+return'B';
+}if(t===Character.TYPE){
+return'C';
+}if(t===Short.TYPE){
+return'S';
+}if(t===Boolean.TYPE){
+return'Z';
+}if(t===Long.TYPE){
+return'J';
+}if(t===Float.TYPE){
+return'F';
+}if(t===Double.TYPE){
+return'D';
+}if(t.isArray()){
+return'[';
+}return'L';
+});
+Clazz_defineMethod(c$,"getTypeString",
+function(){
+if(this.isPrimitive()){
+return null;
+}if(this.typeString==null){
+var t=this.getTypeInternal();
+var typeName=t.getName().$replace('.', '/');
+var str=(t.isArray())?typeName:("L"+typeName+';');
+this.typeString=str.intern();
+}return this.typeString;
+});
+Clazz_defineMethod(c$,"isPrimitive",
+function(){
+var t=this.getTypeInternal();
+return t!=null&&t.isPrimitive();
+});
+Clazz_defineMethod(c$,"setOffset",
+function(newValue){
+this.offset=newValue;
+},"~N");
+Clazz_overrideMethod(c$,"toString",
+function(){
+return this.getClass().getName()+'(' + this.getName () + ':' + this.getTypeInternal () + ')';
+});
+c$.sortFields=Clazz_defineMethod(c$,"sortFields",
+function(fields){
+if(fields.length>1){
+var fieldDescComparator=((Clazz_isClassDefined("java.io.ObjectStreamField$1")?0:java.io.ObjectStreamField.$ObjectStreamField$1$()),Clazz_innerTypeInstance(java.io.ObjectStreamField$1,this,null));
+java.util.Arrays.sort(fields,fieldDescComparator);
+}},"~A");
+Clazz_defineMethod(c$,"resolve",
+function(loader){
+if(this.typeString.length==1){
+switch(this.typeString.charAt(0)){
+case'I':
+this.type=Integer.TYPE;
+return;
+case'B':
+this.type=Byte.TYPE;
+return;
+case'C':
+this.type=Character.TYPE;
+return;
+case'S':
+this.type=Short.TYPE;
+return;
+case'Z':
+this.type=Boolean.TYPE;
+return;
+case'J':
+this.type=Long.TYPE;
+return;
+case'F':
+this.type=Float.TYPE;
+return;
+case'D':
+this.type=Double.TYPE;
+return;
+}
+}var className=this.typeString.$replace('/', '.');
+if((className.charAt(0)).charCodeAt(0)==('L').charCodeAt(0)){
+className=className.substring(1,className.length-1);
+}try{
+var cl=Clazz._4Name(className,false,loader);
+this.type=cl;
+}catch(e){
+if(Clazz_instanceOf(e,ClassNotFoundException)){
+}else{
+throw e;
+}
+}
+},"ClassLoader");
+Clazz_defineMethod(c$,"isUnshared",
+function(){
+return this.unshared;
+});
+c$.$ObjectStreamField$1$=function(){
+Clazz_pu$h(self.c$);
+c$=Clazz_declareAnonymous(java.io,"ObjectStreamField$1",null,java.util.Comparator);
+Clazz_overrideMethod(c$,"compare",
+function(f1,f2){
+return f1.compareTo(f2);
+},"java.io.ObjectStreamField,java.io.ObjectStreamField");
+c$=Clazz_p0p();
+};
+});
+Clazz_declarePackage ("jalview.appletgui");
+Clazz_load (["awt2swing.Panel", "java.awt.event.ActionListener", "awt2swing.Button", "$.Checkbox", "$.Label", "$.TextField", "java.awt.GridLayout"], "jalview.appletgui.Finder", ["awt2swing.Frame", "jalview.analysis.Finder", "jalview.bin.JalviewLite", "jalview.datamodel.SequenceFeature", "jalview.util.MessageManager", "java.awt.Font", "$.Rectangle", "java.awt.event.KeyAdapter", "$.WindowAdapter"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.av = null;
+this.ap = null;
+this.frame = null;
+this.searchResults = null;
+this.seqIndex = 0;
+this.resIndex = -1;
+this.jLabel1 = null;
+this.textfield = null;
+this.findAll = null;
+this.findNext = null;
+this.actionsPanel = null;
+this.gridLayout1 = null;
+this.createNewGroup = null;
+this.caseSensitive = null;
+this.searchDescription = null;
+Clazz_instantialize (this, arguments);
+}, jalview.appletgui, "Finder", awt2swing.Panel, java.awt.event.ActionListener);
+Clazz_prepareFields (c$, function () {
+this.jLabel1 =  new awt2swing.Label ();
+this.textfield =  new awt2swing.TextField ();
+this.findAll =  new awt2swing.Button ();
+this.findNext =  new awt2swing.Button ();
+this.actionsPanel =  new awt2swing.Panel ();
+this.gridLayout1 =  new java.awt.GridLayout ();
+this.createNewGroup =  new awt2swing.Button ();
+this.caseSensitive =  new awt2swing.Checkbox ();
+this.searchDescription =  new awt2swing.Checkbox ();
+});
+Clazz_makeConstructor (c$, 
+function (ap) {
+Clazz_superConstructor (this, jalview.appletgui.Finder, []);
+try {
+this.jbInit ();
+} catch (e) {
+if (Clazz_exceptionOf (e, Exception)) {
+e.printStackTrace ();
+} else {
+throw e;
+}
+}
+this.av = ap.av;
+this.ap = ap;
+this.frame =  new awt2swing.Frame ();
+this.frame.add (this);
+jalview.bin.JalviewLite.addFrame (this.frame, jalview.util.MessageManager.getString ("action.find"), 340, 120);
+this.frame.repaint ();
+this.frame.addWindowListener (((Clazz_isClassDefined ("jalview.appletgui.Finder$1") ? 0 : jalview.appletgui.Finder.$Finder$1$ ()), Clazz_innerTypeInstance (jalview.appletgui.Finder$1, this, Clazz_cloneFinals ("ap", ap))));
+this.textfield.requestFocus ();
+}, "jalview.appletgui.AlignmentPanel");
+Clazz_overrideMethod (c$, "actionPerformed", 
+function (evt) {
+if (evt.getSource () === this.textfield) {
+this.doSearch (false);
+} else if (evt.getSource () === this.findNext) {
+this.doSearch (false);
+} else if (evt.getSource () === this.findAll) {
+this.resIndex = -1;
+this.seqIndex = 0;
+this.doSearch (true);
+} else if (evt.getSource () === this.createNewGroup) {
+this.createNewGroup_actionPerformed ();
+}}, "java.awt.event.ActionEvent");
+Clazz_defineMethod (c$, "createNewGroup_actionPerformed", 
+function () {
+var seqs =  new Array (this.searchResults.getSize ());
+var features =  new Array (this.searchResults.getSize ());
+for (var i = 0; i < this.searchResults.getSize (); i++) {
+seqs[i] = this.searchResults.getResultSequence (i);
+features[i] =  new jalview.datamodel.SequenceFeature (this.textfield.getText ().trim (), "Search Results", null, this.searchResults.getResultStart (i), this.searchResults.getResultEnd (i), "Search Results");
+}
+if (this.ap.seqPanel.seqCanvas.getFeatureRenderer ().amendFeatures (seqs, features, true, this.ap)) {
+this.ap.alignFrame.sequenceFeatures.setState (true);
+this.av.setShowSequenceFeatures (true);
+this.ap.highlightSearchResults (null);
+}});
+Clazz_defineMethod (c$, "doSearch", 
+function (findAll) {
+if (this.ap.av.applet.currentAlignFrame != null) {
+this.ap = this.ap.av.applet.currentAlignFrame.alignPanel;
+this.av = this.ap.av;
+}this.createNewGroup.setEnabled (false);
+var finder =  new jalview.analysis.Finder (this.av.getAlignment (), this.av.getSelectionGroup (), this.seqIndex, this.resIndex);
+finder.setCaseSensitive (this.caseSensitive.getState ());
+finder.setIncludeDescription (this.searchDescription.getState ());
+finder.setFindAll (findAll);
+var searchString = this.textfield.getText ();
+finder.find (searchString);
+this.seqIndex = finder.getSeqIndex ();
+this.resIndex = finder.getResIndex ();
+this.searchResults = finder.getSearchResults ();
+var idMatch = finder.getIdMatch ();
+var haveResults = false;
+if ((idMatch.size () > 0)) {
+haveResults = true;
+this.ap.idPanel.highlightSearchResults (idMatch);
+} else {
+this.ap.idPanel.highlightSearchResults (null);
+}if (this.searchResults.getSize () > 0) {
+haveResults = true;
+this.createNewGroup.setEnabled (true);
+} else {
+this.searchResults = null;
+}this.ap.highlightSearchResults (this.searchResults);
+if (!haveResults) {
+this.ap.alignFrame.setStatus (jalview.util.MessageManager.getString ("label.finished_searching"));
+this.resIndex = -1;
+this.seqIndex = 0;
+} else {
+if (findAll) {
+var message = (idMatch.size () > 0) ? "" + idMatch.size () + " IDs" : "";
+if (idMatch.size () > 0 && this.searchResults != null && this.searchResults.getSize () > 0) {
+message += " and ";
+}if (this.searchResults != null) {
+message += this.searchResults.getSize () + " subsequence matches.";
+}this.ap.alignFrame.setStatus (jalview.util.MessageManager.formatMessage ("label.search_results",  Clazz_newArray (-1, [searchString, message])));
+} else {
+this.ap.alignFrame.setStatus (jalview.util.MessageManager.formatMessage ("label.found_match_for",  Clazz_newArray (-1, [searchString])));
+}}}, "~B");
+Clazz_defineMethod (c$, "jbInit", 
+ function () {
+this.jLabel1.setFont ( new java.awt.Font ("Verdana", 0, 12));
+this.jLabel1.setText (jalview.util.MessageManager.getString ("action.find"));
+this.jLabel1.setBounds ( new java.awt.Rectangle (3, 30, 34, 15));
+this.setLayout (null);
+this.textfield.setFont ( new java.awt.Font ("Verdana", 0, 10));
+this.textfield.setText ("");
+this.textfield.setBounds ( new java.awt.Rectangle (40, 17, 133, 21));
+this.textfield.addKeyListener (((Clazz_isClassDefined ("jalview.appletgui.Finder$2") ? 0 : jalview.appletgui.Finder.$Finder$2$ ()), Clazz_innerTypeInstance (jalview.appletgui.Finder$2, this, null)));
+this.textfield.addActionListener (this);
+this.findAll.setFont ( new java.awt.Font ("Verdana", 0, 10));
+this.findAll.setLabel (jalview.util.MessageManager.getString ("action.find_all"));
+this.findAll.addActionListener (this);
+this.findNext.setEnabled (false);
+this.findNext.setFont ( new java.awt.Font ("Verdana", 0, 10));
+this.findNext.setLabel (jalview.util.MessageManager.getString ("action.find_next"));
+this.findNext.addActionListener (this);
+this.actionsPanel.setBounds ( new java.awt.Rectangle (195, 5, 141, 64));
+this.actionsPanel.setLayout (this.gridLayout1);
+this.gridLayout1.setHgap (0);
+this.gridLayout1.setRows (3);
+this.gridLayout1.setVgap (2);
+this.createNewGroup.setEnabled (false);
+this.createNewGroup.setFont ( new java.awt.Font ("Verdana", 0, 10));
+this.createNewGroup.setLabel (jalview.util.MessageManager.getString ("label.new_feature"));
+this.createNewGroup.addActionListener (this);
+this.caseSensitive.setLabel (jalview.util.MessageManager.getString ("label.match_case"));
+this.caseSensitive.setBounds ( new java.awt.Rectangle (30, 39, 126, 23));
+this.searchDescription.setLabel (jalview.util.MessageManager.getString ("label.include_description"));
+this.searchDescription.setBounds ( new java.awt.Rectangle (30, 59, 170, 23));
+this.actionsPanel.add (this.findNext, null);
+this.actionsPanel.add (this.findAll, null);
+this.actionsPanel.add (this.createNewGroup, null);
+this.add (this.caseSensitive);
+this.add (this.textfield, null);
+this.add (this.jLabel1, null);
+this.add (this.actionsPanel, null);
+this.add (this.searchDescription);
+});
+Clazz_defineMethod (c$, "textfield_keyTyped", 
+function (e) {
+this.findNext.setEnabled (true);
+}, "java.awt.event.KeyEvent");
+c$.$Finder$1$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_declareAnonymous (jalview.appletgui, "Finder$1", java.awt.event.WindowAdapter);
+Clazz_overrideMethod (c$, "windowClosing", 
+function (evt) {
+this.f$.ap.highlightSearchResults (null);
+}, "java.awt.event.WindowEvent");
+c$ = Clazz_p0p ();
+};
+c$.$Finder$2$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_declareAnonymous (jalview.appletgui, "Finder$2", java.awt.event.KeyAdapter);
+Clazz_overrideMethod (c$, "keyTyped", 
+function (e) {
+this.b$["jalview.appletgui.Finder"].textfield_keyTyped (e);
+}, "java.awt.event.KeyEvent");
+c$ = Clazz_p0p ();
+};
+});
+Clazz_declarePackage ("jalview.analysis");
+Clazz_load (null, "jalview.analysis.Finder", ["jalview.datamodel.SearchResults", "jalview.jsdev.RegExp", "jalview.util.Comparison", "java.lang.StringBuffer", "java.util.Vector"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.searchResults = null;
+this.alignment = null;
+this.selection = null;
+this.idMatch = null;
+this.caseSensitive = false;
+this.includeDescription = false;
+this.findAll = false;
+this.regex = null;
+this.seqIndex = 0;
+this.resIndex = -1;
+Clazz_instantialize (this, arguments);
+}, jalview.analysis, "Finder");
+Clazz_makeConstructor (c$, 
+function (alignment, selection) {
+this.alignment = alignment;
+this.selection = selection;
+}, "jalview.datamodel.AlignmentI,jalview.datamodel.SequenceGroup");
+Clazz_makeConstructor (c$, 
+function (alignment, selectionGroup, seqIndex, resIndex) {
+this.construct (alignment, selectionGroup);
+this.seqIndex = seqIndex;
+this.resIndex = resIndex;
+}, "jalview.datamodel.AlignmentI,jalview.datamodel.SequenceGroup,~N,~N");
+Clazz_defineMethod (c$, "find", 
+function (searchString) {
+var hasResults = false;
+if (!this.caseSensitive) {
+searchString = searchString.toUpperCase ();
+}this.regex = jalview.jsdev.RegExp.newRegex ([searchString]);
+this.regex.setIgnoreCase (!this.caseSensitive);
+this.searchResults =  new jalview.datamodel.SearchResults ();
+this.idMatch =  new java.util.Vector ();
+var seq;
+var item = null;
+var found = false;
+var end = this.alignment.getHeight ();
+if (this.selection != null) {
+if ((this.selection.getSize () < 1) || ((this.selection.getEndRes () - this.selection.getStartRes ()) < 2)) {
+this.selection = null;
+}}while (!found && (this.seqIndex < end)) {
+seq = this.alignment.getSequenceAt (this.seqIndex);
+if ((this.selection != null && this.selection.getSize () > 0) && !this.selection.getSequences (null).contains (seq)) {
+this.seqIndex++;
+this.resIndex = -1;
+continue;
+}if (this.resIndex < 0) {
+this.resIndex = 0;
+try {
+var res = Integer.parseInt (searchString);
+if (seq.getEnd () >= res) {
+this.searchResults.addResult (seq, res, res);
+hasResults = true;
+if (!this.findAll) {
+found = true;
+break;
+}}} catch (ex) {
+if (Clazz_exceptionOf (ex, NumberFormatException)) {
+} else {
+throw ex;
+}
+}
+if (this.regex.search (seq.getName ())) {
+this.idMatch.addElement (seq);
+hasResults = true;
+if (!this.findAll) {
+found = true;
+break;
+}}if (this.isIncludeDescription () && seq.getDescription () != null && this.regex.search (seq.getDescription ())) {
+this.idMatch.addElement (seq);
+hasResults = true;
+if (!this.findAll) {
+found = true;
+break;
+}}}item = seq.getSequenceAsString ();
+if ((this.selection != null) && (this.selection.getEndRes () < this.alignment.getWidth () - 1)) {
+item = item.substring (0, this.selection.getEndRes () + 1);
+}var noGapsSB =  new StringBuffer ();
+var insertCount = 0;
+var spaces =  new java.util.Vector ();
+for (var j = 0; j < item.length; j++) {
+if (!jalview.util.Comparison.isGap (item.charAt (j))) {
+noGapsSB.append (item.charAt (j));
+spaces.addElement ( new Integer (insertCount));
+} else {
+insertCount++;
+}}
+var noGaps = noGapsSB.toString ();
+for (var r = this.resIndex; r < noGaps.length; r++) {
+if (this.regex.searchFrom (noGaps, r)) {
+this.resIndex = this.regex.matchedFrom ();
+if ((this.selection != null && this.selection.getSize () > 0) && ((this.resIndex + Integer.parseInt (spaces.elementAt (this.resIndex).toString ())) < this.selection.getStartRes ())) {
+continue;
+}var sres = seq.findPosition (this.resIndex + Integer.parseInt (spaces.elementAt (this.resIndex).toString ()));
+var eres = seq.findPosition (this.regex.matchedTo () - 1 + Integer.parseInt (spaces.elementAt (this.regex.matchedTo () - 1).toString ()));
+this.searchResults.addResult (seq, sres, eres);
+hasResults = true;
+if (!this.findAll) {
+found = true;
+this.resIndex++;
+break;
+}r = this.resIndex;
+} else {
+break;
+}}
+if (!found) {
+this.seqIndex++;
+this.resIndex = -1;
+}}
+return hasResults;
+}, "~S");
+Clazz_defineMethod (c$, "getAlignment", 
+function () {
+return this.alignment;
+});
+Clazz_defineMethod (c$, "setAlignment", 
+function (alignment) {
+this.alignment = alignment;
+}, "jalview.datamodel.AlignmentI");
+Clazz_defineMethod (c$, "isCaseSensitive", 
+function () {
+return this.caseSensitive;
+});
+Clazz_defineMethod (c$, "setCaseSensitive", 
+function (caseSensitive) {
+this.caseSensitive = caseSensitive;
+}, "~B");
+Clazz_defineMethod (c$, "isFindAll", 
+function () {
+return this.findAll;
+});
+Clazz_defineMethod (c$, "setFindAll", 
+function (findAll) {
+this.findAll = findAll;
+}, "~B");
+Clazz_defineMethod (c$, "getSelection", 
+function () {
+return this.selection;
+});
+Clazz_defineMethod (c$, "setSelection", 
+function (selection) {
+this.selection = selection;
+}, "jalview.datamodel.SequenceGroup");
+Clazz_defineMethod (c$, "getIdMatch", 
+function () {
+return this.idMatch;
+});
+Clazz_defineMethod (c$, "getRegex", 
+function () {
+return this.regex;
+});
+Clazz_defineMethod (c$, "getSearchResults", 
+function () {
+return this.searchResults;
+});
+Clazz_defineMethod (c$, "getResIndex", 
+function () {
+return this.resIndex;
+});
+Clazz_defineMethod (c$, "setResIndex", 
+function (resIndex) {
+this.resIndex = resIndex;
+}, "~N");
+Clazz_defineMethod (c$, "getSeqIndex", 
+function () {
+return this.seqIndex;
+});
+Clazz_defineMethod (c$, "setSeqIndex", 
+function (seqIndex) {
+this.seqIndex = seqIndex;
+}, "~N");
+Clazz_defineMethod (c$, "isIncludeDescription", 
+function () {
+return this.includeDescription;
+});
+Clazz_defineMethod (c$, "setIncludeDescription", 
+function (includeDescription) {
+this.includeDescription = includeDescription;
+}, "~B");
+});
+Clazz_declarePackage ("java.awt.event");
+Clazz_load (["java.awt.event.KeyListener"], "java.awt.event.KeyAdapter", null, function () {
+c$ = Clazz_declareType (java.awt.event, "KeyAdapter", null, java.awt.event.KeyListener);
+Clazz_overrideMethod (c$, "keyTyped", 
+function (e) {
+}, "java.awt.event.KeyEvent");
+Clazz_overrideMethod (c$, "keyPressed", 
+function (e) {
+}, "java.awt.event.KeyEvent");
+Clazz_overrideMethod (c$, "keyReleased", 
+function (e) {
+}, "java.awt.event.KeyEvent");
+});
+Clazz_declarePackage ("jalview.appletgui");
+Clazz_load (["awt2swing.Panel", "java.awt.event.ItemListener", "awt2swing.Button", "$.Checkbox", "$.Choice", "java.awt.Font"], "jalview.appletgui.FontChooser", ["awt2swing.Frame", "$.Label", "jalview.appletgui.JVDialog", "jalview.bin.JalviewLite", "jalview.util.MessageManager", "java.awt.BorderLayout", "$.Color", "$.FlowLayout", "$.Toolkit", "java.awt.event.ActionListener"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.fontSize = null;
+this.fontStyle = null;
+this.fontName = null;
+this.scaleAsCdna = null;
+this.ok = null;
+this.cancel = null;
+this.ap = null;
+this.tp = null;
+this.oldFont = null;
+this.oldCharWidth = 0;
+this.oldScaleProtein = false;
+this.lastSelected = null;
+this.lastSelStyle = 0;
+this.lastSelSize = 0;
+this.$init = true;
+this.frame = null;
+Clazz_instantialize (this, arguments);
+}, jalview.appletgui, "FontChooser", awt2swing.Panel, java.awt.event.ItemListener);
+Clazz_prepareFields (c$, function () {
+this.fontSize =  new awt2swing.Choice ();
+this.fontStyle =  new awt2swing.Choice ();
+this.fontName =  new awt2swing.Choice ();
+this.scaleAsCdna =  new awt2swing.Checkbox ();
+this.ok =  new awt2swing.Button ();
+this.cancel =  new awt2swing.Button ();
+});
+Clazz_makeConstructor (c$, 
+function (tp) {
+Clazz_superConstructor (this, jalview.appletgui.FontChooser, []);
+try {
+this.jbInit ();
+} catch (e) {
+if (Clazz_exceptionOf (e, Exception)) {
+e.printStackTrace ();
+} else {
+throw e;
+}
+}
+this.tp = tp;
+this.oldFont = tp.getTreeFont ();
+this.init ();
+}, "jalview.appletgui.TreePanel");
+Clazz_makeConstructor (c$, 
+function (ap) {
+Clazz_superConstructor (this, jalview.appletgui.FontChooser, []);
+this.ap = ap;
+this.oldFont = ap.av.getFont ();
+this.oldCharWidth = ap.av.getViewStyle ().getCharWidth ();
+this.oldScaleProtein = ap.av.getViewStyle ().isScaleProteinAsCdna ();
+try {
+this.jbInit ();
+} catch (e) {
+if (Clazz_exceptionOf (e, Exception)) {
+e.printStackTrace ();
+} else {
+throw e;
+}
+}
+this.init ();
+}, "jalview.appletgui.AlignmentPanel");
+Clazz_defineMethod (c$, "init", 
+function () {
+var fonts = java.awt.Toolkit.getDefaultToolkit ().getFontList ();
+for (var i = 0; i < fonts.length; i++) {
+this.fontName.addItem (fonts[i]);
+}
+for (var i = 1; i < 31; i++) {
+this.fontSize.addItem (i + "");
+}
+this.fontStyle.addItem ("plain");
+this.fontStyle.addItem ("bold");
+this.fontStyle.addItem ("italic");
+this.fontName.select (this.oldFont.getName ());
+this.fontSize.select (this.oldFont.getSize () + "");
+this.fontStyle.select (new Integer (this.oldFont.getStyle ()));
+this.frame =  new awt2swing.Frame ();
+this.frame.add (this);
+jalview.bin.JalviewLite.addFrame (this.frame, jalview.util.MessageManager.getString ("action.change_font"), 440, 115);
+this.$init = false;
+});
+Clazz_overrideMethod (c$, "itemStateChanged", 
+function (evt) {
+var source = evt.getSource ();
+if (source === this.fontName) {
+this.fontName_actionPerformed ();
+} else if (source === this.fontSize) {
+this.fontSize_actionPerformed ();
+} else if (source === this.fontStyle) {
+this.fontStyle_actionPerformed ();
+} else if (source === this.scaleAsCdna) {
+this.scaleAsCdna_actionPerformed ();
+}}, "java.awt.event.ItemEvent");
+Clazz_defineMethod (c$, "ok_actionPerformed", 
+function () {
+this.frame.setVisible (false);
+if (this.ap != null) {
+if (this.ap.getOverviewPanel () != null) {
+this.ap.getOverviewPanel ().updateOverviewImage ();
+}}});
+Clazz_defineMethod (c$, "cancel_actionPerformed", 
+function () {
+if (this.ap != null) {
+this.ap.av.setScaleProteinAsCdna (this.oldScaleProtein);
+if (this.ap.av.getCodingComplement () != null) {
+this.ap.av.getCodingComplement ().setScaleProteinAsCdna (this.oldScaleProtein);
+this.ap.alignFrame.getSplitFrame ().repaint ();
+}this.ap.av.setFont (this.oldFont);
+var style = this.ap.av.getViewStyle ();
+if (style.getCharWidth () != this.oldCharWidth) {
+style.setCharWidth (this.oldCharWidth);
+this.ap.av.setViewStyle (style);
+}this.ap.paintAlignment (true);
+} else if (this.tp != null) {
+this.tp.setTreeFont (this.oldFont);
+this.tp.treeCanvas.repaint ();
+}this.fontName.select (this.oldFont.getName ());
+this.fontSize.select (this.oldFont.getSize () + "");
+this.fontStyle.select (new Integer (this.oldFont.getStyle ()));
+this.frame.setVisible (false);
+});
+Clazz_defineMethod (c$, "changeFont", 
+function () {
+if (this.lastSelected == null) {
+this.lastSelected = this.oldFont;
+this.lastSelSize = this.oldFont.getSize ();
+this.lastSelStyle = this.oldFont.getStyle ();
+}var newFont =  new java.awt.Font (this.fontName.getSelectedItem ().toString (), this.fontStyle.getSelectedIndex (), Integer.parseInt (this.fontSize.getSelectedItem ().toString ()));
+var fm = this.getGraphics ().getFontMetrics (newFont);
+var mw = fm.getStringBounds ("M", this.getGraphics ()).getWidth ();
+var iw = fm.getStringBounds ("I", this.getGraphics ()).getWidth ();
+if (mw < 1 || iw < 1) {
+this.fontName.select (this.lastSelected.getName ());
+this.fontStyle.select (new Integer (this.lastSelStyle));
+this.fontSize.select ("" + this.lastSelSize);
+var d =  new jalview.appletgui.JVDialog (this.frame, jalview.util.MessageManager.getString ("label.invalid_font"), true, 350, 200);
+var mp =  new awt2swing.Panel ();
+d.cancel.setVisible (false);
+mp.setLayout ( new java.awt.FlowLayout ());
+mp.add ( new awt2swing.Label ("Font doesn't have letters defined\nso cannot be used\nwith alignment data."));
+d.setMainPanel (mp);
+d.setVisible (true);
+return;
+}if (this.tp != null) {
+this.tp.setTreeFont (newFont);
+} else if (this.ap != null) {
+this.ap.av.setFont (newFont);
+this.ap.fontChanged ();
+}this.lastSelected = newFont;
+});
+Clazz_defineMethod (c$, "fontName_actionPerformed", 
+function () {
+if (this.$init) {
+return;
+}this.changeFont ();
+});
+Clazz_defineMethod (c$, "fontSize_actionPerformed", 
+function () {
+if (this.$init) {
+return;
+}this.changeFont ();
+});
+Clazz_defineMethod (c$, "fontStyle_actionPerformed", 
+function () {
+if (this.$init) {
+return;
+}this.changeFont ();
+});
+Clazz_defineMethod (c$, "jbInit", 
+ function () {
+this.setLayout ( new java.awt.BorderLayout ());
+this.setBackground (java.awt.Color.white);
+var fontLabel =  new awt2swing.Label (jalview.util.MessageManager.getString ("label.font"));
+fontLabel.setFont (jalview.appletgui.FontChooser.VERDANA_11PT);
+fontLabel.setAlignment (4);
+this.fontSize.setFont (jalview.appletgui.FontChooser.VERDANA_11PT);
+this.fontSize.addItemListener (this);
+this.fontStyle.setFont (jalview.appletgui.FontChooser.VERDANA_11PT);
+this.fontStyle.addItemListener (this);
+var sizeLabel =  new awt2swing.Label (jalview.util.MessageManager.getString ("label.size"));
+sizeLabel.setAlignment (4);
+sizeLabel.setFont (jalview.appletgui.FontChooser.VERDANA_11PT);
+var styleLabel =  new awt2swing.Label (jalview.util.MessageManager.getString ("label.style"));
+styleLabel.setAlignment (4);
+styleLabel.setFont (jalview.appletgui.FontChooser.VERDANA_11PT);
+this.fontName.setFont (jalview.appletgui.FontChooser.VERDANA_11PT);
+this.fontName.addItemListener (this);
+this.scaleAsCdna.setLabel (jalview.util.MessageManager.getString ("label.scale_as_cdna"));
+this.scaleAsCdna.setFont (jalview.appletgui.FontChooser.VERDANA_11PT);
+this.scaleAsCdna.addItemListener (this);
+this.scaleAsCdna.setState (this.ap.av.isScaleProteinAsCdna ());
+this.ok.setFont (jalview.appletgui.FontChooser.VERDANA_11PT);
+this.ok.setLabel (jalview.util.MessageManager.getString ("action.ok"));
+this.ok.addActionListener (((Clazz_isClassDefined ("jalview.appletgui.FontChooser$1") ? 0 : jalview.appletgui.FontChooser.$FontChooser$1$ ()), Clazz_innerTypeInstance (jalview.appletgui.FontChooser$1, this, null)));
+this.cancel.setFont (jalview.appletgui.FontChooser.VERDANA_11PT);
+this.cancel.setLabel (jalview.util.MessageManager.getString ("action.cancel"));
+this.cancel.addActionListener (((Clazz_isClassDefined ("jalview.appletgui.FontChooser$2") ? 0 : jalview.appletgui.FontChooser.$FontChooser$2$ ()), Clazz_innerTypeInstance (jalview.appletgui.FontChooser$2, this, null)));
+var fontPanel =  new awt2swing.Panel ();
+fontPanel.setLayout ( new java.awt.BorderLayout ());
+var stylePanel =  new awt2swing.Panel ();
+stylePanel.setLayout ( new java.awt.BorderLayout ());
+var sizePanel =  new awt2swing.Panel ();
+sizePanel.setLayout ( new java.awt.BorderLayout ());
+var scalePanel =  new awt2swing.Panel ();
+scalePanel.setLayout ( new java.awt.BorderLayout ());
+var okCancelPanel =  new awt2swing.Panel ();
+var optionsPanel =  new awt2swing.Panel ();
+fontPanel.setBackground (java.awt.Color.white);
+stylePanel.setBackground (java.awt.Color.white);
+sizePanel.setBackground (java.awt.Color.white);
+okCancelPanel.setBackground (java.awt.Color.white);
+optionsPanel.setBackground (java.awt.Color.white);
+fontPanel.add (fontLabel, "West");
+fontPanel.add (this.fontName, "Center");
+stylePanel.add (styleLabel, "West");
+stylePanel.add (this.fontStyle, "Center");
+sizePanel.add (sizeLabel, "West");
+sizePanel.add (this.fontSize, "Center");
+scalePanel.add (this.scaleAsCdna, "Center");
+okCancelPanel.add (this.ok, null);
+okCancelPanel.add (this.cancel, null);
+optionsPanel.add (fontPanel, null);
+optionsPanel.add (sizePanel, null);
+optionsPanel.add (stylePanel, null);
+this.add (optionsPanel, "North");
+if (this.ap.alignFrame.getSplitFrame () != null) {
+this.add (scalePanel, "Center");
+}this.add (okCancelPanel, "South");
+});
+Clazz_defineMethod (c$, "scaleAsCdna_actionPerformed", 
+function () {
+this.ap.av.setScaleProteinAsCdna (this.scaleAsCdna.getState ());
+this.ap.av.getCodingComplement ().setScaleProteinAsCdna (this.scaleAsCdna.getState ());
+this.ap.alignFrame.getSplitFrame ().adjustLayout ();
+this.ap.paintAlignment (true);
+this.ap.alignFrame.getSplitFrame ().repaint ();
+});
+c$.$FontChooser$1$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_declareAnonymous (jalview.appletgui, "FontChooser$1", null, java.awt.event.ActionListener);
+Clazz_overrideMethod (c$, "actionPerformed", 
+function (e) {
+this.b$["jalview.appletgui.FontChooser"].ok_actionPerformed ();
+}, "java.awt.event.ActionEvent");
+c$ = Clazz_p0p ();
+};
+c$.$FontChooser$2$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_declareAnonymous (jalview.appletgui, "FontChooser$2", null, java.awt.event.ActionListener);
+Clazz_overrideMethod (c$, "actionPerformed", 
+function (e) {
+this.b$["jalview.appletgui.FontChooser"].cancel_actionPerformed ();
+}, "java.awt.event.ActionEvent");
+c$ = Clazz_p0p ();
+};
+c$.VERDANA_11PT = c$.prototype.VERDANA_11PT =  new java.awt.Font ("Verdana", 0, 11);
+});
+Clazz_declarePackage ("jalview.appletgui");
+Clazz_load (["awt2swing.Panel", "java.awt.event.MouseListener", "$.MouseMotionListener"], "jalview.appletgui.OverviewPanel", ["awt2swing.Frame", "jalview.appletgui.FeatureRenderer", "$.SequenceRenderer", "java.awt.Color", "$.Dimension", "java.awt.event.ComponentAdapter", "java.lang.Thread"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.miniMe = null;
+this.offscreen = null;
+this.av = null;
+this.ap = null;
+this.scalew = 1;
+this.scaleh = 1;
+this.$width = 0;
+this.sequencesHeight = 0;
+this.graphHeight = 20;
+this.boxX = -1;
+this.boxY = -1;
+this.boxWidth = -1;
+this.boxHeight = -1;
+this.resizing = false;
+this.sr = null;
+this.fr = null;
+this.nullFrame = null;
+this.resizeAgain = false;
+Clazz_instantialize (this, arguments);
+}, jalview.appletgui, "OverviewPanel", awt2swing.Panel, [Runnable, java.awt.event.MouseMotionListener, java.awt.event.MouseListener]);
+Clazz_makeConstructor (c$, 
+function (ap) {
+Clazz_superConstructor (this, jalview.appletgui.OverviewPanel, []);
+this.av = ap.av;
+this.ap = ap;
+this.setLayout (null);
+this.nullFrame =  new awt2swing.Frame ();
+this.nullFrame.addNotify ();
+this.sr =  new jalview.appletgui.SequenceRenderer (this.av);
+this.sr.graphics = this.nullFrame.getGraphics ();
+this.sr.renderGaps = false;
+this.sr.forOverview = true;
+this.fr =  new jalview.appletgui.FeatureRenderer (this.av);
+var initialScale = this.av.getAlignment ().getWidth () / this.av.getAlignment ().getHeight ();
+if (this.av.getSequenceConsensusHash () == null) {
+this.graphHeight = 0;
+}if (this.av.getAlignment ().getWidth () > this.av.getAlignment ().getHeight ()) {
+this.$width = 400;
+this.sequencesHeight = Clazz_floatToInt (400 / initialScale);
+if (this.sequencesHeight < 40) {
+this.sequencesHeight = 40;
+}} else {
+this.$width = Clazz_floatToInt (400 * initialScale);
+this.sequencesHeight = 300;
+if (this.$width < 120) {
+this.$width = 120;
+}}this.setSize ( new java.awt.Dimension (this.$width, this.sequencesHeight + this.graphHeight));
+this.addComponentListener (((Clazz_isClassDefined ("jalview.appletgui.OverviewPanel$1") ? 0 : jalview.appletgui.OverviewPanel.$OverviewPanel$1$ ()), Clazz_innerTypeInstance (jalview.appletgui.OverviewPanel$1, this, null)));
+this.addMouseMotionListener (this);
+this.addMouseListener (this);
+this.updateOverviewImage ();
+}, "jalview.appletgui.AlignmentPanel");
+Clazz_overrideMethod (c$, "mouseEntered", 
+function (evt) {
+}, "java.awt.event.MouseEvent");
+Clazz_overrideMethod (c$, "mouseExited", 
+function (evt) {
+}, "java.awt.event.MouseEvent");
+Clazz_overrideMethod (c$, "mouseClicked", 
+function (evt) {
+}, "java.awt.event.MouseEvent");
+Clazz_overrideMethod (c$, "mouseMoved", 
+function (evt) {
+}, "java.awt.event.MouseEvent");
+Clazz_overrideMethod (c$, "mousePressed", 
+function (evt) {
+this.boxX = evt.getX ();
+this.boxY = evt.getY ();
+this.checkValid ();
+}, "java.awt.event.MouseEvent");
+Clazz_overrideMethod (c$, "mouseReleased", 
+function (evt) {
+this.boxX = evt.getX ();
+this.boxY = evt.getY ();
+this.checkValid ();
+}, "java.awt.event.MouseEvent");
+Clazz_overrideMethod (c$, "mouseDragged", 
+function (evt) {
+this.boxX = evt.getX ();
+this.boxY = evt.getY ();
+this.checkValid ();
+}, "java.awt.event.MouseEvent");
+Clazz_defineMethod (c$, "checkValid", 
+function () {
+if (this.boxY < 0) {
+this.boxY = 0;
+}if (this.boxY > (this.sequencesHeight - this.boxHeight)) {
+this.boxY = this.sequencesHeight - this.boxHeight + 1;
+}if (this.boxX < 0) {
+this.boxX = 0;
+}if (this.boxX > (this.$width - this.boxWidth)) {
+if (this.av.hasHiddenColumns ()) {
+this.boxWidth = Clazz_floatToInt ((this.av.endRes - this.av.startRes + 1) * this.av.getCharWidth () * this.scalew);
+}this.boxX = this.$width - this.boxWidth;
+}var col = Clazz_floatToInt (this.boxX / this.scalew / this.av.getCharWidth ());
+var row = Clazz_floatToInt (this.boxY / this.scaleh / this.av.getCharHeight ());
+if (this.av.hasHiddenColumns ()) {
+if (!this.av.getColumnSelection ().isVisible (col)) {
+return;
+}col = this.av.getColumnSelection ().findColumnPosition (col);
+}if (this.av.hasHiddenRows ()) {
+row = this.av.getAlignment ().getHiddenSequences ().findIndexWithoutHiddenSeqs (row);
+}this.ap.setScrollValues (col, row);
+this.ap.paintAlignment (false);
+});
+Clazz_defineMethod (c$, "updateOverviewImage", 
+function () {
+if (this.resizing) {
+this.resizeAgain = true;
+return;
+}if (this.av.isShowSequenceFeatures ()) {
+this.fr.transferSettings (this.ap.seqPanel.seqCanvas.fr);
+}this.resizing = true;
+if ((this.getSize ().width > 0) && (this.getSize ().height > 0)) {
+this.$width = this.getSize ().width;
+this.sequencesHeight = this.getSize ().height - this.graphHeight;
+}this.setSize ( new java.awt.Dimension (this.$width, this.sequencesHeight + this.graphHeight));
+var thread =  new Thread (this);
+thread.start ();
+this.repaint ();
+});
+Clazz_overrideMethod (c$, "run", 
+function () {
+this.miniMe = null;
+var alwidth = this.av.getAlignment ().getWidth ();
+var alheight = this.av.getAlignment ().getHeight ();
+if (this.av.isShowSequenceFeatures ()) {
+this.fr.transferSettings (this.ap.seqPanel.seqCanvas.getFeatureRenderer ());
+}if (this.getSize ().width > 0 && this.getSize ().height > 0) {
+this.$width = this.getSize ().width;
+this.sequencesHeight = this.getSize ().height - this.graphHeight;
+}this.setSize ( new java.awt.Dimension (this.$width, this.sequencesHeight + this.graphHeight));
+var fullsizeWidth = alwidth * this.av.getCharWidth ();
+var fullsizeHeight = alheight * this.av.getCharHeight ();
+this.scalew = this.$width / fullsizeWidth;
+this.scaleh = this.sequencesHeight / fullsizeHeight;
+this.miniMe = this.nullFrame.createImage (this.$width, this.sequencesHeight + this.graphHeight);
+this.offscreen = this.nullFrame.createImage (this.$width, this.sequencesHeight + this.graphHeight);
+var mg = this.miniMe.getGraphics ();
+var sampleCol = alwidth / this.$width;
+var sampleRow = alheight / this.sequencesHeight;
+var lastcol = 0;
+var lastrow = 0;
+var xstart = 0;
+var ystart = 0;
+var color = java.awt.Color.yellow;
+var row;
+var col;
+var sameRow = 0;
+var sameCol = 0;
+var seq;
+var hasHiddenRows = this.av.hasHiddenRows ();
+var hasHiddenCols = this.av.hasHiddenColumns ();
+var hiddenRow = false;
+var alignment = this.av.getAlignment ();
+for (row = 0; row <= this.sequencesHeight; row++) {
+if (Clazz_floatToInt (row * sampleRow) == lastrow) {
+sameRow++;
+continue;
+}hiddenRow = false;
+if (hasHiddenRows) {
+seq = alignment.getHiddenSequences ().getHiddenSequence (lastrow);
+if (seq == null) {
+var index = alignment.getHiddenSequences ().findIndexWithoutHiddenSeqs (lastrow);
+seq = alignment.getSequenceAt (index);
+} else {
+hiddenRow = true;
+}} else {
+seq = alignment.getSequenceAt (lastrow);
+}for (col = 0; col < this.$width; col++) {
+if (Clazz_floatToInt (col * sampleCol) == lastcol && Clazz_floatToInt (row * sampleRow) == lastrow) {
+sameCol++;
+continue;
+}lastcol = Clazz_floatToInt (col * sampleCol);
+if (seq.getLength () > lastcol) {
+color = this.sr.getResidueBoxColour (seq, lastcol);
+if (this.av.isShowSequenceFeatures ()) {
+color = this.fr.findFeatureColour (color, seq, lastcol);
+}} else {
+color = java.awt.Color.white;
+}if (hiddenRow || (hasHiddenCols && !this.av.getColumnSelection ().isVisible (lastcol))) {
+color = color.darker ().darker ();
+}mg.setColor (color);
+if (sameCol == 1 && sameRow == 1) {
+mg.drawLine (xstart, ystart, xstart, ystart);
+} else {
+mg.fillRect (xstart, ystart, sameCol, sameRow);
+}xstart = col;
+sameCol = 1;
+}
+lastrow = Clazz_floatToInt (row * sampleRow);
+ystart = row;
+sameRow = 1;
+}
+if (this.av.getAlignmentConservationAnnotation () != null) {
+for (col = 0; col < this.$width; col++) {
+lastcol = Clazz_floatToInt (col * sampleCol);
+{
+mg.translate (col, this.sequencesHeight);
+this.ap.annotationPanel.renderer.drawGraph (mg, this.av.getAlignmentConservationAnnotation (), this.av.getAlignmentConservationAnnotation ().annotations, Clazz_floatToInt (sampleCol) + 1, this.graphHeight, Clazz_floatToInt (col * sampleCol), Clazz_floatToInt (col * sampleCol) + 1);
+mg.translate (-col, -this.sequencesHeight);
+}}
+}System.gc ();
+this.resizing = false;
+this.setBoxPosition ();
+if (this.resizeAgain) {
+this.resizeAgain = false;
+this.updateOverviewImage ();
+}});
+Clazz_defineMethod (c$, "setBoxPosition", 
+function () {
+var fullsizeWidth = this.av.getAlignment ().getWidth () * this.av.getCharWidth ();
+var fullsizeHeight = (this.av.getAlignment ().getHeight () + this.av.getAlignment ().getHiddenSequences ().getSize ()) * this.av.getCharHeight ();
+var startRes = this.av.getStartRes ();
+var endRes = this.av.getEndRes ();
+if (this.av.hasHiddenColumns ()) {
+startRes = this.av.getColumnSelection ().adjustForHiddenColumns (startRes);
+endRes = this.av.getColumnSelection ().adjustForHiddenColumns (endRes);
+}var startSeq = this.av.startSeq;
+var endSeq = this.av.endSeq;
+if (this.av.hasHiddenRows ()) {
+startSeq = this.av.getAlignment ().getHiddenSequences ().adjustForHiddenSeqs (startSeq);
+endSeq = this.av.getAlignment ().getHiddenSequences ().adjustForHiddenSeqs (endSeq);
+}this.scalew = this.$width / fullsizeWidth;
+this.scaleh = this.sequencesHeight / fullsizeHeight;
+this.boxX = Clazz_floatToInt (startRes * this.av.getCharWidth () * this.scalew);
+this.boxY = Clazz_floatToInt (startSeq * this.av.getCharHeight () * this.scaleh);
+if (this.av.hasHiddenColumns ()) {
+this.boxWidth = Clazz_floatToInt ((endRes - startRes + 1) * this.av.getCharWidth () * this.scalew);
+} else {
+this.boxWidth = Clazz_floatToInt ((endRes - startRes + 1) * this.av.getCharWidth () * this.scalew);
+}this.boxHeight = Clazz_floatToInt ((endSeq - startSeq) * this.av.getCharHeight () * this.scaleh);
+this.repaint ();
+});
+Clazz_overrideMethod (c$, "update", 
+function (g) {
+this.paint (g);
+}, "java.awt.Graphics");
+Clazz_overrideMethod (c$, "paintComponent", 
+function (g) {
+var og = this.offscreen.getGraphics ();
+if (this.miniMe != null) {
+og.drawImage (this.miniMe, 0, 0, this);
+og.setColor (java.awt.Color.red);
+og.drawRect (this.boxX, this.boxY, this.boxWidth, this.boxHeight);
+og.drawRect (this.boxX + 1, this.boxY + 1, this.boxWidth - 2, this.boxHeight - 2);
+g.drawImage (this.offscreen, 0, 0, this);
+}}, "java.awt.Graphics");
+c$.$OverviewPanel$1$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_declareAnonymous (jalview.appletgui, "OverviewPanel$1", java.awt.event.ComponentAdapter);
+Clazz_overrideMethod (c$, "componentResized", 
+function (evt) {
+if (this.b$["jalview.appletgui.OverviewPanel"].getSize ().width != this.b$["jalview.appletgui.OverviewPanel"].$width || this.b$["jalview.appletgui.OverviewPanel"].getSize ().height != this.b$["jalview.appletgui.OverviewPanel"].sequencesHeight + this.b$["jalview.appletgui.OverviewPanel"].graphHeight) {
+this.b$["jalview.appletgui.OverviewPanel"].updateOverviewImage ();
+}}, "java.awt.event.ComponentEvent");
+c$ = Clazz_p0p ();
+};
+});
+Clazz_declarePackage ("jalview.appletgui");
+Clazz_load (["jalview.appletgui.EmbmenuFrame", "java.awt.event.ActionListener", "$.ItemListener", "awt2swing.Button", "$.CheckboxMenuItem", "$.Choice", "$.Label", "$.Menu", "$.MenuBar", "$.MenuItem", "$.Panel", "java.awt.BorderLayout", "$.FlowLayout"], "jalview.appletgui.PCAPanel", ["awt2swing.Frame", "jalview.appletgui.AlignFrame", "$.CutAndPasteTransfer", "$.RotatableCanvas", "jalview.bin.JalviewLite", "jalview.datamodel.Alignment", "jalview.util.MessageManager", "jalview.viewmodel.PCAModel", "java.awt.Color", "$.Font", "java.lang.Thread"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.rc = null;
+this.av = null;
+this.pcaModel = null;
+this.top = 0;
+this.jPanel2 = null;
+this.jLabel1 = null;
+this.jLabel2 = null;
+this.jLabel3 = null;
+this.xCombobox = null;
+this.yCombobox = null;
+this.zCombobox = null;
+this.resetButton = null;
+this.flowLayout1 = null;
+this.borderLayout1 = null;
+this.menuBar1 = null;
+this.menu1 = null;
+this.menu2 = null;
+this.calcSettings = null;
+this.labels = null;
+this.protSetting = null;
+this.nuclSetting = null;
+this.values = null;
+this.inputData = null;
+Clazz_instantialize (this, arguments);
+}, jalview.appletgui, "PCAPanel", jalview.appletgui.EmbmenuFrame, [Runnable, java.awt.event.ActionListener, java.awt.event.ItemListener]);
+Clazz_prepareFields (c$, function () {
+this.jPanel2 =  new awt2swing.Panel ();
+this.jLabel1 =  new awt2swing.Label ();
+this.jLabel2 =  new awt2swing.Label ();
+this.jLabel3 =  new awt2swing.Label ();
+this.xCombobox =  new awt2swing.Choice ();
+this.yCombobox =  new awt2swing.Choice ();
+this.zCombobox =  new awt2swing.Choice ();
+this.resetButton =  new awt2swing.Button ();
+this.flowLayout1 =  new java.awt.FlowLayout ();
+this.borderLayout1 =  new java.awt.BorderLayout ();
+this.menuBar1 =  new awt2swing.MenuBar ();
+this.menu1 =  new awt2swing.Menu ();
+this.menu2 =  new awt2swing.Menu ();
+this.calcSettings =  new awt2swing.Menu ();
+this.labels =  new awt2swing.CheckboxMenuItem ();
+this.protSetting =  new awt2swing.CheckboxMenuItem ();
+this.nuclSetting =  new awt2swing.CheckboxMenuItem ();
+this.values =  new awt2swing.MenuItem ();
+this.inputData =  new awt2swing.MenuItem ();
+});
+Clazz_makeConstructor (c$, 
+function (av) {
+Clazz_superConstructor (this, jalview.appletgui.PCAPanel, []);
+try {
+this.jbInit ();
+} catch (e) {
+if (Clazz_exceptionOf (e, Exception)) {
+e.printStackTrace ();
+} else {
+throw e;
+}
+}
+for (var i = 1; i < 8; i++) {
+this.xCombobox.addItem ("dim " + i);
+this.yCombobox.addItem ("dim " + i);
+this.zCombobox.addItem ("dim " + i);
+}
+this.av = av;
+var selected = av.getSelectionGroup () != null && av.getSelectionGroup ().getSize () > 0;
+var seqstrings = av.getAlignmentView (selected);
+var nucleotide = av.getAlignment ().isNucleotide ();
+var seqs;
+if (!selected) {
+seqs = av.getAlignment ().getSequencesArray ();
+} else {
+seqs = av.getSelectionGroup ().getSequencesInOrder (av.getAlignment ());
+}var sq = seqstrings.getSequences ();
+var length = sq[0].getWidth ();
+for (var i = 0; i < seqs.length; i++) {
+if (sq[i].getWidth () != length) {
+System.out.println ("Sequences must be equal length for PCA analysis");
+return;
+}}
+this.pcaModel =  new jalview.viewmodel.PCAModel (seqstrings, seqs, nucleotide);
+this.rc =  new jalview.appletgui.RotatableCanvas (av);
+this.embedMenuIfNeeded (this.rc);
+this.add (this.rc, "Center");
+jalview.bin.JalviewLite.addFrame (this, jalview.util.MessageManager.getString ("label.principal_component_analysis"), 475, 400);
+var worker =  new Thread (this);
+worker.start ();
+}, "jalview.appletgui.AlignViewport");
+Clazz_overrideMethod (c$, "run", 
+function () {
+this.calcSettings.setEnabled (false);
+this.rc.setEnabled (false);
+try {
+this.nuclSetting.setState (this.pcaModel.isNucleotide ());
+this.protSetting.setState (!this.pcaModel.isNucleotide ());
+this.pcaModel.run ();
+this.xCombobox.select (new Integer (0));
+this.yCombobox.select (new Integer (1));
+this.zCombobox.select (new Integer (2));
+this.pcaModel.updateRc (this.rc);
+this.top = this.pcaModel.getTop ();
+} catch (x) {
+if (Clazz_exceptionOf (x, OutOfMemoryError)) {
+System.err.println ("Out of memory when calculating PCA.");
+return;
+} else {
+throw x;
+}
+}
+this.calcSettings.setEnabled (true);
+this.rc.setEnabled (true);
+this.rc.repaint ();
+this.repaint ();
+});
+Clazz_defineMethod (c$, "doDimensionChange", 
+function () {
+if (this.top == 0) {
+return;
+}var dim1 = this.top - this.xCombobox.getSelectedIndex ();
+var dim2 = this.top - this.yCombobox.getSelectedIndex ();
+var dim3 = this.top - this.zCombobox.getSelectedIndex ();
+this.pcaModel.updateRcView (dim1, dim2, dim3);
+this.rc.img = null;
+this.rc.rotmat.setIdentity ();
+this.rc.initAxes ();
+this.rc.paint (this.rc.getGraphics ());
+});
+Clazz_overrideMethod (c$, "actionPerformed", 
+function (evt) {
+if (evt.getSource () === this.inputData) {
+this.showOriginalData ();
+}if (evt.getSource () === this.resetButton) {
+this.xCombobox.select (new Integer (0));
+this.yCombobox.select (new Integer (1));
+this.zCombobox.select (new Integer (2));
+this.doDimensionChange ();
+}if (evt.getSource () === this.values) {
+this.values_actionPerformed ();
+}}, "java.awt.event.ActionEvent");
+Clazz_overrideMethod (c$, "itemStateChanged", 
+function (evt) {
+if (evt.getSource () === this.xCombobox) {
+this.xCombobox_actionPerformed ();
+} else if (evt.getSource () === this.yCombobox) {
+this.yCombobox_actionPerformed ();
+} else if (evt.getSource () === this.zCombobox) {
+this.zCombobox_actionPerformed ();
+} else if (evt.getSource () === this.labels) {
+this.labels_itemStateChanged (evt);
+} else if (evt.getSource () === this.nuclSetting) {
+if (!this.pcaModel.isNucleotide ()) {
+this.pcaModel.setNucleotide (true);
+ new Thread (this).start ();
+}} else if (evt.getSource () === this.protSetting) {
+if (this.pcaModel.isNucleotide ()) {
+this.pcaModel.setNucleotide (false);
+ new Thread (this).start ();
+}}}, "java.awt.event.ItemEvent");
+Clazz_defineMethod (c$, "xCombobox_actionPerformed", 
+function () {
+this.doDimensionChange ();
+});
+Clazz_defineMethod (c$, "yCombobox_actionPerformed", 
+function () {
+this.doDimensionChange ();
+});
+Clazz_defineMethod (c$, "zCombobox_actionPerformed", 
+function () {
+this.doDimensionChange ();
+});
+Clazz_defineMethod (c$, "values_actionPerformed", 
+function () {
+var cap =  new jalview.appletgui.CutAndPasteTransfer (false, null);
+var frame =  new awt2swing.Frame ();
+frame.add (cap);
+jalview.bin.JalviewLite.addFrame (frame, jalview.util.MessageManager.getString ("label.pca_details"), 500, 500);
+cap.setText (this.pcaModel.getDetails ());
+});
+Clazz_defineMethod (c$, "showOriginalData", 
+function () {
+var gc = '-';
+try {
+gc = this.av.getGapCharacter ();
+} catch (ex) {
+if (Clazz_exceptionOf (ex, Exception)) {
+} else {
+throw ex;
+}
+}
+;var alAndColsel = this.pcaModel.getSeqtrings ().getAlignmentAndColumnSelection (gc);
+if (alAndColsel != null && alAndColsel[0] != null) {
+var al =  new jalview.datamodel.Alignment (alAndColsel[0]);
+var af =  new jalview.appletgui.AlignFrame (al, this.av.applet, "Original Data for PCA", false);
+af.viewport.setHiddenColumns (alAndColsel[1]);
+}});
+Clazz_defineMethod (c$, "labels_itemStateChanged", 
+function (itemEvent) {
+this.rc.showLabels (this.labels.getState ());
+}, "java.awt.event.ItemEvent");
+Clazz_defineMethod (c$, "jbInit", 
+ function () {
+this.setLayout (this.borderLayout1);
+this.jPanel2.setLayout (this.flowLayout1);
+this.jLabel1.setFont ( new java.awt.Font ("Verdana", 0, 12));
+this.jLabel1.setText ("x=");
+this.jLabel2.setFont ( new java.awt.Font ("Verdana", 0, 12));
+this.jLabel2.setText ("y=");
+this.jLabel3.setFont ( new java.awt.Font ("Verdana", 0, 12));
+this.jLabel3.setText ("z=");
+this.jPanel2.setBackground (java.awt.Color.white);
+this.zCombobox.setFont ( new java.awt.Font ("Verdana", 0, 12));
+this.zCombobox.addItemListener (this);
+this.yCombobox.setFont ( new java.awt.Font ("Verdana", 0, 12));
+this.yCombobox.addItemListener (this);
+this.xCombobox.setFont ( new java.awt.Font ("Verdana", 0, 12));
+this.xCombobox.addItemListener (this);
+this.resetButton.setFont ( new java.awt.Font ("Verdana", 0, 12));
+this.resetButton.setLabel (jalview.util.MessageManager.getString ("action.reset"));
+this.resetButton.addActionListener (this);
+this.setMenuBar (this.menuBar1);
+this.menu1.setLabel (jalview.util.MessageManager.getString ("action.file"));
+this.menu2.setLabel (jalview.util.MessageManager.getString ("action.view"));
+this.calcSettings.setLabel (jalview.util.MessageManager.getString ("action.change_params"));
+this.labels.setLabel (jalview.util.MessageManager.getString ("label.labels"));
+this.labels.addItemListener (this);
+this.values.setLabel (jalview.util.MessageManager.getString ("label.output_values"));
+this.values.addActionListener (this);
+this.inputData.setLabel (jalview.util.MessageManager.getString ("label.input_data"));
+this.nuclSetting.setLabel (jalview.util.MessageManager.getString ("label.nucleotide_matrix"));
+this.nuclSetting.addItemListener (this);
+this.protSetting.setLabel (jalview.util.MessageManager.getString ("label.protein_matrix"));
+this.protSetting.addItemListener (this);
+this.add (this.jPanel2, "South");
+this.jPanel2.add (this.jLabel1, null);
+this.jPanel2.add (this.xCombobox, null);
+this.jPanel2.add (this.jLabel2, null);
+this.jPanel2.add (this.yCombobox, null);
+this.jPanel2.add (this.jLabel3, null);
+this.jPanel2.add (this.zCombobox, null);
+this.jPanel2.add (this.resetButton, null);
+this.menuBar1.add (this.menu1);
+this.menuBar1.add (this.menu2);
+this.menuBar1.add (this.calcSettings);
+this.menu2.add (this.labels);
+this.menu1.add (this.values);
+this.menu1.add (this.inputData);
+this.calcSettings.add (this.nuclSetting);
+this.calcSettings.add (this.protSetting);
+this.inputData.addActionListener (this);
+});
+});
+Clazz_declarePackage ("jalview.appletgui");
+Clazz_load (["awt2swing.Panel", "jalview.api.RotatableCanvasI", "java.awt.event.KeyListener", "$.MouseListener", "$.MouseMotionListener", "jalview.math.RotatableMatrix"], "jalview.appletgui.RotatableCanvas", ["awt2swing.Util", "jalview.appletgui.PaintRefresher", "jalview.datamodel.SequenceGroup", "jalview.util.Format", "$.MessageManager", "java.awt.Color", "$.Dimension", "$.Font"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.idmat = null;
+this.objmat = null;
+this.rotmat = null;
+this.tooltip = null;
+this.toolx = 0;
+this.tooly = 0;
+this.$drawAxes = true;
+this.omx = 0;
+this.mx = 0;
+this.omy = 0;
+this.my = 0;
+this.img = null;
+this.ig = null;
+this.prefsize = null;
+this.centre = null;
+this.$width = null;
+this.max = null;
+this.min = null;
+this.maxwidth = 0;
+this.scale = 0;
+this.npoint = 0;
+this.points = null;
+this.orig = null;
+this.axes = null;
+this.startx = 0;
+this.starty = 0;
+this.lastx = 0;
+this.lasty = 0;
+this.rectx1 = 0;
+this.recty1 = 0;
+this.rectx2 = 0;
+this.recty2 = 0;
+this.scalefactor = 1;
+this.av = null;
+this.$showLabels = false;
+Clazz_instantialize (this, arguments);
+}, jalview.appletgui, "RotatableCanvas", awt2swing.Panel, [java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.event.KeyListener, jalview.api.RotatableCanvasI]);
+Clazz_prepareFields (c$, function () {
+this.idmat =  new jalview.math.RotatableMatrix (3, 3);
+this.objmat =  new jalview.math.RotatableMatrix (3, 3);
+this.rotmat =  new jalview.math.RotatableMatrix (3, 3);
+this.centre =  Clazz_newFloatArray (3, 0);
+this.$width =  Clazz_newFloatArray (3, 0);
+this.max =  Clazz_newFloatArray (3, 0);
+this.min =  Clazz_newFloatArray (3, 0);
+});
+Clazz_makeConstructor (c$, 
+function (av) {
+Clazz_superConstructor (this, jalview.appletgui.RotatableCanvas, []);
+this.av = av;
+}, "jalview.viewmodel.AlignmentViewport");
+Clazz_defineMethod (c$, "showLabels", 
+function (b) {
+this.$showLabels = b;
+this.repaint ();
+}, "~B");
+Clazz_overrideMethod (c$, "setPoints", 
+function (points, npoint) {
+this.points = points;
+this.npoint = npoint;
+jalview.appletgui.PaintRefresher.Register (this, this.av.getSequenceSetId ());
+this.prefsize = this.getPreferredSize ();
+this.orig =  Clazz_newFloatArray (npoint, 3, 0);
+for (var i = 0; i < npoint; i++) {
+var sp = points.elementAt (i);
+for (var j = 0; j < 3; j++) {
+this.orig[i][j] = sp.coord[j];
+}
+}
+for (var i = 0; i < 3; i++) {
+for (var j = 0; j < 3; j++) {
+if (i != j) {
+this.idmat.addElement (i, j, 0);
+this.objmat.addElement (i, j, 0);
+this.rotmat.addElement (i, j, 0);
+} else {
+this.idmat.addElement (i, j, 0);
+this.objmat.addElement (i, j, 0);
+this.rotmat.addElement (i, j, 0);
+}}
+}
+this.axes =  Clazz_newFloatArray (3, 3, 0);
+this.initAxes ();
+this.findCentre ();
+this.findWidth ();
+this.scale = this.findScale ();
+this.addMouseListener (this);
+this.addKeyListener (this);
+this.addMouseMotionListener (this);
+}, "java.util.Vector,~N");
+Clazz_defineMethod (c$, "initAxes", 
+function () {
+for (var i = 0; i < 3; i++) {
+for (var j = 0; j < 3; j++) {
+if (i != j) {
+this.axes[i][j] = 0;
+} else {
+this.axes[i][j] = 1;
+}}
+}
+});
+Clazz_defineMethod (c$, "findWidth", 
+function () {
+this.max =  Clazz_newFloatArray (3, 0);
+this.min =  Clazz_newFloatArray (3, 0);
+this.max[0] = -1.0E30;
+this.max[1] = -1.0E30;
+this.max[2] = -1.0E30;
+this.min[0] = 1e30;
+this.min[1] = 1e30;
+this.min[2] = 1e30;
+for (var i = 0; i < 3; i++) {
+for (var j = 0; j < this.npoint; j++) {
+var sp = this.points.elementAt (j);
+if (sp.coord[i] >= this.max[i]) {
+this.max[i] = sp.coord[i];
+}if (sp.coord[i] <= this.min[i]) {
+this.min[i] = sp.coord[i];
+}}
+}
+this.$width[0] = Math.abs (this.max[0] - this.min[0]);
+this.$width[1] = Math.abs (this.max[1] - this.min[1]);
+this.$width[2] = Math.abs (this.max[2] - this.min[2]);
+this.maxwidth = this.$width[0];
+if (this.$width[1] > this.$width[0]) {
+this.maxwidth = this.$width[1];
+}if (this.$width[2] > this.$width[1]) {
+this.maxwidth = this.$width[2];
+}});
+Clazz_defineMethod (c$, "findScale", 
+function () {
+var dim;
+var width;
+var height;
+if (this.getSize ().width != 0) {
+width = this.getSize ().width;
+height = this.getSize ().height;
+} else {
+width = this.prefsize.width;
+height = this.prefsize.height;
+}if (width < height) {
+dim = width;
+} else {
+dim = height;
+}return dim * this.scalefactor / (2 * this.maxwidth);
+});
+Clazz_defineMethod (c$, "findCentre", 
+function () {
+this.findWidth ();
+this.centre[0] = (this.max[0] + this.min[0]) / 2;
+this.centre[1] = (this.max[1] + this.min[1]) / 2;
+this.centre[2] = (this.max[2] + this.min[2]) / 2;
+});
+Clazz_overrideMethod (c$, "getPreferredSize", 
+function () {
+if (this.prefsize != null) {
+return this.prefsize;
+} else {
+return  new java.awt.Dimension (400, 400);
+}});
+Clazz_overrideMethod (c$, "getMinimumSize", 
+function () {
+return this.getPreferredSize ();
+});
+Clazz_overrideMethod (c$, "update", 
+function (g) {
+this.paint (g);
+}, "java.awt.Graphics");
+Clazz_defineMethod (c$, "PaintComponent", 
+function (g) {
+if (this.points == null) {
+g.setFont ( new java.awt.Font ("Verdana", 0, 18));
+awt2swing.Util.drawString (g, jalview.util.MessageManager.getString ("label.calculating_pca") + "....", 20, Clazz_doubleToInt (this.getSize ().height / 2));
+} else {
+if ((this.img == null) || (this.prefsize.width != this.getSize ().width) || (this.prefsize.height != this.getSize ().height)) {
+this.prefsize.width = this.getSize ().width;
+this.prefsize.height = this.getSize ().height;
+this.scale = this.findScale ();
+this.img = this.createImage (this.getSize ().width, this.getSize ().height);
+this.ig = this.img.getGraphics ();
+}this.drawBackground (this.ig, java.awt.Color.black);
+this.drawScene (this.ig);
+if (this.$drawAxes == true) {
+this.drawAxes (this.ig);
+}if (this.tooltip != null) {
+this.ig.setColor (java.awt.Color.red);
+awt2swing.Util.drawString (this.ig, this.tooltip, this.toolx, this.tooly);
+}g.drawImage (this.img, 0, 0, this);
+}}, "java.awt.Graphics");
+Clazz_defineMethod (c$, "drawAxes", 
+function (g) {
+g.setColor (java.awt.Color.yellow);
+for (var i = 0; i < 3; i++) {
+g.drawLine (Clazz_doubleToInt (this.getSize ().width / 2), Clazz_doubleToInt (this.getSize ().height / 2), Clazz_floatToInt (this.axes[i][0] * this.scale * this.max[0] + Clazz_doubleToInt (this.getSize ().width / 2)), Clazz_floatToInt (this.axes[i][1] * this.scale * this.max[1] + Clazz_doubleToInt (this.getSize ().height / 2)));
+}
+}, "java.awt.Graphics");
+Clazz_defineMethod (c$, "drawBackground", 
+function (g, col) {
+g.setColor (col);
+g.fillRect (0, 0, this.prefsize.width, this.prefsize.height);
+}, "java.awt.Graphics,java.awt.Color");
+Clazz_defineMethod (c$, "drawScene", 
+function (g) {
+var halfwidth = Clazz_doubleToInt (this.getSize ().width / 2);
+var halfheight = Clazz_doubleToInt (this.getSize ().height / 2);
+for (var i = 0; i < this.npoint; i++) {
+var sp = this.points.elementAt (i);
+var x = Clazz_floatToInt ((sp.coord[0] - this.centre[0]) * this.scale) + halfwidth;
+var y = Clazz_floatToInt ((sp.coord[1] - this.centre[1]) * this.scale) + halfheight;
+var z = sp.coord[1] - this.centre[2];
+if (this.av.getSequenceColour (sp.sequence) === java.awt.Color.black) {
+g.setColor (java.awt.Color.white);
+} else {
+g.setColor (this.av.getSequenceColour (sp.sequence));
+}if (this.av.getSelectionGroup () != null) {
+if (this.av.getSelectionGroup ().getSequences (null).contains ((this.points.elementAt (i)).sequence)) {
+g.setColor (java.awt.Color.gray);
+}}if (z < 0) {
+g.setColor (g.getColor ().darker ());
+}g.fillRect (x - 3, y - 3, 6, 6);
+if (this.$showLabels) {
+g.setColor (java.awt.Color.red);
+awt2swing.Util.drawString (g, (this.points.elementAt (i)).sequence.getName (), x - 3, y - 4);
+}}
+}, "java.awt.Graphics");
+Clazz_defineMethod (c$, "minimumsize", 
+function () {
+return this.prefsize;
+});
+Clazz_defineMethod (c$, "preferredsize", 
+function () {
+return this.prefsize;
+});
+Clazz_overrideMethod (c$, "keyTyped", 
+function (evt) {
+}, "java.awt.event.KeyEvent");
+Clazz_overrideMethod (c$, "keyReleased", 
+function (evt) {
+}, "java.awt.event.KeyEvent");
+Clazz_overrideMethod (c$, "keyPressed", 
+function (evt) {
+if (evt.getKeyCode () == 38) {
+this.scalefactor = (this.scalefactor * 1.1);
+this.scale = this.findScale ();
+} else if (evt.getKeyCode () == 40) {
+this.scalefactor = (this.scalefactor * 0.9);
+this.scale = this.findScale ();
+} else if (evt.getKeyChar () == 's') {
+System.err.println ("DEBUG: Rectangle selection");
+if (this.rectx2 != -1 && this.recty2 != -1) {
+this.rectSelect (this.rectx1, this.recty1, this.rectx2, this.recty2);
+}}this.repaint ();
+}, "java.awt.event.KeyEvent");
+Clazz_defineMethod (c$, "printPoints", 
+function () {
+for (var i = 0; i < this.npoint; i++) {
+var sp = this.points.elementAt (i);
+jalview.util.Format.printLong (System.out, "%5d ", i);
+for (var j = 0; j < 3; j++) {
+jalview.util.Format.printDouble (System.out, "%13.3f  ", sp.coord[j]);
+}
+System.out.println ();
+}
+});
+Clazz_overrideMethod (c$, "mouseClicked", 
+function (evt) {
+}, "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_overrideMethod (c$, "mouseReleased", 
+function (evt) {
+}, "java.awt.event.MouseEvent");
+Clazz_overrideMethod (c$, "mousePressed", 
+function (evt) {
+var x = evt.getX ();
+var y = evt.getY ();
+this.mx = x;
+this.my = y;
+this.omx = this.mx;
+this.omy = this.my;
+this.startx = x;
+this.starty = y;
+this.rectx1 = x;
+this.recty1 = y;
+this.rectx2 = -1;
+this.recty2 = -1;
+var found = this.findPoint (x, y);
+if (found != null) {
+if (this.av.getSelectionGroup () != null) {
+this.av.getSelectionGroup ().addOrRemove (found, true);
+this.av.getSelectionGroup ().setEndRes (this.av.getAlignment ().getWidth () - 1);
+} else {
+this.av.setSelectionGroup ( new jalview.datamodel.SequenceGroup ());
+this.av.getSelectionGroup ().addOrRemove (found, true);
+this.av.getSelectionGroup ().setEndRes (this.av.getAlignment ().getWidth () - 1);
+}jalview.appletgui.PaintRefresher.Refresh (this, this.av.getSequenceSetId ());
+this.av.sendSelection ();
+}this.repaint ();
+}, "java.awt.event.MouseEvent");
+Clazz_overrideMethod (c$, "mouseMoved", 
+function (evt) {
+var found = this.findPoint (evt.getX (), evt.getY ());
+if (found == null) {
+this.tooltip = null;
+} else {
+this.tooltip = found.getName ();
+this.toolx = evt.getX ();
+this.tooly = evt.getY ();
+}this.repaint ();
+}, "java.awt.event.MouseEvent");
+Clazz_overrideMethod (c$, "mouseDragged", 
+function (evt) {
+this.mx = evt.getX ();
+this.my = evt.getY ();
+this.rotmat.setIdentity ();
+this.rotmat.rotate (this.my - this.omy, 'x');
+this.rotmat.rotate (this.mx - this.omx, 'y');
+for (var i = 0; i < this.npoint; i++) {
+var sp = this.points.elementAt (i);
+sp.coord[0] -= this.centre[0];
+sp.coord[1] -= this.centre[1];
+sp.coord[2] -= this.centre[2];
+sp.coord = this.rotmat.vectorMultiply (sp.coord);
+sp.coord[0] += this.centre[0];
+sp.coord[1] += this.centre[1];
+sp.coord[2] += this.centre[2];
+}
+for (var i = 0; i < 3; i++) {
+this.axes[i] = this.rotmat.vectorMultiply (this.axes[i]);
+}
+this.omx = this.mx;
+this.omy = this.my;
+this.paint (this.getGraphics ());
+}, "java.awt.event.MouseEvent");
+Clazz_defineMethod (c$, "rectSelect", 
+function (x1, y1, x2, y2) {
+for (var i = 0; i < this.npoint; i++) {
+var sp = this.points.elementAt (i);
+var tmp1 = Clazz_doubleToInt ((sp.coord[0] - this.centre[0]) * this.scale + this.getSize ().width / 2.0);
+var tmp2 = Clazz_doubleToInt ((sp.coord[1] - this.centre[1]) * this.scale + this.getSize ().height / 2.0);
+if (tmp1 > x1 && tmp1 < x2 && tmp2 > y1 && tmp2 < y2) {
+if (this.av != null) {
+if (!this.av.getSelectionGroup ().getSequences (null).contains (sp.sequence)) {
+this.av.getSelectionGroup ().addSequence (sp.sequence, true);
+}}}}
+}, "~N,~N,~N,~N");
+Clazz_defineMethod (c$, "findPoint", 
+function (x, y) {
+var halfwidth = Clazz_doubleToInt (this.getSize ().width / 2);
+var halfheight = Clazz_doubleToInt (this.getSize ().height / 2);
+var found = -1;
+for (var i = 0; i < this.npoint; i++) {
+var sp = this.points.elementAt (i);
+var px = Clazz_floatToInt ((sp.coord[0] - this.centre[0]) * this.scale) + halfwidth;
+var py = Clazz_floatToInt ((sp.coord[1] - this.centre[1]) * this.scale) + halfheight;
+if (Math.abs (px - x) < 3 && Math.abs (py - y) < 3) {
+found = i;
+}}
+if (found != -1) {
+return (this.points.elementAt (found)).sequence;
+} else {
+return null;
+}}, "~N,~N");
+});
+Clazz_declarePackage ("jalview.api");
+Clazz_declareInterface (jalview.api, "RotatableCanvasI");
+Clazz_declarePackage ("jalview.math");
+c$ = Clazz_decorateAsClass (function () {
+this.matrix = null;
+this.temp = null;
+this.rot = null;
+Clazz_instantialize (this, arguments);
+}, jalview.math, "RotatableMatrix");
+Clazz_makeConstructor (c$, 
+function (rows, cols) {
+this.matrix =  Clazz_newFloatArray (rows, cols, 0);
+this.temp =  Clazz_newFloatArray (3, 0);
+this.rot =  Clazz_newFloatArray (3, 3, 0);
+}, "~N,~N");
+Clazz_defineMethod (c$, "addElement", 
+function (i, j, value) {
+this.matrix[i][j] = value;
+}, "~N,~N,~N");
+Clazz_defineMethod (c$, "print", 
+function () {
+System.out.println (this.matrix[0][0] + " " + this.matrix[0][1] + " " + this.matrix[0][2]);
+System.out.println (this.matrix[1][0] + " " + this.matrix[1][1] + " " + this.matrix[1][2]);
+System.out.println (this.matrix[2][0] + " " + this.matrix[2][1] + " " + this.matrix[2][2]);
+});
+Clazz_defineMethod (c$, "rotate", 
+function (degrees, axis) {
+var costheta = Math.cos ((degrees * 3.141592653589793) / 180.0);
+var sintheta = Math.sin ((degrees * 3.141592653589793) / 180.0);
+if (axis == 'z') {
+this.rot[0][0] = costheta;
+this.rot[0][1] = -sintheta;
+this.rot[0][2] = 0.0;
+this.rot[1][0] = sintheta;
+this.rot[1][1] = costheta;
+this.rot[1][2] = 0.0;
+this.rot[2][0] = 0.0;
+this.rot[2][1] = 0.0;
+this.rot[2][2] = 1.0;
+this.preMultiply (this.rot);
+}if (axis == 'x') {
+this.rot[0][0] = 1.0;
+this.rot[0][1] = 0.0;
+this.rot[0][2] = 0.0;
+this.rot[1][0] = 0.0;
+this.rot[1][1] = costheta;
+this.rot[1][2] = sintheta;
+this.rot[2][0] = 0.0;
+this.rot[2][1] = -sintheta;
+this.rot[2][2] = costheta;
+this.preMultiply (this.rot);
+}if (axis == 'y') {
+this.rot[0][0] = costheta;
+this.rot[0][1] = 0.0;
+this.rot[0][2] = -sintheta;
+this.rot[1][0] = 0.0;
+this.rot[1][1] = 1.0;
+this.rot[1][2] = 0.0;
+this.rot[2][0] = sintheta;
+this.rot[2][1] = 0.0;
+this.rot[2][2] = costheta;
+this.preMultiply (this.rot);
+}}, "~N,~S");
+Clazz_defineMethod (c$, "vectorMultiply", 
+function (vect) {
+this.temp[0] = vect[0];
+this.temp[1] = vect[1];
+this.temp[2] = vect[2];
+for (var i = 0; i < 3; i++) {
+this.temp[i] = (this.matrix[i][0] * vect[0]) + (this.matrix[i][1] * vect[1]) + (this.matrix[i][2] * vect[2]);
+}
+vect[0] = this.temp[0];
+vect[1] = this.temp[1];
+vect[2] = this.temp[2];
+return vect;
+}, "~A");
+Clazz_defineMethod (c$, "preMultiply", 
+function (mat) {
+var tmp =  Clazz_newFloatArray (3, 3, 0);
+for (var i = 0; i < 3; i++) {
+for (var j = 0; j < 3; j++) {
+tmp[i][j] = (mat[i][0] * this.matrix[0][j]) + (mat[i][1] * this.matrix[1][j]) + (mat[i][2] * this.matrix[2][j]);
+}
+}
+for (var i = 0; i < 3; i++) {
+for (var j = 0; j < 3; j++) {
+this.matrix[i][j] = tmp[i][j];
+}
+}
+}, "~A");
+Clazz_defineMethod (c$, "postMultiply", 
+function (mat) {
+var tmp =  Clazz_newFloatArray (3, 3, 0);
+for (var i = 0; i < 3; i++) {
+for (var j = 0; j < 3; j++) {
+tmp[i][j] = (this.matrix[i][0] * mat[0][j]) + (this.matrix[i][1] * mat[1][j]) + (this.matrix[i][2] * mat[2][j]);
+}
+}
+for (var i = 0; i < 3; i++) {
+for (var j = 0; j < 3; j++) {
+this.matrix[i][j] = tmp[i][j];
+}
+}
+}, "~A");
+Clazz_defineMethod (c$, "setIdentity", 
+function () {
+this.matrix[0][0] = 1.0;
+this.matrix[1][1] = 1.0;
+this.matrix[2][2] = 1.0;
+this.matrix[0][1] = 0.0;
+this.matrix[0][2] = 0.0;
+this.matrix[1][0] = 0.0;
+this.matrix[1][2] = 0.0;
+this.matrix[2][0] = 0.0;
+this.matrix[2][1] = 0.0;
+});
+Clazz_declarePackage ("jalview.viewmodel");
+Clazz_load (null, "jalview.viewmodel.PCAModel", ["jalview.analysis.PCA", "jalview.datamodel.SequencePoint", "java.lang.StringBuffer", "java.util.Vector"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.pca = null;
+this.top = 0;
+this.seqstrings = null;
+this.seqs = null;
+this.score_matrix = null;
+this.nucleotide = false;
+this.points = null;
+this.jvCalcMode = true;
+Clazz_instantialize (this, arguments);
+}, jalview.viewmodel, "PCAModel");
+Clazz_makeConstructor (c$, 
+function (seqstrings2, seqs2, nucleotide2) {
+this.seqstrings = seqstrings2;
+this.seqs = seqs2;
+this.nucleotide = nucleotide2;
+this.score_matrix = nucleotide2 ? "PID" : "BLOSUM62";
+}, "jalview.datamodel.AlignmentView,~A,~B");
+Clazz_defineMethod (c$, "isJvCalcMode", 
+function () {
+return this.jvCalcMode;
+});
+Clazz_defineMethod (c$, "run", 
+function () {
+this.pca =  new jalview.analysis.PCA (this.seqstrings.getSequenceStrings (' '), this.nucleotide, this.score_matrix);
+this.pca.setJvCalcMode (this.jvCalcMode);
+this.pca.run ();
+var ii = 0;
+while ((ii < this.seqs.length) && (this.seqs[ii] != null)) {
+ii++;
+}
+var comps =  Clazz_newDoubleArray (ii, ii, 0);
+for (var i = 0; i < ii; i++) {
+if (this.pca.getEigenvalue (i) > 1e-4) {
+comps[i] = this.pca.component (i);
+}}
+this.top = this.pca.getM ().rows - 1;
+this.points =  new java.util.Vector ();
+var scores = this.pca.getComponents (this.top - 1, this.top - 2, this.top - 3, 100);
+for (var i = 0; i < this.pca.getM ().rows; i++) {
+var sp =  new jalview.datamodel.SequencePoint (this.seqs[i], scores[i]);
+this.points.addElement (sp);
+}
+});
+Clazz_defineMethod (c$, "updateRc", 
+function (rc) {
+rc.setPoints (this.points, this.pca.getM ().rows);
+}, "jalview.api.RotatableCanvasI");
+Clazz_defineMethod (c$, "isNucleotide", 
+function () {
+return this.nucleotide;
+});
+Clazz_defineMethod (c$, "setNucleotide", 
+function (nucleotide) {
+this.nucleotide = nucleotide;
+}, "~B");
+Clazz_defineMethod (c$, "getTop", 
+function () {
+return this.top;
+});
+Clazz_defineMethod (c$, "updateRcView", 
+function (dim1, dim2, dim3) {
+var scores = this.pca.getComponents (dim1 - 1, dim2 - 1, dim3 - 1, 100);
+for (var i = 0; i < this.pca.getM ().rows; i++) {
+(this.points.elementAt (i)).coord = scores[i];
+}
+}, "~N,~N,~N");
+Clazz_defineMethod (c$, "getDetails", 
+function () {
+return this.pca.getDetails ();
+});
+Clazz_defineMethod (c$, "getSeqtrings", 
+function () {
+return this.seqstrings;
+});
+Clazz_defineMethod (c$, "getPointsasCsv", 
+function (transformed, xdim, ydim, zdim) {
+var csv =  new StringBuffer ();
+csv.append ("\"Sequence\"");
+if (transformed) {
+csv.append (",");
+csv.append ("" + xdim);
+csv.append (",");
+csv.append ("" + ydim);
+csv.append (",");
+csv.append ("" + zdim);
+} else {
+for (var d = 1, dmax = this.pca.component (1).length; d <= dmax; d++) {
+csv.append ("," + d);
+}
+}csv.append ("\n");
+for (var s = 0; s < this.seqs.length; s++) {
+csv.append ("\"" + this.seqs[s].getName () + "\"");
+var fl;
+if (!transformed) {
+fl = this.pca.component (s);
+for (var d = fl.length - 1; d >= 0; d--) {
+csv.append (",");
+csv.append (fl[d]);
+}
+} else {
+fl = this.getPointPosition (s);
+for (var d = 0; d < fl.length; d++) {
+csv.append (",");
+csv.append (fl[d]);
+}
+}csv.append ("\n");
+}
+return csv.toString ();
+}, "~B,~N,~N,~N");
+Clazz_defineMethod (c$, "getPointPosition", 
+function (s) {
+var pts =  Clazz_newDoubleArray (3, 0);
+var p = this.points.elementAt (s).coord;
+pts[0] = p[0];
+pts[1] = p[1];
+pts[2] = p[2];
+return pts;
+}, "~N");
+Clazz_defineMethod (c$, "setJvCalcMode", 
+function (state) {
+this.jvCalcMode = state;
+}, "~B");
+Clazz_defineMethod (c$, "getScore_matrix", 
+function () {
+return this.score_matrix;
+});
+Clazz_defineMethod (c$, "setScore_matrix", 
+function (score_matrix) {
+this.score_matrix = score_matrix;
+}, "~S");
+});
+Clazz_declarePackage ("jalview.analysis");
+Clazz_load (["java.lang.StringBuffer"], "jalview.analysis.PCA", ["jalview.datamodel.BinarySequence", "jalview.math.Matrix", "jalview.schemes.ResidueProperties"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.m = null;
+this.symm = null;
+this.m2 = null;
+this.eigenvalue = null;
+this.eigenvector = null;
+this.details = null;
+this.jvCalcMode = true;
+Clazz_instantialize (this, arguments);
+}, jalview.analysis, "PCA", null, Runnable);
+Clazz_prepareFields (c$, function () {
+this.details =  new StringBuffer ();
+});
+Clazz_makeConstructor (c$, 
+function (s) {
+this.construct (s, false);
+}, "~A");
+Clazz_makeConstructor (c$, 
+function (s, nucleotides) {
+this.construct (s, nucleotides, null);
+}, "~A,~B");
+Clazz_makeConstructor (c$, 
+function (s, nucleotides, s_m) {
+var bs =  new Array (s.length);
+var ii = 0;
+while ((ii < s.length) && (s[ii] != null)) {
+bs[ii] =  new jalview.datamodel.BinarySequence (s[ii], nucleotides);
+bs[ii].encode ();
+ii++;
+}
+var bs2 =  new Array (s.length);
+ii = 0;
+var smtrx = null;
+var sm = s_m;
+if (sm != null) {
+smtrx = jalview.schemes.ResidueProperties.getScoreMatrix (sm);
+}if (smtrx == null) {
+smtrx = jalview.schemes.ResidueProperties.getScoreMatrix (sm = (nucleotides ? "DNA" : "BLOSUM62"));
+}this.details.append ("PCA calculation using " + sm + " sequence similarity matrix\n========\n\n");
+while ((ii < s.length) && (s[ii] != null)) {
+bs2[ii] =  new jalview.datamodel.BinarySequence (s[ii], nucleotides);
+if (smtrx != null) {
+try {
+bs2[ii].matrixEncode (smtrx);
+} catch (x) {
+if (Clazz_exceptionOf (x, jalview.datamodel.BinarySequence.InvalidSequenceTypeException)) {
+this.details.append ("Unexpected mismatch of sequence type and score matrix. Calculation will not be valid!\n\n");
+} else {
+throw x;
+}
+}
+}ii++;
+}
+var count = 0;
+while ((count < bs.length) && (bs[count] != null)) {
+count++;
+}
+var seqmat =  Clazz_newDoubleArray (count, bs[0].getDBinary ().length, 0);
+var seqmat2 =  Clazz_newDoubleArray (count, bs2[0].getDBinary ().length, 0);
+var i = 0;
+while (i < count) {
+seqmat[i] = bs[i].getDBinary ();
+seqmat2[i] = bs2[i].getDBinary ();
+i++;
+}
+this.m =  new jalview.math.Matrix (seqmat, count, bs[0].getDBinary ().length);
+this.m2 =  new jalview.math.Matrix (seqmat2, count, bs2[0].getDBinary ().length);
+}, "~A,~B,~S");
+Clazz_defineMethod (c$, "getM", 
+function () {
+return this.m;
+});
+Clazz_defineMethod (c$, "getEigenvalue", 
+function (i) {
+return this.eigenvector.d[i];
+}, "~N");
+Clazz_defineMethod (c$, "getComponents", 
+function (l, n, mm, factor) {
+var out =  Clazz_newFloatArray (this.m.rows, 3, 0);
+for (var i = 0; i < this.m.rows; i++) {
+out[i][0] = this.component (i, l) * factor;
+out[i][1] = this.component (i, n) * factor;
+out[i][2] = this.component (i, mm) * factor;
+}
+return out;
+}, "~N,~N,~N,~N");
+Clazz_defineMethod (c$, "component", 
+function (n) {
+var out =  Clazz_newDoubleArray (this.m.rows, 0);
+for (var i = 0; i < this.m.rows; i++) {
+out[i] = this.component (i, n);
+}
+return out;
+}, "~N");
+Clazz_defineMethod (c$, "component", 
+function (row, n) {
+var out = 0.0;
+for (var i = 0; i < this.symm.cols; i++) {
+out += (this.symm.value[row][i] * this.eigenvector.value[i][n]);
+}
+return out / this.eigenvector.d[n];
+}, "~N,~N");
+Clazz_defineMethod (c$, "getDetails", 
+function () {
+return this.details.toString ();
+});
+Clazz_overrideMethod (c$, "run", 
+function () {
+var ps = ((Clazz_isClassDefined ("jalview.analysis.PCA$1") ? 0 : jalview.analysis.PCA.$PCA$1$ ()), Clazz_innerTypeInstance (jalview.analysis.PCA$1, this, null, System.out));
+try {
+this.details.append ("PCA Calculation Mode is " + (this.jvCalcMode ? "Jalview variant" : "Original SeqSpace") + "\n");
+var mt = this.m.transpose ();
+this.details.append (" --- OrigT * Orig ---- \n");
+if (!this.jvCalcMode) {
+this.eigenvector = mt.preMultiply (this.m);
+} else {
+this.eigenvector = mt.preMultiply (this.m2);
+}this.eigenvector.print (ps);
+this.symm = this.eigenvector.copy ();
+this.eigenvector.tred ();
+this.details.append (" ---Tridiag transform matrix ---\n");
+this.details.append (" --- D vector ---\n");
+this.eigenvector.printD (ps);
+ps.println ();
+this.details.append ("--- E vector ---\n");
+this.eigenvector.printE (ps);
+ps.println ();
+this.eigenvector.tqli ();
+} catch (q) {
+if (Clazz_exceptionOf (q, Exception)) {
+q.printStackTrace ();
+this.details.append ("\n*** Unexpected exception when performing PCA ***\n" + q.getLocalizedMessage ());
+this.details.append ("*** Matrices below may not be fully diagonalised. ***\n");
+} else {
+throw q;
+}
+}
+this.details.append (" --- New diagonalization matrix ---\n");
+this.eigenvector.print (ps);
+this.details.append (" --- Eigenvalues ---\n");
+this.eigenvector.printD (ps);
+ps.println ();
+});
+Clazz_defineMethod (c$, "setJvCalcMode", 
+function (calcMode) {
+this.jvCalcMode = calcMode;
+}, "~B");
+c$.$PCA$1$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_declareAnonymous (jalview.analysis, "PCA$1", java.io.PrintStream);
+Clazz_defineMethod (c$, "print", 
+function (x) {
+this.b$["jalview.analysis.PCA"].details.append (x);
+}, "~S");
+Clazz_defineMethod (c$, "println", 
+function () {
+this.b$["jalview.analysis.PCA"].details.append ("\n");
+});
+c$ = Clazz_p0p ();
+};
+});
+Clazz_declarePackage ("jalview.datamodel");
+Clazz_load (["jalview.datamodel.Sequence", "java.lang.Exception"], "jalview.datamodel.BinarySequence", ["jalview.schemes.ResidueProperties"], function () {
+c$ = Clazz_decorateAsClass (function () {
+if (!Clazz_isClassDefined ("jalview.datamodel.BinarySequence.InvalidSequenceTypeException")) {
+jalview.datamodel.BinarySequence.$BinarySequence$InvalidSequenceTypeException$ ();
+}
+this.binary = null;
+this.dbinary = null;
+this.isNa = false;
+Clazz_instantialize (this, arguments);
+}, jalview.datamodel, "BinarySequence", jalview.datamodel.Sequence);
+Clazz_makeConstructor (c$, 
+function (s, isNa) {
+Clazz_superConstructor (this, jalview.datamodel.BinarySequence, ["", s, 0, s.length]);
+this.isNa = isNa;
+}, "~S,~B");
+Clazz_defineMethod (c$, "initMatrixGetNoRes", 
+ function () {
+var nores = (this.isNa) ? 10 : 23;
+this.dbinary =  Clazz_newDoubleArray (this.getSequence ().length * nores, 0);
+for (var i = 0; i < this.dbinary.length; i++) {
+this.dbinary[i] = 0.0;
+}
+return nores;
+});
+Clazz_defineMethod (c$, "getSymbolmatrix", 
+ function () {
+return (this.isNa) ? jalview.schemes.ResidueProperties.nucleotideIndex : jalview.schemes.ResidueProperties.aaIndex;
+});
+Clazz_defineMethod (c$, "encode", 
+function () {
+var nores = this.initMatrixGetNoRes ();
+var sindex = this.getSymbolmatrix ();
+for (var i = 0; i < this.getSequence ().length; i++) {
+var aanum = nores - 1;
+try {
+aanum = sindex[this.getCharAt (i).charCodeAt (0)];
+} catch (e) {
+if (Clazz_exceptionOf (e, NullPointerException)) {
+aanum = nores - 1;
+} else {
+throw e;
+}
+}
+if (aanum >= nores) {
+aanum = nores - 1;
+}this.dbinary[(i * nores) + aanum] = 1.0;
+}
+});
+Clazz_defineMethod (c$, "matrixEncode", 
+function (matrix) {
+if (this.isNa != matrix.isDNA ()) {
+throw Clazz_innerTypeInstance (jalview.datamodel.BinarySequence.InvalidSequenceTypeException, this, null, "matrix " + matrix.getClass ().getCanonicalName () + " is not a valid matrix for " + (this.isNa ? "nucleotide" : "protein") + "sequences");
+}this.matrixEncode (matrix.isDNA () ? jalview.schemes.ResidueProperties.nucleotideIndex : jalview.schemes.ResidueProperties.aaIndex, matrix.getMatrix ());
+}, "jalview.schemes.ScoreMatrix");
+Clazz_defineMethod (c$, "matrixEncode", 
+ function (aaIndex, matrix) {
+var nores = this.initMatrixGetNoRes ();
+for (var i = 0, iSize = this.getSequence ().length; i < iSize; i++) {
+var aanum = nores - 1;
+try {
+aanum = aaIndex[this.getCharAt (i).charCodeAt (0)];
+} catch (e) {
+if (Clazz_exceptionOf (e, NullPointerException)) {
+aanum = nores - 1;
+} else {
+throw e;
+}
+}
+if (aanum >= nores) {
+aanum = nores - 1;
+}for (var j = 0; j < nores; j++) {
+this.dbinary[(i * nores) + j] = matrix[aanum][j];
+}
+}
+}, "~A,~A");
+Clazz_defineMethod (c$, "toBinaryString", 
+function () {
+var out = "";
+for (var i = 0; i < this.binary.length; i++) {
+out += ( new Integer (this.binary[i])).toString ();
+if (i < (this.binary.length - 1)) {
+out += " ";
+}}
+return out;
+});
+Clazz_defineMethod (c$, "getDBinary", 
+function () {
+return this.dbinary;
+});
+c$.$BinarySequence$InvalidSequenceTypeException$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_decorateAsClass (function () {
+Clazz_prepareCallback (this, arguments);
+Clazz_instantialize (this, arguments);
+}, jalview.datamodel.BinarySequence, "InvalidSequenceTypeException", Exception);
+c$ = Clazz_p0p ();
+};
+});
+Clazz_declarePackage ("jalview.math");
+Clazz_load (null, "jalview.math.Matrix", ["jalview.util.Format", "$.MessageManager", "java.lang.Exception"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.value = null;
+this.rows = 0;
+this.cols = 0;
+this.d = null;
+this.e = null;
+this.maxIter = 45;
+Clazz_instantialize (this, arguments);
+}, jalview.math, "Matrix");
+Clazz_makeConstructor (c$, 
+function (value, rows, cols) {
+this.rows = rows;
+this.cols = cols;
+this.value = value;
+}, "~A,~N,~N");
+Clazz_defineMethod (c$, "transpose", 
+function () {
+var out =  Clazz_newDoubleArray (this.cols, this.rows, 0);
+for (var i = 0; i < this.cols; i++) {
+for (var j = 0; j < this.rows; j++) {
+out[i][j] = this.value[j][i];
+}
+}
+return  new jalview.math.Matrix (out, this.cols, this.rows);
+});
+Clazz_defineMethod (c$, "print", 
+function (ps) {
+for (var i = 0; i < this.rows; i++) {
+for (var j = 0; j < this.cols; j++) {
+jalview.util.Format.printDouble (ps, "%8.2f", this.value[i][j]);
+}
+ps.println ();
+}
+}, "java.io.PrintStream");
+Clazz_defineMethod (c$, "preMultiply", 
+function ($in) {
+var tmp =  Clazz_newDoubleArray ($in.rows, this.cols, 0);
+for (var i = 0; i < $in.rows; i++) {
+for (var j = 0; j < this.cols; j++) {
+tmp[i][j] = 0.0;
+for (var k = 0; k < $in.cols; k++) {
+tmp[i][j] += ($in.value[i][k] * this.value[k][j]);
+}
+}
+}
+return  new jalview.math.Matrix (tmp, $in.rows, this.cols);
+}, "jalview.math.Matrix");
+Clazz_defineMethod (c$, "vectorPostMultiply", 
+function ($in) {
+var out =  Clazz_newDoubleArray ($in.length, 0);
+for (var i = 0; i < $in.length; i++) {
+out[i] = 0.0;
+for (var k = 0; k < $in.length; k++) {
+out[i] += (this.value[i][k] * $in[k]);
+}
+}
+return out;
+}, "~A");
+Clazz_defineMethod (c$, "postMultiply", 
+function ($in) {
+var out =  Clazz_newDoubleArray (this.rows, $in.cols, 0);
+for (var i = 0; i < this.rows; i++) {
+for (var j = 0; j < $in.cols; j++) {
+out[i][j] = 0.0;
+for (var k = 0; k < this.rows; k++) {
+out[i][j] = out[i][j] + (this.value[i][k] * $in.value[k][j]);
+}
+}
+}
+return  new jalview.math.Matrix (out, this.cols, $in.rows);
+}, "jalview.math.Matrix");
+Clazz_defineMethod (c$, "copy", 
+function () {
+var newmat =  Clazz_newDoubleArray (this.rows, this.cols, 0);
+for (var i = 0; i < this.rows; i++) {
+for (var j = 0; j < this.cols; j++) {
+newmat[i][j] = this.value[i][j];
+}
+}
+return  new jalview.math.Matrix (newmat, this.rows, this.cols);
+});
+Clazz_defineMethod (c$, "tred", 
+function () {
+var n = this.rows;
+var l;
+var k;
+var j;
+var i;
+var scale;
+var hh;
+var h;
+var g;
+var f;
+this.d =  Clazz_newDoubleArray (this.rows, 0);
+this.e =  Clazz_newDoubleArray (this.rows, 0);
+for (i = n; i >= 2; i--) {
+l = i - 1;
+h = 0.0;
+scale = 0.0;
+if (l > 1) {
+for (k = 1; k <= l; k++) {
+scale += Math.abs (this.value[i - 1][k - 1]);
+}
+if (scale == 0.0) {
+this.e[i - 1] = this.value[i - 1][l - 1];
+} else {
+for (k = 1; k <= l; k++) {
+this.value[i - 1][k - 1] /= scale;
+h += (this.value[i - 1][k - 1] * this.value[i - 1][k - 1]);
+}
+f = this.value[i - 1][l - 1];
+if (f > 0) {
+g = -1.0 * Math.sqrt (h);
+} else {
+g = Math.sqrt (h);
+}this.e[i - 1] = scale * g;
+h -= (f * g);
+this.value[i - 1][l - 1] = f - g;
+f = 0.0;
+for (j = 1; j <= l; j++) {
+this.value[j - 1][i - 1] = this.value[i - 1][j - 1] / h;
+g = 0.0;
+for (k = 1; k <= j; k++) {
+g += (this.value[j - 1][k - 1] * this.value[i - 1][k - 1]);
+}
+for (k = j + 1; k <= l; k++) {
+g += (this.value[k - 1][j - 1] * this.value[i - 1][k - 1]);
+}
+this.e[j - 1] = g / h;
+f += (this.e[j - 1] * this.value[i - 1][j - 1]);
+}
+hh = f / (h + h);
+for (j = 1; j <= l; j++) {
+f = this.value[i - 1][j - 1];
+g = this.e[j - 1] - (hh * f);
+this.e[j - 1] = g;
+for (k = 1; k <= j; k++) {
+this.value[j - 1][k - 1] -= ((f * this.e[k - 1]) + (g * this.value[i - 1][k - 1]));
+}
+}
+}} else {
+this.e[i - 1] = this.value[i - 1][l - 1];
+}this.d[i - 1] = h;
+}
+this.d[0] = 0.0;
+this.e[0] = 0.0;
+for (i = 1; i <= n; i++) {
+l = i - 1;
+if (this.d[i - 1] != 0.0) {
+for (j = 1; j <= l; j++) {
+g = 0.0;
+for (k = 1; k <= l; k++) {
+g += (this.value[i - 1][k - 1] * this.value[k - 1][j - 1]);
+}
+for (k = 1; k <= l; k++) {
+this.value[k - 1][j - 1] -= (g * this.value[k - 1][i - 1]);
+}
+}
+}this.d[i - 1] = this.value[i - 1][i - 1];
+this.value[i - 1][i - 1] = 1.0;
+for (j = 1; j <= l; j++) {
+this.value[j - 1][i - 1] = 0.0;
+this.value[i - 1][j - 1] = 0.0;
+}
+}
+});
+Clazz_defineMethod (c$, "tqli", 
+function () {
+var n = this.rows;
+var m;
+var l;
+var iter;
+var i;
+var k;
+var s;
+var r;
+var p;
+;var g;
+var f;
+var dd;
+var c;
+var b;
+for (i = 2; i <= n; i++) {
+this.e[i - 2] = this.e[i - 1];
+}
+this.e[n - 1] = 0.0;
+for (l = 1; l <= n; l++) {
+iter = 0;
+do {
+for (m = l; m <= (n - 1); m++) {
+dd = Math.abs (this.d[m - 1]) + Math.abs (this.d[m]);
+if ((Math.abs (this.e[m - 1]) + dd) == dd) {
+break;
+}}
+if (m != l) {
+iter++;
+if (iter == this.maxIter) {
+throw  new Exception (jalview.util.MessageManager.formatMessage ("exception.matrix_too_many_iteration",  Clazz_newArray (-1, ["tqli", Integer.$valueOf (this.maxIter).toString ()])));
+} else {
+}g = (this.d[l] - this.d[l - 1]) / (2.0 * this.e[l - 1]);
+r = Math.sqrt ((g * g) + 1.0);
+g = this.d[m - 1] - this.d[l - 1] + (this.e[l - 1] / (g + this.sign (r, g)));
+c = 1.0;
+s = c;
+p = 0.0;
+for (i = m - 1; i >= l; i--) {
+f = s * this.e[i - 1];
+b = c * this.e[i - 1];
+if (Math.abs (f) >= Math.abs (g)) {
+c = g / f;
+r = Math.sqrt ((c * c) + 1.0);
+this.e[i] = f * r;
+s = 1.0 / r;
+c *= s;
+} else {
+s = f / g;
+r = Math.sqrt ((s * s) + 1.0);
+this.e[i] = g * r;
+c = 1.0 / r;
+s *= c;
+}g = this.d[i] - p;
+r = ((this.d[i - 1] - g) * s) + (2.0 * c * b);
+p = s * r;
+this.d[i] = g + p;
+g = (c * r) - b;
+for (k = 1; k <= n; k++) {
+f = this.value[k - 1][i];
+this.value[k - 1][i] = (s * this.value[k - 1][i - 1]) + (c * f);
+this.value[k - 1][i - 1] = (c * this.value[k - 1][i - 1]) - (s * f);
+}
+}
+this.d[l - 1] = this.d[l - 1] - p;
+this.e[l - 1] = g;
+this.e[m - 1] = 0.0;
+}} while (m != l);
+}
+});
+Clazz_defineMethod (c$, "tred2", 
+function () {
+var n = this.rows;
+var l;
+var k;
+var j;
+var i;
+var scale;
+var hh;
+var h;
+var g;
+var f;
+this.d =  Clazz_newDoubleArray (this.rows, 0);
+this.e =  Clazz_newDoubleArray (this.rows, 0);
+for (i = n - 1; i >= 1; i--) {
+l = i - 1;
+h = 0.0;
+scale = 0.0;
+if (l > 0) {
+for (k = 0; k < l; k++) {
+scale += Math.abs (this.value[i][k]);
+}
+if (scale == 0.0) {
+this.e[i] = this.value[i][l];
+} else {
+for (k = 0; k < l; k++) {
+this.value[i][k] /= scale;
+h += (this.value[i][k] * this.value[i][k]);
+}
+f = this.value[i][l];
+if (f > 0) {
+g = -1.0 * Math.sqrt (h);
+} else {
+g = Math.sqrt (h);
+}this.e[i] = scale * g;
+h -= (f * g);
+this.value[i][l] = f - g;
+f = 0.0;
+for (j = 0; j < l; j++) {
+this.value[j][i] = this.value[i][j] / h;
+g = 0.0;
+for (k = 0; k < j; k++) {
+g += (this.value[j][k] * this.value[i][k]);
+}
+for (k = j; k < l; k++) {
+g += (this.value[k][j] * this.value[i][k]);
+}
+this.e[j] = g / h;
+f += (this.e[j] * this.value[i][j]);
+}
+hh = f / (h + h);
+for (j = 0; j < l; j++) {
+f = this.value[i][j];
+g = this.e[j] - (hh * f);
+this.e[j] = g;
+for (k = 0; k < j; k++) {
+this.value[j][k] -= ((f * this.e[k]) + (g * this.value[i][k]));
+}
+}
+}} else {
+this.e[i] = this.value[i][l];
+}this.d[i] = h;
+}
+this.d[0] = 0.0;
+this.e[0] = 0.0;
+for (i = 0; i < n; i++) {
+l = i - 1;
+if (this.d[i] != 0.0) {
+for (j = 0; j < l; j++) {
+g = 0.0;
+for (k = 0; k < l; k++) {
+g += (this.value[i][k] * this.value[k][j]);
+}
+for (k = 0; k < l; k++) {
+this.value[k][j] -= (g * this.value[k][i]);
+}
+}
+}this.d[i] = this.value[i][i];
+this.value[i][i] = 1.0;
+for (j = 0; j < l; j++) {
+this.value[j][i] = 0.0;
+this.value[i][j] = 0.0;
+}
+}
+});
+Clazz_defineMethod (c$, "tqli2", 
+function () {
+var n = this.rows;
+var m;
+var l;
+var iter;
+var i;
+var k;
+var s;
+var r;
+var p;
+;var g;
+var f;
+var dd;
+var c;
+var b;
+for (i = 2; i <= n; i++) {
+this.e[i - 2] = this.e[i - 1];
+}
+this.e[n - 1] = 0.0;
+for (l = 1; l <= n; l++) {
+iter = 0;
+do {
+for (m = l; m <= (n - 1); m++) {
+dd = Math.abs (this.d[m - 1]) + Math.abs (this.d[m]);
+if ((Math.abs (this.e[m - 1]) + dd) == dd) {
+break;
+}}
+if (m != l) {
+iter++;
+if (iter == this.maxIter) {
+throw  new Exception (jalview.util.MessageManager.formatMessage ("exception.matrix_too_many_iteration",  Clazz_newArray (-1, ["tqli2", Integer.$valueOf (this.maxIter).toString ()])));
+} else {
+}g = (this.d[l] - this.d[l - 1]) / (2.0 * this.e[l - 1]);
+r = Math.sqrt ((g * g) + 1.0);
+g = this.d[m - 1] - this.d[l - 1] + (this.e[l - 1] / (g + this.sign (r, g)));
+c = 1.0;
+s = c;
+p = 0.0;
+for (i = m - 1; i >= l; i--) {
+f = s * this.e[i - 1];
+b = c * this.e[i - 1];
+if (Math.abs (f) >= Math.abs (g)) {
+c = g / f;
+r = Math.sqrt ((c * c) + 1.0);
+this.e[i] = f * r;
+s = 1.0 / r;
+c *= s;
+} else {
+s = f / g;
+r = Math.sqrt ((s * s) + 1.0);
+this.e[i] = g * r;
+c = 1.0 / r;
+s *= c;
+}g = this.d[i] - p;
+r = ((this.d[i - 1] - g) * s) + (2.0 * c * b);
+p = s * r;
+this.d[i] = g + p;
+g = (c * r) - b;
+for (k = 1; k <= n; k++) {
+f = this.value[k - 1][i];
+this.value[k - 1][i] = (s * this.value[k - 1][i - 1]) + (c * f);
+this.value[k - 1][i - 1] = (c * this.value[k - 1][i - 1]) - (s * f);
+}
+}
+this.d[l - 1] = this.d[l - 1] - p;
+this.e[l - 1] = g;
+this.e[m - 1] = 0.0;
+}} while (m != l);
+}
+});
+Clazz_defineMethod (c$, "sign", 
+function (a, b) {
+if (b < 0) {
+return -Math.abs (a);
+} else {
+return Math.abs (a);
+}}, "~N,~N");
+Clazz_defineMethod (c$, "getColumn", 
+function (n) {
+var out =  Clazz_newDoubleArray (this.rows, 0);
+for (var i = 0; i < this.rows; i++) {
+out[i] = this.value[i][n];
+}
+return out;
+}, "~N");
+Clazz_defineMethod (c$, "printD", 
+function (ps) {
+for (var j = 0; j < this.rows; j++) {
+jalview.util.Format.printDouble (ps, "%15.4e", this.d[j]);
+}
+}, "java.io.PrintStream");
+Clazz_defineMethod (c$, "printE", 
+function (ps) {
+for (var j = 0; j < this.rows; j++) {
+jalview.util.Format.printDouble (ps, "%15.4e", this.e[j]);
+}
+}, "java.io.PrintStream");
+});
+Clazz_declarePackage ("jalview.datamodel");
+c$ = Clazz_decorateAsClass (function () {
+this.isPlaceholder = false;
+this.sequence = null;
+this.coord = null;
+Clazz_instantialize (this, arguments);
+}, jalview.datamodel, "SequencePoint");
+Clazz_makeConstructor (c$, 
+function (sequence, coord) {
+this.sequence = sequence;
+this.coord = coord;
+}, "jalview.datamodel.SequenceI,~A");
+Clazz_declarePackage ("jalview.appletgui");
+Clazz_load (["awt2swing.Panel", "java.awt.event.ActionListener", "awt2swing.Button", "$.ScrollPane", "$.TextArea", "java.awt.BorderLayout", "java.util.Vector"], "jalview.appletgui.PairwiseAlignPanel", ["jalview.analysis.AlignSeq", "jalview.appletgui.AlignFrame", "jalview.datamodel.Alignment", "jalview.util.Format", "$.MessageManager", "java.awt.Font"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.sequences = null;
+this.ap = null;
+this.scrollPane = null;
+this.textarea = null;
+this.viewInEditorButton = null;
+this.jPanel1 = null;
+this.borderLayout1 = null;
+Clazz_instantialize (this, arguments);
+}, jalview.appletgui, "PairwiseAlignPanel", awt2swing.Panel, java.awt.event.ActionListener);
+Clazz_prepareFields (c$, function () {
+this.sequences =  new java.util.Vector ();
+this.scrollPane =  new awt2swing.ScrollPane ();
+this.textarea =  new awt2swing.TextArea ();
+this.viewInEditorButton =  new awt2swing.Button ();
+this.jPanel1 =  new awt2swing.Panel ();
+this.borderLayout1 =  new java.awt.BorderLayout ();
+});
+Clazz_makeConstructor (c$, 
+function (ap) {
+Clazz_superConstructor (this, jalview.appletgui.PairwiseAlignPanel, []);
+try {
+this.jbInit ();
+} catch (e) {
+if (Clazz_exceptionOf (e, Exception)) {
+e.printStackTrace ();
+} else {
+throw e;
+}
+}
+this.ap = ap;
+this.sequences =  new java.util.Vector ();
+var seqs;
+var seqStrings = ap.av.getViewAsString (true);
+if (ap.av.getSelectionGroup () == null) {
+seqs = ap.av.getAlignment ().getSequencesArray ();
+} else {
+seqs = ap.av.getSelectionGroup ().getSequencesInOrder (ap.av.getAlignment ());
+}var scores =  Clazz_newFloatArray (seqs.length, seqs.length, 0);
+var totscore = 0;
+var count = ap.av.getSelectionGroup ().getSize ();
+var type = (ap.av.getAlignment ().isNucleotide ()) ? "dna" : "pep";
+var seq;
+for (var i = 1; i < count; i++) {
+for (var j = 0; j < i; j++) {
+var as =  new jalview.analysis.AlignSeq (seqs[i], seqStrings[i], seqs[j], seqStrings[j], type);
+if (as.s1str.length == 0 || as.s2str.length == 0) {
+continue;
+}as.calcScoreMatrix ();
+as.traceAlignment ();
+as.printAlignment (System.out);
+scores[i][j] = as.getMaxScore () / as.getASeq1 ().length;
+totscore = totscore + scores[i][j];
+this.textarea.append (as.getOutput ());
+this.sequences.add (as.getAlignedSeq1 ());
+this.sequences.add (as.getAlignedSeq1 ());
+}
+}
+if (count > 2) {
+System.out.println ("Pairwise alignment scaled similarity score matrix\n");
+for (var i = 0; i < count; i++) {
+jalview.util.Format.print (System.out, "%s \n", ("" + i) + " " + seqs[i].getName ());
+}
+System.out.println ("\n");
+for (var i = 0; i < count; i++) {
+for (var j = 0; j < i; j++) {
+jalview.util.Format.printDouble (System.out, "%7.3f", scores[i][j] / totscore);
+}
+}
+System.out.println ("\n");
+}}, "jalview.appletgui.AlignmentPanel");
+Clazz_overrideMethod (c$, "actionPerformed", 
+function (evt) {
+if (evt.getSource () === this.viewInEditorButton) {
+this.viewInEditorButton_actionPerformed ();
+}}, "java.awt.event.ActionEvent");
+Clazz_defineMethod (c$, "viewInEditorButton_actionPerformed", 
+function () {
+var seq =  new Array (this.sequences.size ());
+for (var i = 0; i < this.sequences.size (); i++) {
+seq[i] = this.sequences.elementAt (i);
+}
+ new jalview.appletgui.AlignFrame ( new jalview.datamodel.Alignment (seq), this.ap.av.applet, "Pairwise Aligned Sequences", false);
+});
+Clazz_defineMethod (c$, "jbInit", 
+ function () {
+this.setLayout (this.borderLayout1);
+this.textarea.setFont ( new java.awt.Font ("Monospaced", 0, 12));
+this.textarea.setText ("");
+this.viewInEditorButton.setFont ( new java.awt.Font ("Verdana", 0, 12));
+this.viewInEditorButton.setLabel (jalview.util.MessageManager.getString ("label.view_alignment_editor"));
+this.viewInEditorButton.addActionListener (this);
+this.add (this.scrollPane, "Center");
+this.scrollPane.add (this.textarea);
+this.add (this.jPanel1, "South");
+this.jPanel1.add (this.viewInEditorButton, null);
+});
+});
+Clazz_declarePackage ("jalview.appletgui");
+Clazz_load (["jalview.appletgui.SliderPanel", "java.awt.event.WindowListener", "java.util.Stack"], "jalview.appletgui.RedundancyPanel", ["awt2swing.Frame", "jalview.analysis.AlignSeq", "jalview.appletgui.PaintRefresher", "jalview.bin.JalviewLite", "jalview.commands.EditCommand", "jalview.util.MessageManager", "java.awt.event.AdjustmentListener", "java.lang.Thread", "java.util.ArrayList", "$.Vector"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.historyList = null;
+this.redundancy = null;
+this.originalSequences = null;
+this.frame = null;
+this.redundantSeqs = null;
+Clazz_instantialize (this, arguments);
+}, jalview.appletgui, "RedundancyPanel", jalview.appletgui.SliderPanel, [Runnable, java.awt.event.WindowListener]);
+Clazz_prepareFields (c$, function () {
+this.historyList =  new java.util.Stack ();
+});
+Clazz_makeConstructor (c$, 
+function (ap) {
+Clazz_superConstructor (this, jalview.appletgui.RedundancyPanel, [ap, 0, false, null]);
+this.redundantSeqs =  new java.util.Vector ();
+this.ap = ap;
+this.undoButton.setVisible (true);
+this.applyButton.setVisible (true);
+this.allGroupsCheck.setVisible (false);
+this.label.setText (jalview.util.MessageManager.getString ("label.enter_redundancy_threshold"));
+this.valueField.setText ("100");
+this.slider.setVisibleAmount (1);
+this.slider.setMinimum (0);
+this.slider.setMaximum (100 + this.slider.getVisibleAmount ());
+this.slider.setValue (100);
+this.slider.addAdjustmentListener (((Clazz_isClassDefined ("jalview.appletgui.RedundancyPanel$1") ? 0 : jalview.appletgui.RedundancyPanel.$RedundancyPanel$1$ ()), Clazz_innerTypeInstance (jalview.appletgui.RedundancyPanel$1, this, null)));
+this.frame =  new awt2swing.Frame ();
+this.frame.add (this);
+jalview.bin.JalviewLite.addFrame (this.frame, jalview.util.MessageManager.getString ("label.redundancy_threshold_selection"), 400, 100);
+this.frame.addWindowListener (this);
+var worker =  new Thread (this);
+worker.start ();
+}, "jalview.appletgui.AlignmentPanel");
+Clazz_overrideMethod (c$, "run", 
+function () {
+this.label.setText (jalview.util.MessageManager.getString ("label.calculating"));
+this.slider.setVisible (false);
+this.applyButton.setEnabled (false);
+this.valueField.setVisible (false);
+this.validate ();
+var omitHidden = null;
+var sg = this.ap.av.getSelectionGroup ();
+var height;
+var start;
+var end;
+if ((sg != null) && (sg.getSize () >= 1)) {
+this.originalSequences = sg.getSequencesInOrder (this.ap.av.getAlignment ());
+start = sg.getStartRes ();
+end = sg.getEndRes ();
+} else {
+this.originalSequences = this.ap.av.getAlignment ().getSequencesArray ();
+start = 0;
+end = this.ap.av.getAlignment ().getWidth ();
+}height = this.originalSequences.length;
+this.redundancy = jalview.analysis.AlignSeq.computeRedundancyMatrix (this.originalSequences, omitHidden, start, end, false);
+this.label.setText (jalview.util.MessageManager.getString ("label.enter_redundancy_threshold"));
+this.slider.setVisible (true);
+this.applyButton.setEnabled (true);
+this.valueField.setVisible (true);
+this.validate ();
+this.sliderValueChanged ();
+});
+Clazz_defineMethod (c$, "sliderValueChanged", 
+function () {
+if (this.redundancy == null) {
+return;
+}var value = this.slider.getValue ();
+var redundantSequences =  new java.util.ArrayList ();
+for (var i = 0; i < this.redundancy.length; i++) {
+if (value <= this.redundancy[i]) {
+redundantSequences.add (this.originalSequences[i]);
+}}
+this.ap.idPanel.idCanvas.setHighlighted (redundantSequences);
+jalview.appletgui.PaintRefresher.Refresh (this, this.ap.av.getSequenceSetId (), true, true);
+});
+Clazz_overrideMethod (c$, "applyButton_actionPerformed", 
+function () {
+var del =  new java.util.Vector ();
+this.undoButton.setEnabled (true);
+var value = this.slider.getValue ();
+var sg = this.ap.av.getSelectionGroup ();
+for (var i = 0; i < this.redundancy.length; i++) {
+if (value <= this.redundancy[i]) {
+del.addElement (this.originalSequences[i]);
+}}
+if (del.size () > 0) {
+var deleted =  new Array (del.size ());
+var width = 0;
+for (var i = 0; i < del.size (); i++) {
+deleted[i] = del.elementAt (i);
+if (deleted[i].getLength () > width) {
+width = deleted[i].getLength ();
+}}
+var cut =  new jalview.commands.EditCommand (jalview.util.MessageManager.getString ("action.remove_redundancy"), jalview.commands.EditCommand.Action.CUT, deleted, 0, width, this.ap.av.getAlignment ());
+var alignment = this.ap.av.getAlignment ();
+for (var i = 0; i < del.size (); i++) {
+alignment.deleteSequence (deleted[i]);
+if (sg != null) {
+sg.deleteSequence (deleted[i], false);
+}}
+this.historyList.push (cut);
+this.ap.alignFrame.addHistoryItem (cut);
+jalview.appletgui.PaintRefresher.Refresh (this, this.ap.av.getSequenceSetId (), true, true);
+this.ap.av.firePropertyChange ("alignment", null, this.ap.av.getAlignment ().getSequences ());
+}});
+Clazz_overrideMethod (c$, "undoButton_actionPerformed", 
+function () {
+var command = this.historyList.pop ();
+command.undoCommand (null);
+if (this.ap.av.getHistoryList ().contains (command)) {
+this.ap.av.getHistoryList ().remove (command);
+this.ap.alignFrame.updateEditMenuBar ();
+this.ap.av.firePropertyChange ("alignment", null, this.ap.av.getAlignment ().getSequences ());
+}this.ap.paintAlignment (true);
+if (this.historyList.size () == 0) {
+this.undoButton.setEnabled (false);
+}});
+Clazz_defineMethod (c$, "valueField_actionPerformed", 
+function (e) {
+try {
+var i = Integer.parseInt (this.valueField.getText ());
+this.slider.setValue (i);
+} catch (ex) {
+if (Clazz_exceptionOf (ex, Exception)) {
+this.valueField.setText (this.slider.getValue () + "");
+} else {
+throw ex;
+}
+}
+}, "java.awt.event.ActionEvent");
+Clazz_overrideMethod (c$, "windowOpened", 
+function (evt) {
+}, "java.awt.event.WindowEvent");
+Clazz_overrideMethod (c$, "windowClosing", 
+function (evt) {
+this.ap.idPanel.idCanvas.setHighlighted (null);
+}, "java.awt.event.WindowEvent");
+Clazz_overrideMethod (c$, "windowClosed", 
+function (evt) {
+}, "java.awt.event.WindowEvent");
+Clazz_overrideMethod (c$, "windowActivated", 
+function (evt) {
+}, "java.awt.event.WindowEvent");
+Clazz_overrideMethod (c$, "windowDeactivated", 
+function (evt) {
+}, "java.awt.event.WindowEvent");
+Clazz_overrideMethod (c$, "windowIconified", 
+function (evt) {
+}, "java.awt.event.WindowEvent");
+Clazz_overrideMethod (c$, "windowDeiconified", 
+function (evt) {
+}, "java.awt.event.WindowEvent");
+c$.$RedundancyPanel$1$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_declareAnonymous (jalview.appletgui, "RedundancyPanel$1", null, java.awt.event.AdjustmentListener);
+Clazz_overrideMethod (c$, "adjustmentValueChanged", 
+function (evt) {
+this.b$["jalview.appletgui.RedundancyPanel"].valueField.setText (this.b$["jalview.appletgui.RedundancyPanel"].slider.getValue () + "");
+this.b$["jalview.appletgui.RedundancyPanel"].sliderValueChanged ();
+}, "java.awt.event.AdjustmentEvent");
+c$ = Clazz_p0p ();
+};
+});
+Clazz_declarePackage ("jalview.appletgui");
+Clazz_load (["jalview.appletgui.EmbmenuFrame", "java.awt.event.ActionListener", "$.ItemListener", "java.lang.Thread", "awt2swing.CheckboxMenuItem", "$.Menu", "$.MenuBar", "$.MenuItem", "$.ScrollPane", "java.awt.BorderLayout"], "jalview.appletgui.TreePanel", ["awt2swing.Frame", "jalview.analysis.NJTree", "jalview.api.analysis.ViewBasedAnalysisI", "jalview.appletgui.AlignFrame", "$.CutAndPasteTransfer", "$.FontChooser", "$.TreeCanvas", "jalview.bin.JalviewLite", "jalview.datamodel.Alignment", "jalview.io.NewickFile", "jalview.schemes.ResidueProperties", "jalview.util.MessageManager", "java.awt.Color", "$.Font"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.seq = null;
+this.$type = null;
+this.pwtype = null;
+this.start = 0;
+this.end = 0;
+this.treeCanvas = null;
+this.tree = null;
+this.ap = null;
+this.av = null;
+if (!Clazz_isClassDefined ("jalview.appletgui.TreePanel.TreeLoader")) {
+jalview.appletgui.TreePanel.$TreePanel$TreeLoader$ ();
+}
+this.borderLayout1 = null;
+this.scrollPane = null;
+this.jMenuBar1 = null;
+this.jMenu2 = null;
+this.fontSize = null;
+this.bootstrapMenu = null;
+this.distanceMenu = null;
+this.placeholdersMenu = null;
+this.fitToWindow = null;
+this.fileMenu = null;
+this.newickOutput = null;
+this.inputData = null;
+Clazz_instantialize (this, arguments);
+}, jalview.appletgui, "TreePanel", jalview.appletgui.EmbmenuFrame, [java.awt.event.ActionListener, java.awt.event.ItemListener]);
+Clazz_prepareFields (c$, function () {
+this.borderLayout1 =  new java.awt.BorderLayout ();
+this.scrollPane =  new awt2swing.ScrollPane ();
+this.jMenuBar1 =  new awt2swing.MenuBar ();
+this.jMenu2 =  new awt2swing.Menu ();
+this.fontSize =  new awt2swing.MenuItem ();
+this.bootstrapMenu =  new awt2swing.CheckboxMenuItem ();
+this.distanceMenu =  new awt2swing.CheckboxMenuItem ();
+this.placeholdersMenu =  new awt2swing.CheckboxMenuItem ();
+this.fitToWindow =  new awt2swing.CheckboxMenuItem ();
+this.fileMenu =  new awt2swing.Menu ();
+this.newickOutput =  new awt2swing.MenuItem ();
+this.inputData =  new awt2swing.MenuItem ();
+});
+Clazz_defineMethod (c$, "getTree", 
+function () {
+return this.tree;
+});
+Clazz_defineMethod (c$, "finalize", 
+function () {
+this.ap = null;
+this.av = null;
+Clazz_superCall (this, jalview.appletgui.TreePanel, "finalize", []);
+});
+Clazz_makeConstructor (c$, 
+function (ap, type, pwtype) {
+Clazz_superConstructor (this, jalview.appletgui.TreePanel, []);
+try {
+this.jbInit ();
+this.setMenuBar (this.jMenuBar1);
+} catch (ex) {
+if (Clazz_exceptionOf (ex, Exception)) {
+ex.printStackTrace ();
+} else {
+throw ex;
+}
+}
+this.initTreePanel (ap, type, pwtype, null);
+}, "jalview.appletgui.AlignmentPanel,~S,~S");
+Clazz_makeConstructor (c$, 
+function (ap, type, pwtype, newtree) {
+Clazz_superConstructor (this, jalview.appletgui.TreePanel, []);
+try {
+this.jbInit ();
+this.setMenuBar (this.jMenuBar1);
+} catch (e) {
+if (Clazz_exceptionOf (e, Exception)) {
+e.printStackTrace ();
+} else {
+throw e;
+}
+}
+this.initTreePanel (ap, type, pwtype, newtree);
+}, "jalview.appletgui.AlignmentPanel,~S,~S,jalview.io.NewickFile");
+Clazz_defineMethod (c$, "initTreePanel", 
+function (ap, type, pwtype, newTree) {
+this.ap = ap;
+this.av = ap.av;
+this.$type = type;
+this.pwtype = pwtype;
+this.treeCanvas =  new jalview.appletgui.TreeCanvas (ap, this.scrollPane);
+var tl = Clazz_innerTypeInstance (jalview.appletgui.TreePanel.TreeLoader, this, null, newTree);
+tl.start ();
+this.embedMenuIfNeeded (this.treeCanvas);
+this.scrollPane.add (this.treeCanvas, "Center");
+}, "jalview.appletgui.AlignmentPanel,~S,~S,jalview.io.NewickFile");
+Clazz_defineMethod (c$, "showOriginalData", 
+function () {
+if (this.tree.seqData != null) {
+var gc = '-';
+try {
+gc = this.av.getGapCharacter ();
+} catch (ex) {
+if (Clazz_exceptionOf (ex, Exception)) {
+} else {
+throw ex;
+}
+}
+;var alAndColsel = this.tree.seqData.getAlignmentAndColumnSelection (gc);
+if (alAndColsel != null && alAndColsel[0] != null) {
+var al =  new jalview.datamodel.Alignment (alAndColsel[0]);
+var af =  new jalview.appletgui.AlignFrame (al, this.av.applet, "Original Data for Tree", false);
+af.viewport.setHiddenColumns (alAndColsel[1]);
+}} else {
+System.out.println ("Original Tree Data not available");
+}});
+Clazz_overrideMethod (c$, "actionPerformed", 
+function (evt) {
+if (evt.getSource () === this.newickOutput) {
+this.newickOutput_actionPerformed ();
+} else if (evt.getSource () === this.fontSize) {
+this.fontSize_actionPerformed ();
+} else if (evt.getSource () === this.inputData) {
+this.showOriginalData ();
+}}, "java.awt.event.ActionEvent");
+Clazz_overrideMethod (c$, "itemStateChanged", 
+function (evt) {
+if (evt.getSource () === this.fitToWindow) {
+this.treeCanvas.fitToWindow = this.fitToWindow.getState ();
+} else if (evt.getSource () === this.distanceMenu) {
+this.treeCanvas.setShowDistances (this.distanceMenu.getState ());
+} else if (evt.getSource () === this.bootstrapMenu) {
+this.treeCanvas.setShowBootstrap (this.bootstrapMenu.getState ());
+} else if (evt.getSource () === this.placeholdersMenu) {
+this.treeCanvas.setMarkPlaceholders (this.placeholdersMenu.getState ());
+}this.treeCanvas.repaint ();
+}, "java.awt.event.ItemEvent");
+Clazz_defineMethod (c$, "newickOutput_actionPerformed", 
+function () {
+var fout =  new jalview.io.NewickFile (this.tree.getTopNode ());
+var output = fout.print (false, true);
+var cap =  new jalview.appletgui.CutAndPasteTransfer (false, null);
+cap.setText (output);
+var frame =  new awt2swing.Frame ();
+frame.add (cap);
+jalview.bin.JalviewLite.addFrame (frame, this.$type + " " + this.pwtype, 500, 100);
+});
+Clazz_defineMethod (c$, "getTreeFont", 
+function () {
+return this.treeCanvas.$font;
+});
+Clazz_defineMethod (c$, "setTreeFont", 
+function (font) {
+this.treeCanvas.$font = font;
+this.treeCanvas.repaint ();
+}, "java.awt.Font");
+Clazz_defineMethod (c$, "fontSize_actionPerformed", 
+function () {
+if (this.treeCanvas == null) {
+return;
+} new jalview.appletgui.FontChooser (this);
+});
+Clazz_defineMethod (c$, "jbInit", 
+ function () {
+this.setLayout (this.borderLayout1);
+this.setBackground (java.awt.Color.white);
+this.setFont ( new java.awt.Font ("Verdana", 0, 12));
+this.jMenu2.setLabel (jalview.util.MessageManager.getString ("action.view"));
+this.fontSize.setLabel (jalview.util.MessageManager.getString ("action.font"));
+this.fontSize.addActionListener (this);
+this.bootstrapMenu.setLabel (jalview.util.MessageManager.getString ("label.show_bootstrap_values"));
+this.bootstrapMenu.addItemListener (this);
+this.distanceMenu.setLabel (jalview.util.MessageManager.getString ("label.show_distances"));
+this.distanceMenu.addItemListener (this);
+this.placeholdersMenu.setLabel (jalview.util.MessageManager.getString ("label.mark_unassociated_leaves"));
+this.placeholdersMenu.addItemListener (this);
+this.fitToWindow.setState (true);
+this.fitToWindow.setLabel (jalview.util.MessageManager.getString ("label.fit_to_window"));
+this.fitToWindow.addItemListener (this);
+this.fileMenu.setLabel (jalview.util.MessageManager.getString ("action.file"));
+this.newickOutput.setLabel (jalview.util.MessageManager.getString ("label.newick_format"));
+this.newickOutput.addActionListener (this);
+this.inputData.setLabel (jalview.util.MessageManager.getString ("label.input_data"));
+this.add (this.scrollPane, "Center");
+this.jMenuBar1.add (this.fileMenu);
+this.jMenuBar1.add (this.jMenu2);
+this.jMenu2.add (this.fitToWindow);
+this.jMenu2.add (this.fontSize);
+this.jMenu2.add (this.distanceMenu);
+this.jMenu2.add (this.bootstrapMenu);
+this.jMenu2.add (this.placeholdersMenu);
+this.fileMenu.add (this.newickOutput);
+this.fileMenu.add (this.inputData);
+this.inputData.addActionListener (this);
+});
+c$.$TreePanel$TreeLoader$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_decorateAsClass (function () {
+Clazz_prepareCallback (this, arguments);
+this.newtree = null;
+this.odata = null;
+Clazz_instantialize (this, arguments);
+}, jalview.appletgui.TreePanel, "TreeLoader", Thread);
+Clazz_makeConstructor (c$, 
+function (a) {
+Clazz_superConstructor (this, jalview.appletgui.TreePanel.TreeLoader, []);
+this.newtree = a;
+}, "jalview.io.NewickFile");
+Clazz_overrideMethod (c$, "run", 
+function () {
+if (this.newtree != null) {
+if (this.odata == null) {
+this.b$["jalview.appletgui.TreePanel"].tree =  new jalview.analysis.NJTree (this.b$["jalview.appletgui.TreePanel"].av.getAlignment ().getSequencesArray (), this.newtree);
+} else {
+this.b$["jalview.appletgui.TreePanel"].tree =  new jalview.analysis.NJTree (this.b$["jalview.appletgui.TreePanel"].av.getAlignment ().getSequencesArray (), this.odata, this.newtree);
+}} else {
+var a;
+var b;
+var c;
+var d = this.b$["jalview.appletgui.TreePanel"].av.getSelectionGroup () != null && this.b$["jalview.appletgui.TreePanel"].av.getSelectionGroup ().getSize () > 1;
+var e = this.b$["jalview.appletgui.TreePanel"].av.getAlignmentView (d);
+if (!d) {
+a = 0;
+b = this.b$["jalview.appletgui.TreePanel"].av.getAlignment ().getWidth ();
+c = this.b$["jalview.appletgui.TreePanel"].av.getAlignment ().getSequencesArray ();
+} else {
+a = this.b$["jalview.appletgui.TreePanel"].av.getSelectionGroup ().getStartRes ();
+b = this.b$["jalview.appletgui.TreePanel"].av.getSelectionGroup ().getEndRes () + 1;
+c = this.b$["jalview.appletgui.TreePanel"].av.getSelectionGroup ().getSequencesInOrder (this.b$["jalview.appletgui.TreePanel"].av.getAlignment ());
+}var f = jalview.schemes.ResidueProperties.getScoreModel (this.b$["jalview.appletgui.TreePanel"].pwtype);
+if (Clazz_instanceOf (f, jalview.api.analysis.ViewBasedAnalysisI)) {
+try {
+f = f.getClass ().newInstance ();
+(f).configureFromAlignmentView (this.b$["jalview.appletgui.TreePanel"].treeCanvas.ap);
+} catch (q) {
+if (Clazz_exceptionOf (q, Exception)) {
+System.err.println ("Couldn't create a scoremodel instance for " + f.getName ());
+q.printStackTrace ();
+} else {
+throw q;
+}
+}
+this.b$["jalview.appletgui.TreePanel"].tree =  new jalview.analysis.NJTree (c, e, this.b$["jalview.appletgui.TreePanel"].$type, this.b$["jalview.appletgui.TreePanel"].pwtype, f, a, b);
+} else {
+this.b$["jalview.appletgui.TreePanel"].tree =  new jalview.analysis.NJTree (c, e, this.b$["jalview.appletgui.TreePanel"].$type, this.b$["jalview.appletgui.TreePanel"].pwtype, null, a, b);
+}}this.b$["jalview.appletgui.TreePanel"].tree.reCount (this.b$["jalview.appletgui.TreePanel"].tree.getTopNode ());
+this.b$["jalview.appletgui.TreePanel"].tree.findHeight (this.b$["jalview.appletgui.TreePanel"].tree.getTopNode ());
+this.b$["jalview.appletgui.TreePanel"].treeCanvas.setTree (this.b$["jalview.appletgui.TreePanel"].tree);
+if (this.newtree != null) {
+var a = this.newtree.HasDistances () && this.b$["jalview.appletgui.TreePanel"].av.applet.getDefaultParameter ("showTreeDistances", this.newtree.HasDistances ());
+var b = this.newtree.HasBootstrap () && this.b$["jalview.appletgui.TreePanel"].av.applet.getDefaultParameter ("showTreeBootstraps", this.newtree.HasBootstrap ());
+this.b$["jalview.appletgui.TreePanel"].distanceMenu.setState (a);
+this.b$["jalview.appletgui.TreePanel"].bootstrapMenu.setState (b);
+this.b$["jalview.appletgui.TreePanel"].treeCanvas.setShowBootstrap (b);
+this.b$["jalview.appletgui.TreePanel"].treeCanvas.setShowDistances (a);
+this.b$["jalview.appletgui.TreePanel"].treeCanvas.setMarkPlaceholders (this.b$["jalview.appletgui.TreePanel"].av.applet.getDefaultParameter ("showUnlinkedTreeNodes", false));
+}this.b$["jalview.appletgui.TreePanel"].treeCanvas.repaint ();
+this.b$["jalview.appletgui.TreePanel"].av.setCurrentTree (this.b$["jalview.appletgui.TreePanel"].tree);
+});
+c$ = Clazz_p0p ();
+};
+});
+Clazz_declarePackage ("jalview.analysis");
+Clazz_load (["java.util.Vector"], ["jalview.analysis.Cluster", "$.NJTree"], ["jalview.analysis.SequenceIdMatcher", "jalview.datamodel.AlignmentView", "$.CigarArray", "$.NodeTransformI", "$.SeqCigar", "$.Sequence", "$.SequenceI", "$.SequenceNode", "jalview.io.NewickFile", "jalview.schemes.ResidueProperties", "jalview.util.Format", "java.lang.StringBuffer"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.$cluster = null;
+this.sequence = null;
+this.seqData = null;
+this.done = null;
+this.noseqs = 0;
+this.noClus = 0;
+this.distance = null;
+this.mini = 0;
+this.minj = 0;
+this.ri = 0;
+this.rj = 0;
+this.groups = null;
+this.maxdist = null;
+this.top = null;
+this.maxDistValue = 0;
+this.maxheight = 0;
+this.ycount = 0;
+this.node = null;
+this.type = null;
+this.pwtype = null;
+this.found = null;
+this.leaves = null;
+this.hasDistances = true;
+this.hasBootstrap = false;
+this.hasRootDistance = true;
+this._lycount = 0;
+this._lylimit = 0;
+Clazz_instantialize (this, arguments);
+}, jalview.analysis, "NJTree");
+Clazz_prepareFields (c$, function () {
+this.groups =  new java.util.Vector ();
+});
+Clazz_makeConstructor (c$, 
+function (seqs, odata, treefile) {
+this.construct (seqs, treefile);
+if (odata != null) {
+this.seqData = odata;
+}}, "~A,jalview.datamodel.AlignmentView,jalview.io.NewickFile");
+Clazz_makeConstructor (c$, 
+function (seqs, treefile) {
+this.sequence = seqs;
+this.top = treefile.getTree ();
+this.hasDistances = treefile.HasDistances ();
+this.hasBootstrap = treefile.HasBootstrap ();
+this.hasRootDistance = treefile.HasRootDistance ();
+this.maxheight = this.findHeight (this.top);
+var algnIds =  new jalview.analysis.SequenceIdMatcher (seqs);
+var leaves =  new java.util.Vector ();
+this.findLeaves (this.top, leaves);
+var i = 0;
+var namesleft = seqs.length;
+var j;
+var nam;
+var realnam;
+var one2many =  new java.util.Vector ();
+var countOne2Many = 0;
+while (i < leaves.size ()) {
+j = leaves.elementAt (i++);
+realnam = j.getName ();
+nam = null;
+if (namesleft > -1) {
+nam = algnIds.findIdMatch (realnam);
+}if (nam != null) {
+j.setElement (nam);
+if (one2many.contains (nam)) {
+countOne2Many++;
+} else {
+one2many.addElement (nam);
+namesleft--;
+}} else {
+j.setElement ( new jalview.datamodel.Sequence (realnam, "THISISAPLACEHLDER"));
+j.setPlaceholder (true);
+}}
+}, "~A,jalview.io.NewickFile");
+Clazz_makeConstructor (c$, 
+function (sequence, seqData, type, pwtype, sm, start, end) {
+this.sequence = sequence;
+this.node =  new java.util.Vector ();
+this.type = type;
+this.pwtype = pwtype;
+if (seqData != null) {
+this.seqData = seqData;
+} else {
+var seqs =  new Array (sequence.length);
+for (var i = 0; i < sequence.length; i++) {
+seqs[i] =  new jalview.datamodel.SeqCigar (sequence[i], start, end);
+}
+var sdata =  new jalview.datamodel.CigarArray (seqs);
+sdata.addOperation ('M', end - start + 1);
+this.seqData =  new jalview.datamodel.AlignmentView (sdata, start);
+}if (!(type.equals ("NJ"))) {
+type = "AV";
+}if (sm == null && !(pwtype.equals ("PID"))) {
+if (jalview.schemes.ResidueProperties.getScoreMatrix (pwtype) == null) {
+pwtype = "BLOSUM62";
+}}var i = 0;
+this.done =  Clazz_newIntArray (sequence.length, 0);
+while ((i < sequence.length) && (sequence[i] != null)) {
+this.done[i] = 0;
+i++;
+}
+this.noseqs = i++;
+this.distance = this.findDistances (sm);
+this.makeLeaves ();
+this.noClus = this.$cluster.size ();
+this.cluster ();
+}, "~A,jalview.datamodel.AlignmentView,~S,~S,jalview.api.analysis.ScoreModelI,~N,~N");
+Clazz_overrideMethod (c$, "toString", 
+function () {
+var fout =  new jalview.io.NewickFile (this.getTopNode ());
+return fout.print (this.isHasBootstrap (), this.isHasDistances (), this.isHasRootDistance ());
+});
+Clazz_defineMethod (c$, "UpdatePlaceHolders", 
+function (list) {
+var leaves =  new java.util.Vector ();
+this.findLeaves (this.top, leaves);
+var sz = leaves.size ();
+var seqmatcher = null;
+var i = 0;
+while (i < sz) {
+var leaf = leaves.elementAt (i++);
+if (list.contains (leaf.element ())) {
+leaf.setPlaceholder (false);
+} else {
+if (seqmatcher == null) {
+var seqs =  new Array (list.size ());
+for (var j = 0; j < seqs.length; j++) {
+seqs[j] = list.get (j);
+}
+seqmatcher =  new jalview.analysis.SequenceIdMatcher (seqs);
+}var nam = seqmatcher.findIdMatch (leaf.getName ());
+if (nam != null) {
+if (!leaf.isPlaceholder ()) {
+}leaf.setPlaceholder (false);
+leaf.setElement (nam);
+} else {
+if (!leaf.isPlaceholder ()) {
+leaf.setElement ( new jalview.datamodel.Sequence (leaf.getName (), "THISISAPLACEHLDER"));
+}leaf.setPlaceholder (true);
+}}}
+}, "java.util.List");
+Clazz_defineMethod (c$, "renameAssociatedNodes", 
+function () {
+this.applyToNodes (((Clazz_isClassDefined ("jalview.analysis.NJTree$1") ? 0 : jalview.analysis.NJTree.$NJTree$1$ ()), Clazz_innerTypeInstance (jalview.analysis.NJTree$1, this, null)));
+});
+Clazz_defineMethod (c$, "cluster", 
+function () {
+while (this.noClus > 2) {
+if (this.type.equals ("NJ")) {
+this.findMinNJDistance ();
+} else {
+this.findMinDistance ();
+}var c = this.joinClusters (this.mini, this.minj);
+this.done[this.minj] = 1;
+this.$cluster.setElementAt (null, this.minj);
+this.$cluster.setElementAt (c, this.mini);
+this.noClus--;
+}
+var onefound = false;
+var one = -1;
+var two = -1;
+for (var i = 0; i < this.noseqs; i++) {
+if (this.done[i] != 1) {
+if (onefound == false) {
+two = i;
+onefound = true;
+} else {
+one = i;
+}}}
+this.joinClusters (one, two);
+this.top = (this.node.elementAt (one));
+this.reCount (this.top);
+this.findHeight (this.top);
+this.findMaxDist (this.top);
+});
+Clazz_defineMethod (c$, "joinClusters", 
+function (i, j) {
+var dist = this.distance[i][j];
+var noi = (this.$cluster.elementAt (i)).value.length;
+var noj = (this.$cluster.elementAt (j)).value.length;
+var value =  Clazz_newIntArray (noi + noj, 0);
+for (var ii = 0; ii < noi; ii++) {
+value[ii] = (this.$cluster.elementAt (i)).value[ii];
+}
+for (var ii = noi; ii < (noi + noj); ii++) {
+value[ii] = (this.$cluster.elementAt (j)).value[ii - noi];
+}
+var c =  new jalview.analysis.Cluster (value);
+this.ri = this.findr (i, j);
+this.rj = this.findr (j, i);
+if (this.type.equals ("NJ")) {
+this.findClusterNJDistance (i, j);
+} else {
+this.findClusterDistance (i, j);
+}var sn =  new jalview.datamodel.SequenceNode ();
+sn.setLeft ((this.node.elementAt (i)));
+sn.setRight ((this.node.elementAt (j)));
+var tmpi = (this.node.elementAt (i));
+var tmpj = (this.node.elementAt (j));
+if (this.type.equals ("NJ")) {
+this.findNewNJDistances (tmpi, tmpj, dist);
+} else {
+this.findNewDistances (tmpi, tmpj, dist);
+}tmpi.setParent (sn);
+tmpj.setParent (sn);
+this.node.setElementAt (sn, i);
+return c;
+}, "~N,~N");
+Clazz_defineMethod (c$, "findNewNJDistances", 
+function (tmpi, tmpj, dist) {
+tmpi.dist = ((dist + this.ri) - this.rj) / 2;
+tmpj.dist = (dist - tmpi.dist);
+if (tmpi.dist < 0) {
+tmpi.dist = 0;
+}if (tmpj.dist < 0) {
+tmpj.dist = 0;
+}}, "jalview.datamodel.SequenceNode,jalview.datamodel.SequenceNode,~N");
+Clazz_defineMethod (c$, "findNewDistances", 
+function (tmpi, tmpj, dist) {
+var ih = 0;
+var jh = 0;
+var sni = tmpi;
+var snj = tmpj;
+while (sni != null) {
+ih = ih + sni.dist;
+sni = sni.left ();
+}
+while (snj != null) {
+jh = jh + snj.dist;
+snj = snj.left ();
+}
+tmpi.dist = ((dist / 2) - ih);
+tmpj.dist = ((dist / 2) - jh);
+}, "jalview.datamodel.SequenceNode,jalview.datamodel.SequenceNode,~N");
+Clazz_defineMethod (c$, "findClusterDistance", 
+function (i, j) {
+var noi = (this.$cluster.elementAt (i)).value.length;
+var noj = (this.$cluster.elementAt (j)).value.length;
+var newdist =  Clazz_newFloatArray (this.noseqs, 0);
+for (var l = 0; l < this.noseqs; l++) {
+if ((l != i) && (l != j)) {
+newdist[l] = ((this.distance[i][l] * noi) + (this.distance[j][l] * noj)) / (noi + noj);
+} else {
+newdist[l] = 0;
+}}
+for (var ii = 0; ii < this.noseqs; ii++) {
+this.distance[i][ii] = newdist[ii];
+this.distance[ii][i] = newdist[ii];
+}
+}, "~N,~N");
+Clazz_defineMethod (c$, "findClusterNJDistance", 
+function (i, j) {
+var newdist =  Clazz_newFloatArray (this.noseqs, 0);
+for (var l = 0; l < this.noseqs; l++) {
+if ((l != i) && (l != j)) {
+newdist[l] = ((this.distance[i][l] + this.distance[j][l]) - this.distance[i][j]) / 2;
+} else {
+newdist[l] = 0;
+}}
+for (var ii = 0; ii < this.noseqs; ii++) {
+this.distance[i][ii] = newdist[ii];
+this.distance[ii][i] = newdist[ii];
+}
+}, "~N,~N");
+Clazz_defineMethod (c$, "findr", 
+function (i, j) {
+var tmp = 1;
+for (var k = 0; k < this.noseqs; k++) {
+if ((k != i) && (k != j) && (this.done[k] != 1)) {
+tmp = tmp + this.distance[i][k];
+}}
+if (this.noClus > 2) {
+tmp = tmp / (this.noClus - 2);
+}return tmp;
+}, "~N,~N");
+Clazz_defineMethod (c$, "findMinNJDistance", 
+function () {
+var min = 100000;
+for (var i = 0; i < (this.noseqs - 1); i++) {
+for (var j = i + 1; j < this.noseqs; j++) {
+if ((this.done[i] != 1) && (this.done[j] != 1)) {
+var tmp = this.distance[i][j] - (this.findr (i, j) + this.findr (j, i));
+if (tmp < min) {
+this.mini = i;
+this.minj = j;
+min = tmp;
+}}}
+}
+return min;
+});
+Clazz_defineMethod (c$, "findMinDistance", 
+function () {
+var min = 100000;
+for (var i = 0; i < (this.noseqs - 1); i++) {
+for (var j = i + 1; j < this.noseqs; j++) {
+if ((this.done[i] != 1) && (this.done[j] != 1)) {
+if (this.distance[i][j] < min) {
+this.mini = i;
+this.minj = j;
+min = this.distance[i][j];
+}}}
+}
+return min;
+});
+Clazz_defineMethod (c$, "findDistances", 
+function (_pwmatrix) {
+var distance =  Clazz_newFloatArray (this.noseqs, this.noseqs, 0);
+if (_pwmatrix == null) {
+_pwmatrix = jalview.schemes.ResidueProperties.getScoreModel (this.pwtype);
+if (_pwmatrix == null) {
+_pwmatrix = jalview.schemes.ResidueProperties.getScoreMatrix ("BLOSUM62");
+}}distance = _pwmatrix.findDistances (this.seqData);
+return distance;
+}, "jalview.api.analysis.ScoreModelI");
+Clazz_defineMethod (c$, "makeLeaves", 
+function () {
+this.$cluster =  new java.util.Vector ();
+for (var i = 0; i < this.noseqs; i++) {
+var sn =  new jalview.datamodel.SequenceNode ();
+sn.setElement (this.sequence[i]);
+sn.setName (this.sequence[i].getName ());
+this.node.addElement (sn);
+var value =  Clazz_newIntArray (1, 0);
+value[0] = i;
+var c =  new jalview.analysis.Cluster (value);
+this.$cluster.addElement (c);
+}
+});
+Clazz_defineMethod (c$, "findLeaves", 
+function (node, leaves) {
+if (node == null) {
+return leaves;
+}if ((node.left () == null) && (node.right () == null)) {
+leaves.addElement (node);
+return leaves;
+} else {
+this.findLeaves (node.left (), leaves);
+this.findLeaves (node.right (), leaves);
+}return leaves;
+}, "jalview.datamodel.SequenceNode,java.util.Vector");
+Clazz_defineMethod (c$, "findLeaf", 
+function (node, count) {
+this.found = this._findLeaf (node, count);
+return this.found;
+}, "jalview.datamodel.SequenceNode,~N");
+Clazz_defineMethod (c$, "_findLeaf", 
+function (node, count) {
+if (node == null) {
+return null;
+}if (node.ycount == count) {
+this.found = node.element ();
+return this.found;
+} else {
+this._findLeaf (node.left (), count);
+this._findLeaf (node.right (), count);
+}return this.found;
+}, "jalview.datamodel.SequenceNode,~N");
+Clazz_defineMethod (c$, "printNode", 
+function (node) {
+if (node == null) {
+return;
+}if ((node.left () == null) && (node.right () == null)) {
+System.out.println ("Leaf = " + (node.element ()).getName ());
+System.out.println ("Dist " + node.dist);
+System.out.println ("Boot " + node.getBootstrap ());
+} else {
+System.out.println ("Dist " + node.dist);
+this.printNode (node.left ());
+this.printNode (node.right ());
+}}, "jalview.datamodel.SequenceNode");
+Clazz_defineMethod (c$, "findMaxDist", 
+function (node) {
+if (node == null) {
+return;
+}if ((node.left () == null) && (node.right () == null)) {
+var dist = node.dist;
+if (dist > this.maxDistValue) {
+this.maxdist = node;
+this.maxDistValue = dist;
+}} else {
+this.findMaxDist (node.left ());
+this.findMaxDist (node.right ());
+}}, "jalview.datamodel.SequenceNode");
+Clazz_defineMethod (c$, "getGroups", 
+function () {
+return this.groups;
+});
+Clazz_defineMethod (c$, "getMaxHeight", 
+function () {
+return this.maxheight;
+});
+Clazz_defineMethod (c$, "groupNodes", 
+function (node, threshold) {
+if (node == null) {
+return;
+}if ((node.height / this.maxheight) > threshold) {
+this.groups.addElement (node);
+} else {
+this.groupNodes (node.left (), threshold);
+this.groupNodes (node.right (), threshold);
+}}, "jalview.datamodel.SequenceNode,~N");
+Clazz_defineMethod (c$, "findHeight", 
+function (node) {
+if (node == null) {
+return this.maxheight;
+}if ((node.left () == null) && (node.right () == null)) {
+node.height = (node.parent ()).height + node.dist;
+if (node.height > this.maxheight) {
+return node.height;
+} else {
+return this.maxheight;
+}} else {
+if (node.parent () != null) {
+node.height = (node.parent ()).height + node.dist;
+} else {
+this.maxheight = 0;
+node.height = 0.0;
+}this.maxheight = this.findHeight ((node.left ()));
+this.maxheight = this.findHeight ((node.right ()));
+}return this.maxheight;
+}, "jalview.datamodel.SequenceNode");
+Clazz_defineMethod (c$, "reRoot", 
+function () {
+if (this.maxdist != null) {
+this.ycount = 0;
+var tmpdist = this.maxdist.dist;
+var sn =  new jalview.datamodel.SequenceNode ();
+sn.setParent (null);
+var snr = this.maxdist.parent ();
+this.changeDirection (snr, this.maxdist);
+System.out.println ("Printing reversed tree");
+this.printN (snr);
+snr.dist = tmpdist / 2;
+this.maxdist.dist = tmpdist / 2;
+snr.setParent (sn);
+this.maxdist.setParent (sn);
+sn.setRight (snr);
+sn.setLeft (this.maxdist);
+this.top = sn;
+this.ycount = 0;
+this.reCount (this.top);
+this.findHeight (this.top);
+}return this.top;
+});
+Clazz_defineMethod (c$, "hasOriginalSequenceData", 
+function () {
+return this.seqData != null;
+});
+Clazz_defineMethod (c$, "printOriginalSequenceData", 
+function (gapChar) {
+if (this.seqData == null) {
+return null;
+}var sb =  new StringBuffer ();
+var seqdatas = this.seqData.getSequenceStrings (gapChar);
+for (var i = 0; i < seqdatas.length; i++) {
+sb.append ( new jalview.util.Format ("%-15s").form (this.sequence[i].getName ()));
+sb.append (" " + seqdatas[i] + "\n");
+}
+return sb.toString ();
+}, "~S");
+Clazz_defineMethod (c$, "printN", 
+function (node) {
+if (node == null) {
+return;
+}if ((node.left () != null) && (node.right () != null)) {
+this.printN (node.left ());
+this.printN (node.right ());
+} else {
+System.out.println (" name = " + (node.element ()).getName ());
+}System.out.println (" dist = " + node.dist + " " + node.count + " " + node.height);
+}, "jalview.datamodel.SequenceNode");
+Clazz_defineMethod (c$, "reCount", 
+function (node) {
+this.ycount = 0;
+this._lycount = 0;
+this._reCount (node);
+}, "jalview.datamodel.SequenceNode");
+Clazz_defineMethod (c$, "_reCount", 
+function (node) {
+if (node == null) {
+return;
+}this._lycount++;
+if ((node.left () != null) && (node.right () != null)) {
+this._reCount (node.left ());
+this._reCount (node.right ());
+var l = node.left ();
+var r = node.right ();
+node.count = l.count + r.count;
+node.ycount = (l.ycount + r.ycount) / 2;
+} else {
+node.count = 1;
+node.ycount = this.ycount++;
+}this._lycount--;
+}, "jalview.datamodel.SequenceNode");
+Clazz_defineMethod (c$, "swapNodes", 
+function (node) {
+if (node == null) {
+return;
+}var tmp = node.left ();
+node.setLeft (node.right ());
+node.setRight (tmp);
+}, "jalview.datamodel.SequenceNode");
+Clazz_defineMethod (c$, "changeDirection", 
+function (node, dir) {
+if (node == null) {
+return;
+}if (node.parent () !== this.top) {
+this.changeDirection (node.parent (), node);
+var tmp = node.parent ();
+if (dir === node.left ()) {
+node.setParent (dir);
+node.setLeft (tmp);
+} else if (dir === node.right ()) {
+node.setParent (dir);
+node.setRight (tmp);
+}} else {
+if (dir === node.left ()) {
+node.setParent (node.left ());
+if (this.top.left () === node) {
+node.setRight (this.top.right ());
+} else {
+node.setRight (this.top.left ());
+}} else {
+node.setParent (node.right ());
+if (this.top.left () === node) {
+node.setLeft (this.top.right ());
+} else {
+node.setLeft (this.top.left ());
+}}}}, "jalview.datamodel.SequenceNode,jalview.datamodel.SequenceNode");
+Clazz_defineMethod (c$, "getMaxDist", 
+function () {
+return this.maxdist;
+});
+Clazz_defineMethod (c$, "getTopNode", 
+function () {
+return this.top;
+});
+Clazz_defineMethod (c$, "isHasDistances", 
+function () {
+return this.hasDistances;
+});
+Clazz_defineMethod (c$, "isHasBootstrap", 
+function () {
+return this.hasBootstrap;
+});
+Clazz_defineMethod (c$, "isHasRootDistance", 
+function () {
+return this.hasRootDistance;
+});
+Clazz_defineMethod (c$, "applyToNodes", 
+function (nodeTransformI) {
+for (var nodes = this.node.elements (); nodes.hasMoreElements (); nodeTransformI.transform (nodes.nextElement ())) {
+;}
+}, "jalview.datamodel.NodeTransformI");
+c$.$NJTree$1$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_declareAnonymous (jalview.analysis, "NJTree$1", null, jalview.datamodel.NodeTransformI);
+Clazz_defineMethod (c$, "transform", 
+function (node) {
+var el = node.element ();
+if (el != null && Clazz_instanceOf (el, jalview.datamodel.SequenceI)) {
+node.setName ((el).getName ());
+}}, "jalview.datamodel.BinaryNode");
+c$ = Clazz_p0p ();
+};
+c$ = Clazz_decorateAsClass (function () {
+this.value = null;
+Clazz_instantialize (this, arguments);
+}, jalview.analysis, "Cluster");
+Clazz_makeConstructor (c$, 
+function (value) {
+this.value = value;
+}, "~A");
+});
+Clazz_declarePackage ("jalview.datamodel");
+Clazz_declareInterface (jalview.datamodel, "NodeTransformI");
+Clazz_declarePackage ("jalview.appletgui");
+Clazz_load (["awt2swing.Panel", "java.awt.event.MouseListener", "$.MouseMotionListener", "java.util.Hashtable"], "jalview.appletgui.TreeCanvas", ["awt2swing.Util", "jalview.analysis.Conservation", "jalview.appletgui.PaintRefresher", "jalview.datamodel.SequenceGroup", "$.SequenceI", "$.SequenceNode", "jalview.schemes.ColourSchemeProperty", "$.ResidueProperties", "$.UserColourScheme", "jalview.util.Format", "$.MappingUtils", "java.awt.Color", "$.Dimension", "$.Point", "$.Rectangle", "java.util.Vector"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.tree = null;
+this.scrollPane = null;
+this.av = null;
+this.$font = null;
+this.fitToWindow = true;
+this.showDistances = false;
+this.showBootstrap = false;
+this.markPlaceholders = false;
+this.offx = 20;
+this.offy = 0;
+this.threshold = 0;
+this.longestName = null;
+this.labelLength = -1;
+this.nameHash = null;
+this.nodeHash = null;
+this.highlightNode = null;
+this.ap = null;
+Clazz_instantialize (this, arguments);
+}, jalview.appletgui, "TreeCanvas", awt2swing.Panel, [java.awt.event.MouseListener, java.awt.event.MouseMotionListener]);
+Clazz_prepareFields (c$, function () {
+this.nameHash =  new java.util.Hashtable ();
+this.nodeHash =  new java.util.Hashtable ();
+});
+Clazz_makeConstructor (c$, 
+function (ap, scroller) {
+Clazz_superConstructor (this, jalview.appletgui.TreeCanvas, []);
+this.ap = ap;
+this.av = ap.av;
+this.$font = this.av.getFont ();
+this.scrollPane = scroller;
+this.addMouseListener (this);
+this.addMouseMotionListener (this);
+this.setLayout (null);
+jalview.appletgui.PaintRefresher.Register (this, this.av.getSequenceSetId ());
+}, "jalview.appletgui.AlignmentPanel,awt2swing.ScrollPane");
+Clazz_defineMethod (c$, "treeSelectionChanged", 
+function (sequence) {
+var selected = this.av.getSelectionGroup ();
+if (selected == null) {
+selected =  new jalview.datamodel.SequenceGroup ();
+this.av.setSelectionGroup (selected);
+}selected.setEndRes (this.av.getAlignment ().getWidth () - 1);
+selected.addOrRemove (sequence, true);
+}, "jalview.datamodel.SequenceI");
+Clazz_defineMethod (c$, "setTree", 
+function (tree) {
+this.tree = tree;
+tree.findHeight (tree.getTopNode ());
+var leaves = tree.findLeaves (tree.getTopNode (),  new java.util.Vector ());
+var has_placeholders = false;
+this.longestName = "";
+for (var i = 0; i < leaves.size (); i++) {
+var lf = leaves.elementAt (i);
+if (lf.isPlaceholder ()) {
+has_placeholders = true;
+}if (this.longestName.length < (lf.element ()).getName ().length) {
+this.longestName = " * " + (lf.element ()).getName ();
+}}
+this.setMarkPlaceholders (has_placeholders);
+}, "jalview.analysis.NJTree");
+Clazz_defineMethod (c$, "drawNode", 
+function (g, node, chunk, scale, width, offx, offy) {
+if (node == null) {
+return;
+}if (node.left () == null && node.right () == null) {
+var height = node.height;
+var dist = node.dist;
+var xstart = Clazz_floatToInt ((height - dist) * scale) + offx;
+var xend = Clazz_floatToInt (height * scale) + offx;
+var ypos = Clazz_floatToInt (node.ycount * chunk) + offy;
+if (Clazz_instanceOf (node.element (), jalview.datamodel.SequenceI)) {
+var seq = node.element ();
+if (this.av.getSequenceColour (seq) === java.awt.Color.white) {
+g.setColor (java.awt.Color.black);
+} else {
+g.setColor (this.av.getSequenceColour (seq).darker ());
+}} else {
+g.setColor (java.awt.Color.black);
+}g.drawLine (xstart, ypos, xend, ypos);
+var nodeLabel = "";
+if (this.showDistances && node.dist > 0) {
+nodeLabel =  new jalview.util.Format ("%-.2f").formDouble (node.dist);
+}if (this.showBootstrap) {
+var btstrap = node.getBootstrap ();
+if (btstrap > -1) {
+if (this.showDistances) {
+nodeLabel = nodeLabel + " : ";
+}nodeLabel = nodeLabel + String.valueOf (node.getBootstrap ());
+}}if (!nodeLabel.equals ("")) {
+awt2swing.Util.drawString (g, nodeLabel, xstart + 2, ypos - 2);
+}var name = (this.markPlaceholders && node.isPlaceholder ()) ? (" * " + node.getName ()) : node.getName ();
+var fm = g.getFontMetrics (this.$font);
+var charWidth = fm.stringWidth (name) + 3;
+var charHeight = fm.getHeight ();
+var rect =  new java.awt.Rectangle (xend + 10, ypos - charHeight, charWidth, charHeight);
+this.nameHash.put (node.element (), rect);
+var selected = this.av.getSelectionGroup ();
+if (selected != null && selected.getSequences (null).contains (node.element ())) {
+g.setColor (java.awt.Color.gray);
+g.fillRect (xend + 10, ypos - charHeight + 3, charWidth, charHeight);
+g.setColor (java.awt.Color.white);
+}awt2swing.Util.drawString (g, name, xend + 10, ypos);
+g.setColor (java.awt.Color.black);
+} else {
+this.drawNode (g, node.left (), chunk, scale, width, offx, offy);
+this.drawNode (g, node.right (), chunk, scale, width, offx, offy);
+var height = node.height;
+var dist = node.dist;
+var xstart = Clazz_floatToInt ((height - dist) * scale) + offx;
+var xend = Clazz_floatToInt (height * scale) + offx;
+var ypos = Clazz_floatToInt (node.ycount * chunk) + offy;
+g.setColor (node.color.darker ());
+g.drawLine (xstart, ypos, xend, ypos);
+if (node === this.highlightNode) {
+g.fillRect (xend - 3, ypos - 3, 6, 6);
+} else {
+g.fillRect (xend - 2, ypos - 2, 4, 4);
+}var ystart = Clazz_floatToInt ((node.left ()).ycount * chunk) + offy;
+var yend = Clazz_floatToInt ((node.right ()).ycount * chunk) + offy;
+var pos =  new java.awt.Rectangle (xend - 2, ypos - 2, 5, 5);
+this.nodeHash.put (node, pos);
+g.drawLine (Clazz_floatToInt (height * scale) + offx, ystart, Clazz_floatToInt (height * scale) + offx, yend);
+var nodeLabel = "";
+if (this.showDistances && (node.dist > 0)) {
+nodeLabel =  new jalview.util.Format ("%-.2f").formDouble (node.dist);
+}if (this.showBootstrap) {
+var btstrap = node.getBootstrap ();
+if (btstrap > -1) {
+if (this.showDistances) {
+nodeLabel = nodeLabel + " : ";
+}nodeLabel = nodeLabel + String.valueOf (node.getBootstrap ());
+}}if (!nodeLabel.equals ("")) {
+awt2swing.Util.drawString (g, nodeLabel, xstart + 2, ypos - 2);
+}}}, "java.awt.Graphics,jalview.datamodel.SequenceNode,~N,~N,~N,~N,~N");
+Clazz_defineMethod (c$, "findElement", 
+function (x, y) {
+var keys = this.nameHash.keys ();
+while (keys.hasMoreElements ()) {
+var ob = keys.nextElement ();
+var rect = this.nameHash.get (ob);
+if (x >= rect.x && x <= (rect.x + rect.width) && y >= rect.y && y <= (rect.y + rect.height)) {
+return ob;
+}}
+keys = this.nodeHash.keys ();
+while (keys.hasMoreElements ()) {
+var ob = keys.nextElement ();
+var rect = this.nodeHash.get (ob);
+if (x >= rect.x && x <= (rect.x + rect.width) && y >= rect.y && y <= (rect.y + rect.height)) {
+return ob;
+}}
+return null;
+}, "~N,~N");
+Clazz_defineMethod (c$, "pickNodes", 
+function (pickBox) {
+var width = this.getSize ().width;
+var height = this.getSize ().height;
+var top = this.tree.getTopNode ();
+var wscale = (width * .8 - this.offx * 2) / this.tree.getMaxHeight ();
+if (top.count == 0) {
+top.count = (top.left ()).count + (top.right ()).count;
+}var chunk = (height - this.offy) / top.count;
+this.pickNode (pickBox, top, chunk, wscale, width, this.offx, this.offy);
+}, "java.awt.Rectangle");
+Clazz_defineMethod (c$, "pickNode", 
+function (pickBox, node, chunk, scale, width, offx, offy) {
+if (node == null) {
+return;
+}if (node.left () == null && node.right () == null) {
+var height = node.height;
+var xend = Clazz_floatToInt (height * scale) + offx;
+var ypos = Clazz_floatToInt (node.ycount * chunk) + offy;
+if (pickBox.contains ( new java.awt.Point (xend, ypos))) {
+if (Clazz_instanceOf (node.element (), jalview.datamodel.SequenceI)) {
+var seq = node.element ();
+var sg = this.av.getSelectionGroup ();
+if (sg != null) {
+sg.addOrRemove (seq, true);
+}}}} else {
+this.pickNode (pickBox, node.left (), chunk, scale, width, offx, offy);
+this.pickNode (pickBox, node.right (), chunk, scale, width, offx, offy);
+}}, "java.awt.Rectangle,jalview.datamodel.SequenceNode,~N,~N,~N,~N,~N");
+Clazz_defineMethod (c$, "setColor", 
+function (node, c) {
+if (node == null) {
+return;
+}if (node.left () == null && node.right () == null) {
+node.color = c;
+if (Clazz_instanceOf (node.element (), jalview.datamodel.SequenceI)) {
+this.av.setSequenceColour (node.element (), c);
+}} else {
+node.color = c;
+this.setColor (node.left (), c);
+this.setColor (node.right (), c);
+}}, "jalview.datamodel.SequenceNode,java.awt.Color");
+Clazz_overrideMethod (c$, "update", 
+function (g) {
+this.paint (g);
+}, "java.awt.Graphics");
+Clazz_overrideMethod (c$, "paintComponent", 
+function (g) {
+if (this.tree == null) {
+return;
+}if (this.nameHash.size () == 0) {
+this.repaint ();
+}var width = this.scrollPane.getSize ().width;
+var height = this.scrollPane.getSize ().height;
+if (!this.fitToWindow) {
+height = g.getFontMetrics (this.$font).getHeight () * this.nameHash.size ();
+}if (this.getSize ().width > width) {
+this.setSize ( new java.awt.Dimension (width, height));
+this.scrollPane.validate ();
+return;
+}this.setSize ( new java.awt.Dimension (width, height));
+g.setFont (this.$font);
+this.draw (g, width, height);
+this.validate ();
+}, "java.awt.Graphics");
+Clazz_defineMethod (c$, "draw", 
+function (g, width, height) {
+this.offy = this.$font.getSize () + 10;
+g.setColor (java.awt.Color.white);
+g.fillRect (0, 0, width, height);
+this.labelLength = g.getFontMetrics (this.$font).stringWidth (this.longestName) + 20;
+var wscale = (width - this.labelLength - this.offx * 2) / this.tree.getMaxHeight ();
+var top = this.tree.getTopNode ();
+if (top.count == 0) {
+top.count = (top.left ()).count + (top.right ()).count;
+}var chunk = (height - this.offy) / top.count;
+this.drawNode (g, this.tree.getTopNode (), chunk, wscale, width, this.offx, this.offy);
+if (this.threshold != 0) {
+if (this.av.getCurrentTree () === this.tree) {
+g.setColor (java.awt.Color.red);
+} else {
+g.setColor (java.awt.Color.gray);
+}var x = Clazz_floatToInt (this.threshold * (this.getSize ().width - this.labelLength - 2 * this.offx) + this.offx);
+g.drawLine (x, 0, x, this.getSize ().height);
+}}, "java.awt.Graphics,~N,~N");
+Clazz_overrideMethod (c$, "mouseReleased", 
+function (e) {
+}, "java.awt.event.MouseEvent");
+Clazz_overrideMethod (c$, "mouseEntered", 
+function (e) {
+}, "java.awt.event.MouseEvent");
+Clazz_overrideMethod (c$, "mouseExited", 
+function (e) {
+}, "java.awt.event.MouseEvent");
+Clazz_overrideMethod (c$, "mouseClicked", 
+function (evt) {
+if (this.highlightNode != null) {
+if (evt.getClickCount () > 1) {
+this.tree.swapNodes (this.highlightNode);
+this.tree.reCount (this.tree.getTopNode ());
+this.tree.findHeight (this.tree.getTopNode ());
+} else {
+var leaves =  new java.util.Vector ();
+this.tree.findLeaves (this.highlightNode, leaves);
+for (var i = 0; i < leaves.size (); i++) {
+var seq = (leaves.elementAt (i)).element ();
+this.treeSelectionChanged (seq);
+}
+}jalview.appletgui.PaintRefresher.Refresh (this, this.av.getSequenceSetId ());
+this.repaint ();
+this.av.sendSelection ();
+}}, "java.awt.event.MouseEvent");
+Clazz_overrideMethod (c$, "mouseDragged", 
+function (ect) {
+}, "java.awt.event.MouseEvent");
+Clazz_overrideMethod (c$, "mouseMoved", 
+function (evt) {
+this.av.setCurrentTree (this.tree);
+var ob = this.findElement (evt.getX (), evt.getY ());
+if (Clazz_instanceOf (ob, jalview.datamodel.SequenceNode)) {
+this.highlightNode = ob;
+this.repaint ();
+} else {
+if (this.highlightNode != null) {
+this.highlightNode = null;
+this.repaint ();
+}}}, "java.awt.event.MouseEvent");
+Clazz_overrideMethod (c$, "mousePressed", 
+function (e) {
+this.av.setCurrentTree (this.tree);
+var x = e.getX ();
+var y = e.getY ();
+var ob = this.findElement (x, y);
+if (Clazz_instanceOf (ob, jalview.datamodel.SequenceI)) {
+this.treeSelectionChanged (ob);
+jalview.appletgui.PaintRefresher.Refresh (this, this.av.getSequenceSetId ());
+this.repaint ();
+this.av.sendSelection ();
+return;
+} else if (!(Clazz_instanceOf (ob, jalview.datamodel.SequenceNode))) {
+if (this.tree.getMaxHeight () != 0) {
+this.threshold = (x - this.offx) / (this.getSize ().width - this.labelLength - 2 * this.offx);
+this.tree.getGroups ().removeAllElements ();
+this.tree.groupNodes (this.tree.getTopNode (), this.threshold);
+this.setColor (this.tree.getTopNode (), java.awt.Color.black);
+this.av.setSelectionGroup (null);
+this.av.getAlignment ().deleteAllGroups ();
+this.av.clearSequenceColours ();
+var codingComplement = this.av.getCodingComplement ();
+if (codingComplement != null) {
+codingComplement.setSelectionGroup (null);
+codingComplement.getAlignment ().deleteAllGroups ();
+codingComplement.clearSequenceColours ();
+}this.colourGroups ();
+}}jalview.appletgui.PaintRefresher.Refresh (this, this.av.getSequenceSetId ());
+this.repaint ();
+}, "java.awt.event.MouseEvent");
+Clazz_defineMethod (c$, "colourGroups", 
+function () {
+for (var i = 0; i < this.tree.getGroups ().size (); i++) {
+var col =  new java.awt.Color (Clazz_doubleToInt (Math.random () * 255), Clazz_doubleToInt (Math.random () * 255), Clazz_doubleToInt (Math.random () * 255));
+this.setColor (this.tree.getGroups ().elementAt (i), col.brighter ());
+var l = this.tree.findLeaves (this.tree.getGroups ().elementAt (i),  new java.util.Vector ());
+var sequences =  new java.util.Vector ();
+for (var j = 0; j < l.size (); j++) {
+var s1 = (l.elementAt (j)).element ();
+if (!sequences.contains (s1)) {
+sequences.addElement (s1);
+}}
+var cs = null;
+var sg =  new jalview.datamodel.SequenceGroup (sequences, "", cs, true, true, false, 0, this.av.getAlignment ().getWidth () - 1);
+if (this.av.getGlobalColourScheme () != null) {
+if (Clazz_instanceOf (this.av.getGlobalColourScheme (), jalview.schemes.UserColourScheme)) {
+cs =  new jalview.schemes.UserColourScheme ((this.av.getGlobalColourScheme ()).getColours ());
+} else {
+cs = jalview.schemes.ColourSchemeProperty.getColour (sg, jalview.schemes.ColourSchemeProperty.getColourName (this.av.getGlobalColourScheme ()));
+}if (cs != null) {
+cs.setThreshold (this.av.getGlobalColourScheme ().getThreshold (), this.av.isIgnoreGapsConsensus ());
+}}sg.cs = cs;
+sg.setName ("JTreeGroup:" + sg.hashCode ());
+sg.setIdColour (col);
+if (this.av.getGlobalColourScheme () != null && this.av.getGlobalColourScheme ().conservationApplied ()) {
+var c =  new jalview.analysis.Conservation ("Group", jalview.schemes.ResidueProperties.propHash, 3, sg.getSequences (null), sg.getStartRes (), sg.getEndRes ());
+c.calculate ();
+c.verdict (false, this.av.getConsPercGaps ());
+cs.setConservation (c);
+sg.cs = cs;
+}this.av.getAlignment ().addGroup (sg);
+this.av.getAlignment ().addGroup (sg);
+var codingComplement = this.av.getCodingComplement ();
+if (codingComplement != null) {
+var mappedGroup = jalview.util.MappingUtils.mapSequenceGroup (sg, this.av, codingComplement);
+if (mappedGroup.getSequences ().size () > 0) {
+codingComplement.getAlignment ().addGroup (mappedGroup);
+for (var seq, $seq = mappedGroup.getSequences ().iterator (); $seq.hasNext () && ((seq = $seq.next ()) || true);) {
+codingComplement.setSequenceColour (seq, col);
+}
+}}}
+this.ap.updateAnnotation ();
+if (this.av.getCodingComplement () != null) {
+(this.av.getCodingComplement ()).firePropertyChange ("alignment", null, this.ap.av.getAlignment ().getSequences ());
+}});
+Clazz_defineMethod (c$, "setShowDistances", 
+function (state) {
+this.showDistances = state;
+this.repaint ();
+}, "~B");
+Clazz_defineMethod (c$, "setShowBootstrap", 
+function (state) {
+this.showBootstrap = state;
+this.repaint ();
+}, "~B");
+Clazz_defineMethod (c$, "setMarkPlaceholders", 
+function (state) {
+this.markPlaceholders = state;
+this.repaint ();
+}, "~B");
+Clazz_defineStatics (c$,
+"PLACEHOLDER", " * ");
+});
+Clazz_declarePackage ("jalview.commands");
+Clazz_load (["jalview.commands.EditCommand"], "jalview.commands.RemoveGapColCommand", ["jalview.util.Comparison"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.columnsDeleted = 0;
+Clazz_instantialize (this, arguments);
+}, jalview.commands, "RemoveGapColCommand", jalview.commands.EditCommand);
+Clazz_makeConstructor (c$, 
+function (description, seqs, start, end, al) {
+Clazz_superConstructor (this, jalview.commands.RemoveGapColCommand, []);
+this.description = description;
+var j;
+var jSize = seqs.length;
+var startCol = -1;
+var endCol = -1;
+this.columnsDeleted = 0;
+this.clearEdits ();
+var $delete = true;
+for (var i = start; i <= end; i++) {
+$delete = true;
+for (j = 0; j < jSize; j++) {
+if (seqs[j].getLength () > i) {
+if (!jalview.util.Comparison.isGap (seqs[j].getCharAt (i))) {
+if ($delete) {
+endCol = i;
+}$delete = false;
+break;
+}}}
+if ($delete && startCol == -1) {
+startCol = i;
+}if (!$delete && startCol > -1) {
+this.appendEdit (jalview.commands.EditCommand.Action.DELETE_GAP, seqs, startCol - this.columnsDeleted, endCol - startCol, al, false, null);
+this.columnsDeleted += (endCol - startCol);
+startCol = -1;
+endCol = -1;
+}}
+if ($delete && startCol > -1) {
+this.appendEdit (jalview.commands.EditCommand.Action.DELETE_GAP, seqs, startCol - this.columnsDeleted, end - startCol + 1, al, false, null);
+this.columnsDeleted += (end - startCol + 1);
+}this.performEdit (0, null);
+}, "~S,~A,~N,~N,jalview.datamodel.AlignmentI");
+Clazz_overrideMethod (c$, "getSize", 
+function () {
+return this.columnsDeleted;
+});
+});
+Clazz_declarePackage ("jalview.commands");
+Clazz_load (["jalview.commands.EditCommand"], "jalview.commands.RemoveGapsCommand", ["jalview.util.Comparison"], function () {
+c$ = Clazz_declareType (jalview.commands, "RemoveGapsCommand", jalview.commands.EditCommand);
+Clazz_makeConstructor (c$, 
+function (description, seqs, al) {
+Clazz_superConstructor (this, jalview.commands.RemoveGapsCommand, []);
+this.description = description;
+var width = 0;
+for (var i = 0; i < seqs.length; i++) {
+if (seqs[i].getLength () > width) {
+width = seqs[i].getLength ();
+}}
+this.findGaps (seqs, 0, width, al);
+}, "~S,~A,jalview.datamodel.AlignmentI");
+Clazz_makeConstructor (c$, 
+function (description, seqs, start, end, al) {
+Clazz_superConstructor (this, jalview.commands.RemoveGapsCommand, []);
+this.description = description;
+this.findGaps (seqs, start, end, al);
+}, "~S,~A,~N,~N,jalview.datamodel.AlignmentI");
+Clazz_defineMethod (c$, "findGaps", 
+function (seqs, start, end, al) {
+var startCol = -1;
+var endCol = -1;
+var deletedCols = 0;
+var j;
+var jSize;
+this.clearEdits ();
+var $delete = true;
+var sequence;
+for (var s = 0; s < seqs.length; s++) {
+deletedCols = 0;
+startCol = -1;
+endCol = -1;
+sequence = seqs[s].getSequence (start, end + 1);
+jSize = sequence.length;
+for (j = 0; j < jSize; j++) {
+$delete = true;
+if (!jalview.util.Comparison.isGap (sequence[j])) {
+if ($delete) {
+endCol = j;
+}$delete = false;
+}if ($delete && startCol == -1) {
+startCol = j;
+}if (!$delete && startCol > -1) {
+this.appendEdit (jalview.commands.EditCommand.Action.DELETE_GAP,  Clazz_newArray (-1, [seqs[s]]), start + startCol - deletedCols, endCol - startCol, al, false, null);
+deletedCols += (endCol - startCol);
+startCol = -1;
+endCol = -1;
+}}
+if ($delete && startCol > -1) {
+this.appendEdit (jalview.commands.EditCommand.Action.DELETE_GAP,  Clazz_newArray (-1, [seqs[s]]), start + startCol - deletedCols, jSize - startCol, al, false, null);
+}}
+this.performEdit (0, null);
+}, "~A,~N,~N,jalview.datamodel.AlignmentI");
+});
+Clazz_declarePackage ("jalview.commands");
+Clazz_load (["jalview.commands.EditCommand"], "jalview.commands.SlideSequencesCommand", ["jalview.util.Comparison"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.gapsInsertedBegin = false;
+Clazz_instantialize (this, arguments);
+}, jalview.commands, "SlideSequencesCommand", jalview.commands.EditCommand);
+Clazz_makeConstructor (c$, 
+function (description, seqsLeft, seqsRight, slideSize, gapChar) {
+Clazz_superConstructor (this, jalview.commands.SlideSequencesCommand, []);
+this.description = description;
+var lSize = seqsLeft.length;
+this.gapsInsertedBegin = false;
+var i;
+var j;
+for (i = 0; i < lSize; i++) {
+for (j = 0; j < slideSize; j++) {
+if (!jalview.util.Comparison.isGap (seqsLeft[i].getCharAt (j))) {
+this.gapsInsertedBegin = true;
+break;
+}}
+}
+var e = null;
+if (!this.gapsInsertedBegin) {
+e = Clazz_innerTypeInstance (jalview.commands.EditCommand.Edit, this, null, jalview.commands.EditCommand.Action.DELETE_GAP, seqsLeft, 0, slideSize, gapChar);
+this.setEdit (e);
+} else {
+e = Clazz_innerTypeInstance (jalview.commands.EditCommand.Edit, this, null, jalview.commands.EditCommand.Action.INSERT_GAP, seqsRight, 0, slideSize, gapChar);
+this.setEdit (e);
+}jalview.commands.EditCommand.performEdit (e, null);
+}, "~S,~A,~A,~N,~S");
+Clazz_defineMethod (c$, "getGapsInsertedBegin", 
+function () {
+return this.gapsInsertedBegin;
+});
+Clazz_defineMethod (c$, "appendSlideCommand", 
+function (command) {
+var same = false;
+if (command.getEdit (0).seqs.length == this.getEdit (0).seqs.length) {
+same = true;
+for (var i = 0; i < command.getEdit (0).seqs.length; i++) {
+if (this.getEdit (0).seqs[i] !== command.getEdit (0).seqs[i]) {
+same = false;
+}}
+}if (same) {
+command.addEdit (this.getEdit (0));
+}return same;
+}, "jalview.commands.SlideSequencesCommand");
+});
+Clazz_declarePackage ("jalview.commands");
+Clazz_load (["jalview.commands.EditCommand"], "jalview.commands.TrimRegionCommand", null, function () {
+c$ = Clazz_decorateAsClass (function () {
+this.colSel = null;
+this.start = null;
+this.shiftList = null;
+this.selectionGroup = null;
+this.deletedHiddenColumns = null;
+this.columnsDeleted = 0;
+Clazz_instantialize (this, arguments);
+}, jalview.commands, "TrimRegionCommand", jalview.commands.EditCommand);
+Clazz_makeConstructor (c$, 
+function (description, command, seqs, column, al, colSel, selectedRegion) {
+Clazz_superConstructor (this, jalview.commands.TrimRegionCommand, []);
+this.description = description;
+this.selectionGroup = selectedRegion;
+this.colSel = colSel;
+if (command.equalsIgnoreCase (jalview.commands.TrimRegionCommand.TRIM_LEFT)) {
+if (column == 0) {
+return;
+}this.columnsDeleted = column;
+this.setEdit (Clazz_innerTypeInstance (jalview.commands.EditCommand.Edit, this, null, jalview.commands.EditCommand.Action.CUT, seqs, 0, column, al));
+} else if (command.equalsIgnoreCase (jalview.commands.TrimRegionCommand.TRIM_RIGHT)) {
+var width = al.getWidth () - column - 1;
+if (width < 2) {
+return;
+}this.columnsDeleted = width - 1;
+this.setEdit (Clazz_innerTypeInstance (jalview.commands.EditCommand.Edit, this, null, jalview.commands.EditCommand.Action.CUT, seqs, column + 1, width, al));
+}var i;
+var isize = this.getEdit (0).seqs.length;
+this.start =  Clazz_newIntArray (isize, 0);
+for (i = 0; i < isize; i++) {
+this.start[i] = this.getEdit (0).seqs[i].getStart ();
+}
+this.performEdit (0, null);
+}, "~S,~S,~A,~N,jalview.datamodel.AlignmentI,jalview.datamodel.ColumnSelection,jalview.datamodel.SequenceGroup");
+Clazz_defineMethod (c$, "cut", 
+function (command) {
+var column;
+var j;
+var jSize = command.seqs.length;
+for (j = 0; j < jSize; j++) {
+if (command.position == 0) {
+column = command.seqs[j].findPosition (command.number);
+command.seqs[j].setStart (column);
+} else {
+column = command.seqs[j].findPosition (command.position) - 1;
+command.seqs[j].setEnd (column);
+}}
+Clazz_superCall (this, jalview.commands.TrimRegionCommand, "cut", [command, null]);
+if (command.position == 0) {
+this.deletedHiddenColumns = this.colSel.compensateForEdit (0, command.number);
+if (this.selectionGroup != null) {
+this.selectionGroup.adjustForRemoveLeft (command.number);
+}} else {
+this.deletedHiddenColumns = this.colSel.compensateForEdit (command.position, command.number);
+if (this.selectionGroup != null) {
+this.selectionGroup.adjustForRemoveRight (command.position);
+}}}, "jalview.commands.EditCommand.Edit");
+Clazz_defineMethod (c$, "paste", 
+function (command) {
+Clazz_superCall (this, jalview.commands.TrimRegionCommand, "paste", [command, null]);
+var column;
+var j;
+var jSize = command.seqs.length;
+for (j = 0; j < jSize; j++) {
+if (command.position == 0) {
+command.seqs[j].setStart (this.start[j]);
+} else {
+column = command.seqs[j].findPosition (command.number + command.position) - 1;
+command.seqs[j].setEnd (column);
+}}
+if (command.position == 0) {
+this.colSel.compensateForEdit (0, -command.number);
+if (this.selectionGroup != null) {
+this.selectionGroup.adjustForRemoveLeft (-command.number);
+}}if (this.deletedHiddenColumns != null) {
+var region;
+for (var i = 0; i < this.deletedHiddenColumns.size (); i++) {
+region = this.deletedHiddenColumns.get (i);
+this.colSel.hideColumns (region[0], region[1]);
+}
+}}, "jalview.commands.EditCommand.Edit");
+Clazz_overrideMethod (c$, "getSize", 
+function () {
+return this.columnsDeleted;
+});
+Clazz_defineStatics (c$,
+"TRIM_LEFT", "TrimLeft",
+"TRIM_RIGHT", "TrimRight");
+});
+Clazz_declarePackage ("jalview.controller");
+Clazz_load (["jalview.api.AlignViewControllerI"], "jalview.controller.AlignViewController", ["jalview.analysis.AlignmentSorter", "$.Grouping", "jalview.commands.OrderCommand", "jalview.datamodel.ColumnSelection", "jalview.io.FeaturesFile", "jalview.util.MessageManager", "java.awt.Color", "java.util.ArrayList", "$.BitSet"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.viewport = null;
+this.alignPanel = null;
+this.avcg = null;
+Clazz_instantialize (this, arguments);
+}, jalview.controller, "AlignViewController", null, jalview.api.AlignViewControllerI);
+Clazz_overrideMethod (c$, "finalize", 
+function () {
+this.viewport = null;
+this.alignPanel = null;
+this.avcg = null;
+});
+Clazz_makeConstructor (c$, 
+function (alignFrame, viewport, alignPanel) {
+this.avcg = alignFrame;
+this.viewport = viewport;
+this.alignPanel = alignPanel;
+}, "jalview.api.AlignViewControllerGuiI,jalview.api.AlignViewportI,jalview.api.AlignmentViewPanel");
+Clazz_overrideMethod (c$, "setViewportAndAlignmentPanel", 
+function (viewport, alignPanel) {
+this.alignPanel = alignPanel;
+this.viewport = viewport;
+}, "jalview.api.AlignViewportI,jalview.api.AlignmentViewPanel");
+Clazz_overrideMethod (c$, "makeGroupsFromSelection", 
+function () {
+var sg = this.viewport.getSelectionGroup ();
+var cs = this.viewport.getColumnSelection ();
+var gps = null;
+if (sg != null && (cs == null || cs.getSelected () == null || cs.size () == 0)) {
+gps = jalview.analysis.Grouping.makeGroupsFrom (this.viewport.getSequenceSelection (), this.viewport.getAlignmentView (true).getSequenceStrings (this.viewport.getGapCharacter ()), this.viewport.getAlignment ().getGroups ());
+} else {
+if (cs != null) {
+gps = jalview.analysis.Grouping.makeGroupsFromCols ((sg == null) ? this.viewport.getAlignment ().getSequencesArray () : sg.getSequences ().toArray ( new Array (0)), cs, this.viewport.getAlignment ().getGroups ());
+}}if (gps != null) {
+this.viewport.getAlignment ().deleteAllGroups ();
+this.viewport.clearSequenceColours ();
+this.viewport.setSelectionGroup (null);
+for (var g = 0; g < gps.length; g++) {
+gps[g].setshowSequenceLogo (this.viewport.isShowSequenceLogo ());
+this.viewport.getAlignment ().addGroup (gps[g]);
+var col =  new java.awt.Color (Clazz_doubleToInt (Math.random () * 255), Clazz_doubleToInt (Math.random () * 255), Clazz_doubleToInt (Math.random () * 255));
+col = col.brighter ();
+for (var sq, $sq = gps[g].getSequences (null).iterator (); $sq.hasNext () && ((sq = $sq.next ()) || true);) {
+this.viewport.setSequenceColour (sq, col);
+}
+}
+return true;
+}return false;
+});
+Clazz_overrideMethod (c$, "createGroup", 
+function () {
+var sg = this.viewport.getSelectionGroup ();
+if (sg != null) {
+this.viewport.getAlignment ().addGroup (sg);
+return true;
+}return false;
+});
+Clazz_overrideMethod (c$, "unGroup", 
+function () {
+var sg = this.viewport.getSelectionGroup ();
+if (sg != null) {
+this.viewport.getAlignment ().deleteGroup (sg);
+return true;
+}return false;
+});
+Clazz_overrideMethod (c$, "deleteGroups", 
+function () {
+if (this.viewport.getAlignment ().getGroups () != null && this.viewport.getAlignment ().getGroups ().size () > 0) {
+this.viewport.getAlignment ().deleteAllGroups ();
+this.viewport.clearSequenceColours ();
+this.viewport.setSelectionGroup (null);
+return true;
+}return false;
+});
+Clazz_overrideMethod (c$, "markColumnsContainingFeatures", 
+function (invert, extendCurrent, toggle, featureType) {
+var bs =  new java.util.BitSet ();
+var alw;
+var alStart;
+var sqcol = (this.viewport.getSelectionGroup () == null ? this.viewport.getAlignment () : this.viewport.getSelectionGroup ());
+alStart = sqcol.getStartRes ();
+alw = sqcol.getEndRes () + 1;
+var seqs = sqcol.getSequences ();
+var nseq = 0;
+for (var sq, $sq = seqs.iterator (); $sq.hasNext () && ((sq = $sq.next ()) || true);) {
+var tfeat = 0;
+if (sq != null) {
+var sf = sq.getSequenceFeatures ();
+if (sf != null) {
+var ist = sq.findIndex (sq.getStart ());
+var iend = sq.findIndex (sq.getEnd ());
+if (iend < alStart || ist > alw) {
+continue;
+}for (var sfpos, $sfpos = 0, $$sfpos = sf; $sfpos < $$sfpos.length && ((sfpos = $$sfpos[$sfpos]) || true); $sfpos++) {
+if (sfpos != null && (featureType.equals (sfpos.getType ()))) {
+tfeat++;
+var i = sq.findIndex (sfpos.getBegin ());
+var j = sq.findIndex (sfpos.getEnd ());
+if (j < alStart || i > alw) {
+continue;
+}if (i < alStart) {
+i = alStart;
+}if (i < ist) {
+i = ist;
+}if (j > alw) {
+j = alw;
+}for (; i <= j; i++) {
+bs.set (i - 1);
+}
+}}
+}if (tfeat > 0) {
+nseq++;
+}}}
+var cs = this.viewport.getColumnSelection ();
+if (bs.cardinality () > 0 || invert) {
+if (cs == null) {
+cs =  new jalview.datamodel.ColumnSelection ();
+} else {
+if (!extendCurrent) {
+cs.clear ();
+}}if (invert) {
+for (var i = bs.nextClearBit (alStart), ibs = bs.nextSetBit (alStart); i >= alStart && i < (alw); ) {
+if (ibs < 0 || i < ibs) {
+if (toggle && cs.contains (i)) {
+cs.removeElement (i++);
+} else {
+cs.addElement (i++);
+}} else {
+i = bs.nextClearBit (ibs);
+ibs = bs.nextSetBit (i);
+}}
+} else {
+for (var i = bs.nextSetBit (alStart); i >= alStart; i = bs.nextSetBit (i + 1)) {
+if (toggle && cs.contains (i)) {
+cs.removeElement (i);
+} else {
+cs.addElement (i);
+}}
+}this.viewport.setColumnSelection (cs);
+this.alignPanel.paintAlignment (true);
+this.avcg.setStatus (jalview.util.MessageManager.formatMessage ("label.view_controller_toggled_marked",  Clazz_newArray (-1, [(toggle ? jalview.util.MessageManager.getString ("label.toggled") : jalview.util.MessageManager.getString ("label.marked")), (invert ? (Integer.$valueOf ((alw - alStart) - bs.cardinality ()).toString ()) : (Integer.$valueOf (bs.cardinality ()).toString ())), featureType, Integer.$valueOf (nseq).toString ()])));
+return true;
+} else {
+this.avcg.setStatus (jalview.util.MessageManager.formatMessage ("label.no_feature_of_type_found",  Clazz_newArray (-1, [featureType])));
+if (!extendCurrent && cs != null) {
+cs.clear ();
+this.alignPanel.paintAlignment (true);
+}return false;
+}}, "~B,~B,~B,~S");
+Clazz_overrideMethod (c$, "sortAlignmentByFeatureDensity", 
+function (typ) {
+this.sortBy (typ, "Sort by Density", jalview.analysis.AlignmentSorter.FEATURE_DENSITY);
+}, "~A");
+Clazz_defineMethod (c$, "sortBy", 
+function (typ, methodText, method) {
+var fr = this.alignPanel.getFeatureRenderer ();
+if (typ == null) {
+typ = fr == null ? null : fr.getDisplayedFeatureTypes ();
+}var gps = null;
+gps = fr == null ? null : fr.getDisplayedFeatureGroups ();
+if (typ != null) {
+var types =  new java.util.ArrayList ();
+for (var i = 0; i < typ.length; i++) {
+if (typ[i] != null) {
+types.add (typ[i]);
+}typ =  new Array (types.size ());
+types.toArray (typ);
+}
+}if (gps != null) {
+var grps =  new java.util.ArrayList ();
+for (var i = 0; i < gps.length; i++) {
+if (gps[i] != null) {
+grps.add (gps[i]);
+}}
+gps =  new Array (grps.size ());
+grps.toArray (gps);
+}var al = this.viewport.getAlignment ();
+var start;
+var stop;
+var sg = this.viewport.getSelectionGroup ();
+if (sg != null) {
+start = sg.getStartRes ();
+stop = sg.getEndRes ();
+} else {
+start = 0;
+stop = al.getWidth ();
+}var oldOrder = al.getSequencesArray ();
+jalview.analysis.AlignmentSorter.sortByFeature (typ, gps, start, stop, al, method);
+this.avcg.addHistoryItem ( new jalview.commands.OrderCommand (methodText, oldOrder, this.viewport.getAlignment ()));
+this.alignPanel.paintAlignment (true);
+}, "~A,~S,~S");
+Clazz_overrideMethod (c$, "sortAlignmentByFeatureScore", 
+function (typ) {
+this.sortBy (typ, "Sort by Feature Score", jalview.analysis.AlignmentSorter.FEATURE_SCORE);
+}, "~A");
+Clazz_overrideMethod (c$, "parseFeaturesFile", 
+function (file, protocol, relaxedIdMatching) {
+var featuresFile = false;
+try {
+featuresFile =  new jalview.io.FeaturesFile (file, protocol).parse (this.viewport.getAlignment ().getDataset (), this.alignPanel.getFeatureRenderer ().getFeatureColours (), false, relaxedIdMatching);
+} catch (ex) {
+if (Clazz_exceptionOf (ex, Exception)) {
+ex.printStackTrace ();
+} else {
+throw ex;
+}
+}
+if (featuresFile) {
+this.avcg.refreshFeatureUI (true);
+if (this.alignPanel.getFeatureRenderer () != null) {
+this.alignPanel.getFeatureRenderer ().findAllFeatures (true);
+}if (this.avcg.getFeatureSettingsUI () != null) {
+this.avcg.getFeatureSettingsUI ().discoverAllFeatureData ();
+}this.alignPanel.paintAlignment (true);
+}return featuresFile;
+}, "~S,~S,~B");
+});
+Clazz_declarePackage ("jalview.api");
+Clazz_declareInterface (jalview.api, "AlignViewControllerI");
+Clazz_declarePackage ("jalview.analysis");
+Clazz_load (null, "jalview.analysis.Grouping", ["jalview.datamodel.SequenceGroup", "java.lang.StringBuilder", "java.util.ArrayList", "$.HashMap"], function () {
+c$ = Clazz_declareType (jalview.analysis, "Grouping");
+c$.makeGroupsFrom = Clazz_defineMethod (c$, "makeGroupsFrom", 
+function (sequences, selectedChars, list) {
+var gps =  new java.util.HashMap ();
+var width = 0;
+var i;
+var pgroup =  new java.util.HashMap ();
+if (list != null) {
+for (var sg, $sg = list.iterator (); $sg.hasNext () && ((sg = $sg.next ()) || true);) {
+for (var sq, $sq = sg.getSequences (null).iterator (); $sq.hasNext () && ((sq = $sq.next ()) || true);) {
+pgroup.put (sq.toString (), sg);
+}
+}
+}for (i = 0; i < sequences.length; i++) {
+var schar = selectedChars[i];
+var pgp = pgroup.get ((sequences[i]).toString ());
+if (pgp != null) {
+schar = pgp.getName () + ":" + schar;
+}var svec = gps.get (schar);
+if (svec == null) {
+svec =  new java.util.ArrayList ();
+gps.put (schar, svec);
+}if (width < sequences[i].getLength ()) {
+width = sequences[i].getLength ();
+}svec.add (sequences[i]);
+}
+var groups =  new Array (gps.size ());
+i = 0;
+for (var key, $key = gps.keySet ().iterator (); $key.hasNext () && ((key = $key.next ()) || true);) {
+var group =  new jalview.datamodel.SequenceGroup (gps.get (key), "Subseq: " + key, null, true, true, false, 0, width - 1);
+groups[i++] = group;
+}
+gps.clear ();
+pgroup.clear ();
+return groups;
+}, "~A,~A,java.util.List");
+c$.makeGroupsFromCols = Clazz_defineMethod (c$, "makeGroupsFromCols", 
+function (sequences, cs, list) {
+var gps =  new java.util.HashMap ();
+var pgroup =  new java.util.HashMap ();
+if (list != null) {
+for (var sg, $sg = list.iterator (); $sg.hasNext () && ((sg = $sg.next ()) || true);) {
+for (var sq, $sq = sg.getSequences (null).iterator (); $sq.hasNext () && ((sq = $sq.next ()) || true);) {
+pgroup.put (sq.toString (), sg);
+}
+}
+}var spos =  Clazz_newIntArray (cs.getSelected ().size (), 0);
+var width = -1;
+var i = 0;
+for (var pos, $pos = cs.getSelected ().iterator (); $pos.hasNext () && ((pos = $pos.next ()) || true);) {
+spos[i++] = pos.intValue ();
+}
+;for (i = 0; i < sequences.length; i++) {
+var slen = sequences[i].getLength ();
+if (width < slen) {
+width = slen;
+}var pgp = pgroup.get ((sequences[i]).toString ());
+var schar =  new StringBuilder ();
+if (pgp != null) {
+schar.append (pgp.getName () + ":");
+}for (var p, $p = 0, $$p = spos; $p < $$p.length && ((p = $$p[$p]) || true); $p++) {
+if (p >= slen) {
+schar.append ("~");
+} else {
+schar.append (sequences[i].getCharAt (p));
+}}
+var svec = gps.get (schar.toString ());
+if (svec == null) {
+svec =  new java.util.ArrayList ();
+gps.put (schar.toString (), svec);
+}svec.add (sequences[i]);
+}
+var groups =  new Array (gps.size ());
+i = 0;
+for (var key, $key = gps.keySet ().iterator (); $key.hasNext () && ((key = $key.next ()) || true);) {
+var group =  new jalview.datamodel.SequenceGroup (gps.get (key), "Subseq: " + key, null, true, true, false, 0, width - 1);
+groups[i++] = group;
+}
+gps.clear ();
+pgroup.clear ();
+return groups;
+}, "~A,jalview.datamodel.ColumnSelection,java.util.List");
+c$.divideByFeature = Clazz_defineMethod (c$, "divideByFeature", 
+function (featureLabels, groupLabels, start, stop, sequences, exgroups, method) {
+}, "~A,~A,~N,~N,~A,java.util.Vector,~S");
+});
+Clazz_declarePackage ("jalview.io");
+Clazz_load (null, "jalview.io.AlignmentProperties", ["java.lang.StringBuffer"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.alignment = null;
+Clazz_instantialize (this, arguments);
+}, jalview.io, "AlignmentProperties");
+Clazz_makeConstructor (c$, 
+function (alignment) {
+this.alignment = alignment;
+}, "jalview.datamodel.AlignmentI");
+Clazz_defineMethod (c$, "writeProperties", 
+function (sb, html) {
+var nl = html ? "<br>" : System.getProperty ("line.separator");
+var avg = 0;
+var min = 2147483647;
+var max = 0;
+for (var i = 0; i < this.alignment.getHeight (); i++) {
+var size = 1 + this.alignment.getSequenceAt (i).getEnd () - this.alignment.getSequenceAt (i).getStart ();
+avg += size;
+if (size > max) {
+max = size;
+}if (size < min) {
+min = size;
+}}
+avg = avg / this.alignment.getHeight ();
+sb.append (nl);
+sb.append ("Sequences: " + this.alignment.getHeight ());
+sb.append (nl);
+sb.append ("Minimum Sequence Length: " + min);
+sb.append (nl);
+sb.append ("Maximum Sequence Length: " + max);
+sb.append (nl);
+sb.append ("Average Length: " + Clazz_floatToInt (avg));
+if ((this.alignment).alignmentProperties != null) {
+sb.append (nl);
+sb.append (nl);
+if (html) {
+sb.append ("<table border=\"1\">");
+}var props = (this.alignment).alignmentProperties;
+var en = props.keys ();
+while (en.hasMoreElements ()) {
+var key = en.nextElement ().toString ();
+var vals = props.get (key).toString ();
+if (html) {
+var val =  new StringBuffer ();
+var pos = 0;
+var npos;
+do {
+npos = vals.indexOf ("\n", pos);
+if (npos == -1) {
+val.append (vals.substring (pos));
+} else {
+val.append (vals.substring (pos, npos));
+val.append ("<br>");
+}pos = npos + 1;
+} while (npos != -1);
+sb.append ("<tr><td>" + key + "</td><td>" + val + "</td></tr>");
+} else {
+sb.append (nl + key + "\t" + vals);
+}}
+if (html) {
+sb.append ("</table>");
+}}}, "StringBuffer,~B");
+Clazz_defineMethod (c$, "formatAsString", 
+function () {
+return this.formatReport (false);
+});
+Clazz_defineMethod (c$, "formatReport", 
+function (html) {
+var sb =  new StringBuffer ();
+this.writeProperties (sb, html);
+return sb;
+}, "~B");
+Clazz_defineMethod (c$, "formatAsHtml", 
+function () {
+return this.formatReport (true);
+});
+});
+Clazz_declarePackage ("jalview.schemes");
+Clazz_load (null, "jalview.schemes.RNAHelicesColourChooser", ["jalview.schemes.RNAHelicesColour", "java.util.Hashtable", "$.Vector"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.av = null;
+this.ap = null;
+this.oldcs = null;
+this.oldgroupColours = null;
+this.currentAnnotation = null;
+this.adjusting = false;
+Clazz_instantialize (this, arguments);
+}, jalview.schemes, "RNAHelicesColourChooser");
+Clazz_makeConstructor (c$, 
+function (av, ap) {
+this.oldcs = av.getGlobalColourScheme ();
+if (av.getAlignment ().getGroups () != null) {
+this.oldgroupColours =  new java.util.Hashtable ();
+for (var sg, $sg = ap.getAlignment ().getGroups ().iterator (); $sg.hasNext () && ((sg = $sg.next ()) || true);) {
+if (sg.cs != null) {
+this.oldgroupColours.put (sg, sg.cs);
+}}
+}this.av = av;
+this.ap = ap;
+if (Clazz_instanceOf (this.oldcs, jalview.schemes.RNAHelicesColour)) {
+var rhc = this.oldcs;
+}this.adjusting = true;
+var list =  new java.util.Vector ();
+var index = 1;
+for (var i = 0; i < av.getAlignment ().getAlignmentAnnotation ().length; i++) {
+var label = av.getAlignment ().getAlignmentAnnotation ()[i].label;
+if (!list.contains (label)) list.addElement (label);
+ else list.addElement (label + "_" + (index++));
+}
+this.adjusting = false;
+this.changeColour ();
+}, "jalview.api.AlignViewportI,jalview.api.AlignmentViewPanel");
+Clazz_defineMethod (c$, "changeColour", 
+function () {
+if (this.adjusting) {
+return;
+}var rhc = null;
+rhc =  new jalview.schemes.RNAHelicesColour (this.av.getAlignment ());
+this.av.setGlobalColourScheme (rhc);
+if (this.av.getAlignment ().getGroups () != null) {
+for (var sg, $sg = this.ap.getAlignment ().getGroups ().iterator (); $sg.hasNext () && ((sg = $sg.next ()) || true);) {
+if (sg.cs == null) {
+continue;
+}sg.cs =  new jalview.schemes.RNAHelicesColour (sg);
+}
+}this.ap.paintAlignment (false);
+});
+Clazz_defineMethod (c$, "reset", 
+function () {
+this.av.setGlobalColourScheme (this.oldcs);
+if (this.av.getAlignment ().getGroups () != null) {
+for (var sg, $sg = this.ap.getAlignment ().getGroups ().iterator (); $sg.hasNext () && ((sg = $sg.next ()) || true);) {
+sg.cs = this.oldgroupColours.get (sg);
+}
+}});
+Clazz_defineMethod (c$, "annotations_actionPerformed", 
+function (e) {
+this.changeColour ();
+}, "java.awt.event.ActionEvent");
+});
+Clazz_declarePackage ("jalview.schemes");
+Clazz_load (["jalview.schemes.ResidueColourScheme"], "jalview.schemes.RNAInteractionColourScheme", ["jalview.schemes.ResidueProperties", "java.awt.Color"], function () {
+c$ = Clazz_declareType (jalview.schemes, "RNAInteractionColourScheme", jalview.schemes.ResidueColourScheme);
+Clazz_overrideMethod (c$, "findColour", 
+function (c) {
+return this.colors[jalview.schemes.ResidueProperties.nucleotideIndex[c.charCodeAt (0)]];
+}, "~S");
+Clazz_overrideMethod (c$, "findColourSeq", 
+function (c, j, seq) {
+var currentColour;
+if ((this.threshold == 0) || this.aboveThreshold (c, j)) {
+try {
+currentColour = this.colors[jalview.schemes.ResidueProperties.nucleotideIndex[c.charCodeAt (0)]];
+} catch (ex) {
+if (Clazz_exceptionOf (ex, Exception)) {
+return java.awt.Color.white;
+} else {
+throw ex;
+}
+}
+} else {
+return java.awt.Color.white;
+}if (this.conservationColouring) {
+currentColour = this.applyConservation (currentColour, j);
+}return currentColour;
+}, "~S,~N,jalview.datamodel.SequenceI");
+});
+Clazz_declarePackage("java.net");
+c$=Clazz_declareType(java.net,"URLEncoder");
+c$.encode=Clazz_defineMethod(c$,"encode",
+function(s){
+return encodeURIComponent(arguments[0]);
+},"~S");
+c$.encode=Clazz_defineMethod(c$,"encode",
+function(s,enc){
+return encodeURIComponent(arguments[0]);
+},"~S,~S");
+Clazz_defineStatics(c$,
+"digits","0123456789ABCDEF");
+Clazz_declarePackage ("jalview.io");
+Clazz_load (null, "jalview.io.JnetAnnotationMaker", ["jalview.datamodel.AlignmentAnnotation", "$.Annotation", "jalview.util.MessageManager", "java.lang.Exception", "$.Float"], function () {
+c$ = Clazz_declareType (jalview.io, "JnetAnnotationMaker");
+c$.add_annotation = Clazz_defineMethod (c$, "add_annotation", 
+function (prediction, al, firstSeq, noMsa) {
+jalview.io.JnetAnnotationMaker.add_annotation (prediction, al, firstSeq, noMsa, Clazz_castNullAs ("Array"));
+}, "jalview.io.AlignFile,jalview.datamodel.AlignmentI,~N,~B");
+c$.add_annotation = Clazz_defineMethod (c$, "add_annotation", 
+function (prediction, al, firstSeq, noMsa, delMap) {
+var i = 0;
+var preds = prediction.getSeqsAsArray ();
+var seqRef = al.getSequenceAt (firstSeq);
+var width = preds[0].getSequence ().length;
+var gapmap = al.getSequenceAt (firstSeq).gapMap ();
+if ((delMap != null && delMap.length > width) || (delMap == null && gapmap.length != width)) {
+throw ( new Exception (jalview.util.MessageManager.formatMessage ("exception.number_of_residues_in_query_sequence_differ_from_prediction",  Clazz_newArray (-1, [(delMap == null ? "" : jalview.util.MessageManager.getString ("label.mapped")), al.getSequenceAt (firstSeq).getName (), al.getSequenceAt (firstSeq).getSequenceAsString (), Integer.$valueOf (width).toString ()]))));
+}var annot;
+var annotations = null;
+var existingAnnotations = 0;
+if (al.getAlignmentAnnotation () != null) {
+existingAnnotations = al.getAlignmentAnnotation ().length;
+}var sol =  new Array (al.getWidth ());
+var firstsol = true;
+while (i < preds.length) {
+var id = preds[i].getName ().toUpperCase ();
+if (id.startsWith ("LUPAS") || id.startsWith ("JNET") || id.startsWith ("JPRED")) {
+if (id.startsWith ("JNETSOL")) {
+var amnt = (id.endsWith ("25") ? 3 : id.endsWith ("5") ? 6 : 9);
+for (var spos = 0; spos < width; spos++) {
+var sposw = (delMap == null) ? gapmap[spos] : gapmap[delMap[spos]];
+if (firstsol) {
+sol[sposw] =  new jalview.datamodel.Annotation (0);
+}if (preds[i].getCharAt (spos) == 'B' && (sol[sposw].value == 0 || sol[sposw].value < amnt)) {
+sol[sposw].value = amnt;
+}}
+firstsol = false;
+} else {
+annotations =  new Array (al.getWidth ());
+if (id.equals ("JNETPRED") || id.equals ("JNETPSSM") || id.equals ("JNETFREQ") || id.equals ("JNETHMM") || id.equals ("JNETALIGN") || id.equals ("JPRED")) {
+if (delMap == null) {
+for (var j = 0; j < width; j++) {
+annotations[gapmap[j]] =  new jalview.datamodel.Annotation ("", "", preds[i].getCharAt (j), 0);
+}
+} else {
+for (var j = 0; j < width; j++) {
+annotations[gapmap[delMap[j]]] =  new jalview.datamodel.Annotation ("", "", preds[i].getCharAt (j), 0);
+}
+}} else if (id.equals ("JNETCONF")) {
+if (delMap == null) {
+for (var j = 0; j < width; j++) {
+var value =  new Float (preds[i].getCharAt (j) + "").floatValue ();
+annotations[gapmap[j]] =  new jalview.datamodel.Annotation (preds[i].getCharAt (j) + "", "", preds[i].getCharAt (j), value);
+}
+} else {
+for (var j = 0; j < width; j++) {
+var value =  new Float (preds[i].getCharAt (j) + "").floatValue ();
+annotations[gapmap[delMap[j]]] =  new jalview.datamodel.Annotation (preds[i].getCharAt (j) + "", "", preds[i].getCharAt (j), value);
+}
+}} else {
+if (delMap == null) {
+for (var j = 0; j < width; j++) {
+annotations[gapmap[j]] =  new jalview.datamodel.Annotation (preds[i].getCharAt (j) + "", "", ' ', 0);
+}
+} else {
+for (var j = 0; j < width; j++) {
+annotations[gapmap[delMap[j]]] =  new jalview.datamodel.Annotation (preds[i].getCharAt (j) + "", "", ' ', 0);
+}
+}}if (id.equals ("JNETCONF")) {
+annot =  new jalview.datamodel.AlignmentAnnotation (preds[i].getName (), "JNet Output", annotations, 0, 10, 1);
+} else {
+annot =  new jalview.datamodel.AlignmentAnnotation (preds[i].getName (), "JNet Output", annotations);
+}if (seqRef != null) {
+annot.createSequenceMapping (seqRef, 1, true);
+seqRef.addAlignmentAnnotation (annot);
+}al.addAnnotation (annot);
+al.setAnnotationIndex (annot, al.getAlignmentAnnotation ().length - existingAnnotations - 1);
+}if (noMsa) {
+al.deleteSequence (preds[i]);
+}}i++;
+}
+if (!firstsol) {
+annot =  new jalview.datamodel.AlignmentAnnotation ("Jnet Burial", "<html>Prediction of Solvent Accessibility<br/>levels are<ul><li>0 - Exposed</li><li>3 - 25% or more S.A. accessible</li><li>6 - 5% or more S.A. accessible</li><li>9 - Buried (<5% exposed)</li></ul>", sol, 0, 9, 1);
+annot.validateRangeAndDisplay ();
+if (seqRef != null) {
+annot.createSequenceMapping (seqRef, 1, true);
+seqRef.addAlignmentAnnotation (annot);
+}al.addAnnotation (annot);
+al.setAnnotationIndex (annot, al.getAlignmentAnnotation ().length - existingAnnotations - 1);
+}}, "jalview.io.AlignFile,jalview.datamodel.AlignmentI,~N,~B,~A");
+});
+Clazz_declarePackage ("jalview.javascript");
+Clazz_load (null, "jalview.javascript.JSFunctionExec", ["jalview.bin.JalviewLite", "java.lang.StringBuffer", "$.Thread", "java.net.MalformedURLException", "$.URL", "netscape.javascript.JSException", "$.JSObject"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.jvlite = null;
+this.jsExecQueue = null;
+this.executor = null;
+Clazz_instantialize (this, arguments);
+}, jalview.javascript, "JSFunctionExec", null, Runnable);
+Clazz_makeConstructor (c$, 
+function (applet) {
+this.jvlite = applet;
+this.jsExecQueue = this.jvlite.getJsExecQueue ();
+this.jvlite.setExecutor (this);
+}, "jalview.bin.JalviewLite");
+Clazz_overrideMethod (c$, "finalize", 
+function () {
+this.jvlite = null;
+this.executor = null;
+if (this.jsExecQueue != null) {
+this.jsExecQueue.clear ();
+}this.jsExecQueue = null;
+});
+Clazz_defineMethod (c$, "stopQueue", 
+function () {
+if (this.jsExecQueue != null) {
+var q = null;
+{
+q = this.jsExecQueue;
+this.jsExecQueue = null;
+}if (q != null) {
+for (var jx, $jx = q.iterator (); $jx.hasNext () && ((jx = $jx.next ()) || true);) {
+jx.jvlite = null;
+}
+q.removeAllElements ();
+{
+q.notifyAll ();
+}}}this.jvlite = null;
+this.executor = null;
+});
+Clazz_defineMethod (c$, "run", 
+function () {
+while (this.jsExecQueue != null) {
+if (this.jsExecQueue.size () > 0) {
+var r = this.jsExecQueue.elementAt (0);
+this.jsExecQueue.removeElementAt (0);
+try {
+r.run ();
+} catch (e$$) {
+if (Clazz_exceptionOf (e$$, Exception)) {
+var ex = e$$;
+{
+ex.printStackTrace ();
+}
+} else if (Clazz_exceptionOf (e$$, Error)) {
+var ex = e$$;
+{
+ex.printStackTrace ();
+}
+} else {
+throw e$$;
+}
+}
+} else {
+try {
+{
+this.jsExecQueue.wait (1000);
+}} catch (ex) {
+if (Clazz_exceptionOf (ex, Exception)) {
+} else {
+throw ex;
+}
+}
+;}}
+});
+Clazz_defineMethod (c$, "executeJavascriptFunction", 
+function (_listener, objects) {
+this.executeJavascriptFunction (false, _listener, objects);
+}, "~S,~A");
+Clazz_defineMethod (c$, "executeJavascriptFunction", 
+function (async, _listener, $arguments) {
+this.executeJavascriptFunction (async, _listener, $arguments, null);
+}, "~B,~S,~A");
+Clazz_defineMethod (c$, "executeJavascriptFunction", 
+function (async, _listener, $arguments, dbgMsg) {
+var objects =  new Array ($arguments != null ? $arguments.length : 0);
+if ($arguments != null) {
+System.arraycopy ($arguments, 0, objects, 0, $arguments.length);
+}var jsex =  new Array (1);
+var exec = ((Clazz_isClassDefined ("jalview.javascript.JSFunctionExec$1") ? 0 : jalview.javascript.JSFunctionExec.$JSFunctionExec$1$ ()), Clazz_innerTypeInstance (jalview.javascript.JSFunctionExec$1, this, Clazz_cloneFinals ("dbgMsg", dbgMsg, "_listener", _listener, "objects", objects, "jsex", jsex, "async", async)));
+if (async) {
+if (this.executor == null) {
+this.executor =  new Thread ( new jalview.javascript.JSFunctionExec (this.jvlite));
+this.executor.start ();
+}{
+this.jsExecQueue.addElement (exec);
+this.jsExecQueue.notify ();
+}} else {
+exec.run ();
+if (jsex[0] != null) {
+throw (jsex[0]);
+}}}, "~B,~S,~A,~S");
+c$.$JSFunctionExec$1$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_declareAnonymous (jalview.javascript, "JSFunctionExec$1", null, Runnable);
+Clazz_defineMethod (c$, "run", 
+function () {
+try {
+var scriptObject = null;
+try {
+scriptObject = netscape.javascript.JSObject.getWindow (this.b$["jalview.javascript.JSFunctionExec"].jvlite);
+} catch (ex) {
+if (Clazz_exceptionOf (ex, Exception)) {
+} else {
+throw ex;
+}
+}
+;if (scriptObject != null) {
+if (jalview.bin.JalviewLite.debug && this.f$.dbgMsg != null) {
+System.err.println (this.f$.dbgMsg);
+}scriptObject.call (this.f$._listener, this.f$.objects);
+}} catch (jex) {
+if (Clazz_exceptionOf (jex, Exception)) {
+if (!(Clazz_instanceOf (jex, java.net.MalformedURLException))) {
+if (jalview.bin.JalviewLite.debug) {
+System.err.println (jex);
+}if (Clazz_instanceOf (jex, netscape.javascript.JSException) && this.b$["jalview.javascript.JSFunctionExec"].jvlite.jsfallbackEnabled) {
+this.f$.jsex[0] = jex;
+if (jalview.bin.JalviewLite.debug) {
+System.err.println ("Falling back to javascript: url call");
+}var sb =  new StringBuffer ("javascript:" + this.f$._listener + "(");
+for (var i = 0; this.f$.objects != null && i < this.f$.objects.length; i++) {
+if (i > 0) {
+sb.append (",");
+}sb.append ("\"");
+if (this.f$.objects[i] != null && !(this.f$.objects[i].getClass ().getName ().indexOf ("jalview") == 0)) {
+sb.append (this.f$.objects[i].toString ());
+}sb.append ("\"");
+}
+sb.append (")");
+if (jalview.bin.JalviewLite.debug) {
+System.err.println (sb.toString ());
+}var url = null;
+try {
+url =  new java.net.URL (sb.toString ());
+this.b$["jalview.javascript.JSFunctionExec"].jvlite.getAppletContext ().showDocument (url);
+jex = null;
+} catch (uex) {
+if (Clazz_exceptionOf (uex, Exception)) {
+jex = uex;
+} else {
+throw uex;
+}
+}
+}if (jex != null) {
+if (this.f$.async) {
+jex.printStackTrace ();
+} else {
+this.f$.jsex[0] = jex;
+}};}} else {
+throw jex;
+}
+}
+});
+c$ = Clazz_p0p ();
+};
+});
+Clazz_declarePackage ("netscape.javascript");
+Clazz_load (["java.lang.Exception"], "netscape.javascript.JSException", null, function () {
+c$ = Clazz_declareType (netscape.javascript, "JSException", Exception);
+});
+Clazz_declarePackage ("netscape.javascript");
+c$ = Clazz_declareType (netscape.javascript, "JSObject");
+c$.getWindow = Clazz_defineMethod (c$, "getWindow", 
+function (jvlite) {
+{
+return window;
+}}, "jalview.bin.JalviewLite");
+Clazz_defineMethod (c$, "call", 
+function (func, params) {
+{
+alert("call " + func);
+func.apply(null, params);
+}}, "~S,~A");
+Clazz_defineMethod (c$, "eval", 
+function (string) {
+{
+alert("evval " + string);
+}return this.eval (string);
+}, "~S");
+Clazz_declarePackage ("jalview.javascript");
+Clazz_load (["jalview.javascript.JSFunctionExec", "$.JsCallBack", "jalview.structure.SelectionListener"], "jalview.javascript.JsSelectionSender", ["jalview.appletgui.AlignViewport", "netscape.javascript.JSException"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this._af = null;
+this._listener = null;
+Clazz_instantialize (this, arguments);
+}, jalview.javascript, "JsSelectionSender", jalview.javascript.JSFunctionExec, [jalview.structure.SelectionListener, jalview.javascript.JsCallBack]);
+Clazz_makeConstructor (c$, 
+function (jvlite, af, listener) {
+Clazz_superConstructor (this, jalview.javascript.JsSelectionSender, [jvlite]);
+this._af = af;
+this._listener = listener;
+}, "jalview.bin.JalviewLite,jalview.appletgui.AlignFrame,~S");
+Clazz_overrideMethod (c$, "selection", 
+function (seqsel, colsel, source) {
+try {
+var setid = "";
+var viewid = "";
+var src = this._af;
+if (source != null) {
+if (Clazz_instanceOf (source, jalview.appletgui.AlignViewport) && (source).applet.currentAlignFrame.viewport === source) {
+src = (source).applet.currentAlignFrame;
+}}var seqs =  Clazz_newArray (-1, []);
+var cols =  Clazz_newArray (-1, []);
+var strt = 0;
+var end = (src == null) ? -1 : src.alignPanel.av.getAlignment ().getWidth ();
+if (seqsel != null && seqsel.getSize () > 0) {
+seqs =  new Array (seqsel.getSize ());
+for (var i = 0; i < seqs.length; i++) {
+seqs[i] = seqsel.getSequenceAt (i).getName ();
+}
+if (strt < seqsel.getStartRes ()) {
+strt = seqsel.getStartRes ();
+}if (end == -1 || end > seqsel.getEndRes ()) {
+end = seqsel.getEndRes ();
+}}if (colsel != null && colsel.size () > 0) {
+if (end == -1) {
+end = colsel.getMax () + 1;
+}cols =  new Array (colsel.getSelected ().size ());
+var d = 0;
+var r = -1;
+for (var i = 0; i < cols.length; i++) {
+cols[i] = "" + (1 + colsel.getSelected ().elementAt (i).intValue ());
+}
+} else {
+if (seqsel != null && seqsel.getSize () > 0) {
+cols =  new Array (2);
+cols[0] = "" + (1 + strt) + "-" + (1 + end);
+};}System.err.println ("Relaying selection to jsfunction:" + this._listener);
+this.executeJavascriptFunction (this._listener,  Clazz_newArray (-1, [src, setid, this.jvlite.arrayToSeparatorList (seqs), this.jvlite.arrayToSeparatorList (cols)]));
+} catch (ex) {
+if (Clazz_exceptionOf (ex, Exception)) {
+System.err.println ("Jalview Javascript exec error: Couldn't send selection message using function '" + this._listener + "'");
+ex.printStackTrace ();
+if (Clazz_instanceOf (ex, netscape.javascript.JSException)) {
+System.err.println ("Javascript Exception: " + (ex).getCause ().toString ());
+}} else {
+throw ex;
+}
+}
+}, "jalview.datamodel.SequenceGroup,jalview.datamodel.ColumnSelection,jalview.structure.SelectionSource");
+Clazz_overrideMethod (c$, "getAlignFrame", 
+function () {
+return this._af;
+});
+Clazz_overrideMethod (c$, "getListenerFunction", 
+function () {
+return this._listener;
+});
+});
+Clazz_declarePackage ("jalview.javascript");
+Clazz_declareInterface (jalview.javascript, "JsCallBack");
+Clazz_declarePackage ("jalview.javascript");
+Clazz_load (["jalview.javascript.JSFunctionExec", "$.JsCallBack", "jalview.structure.VamsasListener"], "jalview.javascript.MouseOverListener", ["jalview.appletgui.AlignViewport", "netscape.javascript.JSException"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this._af = null;
+this._listener = null;
+this.last = null;
+this.i = -1;
+Clazz_instantialize (this, arguments);
+}, jalview.javascript, "MouseOverListener", jalview.javascript.JSFunctionExec, [jalview.structure.VamsasListener, jalview.javascript.JsCallBack]);
+Clazz_overrideMethod (c$, "mouseOverSequence", 
+function (seq, index, source) {
+if (seq !== this.last || this.i != index) {
+this.last = seq;
+this.i = index;
+var src = null;
+try {
+if (source != null) {
+if (Clazz_instanceOf (source, jalview.appletgui.AlignViewport) && (source).applet.currentAlignFrame.viewport === source) {
+src = (source).applet.currentAlignFrame;
+}}this.executeJavascriptFunction (this._listener,  Clazz_newArray (-1, [src, seq.getDisplayId (false), "" + (1 + this.i), "" + seq.findPosition (this.i)]));
+} catch (ex) {
+if (Clazz_exceptionOf (ex, Exception)) {
+System.err.println ("JalviewLite javascript error: Couldn't send mouseOver with handler '" + this._listener + "'");
+if (Clazz_instanceOf (ex, netscape.javascript.JSException)) {
+System.err.println ("Javascript Exception: " + (ex).getMessage ());
+}ex.printStackTrace ();
+} else {
+throw ex;
+}
+}
+}}, "jalview.datamodel.SequenceI,~N,jalview.structure.VamsasSource");
+Clazz_makeConstructor (c$, 
+function (applet, af, listener) {
+Clazz_superConstructor (this, jalview.javascript.MouseOverListener, [applet]);
+this._af = af;
+this._listener = listener;
+}, "jalview.bin.JalviewLite,jalview.appletgui.AlignFrame,~S");
+Clazz_overrideMethod (c$, "getAlignFrame", 
+function () {
+return this._af;
+});
+Clazz_overrideMethod (c$, "getListenerFunction", 
+function () {
+return this._listener;
+});
+});
+Clazz_declarePackage ("jalview.javascript");
+Clazz_load (["jalview.javascript.JSFunctionExec", "$.JsCallBack", "jalview.structure.StructureListener"], "jalview.javascript.MouseOverStructureListener", ["jalview.api.AlignmentViewPanel", "jalview.appletgui.FeatureRenderer", "jalview.ext.jmol.JmolCommands", "jalview.structure.StructureSelectionManager", "java.net.URL", "java.util.ArrayList"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this._listenerfn = null;
+this.modelSet = null;
+Clazz_instantialize (this, arguments);
+}, jalview.javascript, "MouseOverStructureListener", jalview.javascript.JSFunctionExec, [jalview.javascript.JsCallBack, jalview.structure.StructureListener]);
+Clazz_makeConstructor (c$, 
+function (jalviewLite, listener, modelList) {
+Clazz_superConstructor (this, jalview.javascript.MouseOverStructureListener, [jalviewLite]);
+this._listenerfn = listener;
+this.modelSet = modelList;
+if (this.modelSet != null) {
+for (var i = 0; i < this.modelSet.length; i++) {
+try {
+if ( new java.net.URL (this.modelSet[i]).openConnection () != null) {
+continue;
+}} catch (x) {
+if (Clazz_exceptionOf (x, Exception)) {
+} else {
+throw x;
+}
+}
+;try {
+var db = this.jvlite.getDocumentBase ().toString ();
+db = db.substring (0, db.lastIndexOf ("/"));
+if ( new java.net.URL (db + "/" + this.modelSet[i]).openConnection () != null) {
+this.modelSet[i] = db + "/" + this.modelSet[i];
+continue;
+}} catch (x) {
+if (Clazz_exceptionOf (x, Exception)) {
+} else {
+throw x;
+}
+}
+;try {
+if ( new java.net.URL (this.jvlite.getCodeBase () + this.modelSet[i]).openConnection () != null) {
+this.modelSet[i] = this.jvlite.getCodeBase () + this.modelSet[i];
+continue;
+}} catch (x) {
+if (Clazz_exceptionOf (x, Exception)) {
+} else {
+throw x;
+}
+}
+;}
+}}, "jalview.bin.JalviewLite,~S,~A");
+Clazz_overrideMethod (c$, "getPdbFile", 
+function () {
+return this.modelSet;
+});
+Clazz_defineMethod (c$, "mouseOverStructure", 
+function (atomIndex, strInfo) {
+}, "~N,~S");
+Clazz_overrideMethod (c$, "highlightAtoms", 
+function (atoms) {
+for (var atom, $atom = atoms.iterator (); $atom.hasNext () && ((atom = $atom.next ()) || true);) {
+try {
+this.executeJavascriptFunction (this._listenerfn,  Clazz_newArray (-1, ["mouseover", "" + atom.getPdbFile (), "" + atom.getChain (), "" + (atom.getPdbResNum ()), "" + atom.getAtomIndex ()]));
+} catch (ex) {
+if (Clazz_exceptionOf (ex, Exception)) {
+System.err.println ("Couldn't execute callback with " + this._listenerfn + " for atomSpec: " + atom);
+ex.printStackTrace ();
+} else {
+throw ex;
+}
+}
+}
+}, "java.util.List");
+Clazz_overrideMethod (c$, "updateColours", 
+function (srce) {
+var source = srce;
+var ssm = jalview.structure.StructureSelectionManager.getStructureSelectionManager (this.jvlite);
+if (Clazz_instanceOf (source, jalview.api.AlignmentViewPanel)) {
+var sequence =  new Array (this.modelSet.length);
+for (var m = 0; m < this.modelSet.length; m++) {
+var sm = ssm.getMapping (this.modelSet[m]);
+if (sm != null && sm.length > 0) {
+sequence[m] =  new Array (sm.length);
+for (var i = 0; i < sm.length; i++) {
+sequence[m][i] = sm[i].getSequence ();
+}
+} else {
+sequence[m] =  new Array (0);
+}}
+var sr = (source).getSequenceRenderer ();
+var fr = (source).av.isShowSequenceFeatures () ?  new jalview.appletgui.FeatureRenderer ((source).av) : null;
+if (fr != null) {
+(fr).transferSettings ((source).getFeatureRenderer ());
+};var ccomands =  new java.util.ArrayList ();
+var pdbfn =  new java.util.ArrayList ();
+var colcommands = jalview.ext.jmol.JmolCommands.getColourBySequenceCommand (ssm, this.modelSet, sequence, sr, fr, (source).getAlignment ());
+if (colcommands == null) {
+return;
+}var sz = 0;
+for (var ccset, $ccset = 0, $$ccset = colcommands; $ccset < $$ccset.length && ((ccset = $$ccset[$ccset]) || true); $ccset++) {
+sz += ccset.commands.length;
+ccomands.add (ccset.commands);
+pdbfn.add (ccset.mapping);
+}
+var mclass;
+var mhandle;
+var ccomandset =  new Array (sz);
+sz = 0;
+for (var ccset, $ccset = ccomands.iterator (); $ccset.hasNext () && ((ccset = $ccset.next ()) || true);) {
+System.arraycopy (ccset, 0, ccomandset, sz, ccset.length);
+sz += ccset.length;
+}
+if (this.jvlite.isJsMessageSetChanged (mclass = "colourstruct", mhandle = (source).av.getViewId (), ccomandset)) {
+this.jvlite.setJsMessageSet (mclass, mhandle, ccomandset);
+var st =  Clazz_newArray (-1, ["colourstruct", "" + (source).av.getViewId (), "" + ccomandset.length, this.jvlite.arrayToSeparatorList (pdbfn.toArray ( new Array (pdbfn.size ())))]);
+try {
+this.executeJavascriptFunction (true, this._listenerfn, st);
+} catch (ex) {
+if (Clazz_exceptionOf (ex, Exception)) {
+System.err.println ("Couldn't execute callback with " + this._listenerfn + " using args { " + st[0] + ", " + st[1] + ", " + st[2] + "," + st[3] + "}");
+ex.printStackTrace ();
+} else {
+throw ex;
+}
+}
+}}}, "~O");
+Clazz_overrideMethod (c$, "getAlignFrame", 
+function () {
+return null;
+});
+Clazz_overrideMethod (c$, "getListenerFunction", 
+function () {
+return this._listenerfn;
+});
+Clazz_defineMethod (c$, "finalise", 
+function () {
+this.jvlite = null;
+Clazz_superCall (this, jalview.javascript.MouseOverStructureListener, "finalize", []);
+});
+Clazz_overrideMethod (c$, "releaseReferences", 
+function (svl) {
+}, "~O");
+Clazz_overrideMethod (c$, "isListeningFor", 
+function (seq) {
+return true;
+}, "jalview.datamodel.SequenceI");
+});
+Clazz_declarePackage ("jalview.ext.jmol");
+Clazz_load (null, "jalview.ext.jmol.JmolCommands", ["jalview.structure.StructureMappingcommandSet", "jalview.util.Comparison", "java.lang.StringBuffer", "java.util.ArrayList"], function () {
+c$ = Clazz_declareType (jalview.ext.jmol, "JmolCommands");
+c$.getColourBySequenceCommand = Clazz_defineMethod (c$, "getColourBySequenceCommand", 
+function (ssm, files, sequence, sr, fr, alignment) {
+var cset =  new java.util.ArrayList ();
+for (var pdbfnum = 0; pdbfnum < files.length; pdbfnum++) {
+var mapping = ssm.getMapping (files[pdbfnum]);
+var command =  new StringBuffer ();
+var smc;
+var str =  new java.util.ArrayList ();
+if (mapping == null || mapping.length < 1) {
+continue;
+}var lastPos = -1;
+for (var s = 0; s < sequence[pdbfnum].length; s++) {
+for (var sp, m = 0; m < mapping.length; m++) {
+if (mapping[m].getSequence () === sequence[pdbfnum][s] && (sp = alignment.findIndex (sequence[pdbfnum][s])) > -1) {
+var asp = alignment.getSequenceAt (sp);
+for (var r = 0; r < asp.getLength (); r++) {
+if (jalview.util.Comparison.isGap (asp.getCharAt (r))) {
+continue;
+}var pos = mapping[m].getPDBResNum (asp.findPosition (r));
+if (pos < 1 || pos == lastPos) {
+continue;
+}lastPos = pos;
+var col = sr.getResidueBoxColour (sequence[pdbfnum][s], r);
+if (fr != null) {
+col = fr.findFeatureColour (col, sequence[pdbfnum][s], r);
+}var newSelcom = (mapping[m].getChain () !== " " ? ":" + mapping[m].getChain () : "") + "/" + (pdbfnum + 1) + ".1" + ";color[" + col.getRed () + "," + col.getGreen () + "," + col.getBlue () + "]";
+if (command.length () > newSelcom.length && command.substring (command.length () - newSelcom.length).equals (newSelcom)) {
+command = jalview.ext.jmol.JmolCommands.condenseCommand (command, pos);
+continue;
+}command.append (";");
+if (command.length () > 51200) {
+str.add (command.toString ());
+command.setLength (0);
+}command.append ("select " + pos);
+command.append (newSelcom);
+}
+break;
+}}
+}
+{
+str.add (command.toString ());
+command.setLength (0);
+}cset.add ( new jalview.structure.StructureMappingcommandSet (jalview.ext.jmol.JmolCommands, files[pdbfnum], str.toArray ( new Array (str.size ()))));
+}
+return cset.toArray ( new Array (cset.size ()));
+}, "jalview.structure.StructureSelectionManager,~A,~A,jalview.api.SequenceRenderer,jalview.api.FeatureRenderer,jalview.datamodel.AlignmentI");
+c$.condenseCommand = Clazz_defineMethod (c$, "condenseCommand", 
+function (command, pos) {
+var p = command.length ();
+var q = p;
+do {
+p -= 6;
+if (p < 1) {
+p = 0;
+};} while ((q = command.indexOf ("select", p)) == -1 && p > 0);
+var sb =  new StringBuffer (command.substring (0, q + 7));
+command = command.$delete (0, q + 7);
+var start;
+if (command.indexOf ("-") > -1) {
+start = command.substring (0, command.indexOf ("-"));
+} else {
+start = command.substring (0, command.indexOf (":"));
+}sb.append (start + "-" + pos + command.substring (command.indexOf (":")));
+return sb;
+}, "StringBuffer,~N");
+});
+Clazz_declarePackage ("jalview.structure");
+c$ = Clazz_decorateAsClass (function () {
+this.mapping = null;
+this.commands = null;
+this.handledBy = null;
+Clazz_instantialize (this, arguments);
+}, jalview.structure, "StructureMappingcommandSet");
+Clazz_makeConstructor (c$, 
+function (handledBy, files, commands) {
+this.mapping = files;
+this.handledBy = handledBy;
+this.commands = commands;
+}, "~O,~S,~A");
+Clazz_declarePackage ("java.util");
+Clazz_load (["java.util.Hashtable"], "java.util.Properties", ["java.lang.IllegalArgumentException"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.defaults = null;
+if (!Clazz_isClassDefined ("java.util.Properties.LineReader")) {
+java.util.Properties.$Properties$LineReader$ ();
+}
+Clazz_instantialize (this, arguments);
+}, java.util, "Properties", java.util.Hashtable);
+Clazz_makeConstructor (c$, 
+function () {
+this.construct (null);
+});
+Clazz_makeConstructor (c$, 
+function (defaults) {
+Clazz_superConstructor (this, java.util.Properties, []);
+this.defaults = defaults;
+}, "java.util.Properties");
+Clazz_defineMethod (c$, "setProperty", 
+function (key, value) {
+return this.put (key, value);
+}, "~S,~S");
+Clazz_defineMethod (c$, "load", 
+function (reader) {
+this.load0 (Clazz_innerTypeInstance (java.util.Properties.LineReader, this, null, reader));
+}, "java.io.Reader");
+Clazz_defineMethod (c$, "load", 
+function (inStream) {
+this.load0 (Clazz_innerTypeInstance (java.util.Properties.LineReader, this, null, inStream));
+}, "java.io.InputStream");
+Clazz_defineMethod (c$, "load0", 
+ function (lr) {
+var convtBuf =  Clazz_newCharArray (1024, '\0');
+var limit;
+var keyLen;
+var valueStart;
+var c;
+var hasSep;
+var precedingBackslash;
+while ((limit = lr.readLine ()) >= 0) {
+c = String.fromCharCode ( 0);
+keyLen = 0;
+valueStart = limit;
+hasSep = false;
+precedingBackslash = false;
+while (keyLen < limit) {
+c = lr.lineBuf[keyLen];
+if ((c == '=' || c == ':') && !precedingBackslash) {
+valueStart = keyLen + 1;
+hasSep = true;
+break;
+} else if ((c == ' ' || c == '\t' || c == '\f') && !precedingBackslash) {
+valueStart = keyLen + 1;
+break;
+}if (c == '\\') {
+precedingBackslash = !precedingBackslash;
+} else {
+precedingBackslash = false;
+}keyLen++;
+}
+while (valueStart < limit) {
+c = lr.lineBuf[valueStart];
+if (c != ' ' && c != '\t' && c != '\f') {
+if (!hasSep && (c == '=' || c == ':')) {
+hasSep = true;
+} else {
+break;
+}}valueStart++;
+}
+var key = this.loadConvert (lr.lineBuf, 0, keyLen, convtBuf);
+var value = this.loadConvert (lr.lineBuf, valueStart, limit - valueStart, convtBuf);
+this.put (key, value);
+}
+}, "java.util.Properties.LineReader");
+Clazz_defineMethod (c$, "loadConvert", 
+ function ($in, off, len, convtBuf) {
+if (convtBuf.length < len) {
+var newLen = len * 2;
+if (newLen < 0) {
+newLen = 2147483647;
+}convtBuf =  Clazz_newCharArray (newLen, '\0');
+}var aChar;
+var out = convtBuf;
+var outLen = 0;
+var end = off + len;
+while (off < end) {
+aChar = $in[off++];
+if (aChar == '\\') {
+aChar = $in[off++];
+if (aChar == 'u') {
+var value = 0;
+for (var i = 0; i < 4; i++) {
+aChar = $in[off++];
+switch (aChar) {
+case '0':
+case '1':
+case '2':
+case '3':
+case '4':
+case '5':
+case '6':
+case '7':
+case '8':
+case '9':
+value = (value << 4) + aChar.charCodeAt (0) - 48;
+break;
+case 'a':
+case 'b':
+case 'c':
+case 'd':
+case 'e':
+case 'f':
+value = (value << 4) + 10 + aChar.charCodeAt (0) - 97;
+break;
+case 'A':
+case 'B':
+case 'C':
+case 'D':
+case 'E':
+case 'F':
+value = (value << 4) + 10 + aChar.charCodeAt (0) - 65;
+break;
+default:
+throw  new IllegalArgumentException ("Malformed \\uxxxx encoding.");
+}
+}
+out[outLen++] = String.fromCharCode (value);
+} else {
+if (aChar == 't') aChar = '\t';
+ else if (aChar == 'r') aChar = '\r';
+ else if (aChar == 'n') aChar = '\n';
+ else if (aChar == 'f') aChar = '\f';
+out[outLen++] = aChar;
+}} else {
+out[outLen++] = aChar;
+}}
+return  String.instantialize (out, 0, outLen);
+}, "~A,~N,~N,~A");
+Clazz_defineMethod (c$, "getProperty", 
+function (key) {
+var oval = Clazz_superCall (this, java.util.Properties, "get", [key]);
+var sval = (Clazz_instanceOf (oval, String)) ? oval : null;
+return ((sval == null) && (this.defaults != null)) ? this.defaults.getProperty (key) : sval;
+}, "~S");
+Clazz_defineMethod (c$, "getProperty", 
+function (key, defaultValue) {
+var val = this.getProperty (key);
+return (val == null) ? defaultValue : val;
+}, "~S,~S");
+Clazz_defineMethod (c$, "propertyNames", 
+function () {
+var h =  new java.util.Hashtable ();
+this.enumerate (h);
+return h.keys ();
+});
+Clazz_defineMethod (c$, "stringPropertyNames", 
+function () {
+var h =  new java.util.Hashtable ();
+this.enumerateStringProperties (h);
+return h.keySet ();
+});
+Clazz_defineMethod (c$, "enumerate", 
+ function (h) {
+if (this.defaults != null) {
+this.defaults.enumerate (h);
+}for (var e = this.keys (); e.hasMoreElements (); ) {
+var key = e.nextElement ();
+h.put (key, this.get (key));
+}
+}, "java.util.Hashtable");
+Clazz_defineMethod (c$, "enumerateStringProperties", 
+ function (h) {
+if (this.defaults != null) {
+this.defaults.enumerateStringProperties (h);
+}for (var e = this.keys (); e.hasMoreElements (); ) {
+var k = e.nextElement ();
+var v = this.get (k);
+if (Clazz_instanceOf (k, String) && Clazz_instanceOf (v, String)) {
+h.put (k, v);
+}}
+}, "java.util.Hashtable");
+c$.$Properties$LineReader$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_decorateAsClass (function () {
+Clazz_prepareCallback (this, arguments);
+this.inByteBuf = null;
+this.inCharBuf = null;
+this.lineBuf = null;
+this.inLimit = 0;
+this.inOff = 0;
+this.inStream = null;
+this.reader = null;
+Clazz_instantialize (this, arguments);
+}, java.util.Properties, "LineReader");
+Clazz_prepareFields (c$, function () {
+this.lineBuf =  Clazz_newCharArray (1024, '\0');
+});
+Clazz_makeConstructor (c$, 
+function (a) {
+this.inStream = a;
+this.inByteBuf =  Clazz_newByteArray (8192, 0);
+}, "java.io.InputStream");
+Clazz_makeConstructor (c$, 
+function (a) {
+this.reader = a;
+this.inCharBuf =  Clazz_newCharArray (8192, '\0');
+}, "java.io.Reader");
+Clazz_defineMethod (c$, "readLine", 
+function () {
+var a = 0;
+var b = String.fromCharCode (0);
+var c = true;
+var d = false;
+var e = true;
+var f = false;
+var g = false;
+var h = false;
+while (true) {
+if (this.inOff >= this.inLimit) {
+this.inLimit = (this.inStream == null) ? this.reader.read (this.inCharBuf) : this.inStream.read (this.inByteBuf);
+this.inOff = 0;
+if (this.inLimit <= 0) {
+if (a == 0 || d) {
+return -1;
+}return a;
+}}if (this.inStream != null) {
+b = String.fromCharCode (0xff & this.inByteBuf[this.inOff++]);
+} else {
+b = this.inCharBuf[this.inOff++];
+}if (h) {
+h = false;
+if (b == '\n') {
+continue;
+}}if (c) {
+if (b == ' ' || b == '\t' || b == '\f') {
+continue;
+}if (!f && (b == '\r' || b == '\n')) {
+continue;
+}c = false;
+f = false;
+}if (e) {
+e = false;
+if (b == '#' || b == '!') {
+d = true;
+continue;
+}}if (b != '\n' && b != '\r') {
+this.lineBuf[a++] = b;
+if (a == this.lineBuf.length) {
+var i = this.lineBuf.length * 2;
+{
+}var j =  Clazz_newCharArray (i, '\0');
+System.arraycopy (this.lineBuf, 0, j, 0, this.lineBuf.length);
+this.lineBuf = j;
+}if (b == '\\') {
+g = !g;
+} else {
+g = false;
+}} else {
+if (d || a == 0) {
+d = false;
+e = true;
+c = true;
+a = 0;
+continue;
+}if (this.inOff >= this.inLimit) {
+this.inLimit = (this.inStream == null) ? this.reader.read (this.inCharBuf) : this.inStream.read (this.inByteBuf);
+this.inOff = 0;
+if (this.inLimit <= 0) {
+return a;
+}}if (g) {
+a -= 1;
+c = true;
+f = true;
+g = false;
+if (b == '\r') {
+h = true;
+}} else {
+return a;
+}}}
+});
+c$ = Clazz_p0p ();
+};
+});
+Clazz_declarePackage ("jssun.util");
+Clazz_load (["java.util.Enumeration"], "jssun.util.ResourceBundleEnumeration", ["java.util.NoSuchElementException"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.set = null;
+this.iterator = null;
+this.enumeration = null;
+this.next = null;
+Clazz_instantialize (this, arguments);
+}, jssun.util, "ResourceBundleEnumeration", null, java.util.Enumeration);
+Clazz_makeConstructor (c$, 
+function (set, enumeration) {
+this.set = set;
+this.iterator = set.iterator ();
+this.enumeration = enumeration;
+}, "java.util.Set,java.util.Enumeration");
+Clazz_defineMethod (c$, "hasMoreElements", 
+function () {
+if (this.next == null) {
+if (this.iterator.hasNext ()) {
+this.next = this.iterator.next ();
+} else if (this.enumeration != null) {
+while (this.next == null && this.enumeration.hasMoreElements ()) {
+this.next = this.enumeration.nextElement ();
+if (this.set.contains (this.next)) {
+this.next = null;
+}}
+}}return this.next != null;
+});
+Clazz_defineMethod (c$, "nextElement", 
+function () {
+if (this.hasMoreElements ()) {
+var result = this.next;
+this.next = null;
+return result;
+} else {
+throw  new java.util.NoSuchElementException ();
+}});
+});
+Clazz_declarePackage ("jalview.io");
+Clazz_load (["jalview.io.AlignFile"], "jalview.io.FastaFile", ["jalview.datamodel.AlignmentAnnotation", "$.Annotation", "java.lang.StringBuffer"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.len = 72;
+this.out = null;
+Clazz_instantialize (this, arguments);
+}, jalview.io, "FastaFile", jalview.io.AlignFile);
+Clazz_makeConstructor (c$, 
+function () {
+Clazz_superConstructor (this, jalview.io.FastaFile, []);
+});
+Clazz_overrideMethod (c$, "parse", 
+function () {
+var sb =  new StringBuffer ();
+var firstLine = true;
+var line;
+var uline;
+var seq = null;
+var annotation = false;
+while ((uline = this.nextLine ()) != null) {
+line = uline.trim ();
+if (line.length > 0) {
+if (line.charAt (0) == '>') {
+if (line.startsWith (">#_")) {
+if (annotation) {
+this.annotations.addElement (this.makeAnnotation (seq, sb));
+}} else {
+annotation = false;
+}if (!firstLine) {
+seq.setSequence (sb.toString ());
+if (!annotation) {
+this.seqs.addElement (seq);
+}}seq = this.parseId (line.substring (1));
+firstLine = false;
+sb =  new StringBuffer ();
+if (line.startsWith (">#_")) {
+annotation = true;
+}} else {
+sb.append (annotation ? uline : line);
+}}}
+if (annotation) {
+this.annotations.addElement (this.makeAnnotation (seq, sb));
+} else if (!firstLine) {
+seq.setSequence (sb.toString ());
+this.seqs.addElement (seq);
+}});
+Clazz_defineMethod (c$, "makeAnnotation", 
+ function (seq, sb) {
+var anots =  new Array (sb.length ());
+var cb;
+for (var i = 0; i < anots.length; i++) {
+var cn = sb.charAt (i);
+if (cn != ' ') {
+anots[i] =  new jalview.datamodel.Annotation ("" + cn, null, ' ', NaN);
+}}
+var aa =  new jalview.datamodel.AlignmentAnnotation (seq.getName ().substring (2), seq.getDescription (), anots);
+return aa;
+}, "jalview.datamodel.SequenceI,StringBuffer");
+Clazz_defineMethod (c$, "addAnnotations", 
+function (al) {
+this.addProperties (al);
+for (var i = 0; i < this.annotations.size (); i++) {
+var aa = this.annotations.elementAt (i);
+aa.setPadGaps (true, al.getGapCharacter ());
+al.addAnnotation (aa);
+}
+}, "jalview.datamodel.Alignment");
+Clazz_defineMethod (c$, "print", 
+function (s) {
+this.out =  new StringBuffer ();
+var i = 0;
+while ((i < s.length) && (s[i] != null)) {
+this.out.append (">" + this.printId (s[i]));
+if (s[i].getDescription () != null) {
+this.out.append (" " + s[i].getDescription ());
+}this.out.append (this.newline);
+var nochunks = (Clazz_doubleToInt (s[i].getLength () / this.len)) + 1;
+for (var j = 0; j < nochunks; j++) {
+var start = j * this.len;
+var end = start + this.len;
+if (end < s[i].getLength ()) {
+this.out.append (s[i].getSequenceAsString (start, end) + this.newline);
+} else if (start < s[i].getLength ()) {
+this.out.append (s[i].getSequenceAsString (start, s[i].getLength ()) + this.newline);
+}}
+i++;
+}
+return this.out.toString ();
+}, "~A");
+Clazz_defineMethod (c$, "print", 
+function () {
+return this.print (this.getSeqsAsArray ());
+});
+});
+Clazz_declarePackage ("swingjs.plaf");
+Clazz_load (["swingjs.plaf.JSPanelUI"], "swingjs.plaf.JSMenuBarUI", ["java.awt.Dimension", "javax.swing.LookAndFeel"], function () {
+c$ = Clazz_declareType (swingjs.plaf, "JSMenuBarUI", swingjs.plaf.JSPanelUI);
+Clazz_makeConstructor (c$, 
+function () {
+Clazz_superConstructor (this, swingjs.plaf.JSMenuBarUI, []);
+this.isContainer = true;
+this.setDoc ();
+});
+Clazz_overrideMethod (c$, "getDOMObject", 
+function () {
+if (this.domNode == null) this.domNode = this.createDOMObject ("div", this.id, []);
+return this.domNode;
+});
+Clazz_overrideMethod (c$, "setHTMLSize", 
+function (obj, addCSS) {
+return  new java.awt.Dimension (this.c.getWidth (), this.c.getHeight ());
+}, "swingjs.api.DOMNode,~B");
+Clazz_defineMethod (c$, "getPreferredSize", 
+function (c) {
+return null;
+}, "javax.swing.JComponent");
+Clazz_overrideMethod (c$, "installJSUI", 
+function () {
+javax.swing.LookAndFeel.installColorsAndFont (this.c, "MenuBar.background", "MenuBar.foreground", "MenuBar.font");
+});
+Clazz_overrideMethod (c$, "uninstallJSUI", 
+function () {
+});
+});
+Clazz_declarePackage ("swingjs.plaf");
+Clazz_load (["swingjs.plaf.JSComponentUI"], "swingjs.plaf.JSMenuUI", ["java.awt.Dimension", "javax.swing.LookAndFeel"], function () {
+c$ = Clazz_declareType (swingjs.plaf, "JSMenuUI", swingjs.plaf.JSComponentUI);
+Clazz_makeConstructor (c$, 
+function () {
+Clazz_superConstructor (this, swingjs.plaf.JSMenuUI, []);
+this.isContainer = true;
+this.setDoc ();
+});
+Clazz_overrideMethod (c$, "getDOMObject", 
+function () {
+if (this.domNode == null) this.domNode = this.createDOMObject ("select", this.id, []);
+return this.domNode;
+});
+Clazz_overrideMethod (c$, "setHTMLSize", 
+function (obj, addCSS) {
+return  new java.awt.Dimension (this.c.getWidth (), this.c.getHeight ());
+}, "swingjs.api.DOMNode,~B");
+Clazz_defineMethod (c$, "getPreferredSize", 
+function (c) {
+return null;
+}, "javax.swing.JComponent");
+Clazz_overrideMethod (c$, "installJSUI", 
+function () {
+javax.swing.LookAndFeel.installColorsAndFont (this.c, "Menu.background", "Menu.foreground", "Menu.font");
+});
+Clazz_overrideMethod (c$, "uninstallJSUI", 
+function () {
+});
+});
+Clazz_declarePackage ("swingjs.plaf");
+Clazz_load (["swingjs.plaf.JSButtonUI"], "swingjs.plaf.JSMenuItemUI", ["javax.swing.LookAndFeel", "$.UIManager", "javax.swing.plaf.UIResource", "swingjs.api.DOMNode", "swingjs.plaf.JSButtonListener"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.$domBtn = null;
+this.$shiftOffset = 0;
+this.$defaultTextShiftOffset = 0;
+Clazz_instantialize (this, arguments);
+}, swingjs.plaf, "JSMenuItemUI", swingjs.plaf.JSButtonUI);
+Clazz_overrideMethod (c$, "getDOMObject", 
+function () {
+if (this.domNode == null) this.$domBtn = this.enableNode = this.valueNode = this.domNode = this.createDOMObject ("input", this.id, ["type", "button"]);
+this.setCssFont (swingjs.api.DOMNode.setAttr (this.domNode, "value", (this.c).getText ()), this.c.getFont ());
+return this.domNode;
+});
+Clazz_overrideMethod (c$, "verifyButtonClick", 
+function (isRelease) {
+return true;
+}, "~B");
+Clazz_overrideMethod (c$, "installJSUI", 
+function () {
+this.installDefaults (this.c);
+this.installListeners (this.c);
+this.installKeyboardActions (this.c);
+});
+Clazz_overrideMethod (c$, "uninstallJSUI", 
+function () {
+this.uninstallKeyboardActions (this.c);
+this.uninstallListeners (this.c);
+});
+Clazz_overrideMethod (c$, "installListeners", 
+function (b) {
+var listener =  new swingjs.plaf.JSButtonListener (b);
+if (listener != null) {
+b.addMouseListener (listener);
+b.addMouseMotionListener (listener);
+b.addFocusListener (listener);
+b.addPropertyChangeListener (listener);
+b.addChangeListener (listener);
+}}, "javax.swing.AbstractButton");
+Clazz_overrideMethod (c$, "uninstallListeners", 
+function (b) {
+var listener = this.getButtonListener (b);
+if (listener != null) {
+b.removeMouseListener (listener);
+b.removeMouseMotionListener (listener);
+b.removeFocusListener (listener);
+b.removeChangeListener (listener);
+b.removePropertyChangeListener (listener);
+}}, "javax.swing.AbstractButton");
+Clazz_overrideMethod (c$, "installKeyboardActions", 
+function (b) {
+var listener = this.getButtonListener (b);
+if (listener != null) {
+listener.installKeyboardActions (b);
+}}, "javax.swing.AbstractButton");
+Clazz_overrideMethod (c$, "uninstallKeyboardActions", 
+function (b) {
+var listener = this.getButtonListener (b);
+if (listener != null) {
+listener.uninstallKeyboardActions (b);
+}}, "javax.swing.AbstractButton");
+Clazz_overrideMethod (c$, "getPropertyPrefix", 
+function () {
+return "Button.";
+});
+Clazz_overrideMethod (c$, "installDefaults", 
+function (b) {
+var pp = this.getPropertyPrefix ();
+this.$defaultTextShiftOffset = javax.swing.UIManager.getInt (pp + "textShiftOffset");
+if (b.getMargin () == null || (Clazz_instanceOf (b.getMargin (), javax.swing.plaf.UIResource))) {
+b.setMargin (javax.swing.UIManager.getInsets (pp + "margin"));
+}javax.swing.LookAndFeel.installColorsAndFont (b, pp + "background", pp + "foreground", pp + "font");
+javax.swing.LookAndFeel.installProperty (b, "iconTextGap",  new Integer (4));
+}, "javax.swing.AbstractButton");
+});
+Clazz_declarePackage ("swingjs.plaf");
+Clazz_load (["swingjs.plaf.JSCheckBoxUI"], "swingjs.plaf.JSCheckBoxMenuItemUI", null, function () {
+c$ = Clazz_declareType (swingjs.plaf, "JSCheckBoxMenuItemUI", swingjs.plaf.JSCheckBoxUI);
+Clazz_overrideMethod (c$, "getDOMObject", 
+function () {
+return this.getButtonObject ("checkBox");
+});
+Clazz_overrideMethod (c$, "getPropertyPrefix", 
+function () {
+return "CheckBoxMenuItem.";
+});
+});
+Clazz_declarePackage ("swingjs.plaf");
+Clazz_load (["swingjs.plaf.JSRadioButtonUI"], "swingjs.plaf.JSCheckBoxUI", null, function () {
+c$ = Clazz_declareType (swingjs.plaf, "JSCheckBoxUI", swingjs.plaf.JSRadioButtonUI);
+Clazz_overrideMethod (c$, "getDOMObject", 
+function () {
+return this.getButtonObject ("checkBox");
+});
+Clazz_overrideMethod (c$, "getPropertyPrefix", 
+function () {
+return "CheckBox.";
+});
+});
+Clazz_declarePackage ("swingjs.plaf");
+Clazz_load (["swingjs.plaf.JSComponentUI"], "swingjs.plaf.JSLabelUI", ["swingjs.api.DOMNode"], function () {
+c$ = Clazz_declareType (swingjs.plaf, "JSLabelUI", swingjs.plaf.JSComponentUI);
+Clazz_overrideMethod (c$, "getDOMObject", 
+function () {
+if (this.domNode == null) this.textNode = this.domNode = this.createDOMObject ("label", this.id, []);
+swingjs.plaf.JSComponentUI.vCenter (this.domNode, 10);
+return this.setCssFont (swingjs.api.DOMNode.setAttr (this.domNode, "innerHTML", (this.c).getText ()), this.c.getFont ());
+});
+Clazz_overrideMethod (c$, "installJSUI", 
+function () {
+});
+Clazz_overrideMethod (c$, "uninstallJSUI", 
+function () {
+});
+});
+Clazz_declarePackage ("swingjs.plaf");
+Clazz_load (["swingjs.plaf.JSMenuUI"], "swingjs.plaf.JSPopupMenuUI", ["java.awt.Dimension", "javax.swing.LookAndFeel"], function () {
+c$ = Clazz_declareType (swingjs.plaf, "JSPopupMenuUI", swingjs.plaf.JSMenuUI);
+Clazz_makeConstructor (c$, 
+function () {
+Clazz_superConstructor (this, swingjs.plaf.JSPopupMenuUI, []);
+this.isContainer = true;
+this.setDoc ();
+});
+Clazz_overrideMethod (c$, "getDOMObject", 
+function () {
+if (this.domNode == null) this.domNode = this.createDOMObject ("select", this.id, []);
+return this.domNode;
+});
+Clazz_overrideMethod (c$, "setHTMLSize", 
+function (obj, addCSS) {
+return  new java.awt.Dimension (this.c.getWidth (), this.c.getHeight ());
+}, "swingjs.api.DOMNode,~B");
+Clazz_defineMethod (c$, "getPreferredSize", 
+function (c) {
+return null;
+}, "javax.swing.JComponent");
+Clazz_overrideMethod (c$, "installJSUI", 
+function () {
+javax.swing.LookAndFeel.installColorsAndFont (this.c, "PopupMenu.background", "PopupMenu.foreground", "PopupMenu.font");
+});
+Clazz_overrideMethod (c$, "uninstallJSUI", 
+function () {
+});
+});
+Clazz_declarePackage ("swingjs.plaf");
+Clazz_load (["swingjs.plaf.JSSeparatorUI"], "swingjs.plaf.JSPopupMenuSeparatorUI", ["swingjs.api.DOMNode"], function () {
+c$ = Clazz_declareType (swingjs.plaf, "JSPopupMenuSeparatorUI", swingjs.plaf.JSSeparatorUI);
+Clazz_overrideMethod (c$, "getDOMObject", 
+function () {
+if (this.domNode == null) this.textNode = this.domNode = this.createDOMObject ("label", this.id, []);
+swingjs.plaf.JSComponentUI.vCenter (this.domNode, 10);
+return this.setCssFont (swingjs.api.DOMNode.setAttr (this.domNode, "innerHTML", (this.c).getText ()), this.c.getFont ());
+});
+Clazz_overrideMethod (c$, "installJSUI", 
+function () {
+});
+Clazz_overrideMethod (c$, "uninstallJSUI", 
+function () {
+});
+});
+//Clazz_declarePackage ("swingjs.plaf");
+//Clazz_load (["swingjs.plaf.JSSliderUI"], "swingjs.plaf.JSScrollBarUI", null, function () {
+//c$ = Clazz_declareType (swingjs.plaf, "JSScrollBarUI", swingjs.plaf.JSSliderUI);
+//});
+
+
+Clazz_declarePackage ("swingjs.plaf");
+Clazz_load (["swingjs.plaf.JSComponentUI"], "swingjs.plaf.JSScrollBarUI", null, function () {
+c$ = Clazz_declareType (swingjs.plaf, "JSScrollBarUI", swingjs.plaf.JSComponentUI);
+Clazz_overrideMethod (c$, "getDOMObject", 
+function () {
+if (this.domNode == null) this.domNode = this.createDOMObject ("div", this.id, []);
+return this.domNode;
+});
+Clazz_overrideMethod (c$, "installJSUI", 
+function () {
+});
+Clazz_overrideMethod (c$, "uninstallJSUI", 
+function () {
+});
+});
+Clazz_declarePackage ("swingjs");
+Clazz_load (null, "swingjs.JSImagekit", ["java.util.Arrays", "swingjs.JSImage", "swingjs.api.Interface"], function () {
+c$ = Clazz_declareType (swingjs, "JSImagekit");
+Clazz_makeConstructor (c$, 
+function () {
+});
+Clazz_defineMethod (c$, "createImageFromBytes", 
+function (data, imageoffset, imagelength) {
+var w = 0;
+var h = 0;
+var argb = null;
+var b = null;
+var type = null;
+if (data == null) {
+w = imageoffset;
+h = imagelength;
+} else {
+if (imagelength < 0) imagelength = data.length;
+b = java.util.Arrays.copyOfRange (data, imageoffset, imagelength);
+if (b.length < 54) return null;
+switch (this.getSourceType (b)) {
+case 3:
+var ie = swingjs.api.Interface.getInstance ("javajs.img.BMPDecoder", true);
+var o = ie.decodeWindowsBMP (b);
+if (o == null || o[0] == null) return null;
+w = (o[1]).intValue ();
+h = (o[2]).intValue ();
+argb = o[0];
+break;
+case 1:
+var pt = 2;
+while (true) {
+switch (this.getInt (b, pt)) {
+case 49407:
+case 49919:
+h = this.getIntRev (b, pt + 5);
+w = this.getIntRev (b, pt + 7);
+pt = 0;
+break;
+}
+if (pt == 0) break;
+pt += 2 + this.getIntRev (b, pt + 2);
+}
+type = "jpeg";
+break;
+case 0:
+w = this.getLong (b, 16);
+h = this.getLong (b, 20);
+type = "png";
+break;
+case 2:
+w = this.getInt (b, 6);
+h = this.getInt (b, 8);
+type = "gif";
+break;
+case -1:
+System.out.println ("JSImagekit: Unknown image type: " + b[0] + " " + b[1] + " " + b[2] + " " + b[3]);
+data = null;
+break;
+}
+}if (w == 0 || h == 0) return null;
+var jsimage =  new swingjs.JSImage (argb, w, h);
+if (data != null && argb == null) jsimage.getDOMImage (b, type);
+return jsimage;
+}, "~A,~N,~N");
+Clazz_defineMethod (c$, "getLong", 
+ function (b, pt) {
+return ((b[pt] & 0xFF) << 24) + ((b[pt + 1] & 0xFF) << 16) + ((b[pt + 2] & 0xFF) << 8) + (b[pt + 3] & 0xFF);
+}, "~A,~N");
+Clazz_defineMethod (c$, "getInt", 
+ function (b, pt) {
+return (b[pt] & 0xFF) + ((b[pt + 1] & 0xFF) << 8);
+}, "~A,~N");
+Clazz_defineMethod (c$, "getIntRev", 
+ function (b, pt) {
+return ((b[pt] & 0xFF) << 8) + (b[pt + 1] & 0xFF);
+}, "~A,~N");
+Clazz_defineMethod (c$, "getSourceType", 
+ function (b) {
+return ((b[0] & 0xFF) == 0x89 && b[1] == 80 && b[2] == 78 && b[3] == 71 ? 0 : (b[0] & 0xFF) == 0xFF && (b[1] & 0xFF) == 0xD8 ? 1 : b[0] == 71 && b[1] == 73 && b[2] == 70 ? 2 : b[0] == 66 && b[1] == 77 ? 3 : -1);
+}, "~A");
+Clazz_defineStatics (c$,
+"UNK", -1,
+"PNG", 0,
+"JPG", 1,
+"GIF", 2,
+"BMP", 3,
+"JPG_SOF0", 0xC0FF,
+"JPG_SOF2", 0xC2FF);
+});
+Clazz_declarePackage ("swingjs");
+Clazz_load (["java.awt.image.BufferedImage"], "swingjs.JSImage", ["JU.Base64", "swingjs.api.DOMNode"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.typeRequested = 0;
+this.pix = null;
+this._imgNode = null;
+this.width = 0;
+this.height = 0;
+Clazz_instantialize (this, arguments);
+}, swingjs, "JSImage", java.awt.image.BufferedImage);
+Clazz_makeConstructor (c$, 
+function (argb, width, height) {
+Clazz_superConstructor (this, swingjs.JSImage, [width, height, 2]);
+this.width = width;
+this.height = height;
+this.pix = argb;
+}, "~A,~N,~N");
+Clazz_defineMethod (c$, "toIntARGB", 
+function (imgData) {
+var n = Clazz_doubleToInt (imgData.length / 4);
+var iData =  Clazz_newIntArray (n, 0);
+for (var i = 0, j = 0; i < n; j++) iData[i++] = (imgData[j++] << 16) | (imgData[j++] << 8) | imgData[j++] | 0xFF000000;
+
+return iData;
+}, "~A");
+Clazz_defineMethod (c$, "getDOMImage", 
+function (b, type) {
+var dataurl = "data:image/" + type + ";base64," + JU.Base64.getBase64 (b).toString ();
+var me = this;
+var img = null;
+{
+img = new Image(this.width, this.height);
+//img.onLoad = function() { me.setDOMImage(img); };
+img.src = dataurl;
+}this.setDOMImage (img);
+}, "~A,~S");
+Clazz_defineMethod (c$, "setDOMImage", 
+function (img) {
+var canvas = swingjs.api.DOMNode.createElement ("canvas", "JSImage");
+var w = this.width;
+var h = this.height;
+this._imgNode = img;
+{
+canvas.width = w;
+canvas.height = h;
+var ctx = canvas.getContext("2d");
+ctx.drawImage(img, 0, 0, w, h);
+var data = ctx.getImageData(0, 0, w, h).data;
+img._pbuf32 = this.toIntARGB(data);
+}}, "swingjs.api.DOMNode");
+Clazz_defineMethod (c$, "getHeight", 
+function (o) {
+return this.height;
+}, "java.awt.image.ImageObserver");
+Clazz_defineMethod (c$, "getWidth", 
+function (o) {
+return this.width;
+}, "java.awt.image.ImageObserver");
+});
+Clazz_declarePackage ("jssun.awt.image");
+Clazz_load (["jssun.awt.image.IntegerComponentRaster"], "jssun.awt.image.IntegerInterleavedRaster", ["java.lang.ArrayIndexOutOfBoundsException", "java.awt.Point", "$.Rectangle", "java.awt.image.DataBufferInt", "$.RasterFormatException", "$.SinglePixelPackedSampleModel"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.$maxX = 0;
+this.$maxY = 0;
+Clazz_instantialize (this, arguments);
+}, jssun.awt.image, "IntegerInterleavedRaster", jssun.awt.image.IntegerComponentRaster);
+Clazz_makeConstructor (c$, 
+function (sampleModel, origin) {
+Clazz_superConstructor (this, jssun.awt.image.IntegerInterleavedRaster, []);
+this.setIntInterRaster (sampleModel, sampleModel.createDataBuffer (),  new java.awt.Rectangle (origin.x, origin.y, sampleModel.getWidth (), sampleModel.getHeight ()), origin, null);
+}, "java.awt.image.SampleModel,java.awt.Point");
+Clazz_makeConstructor (c$, 
+function (sampleModel, dataBuffer, origin) {
+Clazz_superConstructor (this, jssun.awt.image.IntegerInterleavedRaster, []);
+this.setParams (sampleModel, dataBuffer, origin);
+}, "java.awt.image.SampleModel,java.awt.image.DataBuffer,java.awt.Point");
+Clazz_makeConstructor (c$, 
+function () {
+Clazz_superConstructor (this, jssun.awt.image.IntegerInterleavedRaster, []);
+});
+Clazz_overrideMethod (c$, "setParams", 
+function (sampleModel, dataBuffer, origin) {
+this.setIntInterRaster (sampleModel, dataBuffer,  new java.awt.Rectangle (origin.x, origin.y, sampleModel.getWidth (), sampleModel.getHeight ()), origin, null);
+}, "java.awt.image.SampleModel,java.awt.image.DataBuffer,java.awt.Point");
+Clazz_makeConstructor (c$, 
+function (sampleModel, dataBuffer, aRegion, origin, parent) {
+Clazz_superConstructor (this, jssun.awt.image.IntegerInterleavedRaster, []);
+this.setIntInterRaster (sampleModel, dataBuffer, aRegion, origin, parent);
+}, "java.awt.image.SampleModel,java.awt.image.DataBuffer,java.awt.Rectangle,java.awt.Point,jssun.awt.image.IntegerInterleavedRaster");
+Clazz_defineMethod (c$, "setIntInterRaster", 
+ function (sampleModel, dataBuffer, aRegion, origin, parent) {
+this.setIntCompRaster (sampleModel, dataBuffer, aRegion, origin, parent);
+this.$maxX = this.minX + this.width;
+this.$maxY = this.minY + this.height;
+if (!(Clazz_instanceOf (dataBuffer, java.awt.image.DataBufferInt))) {
+throw  new java.awt.image.RasterFormatException ("IntegerInterleavedRasters must haveinteger DataBuffers");
+}var dbi = dataBuffer;
+this.data = jssun.awt.image.SunWritableRaster.stealData (dbi, 0);
+if (Clazz_instanceOf (sampleModel, java.awt.image.SinglePixelPackedSampleModel)) {
+var sppsm = sampleModel;
+this.scanlineStride = sppsm.getScanlineStride ();
+this.pixelStride = 1;
+this.dataOffsets =  Clazz_newIntArray (1, 0);
+this.dataOffsets[0] = dbi.getOffset ();
+this.bandOffset = this.dataOffsets[0];
+var xOffset = aRegion.x - origin.x;
+var yOffset = aRegion.y - origin.y;
+this.dataOffsets[0] += xOffset + yOffset * this.scanlineStride;
+this.numDataElems = sppsm.getNumDataElements ();
+} else {
+throw  new java.awt.image.RasterFormatException ("IntegerInterleavedRasters must have SinglePixelPackedSampleModel");
+}this.verify ();
+}, "java.awt.image.SampleModel,java.awt.image.DataBuffer,java.awt.Rectangle,java.awt.Point,jssun.awt.image.IntegerInterleavedRaster");
+Clazz_overrideMethod (c$, "getDataOffsets", 
+function () {
+return this.dataOffsets.clone ();
+});
+Clazz_overrideMethod (c$, "getDataOffset", 
+function (band) {
+return this.dataOffsets[band];
+}, "~N");
+Clazz_overrideMethod (c$, "getScanlineStride", 
+function () {
+return this.scanlineStride;
+});
+Clazz_overrideMethod (c$, "getPixelStride", 
+function () {
+return this.pixelStride;
+});
+Clazz_overrideMethod (c$, "getDataStorage", 
+function () {
+return this.data;
+});
+Clazz_defineMethod (c$, "getDataElements", 
+function (x, y, obj) {
+if ((x < this.minX) || (y < this.minY) || (x >= this.$maxX) || (y >= this.$maxY)) {
+throw  new ArrayIndexOutOfBoundsException ("Coordinate out of bounds!");
+}var outData;
+if (obj == null) {
+outData =  Clazz_newIntArray (1, 0);
+} else {
+outData = obj;
+}var off = (y - this.minY) * this.scanlineStride + (x - this.minX) + this.dataOffsets[0];
+outData[0] = this.data[off];
+return outData;
+}, "~N,~N,~O");
+Clazz_defineMethod (c$, "getDataElements", 
+function (x, y, w, h, obj) {
+if ((x < this.minX) || (y < this.minY) || (x + w > this.$maxX) || (y + h > this.$maxY)) {
+throw  new ArrayIndexOutOfBoundsException ("Coordinate out of bounds!");
+}var outData;
+if (Clazz_instanceOf (obj, Array)) {
+outData = obj;
+} else {
+outData =  Clazz_newIntArray (w * h, 0);
+}var yoff = (y - this.minY) * this.scanlineStride + (x - this.minX) + this.dataOffsets[0];
+var off = 0;
+for (var ystart = 0; ystart < h; ystart++) {
+System.arraycopy (this.data, yoff, outData, off, w);
+off += w;
+yoff += this.scanlineStride;
+}
+return outData;
+}, "~N,~N,~N,~N,~O");
+Clazz_defineMethod (c$, "setDataElements", 
+function (x, y, obj) {
+if ((x < this.minX) || (y < this.minY) || (x >= this.$maxX) || (y >= this.$maxY)) {
+throw  new ArrayIndexOutOfBoundsException ("Coordinate out of bounds!");
+}var inData = obj;
+var off = (y - this.minY) * this.scanlineStride + (x - this.minX) + this.dataOffsets[0];
+this.data[off] = inData[0];
+this.markDirty ();
+}, "~N,~N,~O");
+Clazz_defineMethod (c$, "setDataElements", 
+function (x, y, inRaster) {
+var dstOffX = x + inRaster.getMinX ();
+var dstOffY = y + inRaster.getMinY ();
+var width = inRaster.getWidth ();
+var height = inRaster.getHeight ();
+if ((dstOffX < this.minX) || (dstOffY < this.minY) || (dstOffX + width > this.$maxX) || (dstOffY + height > this.$maxY)) {
+throw  new ArrayIndexOutOfBoundsException ("Coordinate out of bounds!");
+}this.setDataElements (dstOffX, dstOffY, width, height, inRaster);
+}, "~N,~N,java.awt.image.Raster");
+Clazz_defineMethod (c$, "setDataElements", 
+ function (dstX, dstY, width, height, inRaster) {
+if (width <= 0 || height <= 0) {
+return;
+}var srcOffX = inRaster.getMinX ();
+var srcOffY = inRaster.getMinY ();
+var tdata = null;
+if (Clazz_instanceOf (inRaster, jssun.awt.image.IntegerInterleavedRaster)) {
+var ict = inRaster;
+tdata = ict.getDataStorage ();
+var tss = ict.getScanlineStride ();
+var toff = ict.getDataOffset (0);
+var srcOffset = toff;
+var dstOffset = this.dataOffsets[0] + (dstY - this.minY) * this.scanlineStride + (dstX - this.minX);
+for (var startY = 0; startY < height; startY++) {
+System.arraycopy (tdata, srcOffset, this.data, dstOffset, width);
+srcOffset += tss;
+dstOffset += this.scanlineStride;
+}
+this.markDirty ();
+return;
+}var odata = null;
+for (var startY = 0; startY < height; startY++) {
+odata = inRaster.getDataElements (srcOffX, srcOffY + startY, width, 1, odata);
+this.setDataElements (dstX, dstY + startY, width, 1, odata);
+}
+}, "~N,~N,~N,~N,java.awt.image.Raster");
+Clazz_defineMethod (c$, "setDataElements", 
+function (x, y, w, h, obj) {
+if ((x < this.minX) || (y < this.minY) || (x + w > this.$maxX) || (y + h > this.$maxY)) {
+throw  new ArrayIndexOutOfBoundsException ("Coordinate out of bounds!");
+}var inData = obj;
+var yoff = (y - this.minY) * this.scanlineStride + (x - this.minX) + this.dataOffsets[0];
+var off = 0;
+for (var ystart = 0; ystart < h; ystart++) {
+System.arraycopy (inData, off, this.data, yoff, w);
+off += w;
+yoff += this.scanlineStride;
+}
+this.markDirty ();
+}, "~N,~N,~N,~N,~O");
+Clazz_overrideMethod (c$, "createWritableChild", 
+function (x, y, width, height, x0, y0, bandList) {
+if (x < this.minX) {
+throw  new java.awt.image.RasterFormatException ("x lies outside raster");
+}if (y < this.minY) {
+throw  new java.awt.image.RasterFormatException ("y lies outside raster");
+}if ((x + width < x) || (x + width > this.minX + this.width)) {
+throw  new java.awt.image.RasterFormatException ("(x + width) is outside raster");
+}if ((y + height < y) || (y + height > this.minY + this.height)) {
+throw  new java.awt.image.RasterFormatException ("(y + height) is outside raster");
+}var sm;
+if (bandList != null) sm = this.sampleModel.createSubsetSampleModel (bandList);
+ else sm = this.sampleModel;
+var deltaX = x0 - x;
+var deltaY = y0 - y;
+return  new jssun.awt.image.IntegerInterleavedRaster (sm, this.dataBuffer,  new java.awt.Rectangle (x0, y0, width, height),  new java.awt.Point (this.sampleModelTranslateX + deltaX, this.sampleModelTranslateY + deltaY), this);
+}, "~N,~N,~N,~N,~N,~N,~A");
+Clazz_overrideMethod (c$, "createChild", 
+function (x, y, width, height, x0, y0, bandList) {
+return this.createWritableChild (x, y, width, height, x0, y0, bandList);
+}, "~N,~N,~N,~N,~N,~N,~A");
+Clazz_defineMethod (c$, "createCompatibleWritableRaster", 
+function (w, h) {
+if (w <= 0 || h <= 0) {
+throw  new java.awt.image.RasterFormatException ("negative " + ((w <= 0) ? "width" : "height"));
+}var sm = this.sampleModel.createCompatibleSampleModel (w, h);
+return  new jssun.awt.image.IntegerInterleavedRaster (sm,  new java.awt.Point (0, 0));
+}, "~N,~N");
+Clazz_defineMethod (c$, "createCompatibleWritableRaster", 
+function () {
+return this.createCompatibleWritableRaster (this.width, this.height);
+});
+Clazz_overrideMethod (c$, "toString", 
+function () {
+return  String.instantialize ("IntegerInterleavedRaster: width = " + this.width + " height = " + this.height + " #Bands = " + this.numBands + " xOff = " + this.sampleModelTranslateX + " yOff = " + this.sampleModelTranslateY + " dataOffset[0] " + this.dataOffsets[0]);
+});
+});
+Clazz_declarePackage ("jssun.awt.image");
+Clazz_load (["jssun.awt.image.SunWritableRaster"], "jssun.awt.image.IntegerComponentRaster", ["java.lang.ArrayIndexOutOfBoundsException", "java.awt.Point", "$.Rectangle", "java.awt.image.DataBufferInt", "$.RasterFormatException", "$.SinglePixelPackedSampleModel"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.bandOffset = 0;
+this.dataOffsets = null;
+this.scanlineStride = 0;
+this.pixelStride = 0;
+this.data = null;
+this.numDataElems = 0;
+this.type = 0;
+this.maxX = 0;
+this.maxY = 0;
+Clazz_instantialize (this, arguments);
+}, jssun.awt.image, "IntegerComponentRaster", jssun.awt.image.SunWritableRaster);
+Clazz_makeConstructor (c$, 
+function (sampleModel, origin) {
+Clazz_superConstructor (this, jssun.awt.image.IntegerComponentRaster, []);
+this.setIntCompRaster (sampleModel, sampleModel.createDataBuffer (),  new java.awt.Rectangle (origin.x, origin.y, sampleModel.getWidth (), sampleModel.getHeight ()), origin, null);
+}, "java.awt.image.SampleModel,java.awt.Point");
+Clazz_makeConstructor (c$, 
+function (sampleModel, dataBuffer, origin) {
+Clazz_superConstructor (this, jssun.awt.image.IntegerComponentRaster, []);
+this.setIntCompRaster (sampleModel, dataBuffer,  new java.awt.Rectangle (origin.x, origin.y, sampleModel.getWidth (), sampleModel.getHeight ()), origin, null);
+}, "java.awt.image.SampleModel,java.awt.image.DataBuffer,java.awt.Point");
+Clazz_makeConstructor (c$, 
+function () {
+Clazz_superConstructor (this, jssun.awt.image.IntegerComponentRaster, []);
+});
+Clazz_makeConstructor (c$, 
+function (sampleModel, dataBuffer, aRegion, origin, parent) {
+Clazz_superConstructor (this, jssun.awt.image.IntegerComponentRaster, []);
+this.setIntCompRaster (sampleModel, dataBuffer, aRegion, origin, parent);
+}, "java.awt.image.SampleModel,java.awt.image.DataBuffer,java.awt.Rectangle,java.awt.Point,java.awt.image.Raster");
+Clazz_defineMethod (c$, "setIntCompRaster", 
+function (sampleModel, dataBuffer, aRegion, origin, parent) {
+this.setSunRaster (sampleModel, dataBuffer, aRegion, origin, parent);
+this.maxX = this.minX + this.width;
+this.maxY = this.minY + this.height;
+if (!(Clazz_instanceOf (dataBuffer, java.awt.image.DataBufferInt))) {
+throw  new java.awt.image.RasterFormatException ("IntegerComponentRasters must haveinteger DataBuffers");
+}var dbi = dataBuffer;
+if (dbi.getNumBanks () != 1) {
+throw  new java.awt.image.RasterFormatException ("DataBuffer for IntegerComponentRasters must only have 1 bank.");
+}this.data = jssun.awt.image.SunWritableRaster.stealData (dbi, 0);
+if (Clazz_instanceOf (sampleModel, java.awt.image.SinglePixelPackedSampleModel)) {
+var sppsm = sampleModel;
+var boffsets = sppsm.getBitOffsets ();
+var notByteBoundary = false;
+for (var i = 1; i < boffsets.length; i++) {
+if ((boffsets[i] % 8) != 0) {
+notByteBoundary = true;
+}}
+this.type = (notByteBoundary ? 9 : 10);
+this.scanlineStride = sppsm.getScanlineStride ();
+this.pixelStride = 1;
+this.dataOffsets =  Clazz_newIntArray (1, 0);
+this.dataOffsets[0] = dbi.getOffset ();
+this.bandOffset = this.dataOffsets[0];
+var xOffset = aRegion.x - origin.x;
+var yOffset = aRegion.y - origin.y;
+this.dataOffsets[0] += xOffset + yOffset * this.scanlineStride;
+this.numDataElems = sppsm.getNumDataElements ();
+} else {
+throw  new java.awt.image.RasterFormatException ("IntegerComponentRasters must have SinglePixelPackedSampleModel");
+}this.verify ();
+}, "java.awt.image.SampleModel,java.awt.image.DataBuffer,java.awt.Rectangle,java.awt.Point,java.awt.image.Raster");
+Clazz_defineMethod (c$, "getDataOffsets", 
+function () {
+return this.dataOffsets.clone ();
+});
+Clazz_defineMethod (c$, "getDataOffset", 
+function (band) {
+return this.dataOffsets[band];
+}, "~N");
+Clazz_defineMethod (c$, "getScanlineStride", 
+function () {
+return this.scanlineStride;
+});
+Clazz_defineMethod (c$, "getPixelStride", 
+function () {
+return this.pixelStride;
+});
+Clazz_defineMethod (c$, "getDataStorage", 
+function () {
+return this.data;
+});
+Clazz_defineMethod (c$, "getDataElements", 
+function (x, y, obj) {
+if ((x < this.minX) || (y < this.minY) || (x >= this.maxX) || (y >= this.maxY)) {
+throw  new ArrayIndexOutOfBoundsException ("Coordinate out of bounds!");
+}var outData;
+if (obj == null) {
+outData =  Clazz_newIntArray (this.numDataElements, 0);
+} else {
+outData = obj;
+}var off = (y - this.minY) * this.scanlineStride + (x - this.minX) * this.pixelStride;
+for (var band = 0; band < this.numDataElements; band++) {
+outData[band] = this.data[this.dataOffsets[band] + off];
+}
+return outData;
+}, "~N,~N,~O");
+Clazz_defineMethod (c$, "getDataElements", 
+function (x, y, w, h, obj) {
+if ((x < this.minX) || (y < this.minY) || (x + w > this.maxX) || (y + h > this.maxY)) {
+throw  new ArrayIndexOutOfBoundsException ("Coordinate out of bounds!");
+}var outData;
+if (Clazz_instanceOf (obj, Array)) {
+outData = obj;
+} else {
+outData =  Clazz_newIntArray (this.numDataElements * w * h, 0);
+}var yoff = (y - this.minY) * this.scanlineStride + (x - this.minX) * this.pixelStride;
+var xoff;
+var off = 0;
+var xstart;
+var ystart;
+for (ystart = 0; ystart < h; ystart++, yoff += this.scanlineStride) {
+xoff = yoff;
+for (xstart = 0; xstart < w; xstart++, xoff += this.pixelStride) {
+for (var c = 0; c < this.numDataElements; c++) {
+outData[off++] = this.data[this.dataOffsets[c] + xoff];
+}
+}
+}
+return outData;
+}, "~N,~N,~N,~N,~O");
+Clazz_defineMethod (c$, "setDataElements", 
+function (x, y, obj) {
+if ((x < this.minX) || (y < this.minY) || (x >= this.maxX) || (y >= this.maxY)) {
+throw  new ArrayIndexOutOfBoundsException ("Coordinate out of bounds!");
+}var inData = obj;
+var off = (y - this.minY) * this.scanlineStride + (x - this.minX) * this.pixelStride;
+for (var i = 0; i < this.numDataElements; i++) {
+this.data[this.dataOffsets[i] + off] = inData[i];
+}
+this.markDirty ();
+}, "~N,~N,~O");
+Clazz_overrideMethod (c$, "setDataElementsRaster", 
+function (x, y, inRaster) {
+var dstOffX = x + inRaster.getMinX ();
+var dstOffY = y + inRaster.getMinY ();
+var width = inRaster.getWidth ();
+var height = inRaster.getHeight ();
+if ((dstOffX < this.minX) || (dstOffY < this.minY) || (dstOffX + width > this.maxX) || (dstOffY + height > this.maxY)) {
+throw  new ArrayIndexOutOfBoundsException ("Coordinate out of bounds!");
+}this.setDataElementsRaster4 (dstOffX, dstOffY, width, height, inRaster);
+}, "~N,~N,java.awt.image.Raster");
+Clazz_defineMethod (c$, "setDataElementsRaster4", 
+ function (dstX, dstY, width, height, inRaster) {
+if (width <= 0 || height <= 0) {
+return;
+}var srcOffX = inRaster.getMinX ();
+var srcOffY = inRaster.getMinY ();
+var tdata = null;
+if (Clazz_instanceOf (inRaster, jssun.awt.image.IntegerComponentRaster) && (this.pixelStride == 1) && (this.numDataElements == 1)) {
+var ict = inRaster;
+if (ict.getNumDataElements () != 1) {
+throw  new ArrayIndexOutOfBoundsException ("Number of bands does not match");
+}tdata = ict.getDataStorage ();
+var tss = ict.getScanlineStride ();
+var toff = ict.getDataOffset (0);
+var srcOffset = toff;
+var dstOffset = this.dataOffsets[0] + (dstY - this.minY) * this.scanlineStride + (dstX - this.minX);
+if (ict.getPixelStride () == this.pixelStride) {
+width *= this.pixelStride;
+for (var startY = 0; startY < height; startY++) {
+System.arraycopy (tdata, srcOffset, this.data, dstOffset, width);
+srcOffset += tss;
+dstOffset += this.scanlineStride;
+}
+this.markDirty ();
+return;
+}}var odata = null;
+for (var startY = 0; startY < height; startY++) {
+odata = inRaster.getDataElements (srcOffX, srcOffY + startY, width, 1, odata);
+this.setDataElements (dstX, dstY + startY, width, 1, odata);
+}
+}, "~N,~N,~N,~N,java.awt.image.Raster");
+Clazz_defineMethod (c$, "setDataElements", 
+function (x, y, w, h, obj) {
+if ((x < this.minX) || (y < this.minY) || (x + w > this.maxX) || (y + h > this.maxY)) {
+throw  new ArrayIndexOutOfBoundsException ("Coordinate out of bounds!");
+}var inData = obj;
+var yoff = (y - this.minY) * this.scanlineStride + (x - this.minX) * this.pixelStride;
+var xoff;
+var off = 0;
+var xstart;
+var ystart;
+for (ystart = 0; ystart < h; ystart++, yoff += this.scanlineStride) {
+xoff = yoff;
+for (xstart = 0; xstart < w; xstart++, xoff += this.pixelStride) {
+for (var c = 0; c < this.numDataElements; c++) {
+this.data[this.dataOffsets[c] + xoff] = inData[off++];
+}
+}
+}
+this.markDirty ();
+}, "~N,~N,~N,~N,~O");
+Clazz_overrideMethod (c$, "createWritableChild", 
+function (x, y, width, height, x0, y0, bandList) {
+if (x < this.minX) {
+throw  new java.awt.image.RasterFormatException ("x lies outside raster");
+}if (y < this.minY) {
+throw  new java.awt.image.RasterFormatException ("y lies outside raster");
+}if ((x + width < x) || (x + width > this.minX + this.width)) {
+throw  new java.awt.image.RasterFormatException ("(x + width) is outside raster");
+}if ((y + height < y) || (y + height > this.minY + this.height)) {
+throw  new java.awt.image.RasterFormatException ("(y + height) is outside raster");
+}var sm;
+if (bandList != null) sm = this.sampleModel.createSubsetSampleModel (bandList);
+ else sm = this.sampleModel;
+var deltaX = x0 - x;
+var deltaY = y0 - y;
+return  new jssun.awt.image.IntegerComponentRaster (sm, this.dataBuffer,  new java.awt.Rectangle (x0, y0, width, height),  new java.awt.Point (this.sampleModelTranslateX + deltaX, this.sampleModelTranslateY + deltaY), this);
+}, "~N,~N,~N,~N,~N,~N,~A");
+Clazz_overrideMethod (c$, "createChild", 
+function (x, y, width, height, x0, y0, bandList) {
+return this.createWritableChild (x, y, width, height, x0, y0, bandList);
+}, "~N,~N,~N,~N,~N,~N,~A");
+Clazz_defineMethod (c$, "createCompatibleWritableRaster", 
+function (w, h) {
+if (w <= 0 || h <= 0) {
+throw  new java.awt.image.RasterFormatException ("negative " + ((w <= 0) ? "width" : "height"));
+}var sm = this.sampleModel.createCompatibleSampleModel (w, h);
+return  new jssun.awt.image.IntegerComponentRaster (sm,  new java.awt.Point (0, 0));
+}, "~N,~N");
+Clazz_defineMethod (c$, "createCompatibleWritableRaster", 
+function () {
+return this.createCompatibleWritableRaster (this.width, this.height);
+});
+Clazz_defineMethod (c$, "verify", 
+function () {
+if (this.width <= 0 || this.height <= 0 || this.height > (Clazz_doubleToInt (2147483647 / this.width))) {
+throw  new java.awt.image.RasterFormatException ("Invalid raster dimension");
+}if (this.dataOffsets[0] < 0) {
+throw  new java.awt.image.RasterFormatException ("Data offset (" + this.dataOffsets[0] + ") must be >= 0");
+}if (this.minX - this.sampleModelTranslateX < 0 || this.minY - this.sampleModelTranslateY < 0) {
+throw  new java.awt.image.RasterFormatException ("Incorrect origin/translate: (" + this.minX + ", " + this.minY + ") / (" + this.sampleModelTranslateX + ", " + this.sampleModelTranslateY + ")");
+}if (this.scanlineStride < 0 || this.scanlineStride > (Clazz_doubleToInt (2147483647 / this.height))) {
+throw  new java.awt.image.RasterFormatException ("Incorrect scanline stride: " + this.scanlineStride);
+}if (this.height > 1 || this.minY - this.sampleModelTranslateY > 0) {
+if (this.scanlineStride > this.data.length) {
+throw  new java.awt.image.RasterFormatException ("Incorrect scanline stride: " + this.scanlineStride);
+}}var lastScanOffset = (this.height - 1) * this.scanlineStride;
+if (this.pixelStride < 0 || this.pixelStride > (Clazz_doubleToInt (2147483647 / this.width)) || this.pixelStride > this.data.length) {
+throw  new java.awt.image.RasterFormatException ("Incorrect pixel stride: " + this.pixelStride);
+}var lastPixelOffset = (this.width - 1) * this.pixelStride;
+if (lastPixelOffset > (2147483647 - lastScanOffset)) {
+throw  new java.awt.image.RasterFormatException ("Incorrect raster attributes");
+}lastPixelOffset += lastScanOffset;
+var index;
+var maxIndex = 0;
+for (var i = 0; i < this.numDataElements; i++) {
+if (this.dataOffsets[i] > (2147483647 - lastPixelOffset)) {
+throw  new java.awt.image.RasterFormatException ("Incorrect band offset: " + this.dataOffsets[i]);
+}index = lastPixelOffset + this.dataOffsets[i];
+if (index > maxIndex) {
+maxIndex = index;
+}}
+if (this.data.length <= maxIndex) {
+throw  new java.awt.image.RasterFormatException ("Data array too small (should be > " + maxIndex + " )");
+}});
+Clazz_overrideMethod (c$, "toString", 
+function () {
+return  String.instantialize ("IntegerComponentRaster: width = " + this.width + " height = " + this.height + " #Bands = " + this.numBands + " #DataElements " + this.numDataElements + " xOff = " + this.sampleModelTranslateX + " yOff = " + this.sampleModelTranslateY + " dataOffset[0] " + this.dataOffsets[0]);
+});
+Clazz_defineStatics (c$,
+"TYPE_CUSTOM", 0,
+"TYPE_BYTE_SAMPLES", 1,
+"TYPE_USHORT_SAMPLES", 2,
+"TYPE_INT_SAMPLES", 3,
+"TYPE_BYTE_BANDED_SAMPLES", 4,
+"TYPE_USHORT_BANDED_SAMPLES", 5,
+"TYPE_INT_BANDED_SAMPLES", 6,
+"TYPE_BYTE_PACKED_SAMPLES", 7,
+"TYPE_USHORT_PACKED_SAMPLES", 8,
+"TYPE_INT_PACKED_SAMPLES", 9,
+"TYPE_INT_8BIT_SAMPLES", 10,
+"TYPE_BYTE_BINARY_SAMPLES", 11);
+});
+Clazz_declarePackage ("jssun.awt.image");
+Clazz_load (["java.awt.image.WritableRaster", "jssun.awt.image.DataStealer"], "jssun.awt.image.SunWritableRaster", ["jssun.java2d.StateTrackable", "$.StateTrackableDelegate"], function () {
+c$ = Clazz_decorateAsClass (function () {
+this.theTrackable = null;
+Clazz_instantialize (this, arguments);
+}, jssun.awt.image, "SunWritableRaster", java.awt.image.WritableRaster);
+c$.getStealer = Clazz_defineMethod (c$, "getStealer", 
+ function () {
+return (jssun.awt.image.SunWritableRaster.stealer == null ? jssun.awt.image.SunWritableRaster.stealer = ((Clazz_isClassDefined ("jssun.awt.image.SunWritableRaster$1") ? 0 : jssun.awt.image.SunWritableRaster.$SunWritableRaster$1$ ()), Clazz_innerTypeInstance (jssun.awt.image.SunWritableRaster$1, this, null)) : jssun.awt.image.SunWritableRaster.stealer);
+});
+c$.stealData = Clazz_defineMethod (c$, "stealData", 
+function (dbb, bank) {
+return jssun.awt.image.SunWritableRaster.getStealer ().getData (dbb, bank);
+}, "java.awt.image.DataBufferByte,~N");
+c$.stealData = Clazz_defineMethod (c$, "stealData", 
+function (dbi, bank) {
+return jssun.awt.image.SunWritableRaster.getStealer ().getData (dbi, bank);
+}, "java.awt.image.DataBufferInt,~N");
+c$.stealTrackable = Clazz_defineMethod (c$, "stealTrackable", 
+function (db) {
+return jssun.awt.image.SunWritableRaster.getStealer ().getTrackable (db);
+}, "java.awt.image.DataBuffer");
+c$.setTrackable = Clazz_defineMethod (c$, "setTrackable", 
+function (db, trackable) {
+jssun.awt.image.SunWritableRaster.getStealer ().setTrackable (db, trackable);
+}, "java.awt.image.DataBuffer,jssun.java2d.StateTrackableDelegate");
+c$.makeTrackable = Clazz_defineMethod (c$, "makeTrackable", 
+function (db) {
+jssun.awt.image.SunWritableRaster.getStealer ().setTrackable (db, jssun.java2d.StateTrackableDelegate.createInstance (jssun.java2d.StateTrackable.State.STABLE));
+}, "java.awt.image.DataBuffer");
+c$.markDirty = Clazz_defineMethod (c$, "markDirty", 
+function (db) {
+jssun.awt.image.SunWritableRaster.getStealer ().getTrackable (db).markDirty ();
+}, "java.awt.image.DataBuffer");
+c$.markDirty = Clazz_defineMethod (c$, "markDirty", 
+function (wr) {
+if (Clazz_instanceOf (wr, jssun.awt.image.SunWritableRaster)) {
+(wr).markDirty ();
+} else {
+jssun.awt.image.SunWritableRaster.markDirty (wr.getDataBuffer ());
+}}, "java.awt.image.WritableRaster");
+Clazz_makeConstructor (c$, 
+function (sampleModel, origin) {
+Clazz_superConstructor (this, jssun.awt.image.SunWritableRaster, [sampleModel, origin]);
+this.theTrackable = jssun.awt.image.SunWritableRaster.stealTrackable (this.dataBuffer);
+}, "java.awt.image.SampleModel,java.awt.Point");
+Clazz_makeConstructor (c$, 
+function (sampleModel, dataBuffer, origin) {
+Clazz_superConstructor (this, jssun.awt.image.SunWritableRaster, [sampleModel, dataBuffer, origin]);
+this.theTrackable = jssun.awt.image.SunWritableRaster.stealTrackable (dataBuffer);
+}, "java.awt.image.SampleModel,java.awt.image.DataBuffer,java.awt.Point");
+Clazz_makeConstructor (c$, 
+function () {
+Clazz_superConstructor (this, jssun.awt.image.SunWritableRaster, []);
+});
+Clazz_makeConstructor (c$, 
+function (sampleModel, dataBuffer, aRegion, sampleModelTranslate, parent) {
+Clazz_superConstructor (this, jssun.awt.image.SunWritableRaster, []);
+this.setSunRaster (sampleModel, dataBuffer, aRegion, sampleModelTranslate, parent);
+}, "java.awt.image.SampleModel,java.awt.image.DataBuffer,java.awt.Rectangle,java.awt.Point,java.awt.image.Raster");
+Clazz_defineMethod (c$, "setSunRaster", 
+function (sampleModel, dataBuffer, aRegion, sampleModelTranslate, parent) {
+this.setRaster (sampleModel, dataBuffer, aRegion, sampleModelTranslate, parent);
+this.theTrackable = jssun.awt.image.SunWritableRaster.stealTrackable (dataBuffer);
+}, "java.awt.image.SampleModel,java.awt.image.DataBuffer,java.awt.Rectangle,java.awt.Point,java.awt.image.Raster");
+Clazz_defineMethod (c$, "markDirty", 
+function () {
+this.theTrackable.markDirty ();
+});
+c$.$SunWritableRaster$1$ = function () {
+Clazz_pu$h(self.c$);
+c$ = Clazz_declareAnonymous (jssun.awt.image, "SunWritableRaster$1", null, jssun.awt.image.DataStealer);
+Clazz_defineMethod (c$, "getData", 
+function (dbb, bank) {
+return dbb.bankdata[bank];
+}, "java.awt.image.DataBufferByte,~N");
+Clazz_defineMethod (c$, "getData", 
+function (dbi, bank) {
+return dbi.bankdata[bank];
+}, "java.awt.image.DataBufferInt,~N");
+Clazz_defineMethod (c$, "getTrackable", 
+function (db) {
+return db.theTrackable;
+}, "java.awt.image.DataBuffer");
+Clazz_defineMethod (c$, "setTrackable", 
+function (db, trackable) {
+db.theTrackable = trackable;
+}, "java.awt.image.DataBuffer,jssun.java2d.StateTrackableDelegate");
+c$ = Clazz_p0p ();
+};
+Clazz_defineStatics (c$,
+"stealer", null);
+});
+Clazz_declarePackage ("jssun.awt.image");
+Clazz_declareInterface (jssun.awt.image, "DataStealer");
+})(Clazz
+,Clazz.getClassName
+,Clazz.newLongArray
+,Clazz.doubleToByte
+,Clazz.doubleToInt
+,Clazz.doubleToLong
+,Clazz.declarePackage
+,Clazz.instanceOf
+,Clazz.load
+,Clazz.instantialize
+,Clazz.decorateAsClass
+,Clazz.floatToInt
+,Clazz.floatToLong
+,Clazz.makeConstructor
+,Clazz.defineEnumConstant
+,Clazz.exceptionOf
+,Clazz.newIntArray
+,Clazz.defineStatics
+,Clazz.newFloatArray
+,Clazz.declareType
+,Clazz.prepareFields
+,Clazz.superConstructor
+,Clazz.newByteArray
+,Clazz.declareInterface
+,Clazz.p0p
+,Clazz.pu$h
+,Clazz.newShortArray
+,Clazz.innerTypeInstance
+,Clazz.isClassDefined
+,Clazz.prepareCallback
+,Clazz.newArray
+,Clazz.castNullAs
+,Clazz.floatToShort
+,Clazz.superCall
+,Clazz.decorateAsType
+,Clazz.newBooleanArray
+,Clazz.newCharArray
+,Clazz.implementOf
+,Clazz.newDoubleArray
+,Clazz.overrideConstructor
+,Clazz.clone
+,Clazz.doubleToShort
+,Clazz.getInheritedLevel
+,Clazz.getParamsType
+,Clazz.isAF
+,Clazz.isAI
+,Clazz.isAS
+,Clazz.isASS
+,Clazz.isAP
+,Clazz.isAFloat
+,Clazz.isAII
+,Clazz.isAFF
+,Clazz.isAFFF
+,Clazz.tryToSearchAndExecute
+,Clazz.getStackTrace
+,Clazz.inheritArgs
+,Clazz.alert
+,Clazz.defineMethod
+,Clazz.overrideMethod
+,Clazz.declareAnonymous
+,Clazz.checkPrivateMethod
+,Clazz.cloneFinals
+);