M7UbCw> -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);
-g.drawString (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);
-g.drawString (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);
-g.drawString (jalview.util.MessageManager.getString ("label.right_click"), 2, 8);
-g.drawString (jalview.util.MessageManager.getString ("label.to_add_annotation"), 2, 18);
-}}, "java.awt.Graphics,~N");
-c$.$AnnotationLabels$1$ = function () {
-Clazz.pu$h ();
-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 ();
-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 ();
-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 ();
-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 ();
-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 ();
-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 ();
-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 ();
-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 ("jalview.appletgui");
+Clazz.load (["awt2swing.Panel", "java.awt.event.ActionListener", "$.MouseListener", "$.MouseMotionListener"], "jalview.appletgui.AnnotationLabels", ["awt2swing.Checkbox", "$.CheckboxMenuItem", "$.Frame", "$.MenuItem", "$.PopupMenu", "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);
+g.drawString (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);
+g.drawString (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);
+g.drawString (jalview.util.MessageManager.getString ("label.right_click"), 2, 8);
+g.drawString (jalview.util.MessageManager.getString ("label.to_add_annotation"), 2, 18);
+}}, "java.awt.Graphics,~N");
+c$.$AnnotationLabels$1$ = function () {
+Clazz.pu$h ();
+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 ();
+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 ();
+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 ();
+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 ();
+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 ();
+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 ();
+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 ();
+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");
+});
diff --git a/bin/jalview/appletgui/AnnotationPanel.class b/bin/jalview/appletgui/AnnotationPanel.class
index ec1d4ce4544ce48b7fdf624f331f19f2a9a28db2..8d48e905c927a7ab5f0c56c46847a025e0519e22 100644
GIT binary patch
delta 37
tcmX?{b0}v6qdMc+%}nYmm;_ZAxc@K+u`_!7We{Lw6qb_OyhpR02LR;s3aJ19
delta 38
ucmX?XX5u`_!7We{Lw6qXWa+Pqt{od*Ez#R{tc
diff --git a/bin/jalview/appletgui/AnnotationPanel.js b/bin/jalview/appletgui/AnnotationPanel.js
index 33f7259..6234bd3 100644
--- a/bin/jalview/appletgui/AnnotationPanel.js
+++ b/bin/jalview/appletgui/AnnotationPanel.js
@@ -1,364 +1,364 @@
-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", "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) {
-g.drawString (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.appletgui");
+Clazz.load (["awt2swing.Panel", "jalview.renderer.AwtRenderPanelI", "java.awt.event.ActionListener", "$.AdjustmentListener", "$.MouseListener", "$.MouseMotionListener", "java.awt.Color"], "jalview.appletgui.AnnotationPanel", ["awt2swing.MenuItem", "$.PopupMenu", "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) {
+g.drawString (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);
+});
diff --git a/bin/jalview/appletgui/AnnotationRowFilter.js b/bin/jalview/appletgui/AnnotationRowFilter.js
index 8b9fe70..aafbcad 100644
--- a/bin/jalview/appletgui/AnnotationRowFilter.js
+++ b/bin/jalview/appletgui/AnnotationRowFilter.js
@@ -1,131 +1,131 @@
-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", "$.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");
+});
diff --git a/bin/jalview/appletgui/AppletJmol.js b/bin/jalview/appletgui/AppletJmol.js
index d2a97b8..b8f808a 100644
--- a/bin/jalview/appletgui/AppletJmol.js
+++ b/bin/jalview/appletgui/AppletJmol.js
@@ -1,48 +1,48 @@
-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 ();
-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 (["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 ();
+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 ();
+};
+});
diff --git a/bin/jalview/appletgui/AppletJmolBinding.js b/bin/jalview/appletgui/AppletJmolBinding.js
index cdb8890..7f93e13 100644
--- a/bin/jalview/appletgui/AppletJmolBinding.js
+++ b/bin/jalview/appletgui/AppletJmolBinding.js
@@ -1,2 +1,2 @@
-Clazz.declarePackage ("jalview.appletgui");
-c$ = Clazz.declareType (jalview.appletgui, "AppletJmolBinding");
+Clazz.declarePackage ("jalview.appletgui");
+c$ = Clazz.declareType (jalview.appletgui, "AppletJmolBinding");
diff --git a/bin/jalview/appletgui/CutAndPasteTransfer.class b/bin/jalview/appletgui/CutAndPasteTransfer.class
index 31c248dc77589aa25460b1b1c9d1e1fbc091a048..9292d368f64112dcecaa6904cb8f6a5fcc73e40e 100644
GIT binary patch
delta 30
mcmeB8?M~g$tHT((xlc!!iP@8ZWAYL`TP9AI%}@1KFarRga#tHT(-xlc!!iP@WhYw{93TNXAZMyJh>^;R$g0I;SB<^TWy
diff --git a/bin/jalview/appletgui/CutAndPasteTransfer.js b/bin/jalview/appletgui/CutAndPasteTransfer.js
index c1e339a..4030094 100644
--- a/bin/jalview/appletgui/CutAndPasteTransfer.js
+++ b/bin/jalview/appletgui/CutAndPasteTransfer.js
@@ -1,264 +1,264 @@
-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",
-($fz = 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");
-}, $fz.isPrivate = true, $fz));
-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 ("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",
+($fz = 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");
+}, $fz.isPrivate = true, $fz));
+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");
+});
diff --git a/bin/jalview/appletgui/EditNameDialog.js b/bin/jalview/appletgui/EditNameDialog.js
index efedf02..68044ad 100644
--- a/bin/jalview/appletgui/EditNameDialog.js
+++ b/bin/jalview/appletgui/EditNameDialog.js
@@ -1,44 +1,44 @@
-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 ("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");
+});
diff --git a/bin/jalview/appletgui/EmbmenuFrame.js b/bin/jalview/appletgui/EmbmenuFrame.js
index 13a7183..7a5362c 100644
--- a/bin/jalview/appletgui/EmbmenuFrame.js
+++ b/bin/jalview/appletgui/EmbmenuFrame.js
@@ -1,110 +1,110 @@
-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 ("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;
+});
diff --git a/bin/jalview/appletgui/ExtJmol.js b/bin/jalview/appletgui/ExtJmol.js
index 170d005..150efd5 100644
--- a/bin/jalview/appletgui/ExtJmol.js
+++ b/bin/jalview/appletgui/ExtJmol.js
@@ -1,17 +1,17 @@
-Clazz.declarePackage ("jalview.appletgui");
-Clazz.load (["jalview.structures.models.AAStructureBindingModel"], "jalview.appletgui.ExtJmol", null, function () {
-c$ = Clazz.declareType (jalview.appletgui, "ExtJmol", jalview.structures.models.AAStructureBindingModel);
-Clazz.overrideMethod (c$, "getPdbFile",
-function () {
-return null;
-});
-Clazz.overrideMethod (c$, "updateColours",
-function (source) {
-}, "~O");
-Clazz.overrideMethod (c$, "releaseReferences",
-function (svl) {
-}, "~O");
-Clazz.overrideMethod (c$, "highlightAtoms",
-function (atoms) {
-}, "java.util.List");
-});
+Clazz.declarePackage ("jalview.appletgui");
+Clazz.load (["jalview.structures.models.AAStructureBindingModel"], "jalview.appletgui.ExtJmol", null, function () {
+c$ = Clazz.declareType (jalview.appletgui, "ExtJmol", jalview.structures.models.AAStructureBindingModel);
+Clazz.overrideMethod (c$, "getPdbFile",
+function () {
+return null;
+});
+Clazz.overrideMethod (c$, "updateColours",
+function (source) {
+}, "~O");
+Clazz.overrideMethod (c$, "releaseReferences",
+function (svl) {
+}, "~O");
+Clazz.overrideMethod (c$, "highlightAtoms",
+function (atoms) {
+}, "java.util.List");
+});
diff --git a/bin/jalview/appletgui/FeatureColourChooser.class b/bin/jalview/appletgui/FeatureColourChooser.class
index 0c8e5546e0eb12c4dd5fd5489da9a2a904e9caf5..8aee64e3e234310caabbce9fce854fb0e5f85dfa 100644
GIT binary patch
delta 27
jcmewt^*3sRy9(p$$sQ^XIJg*Ci`W^LGjBFj_2mEno$3iM
delta 28
kcmewx^)G6Jy9(o*$sQ^XIJp_vir5*KGcav7Q1#^i0Hx^(F#rGn
diff --git a/bin/jalview/appletgui/FeatureColourChooser.js b/bin/jalview/appletgui/FeatureColourChooser.js
index cfa5380..929c04b 100644
--- a/bin/jalview/appletgui/FeatureColourChooser.js
+++ b/bin/jalview/appletgui/FeatureColourChooser.js
@@ -1,292 +1,292 @@
-Clazz.declarePackage ("jalview.appletgui");
-Clazz.load (["awt2swing.Panel", "java.awt.event.ActionListener", "$.AdjustmentListener", "$.ItemListener", "$.MouseListener", "awt2swing.Checkbox", "$.Choice", "$.Scrollbar", "$.TextField"], "jalview.appletgui.FeatureColourChooser", ["awt2swing.Label", "jalview.appletgui.JVDialog", "$.PaintRefresher", "$.UserDefinedColours", "jalview.datamodel.GraphLine", "jalview.schemes.GraduatedColor", "jalview.util.MessageManager", "java.awt.Color", "$.Dimension", "$.FlowLayout", "$.Font", "$.GridLayout", "java.awt.event.ActionEvent", "java.lang.Float"], function () {
-c$ = Clazz.decorateAsClass (function () {
-this.frame = null;
-this.owner = null;
-this.fr = null;
-this.fs = null;
-this.cs = null;
-this.oldcs = null;
-this.oldgroupColours = null;
-this.adjusting = false;
-this.min = 0;
-this.max = 0;
-this.type = null;
-this.af = null;
-this.minColour = null;
-this.maxColour = null;
-this.jPanel1 = null;
-this.jPanel2 = null;
-this.threshold = null;
-this.jPanel3 = null;
-this.jPanel4 = null;
-this.slider = null;
-this.thresholdValue = null;
-this.thresholdIsMin = null;
-this.colourFromLabel = null;
-this.threshline = null;
-Clazz.instantialize (this, arguments);
-}, jalview.appletgui, "FeatureColourChooser", awt2swing.Panel, [java.awt.event.ActionListener, java.awt.event.AdjustmentListener, java.awt.event.ItemListener, java.awt.event.MouseListener]);
-Clazz.prepareFields (c$, function () {
-this.minColour = new awt2swing.Panel ();
-this.maxColour = new awt2swing.Panel ();
-this.jPanel1 = new awt2swing.Panel ();
-this.jPanel2 = new awt2swing.Panel ();
-this.threshold = new awt2swing.Choice ();
-this.jPanel3 = new awt2swing.Panel ();
-this.jPanel4 = new awt2swing.Panel ();
-this.slider = new awt2swing.Scrollbar (0);
-this.thresholdValue = new awt2swing.TextField (20);
-this.thresholdIsMin = new awt2swing.Checkbox ();
-this.colourFromLabel = new awt2swing.Checkbox ();
-});
-Clazz.makeConstructor (c$,
-function (af, type) {
-Clazz.superConstructor (this, jalview.appletgui.FeatureColourChooser, []);
-this.af = af;
-this.init (af.getSeqcanvas ().getFeatureRenderer (), type);
-}, "jalview.appletgui.AlignFrame,~S");
-Clazz.makeConstructor (c$,
-function (fsettings, type) {
-Clazz.superConstructor (this, jalview.appletgui.FeatureColourChooser, []);
-this.fs = fsettings;
-this.init (fsettings.fr, type);
-}, "jalview.appletgui.FeatureSettings,~S");
-Clazz.defineMethod (c$, "init",
-($fz = 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);
-}}, $fz.isPrivate = true, $fz), "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",
-($fz = 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);
-}, $fz.isPrivate = true, $fz));
-Clazz.overrideMethod (c$, "actionPerformed",
-function (evt) {
-if (evt.getSource () === this.thresholdValue) {
-try {
-var f = new Float (this.thresholdValue.getText ()).floatValue ();
-this.slider.setValue (Clazz.floatToInt (f * 1000));
-this.adjustmentValueChanged (null);
-} catch (ex) {
-if (Clazz.exceptionOf (ex, NumberFormatException)) {
-} else {
-throw ex;
-}
-}
-} else if (evt.getSource () === this.minColour) {
-this.minColour_actionPerformed (null);
-} else if (evt.getSource () === this.maxColour) {
-this.maxColour_actionPerformed (null);
-} else {
-this.changeColour ();
-}}, "java.awt.event.ActionEvent");
-Clazz.overrideMethod (c$, "itemStateChanged",
-function (evt) {
-this.maxColour.setEnabled (!this.colourFromLabel.getState ());
-this.minColour.setEnabled (!this.colourFromLabel.getState ());
-this.changeColour ();
-}, "java.awt.event.ItemEvent");
-Clazz.overrideMethod (c$, "adjustmentValueChanged",
-function (evt) {
-if (!this.adjusting) {
-this.thresholdValue.setText ((this.slider.getValue () / 1000) + "");
-this.valueChanged ();
-}}, "java.awt.event.AdjustmentEvent");
-Clazz.defineMethod (c$, "valueChanged",
-function () {
-this.threshline.value = this.slider.getValue () / 1000;
-this.cs.setThresh (this.threshline.value);
-this.changeColour ();
-jalview.appletgui.PaintRefresher.Refresh (this, this.fr.getViewport ().getSequenceSetId ());
-});
-Clazz.defineMethod (c$, "minColour_actionPerformed",
-function (newCol) {
-if (newCol == null) {
-var udc = new jalview.appletgui.UserDefinedColours (this, this.minColour.getBackground (), this.owner, jalview.util.MessageManager.getString ("label.select_colour_minimum_value"));
-} else {
-this.minColour.setBackground (newCol);
-this.minColour.setForeground (newCol);
-this.minColour.repaint ();
-this.changeColour ();
-}}, "java.awt.Color");
-Clazz.defineMethod (c$, "maxColour_actionPerformed",
-function (newCol) {
-if (newCol == null) {
-var udc = new jalview.appletgui.UserDefinedColours (this, this.maxColour.getBackground (), this.owner, jalview.util.MessageManager.getString ("label.select_colour_maximum_value"));
-} else {
-this.maxColour.setBackground (newCol);
-this.maxColour.setForeground (newCol);
-this.maxColour.repaint ();
-this.changeColour ();
-}}, "java.awt.Color");
-Clazz.defineMethod (c$, "changeColour",
-function () {
-if (this.adjusting) {
-return;
-}var aboveThreshold = -1;
-if (this.threshold.getSelectedIndex () == 1) {
-aboveThreshold = 1;
-} else if (this.threshold.getSelectedIndex () == 2) {
-aboveThreshold = 0;
-}this.slider.setEnabled (true);
-this.thresholdValue.setEnabled (true);
-var acg = new jalview.schemes.GraduatedColor (this.minColour.getBackground (), this.maxColour.getBackground (), this.min, this.max);
-acg.setColourByLabel (this.colourFromLabel.getState ());
-this.maxColour.setEnabled (!this.colourFromLabel.getState ());
-this.minColour.setEnabled (!this.colourFromLabel.getState ());
-if (aboveThreshold == -1) {
-this.slider.setEnabled (false);
-this.thresholdValue.setEnabled (false);
-this.thresholdValue.setText ("");
-} else if (aboveThreshold != -1 && this.threshline == null) {
-this.threshline = new jalview.datamodel.GraphLine ((this.max - this.min) / 2, "Threshold", java.awt.Color.black);
-}if (aboveThreshold != -1) {
-this.adjusting = true;
-acg.setThresh (this.threshline.value);
-var range = this.max * 1000 - this.min * 1000;
-this.slider.setMinimum (Clazz.floatToInt (this.min * 1000));
-this.slider.setMaximum (Clazz.floatToInt (this.max * 1000));
-this.slider.setValue (Clazz.floatToInt (this.threshline.value * 1000));
-this.thresholdValue.setText (this.threshline.value + "");
-this.slider.setEnabled (true);
-this.thresholdValue.setEnabled (true);
-this.adjusting = false;
-}acg.setThreshType (aboveThreshold);
-if (this.thresholdIsMin.getState () && aboveThreshold != -1) {
-if (aboveThreshold == 1) {
-acg = new jalview.schemes.GraduatedColor (acg, this.threshline.value, this.max);
-} else {
-acg = new jalview.schemes.GraduatedColor (acg, this.min, this.threshline.value);
-}}this.fr.setColour (this.type, acg);
-this.cs = acg;
-jalview.appletgui.PaintRefresher.Refresh (this, this.fr.getViewport ().getSequenceSetId ());
-});
-Clazz.defineMethod (c$, "reset",
-function () {
-this.fr.setColour (this.type, this.oldcs);
-jalview.appletgui.PaintRefresher.Refresh (this, this.fr.getViewport ().getSequenceSetId ());
-});
-Clazz.overrideMethod (c$, "mouseClicked",
-function (evt) {
-}, "java.awt.event.MouseEvent");
-Clazz.overrideMethod (c$, "mousePressed",
-function (evt) {
-}, "java.awt.event.MouseEvent");
-Clazz.overrideMethod (c$, "mouseReleased",
-function (evt) {
-if (evt.getSource () === this.minColour || evt.getSource () === this.maxColour) {
-this.actionPerformed ( new java.awt.event.ActionEvent (evt.getSource (), 1, "Clicked"));
-} else {
-jalview.appletgui.PaintRefresher.Refresh (this, this.fr.getViewport ().getSequenceSetId ());
-}}, "java.awt.event.MouseEvent");
-Clazz.overrideMethod (c$, "mouseEntered",
-function (evt) {
-}, "java.awt.event.MouseEvent");
-Clazz.overrideMethod (c$, "mouseExited",
-function (evt) {
-}, "java.awt.event.MouseEvent");
-});
+Clazz.declarePackage ("jalview.appletgui");
+Clazz.load (["awt2swing.Panel", "java.awt.event.ActionListener", "$.AdjustmentListener", "$.ItemListener", "$.MouseListener", "awt2swing.Checkbox", "$.Choice", "$.Scrollbar", "$.TextField"], "jalview.appletgui.FeatureColourChooser", ["awt2swing.Label", "jalview.appletgui.JVDialog", "$.PaintRefresher", "$.UserDefinedColours", "jalview.datamodel.GraphLine", "jalview.schemes.GraduatedColor", "jalview.util.MessageManager", "java.awt.Color", "$.Dimension", "$.FlowLayout", "$.Font", "$.GridLayout", "java.awt.event.ActionEvent", "java.lang.Float"], function () {
+c$ = Clazz.decorateAsClass (function () {
+this.frame = null;
+this.owner = null;
+this.fr = null;
+this.fs = null;
+this.cs = null;
+this.oldcs = null;
+this.oldgroupColours = null;
+this.adjusting = false;
+this.min = 0;
+this.max = 0;
+this.type = null;
+this.af = null;
+this.minColour = null;
+this.maxColour = null;
+this.jPanel1 = null;
+this.jPanel2 = null;
+this.threshold = null;
+this.jPanel3 = null;
+this.jPanel4 = null;
+this.slider = null;
+this.thresholdValue = null;
+this.thresholdIsMin = null;
+this.colourFromLabel = null;
+this.threshline = null;
+Clazz.instantialize (this, arguments);
+}, jalview.appletgui, "FeatureColourChooser", awt2swing.Panel, [java.awt.event.ActionListener, java.awt.event.AdjustmentListener, java.awt.event.ItemListener, java.awt.event.MouseListener]);
+Clazz.prepareFields (c$, function () {
+this.minColour = new awt2swing.Panel ();
+this.maxColour = new awt2swing.Panel ();
+this.jPanel1 = new awt2swing.Panel ();
+this.jPanel2 = new awt2swing.Panel ();
+this.threshold = new awt2swing.Choice ();
+this.jPanel3 = new awt2swing.Panel ();
+this.jPanel4 = new awt2swing.Panel ();
+this.slider = new awt2swing.Scrollbar (0);
+this.thresholdValue = new awt2swing.TextField (20);
+this.thresholdIsMin = new awt2swing.Checkbox ();
+this.colourFromLabel = new awt2swing.Checkbox ();
+});
+Clazz.makeConstructor (c$,
+function (af, type) {
+Clazz.superConstructor (this, jalview.appletgui.FeatureColourChooser, []);
+this.af = af;
+this.init (af.getSeqcanvas ().getFeatureRenderer (), type);
+}, "jalview.appletgui.AlignFrame,~S");
+Clazz.makeConstructor (c$,
+function (fsettings, type) {
+Clazz.superConstructor (this, jalview.appletgui.FeatureColourChooser, []);
+this.fs = fsettings;
+this.init (fsettings.fr, type);
+}, "jalview.appletgui.FeatureSettings,~S");
+Clazz.defineMethod (c$, "init",
+($fz = 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);
+}}, $fz.isPrivate = true, $fz), "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",
+($fz = 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);
+}, $fz.isPrivate = true, $fz));
+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");
+});
diff --git a/bin/jalview/appletgui/FeatureRenderer.class b/bin/jalview/appletgui/FeatureRenderer.class
index 94cc9b34e9954183584c291b9abf79dda3ff5162..6582fe79533beaae65600f8ab8c36031dad6fc66 100644
GIT binary patch
delta 28
kcmccNeBF7&9dX7Jo9~LB<6!>DATxQL!g5C8$>EBP0KmKp-v9sr
delta 29
lcmccae8YLe9dX8!o9~LB<6!>9AUk=T!g3}7rpaN7jR4Cy3*i6&
diff --git a/bin/jalview/appletgui/FeatureRenderer.js b/bin/jalview/appletgui/FeatureRenderer.js
index 05b643c..3d688fd 100644
--- a/bin/jalview/appletgui/FeatureRenderer.js
+++ b/bin/jalview/appletgui/FeatureRenderer.js
@@ -1,272 +1,272 @@
-Clazz.declarePackage ("jalview.appletgui");
-Clazz.load (["awt2swing.Panel", "jalview.renderer.seqfeatures.FeatureRenderer"], "jalview.appletgui.FeatureRenderer", ["awt2swing.Button", "$.Choice", "$.Label", "$.ScrollPane", "$.TextArea", "$.TextField", "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 ();
-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);
-a.drawString (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 ();
-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 ();
-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 ();
-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.appletgui");
+Clazz.load (["awt2swing.Panel", "jalview.renderer.seqfeatures.FeatureRenderer"], "jalview.appletgui.FeatureRenderer", ["awt2swing.Button", "$.Choice", "$.Label", "$.ScrollPane", "$.TextArea", "$.TextField", "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 ();
+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);
+a.drawString (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 ();
+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 ();
+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 ();
+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);
+});
diff --git a/bin/jalview/appletgui/FeatureSettings.js b/bin/jalview/appletgui/FeatureSettings.js
index c10ac3f..cc92844 100644
--- a/bin/jalview/appletgui/FeatureSettings.js
+++ b/bin/jalview/appletgui/FeatureSettings.js
@@ -1,444 +1,444 @@
-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", "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);
-g.drawString (jalview.util.MessageManager.getString ("label.no_features_added_to_this_alignment"), 10, 20);
-g.drawString (jalview.util.MessageManager.getString ("label.features_can_be_added_from_searches_1"), 10, 40);
-g.drawString (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 ();
-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 ();
-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 ();
-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 ();
-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 ();
-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 ();
-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.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", "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);
+g.drawString (jalview.util.MessageManager.getString ("label.no_features_added_to_this_alignment"), 10, 20);
+g.drawString (jalview.util.MessageManager.getString ("label.features_can_be_added_from_searches_1"), 10, 40);
+g.drawString (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 ();
+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 ();
+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 ();
+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 ();
+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 ();
+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 ();
+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 ();
+};
+});
diff --git a/bin/jalview/appletgui/Finder.js b/bin/jalview/appletgui/Finder.js
index d64e048..22e3c84 100644
--- a/bin/jalview/appletgui/Finder.js
+++ b/bin/jalview/appletgui/Finder.js
@@ -1,184 +1,184 @@
-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",
-($fz = 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);
-}, $fz.isPrivate = true, $fz));
-Clazz.defineMethod (c$, "textfield_keyTyped",
-function (e) {
-this.findNext.setEnabled (true);
-}, "java.awt.event.KeyEvent");
-c$.$Finder$1$ = function () {
-Clazz.pu$h ();
-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 ();
-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.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",
+($fz = 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);
+}, $fz.isPrivate = true, $fz));
+Clazz.defineMethod (c$, "textfield_keyTyped",
+function (e) {
+this.findNext.setEnabled (true);
+}, "java.awt.event.KeyEvent");
+c$.$Finder$1$ = function () {
+Clazz.pu$h ();
+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 ();
+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 ();
+};
+});
diff --git a/bin/jalview/appletgui/FontChooser.js b/bin/jalview/appletgui/FontChooser.js
index c8a21c0..a0154ca 100644
--- a/bin/jalview/appletgui/FontChooser.js
+++ b/bin/jalview/appletgui/FontChooser.js
@@ -1,259 +1,259 @@
-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",
-($fz = 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");
-}, $fz.isPrivate = true, $fz));
-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 ();
-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 ();
-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.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",
+($fz = 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");
+}, $fz.isPrivate = true, $fz));
+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 ();
+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 ();
+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);
+});
diff --git a/bin/jalview/appletgui/IdCanvas.class b/bin/jalview/appletgui/IdCanvas.class
index c079bc6f51062c42fd86384fc19a9d3473fc7891..2c2cb6ff1ba654f1339a51514e9cab5513f6af44 100644
GIT binary patch
delta 69
zcmV-L0J{J2Kkq-V_7VYZv-c8W0SgNN1PuNFPXPe|60>C#z5xl}00#gQ0008blOGiv
bvq%=+1Owav7n3O)S^*W4@Ea7fnHyLH`W6&%
delta 87
zcmaEF|IvQKHzCIS&EJKR7Fi`VQJKx|
pV)s~>?=nbC){u@86Jp?CX8 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);
-this.gg.drawString (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"], "jalview.appletgui.IdCanvas", ["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);
+}gg.drawString (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);
+this.gg.drawString (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");
+});
diff --git a/bin/jalview/appletgui/IdPanel.js b/bin/jalview/appletgui/IdPanel.js
index 1419a24..4f70687 100644
--- a/bin/jalview/appletgui/IdPanel.js
+++ b/bin/jalview/appletgui/IdPanel.js
@@ -1,285 +1,285 @@
-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 ();
-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.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 ();
+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 ();
+};
+});
diff --git a/bin/jalview/appletgui/IdwidthAdjuster.js b/bin/jalview/appletgui/IdwidthAdjuster.js
index 80a0c59..e7b92f7 100644
--- a/bin/jalview/appletgui/IdwidthAdjuster.js
+++ b/bin/jalview/appletgui/IdwidthAdjuster.js
@@ -1,66 +1,66 @@
-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.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");
+});
diff --git a/bin/jalview/appletgui/JVDialog.js b/bin/jalview/appletgui/JVDialog.js
index 6f85ed1..ed9ee14 100644
--- a/bin/jalview/appletgui/JVDialog.js
+++ b/bin/jalview/appletgui/JVDialog.js
@@ -1,40 +1,40 @@
-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 (["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");
+});
diff --git a/bin/jalview/appletgui/OverviewPanel.class b/bin/jalview/appletgui/OverviewPanel.class
index 58462cbc301532856b8df79eee989663d056be7e..e63efea68145a055c9caabf1ca5197284c92485b 100644
GIT binary patch
delta 89
zcmbQ>*Xy?-OO(-UbGE25laLSt^M8iD49x5djO+~dObiS*n-_{Rvoc=Yyi}&2mB*Dq
r{4awoBctAbhO?6mmBl9KEAvcFQqq`wT}cwm-k{{qXuFwFnV$s!8q^o~
delta 96
zcmeD6o8Y%0OO(-kbGE25ldv!Y%YTNw49x5djO+~dObiT`Oq&;oGqW;Y-@HVopOwd*
uLGmwyEhD4ee}=P@H!4X^&R6D~oT#M1!t|ek2`;cs$)CxJY4blNeii`0J{na3
diff --git a/bin/jalview/appletgui/OverviewPanel.js b/bin/jalview/appletgui/OverviewPanel.js
index cadd6b7..41baadd 100644
--- a/bin/jalview/appletgui/OverviewPanel.js
+++ b/bin/jalview/appletgui/OverviewPanel.js
@@ -1,262 +1,262 @@
-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 ();
-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 (["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 ();
+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 ();
+};
+});
diff --git a/bin/jalview/appletgui/PCAPanel.class b/bin/jalview/appletgui/PCAPanel.class
index 92d23e527ae8ea54793305dc72df08ca8a6a384b..fbccea51faad9e29b6292a88ea0aed3f33d72f13 100644
GIT binary patch
delta 37
tcmeAU>I&MhO_9-f^L9loMqUmEHX%VlAuV+V7RH*%h01E1MU}s?0szFv36TH*
delta 38
ucmeAQ>JHklO_9-L^L9loMm|mkb|FDQA$2Bo1{TJe$py-4n?;nru>t_fzX_56
diff --git a/bin/jalview/appletgui/PCAPanel.js b/bin/jalview/appletgui/PCAPanel.js
index 7813b4d..77168bf 100644
--- a/bin/jalview/appletgui/PCAPanel.js
+++ b/bin/jalview/appletgui/PCAPanel.js
@@ -1,253 +1,253 @@
-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",
-($fz = 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);
-}, $fz.isPrivate = true, $fz));
-});
+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",
+($fz = 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);
+}, $fz.isPrivate = true, $fz));
+});
diff --git a/bin/jalview/appletgui/PaintRefresher.class b/bin/jalview/appletgui/PaintRefresher.class
index 0086f7e114f52cfa44cf1598d6c78a1145d40f12..8d0e0cc084b6dda4da55adb7d38c69071253e3b5 100644
GIT binary patch
delta 24
gcmbQFI#G3l1Q+A+$&y?LSy>sF1ynXa;M&9v09!E!761SM
delta 25
hcmbQJI!Sed1Q+9p$&y?L+1MCZ1QeMz-{;!I4gg>i2N(bV
diff --git a/bin/jalview/appletgui/PaintRefresher.js b/bin/jalview/appletgui/PaintRefresher.js
index 09c8d0a..7bd9686 100644
--- a/bin/jalview/appletgui/PaintRefresher.js
+++ b/bin/jalview/appletgui/PaintRefresher.js
@@ -1,126 +1,126 @@
-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.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);
+});
diff --git a/bin/jalview/appletgui/PairwiseAlignPanel.class b/bin/jalview/appletgui/PairwiseAlignPanel.class
index 22c33f930660e49a58c5a7e2a0e56758cd5146c6..202bf5c11334ea6e94ef93a415dbcd14e340eec7 100644
GIT binary patch
delta 32
ocmX@DdrEhMy8vU#W)Fcg%*@jngeQxOq_7yXGvsY<5b 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",
-($fz = 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);
-}, $fz.isPrivate = true, $fz));
-});
+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",
+($fz = 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);
+}, $fz.isPrivate = true, $fz));
+});
diff --git a/bin/jalview/appletgui/RedundancyPanel.js b/bin/jalview/appletgui/RedundancyPanel.js
index f6b850d..647ac1b 100644
--- a/bin/jalview/appletgui/RedundancyPanel.js
+++ b/bin/jalview/appletgui/RedundancyPanel.js
@@ -1,165 +1,165 @@
-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 ();
-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.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 ();
+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 ();
+};
+});
diff --git a/bin/jalview/appletgui/RotatableCanvas.js b/bin/jalview/appletgui/RotatableCanvas.js
index 0bb0b4a..5e61dea 100644
--- a/bin/jalview/appletgui/RotatableCanvas.js
+++ b/bin/jalview/appletgui/RotatableCanvas.js
@@ -1,371 +1,371 @@
-Clazz.declarePackage ("jalview.appletgui");
-Clazz.load (["awt2swing.Panel", "jalview.api.RotatableCanvasI", "java.awt.event.KeyListener", "$.MouseListener", "$.MouseMotionListener", "jalview.math.RotatableMatrix"], "jalview.appletgui.RotatableCanvas", ["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));
-g.drawString (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);
-this.ig.drawString (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);
-g.drawString ((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.appletgui");
+Clazz.load (["awt2swing.Panel", "jalview.api.RotatableCanvasI", "java.awt.event.KeyListener", "$.MouseListener", "$.MouseMotionListener", "jalview.math.RotatableMatrix"], "jalview.appletgui.RotatableCanvas", ["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));
+g.drawString (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);
+this.ig.drawString (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);
+g.drawString ((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");
+});
diff --git a/bin/jalview/appletgui/ScalePanel.class b/bin/jalview/appletgui/ScalePanel.class
index 66ccdcbc301ce1614b7fc4761be9ab4c49f7bfa7..332e353f97240d915fd50282bd0cb744c0e578a1 100644
GIT binary patch
delta 77
zcmbQ>*5|e%L71^?bE0q%vy?dl_a6p5#y<>g#Mvz9ZU=sn0vtbib0~ 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) {
-gg.drawString (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) {
-gg.drawString (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 ();
-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 ();
-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 ();
-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", "java.awt.event.MouseListener", "$.MouseMotionListener"], "jalview.appletgui.ScalePanel", ["awt2swing.MenuItem", "$.PopupMenu", "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) {
+gg.drawString (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) {
+gg.drawString (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 ();
+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 ();
+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 ();
+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 ();
+};
+});
diff --git a/bin/jalview/appletgui/SeqCanvas.class b/bin/jalview/appletgui/SeqCanvas.class
index a5ce5f0d9c90908b872baf320a7eb6b5f4e6017b..c3feb048d8e8a1bfe47824aee5b7a027494a7db7 100644
GIT binary patch
delta 162
zcmZ2fIJa=aDS5`M&8Ox4n53l{IQSS8{xftiaI!Nn!TA1UM(@ot)lyhQ
zo-qjhWzc13Sj5h-U+fQq1mk~({KZP!
wV&I>wr!BU5k@h4uMxM>4M$=iDOBfU;pEtMWaRw?0=HQoQmf>KUEMn0K0MDHyz5oCK
diff --git a/bin/jalview/appletgui/SeqCanvas.js b/bin/jalview/appletgui/SeqCanvas.js
index ac84c24..af5372b 100644
--- a/bin/jalview/appletgui/SeqCanvas.js
+++ b/bin/jalview/appletgui/SeqCanvas.js
@@ -1,411 +1,411 @@
-Clazz.declarePackage ("jalview.appletgui");
-Clazz.load (["awt2swing.Panel"], "jalview.appletgui.SeqCanvas", ["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",
-($fz = function () {
-this.avcharHeight = this.av.getCharHeight ();
-this.avcharWidth = this.av.getCharWidth ();
-}, $fz.isPrivate = true, $fz));
-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",
-($fz = 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);
-}g.drawString (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);
-}
-}, $fz.isPrivate = true, $fz), "java.awt.Graphics,~N,~N,~N");
-Clazz.defineMethod (c$, "drawWestScale",
-($fz = 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);
-g.drawString (value + "", x, (ypos + (i * this.avcharHeight)) - (Clazz.doubleToInt (this.avcharHeight / 5)));
-}}
-}, $fz.isPrivate = true, $fz), "java.awt.Graphics,~N,~N,~N");
-Clazz.defineMethod (c$, "drawEastScale",
-($fz = 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) {
-g.drawString (String.valueOf (value), 0, (ypos + (i * this.avcharHeight)) - (Clazz.doubleToInt (this.avcharHeight / 5)));
-}}
-}, $fz.isPrivate = true, $fz), "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",
-($fz = 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;
-}
-}, $fz.isPrivate = true, $fz), "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",
-($fz = 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);
-}}}, $fz.isPrivate = true, $fz), "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",
-($fz = 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 ());
-}}, $fz.isPrivate = true, $fz), "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 (["awt2swing.Panel"], "jalview.appletgui.SeqCanvas", ["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",
+($fz = function () {
+this.avcharHeight = this.av.getCharHeight ();
+this.avcharWidth = this.av.getCharWidth ();
+}, $fz.isPrivate = true, $fz));
+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",
+($fz = 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);
+}g.drawString (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);
+}
+}, $fz.isPrivate = true, $fz), "java.awt.Graphics,~N,~N,~N");
+Clazz.defineMethod (c$, "drawWestScale",
+($fz = 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);
+g.drawString (value + "", x, (ypos + (i * this.avcharHeight)) - (Clazz.doubleToInt (this.avcharHeight / 5)));
+}}
+}, $fz.isPrivate = true, $fz), "java.awt.Graphics,~N,~N,~N");
+Clazz.defineMethod (c$, "drawEastScale",
+($fz = 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) {
+g.drawString (String.valueOf (value), 0, (ypos + (i * this.avcharHeight)) - (Clazz.doubleToInt (this.avcharHeight / 5)));
+}}
+}, $fz.isPrivate = true, $fz), "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",
+($fz = 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;
+}
+}, $fz.isPrivate = true, $fz), "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",
+($fz = 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);
+}}}, $fz.isPrivate = true, $fz), "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",
+($fz = 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 ());
+}}, $fz.isPrivate = true, $fz), "java.awt.Graphics,~N,~N,~N,~N,~N");
+Clazz.defineMethod (c$, "highlightSearchResults",
+function (results) {
+this.searchResults = results;
+this.repaint ();
+}, "jalview.datamodel.SearchResults");
+});
diff --git a/bin/jalview/appletgui/SeqPanel.class b/bin/jalview/appletgui/SeqPanel.class
index 90a222210441e3c3fb09cb26bb91d92ae2268843..f3e19d0caafc4fb6e7b8e19c54ad5781b1737012 100644
GIT binary patch
delta 339
zcmXAiKTASk6o=36UiH0||F~W?Q7@E5BnDAqCfHC8rBYN91TBRWh!}!fLv0NXLQ^f#
z2MEp{^ad2#Id=@Flhi&f0_f5vH}h`_+WfThV4KQO
zutzh1mn@14YRVNtpGs0V(lo9LN$l}+VGV8{IrRlXp_36pjZAq$-<0UsFG{{IupVXo4E9od{(foYOnqdovGO|skyk%?AUTUk7;b0)nagRc1Vj0@G17^k9eP?Z%
PqQ}9~99t}Fr6%nMv4mUy
diff --git a/bin/jalview/appletgui/SeqPanel.js b/bin/jalview/appletgui/SeqPanel.js
index 7f97353..d500d0e 100644
--- a/bin/jalview/appletgui/SeqPanel.js
+++ b/bin/jalview/appletgui/SeqPanel.js
@@ -1,962 +1,962 @@
-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",
-($fz = 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);
-}}, $fz.isPrivate = true, $fz), "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",
-($fz = 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;
-}, $fz.isPrivate = true, $fz), "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 ();
-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.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",
+($fz = 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);
+}}, $fz.isPrivate = true, $fz), "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",
+($fz = 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;
+}, $fz.isPrivate = true, $fz), "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 ();
+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 ();
+};
+});
diff --git a/bin/jalview/appletgui/SequenceRenderer.class b/bin/jalview/appletgui/SequenceRenderer.class
index a758da72ac228ab7114e229bb0f310dc6a39cce9..d15b02fae27268e7969a5ed0a591d968581814c4 100644
GIT binary patch
delta 99
zcmca(b<=9YJ$}Z`lkfAdV_{)nGTuB%pq+_Pe6y7BS4IOx2KN69`V2hm42>wJ?%&gBKFnN)LGNaVy;}TO@0Jqf@5dZ)H
delta 82
zcmcaC@K;7=B?gYkf})b5dQ9Sq(rio&
mj0`gwCIU$b1_tH{o9#s7nVAh31Sc<$P-YTm+I&P}DhmLdwG)T{
diff --git a/bin/jalview/appletgui/SequenceRenderer.js b/bin/jalview/appletgui/SequenceRenderer.js
index 449c271..43ee455 100644
--- a/bin/jalview/appletgui/SequenceRenderer.js
+++ b/bin/jalview/appletgui/SequenceRenderer.js
@@ -1,196 +1,196 @@
-Clazz.declarePackage ("jalview.appletgui");
-Clazz.load (["jalview.api.SequenceRenderer"], "jalview.appletgui.SequenceRenderer", ["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.findColour (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);
-this.graphics.drawString (String.valueOf (s), charOffset + avCharWidth * (i - start), y1);
-}
-}, "jalview.datamodel.SequenceI,~N,~N,~N");
-Clazz.defineMethod (c$, "getDisplayChar",
-($fz = 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;
-}, $fz.isPrivate = true, $fz), "~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);
-this.graphics.drawString (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);
-this.graphics.drawString (String.valueOf (s), charOffset + x1, (y1 + this.av.getCharHeight ()) - pady);
-}}, "jalview.datamodel.SequenceI,~N,~N,~N");
-});
+Clazz.declarePackage ("jalview.appletgui");
+Clazz.load (["jalview.api.SequenceRenderer"], "jalview.appletgui.SequenceRenderer", ["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.findColour (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);
+this.graphics.drawString (String.valueOf (s), charOffset + avCharWidth * (i - start), y1);
+}
+}, "jalview.datamodel.SequenceI,~N,~N,~N");
+Clazz.defineMethod (c$, "getDisplayChar",
+($fz = 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;
+}, $fz.isPrivate = true, $fz), "~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);
+this.graphics.drawString (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);
+this.graphics.drawString (String.valueOf (s), charOffset + x1, (y1 + this.av.getCharHeight ()) - pady);
+}}, "jalview.datamodel.SequenceI,~N,~N,~N");
+});
diff --git a/bin/jalview/appletgui/SliderPanel.class b/bin/jalview/appletgui/SliderPanel.class
index ae2daacb7e53248cdbacaa191d30e4005b3a4a26..58ba84cd04598e41c300aa96ba211e12727db78e 100644
GIT binary patch
delta 37
tcmZql`0u{qh%}?u=A+UUjDms;>>Pg?G}syR*cs&o1bAdN3&?(C0|42a35Ngx
delta 39
vcmezG-srL6h%}?m=A+UUjKabUoE(1{RM{Ey*cs)S1O#{_nKtvueq;jx>PZQU
diff --git a/bin/jalview/appletgui/SliderPanel.js b/bin/jalview/appletgui/SliderPanel.js
index dc38cc2..8ba7a20 100644
--- a/bin/jalview/appletgui/SliderPanel.js
+++ b/bin/jalview/appletgui/SliderPanel.js
@@ -1,270 +1,270 @@
-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",
-($fz = 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");
-}, $fz.isPrivate = true, $fz));
-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 ();
-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 ();
-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.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",
+($fz = 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");
+}, $fz.isPrivate = true, $fz));
+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 ();
+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 ();
+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);
+});
diff --git a/bin/jalview/appletgui/SplitFrame.js b/bin/jalview/appletgui/SplitFrame.js
index 7818eaf..eb3570a 100644
--- a/bin/jalview/appletgui/SplitFrame.js
+++ b/bin/jalview/appletgui/SplitFrame.js
@@ -1,108 +1,108 @@
-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",
-($fz = 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);
-}, $fz.isPrivate = true, $fz), "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 ("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",
+($fz = 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);
+}, $fz.isPrivate = true, $fz), "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");
+});
diff --git a/bin/jalview/appletgui/TitledPanel.js b/bin/jalview/appletgui/TitledPanel.js
index 351c3ff..026a455 100644
--- a/bin/jalview/appletgui/TitledPanel.js
+++ b/bin/jalview/appletgui/TitledPanel.js
@@ -1,43 +1,43 @@
-Clazz.declarePackage ("jalview.appletgui");
-Clazz.load (["awt2swing.Panel", "java.awt.Insets"], "jalview.appletgui.TitledPanel", null, 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 ());
-g.drawString (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 ("jalview.appletgui");
+Clazz.load (["awt2swing.Panel", "java.awt.Insets"], "jalview.appletgui.TitledPanel", null, 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 ());
+g.drawString (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");
+});
diff --git a/bin/jalview/appletgui/Tooltip.js b/bin/jalview/appletgui/Tooltip.js
index cb48e62..425b8d7 100644
--- a/bin/jalview/appletgui/Tooltip.js
+++ b/bin/jalview/appletgui/Tooltip.js
@@ -1,67 +1,67 @@
-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",
-($fz = function () {
-}, $fz.isPrivate = true, $fz));
-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.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",
+($fz = function () {
+}, $fz.isPrivate = true, $fz));
+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");
+});
diff --git a/bin/jalview/appletgui/TreeCanvas.class b/bin/jalview/appletgui/TreeCanvas.class
index ee9c1c158b4e224c816b31a31e01603cd948d8c1..b5cddc10b3f025c9a16732cc861f28434385ed77 100644
GIT binary patch
delta 74
zcmcawd#QHAeigCV(bjetiKsDG#MBf
e85q|xFfwQ}FfbgRtZlHDl@%zZxA~pHb6xOM!`>X*0KWH8bPX&Fy+UjN%*&EUdp7QkgUv
h7#SHD*D^3NXfrS{9GR?Xu$PSuD5uS|`L)4wUI5LQ6{Y|H
diff --git a/bin/jalview/appletgui/TreeCanvas.js b/bin/jalview/appletgui/TreeCanvas.js
index da76a3e..69da9f2 100644
--- a/bin/jalview/appletgui/TreeCanvas.js
+++ b/bin/jalview/appletgui/TreeCanvas.js
@@ -1,375 +1,375 @@
-Clazz.declarePackage ("jalview.appletgui");
-Clazz.load (["awt2swing.Panel", "java.awt.event.MouseListener", "$.MouseMotionListener", "java.util.Hashtable"], "jalview.appletgui.TreeCanvas", ["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 ("")) {
-g.drawString (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);
-}g.drawString (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 ("")) {
-g.drawString (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.appletgui");
+Clazz.load (["awt2swing.Panel", "java.awt.event.MouseListener", "$.MouseMotionListener", "java.util.Hashtable"], "jalview.appletgui.TreeCanvas", ["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 ("")) {
+g.drawString (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);
+}g.drawString (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 ("")) {
+g.drawString (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", " * ");
+});
diff --git a/bin/jalview/appletgui/TreePanel$TreeLoader.class b/bin/jalview/appletgui/TreePanel$TreeLoader.class
index 9a214e5abd0f6ab7e5a1cf664fcc31076d29ca8a..cd993a2c5a8cedecee051d4ccc3d51f22e31bae4 100644
GIT binary patch
delta 24
fcmZ3gwnS}1Egxgg<~lxI7S=chek1kC8-+>$WHJY1
delta 25
gcmZ3Ywp49HEgxg=<~lxI7Pfc>0V5Tr$s2@90BP(8WdHyG
diff --git a/bin/jalview/appletgui/TreePanel.class b/bin/jalview/appletgui/TreePanel.class
index a2409c826bda6eb6f2137e4a3a747e6ef097e82e..b8a678db3ffa1b22d131c1011bb78e9c7f3bf081 100644
GIT binary patch
delta 41
xcmbQ?Jl%Q2Qz=H7&CjIR7)3=HSpG9eFfg$*FfuYQvNM!2{9^Ff%p^076#(qW3AX?M
delta 42
ycmbR4Ji~dzQz=H-&CjIR7{$aGSpPFfFfg$*FfuYQvNM!2{9 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.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",
+($fz = 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);
+}, $fz.isPrivate = true, $fz));
+c$.$TreePanel$TreeLoader$ = function () {
+Clazz.pu$h ();
+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 ();
+};
+});
diff --git a/bin/jalview/appletgui/UserDefinedColours.class b/bin/jalview/appletgui/UserDefinedColours.class
index c53d7e0e2533370b79bf6587502e0e59209a3117..593d23d327f13bcd94953cab4d567298de1e4421 100644
GIT binary patch
delta 46
xcmeBeXY6ig+z@HOn7KL1!kLLpm4Q!9U10JOD_zFw&6lh~AtGABoAqqt*#J9(3_}0_
delta 48
zcmeBfXY6ff+z@HOn6){|!kLL(je%cHotJ6yVk=$7n#~ujLLow00!*8AY~$GgOq2{o
diff --git a/bin/jalview/appletgui/UserDefinedColours.js b/bin/jalview/appletgui/UserDefinedColours.js
index 2cc0d9b..a1b23f6 100644
--- a/bin/jalview/appletgui/UserDefinedColours.js
+++ b/bin/jalview/appletgui/UserDefinedColours.js
@@ -1,481 +1,481 @@
-Clazz.declarePackage ("jalview.appletgui");
-Clazz.load (["awt2swing.Panel", "java.awt.event.ActionListener", "$.AdjustmentListener", "$.FocusListener", "awt2swing.Button", "$.Label", "$.Scrollbar", "$.TextField", "java.awt.GridLayout", "java.util.Vector"], "jalview.appletgui.UserDefinedColours", ["awt2swing.Frame", "jalview.appletgui.AnnotationColourChooser", "$.FeatureColourChooser", "$.FeatureRenderer", "$.FeatureSettings", "jalview.bin.JalviewLite", "jalview.schemes.ResidueProperties", "$.UserColourScheme", "jalview.util.MessageManager", "java.awt.Color", "$.Dialog", "$.Font", "$.Rectangle", "java.awt.event.MouseAdapter", "java.lang.Error"], function () {
-c$ = Clazz.decorateAsClass (function () {
-this.ap = null;
-this.seqGroup = null;
-this.selectedButton = null;
-this.oldColours = null;
-this.oldColourScheme = null;
-this.frame = null;
-this.jmol = null;
-this.dialog = null;
-this.caller = null;
-this.originalLabel = null;
-this.originalColour = null;
-this.R = 0;
-this.G = 0;
-this.B = 0;
-this.buttonPanel = null;
-this.gridLayout = null;
-this.okcancelPanel = null;
-this.okButton = null;
-this.applyButton = null;
-this.cancelButton = null;
-this.rScroller = null;
-this.label1 = null;
-this.rText = null;
-this.label4 = null;
-this.gScroller = null;
-this.gText = null;
-this.label5 = null;
-this.bScroller = null;
-this.bText = null;
-this.target = null;
-Clazz.instantialize (this, arguments);
-}, jalview.appletgui, "UserDefinedColours", awt2swing.Panel, [java.awt.event.ActionListener, java.awt.event.AdjustmentListener, java.awt.event.FocusListener]);
-Clazz.prepareFields (c$, function () {
-this.oldColours = new java.util.Vector ();
-this.buttonPanel = new awt2swing.Panel ();
-this.gridLayout = new java.awt.GridLayout ();
-this.okcancelPanel = new awt2swing.Panel ();
-this.okButton = new awt2swing.Button ();
-this.applyButton = new awt2swing.Button ();
-this.cancelButton = new awt2swing.Button ();
-this.rScroller = new awt2swing.Scrollbar ();
-this.label1 = new awt2swing.Label ();
-this.rText = new awt2swing.TextField ();
-this.label4 = new awt2swing.Label ();
-this.gScroller = new awt2swing.Scrollbar ();
-this.gText = new awt2swing.TextField ();
-this.label5 = new awt2swing.Label ();
-this.bScroller = new awt2swing.Scrollbar ();
-this.bText = new awt2swing.TextField ();
-this.target = new awt2swing.Panel ();
-});
-Clazz.defineMethod (c$, "loadDefaultColours",
-function () {
-return null;
-});
-Clazz.makeConstructor (c$,
-function (ap, sg) {
-Clazz.superConstructor (this, jalview.appletgui.UserDefinedColours, []);
-this.ap = ap;
-this.seqGroup = sg;
-if (this.seqGroup != null) {
-this.oldColourScheme = this.seqGroup.cs;
-} else {
-this.oldColourScheme = ap.av.getGlobalColourScheme ();
-}this.init ();
-}, "jalview.appletgui.AlignmentPanel,jalview.datamodel.SequenceGroup");
-Clazz.makeConstructor (c$,
-function (jmol) {
-Clazz.superConstructor (this, jalview.appletgui.UserDefinedColours, []);
-this.jmol = jmol;
-this.init ();
-}, "jalview.appletgui.AppletJmol");
-Clazz.makeConstructor (c$,
-function (fr, alignframe) {
-Clazz.superConstructor (this, jalview.appletgui.UserDefinedColours, []);
-this.caller = fr;
-this.originalColour = fr.colourPanel.getBackground ();
-this.originalLabel = "Feature Colour";
-this.setForDialog ("Select Feature Colour", alignframe);
-this.setTargetColour (fr.colourPanel.getBackground ());
-this.dialog.setVisible (true);
-}, "jalview.appletgui.FeatureRenderer,awt2swing.Frame");
-Clazz.makeConstructor (c$,
-function (caller, col1, alignframe) {
-this.construct (caller, col1, alignframe, "Select Colour");
-}, "java.awt.Component,java.awt.Color,awt2swing.Frame");
-Clazz.makeConstructor (c$,
-function (caller, col1, alignframe, title) {
-Clazz.superConstructor (this, jalview.appletgui.UserDefinedColours, []);
-this.caller = caller;
-this.originalColour = col1;
-this.originalLabel = title;
-this.setForDialog (title, alignframe);
-this.setTargetColour (col1);
-this.dialog.setVisible (true);
-}, "java.awt.Component,java.awt.Color,awt2swing.Frame,~S");
-Clazz.makeConstructor (c$,
-function (caller, label, colour) {
-this.construct (caller, label, colour, colour);
-}, "~O,~S,java.awt.Color");
-Clazz.makeConstructor (c$,
-function (me, type, graduatedColor) {
-this.construct (me, type, graduatedColor, graduatedColor.getMaxColor ());
-}, "jalview.appletgui.FeatureSettings,~S,jalview.schemes.GraduatedColor");
-Clazz.makeConstructor (c$,
-($fz = function (caller, label, ocolour, colour) {
-Clazz.superConstructor (this, jalview.appletgui.UserDefinedColours, []);
-this.caller = caller;
-this.originalColour = ocolour;
-this.originalLabel = label;
-this.init ();
-this.remove (this.buttonPanel);
-this.setTargetColour (colour);
-this.okcancelPanel.setBounds ( new java.awt.Rectangle (0, 113, 400, 35));
-this.frame.setTitle (jalview.util.MessageManager.getString ("label.user_defined_colours") + " - " + label);
-this.frame.setSize (420, 200);
-}, $fz.isPrivate = true, $fz), "~O,~S,~O,java.awt.Color");
-Clazz.defineMethod (c$, "setForDialog",
-function (title, alignframe) {
-this.init ();
-this.frame.setVisible (false);
-this.remove (this.buttonPanel);
-if (Clazz.instanceOf (alignframe, awt2swing.Frame)) {
-this.dialog = new java.awt.Dialog (alignframe, title, true);
-} else {
-throw new Error (jalview.util.MessageManager.getString ("label.error_unsupported_owwner_user_colour_scheme"));
-}this.dialog.add (this);
-this.setSize (400, 123);
-this.okcancelPanel.setBounds ( new java.awt.Rectangle (0, 123, 400, 35));
-var height = 160 + alignframe.getInsets ().top + this.getInsets ().bottom;
-var width = 400;
-this.dialog.setBounds (alignframe.getBounds ().x + Clazz.doubleToInt ((alignframe.getSize ().width - width) / 2), alignframe.getBounds ().y + Clazz.doubleToInt ((alignframe.getSize ().height - height) / 2), width, height);
-}, "~S,java.awt.Container");
-Clazz.overrideMethod (c$, "actionPerformed",
-function (evt) {
-var source = evt.getSource ();
-if (source === this.okButton) {
-this.okButton_actionPerformed ();
-} else if (source === this.applyButton) {
-this.applyButton_actionPerformed ();
-} else if (source === this.cancelButton) {
-this.cancelButton_actionPerformed ();
-} else if (source === this.rText) {
-this.rText_actionPerformed ();
-} else if (source === this.gText) {
-this.gText_actionPerformed ();
-} else if (source === this.bText) {
-this.bText_actionPerformed ();
-}}, "java.awt.event.ActionEvent");
-Clazz.overrideMethod (c$, "adjustmentValueChanged",
-function (evt) {
-if (evt.getSource () === this.rScroller) {
-this.rScroller_adjustmentValueChanged ();
-} else if (evt.getSource () === this.gScroller) {
-this.gScroller_adjustmentValueChanged ();
-} else if (evt.getSource () === this.bScroller) {
-this.bScroller_adjustmentValueChanged ();
-}}, "java.awt.event.AdjustmentEvent");
-Clazz.defineMethod (c$, "init",
-function () {
-try {
-this.jbInit ();
-} catch (e) {
-if (Clazz.exceptionOf (e, Exception)) {
-e.printStackTrace ();
-} else {
-throw e;
-}
-}
-this.frame = new awt2swing.Frame ();
-this.frame.add (this);
-jalview.bin.JalviewLite.addFrame (this.frame, jalview.util.MessageManager.getString ("label.user_defined_colours"), 420, 345);
-if (this.seqGroup != null) {
-this.frame.setTitle (this.frame.getTitle () + " (" + this.seqGroup.getName () + ")");
-}for (var i = 0; i < 20; i++) {
-this.makeButton (jalview.schemes.ResidueProperties.aa2Triplet.get (jalview.schemes.ResidueProperties.aa[i]) + "", jalview.schemes.ResidueProperties.aa[i]);
-}
-this.makeButton ("B", "B");
-this.makeButton ("Z", "Z");
-this.makeButton ("X", "X");
-this.makeButton ("Gap", "'.','-',' '");
-this.validate ();
-});
-Clazz.defineMethod (c$, "rText_actionPerformed",
-function () {
-try {
-var i = Integer.parseInt (this.rText.getText ());
-this.rScroller.setValue (i);
-this.rScroller_adjustmentValueChanged ();
-} catch (ex) {
-if (Clazz.exceptionOf (ex, NumberFormatException)) {
-} else {
-throw ex;
-}
-}
-});
-Clazz.defineMethod (c$, "gText_actionPerformed",
-function () {
-try {
-var i = Integer.parseInt (this.gText.getText ());
-this.gScroller.setValue (i);
-this.gScroller_adjustmentValueChanged ();
-} catch (ex) {
-if (Clazz.exceptionOf (ex, NumberFormatException)) {
-} else {
-throw ex;
-}
-}
-});
-Clazz.defineMethod (c$, "bText_actionPerformed",
-function () {
-try {
-var i = Integer.parseInt (this.bText.getText ());
-this.bScroller.setValue (i);
-this.bScroller_adjustmentValueChanged ();
-} catch (ex) {
-if (Clazz.exceptionOf (ex, NumberFormatException)) {
-} else {
-throw ex;
-}
-}
-});
-Clazz.defineMethod (c$, "rScroller_adjustmentValueChanged",
-function () {
-this.R = this.rScroller.getValue ();
-this.rText.setText (this.R + "");
-this.colourChanged ();
-});
-Clazz.defineMethod (c$, "gScroller_adjustmentValueChanged",
-function () {
-this.G = this.gScroller.getValue ();
-this.gText.setText (this.G + "");
-this.colourChanged ();
-});
-Clazz.defineMethod (c$, "bScroller_adjustmentValueChanged",
-function () {
-this.B = this.bScroller.getValue ();
-this.bText.setText (this.B + "");
-this.colourChanged ();
-});
-Clazz.defineMethod (c$, "colourChanged",
-function () {
-var col = new java.awt.Color (this.R, this.G, this.B);
-this.target.setBackground (col);
-this.target.repaint ();
-if (this.selectedButton != null) {
-this.selectedButton.setBackground (col);
-this.selectedButton.repaint ();
-}});
-Clazz.defineMethod (c$, "setTargetColour",
-function (col) {
-this.R = col.getRed ();
-this.G = col.getGreen ();
-this.B = col.getBlue ();
-this.rScroller.setValue (this.R);
-this.gScroller.setValue (this.G);
-this.bScroller.setValue (this.B);
-this.rText.setText (this.R + "");
-this.gText.setText (this.G + "");
-this.bText.setText (this.B + "");
-this.colourChanged ();
-}, "java.awt.Color");
-Clazz.defineMethod (c$, "colourButtonPressed",
-function (e) {
-this.selectedButton = e.getSource ();
-this.setTargetColour (this.selectedButton.getBackground ());
-}, "java.awt.event.MouseEvent");
-Clazz.defineMethod (c$, "makeButton",
-function (label, aa) {
-var button = new awt2swing.Button ();
-var col = java.awt.Color.white;
-if (this.oldColourScheme != null) {
-try {
-col = this.oldColourScheme.findColour (aa.charAt (0), -1, null);
-} catch (ex) {
-if (Clazz.exceptionOf (ex, Exception)) {
-} else {
-throw ex;
-}
-}
-}button.setBackground (col);
-this.oldColours.addElement (col);
-button.setLabel (label);
-button.setForeground (col.darker ().darker ().darker ());
-button.setFont ( new java.awt.Font ("Verdana", 1, 10));
-button.addMouseListener (((Clazz.isClassDefined ("jalview.appletgui.UserDefinedColours$1") ? 0 : jalview.appletgui.UserDefinedColours.$UserDefinedColours$1$ ()), Clazz.innerTypeInstance (jalview.appletgui.UserDefinedColours$1, this, null)));
-this.buttonPanel.add (button, null);
-}, "~S,~S");
-Clazz.defineMethod (c$, "okButton_actionPerformed",
-function () {
-this.applyButton_actionPerformed ();
-if (this.dialog != null) {
-this.dialog.setVisible (false);
-}this.frame.setVisible (false);
-});
-Clazz.defineMethod (c$, "getColor",
-function () {
-return new java.awt.Color (this.R, this.G, this.B);
-});
-Clazz.defineMethod (c$, "applyButton_actionPerformed",
-function () {
-if (this.caller != null) {
-if (Clazz.instanceOf (this.caller, jalview.appletgui.FeatureSettings)) {
-(this.caller).setUserColour (this.originalLabel, this.getColor ());
-} else if (Clazz.instanceOf (this.caller, jalview.appletgui.AnnotationColourChooser)) {
-if (this.originalLabel.equals ("Min Colour")) {
-(this.caller).minColour_actionPerformed (this.getColor ());
-} else {
-(this.caller).maxColour_actionPerformed (this.getColor ());
-}} else if (Clazz.instanceOf (this.caller, jalview.appletgui.FeatureRenderer)) {
-(this.caller).colourPanel.updateColor (this.getColor ());
-} else if (Clazz.instanceOf (this.caller, jalview.appletgui.FeatureColourChooser)) {
-if (this.originalLabel.indexOf ("inimum") > -1) {
-(this.caller).minColour_actionPerformed (this.getColor ());
-} else {
-(this.caller).maxColour_actionPerformed (this.getColor ());
-}}return;
-}var newColours = new Array (24);
-for (var i = 0; i < 24; i++) {
-var button = this.buttonPanel.getComponent (i);
-newColours[i] = button.getBackground ();
-}
-var ucs = new jalview.schemes.UserColourScheme (newColours);
-if (this.ap != null) {
-ucs.setThreshold (0, this.ap.av.isIgnoreGapsConsensus ());
-}if (this.ap != null) {
-if (this.seqGroup != null) {
-this.seqGroup.cs = ucs;
-} else {
-this.ap.av.setGlobalColourScheme (ucs);
-}this.ap.seqPanel.seqCanvas.img = null;
-this.ap.paintAlignment (true);
-} else if (this.jmol != null) {
-this.jmol.setJalviewColourScheme (ucs);
-}});
-Clazz.defineMethod (c$, "cancelButton_actionPerformed",
-function () {
-if (this.caller != null) {
-if (Clazz.instanceOf (this.caller, jalview.appletgui.FeatureSettings)) {
-(this.caller).setUserColour (this.originalLabel, this.originalColour);
-} else if (Clazz.instanceOf (this.caller, jalview.appletgui.AnnotationColourChooser)) {
-if (this.originalLabel.equals ("Min Colour")) {
-(this.caller).minColour_actionPerformed (this.originalColour);
-} else {
-(this.caller).maxColour_actionPerformed (this.originalColour);
-}} else if (Clazz.instanceOf (this.caller, jalview.appletgui.FeatureRenderer)) {
-(this.caller).colourPanel.updateColor (this.originalColour);
-} else if (Clazz.instanceOf (this.caller, jalview.appletgui.FeatureColourChooser)) {
-if (this.originalLabel.indexOf ("inimum") > -1) {
-(this.caller).minColour_actionPerformed (this.originalColour);
-} else {
-(this.caller).maxColour_actionPerformed (this.originalColour);
-}}if (this.dialog != null) {
-this.dialog.setVisible (false);
-}this.frame.setVisible (false);
-return;
-}var newColours = new Array (24);
-for (var i = 0; i < 24; i++) {
-newColours[i] = this.oldColours.elementAt (i);
-this.buttonPanel.getComponent (i).setBackground (newColours[i]);
-}
-var ucs = new jalview.schemes.UserColourScheme (newColours);
-if (this.ap != null) {
-if (this.seqGroup != null) {
-this.seqGroup.cs = ucs;
-} else {
-this.ap.av.setGlobalColourScheme (ucs);
-}this.ap.paintAlignment (true);
-} else if (this.jmol != null) {
-this.jmol.setJalviewColourScheme (ucs);
-}this.frame.setVisible (false);
-});
-Clazz.defineMethod (c$, "jbInit",
-($fz = function () {
-this.setLayout (null);
-this.buttonPanel.setLayout (this.gridLayout);
-this.gridLayout.setColumns (6);
-this.gridLayout.setRows (4);
-this.okButton.setFont ( new java.awt.Font ("Verdana", 0, 11));
-this.okButton.setLabel (jalview.util.MessageManager.getString ("action.ok"));
-this.okButton.addActionListener (this);
-this.applyButton.setFont ( new java.awt.Font ("Verdana", 0, 11));
-this.applyButton.setLabel (jalview.util.MessageManager.getString ("action.apply"));
-this.applyButton.addActionListener (this);
-this.cancelButton.setFont ( new java.awt.Font ("Verdana", 0, 11));
-this.cancelButton.setLabel (jalview.util.MessageManager.getString ("action.cancel"));
-this.cancelButton.addActionListener (this);
-this.setBackground ( new java.awt.Color (212, 208, 223));
-this.okcancelPanel.setBounds ( new java.awt.Rectangle (0, 265, 400, 35));
-this.buttonPanel.setBounds ( new java.awt.Rectangle (0, 123, 400, 142));
-this.rScroller.setMaximum (256);
-this.rScroller.setMinimum (0);
-this.rScroller.setOrientation (0);
-this.rScroller.setUnitIncrement (1);
-this.rScroller.setVisibleAmount (1);
-this.rScroller.setBounds ( new java.awt.Rectangle (36, 27, 119, 19));
-this.rScroller.addAdjustmentListener (this);
-this.label1.setAlignment (4);
-this.label1.setText ("R");
-this.label1.setBounds ( new java.awt.Rectangle (19, 30, 16, 15));
-this.rText.setFont ( new java.awt.Font ("Dialog", 0, 10));
-this.rText.setText ("0 ");
-this.rText.setBounds ( new java.awt.Rectangle (156, 27, 53, 19));
-this.rText.addActionListener (this);
-this.rText.addFocusListener (this);
-this.label4.setAlignment (4);
-this.label4.setText ("G");
-this.label4.setBounds ( new java.awt.Rectangle (15, 56, 20, 15));
-this.gScroller.setMaximum (256);
-this.gScroller.setMinimum (0);
-this.gScroller.setOrientation (0);
-this.gScroller.setUnitIncrement (1);
-this.gScroller.setVisibleAmount (1);
-this.gScroller.setBounds ( new java.awt.Rectangle (35, 52, 120, 20));
-this.gScroller.addAdjustmentListener (this);
-this.gText.setFont ( new java.awt.Font ("Dialog", 0, 10));
-this.gText.setText ("0 ");
-this.gText.setBounds ( new java.awt.Rectangle (156, 52, 53, 20));
-this.gText.addActionListener (this);
-this.gText.addFocusListener (this);
-this.label5.setAlignment (4);
-this.label5.setText ("B");
-this.label5.setBounds ( new java.awt.Rectangle (14, 82, 20, 15));
-this.bScroller.setMaximum (256);
-this.bScroller.setMinimum (0);
-this.bScroller.setOrientation (0);
-this.bScroller.setUnitIncrement (1);
-this.bScroller.setVisibleAmount (1);
-this.bScroller.setBounds ( new java.awt.Rectangle (35, 78, 120, 20));
-this.bScroller.addAdjustmentListener (this);
-this.bText.setFont ( new java.awt.Font ("Dialog", 0, 10));
-this.bText.setText ("0 ");
-this.bText.setBounds ( new java.awt.Rectangle (157, 78, 52, 20));
-this.bText.addActionListener (this);
-this.bText.addFocusListener (this);
-this.target.setBackground (java.awt.Color.black);
-this.target.setBounds ( new java.awt.Rectangle (229, 26, 134, 79));
-this.add (this.okcancelPanel, null);
-this.okcancelPanel.add (this.okButton, null);
-this.okcancelPanel.add (this.applyButton, null);
-this.okcancelPanel.add (this.cancelButton, null);
-this.add (this.rText);
-this.add (this.gText);
-this.add (this.bText);
-this.add (this.buttonPanel, null);
-this.add (this.target, null);
-this.add (this.gScroller);
-this.add (this.rScroller);
-this.add (this.bScroller);
-this.add (this.label5);
-this.add (this.label4);
-this.add (this.label1);
-}, $fz.isPrivate = true, $fz));
-Clazz.overrideMethod (c$, "focusGained",
-function (e) {
-}, "java.awt.event.FocusEvent");
-Clazz.overrideMethod (c$, "focusLost",
-function (e) {
-var c = e.getComponent ();
-if (c === this.rText) {
-this.rText_actionPerformed ();
-} else {
-if (c === this.gText) {
-this.gText_actionPerformed ();
-} else {
-if (c === this.bText) {
-this.bText_actionPerformed ();
-}}}}, "java.awt.event.FocusEvent");
-c$.$UserDefinedColours$1$ = function () {
-Clazz.pu$h ();
-c$ = Clazz.declareAnonymous (jalview.appletgui, "UserDefinedColours$1", java.awt.event.MouseAdapter);
-Clazz.overrideMethod (c$, "mousePressed",
-function (e) {
-this.b$["jalview.appletgui.UserDefinedColours"].colourButtonPressed (e);
-}, "java.awt.event.MouseEvent");
-c$ = Clazz.p0p ();
-};
-});
+Clazz.declarePackage ("jalview.appletgui");
+Clazz.load (["awt2swing.Panel", "java.awt.event.ActionListener", "$.AdjustmentListener", "$.FocusListener", "awt2swing.Button", "$.Label", "$.Scrollbar", "$.TextField", "java.awt.GridLayout", "java.util.Vector"], "jalview.appletgui.UserDefinedColours", ["awt2swing.Frame", "jalview.appletgui.AnnotationColourChooser", "$.FeatureColourChooser", "$.FeatureRenderer", "$.FeatureSettings", "jalview.bin.JalviewLite", "jalview.schemes.ResidueProperties", "$.UserColourScheme", "jalview.util.MessageManager", "java.awt.Color", "$.Dialog", "$.Font", "$.Rectangle", "java.awt.event.MouseAdapter", "java.lang.Error"], function () {
+c$ = Clazz.decorateAsClass (function () {
+this.ap = null;
+this.seqGroup = null;
+this.selectedButton = null;
+this.oldColours = null;
+this.oldColourScheme = null;
+this.frame = null;
+this.jmol = null;
+this.dialog = null;
+this.caller = null;
+this.originalLabel = null;
+this.originalColour = null;
+this.R = 0;
+this.G = 0;
+this.B = 0;
+this.buttonPanel = null;
+this.gridLayout = null;
+this.okcancelPanel = null;
+this.okButton = null;
+this.applyButton = null;
+this.cancelButton = null;
+this.rScroller = null;
+this.label1 = null;
+this.rText = null;
+this.label4 = null;
+this.gScroller = null;
+this.gText = null;
+this.label5 = null;
+this.bScroller = null;
+this.bText = null;
+this.target = null;
+Clazz.instantialize (this, arguments);
+}, jalview.appletgui, "UserDefinedColours", awt2swing.Panel, [java.awt.event.ActionListener, java.awt.event.AdjustmentListener, java.awt.event.FocusListener]);
+Clazz.prepareFields (c$, function () {
+this.oldColours = new java.util.Vector ();
+this.buttonPanel = new awt2swing.Panel ();
+this.gridLayout = new java.awt.GridLayout ();
+this.okcancelPanel = new awt2swing.Panel ();
+this.okButton = new awt2swing.Button ();
+this.applyButton = new awt2swing.Button ();
+this.cancelButton = new awt2swing.Button ();
+this.rScroller = new awt2swing.Scrollbar ();
+this.label1 = new awt2swing.Label ();
+this.rText = new awt2swing.TextField ();
+this.label4 = new awt2swing.Label ();
+this.gScroller = new awt2swing.Scrollbar ();
+this.gText = new awt2swing.TextField ();
+this.label5 = new awt2swing.Label ();
+this.bScroller = new awt2swing.Scrollbar ();
+this.bText = new awt2swing.TextField ();
+this.target = new awt2swing.Panel ();
+});
+Clazz.defineMethod (c$, "loadDefaultColours",
+function () {
+return null;
+});
+Clazz.makeConstructor (c$,
+function (ap, sg) {
+Clazz.superConstructor (this, jalview.appletgui.UserDefinedColours, []);
+this.ap = ap;
+this.seqGroup = sg;
+if (this.seqGroup != null) {
+this.oldColourScheme = this.seqGroup.cs;
+} else {
+this.oldColourScheme = ap.av.getGlobalColourScheme ();
+}this.init ();
+}, "jalview.appletgui.AlignmentPanel,jalview.datamodel.SequenceGroup");
+Clazz.makeConstructor (c$,
+function (jmol) {
+Clazz.superConstructor (this, jalview.appletgui.UserDefinedColours, []);
+this.jmol = jmol;
+this.init ();
+}, "jalview.appletgui.AppletJmol");
+Clazz.makeConstructor (c$,
+function (fr, alignframe) {
+Clazz.superConstructor (this, jalview.appletgui.UserDefinedColours, []);
+this.caller = fr;
+this.originalColour = fr.colourPanel.getBackground ();
+this.originalLabel = "Feature Colour";
+this.setForDialog ("Select Feature Colour", alignframe);
+this.setTargetColour (fr.colourPanel.getBackground ());
+this.dialog.setVisible (true);
+}, "jalview.appletgui.FeatureRenderer,awt2swing.Frame");
+Clazz.makeConstructor (c$,
+function (caller, col1, alignframe) {
+this.construct (caller, col1, alignframe, "Select Colour");
+}, "java.awt.Component,java.awt.Color,awt2swing.Frame");
+Clazz.makeConstructor (c$,
+function (caller, col1, alignframe, title) {
+Clazz.superConstructor (this, jalview.appletgui.UserDefinedColours, []);
+this.caller = caller;
+this.originalColour = col1;
+this.originalLabel = title;
+this.setForDialog (title, alignframe);
+this.setTargetColour (col1);
+this.dialog.setVisible (true);
+}, "java.awt.Component,java.awt.Color,awt2swing.Frame,~S");
+Clazz.makeConstructor (c$,
+function (caller, label, colour) {
+this.construct (caller, label, colour, colour);
+}, "~O,~S,java.awt.Color");
+Clazz.makeConstructor (c$,
+function (me, type, graduatedColor) {
+this.construct (me, type, graduatedColor, graduatedColor.getMaxColor ());
+}, "jalview.appletgui.FeatureSettings,~S,jalview.schemes.GraduatedColor");
+Clazz.makeConstructor (c$,
+($fz = function (caller, label, ocolour, colour) {
+Clazz.superConstructor (this, jalview.appletgui.UserDefinedColours, []);
+this.caller = caller;
+this.originalColour = ocolour;
+this.originalLabel = label;
+this.init ();
+this.remove (this.buttonPanel);
+this.setTargetColour (colour);
+this.okcancelPanel.setBounds ( new java.awt.Rectangle (0, 113, 400, 35));
+this.frame.setTitle (jalview.util.MessageManager.getString ("label.user_defined_colours") + " - " + label);
+this.frame.setSize (420, 200);
+}, $fz.isPrivate = true, $fz), "~O,~S,~O,java.awt.Color");
+Clazz.defineMethod (c$, "setForDialog",
+function (title, alignframe) {
+this.init ();
+this.frame.setVisible (false);
+this.remove (this.buttonPanel);
+if (Clazz.instanceOf (alignframe, awt2swing.Frame)) {
+this.dialog = new java.awt.Dialog (alignframe, title, true);
+} else {
+throw new Error (jalview.util.MessageManager.getString ("label.error_unsupported_owwner_user_colour_scheme"));
+}this.dialog.add (this);
+this.setSize (400, 123);
+this.okcancelPanel.setBounds ( new java.awt.Rectangle (0, 123, 400, 35));
+var height = 160 + alignframe.getInsets ().top + this.getInsets ().bottom;
+var width = 400;
+this.dialog.setBounds (alignframe.getBounds ().x + Clazz.doubleToInt ((alignframe.getSize ().width - width) / 2), alignframe.getBounds ().y + Clazz.doubleToInt ((alignframe.getSize ().height - height) / 2), width, height);
+}, "~S,java.awt.Container");
+Clazz.overrideMethod (c$, "actionPerformed",
+function (evt) {
+var source = evt.getSource ();
+if (source === this.okButton) {
+this.okButton_actionPerformed ();
+} else if (source === this.applyButton) {
+this.applyButton_actionPerformed ();
+} else if (source === this.cancelButton) {
+this.cancelButton_actionPerformed ();
+} else if (source === this.rText) {
+this.rText_actionPerformed ();
+} else if (source === this.gText) {
+this.gText_actionPerformed ();
+} else if (source === this.bText) {
+this.bText_actionPerformed ();
+}}, "java.awt.event.ActionEvent");
+Clazz.overrideMethod (c$, "adjustmentValueChanged",
+function (evt) {
+if (evt.getSource () === this.rScroller) {
+this.rScroller_adjustmentValueChanged ();
+} else if (evt.getSource () === this.gScroller) {
+this.gScroller_adjustmentValueChanged ();
+} else if (evt.getSource () === this.bScroller) {
+this.bScroller_adjustmentValueChanged ();
+}}, "java.awt.event.AdjustmentEvent");
+Clazz.defineMethod (c$, "init",
+function () {
+try {
+this.jbInit ();
+} catch (e) {
+if (Clazz.exceptionOf (e, Exception)) {
+e.printStackTrace ();
+} else {
+throw e;
+}
+}
+this.frame = new awt2swing.Frame ();
+this.frame.add (this);
+jalview.bin.JalviewLite.addFrame (this.frame, jalview.util.MessageManager.getString ("label.user_defined_colours"), 420, 345);
+if (this.seqGroup != null) {
+this.frame.setTitle (this.frame.getTitle () + " (" + this.seqGroup.getName () + ")");
+}for (var i = 0; i < 20; i++) {
+this.makeButton (jalview.schemes.ResidueProperties.aa2Triplet.get (jalview.schemes.ResidueProperties.aa[i]) + "", jalview.schemes.ResidueProperties.aa[i]);
+}
+this.makeButton ("B", "B");
+this.makeButton ("Z", "Z");
+this.makeButton ("X", "X");
+this.makeButton ("Gap", "'.','-',' '");
+this.validate ();
+});
+Clazz.defineMethod (c$, "rText_actionPerformed",
+function () {
+try {
+var i = Integer.parseInt (this.rText.getText ());
+this.rScroller.setValue (i);
+this.rScroller_adjustmentValueChanged ();
+} catch (ex) {
+if (Clazz.exceptionOf (ex, NumberFormatException)) {
+} else {
+throw ex;
+}
+}
+});
+Clazz.defineMethod (c$, "gText_actionPerformed",
+function () {
+try {
+var i = Integer.parseInt (this.gText.getText ());
+this.gScroller.setValue (i);
+this.gScroller_adjustmentValueChanged ();
+} catch (ex) {
+if (Clazz.exceptionOf (ex, NumberFormatException)) {
+} else {
+throw ex;
+}
+}
+});
+Clazz.defineMethod (c$, "bText_actionPerformed",
+function () {
+try {
+var i = Integer.parseInt (this.bText.getText ());
+this.bScroller.setValue (i);
+this.bScroller_adjustmentValueChanged ();
+} catch (ex) {
+if (Clazz.exceptionOf (ex, NumberFormatException)) {
+} else {
+throw ex;
+}
+}
+});
+Clazz.defineMethod (c$, "rScroller_adjustmentValueChanged",
+function () {
+this.R = this.rScroller.getValue ();
+this.rText.setText (this.R + "");
+this.colourChanged ();
+});
+Clazz.defineMethod (c$, "gScroller_adjustmentValueChanged",
+function () {
+this.G = this.gScroller.getValue ();
+this.gText.setText (this.G + "");
+this.colourChanged ();
+});
+Clazz.defineMethod (c$, "bScroller_adjustmentValueChanged",
+function () {
+this.B = this.bScroller.getValue ();
+this.bText.setText (this.B + "");
+this.colourChanged ();
+});
+Clazz.defineMethod (c$, "colourChanged",
+function () {
+var col = new java.awt.Color (this.R, this.G, this.B);
+this.target.setBackground (col);
+this.target.repaint ();
+if (this.selectedButton != null) {
+this.selectedButton.setBackground (col);
+this.selectedButton.repaint ();
+}});
+Clazz.defineMethod (c$, "setTargetColour",
+function (col) {
+this.R = col.getRed ();
+this.G = col.getGreen ();
+this.B = col.getBlue ();
+this.rScroller.setValue (this.R);
+this.gScroller.setValue (this.G);
+this.bScroller.setValue (this.B);
+this.rText.setText (this.R + "");
+this.gText.setText (this.G + "");
+this.bText.setText (this.B + "");
+this.colourChanged ();
+}, "java.awt.Color");
+Clazz.defineMethod (c$, "colourButtonPressed",
+function (e) {
+this.selectedButton = e.getSource ();
+this.setTargetColour (this.selectedButton.getBackground ());
+}, "java.awt.event.MouseEvent");
+Clazz.defineMethod (c$, "makeButton",
+function (label, aa) {
+var button = new awt2swing.Button ();
+var col = java.awt.Color.white;
+if (this.oldColourScheme != null) {
+try {
+col = this.oldColourScheme.findColour (aa.charAt (0), -1, null);
+} catch (ex) {
+if (Clazz.exceptionOf (ex, Exception)) {
+} else {
+throw ex;
+}
+}
+}button.setBackground (col);
+this.oldColours.addElement (col);
+button.setLabel (label);
+button.setForeground (col.darker ().darker ().darker ());
+button.setFont ( new java.awt.Font ("Verdana", 1, 10));
+button.addMouseListener (((Clazz.isClassDefined ("jalview.appletgui.UserDefinedColours$1") ? 0 : jalview.appletgui.UserDefinedColours.$UserDefinedColours$1$ ()), Clazz.innerTypeInstance (jalview.appletgui.UserDefinedColours$1, this, null)));
+this.buttonPanel.add (button, null);
+}, "~S,~S");
+Clazz.defineMethod (c$, "okButton_actionPerformed",
+function () {
+this.applyButton_actionPerformed ();
+if (this.dialog != null) {
+this.dialog.setVisible (false);
+}this.frame.setVisible (false);
+});
+Clazz.defineMethod (c$, "getColor",
+function () {
+return new java.awt.Color (this.R, this.G, this.B);
+});
+Clazz.defineMethod (c$, "applyButton_actionPerformed",
+function () {
+if (this.caller != null) {
+if (Clazz.instanceOf (this.caller, jalview.appletgui.FeatureSettings)) {
+(this.caller).setUserColour (this.originalLabel, this.getColor ());
+} else if (Clazz.instanceOf (this.caller, jalview.appletgui.AnnotationColourChooser)) {
+if (this.originalLabel.equals ("Min Colour")) {
+(this.caller).minColour_actionPerformed (this.getColor ());
+} else {
+(this.caller).maxColour_actionPerformed (this.getColor ());
+}} else if (Clazz.instanceOf (this.caller, jalview.appletgui.FeatureRenderer)) {
+(this.caller).colourPanel.updateColor (this.getColor ());
+} else if (Clazz.instanceOf (this.caller, jalview.appletgui.FeatureColourChooser)) {
+if (this.originalLabel.indexOf ("inimum") > -1) {
+(this.caller).minColour_actionPerformed (this.getColor ());
+} else {
+(this.caller).maxColour_actionPerformed (this.getColor ());
+}}return;
+}var newColours = new Array (24);
+for (var i = 0; i < 24; i++) {
+var button = this.buttonPanel.getComponent (i);
+newColours[i] = button.getBackground ();
+}
+var ucs = new jalview.schemes.UserColourScheme (newColours);
+if (this.ap != null) {
+ucs.setThreshold (0, this.ap.av.isIgnoreGapsConsensus ());
+}if (this.ap != null) {
+if (this.seqGroup != null) {
+this.seqGroup.cs = ucs;
+} else {
+this.ap.av.setGlobalColourScheme (ucs);
+}this.ap.seqPanel.seqCanvas.img = null;
+this.ap.paintAlignment (true);
+} else if (this.jmol != null) {
+this.jmol.setJalviewColourScheme (ucs);
+}});
+Clazz.defineMethod (c$, "cancelButton_actionPerformed",
+function () {
+if (this.caller != null) {
+if (Clazz.instanceOf (this.caller, jalview.appletgui.FeatureSettings)) {
+(this.caller).setUserColour (this.originalLabel, this.originalColour);
+} else if (Clazz.instanceOf (this.caller, jalview.appletgui.AnnotationColourChooser)) {
+if (this.originalLabel.equals ("Min Colour")) {
+(this.caller).minColour_actionPerformed (this.originalColour);
+} else {
+(this.caller).maxColour_actionPerformed (this.originalColour);
+}} else if (Clazz.instanceOf (this.caller, jalview.appletgui.FeatureRenderer)) {
+(this.caller).colourPanel.updateColor (this.originalColour);
+} else if (Clazz.instanceOf (this.caller, jalview.appletgui.FeatureColourChooser)) {
+if (this.originalLabel.indexOf ("inimum") > -1) {
+(this.caller).minColour_actionPerformed (this.originalColour);
+} else {
+(this.caller).maxColour_actionPerformed (this.originalColour);
+}}if (this.dialog != null) {
+this.dialog.setVisible (false);
+}this.frame.setVisible (false);
+return;
+}var newColours = new Array (24);
+for (var i = 0; i < 24; i++) {
+newColours[i] = this.oldColours.elementAt (i);
+this.buttonPanel.getComponent (i).setBackground (newColours[i]);
+}
+var ucs = new jalview.schemes.UserColourScheme (newColours);
+if (this.ap != null) {
+if (this.seqGroup != null) {
+this.seqGroup.cs = ucs;
+} else {
+this.ap.av.setGlobalColourScheme (ucs);
+}this.ap.paintAlignment (true);
+} else if (this.jmol != null) {
+this.jmol.setJalviewColourScheme (ucs);
+}this.frame.setVisible (false);
+});
+Clazz.defineMethod (c$, "jbInit",
+($fz = function () {
+this.setLayout (null);
+this.buttonPanel.setLayout (this.gridLayout);
+this.gridLayout.setColumns (6);
+this.gridLayout.setRows (4);
+this.okButton.setFont ( new java.awt.Font ("Verdana", 0, 11));
+this.okButton.setLabel (jalview.util.MessageManager.getString ("action.ok"));
+this.okButton.addActionListener (this);
+this.applyButton.setFont ( new java.awt.Font ("Verdana", 0, 11));
+this.applyButton.setLabel (jalview.util.MessageManager.getString ("action.apply"));
+this.applyButton.addActionListener (this);
+this.cancelButton.setFont ( new java.awt.Font ("Verdana", 0, 11));
+this.cancelButton.setLabel (jalview.util.MessageManager.getString ("action.cancel"));
+this.cancelButton.addActionListener (this);
+this.setBackground ( new java.awt.Color (212, 208, 223));
+this.okcancelPanel.setBounds ( new java.awt.Rectangle (0, 265, 400, 35));
+this.buttonPanel.setBounds ( new java.awt.Rectangle (0, 123, 400, 142));
+this.rScroller.setMaximum (256);
+this.rScroller.setMinimum (0);
+this.rScroller.setOrientation (0);
+this.rScroller.setUnitIncrement (1);
+this.rScroller.setVisibleAmount (1);
+this.rScroller.setBounds ( new java.awt.Rectangle (36, 27, 119, 19));
+this.rScroller.addAdjustmentListener (this);
+this.label1.setAlignment (4);
+this.label1.setText ("R");
+this.label1.setBounds ( new java.awt.Rectangle (19, 30, 16, 15));
+this.rText.setFont ( new java.awt.Font ("Dialog", 0, 10));
+this.rText.setText ("0 ");
+this.rText.setBounds ( new java.awt.Rectangle (156, 27, 53, 19));
+this.rText.addActionListener (this);
+this.rText.addFocusListener (this);
+this.label4.setAlignment (4);
+this.label4.setText ("G");
+this.label4.setBounds ( new java.awt.Rectangle (15, 56, 20, 15));
+this.gScroller.setMaximum (256);
+this.gScroller.setMinimum (0);
+this.gScroller.setOrientation (0);
+this.gScroller.setUnitIncrement (1);
+this.gScroller.setVisibleAmount (1);
+this.gScroller.setBounds ( new java.awt.Rectangle (35, 52, 120, 20));
+this.gScroller.addAdjustmentListener (this);
+this.gText.setFont ( new java.awt.Font ("Dialog", 0, 10));
+this.gText.setText ("0 ");
+this.gText.setBounds ( new java.awt.Rectangle (156, 52, 53, 20));
+this.gText.addActionListener (this);
+this.gText.addFocusListener (this);
+this.label5.setAlignment (4);
+this.label5.setText ("B");
+this.label5.setBounds ( new java.awt.Rectangle (14, 82, 20, 15));
+this.bScroller.setMaximum (256);
+this.bScroller.setMinimum (0);
+this.bScroller.setOrientation (0);
+this.bScroller.setUnitIncrement (1);
+this.bScroller.setVisibleAmount (1);
+this.bScroller.setBounds ( new java.awt.Rectangle (35, 78, 120, 20));
+this.bScroller.addAdjustmentListener (this);
+this.bText.setFont ( new java.awt.Font ("Dialog", 0, 10));
+this.bText.setText ("0 ");
+this.bText.setBounds ( new java.awt.Rectangle (157, 78, 52, 20));
+this.bText.addActionListener (this);
+this.bText.addFocusListener (this);
+this.target.setBackground (java.awt.Color.black);
+this.target.setBounds ( new java.awt.Rectangle (229, 26, 134, 79));
+this.add (this.okcancelPanel, null);
+this.okcancelPanel.add (this.okButton, null);
+this.okcancelPanel.add (this.applyButton, null);
+this.okcancelPanel.add (this.cancelButton, null);
+this.add (this.rText);
+this.add (this.gText);
+this.add (this.bText);
+this.add (this.buttonPanel, null);
+this.add (this.target, null);
+this.add (this.gScroller);
+this.add (this.rScroller);
+this.add (this.bScroller);
+this.add (this.label5);
+this.add (this.label4);
+this.add (this.label1);
+}, $fz.isPrivate = true, $fz));
+Clazz.overrideMethod (c$, "focusGained",
+function (e) {
+}, "java.awt.event.FocusEvent");
+Clazz.overrideMethod (c$, "focusLost",
+function (e) {
+var c = e.getComponent ();
+if (c === this.rText) {
+this.rText_actionPerformed ();
+} else {
+if (c === this.gText) {
+this.gText_actionPerformed ();
+} else {
+if (c === this.bText) {
+this.bText_actionPerformed ();
+}}}}, "java.awt.event.FocusEvent");
+c$.$UserDefinedColours$1$ = function () {
+Clazz.pu$h ();
+c$ = Clazz.declareAnonymous (jalview.appletgui, "UserDefinedColours$1", java.awt.event.MouseAdapter);
+Clazz.overrideMethod (c$, "mousePressed",
+function (e) {
+this.b$["jalview.appletgui.UserDefinedColours"].colourButtonPressed (e);
+}, "java.awt.event.MouseEvent");
+c$ = Clazz.p0p ();
+};
+});
diff --git a/bin/jalview/bin/Cache.js b/bin/jalview/bin/Cache.js
index b2a7cae..3013f58 100644
--- a/bin/jalview/bin/Cache.js
+++ b/bin/jalview/bin/Cache.js
@@ -1,29 +1,29 @@
-Clazz.declarePackage ("jalview.bin");
-c$ = Clazz.decorateAsClass (function () {
-if (!Clazz.isClassDefined ("jalview.bin.Cache.Log")) {
-jalview.bin.Cache.$Cache$Log$ ();
-}
-Clazz.instantialize (this, arguments);
-}, jalview.bin, "Cache");
-c$.getDefault = Clazz.defineMethod (c$, "getDefault",
-function (string, string2) {
-return null;
-}, "~S,~S");
-c$.$Cache$Log$ = function () {
-Clazz.pu$h ();
-c$ = Clazz.decorateAsClass (function () {
-Clazz.prepareCallback (this, arguments);
-Clazz.instantialize (this, arguments);
-}, jalview.bin.Cache, "Log");
-Clazz.defineMethod (c$, "error",
-function (a) {
-}, "~S");
-Clazz.defineMethod (c$, "isDebugEnabled",
-function () {
-return false;
-});
-c$ = Clazz.p0p ();
-};
-Clazz.defineStatics (c$,
-"CASTORLOGLEVEL", null,
-"log", null);
+Clazz.declarePackage ("jalview.bin");
+c$ = Clazz.decorateAsClass (function () {
+if (!Clazz.isClassDefined ("jalview.bin.Cache.Log")) {
+jalview.bin.Cache.$Cache$Log$ ();
+}
+Clazz.instantialize (this, arguments);
+}, jalview.bin, "Cache");
+c$.getDefault = Clazz.defineMethod (c$, "getDefault",
+function (string, string2) {
+return null;
+}, "~S,~S");
+c$.$Cache$Log$ = function () {
+Clazz.pu$h ();
+c$ = Clazz.decorateAsClass (function () {
+Clazz.prepareCallback (this, arguments);
+Clazz.instantialize (this, arguments);
+}, jalview.bin.Cache, "Log");
+Clazz.defineMethod (c$, "error",
+function (a) {
+}, "~S");
+Clazz.defineMethod (c$, "isDebugEnabled",
+function () {
+return false;
+});
+c$ = Clazz.p0p ();
+};
+Clazz.defineStatics (c$,
+"CASTORLOGLEVEL", null,
+"log", null);
diff --git a/bin/jalview/bin/JalviewLite$4.class b/bin/jalview/bin/JalviewLite$4.class
index 09353ffdf84fc88e703e3246ace3a756cb725b31..884af19eb9a936cacbe2e117efc2e06803f378f6 100644
GIT binary patch
delta 24
gcmdnRzmtE%G&aV6lc%$NVdG?A`pytPc@nz@0C!#pyZ`_I
delta 25
hcmdnVzl(pvG&aWnlc%$NVdr9C{>>2MGd*$M$`RR#3`
diff --git a/bin/jalview/bin/JalviewLite$LoadingThread.class b/bin/jalview/bin/JalviewLite$LoadingThread.class
index 6ffac37375320fca723ab6fd9057595c2ef345e7..4dc6751b21f72934fb454ff3f78ba733c567db79 100644
GIT binary patch
delta 122
zcmV-=0EPeEc;tAnH7fxKvoO+M3W0VQkI4tX8-^I
delta 138
zcmaD-akpZFsWv0$W;5+xR_1C3$;rnIN|>0KHd`BRWMNd?{MJ;2QJRN=$TI$62xMo9{>8xNv^mhCjfpXP^9?I0
nM#TUI?*9z349x5djO+~B>`cpmG$S{oBhWN&5W{J*kWCN(W>X$p
diff --git a/bin/jalview/bin/JalviewLite.class b/bin/jalview/bin/JalviewLite.class
index ae19296f78a267d582476954c2bed9b6abe49b54..7d7000785d2b23642896449277f1e882e9a9d94b 100644
GIT binary patch
delta 193
zcmX@QiD}O!rVWfyjHfm;MYXXrJ2R+G?oRAsasJ6*Hd!{wnbBf%QqnC!#&?@-OD-}p
z%P??G7AzBH)ZDCArq0HgyVgko;P}hH&dA8)%g*A%z#k0MCCdp^s1H||znQZs2xJr6zm%&7)c4@9~QjLhkiCzfe!4k`P}%9yv=tHz2&
zz?ebQK-`I)sX+KQLx7|m)8r`)ih|-y{0vMi<_sYWj0~X+42*`Gk2Xj%s)#ah{$*fi
zWaRN>XYpa+7XWFKF=DomU6
kn|BE@F4(L!ErpTUnt^lj#OeBMI!rRMf=-){Os`-B0FdN5SpWb4
diff --git a/bin/jalview/bin/JalviewLite.js b/bin/jalview/bin/JalviewLite.js
index 23d66b7..1049dcb 100644
--- a/bin/jalview/bin/JalviewLite.js
+++ b/bin/jalview/bin/JalviewLite.js
@@ -1,1617 +1,1617 @@
-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", ["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",
-($fz = 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");
-}, $fz.isPrivate = true, $fz));
-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",
-($fz = 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);
-}, $fz.isPrivate = true, $fz));
-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",
-($fz = 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;
-}
-}
-}}}, $fz.isPrivate = true, $fz));
-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",
-($fz = 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;
-}
-}
-}
-}, $fz.isPrivate = true, $fz));
-Clazz.defineMethod (c$, "callInitCallback",
-($fz = 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.");
-}}}, $fz.isPrivate = true, $fz));
-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);
-g.drawString (jalview.util.MessageManager.getString ("label.jalview_cannot_open_file"), 5, 15);
-g.drawString ("\"" + 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));
-g.drawString (jalview.util.MessageManager.getString ("label.jalview_applet"), 50, Clazz.doubleToInt (this.getSize ().height / 2) - 30);
-g.drawString (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",
-($fz = 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;
-}, $fz.isPrivate = true, $fz), "~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 ();
-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")) {
-Class.forName ("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 ();
-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",
-($fz = function (a) {
-if (jalview.bin.JalviewLite.debug) {
-System.err.println (a);
-}}, $fz.isPrivate = true, $fz), "~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",
-($fz = 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 ();
-}, $fz.isPrivate = true, $fz));
-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",
-($fz = 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;
-}, $fz.isPrivate = true, $fz), "~S");
-c$ = Clazz.p0p ();
-};
-c$.$JalviewLite$1$ = function () {
-Clazz.pu$h ();
-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 ();
-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 ();
-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 ();
-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 ();
-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 ();
-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 ();
-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 ();
-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 ();
-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 ();
-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 ("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", ["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",
+($fz = 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");
+}, $fz.isPrivate = true, $fz));
+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",
+($fz = 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);
+}, $fz.isPrivate = true, $fz));
+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",
+($fz = 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;
+}
+}
+}}}, $fz.isPrivate = true, $fz));
+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",
+($fz = 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;
+}
+}
+}
+}, $fz.isPrivate = true, $fz));
+Clazz.defineMethod (c$, "callInitCallback",
+($fz = 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.");
+}}}, $fz.isPrivate = true, $fz));
+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);
+g.drawString (jalview.util.MessageManager.getString ("label.jalview_cannot_open_file"), 5, 15);
+g.drawString ("\"" + 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));
+g.drawString (jalview.util.MessageManager.getString ("label.jalview_applet"), 50, Clazz.doubleToInt (this.getSize ().height / 2) - 30);
+g.drawString (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",
+($fz = 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;
+}, $fz.isPrivate = true, $fz), "~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 ();
+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")) {
+Class.forName ("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 ();
+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",
+($fz = function (a) {
+if (jalview.bin.JalviewLite.debug) {
+System.err.println (a);
+}}, $fz.isPrivate = true, $fz), "~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",
+($fz = 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 ();
+}, $fz.isPrivate = true, $fz));
+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",
+($fz = 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;
+}, $fz.isPrivate = true, $fz), "~S");
+c$ = Clazz.p0p ();
+};
+c$.$JalviewLite$1$ = function () {
+Clazz.pu$h ();
+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 ();
+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 ();
+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 ();
+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 ();
+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 ();
+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 ();
+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 ();
+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 ();
+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 ();
+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);
+});
diff --git a/bin/jalview/commands/ChangeCaseCommand.js b/bin/jalview/commands/ChangeCaseCommand.js
index fb085d6..0ebfc96 100644
--- a/bin/jalview/commands/ChangeCaseCommand.js
+++ b/bin/jalview/commands/ChangeCaseCommand.js
@@ -1,74 +1,74 @@
-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.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);
+});
diff --git a/bin/jalview/commands/CommandI.js b/bin/jalview/commands/CommandI.js
index 792918f..598c931 100644
--- a/bin/jalview/commands/CommandI.js
+++ b/bin/jalview/commands/CommandI.js
@@ -1,2 +1,2 @@
-Clazz.declarePackage ("jalview.commands");
-Clazz.declareInterface (jalview.commands, "CommandI");
+Clazz.declarePackage ("jalview.commands");
+Clazz.declareInterface (jalview.commands, "CommandI");
diff --git a/bin/jalview/commands/EditCommand.class b/bin/jalview/commands/EditCommand.class
index 21a616107a7a24691e05ebf7d2ef1d0a7056933e..8e6645ea80f69a154d1cc7a11c0a2ca688e96452 100644
GIT binary patch
delta 140
zcmeykfbq!!#tr+enYcf1K4`t1i`kpOYI3$)w1_f0!lJUQDfT2g_X@fgz|23AG|rk@P#K+MJTi$UN&
z1JmSNZkkM7Op{sM4J<^N{xj$?aIrIJF*33<<^i<;sb7qYj0_CQzZlqosu?(uB^f|6
ivK&m4)7=#XIhpwWFsL*BVQ>WM`Nw0XMwSq=d0$s-v6
diff --git a/bin/jalview/commands/EditCommand.js b/bin/jalview/commands/EditCommand.js
index b556231..0839473 100644
--- a/bin/jalview/commands/EditCommand.js
+++ b/bin/jalview/commands/EditCommand.js
@@ -1,661 +1,661 @@
-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",
-($fz = 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);
-}, $fz.isPrivate = true, $fz), "jalview.commands.EditCommand.Edit");
-c$.deleteGap = Clazz.defineMethod (c$, "deleteGap",
-($fz = 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);
-}, $fz.isPrivate = true, $fz), "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 ();
-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 ();
-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.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",
+($fz = 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);
+}, $fz.isPrivate = true, $fz), "jalview.commands.EditCommand.Edit");
+c$.deleteGap = Clazz.defineMethod (c$, "deleteGap",
+($fz = 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);
+}, $fz.isPrivate = true, $fz), "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 ();
+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 ();
+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 ();
+});
diff --git a/bin/jalview/commands/OrderCommand.js b/bin/jalview/commands/OrderCommand.js
index c85c70b..8939653 100644
--- a/bin/jalview/commands/OrderCommand.js
+++ b/bin/jalview/commands/OrderCommand.js
@@ -1,38 +1,38 @@
-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.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");
+});
diff --git a/bin/jalview/commands/RemoveGapColCommand.js b/bin/jalview/commands/RemoveGapColCommand.js
index a41e76e..511279b 100644
--- a/bin/jalview/commands/RemoveGapColCommand.js
+++ b/bin/jalview/commands/RemoveGapColCommand.js
@@ -1,45 +1,45 @@
-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.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;
+});
+});
diff --git a/bin/jalview/commands/RemoveGapsCommand.js b/bin/jalview/commands/RemoveGapsCommand.js
index 7097db3..3cc233d 100644
--- a/bin/jalview/commands/RemoveGapsCommand.js
+++ b/bin/jalview/commands/RemoveGapsCommand.js
@@ -1,56 +1,56 @@
-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.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");
+});
diff --git a/bin/jalview/commands/SlideSequencesCommand.js b/bin/jalview/commands/SlideSequencesCommand.js
index 125c732..5a79b67 100644
--- a/bin/jalview/commands/SlideSequencesCommand.js
+++ b/bin/jalview/commands/SlideSequencesCommand.js
@@ -1,48 +1,48 @@
-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.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");
+});
diff --git a/bin/jalview/commands/TrimRegionCommand.class b/bin/jalview/commands/TrimRegionCommand.class
index aace60c7cb52f246e5b5eff7d9a2aa27eec68956..5e4d0bb0105d897f55a15269347cacae63cda249 100644
GIT binary patch
delta 29
lcmX>rcSdeQCpY8F&0XBdjLfDCY?D9m7&4k~R_4`W0sxs(2&Di3
delta 30
mcmX>jcUEpgCpY7)&0XBdjLc>X?2|w67&4hKZC2vdVgdl669}gO
diff --git a/bin/jalview/commands/TrimRegionCommand.js b/bin/jalview/commands/TrimRegionCommand.js
index ff06747..2732ca0 100644
--- a/bin/jalview/commands/TrimRegionCommand.js
+++ b/bin/jalview/commands/TrimRegionCommand.js
@@ -1,91 +1,91 @@
-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.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");
+});
diff --git a/bin/jalview/controller/AlignViewController.class b/bin/jalview/controller/AlignViewController.class
index c9c4b7826351b488e44602a65133a25e14ac0098..7507fecf9d9ce9e981d86c37e0ebe1bf522ae966 100644
GIT binary patch
delta 67
zcmbOj))Tg2gB)Yv=8bYDtjsbDN|RqG>o5l~2u^lTQDS76Y^`Fz?7<)oSK(pi
W;^LjWKxG~)kKj)Rfz7U}XIKG&$r1nn
delta 77
zcmeAPn;5oXgB)Yn=8bYDtjvlG>XTn6>oEH>2u`+FQDS9a`p>{Sd7+9n>wgAU263R6
h;^aOR9#$qUE-t3Yb5-WCb2173WZ-4m?4Wvv6#!P&6m 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.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");
+});
diff --git a/bin/jalview/controller/FeatureSettingsController.js b/bin/jalview/controller/FeatureSettingsController.js
index 1a3acab..8a9666e 100644
--- a/bin/jalview/controller/FeatureSettingsController.js
+++ b/bin/jalview/controller/FeatureSettingsController.js
@@ -1,7 +1,7 @@
-Clazz.declarePackage ("jalview.controller");
-c$ = Clazz.decorateAsClass (function () {
-this.settingUI = null;
-this.fr = null;
-this.fsettings = null;
-Clazz.instantialize (this, arguments);
-}, jalview.controller, "FeatureSettingsController");
+Clazz.declarePackage ("jalview.controller");
+c$ = Clazz.decorateAsClass (function () {
+this.settingUI = null;
+this.fr = null;
+this.fsettings = null;
+Clazz.instantialize (this, arguments);
+}, jalview.controller, "FeatureSettingsController");
diff --git a/bin/jalview/controller/FeatureSettingsControllerGuiI.js b/bin/jalview/controller/FeatureSettingsControllerGuiI.js
index ec98397..c092514 100644
--- a/bin/jalview/controller/FeatureSettingsControllerGuiI.js
+++ b/bin/jalview/controller/FeatureSettingsControllerGuiI.js
@@ -1,2 +1,2 @@
-Clazz.declarePackage ("jalview.controller");
-Clazz.declareInterface (jalview.controller, "FeatureSettingsControllerGuiI");
+Clazz.declarePackage ("jalview.controller");
+Clazz.declareInterface (jalview.controller, "FeatureSettingsControllerGuiI");
diff --git a/bin/jalview/datamodel/ASequence.js b/bin/jalview/datamodel/ASequence.js
index 1c80545..76a4493 100644
--- a/bin/jalview/datamodel/ASequence.js
+++ b/bin/jalview/datamodel/ASequence.js
@@ -1,4 +1,4 @@
-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.datamodel");
+Clazz.load (["jalview.datamodel.ASequenceI"], "jalview.datamodel.ASequence", null, function () {
+c$ = Clazz.declareType (jalview.datamodel, "ASequence", null, jalview.datamodel.ASequenceI);
+});
diff --git a/bin/jalview/datamodel/ASequenceI.js b/bin/jalview/datamodel/ASequenceI.js
index 91b3544..3d17914 100644
--- a/bin/jalview/datamodel/ASequenceI.js
+++ b/bin/jalview/datamodel/ASequenceI.js
@@ -1,2 +1,2 @@
-Clazz.declarePackage ("jalview.datamodel");
-Clazz.declareInterface (jalview.datamodel, "ASequenceI");
+Clazz.declarePackage ("jalview.datamodel");
+Clazz.declareInterface (jalview.datamodel, "ASequenceI");
diff --git a/bin/jalview/datamodel/AlignedCodon.js b/bin/jalview/datamodel/AlignedCodon.js
index d02ac8a..3b95647 100644
--- a/bin/jalview/datamodel/AlignedCodon.js
+++ b/bin/jalview/datamodel/AlignedCodon.js
@@ -1,42 +1,42 @@
-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 (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 ();
+});
+});
diff --git a/bin/jalview/datamodel/AlignedCodonFrame.class b/bin/jalview/datamodel/AlignedCodonFrame.class
index dcb271c5b283832d763af6c4541bcb6e5e6c0d15..071822f6290786b40a278136d64f0c79ad11d513 100644
GIT binary patch
delta 31
ncmdmMzRP^Wd?7}S%?pH9GcwmOa8LFVF=GDDz_qze#GD-fuyP5>
delta 34
qcmdmGzSn%id?7~d%?pH9GcwmR@J#j-F=G40!2X|sX>+rPIXeK+hziL7
diff --git a/bin/jalview/datamodel/AlignedCodonFrame.js b/bin/jalview/datamodel/AlignedCodonFrame.js
index 8d854b4..043b032 100644
--- a/bin/jalview/datamodel/AlignedCodonFrame.js
+++ b/bin/jalview/datamodel/AlignedCodonFrame.js
@@ -1,198 +1,198 @@
-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 (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");
+});
diff --git a/bin/jalview/datamodel/Alignment.class b/bin/jalview/datamodel/Alignment.class
index 5ed53fa1ea9ea7524508837ff00735c46ebbccf2..c65b99e11df284fdb248bf79181ec2ab689f48c2 100644
GIT binary patch
delta 75
zcmV-R0JQ(s+X2(t0kC^O0d2E-30DyX0co=vTx$da{Qx18iD2{r46}b>R}8!i7#aWo
delta 78
zcmV-U0I~nm+X2?w0kC^O0dBK=KuG}uBmfAL$Uz+f2LiL^K`Rjf4zm(dg#!bK01uOz
kR%`+z0<#BK5d{Hivl(1#1Oxs6B9n(;^a2S2vwUG!4C=`k7XSbN
diff --git a/bin/jalview/datamodel/Alignment.js b/bin/jalview/datamodel/Alignment.js
index f70f6ce..a4d45ee 100644
--- a/bin/jalview/datamodel/Alignment.js
+++ b/bin/jalview/datamodel/Alignment.js
@@ -1,815 +1,815 @@
-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",
-($fz = 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]);
-}
-}, $fz.isPrivate = true, $fz), "~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",
-($fz = function () {
-if (--this.alignmentRefs == 0) {
-this.finalize ();
-}}, $fz.isPrivate = true, $fz));
-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",
-($fz = 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;
-}}, $fz.isPrivate = true, $fz), "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",
-($fz = function (aa) {
-if (aa.sequenceRef != null) {
-aa.sequenceRef.removeAlignmentAnnotation (aa);
-}if (aa.groupRef != null) {
-aa.groupRef = null;
-}}, $fz.isPrivate = true, $fz), "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",
-($fz = function () {
-this.alignmentRefs++;
-}, $fz.isPrivate = true, $fz));
-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.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",
+($fz = 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]);
+}
+}, $fz.isPrivate = true, $fz), "~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",
+($fz = function () {
+if (--this.alignmentRefs == 0) {
+this.finalize ();
+}}, $fz.isPrivate = true, $fz));
+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",
+($fz = 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;
+}}, $fz.isPrivate = true, $fz), "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",
+($fz = function (aa) {
+if (aa.sequenceRef != null) {
+aa.sequenceRef.removeAlignmentAnnotation (aa);
+}if (aa.groupRef != null) {
+aa.groupRef = null;
+}}, $fz.isPrivate = true, $fz), "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",
+($fz = function () {
+this.alignmentRefs++;
+}, $fz.isPrivate = true, $fz));
+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);
+});
diff --git a/bin/jalview/datamodel/AlignmentAnnotation.class b/bin/jalview/datamodel/AlignmentAnnotation.class
index 840fdf1fd89061ed2917d106deca03141f04fb7f..88e30dbda799a85e7011292bcb43cd2825a413cc 100644
GIT binary patch
delta 117
zcmeC1#yD{roXe
zXJBP#U}R)xc*n@dz`!HR^PBOYungyKMlq(%eOi%1j4hjA*yJ#Zi!*RbI{*#gWdxBK
njJ!V?SeUq&HfP!yvNEb}p6$Gwkt36VOH9Urk!f>`>sD3(5qKjz
diff --git a/bin/jalview/datamodel/AlignmentAnnotation.js b/bin/jalview/datamodel/AlignmentAnnotation.js
index 0be7f1c..e321a8d 100644
--- a/bin/jalview/datamodel/AlignmentAnnotation.js
+++ b/bin/jalview/datamodel/AlignmentAnnotation.js
@@ -1,623 +1,623 @@
-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",
-($fz = 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 ();
-}}, $fz.isPrivate = true, $fz), "CharSequence");
-Clazz.defineMethod (c$, "_markRnaHelices",
-($fz = 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);
-}, $fz.isPrivate = true, $fz));
-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 ("");
-if (i > -1) {
-return "" + 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 ();
-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.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",
+($fz = 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 ();
+}}, $fz.isPrivate = true, $fz), "CharSequence");
+Clazz.defineMethod (c$, "_markRnaHelices",
+($fz = 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);
+}, $fz.isPrivate = true, $fz));
+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 ("");
+if (i > -1) {
+return "" + 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 ();
+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);
+});
diff --git a/bin/jalview/datamodel/AlignmentI.js b/bin/jalview/datamodel/AlignmentI.js
index d1f3174..80e1794 100644
--- a/bin/jalview/datamodel/AlignmentI.js
+++ b/bin/jalview/datamodel/AlignmentI.js
@@ -1,4 +1,4 @@
-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 (["jalview.datamodel.AnnotatedCollectionI"], "jalview.datamodel.AlignmentI", null, function () {
+Clazz.declareInterface (jalview.datamodel, "AlignmentI", jalview.datamodel.AnnotatedCollectionI);
+});
diff --git a/bin/jalview/datamodel/AlignmentOrder.js b/bin/jalview/datamodel/AlignmentOrder.js
index 281aa17..0fb0cbb 100644
--- a/bin/jalview/datamodel/AlignmentOrder.js
+++ b/bin/jalview/datamodel/AlignmentOrder.js
@@ -1,118 +1,118 @@
-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 (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);
+});
diff --git a/bin/jalview/datamodel/AlignmentView.class b/bin/jalview/datamodel/AlignmentView.class
index 122d311e9828f76a9d3bb6b05dfdb0d156ac69fe..08408b7ad6afccecd66ac8dc5832289fbfea18cf 100644
GIT binary patch
delta 53
zcmV-50LuT!oB_C;0kHHm0cErGH1YxiasUyN>NimV6SGS=@CpG@vphpE0Rtca2a|6^
L7XcKrh(y2%Dkl;#
delta 69
zcmV-L0J{IUoB_z30kHHm0d%wVH1YxifdCSd>Nimk5C8-R009990Z;(|0RI32vphKP
b3IS5HEkiH?10etilVC&_0uchUctpSn2+R|S
diff --git a/bin/jalview/datamodel/AlignmentView.js b/bin/jalview/datamodel/AlignmentView.js
index e88c405..e559e79 100644
--- a/bin/jalview/datamodel/AlignmentView.js
+++ b/bin/jalview/datamodel/AlignmentView.js
@@ -1,625 +1,625 @@
-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",
-($fz = 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;
-}
-}}}}, $fz.isPrivate = true, $fz), "jalview.datamodel.AlignmentI,~N,~N,~B");
-Clazz.defineMethod (c$, "getVisibleSeqs",
-($fz = 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;
-}, $fz.isPrivate = true, $fz), "~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 ();
-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.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",
+($fz = 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;
+}
+}}}}, $fz.isPrivate = true, $fz), "jalview.datamodel.AlignmentI,~N,~N,~B");
+Clazz.defineMethod (c$, "getVisibleSeqs",
+($fz = 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;
+}, $fz.isPrivate = true, $fz), "~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 ();
+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 ();
+};
+});
diff --git a/bin/jalview/datamodel/AnnotatedCollectionI.js b/bin/jalview/datamodel/AnnotatedCollectionI.js
index 0dda32c..fd7a804 100644
--- a/bin/jalview/datamodel/AnnotatedCollectionI.js
+++ b/bin/jalview/datamodel/AnnotatedCollectionI.js
@@ -1,4 +1,4 @@
-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.load (["jalview.datamodel.SequenceCollectionI"], "jalview.datamodel.AnnotatedCollectionI", null, function () {
+Clazz.declareInterface (jalview.datamodel, "AnnotatedCollectionI", jalview.datamodel.SequenceCollectionI);
+});
diff --git a/bin/jalview/datamodel/Annotation.class b/bin/jalview/datamodel/Annotation.class
index ad9b0f6c0e2cad278dee7c2149ab438c3ad36617..043f3308f0825b28329db8a4dfc0805ed14f2c8f 100644
GIT binary patch
delta 229
zcmX>o{91U!G!|}WhFl&7dxktl2ARnVS;QvCGjnX-$D+#2`GIh3{r?j@-`RsY5)ugI$!_*
delta 188
zcmaDYd{B79G!||PhFl&7dxktl2I 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 (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 ();
+});
+});
diff --git a/bin/jalview/datamodel/BinaryNode.js b/bin/jalview/datamodel/BinaryNode.js
index 64fb764..7575508 100644
--- a/bin/jalview/datamodel/BinaryNode.js
+++ b/bin/jalview/datamodel/BinaryNode.js
@@ -1,112 +1,112 @@
-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.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;
+});
diff --git a/bin/jalview/datamodel/BinarySequence.js b/bin/jalview/datamodel/BinarySequence.js
index 2285387..90b6b95 100644
--- a/bin/jalview/datamodel/BinarySequence.js
+++ b/bin/jalview/datamodel/BinarySequence.js
@@ -1,99 +1,99 @@
-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",
-($fz = 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;
-}, $fz.isPrivate = true, $fz));
-Clazz.defineMethod (c$, "getSymbolmatrix",
-($fz = function () {
-return (this.isNa) ? jalview.schemes.ResidueProperties.nucleotideIndex : jalview.schemes.ResidueProperties.aaIndex;
-}, $fz.isPrivate = true, $fz));
-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",
-($fz = 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];
-}
-}
-}, $fz.isPrivate = true, $fz), "~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 ();
-c$ = Clazz.decorateAsClass (function () {
-Clazz.prepareCallback (this, arguments);
-Clazz.instantialize (this, arguments);
-}, jalview.datamodel.BinarySequence, "InvalidSequenceTypeException", Exception);
-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",
+($fz = 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;
+}, $fz.isPrivate = true, $fz));
+Clazz.defineMethod (c$, "getSymbolmatrix",
+($fz = function () {
+return (this.isNa) ? jalview.schemes.ResidueProperties.nucleotideIndex : jalview.schemes.ResidueProperties.aaIndex;
+}, $fz.isPrivate = true, $fz));
+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",
+($fz = 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];
+}
+}
+}, $fz.isPrivate = true, $fz), "~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 ();
+c$ = Clazz.decorateAsClass (function () {
+Clazz.prepareCallback (this, arguments);
+Clazz.instantialize (this, arguments);
+}, jalview.datamodel.BinarySequence, "InvalidSequenceTypeException", Exception);
+c$ = Clazz.p0p ();
+};
+});
diff --git a/bin/jalview/datamodel/CigarArray.class b/bin/jalview/datamodel/CigarArray.class
index c31f49e0ff94cc06294168b9fca19d8be6fe8c31..10b48a9697e4714110db1112daea4bffd2eda569 100644
GIT binary patch
delta 42
zcmV+_0M-AsG_*9ZXb}OBvuP3U0S2G|5B~rmlfe@ilXnwq0~P=Wlc5t6v-uM|21IEN
A0RR91
delta 44
zcmV+{0Mq}pG_^FaXb}OCvuP3U0S2J}5dQ!nlfe@ilXnwq0}}uTlc5t60Rpr56Fdf7
Cs15@F
diff --git a/bin/jalview/datamodel/CigarArray.js b/bin/jalview/datamodel/CigarArray.js
index b18df9f..7f45aff 100644
--- a/bin/jalview/datamodel/CigarArray.js
+++ b/bin/jalview/datamodel/CigarArray.js
@@ -1,188 +1,188 @@
-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",
-($fz = 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;
-}, $fz.isPrivate = true, $fz), "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",
-($fz = 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);
-}}, $fz.isPrivate = true, $fz), "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 (["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",
+($fz = 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;
+}, $fz.isPrivate = true, $fz), "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",
+($fz = 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);
+}}, $fz.isPrivate = true, $fz), "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;
+});
+});
diff --git a/bin/jalview/datamodel/CigarBase.class b/bin/jalview/datamodel/CigarBase.class
index d6583684f0ee21b41a054f760db8b730d934db05..7417a4dce3c56ea2cde6181993333590f8121bc5 100644
GIT binary patch
delta 36
scmX?ObJAwRF;T|i&BsL@n3;_j1SfMzs&jCN@hJUb5D?jHBPqZN0NTL`kpKVy
delta 39
vcmX?UbH--FF;T{{&BsL@n3+u(L?&}ds&lh42{Z91{bCRhWZG;gDZmN<@=OVr
diff --git a/bin/jalview/datamodel/CigarBase.js b/bin/jalview/datamodel/CigarBase.js
index bd75085..5b88b3f 100644
--- a/bin/jalview/datamodel/CigarBase.js
+++ b/bin/jalview/datamodel/CigarBase.js
@@ -1,310 +1,310 @@
-Clazz.declarePackage ("jalview.datamodel");
-Clazz.load (null, "jalview.datamodel.CigarBase", ["jalview.util.MessageManager", "java.lang.Error", "$.Exception", "$.StringBuffer", "java.util.Vector", "javajs.util.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 = javajs.util.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 (null, "jalview.datamodel.CigarBase", ["jalview.util.MessageManager", "java.lang.Error", "$.Exception", "$.StringBuffer", "java.util.Vector", "javajs.util.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 = javajs.util.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));
+});
diff --git a/bin/jalview/datamodel/CigarCigar.js b/bin/jalview/datamodel/CigarCigar.js
index 12f3e39..9448de4 100644
--- a/bin/jalview/datamodel/CigarCigar.js
+++ b/bin/jalview/datamodel/CigarCigar.js
@@ -1,22 +1,22 @@
-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.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");
+});
diff --git a/bin/jalview/datamodel/CigarSimple.js b/bin/jalview/datamodel/CigarSimple.js
index 776f62a..1f9da1c 100644
--- a/bin/jalview/datamodel/CigarSimple.js
+++ b/bin/jalview/datamodel/CigarSimple.js
@@ -1,4 +1,4 @@
-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.CigarBase"], "jalview.datamodel.CigarSimple", null, function () {
+c$ = Clazz.declareType (jalview.datamodel, "CigarSimple", jalview.datamodel.CigarBase);
+});
diff --git a/bin/jalview/datamodel/ColumnSelection.class b/bin/jalview/datamodel/ColumnSelection.class
index c770c9670bb85cffc2b1fd3acb2b1438f78354df..e80a2622eb6f7acded9bcb68422cc3aaa61e76e5 100644
GIT binary patch
delta 120
zcmZpi%h)}aaf5{_WAJ86)lW>!2@GPB^)!@}S^qG|FiNuWIWYcV;A2FP+Kj>ujLfo<
z{~4Gj8)`^w?$-!VX6)Vkz&nOX-GG7X4+9ragEFI(h=|C423rPpb_PavMgw-n1B{I9
Q3=h~D;ushwhx+LN02jm?v;Y7A
delta 102
zcmeC4%h))Vaf5{_WB6uE)lW>!DGXAR^)!@}nV9}C$S_JWG4VMt{$b!_M35ScOu`O~
x%u-C7^EGmm8S6LS@s44VRAS)%!@vbps>~=QA|mpa!HS*X0XsvS)8u$R9RLuT7@`0G
diff --git a/bin/jalview/datamodel/ColumnSelection.js b/bin/jalview/datamodel/ColumnSelection.js
index 6cab54c..b9e3e99 100644
--- a/bin/jalview/datamodel/ColumnSelection.js
+++ b/bin/jalview/datamodel/ColumnSelection.js
@@ -1,682 +1,682 @@
-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",
-($fz = 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;
-}}
-}}, $fz.isPrivate = true, $fz), "~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",
-($fz = 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;
-}, $fz.isPrivate = true, $fz), "java.util.List,java.util.Vector");
-Clazz.defineMethod (c$, "pruneColumnList",
-($fz = 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;
-}, $fz.isPrivate = true, $fz), "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.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",
+($fz = 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;
+}}
+}}, $fz.isPrivate = true, $fz), "~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",
+($fz = 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;
+}, $fz.isPrivate = true, $fz), "java.util.List,java.util.Vector");
+Clazz.defineMethod (c$, "pruneColumnList",
+($fz = 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;
+}, $fz.isPrivate = true, $fz), "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");
+});
diff --git a/bin/jalview/datamodel/DBRefEntry.js b/bin/jalview/datamodel/DBRefEntry.js
index da2e0cb..148cf99 100644
--- a/bin/jalview/datamodel/DBRefEntry.js
+++ b/bin/jalview/datamodel/DBRefEntry.js
@@ -1,93 +1,93 @@
-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");
+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 ();
+});
+});
diff --git a/bin/jalview/datamodel/DBRefSource.js b/bin/jalview/datamodel/DBRefSource.js
index 587f6f3..00d7337 100644
--- a/bin/jalview/datamodel/DBRefSource.js
+++ b/bin/jalview/datamodel/DBRefSource.js
@@ -1,29 +1,29 @@
-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");
+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");
diff --git a/bin/jalview/datamodel/FeatureProperties.js b/bin/jalview/datamodel/FeatureProperties.js
index 6df3e2b..350148d 100644
--- a/bin/jalview/datamodel/FeatureProperties.js
+++ b/bin/jalview/datamodel/FeatureProperties.js
@@ -1,20 +1,20 @@
-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.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");
+});
diff --git a/bin/jalview/datamodel/GraphLine.js b/bin/jalview/datamodel/GraphLine.js
index 564e7f4..83ffc69 100644
--- a/bin/jalview/datamodel/GraphLine.js
+++ b/bin/jalview/datamodel/GraphLine.js
@@ -1,36 +1,36 @@
-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 (["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");
+});
diff --git a/bin/jalview/datamodel/HiddenSequences.class b/bin/jalview/datamodel/HiddenSequences.class
index a6524e4aeebfd05e8e66a6ed26285f81260c14a2..5553ae26124c2c73ffb985c59e889b4cd4db000f 100644
GIT binary patch
delta 27
jcmZoOY&G0qA
delta 28
kcmZoQY%| 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.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");
+});
diff --git a/bin/jalview/datamodel/IncompleteCodonException.js b/bin/jalview/datamodel/IncompleteCodonException.js
index 372d9dd..924024c 100644
--- a/bin/jalview/datamodel/IncompleteCodonException.js
+++ b/bin/jalview/datamodel/IncompleteCodonException.js
@@ -1,4 +1,4 @@
-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 (["java.lang.RuntimeException"], "jalview.datamodel.IncompleteCodonException", null, function () {
+c$ = Clazz.declareType (jalview.datamodel, "IncompleteCodonException", RuntimeException);
+});
diff --git a/bin/jalview/datamodel/Mapping.js b/bin/jalview/datamodel/Mapping.js
index fe06fda..a25222e 100644
--- a/bin/jalview/datamodel/Mapping.js
+++ b/bin/jalview/datamodel/Mapping.js
@@ -1,304 +1,304 @@
-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 ();
-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",
-($fz = 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 ();
-}, $fz.isPrivate = true, $fz));
-Clazz.defineMethod (c$, "getNextCodon",
-($fz = 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;
-}, $fz.isPrivate = true, $fz));
-Clazz.defineMethod (c$, "getAlignedCodon",
-($fz = 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;
-}, $fz.isPrivate = true, $fz), "~A");
-Clazz.defineMethod (c$, "getAlignedColumn",
-($fz = function (a) {
-while (this.alignedBases < a && this.alignedColumn < this.alignedSeq.length) {
-if (this.alignedSeq[this.alignedColumn++] != this.gap) {
-this.alignedBases++;
-}}
-return this.alignedColumn - 1;
-}, $fz.isPrivate = true, $fz), "~N");
-Clazz.overrideMethod (c$, "remove",
-function () {
-});
-c$ = Clazz.p0p ();
-};
-});
+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 ();
+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",
+($fz = 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 ();
+}, $fz.isPrivate = true, $fz));
+Clazz.defineMethod (c$, "getNextCodon",
+($fz = 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;
+}, $fz.isPrivate = true, $fz));
+Clazz.defineMethod (c$, "getAlignedCodon",
+($fz = 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;
+}, $fz.isPrivate = true, $fz), "~A");
+Clazz.defineMethod (c$, "getAlignedColumn",
+($fz = function (a) {
+while (this.alignedBases < a && this.alignedColumn < this.alignedSeq.length) {
+if (this.alignedSeq[this.alignedColumn++] != this.gap) {
+this.alignedBases++;
+}}
+return this.alignedColumn - 1;
+}, $fz.isPrivate = true, $fz), "~N");
+Clazz.overrideMethod (c$, "remove",
+function () {
+});
+c$ = Clazz.p0p ();
+};
+});
diff --git a/bin/jalview/datamodel/NodeTransformI.js b/bin/jalview/datamodel/NodeTransformI.js
index 83ace63..0f7a757 100644
--- a/bin/jalview/datamodel/NodeTransformI.js
+++ b/bin/jalview/datamodel/NodeTransformI.js
@@ -1,2 +1,2 @@
-Clazz.declarePackage ("jalview.datamodel");
-Clazz.declareInterface (jalview.datamodel, "NodeTransformI");
+Clazz.declarePackage ("jalview.datamodel");
+Clazz.declareInterface (jalview.datamodel, "NodeTransformI");
diff --git a/bin/jalview/datamodel/PDBEntry.js b/bin/jalview/datamodel/PDBEntry.js
index e52f785..e153399 100644
--- a/bin/jalview/datamodel/PDBEntry.js
+++ b/bin/jalview/datamodel/PDBEntry.js
@@ -1,88 +1,88 @@
-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 ();
-c$ = Clazz.declareType (jalview.datamodel.PDBEntry, "Type", Enum);
-Clazz.defineEnumConstant (c$, "PDB", 0, []);
-Clazz.defineEnumConstant (c$, "FILE", 1, []);
-c$ = Clazz.p0p ();
-});
+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 ();
+c$ = Clazz.declareType (jalview.datamodel.PDBEntry, "Type", Enum);
+Clazz.defineEnumConstant (c$, "PDB", 0, []);
+Clazz.defineEnumConstant (c$, "FILE", 1, []);
+c$ = Clazz.p0p ();
+});
diff --git a/bin/jalview/datamodel/Provenance.js b/bin/jalview/datamodel/Provenance.js
index 04f873e..c0180ea 100644
--- a/bin/jalview/datamodel/Provenance.js
+++ b/bin/jalview/datamodel/Provenance.js
@@ -1,25 +1,25 @@
-Clazz.declarePackage ("jalview.datamodel");
-Clazz.load (["java.util.Vector"], "jalview.datamodel.Provenance", ["jalview.datamodel.ProvenanceEntry"], function () {
-c$ = Clazz.decorateAsClass (function () {
-this.entries = null;
-Clazz.instantialize (this, arguments);
-}, jalview.datamodel, "Provenance");
-Clazz.prepareFields (c$, function () {
-this.entries = new java.util.Vector ();
-});
-Clazz.makeConstructor (c$,
-function () {
-});
-Clazz.defineMethod (c$, "getEntries",
-function () {
-var ret = new Array (this.entries.size ());
-for (var i = 0; i < this.entries.size (); i++) {
-ret[i] = this.entries.elementAt (i);
-}
-return ret;
-});
-Clazz.defineMethod (c$, "addEntry",
-function (user, action, date, id) {
-this.entries.addElement ( new jalview.datamodel.ProvenanceEntry (user, action, date, id));
-}, "~S,~S,java.util.Date,~S");
-});
+Clazz.declarePackage ("jalview.datamodel");
+Clazz.load (["java.util.Vector"], "jalview.datamodel.Provenance", ["jalview.datamodel.ProvenanceEntry"], function () {
+c$ = Clazz.decorateAsClass (function () {
+this.entries = null;
+Clazz.instantialize (this, arguments);
+}, jalview.datamodel, "Provenance");
+Clazz.prepareFields (c$, function () {
+this.entries = new java.util.Vector ();
+});
+Clazz.makeConstructor (c$,
+function () {
+});
+Clazz.defineMethod (c$, "getEntries",
+function () {
+var ret = new Array (this.entries.size ());
+for (var i = 0; i < this.entries.size (); i++) {
+ret[i] = this.entries.elementAt (i);
+}
+return ret;
+});
+Clazz.defineMethod (c$, "addEntry",
+function (user, action, date, id) {
+this.entries.addElement ( new jalview.datamodel.ProvenanceEntry (user, action, date, id));
+}, "~S,~S,java.util.Date,~S");
+});
diff --git a/bin/jalview/datamodel/ProvenanceEntry.js b/bin/jalview/datamodel/ProvenanceEntry.js
index 5077d90..1283717 100644
--- a/bin/jalview/datamodel/ProvenanceEntry.js
+++ b/bin/jalview/datamodel/ProvenanceEntry.js
@@ -1,31 +1,31 @@
-Clazz.declarePackage ("jalview.datamodel");
-c$ = Clazz.decorateAsClass (function () {
-this.user = null;
-this.action = null;
-this.id = null;
-this.date = null;
-Clazz.instantialize (this, arguments);
-}, jalview.datamodel, "ProvenanceEntry");
-Clazz.makeConstructor (c$,
-function (u, a, d, i) {
-this.user = u;
-this.action = a;
-this.date = d;
-this.id = i;
-}, "~S,~S,java.util.Date,~S");
-Clazz.defineMethod (c$, "getUser",
-function () {
-return this.user;
-});
-Clazz.defineMethod (c$, "getAction",
-function () {
-return this.action;
-});
-Clazz.defineMethod (c$, "getDate",
-function () {
-return this.date;
-});
-Clazz.defineMethod (c$, "getID",
-function () {
-return this.id;
-});
+Clazz.declarePackage ("jalview.datamodel");
+c$ = Clazz.decorateAsClass (function () {
+this.user = null;
+this.action = null;
+this.id = null;
+this.date = null;
+Clazz.instantialize (this, arguments);
+}, jalview.datamodel, "ProvenanceEntry");
+Clazz.makeConstructor (c$,
+function (u, a, d, i) {
+this.user = u;
+this.action = a;
+this.date = d;
+this.id = i;
+}, "~S,~S,java.util.Date,~S");
+Clazz.defineMethod (c$, "getUser",
+function () {
+return this.user;
+});
+Clazz.defineMethod (c$, "getAction",
+function () {
+return this.action;
+});
+Clazz.defineMethod (c$, "getDate",
+function () {
+return this.date;
+});
+Clazz.defineMethod (c$, "getID",
+function () {
+return this.id;
+});
diff --git a/bin/jalview/datamodel/RnaViewerModel.js b/bin/jalview/datamodel/RnaViewerModel.js
index 2e64a80..612cdda 100644
--- a/bin/jalview/datamodel/RnaViewerModel.js
+++ b/bin/jalview/datamodel/RnaViewerModel.js
@@ -1,21 +1,21 @@
-Clazz.declarePackage ("jalview.datamodel");
-c$ = Clazz.decorateAsClass (function () {
-this.viewId = null;
-this.title = null;
-this.x = 0;
-this.y = 0;
-this.width = 0;
-this.height = 0;
-this.dividerLocation = 0;
-Clazz.instantialize (this, arguments);
-}, jalview.datamodel, "RnaViewerModel");
-Clazz.makeConstructor (c$,
-function (viewId, title, xpos, ypos, width, height, dividerLocation) {
-this.viewId = viewId;
-this.title = title;
-this.x = xpos;
-this.y = ypos;
-this.width = width;
-this.height = height;
-this.dividerLocation = dividerLocation;
-}, "~S,~S,~N,~N,~N,~N,~N");
+Clazz.declarePackage ("jalview.datamodel");
+c$ = Clazz.decorateAsClass (function () {
+this.viewId = null;
+this.title = null;
+this.x = 0;
+this.y = 0;
+this.width = 0;
+this.height = 0;
+this.dividerLocation = 0;
+Clazz.instantialize (this, arguments);
+}, jalview.datamodel, "RnaViewerModel");
+Clazz.makeConstructor (c$,
+function (viewId, title, xpos, ypos, width, height, dividerLocation) {
+this.viewId = viewId;
+this.title = title;
+this.x = xpos;
+this.y = ypos;
+this.width = width;
+this.height = height;
+this.dividerLocation = dividerLocation;
+}, "~S,~S,~N,~N,~N,~N,~N");
diff --git a/bin/jalview/datamodel/SearchResults.js b/bin/jalview/datamodel/SearchResults.js
index 74170de..e82bfa5 100644
--- a/bin/jalview/datamodel/SearchResults.js
+++ b/bin/jalview/datamodel/SearchResults.js
@@ -1,137 +1,137 @@
-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 ();
-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 (["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 ();
+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 ();
+};
+});
diff --git a/bin/jalview/datamodel/SecondaryStructureAnnotation.js b/bin/jalview/datamodel/SecondaryStructureAnnotation.js
index 6a35ad3..2d1eb58 100644
--- a/bin/jalview/datamodel/SecondaryStructureAnnotation.js
+++ b/bin/jalview/datamodel/SecondaryStructureAnnotation.js
@@ -1,23 +1,23 @@
-Clazz.declarePackage ("jalview.datamodel");
-Clazz.load (["jalview.datamodel.AlignmentAnnotation"], "jalview.datamodel.SecondaryStructureAnnotation", ["jalview.datamodel.Annotation"], function () {
-c$ = Clazz.declareType (jalview.datamodel, "SecondaryStructureAnnotation", jalview.datamodel.AlignmentAnnotation);
-Clazz.makeConstructor (c$,
-function (rna) {
-Clazz.superConstructor (this, jalview.datamodel.SecondaryStructureAnnotation, ["Secondary Structure", "Un truc trop cool", jalview.datamodel.SecondaryStructureAnnotation.getAnnotation (rna)]);
-jalview.datamodel.SecondaryStructureAnnotation._rna = rna;
-}, "fr.orsay.lri.varna.models.rna.RNA");
-Clazz.defineMethod (c$, "getRNA",
-function () {
-return jalview.datamodel.SecondaryStructureAnnotation._rna;
-});
-c$.getAnnotation = Clazz.defineMethod (c$, "getAnnotation",
-function (rna) {
-var ann = new Array (rna.getSize ());
-for (var i = 0; i < ann.length; i++) {
-ann[i] = new jalview.datamodel.Annotation (jalview.datamodel.SecondaryStructureAnnotation._rna.getStructDBN (true), "", ' ', 0);
-;}
-return ann;
-}, "fr.orsay.lri.varna.models.rna.RNA");
-Clazz.defineStatics (c$,
-"_rna", null);
-});
+Clazz.declarePackage ("jalview.datamodel");
+Clazz.load (["jalview.datamodel.AlignmentAnnotation"], "jalview.datamodel.SecondaryStructureAnnotation", ["jalview.datamodel.Annotation"], function () {
+c$ = Clazz.declareType (jalview.datamodel, "SecondaryStructureAnnotation", jalview.datamodel.AlignmentAnnotation);
+Clazz.makeConstructor (c$,
+function (rna) {
+Clazz.superConstructor (this, jalview.datamodel.SecondaryStructureAnnotation, ["Secondary Structure", "Un truc trop cool", jalview.datamodel.SecondaryStructureAnnotation.getAnnotation (rna)]);
+jalview.datamodel.SecondaryStructureAnnotation._rna = rna;
+}, "fr.orsay.lri.varna.models.rna.RNA");
+Clazz.defineMethod (c$, "getRNA",
+function () {
+return jalview.datamodel.SecondaryStructureAnnotation._rna;
+});
+c$.getAnnotation = Clazz.defineMethod (c$, "getAnnotation",
+function (rna) {
+var ann = new Array (rna.getSize ());
+for (var i = 0; i < ann.length; i++) {
+ann[i] = new jalview.datamodel.Annotation (jalview.datamodel.SecondaryStructureAnnotation._rna.getStructDBN (true), "", ' ', 0);
+;}
+return ann;
+}, "fr.orsay.lri.varna.models.rna.RNA");
+Clazz.defineStatics (c$,
+"_rna", null);
+});
diff --git a/bin/jalview/datamodel/SeqCigar.class b/bin/jalview/datamodel/SeqCigar.class
index 5f54f078404e89243ed9f3d90cc7c461a31f51c6..8bb4e15df3af4395cdaa2bf4673c6e8aef3e4d58 100644
GIT binary patch
delta 53
zcmezB|Ji?ok__YD&B`*@7!}nRxc@WAFmSRnJZ5K5WrP3*1`!9wKMb0ToMN1tW#n#h
F0sxc<3_$<@
delta 55
zcmezD|J8qkk__Yj&B`*@7?m{`c>gm 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;
-}, $fz.isPrivate = true, $fz), "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.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",
+($fz = 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;
+}, $fz.isPrivate = true, $fz), "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");
+});
diff --git a/bin/jalview/datamodel/Sequence.class b/bin/jalview/datamodel/Sequence.class
index 87bb9e379925b9147fc7678a239259659936b600..f406e42514a27dec0e1194ca8c7257d8b40d7033 100644
GIT binary patch
delta 43
xcmZ26g>m^5#tmI2jDDNDP0ScY#Ti)tGsrNou`@8TGtOWH0tN=r&DTu>MF0nx3KswX
delta 44
ycmZ2Jg>l6c#tmI2jQ*RuP0Sd@BpBHKGsrNou`@8TGtOWH0tN;lrp?z(14RH2?g|+I
diff --git a/bin/jalview/datamodel/Sequence.js b/bin/jalview/datamodel/Sequence.js
index 6a15091..06c8329 100644
--- a/bin/jalview/datamodel/Sequence.js
+++ b/bin/jalview/datamodel/Sequence.js
@@ -1,658 +1,658 @@
-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",
-($fz = function (oldEntry, newEntry) {
-if (newEntry.getFile () != null) {
-oldEntry.setFile (newEntry.getFile ());
-}}, $fz.isPrivate = true, $fz), "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",
-($fz = 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;
-}, $fz.isPrivate = true, $fz));
-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.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",
+($fz = function (oldEntry, newEntry) {
+if (newEntry.getFile () != null) {
+oldEntry.setFile (newEntry.getFile ());
+}}, $fz.isPrivate = true, $fz), "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",
+($fz = 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;
+}, $fz.isPrivate = true, $fz));
+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");
+});
diff --git a/bin/jalview/datamodel/SequenceCollectionI.js b/bin/jalview/datamodel/SequenceCollectionI.js
index b0849db..6f0107b 100644
--- a/bin/jalview/datamodel/SequenceCollectionI.js
+++ b/bin/jalview/datamodel/SequenceCollectionI.js
@@ -1,2 +1,2 @@
-Clazz.declarePackage ("jalview.datamodel");
-Clazz.declareInterface (jalview.datamodel, "SequenceCollectionI");
+Clazz.declarePackage ("jalview.datamodel");
+Clazz.declareInterface (jalview.datamodel, "SequenceCollectionI");
diff --git a/bin/jalview/datamodel/SequenceDummy.js b/bin/jalview/datamodel/SequenceDummy.js
index 38b0a3c..d5a179c 100644
--- a/bin/jalview/datamodel/SequenceDummy.js
+++ b/bin/jalview/datamodel/SequenceDummy.js
@@ -1,20 +1,20 @@
-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 ("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;
+});
+});
diff --git a/bin/jalview/datamodel/SequenceFeature.js b/bin/jalview/datamodel/SequenceFeature.js
index f8ce548..d2f14a8 100644
--- a/bin/jalview/datamodel/SequenceFeature.js
+++ b/bin/jalview/datamodel/SequenceFeature.js
@@ -1,170 +1,170 @@
-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.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;
+});
+});
diff --git a/bin/jalview/datamodel/SequenceGroup.class b/bin/jalview/datamodel/SequenceGroup.class
index f773fbca897d7e7630387a3859477bd45ad4b6a1..d962521a442198b9231e39355af8f30dd594a530 100644
GIT binary patch
delta 119
zcmZ3#jBx`H6&W(lnp|u+g_V_oSx99wuTd&9f8%|+kV_*?dWZKMQl*-KbeshuOZboKf2JXoQ=9*%^7+9Uy
z8JCGOFfsNs#xXE5m@+Uh8gDK&S7(&sW?<#{&5+~D$mGfhlrLl~g39Y`-eRG^$OV!2
M1 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",
-($fz = 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);
-}, $fz.isPrivate = true, $fz), "jalview.analysis.Conservation");
-Clazz.defineMethod (c$, "_updateConsensusRow",
-($fz = 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);
-}, $fz.isPrivate = true, $fz), "~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.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",
+($fz = 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);
+}, $fz.isPrivate = true, $fz), "jalview.analysis.Conservation");
+Clazz.defineMethod (c$, "_updateConsensusRow",
+($fz = 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);
+}, $fz.isPrivate = true, $fz), "~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;
+});
+});
diff --git a/bin/jalview/datamodel/SequenceI.js b/bin/jalview/datamodel/SequenceI.js
index 242d5a5..dcf0724 100644
--- a/bin/jalview/datamodel/SequenceI.js
+++ b/bin/jalview/datamodel/SequenceI.js
@@ -1,4 +1,4 @@
-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.load (["jalview.datamodel.ASequenceI"], "jalview.datamodel.SequenceI", null, function () {
+Clazz.declareInterface (jalview.datamodel, "SequenceI", jalview.datamodel.ASequenceI);
+});
diff --git a/bin/jalview/datamodel/SequenceNode.js b/bin/jalview/datamodel/SequenceNode.js
index 54cb491..2069471 100644
--- a/bin/jalview/datamodel/SequenceNode.js
+++ b/bin/jalview/datamodel/SequenceNode.js
@@ -1,64 +1,64 @@
-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");
+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;
+});
+});
diff --git a/bin/jalview/datamodel/SequencePoint.js b/bin/jalview/datamodel/SequencePoint.js
index 0616692..549eae1 100644
--- a/bin/jalview/datamodel/SequencePoint.js
+++ b/bin/jalview/datamodel/SequencePoint.js
@@ -1,12 +1,12 @@
-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.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");
diff --git a/bin/jalview/datamodel/StructureViewerModel.js b/bin/jalview/datamodel/StructureViewerModel.js
index e21d3fc..cc11e43 100644
--- a/bin/jalview/datamodel/StructureViewerModel.js
+++ b/bin/jalview/datamodel/StructureViewerModel.js
@@ -1,156 +1,156 @@
-Clazz.declarePackage ("jalview.datamodel");
-Clazz.load (["java.util.HashMap"], "jalview.datamodel.StructureViewerModel", ["java.util.ArrayList"], function () {
-c$ = Clazz.decorateAsClass (function () {
-this.x = 0;
-this.y = 0;
-this.width = 0;
-this.height = 0;
-this.alignWithPanel = false;
-this.colourWithAlignPanel = false;
-this.colourByViewer = false;
-this.stateData = "";
-this.viewId = null;
-this.type = null;
-this.fileData = null;
-if (!Clazz.isClassDefined ("jalview.datamodel.StructureViewerModel.StructureData")) {
-jalview.datamodel.StructureViewerModel.$StructureViewerModel$StructureData$ ();
-}
-Clazz.instantialize (this, arguments);
-}, jalview.datamodel, "StructureViewerModel");
-Clazz.prepareFields (c$, function () {
-this.fileData = new java.util.HashMap ();
-});
-Clazz.makeConstructor (c$,
-function (x, y, width, height, alignWithPanel, colourWithAlignPanel, colourByViewer, viewId, type) {
-this.x = x;
-this.y = y;
-this.width = width;
-this.height = height;
-this.alignWithPanel = alignWithPanel;
-this.colourWithAlignPanel = colourWithAlignPanel;
-this.colourByViewer = colourByViewer;
-this.viewId = viewId;
-this.type = type;
-}, "~N,~N,~N,~N,~B,~B,~B,~S,~S");
-Clazz.defineMethod (c$, "getX",
-function () {
-return this.x;
-});
-Clazz.defineMethod (c$, "setX",
-function (x) {
-this.x = x;
-}, "~N");
-Clazz.defineMethod (c$, "getY",
-function () {
-return this.y;
-});
-Clazz.defineMethod (c$, "setY",
-function (y) {
-this.y = y;
-}, "~N");
-Clazz.defineMethod (c$, "getWidth",
-function () {
-return this.width;
-});
-Clazz.defineMethod (c$, "setWidth",
-function (width) {
-this.width = width;
-}, "~N");
-Clazz.defineMethod (c$, "getHeight",
-function () {
-return this.height;
-});
-Clazz.defineMethod (c$, "setHeight",
-function (height) {
-this.height = height;
-}, "~N");
-Clazz.defineMethod (c$, "isAlignWithPanel",
-function () {
-return this.alignWithPanel;
-});
-Clazz.defineMethod (c$, "setAlignWithPanel",
-function (alignWithPanel) {
-this.alignWithPanel = alignWithPanel;
-}, "~B");
-Clazz.defineMethod (c$, "isColourWithAlignPanel",
-function () {
-return this.colourWithAlignPanel;
-});
-Clazz.defineMethod (c$, "setColourWithAlignPanel",
-function (colourWithAlignPanel) {
-this.colourWithAlignPanel = colourWithAlignPanel;
-}, "~B");
-Clazz.defineMethod (c$, "isColourByViewer",
-function () {
-return this.colourByViewer;
-});
-Clazz.defineMethod (c$, "setColourByViewer",
-function (colourByViewer) {
-this.colourByViewer = colourByViewer;
-}, "~B");
-Clazz.defineMethod (c$, "getStateData",
-function () {
-return this.stateData;
-});
-Clazz.defineMethod (c$, "setStateData",
-function (stateData) {
-this.stateData = stateData;
-}, "~S");
-Clazz.defineMethod (c$, "getFileData",
-function () {
-return this.fileData;
-});
-Clazz.defineMethod (c$, "setFileData",
-function (fileData) {
-this.fileData = fileData;
-}, "java.util.Map");
-Clazz.defineMethod (c$, "getViewId",
-function () {
-return this.viewId;
-});
-Clazz.defineMethod (c$, "getType",
-function () {
-return this.type;
-});
-c$.$StructureViewerModel$StructureData$ = function () {
-Clazz.pu$h ();
-c$ = Clazz.decorateAsClass (function () {
-Clazz.prepareCallback (this, arguments);
-this.filePath = null;
-this.pdbId = null;
-this.seqList = null;
-Clazz.instantialize (this, arguments);
-}, jalview.datamodel.StructureViewerModel, "StructureData");
-Clazz.makeConstructor (c$,
-function (a, b) {
-this.filePath = a;
-this.pdbId = b;
-this.seqList = new java.util.ArrayList ();
-}, "~S,~S");
-Clazz.defineMethod (c$, "getFilePath",
-function () {
-return this.filePath;
-});
-Clazz.defineMethod (c$, "setFilePath",
-function (a) {
-this.filePath = a;
-}, "~S");
-Clazz.defineMethod (c$, "getPdbId",
-function () {
-return this.pdbId;
-});
-Clazz.defineMethod (c$, "setPdbId",
-function (a) {
-this.pdbId = a;
-}, "~S");
-Clazz.defineMethod (c$, "getSeqList",
-function () {
-return this.seqList;
-});
-Clazz.defineMethod (c$, "setSeqList",
-function (a) {
-this.seqList = a;
-}, "java.util.List");
-c$ = Clazz.p0p ();
-};
-});
+Clazz.declarePackage ("jalview.datamodel");
+Clazz.load (["java.util.HashMap"], "jalview.datamodel.StructureViewerModel", ["java.util.ArrayList"], function () {
+c$ = Clazz.decorateAsClass (function () {
+this.x = 0;
+this.y = 0;
+this.width = 0;
+this.height = 0;
+this.alignWithPanel = false;
+this.colourWithAlignPanel = false;
+this.colourByViewer = false;
+this.stateData = "";
+this.viewId = null;
+this.type = null;
+this.fileData = null;
+if (!Clazz.isClassDefined ("jalview.datamodel.StructureViewerModel.StructureData")) {
+jalview.datamodel.StructureViewerModel.$StructureViewerModel$StructureData$ ();
+}
+Clazz.instantialize (this, arguments);
+}, jalview.datamodel, "StructureViewerModel");
+Clazz.prepareFields (c$, function () {
+this.fileData = new java.util.HashMap ();
+});
+Clazz.makeConstructor (c$,
+function (x, y, width, height, alignWithPanel, colourWithAlignPanel, colourByViewer, viewId, type) {
+this.x = x;
+this.y = y;
+this.width = width;
+this.height = height;
+this.alignWithPanel = alignWithPanel;
+this.colourWithAlignPanel = colourWithAlignPanel;
+this.colourByViewer = colourByViewer;
+this.viewId = viewId;
+this.type = type;
+}, "~N,~N,~N,~N,~B,~B,~B,~S,~S");
+Clazz.defineMethod (c$, "getX",
+function () {
+return this.x;
+});
+Clazz.defineMethod (c$, "setX",
+function (x) {
+this.x = x;
+}, "~N");
+Clazz.defineMethod (c$, "getY",
+function () {
+return this.y;
+});
+Clazz.defineMethod (c$, "setY",
+function (y) {
+this.y = y;
+}, "~N");
+Clazz.defineMethod (c$, "getWidth",
+function () {
+return this.width;
+});
+Clazz.defineMethod (c$, "setWidth",
+function (width) {
+this.width = width;
+}, "~N");
+Clazz.defineMethod (c$, "getHeight",
+function () {
+return this.height;
+});
+Clazz.defineMethod (c$, "setHeight",
+function (height) {
+this.height = height;
+}, "~N");
+Clazz.defineMethod (c$, "isAlignWithPanel",
+function () {
+return this.alignWithPanel;
+});
+Clazz.defineMethod (c$, "setAlignWithPanel",
+function (alignWithPanel) {
+this.alignWithPanel = alignWithPanel;
+}, "~B");
+Clazz.defineMethod (c$, "isColourWithAlignPanel",
+function () {
+return this.colourWithAlignPanel;
+});
+Clazz.defineMethod (c$, "setColourWithAlignPanel",
+function (colourWithAlignPanel) {
+this.colourWithAlignPanel = colourWithAlignPanel;
+}, "~B");
+Clazz.defineMethod (c$, "isColourByViewer",
+function () {
+return this.colourByViewer;
+});
+Clazz.defineMethod (c$, "setColourByViewer",
+function (colourByViewer) {
+this.colourByViewer = colourByViewer;
+}, "~B");
+Clazz.defineMethod (c$, "getStateData",
+function () {
+return this.stateData;
+});
+Clazz.defineMethod (c$, "setStateData",
+function (stateData) {
+this.stateData = stateData;
+}, "~S");
+Clazz.defineMethod (c$, "getFileData",
+function () {
+return this.fileData;
+});
+Clazz.defineMethod (c$, "setFileData",
+function (fileData) {
+this.fileData = fileData;
+}, "java.util.Map");
+Clazz.defineMethod (c$, "getViewId",
+function () {
+return this.viewId;
+});
+Clazz.defineMethod (c$, "getType",
+function () {
+return this.type;
+});
+c$.$StructureViewerModel$StructureData$ = function () {
+Clazz.pu$h ();
+c$ = Clazz.decorateAsClass (function () {
+Clazz.prepareCallback (this, arguments);
+this.filePath = null;
+this.pdbId = null;
+this.seqList = null;
+Clazz.instantialize (this, arguments);
+}, jalview.datamodel.StructureViewerModel, "StructureData");
+Clazz.makeConstructor (c$,
+function (a, b) {
+this.filePath = a;
+this.pdbId = b;
+this.seqList = new java.util.ArrayList ();
+}, "~S,~S");
+Clazz.defineMethod (c$, "getFilePath",
+function () {
+return this.filePath;
+});
+Clazz.defineMethod (c$, "setFilePath",
+function (a) {
+this.filePath = a;
+}, "~S");
+Clazz.defineMethod (c$, "getPdbId",
+function () {
+return this.pdbId;
+});
+Clazz.defineMethod (c$, "setPdbId",
+function (a) {
+this.pdbId = a;
+}, "~S");
+Clazz.defineMethod (c$, "getSeqList",
+function () {
+return this.seqList;
+});
+Clazz.defineMethod (c$, "setSeqList",
+function (a) {
+this.seqList = a;
+}, "java.util.List");
+c$ = Clazz.p0p ();
+};
+});
diff --git a/bin/jalview/datamodel/UniprotEntry.js b/bin/jalview/datamodel/UniprotEntry.js
index 24b3ce2..5b80f48 100644
--- a/bin/jalview/datamodel/UniprotEntry.js
+++ b/bin/jalview/datamodel/UniprotEntry.js
@@ -1,58 +1,58 @@
-Clazz.declarePackage ("jalview.datamodel");
-c$ = Clazz.decorateAsClass (function () {
-this.sequence = null;
-this.name = null;
-this.accession = null;
-this.feature = null;
-this.dbrefs = null;
-this.protName = null;
-Clazz.instantialize (this, arguments);
-}, jalview.datamodel, "UniprotEntry");
-Clazz.defineMethod (c$, "setAccession",
-function (items) {
-this.accession = items;
-}, "java.util.Vector");
-Clazz.defineMethod (c$, "setFeature",
-function (items) {
-this.feature = items;
-}, "java.util.Vector");
-Clazz.defineMethod (c$, "getFeature",
-function () {
-return this.feature;
-});
-Clazz.defineMethod (c$, "getAccession",
-function () {
-return this.accession;
-});
-Clazz.defineMethod (c$, "setProtein",
-function (names) {
-this.protName = names;
-}, "jalview.datamodel.UniprotProteinName");
-Clazz.defineMethod (c$, "getProtein",
-function () {
-return this.protName;
-});
-Clazz.defineMethod (c$, "setName",
-function (na) {
-this.name = na;
-}, "java.util.Vector");
-Clazz.defineMethod (c$, "getName",
-function () {
-return this.name;
-});
-Clazz.defineMethod (c$, "getUniprotSequence",
-function () {
-return this.sequence;
-});
-Clazz.defineMethod (c$, "setUniprotSequence",
-function (seq) {
-this.sequence = seq;
-}, "jalview.datamodel.UniprotSequence");
-Clazz.defineMethod (c$, "getDbReference",
-function () {
-return this.dbrefs;
-});
-Clazz.defineMethod (c$, "setDbReference",
-function (dbref) {
-this.dbrefs = dbref;
-}, "java.util.Vector");
+Clazz.declarePackage ("jalview.datamodel");
+c$ = Clazz.decorateAsClass (function () {
+this.sequence = null;
+this.name = null;
+this.accession = null;
+this.feature = null;
+this.dbrefs = null;
+this.protName = null;
+Clazz.instantialize (this, arguments);
+}, jalview.datamodel, "UniprotEntry");
+Clazz.defineMethod (c$, "setAccession",
+function (items) {
+this.accession = items;
+}, "java.util.Vector");
+Clazz.defineMethod (c$, "setFeature",
+function (items) {
+this.feature = items;
+}, "java.util.Vector");
+Clazz.defineMethod (c$, "getFeature",
+function () {
+return this.feature;
+});
+Clazz.defineMethod (c$, "getAccession",
+function () {
+return this.accession;
+});
+Clazz.defineMethod (c$, "setProtein",
+function (names) {
+this.protName = names;
+}, "jalview.datamodel.UniprotProteinName");
+Clazz.defineMethod (c$, "getProtein",
+function () {
+return this.protName;
+});
+Clazz.defineMethod (c$, "setName",
+function (na) {
+this.name = na;
+}, "java.util.Vector");
+Clazz.defineMethod (c$, "getName",
+function () {
+return this.name;
+});
+Clazz.defineMethod (c$, "getUniprotSequence",
+function () {
+return this.sequence;
+});
+Clazz.defineMethod (c$, "setUniprotSequence",
+function (seq) {
+this.sequence = seq;
+}, "jalview.datamodel.UniprotSequence");
+Clazz.defineMethod (c$, "getDbReference",
+function () {
+return this.dbrefs;
+});
+Clazz.defineMethod (c$, "setDbReference",
+function (dbref) {
+this.dbrefs = dbref;
+}, "java.util.Vector");
diff --git a/bin/jalview/datamodel/UniprotFile.js b/bin/jalview/datamodel/UniprotFile.js
index f779f79..e0f80f8 100644
--- a/bin/jalview/datamodel/UniprotFile.js
+++ b/bin/jalview/datamodel/UniprotFile.js
@@ -1,13 +1,13 @@
-Clazz.declarePackage ("jalview.datamodel");
-c$ = Clazz.decorateAsClass (function () {
-this._items = null;
-Clazz.instantialize (this, arguments);
-}, jalview.datamodel, "UniprotFile");
-Clazz.defineMethod (c$, "setUniprotEntries",
-function (items) {
-this._items = items;
-}, "java.util.Vector");
-Clazz.defineMethod (c$, "getUniprotEntries",
-function () {
-return this._items;
-});
+Clazz.declarePackage ("jalview.datamodel");
+c$ = Clazz.decorateAsClass (function () {
+this._items = null;
+Clazz.instantialize (this, arguments);
+}, jalview.datamodel, "UniprotFile");
+Clazz.defineMethod (c$, "setUniprotEntries",
+function (items) {
+this._items = items;
+}, "java.util.Vector");
+Clazz.defineMethod (c$, "getUniprotEntries",
+function () {
+return this._items;
+});
diff --git a/bin/jalview/datamodel/UniprotProteinName.js b/bin/jalview/datamodel/UniprotProteinName.js
index fd4ce5b..931e26c 100644
--- a/bin/jalview/datamodel/UniprotProteinName.js
+++ b/bin/jalview/datamodel/UniprotProteinName.js
@@ -1,13 +1,13 @@
-Clazz.declarePackage ("jalview.datamodel");
-c$ = Clazz.decorateAsClass (function () {
-this.names = null;
-Clazz.instantialize (this, arguments);
-}, jalview.datamodel, "UniprotProteinName");
-Clazz.defineMethod (c$, "setName",
-function (names) {
-this.names = names;
-}, "java.util.Vector");
-Clazz.defineMethod (c$, "getName",
-function () {
-return this.names;
-});
+Clazz.declarePackage ("jalview.datamodel");
+c$ = Clazz.decorateAsClass (function () {
+this.names = null;
+Clazz.instantialize (this, arguments);
+}, jalview.datamodel, "UniprotProteinName");
+Clazz.defineMethod (c$, "setName",
+function (names) {
+this.names = names;
+}, "java.util.Vector");
+Clazz.defineMethod (c$, "getName",
+function () {
+return this.names;
+});
diff --git a/bin/jalview/datamodel/UniprotSequence.js b/bin/jalview/datamodel/UniprotSequence.js
index 039f1db..d6ae549 100644
--- a/bin/jalview/datamodel/UniprotSequence.js
+++ b/bin/jalview/datamodel/UniprotSequence.js
@@ -1,21 +1,21 @@
-Clazz.declarePackage ("jalview.datamodel");
-Clazz.load (null, "jalview.datamodel.UniprotSequence", ["java.lang.StringBuilder"], function () {
-c$ = Clazz.decorateAsClass (function () {
-this._content = "";
-Clazz.instantialize (this, arguments);
-}, jalview.datamodel, "UniprotSequence");
-Clazz.defineMethod (c$, "setContent",
-function (seq) {
-if (seq != null) {
-var sb = new StringBuilder (seq.length);
-for (var i = 0; i < seq.length; i++) {
-if (seq.charAt (i) != ' ') {
-sb.append (seq.charAt (i));
-}}
-this._content = sb.toString ();
-}}, "~S");
-Clazz.defineMethod (c$, "getContent",
-function () {
-return this._content;
-});
-});
+Clazz.declarePackage ("jalview.datamodel");
+Clazz.load (null, "jalview.datamodel.UniprotSequence", ["java.lang.StringBuilder"], function () {
+c$ = Clazz.decorateAsClass (function () {
+this._content = "";
+Clazz.instantialize (this, arguments);
+}, jalview.datamodel, "UniprotSequence");
+Clazz.defineMethod (c$, "setContent",
+function (seq) {
+if (seq != null) {
+var sb = new StringBuilder (seq.length);
+for (var i = 0; i < seq.length; i++) {
+if (seq.charAt (i) != ' ') {
+sb.append (seq.charAt (i));
+}}
+this._content = sb.toString ();
+}}, "~S");
+Clazz.defineMethod (c$, "getContent",
+function () {
+return this._content;
+});
+});
diff --git a/bin/jalview/ext/jmol/JmolCommands.class b/bin/jalview/ext/jmol/JmolCommands.class
index 5debe8db5e968bb61304a3d53794be9890ac6665..36f4b3f4c1991dc1021435eecf267f58a50cb60d 100644
GIT binary patch
delta 53
zcmaE<@mynrEidEA&33$2Ec|^8B7Yh9*%<^F|1)SY@J#+7BsSSVh>MAVVe%@$Bqk-s
J&HO@9OaP|G4ZHvV
delta 51
zcmaE^@ls=hEidEg&33$2Ec_D~#Qrkyvoi=V{%25U;F%mKq`=I;z%+TKU=p)DBhzMH
Hp(rK*dCd$<
diff --git a/bin/jalview/ext/jmol/JmolCommands.js b/bin/jalview/ext/jmol/JmolCommands.js
index 495572c..b08a4e3 100644
--- a/bin/jalview/ext/jmol/JmolCommands.js
+++ b/bin/jalview/ext/jmol/JmolCommands.js
@@ -1,69 +1,69 @@
-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.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");
+});
diff --git a/bin/jalview/ext/varna/JalviewVarnaBinding.js b/bin/jalview/ext/varna/JalviewVarnaBinding.js
index f8bdf18..61bd3e7 100644
--- a/bin/jalview/ext/varna/JalviewVarnaBinding.js
+++ b/bin/jalview/ext/varna/JalviewVarnaBinding.js
@@ -1,4 +1,4 @@
-Clazz.declarePackage ("jalview.ext.varna");
-Clazz.load (["jalview.api.StructureSelectionManagerProvider", "jalview.structure.StructureListener", "jalview.structures.models.SequenceStructureBindingModel", "java.awt.event.ComponentListener"], "jalview.ext.varna.JalviewVarnaBinding", null, function () {
-c$ = Clazz.declareType (jalview.ext.varna, "JalviewVarnaBinding", jalview.structures.models.SequenceStructureBindingModel, [jalview.structure.StructureListener, java.awt.event.ComponentListener, jalview.api.StructureSelectionManagerProvider]);
-});
+Clazz.declarePackage ("jalview.ext.varna");
+Clazz.load (["jalview.api.StructureSelectionManagerProvider", "jalview.structure.StructureListener", "jalview.structures.models.SequenceStructureBindingModel", "java.awt.event.ComponentListener"], "jalview.ext.varna.JalviewVarnaBinding", null, function () {
+c$ = Clazz.declareType (jalview.ext.varna, "JalviewVarnaBinding", jalview.structures.models.SequenceStructureBindingModel, [jalview.structure.StructureListener, java.awt.event.ComponentListener, jalview.api.StructureSelectionManagerProvider]);
+});
diff --git a/bin/jalview/ext/varna/RnaModel.js b/bin/jalview/ext/varna/RnaModel.js
index 9916e8e..f125256 100644
--- a/bin/jalview/ext/varna/RnaModel.js
+++ b/bin/jalview/ext/varna/RnaModel.js
@@ -1,17 +1,17 @@
-Clazz.declarePackage ("jalview.ext.varna");
-c$ = Clazz.decorateAsClass (function () {
-this.title = null;
-this.ann = null;
-this.seq = null;
-this.gapped = false;
-this.rna = null;
-Clazz.instantialize (this, arguments);
-}, jalview.ext.varna, "RnaModel");
-Clazz.makeConstructor (c$,
-function (t, aa, s, r, g) {
-this.title = t;
-this.ann = aa;
-this.seq = s;
-this.rna = r;
-this.gapped = g;
-}, "~S,jalview.datamodel.AlignmentAnnotation,jalview.datamodel.SequenceI,fr.orsay.lri.varna.models.rna.RNA,~B");
+Clazz.declarePackage ("jalview.ext.varna");
+c$ = Clazz.decorateAsClass (function () {
+this.title = null;
+this.ann = null;
+this.seq = null;
+this.gapped = false;
+this.rna = null;
+Clazz.instantialize (this, arguments);
+}, jalview.ext.varna, "RnaModel");
+Clazz.makeConstructor (c$,
+function (t, aa, s, r, g) {
+this.title = t;
+this.ann = aa;
+this.seq = s;
+this.rna = r;
+this.gapped = g;
+}, "~S,jalview.datamodel.AlignmentAnnotation,jalview.datamodel.SequenceI,fr.orsay.lri.varna.models.rna.RNA,~B");
diff --git a/bin/jalview/ext/varna/VarnaCommands.class b/bin/jalview/ext/varna/VarnaCommands.class
index 7a0d88ffafdbe8ab137ff09f63003b25e2f799e2..27a2330ebde8b4427e67fa7ff0e1773236622921 100644
GIT binary patch
delta 46
zcmdn0x>$L
diff --git a/bin/jalview/ext/varna/VarnaCommands.js b/bin/jalview/ext/varna/VarnaCommands.js
index b609d09..6562f80 100644
--- a/bin/jalview/ext/varna/VarnaCommands.js
+++ b/bin/jalview/ext/varna/VarnaCommands.js
@@ -1,66 +1,66 @@
-Clazz.declarePackage ("jalview.ext.varna");
-Clazz.load (null, "jalview.ext.varna.VarnaCommands", ["jalview.util.Comparison", "java.lang.StringBuffer", "java.util.ArrayList"], function () {
-c$ = Clazz.declareType (jalview.ext.varna, "VarnaCommands");
-c$.getColourBySequenceCommand = Clazz.defineMethod (c$, "getColourBySequenceCommand",
-function (ssm, files, sequence, sr, fr, alignment) {
-var str = new java.util.ArrayList ();
-var command = new StringBuffer ();
-for (var pdbfnum = 0; pdbfnum < files.length; pdbfnum++) {
-var mapping = ssm.getMapping (files[pdbfnum]);
-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.varna.VarnaCommands.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);
-}return str.toArray ( new Array (str.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.ext.varna");
+Clazz.load (null, "jalview.ext.varna.VarnaCommands", ["jalview.util.Comparison", "java.lang.StringBuffer", "java.util.ArrayList"], function () {
+c$ = Clazz.declareType (jalview.ext.varna, "VarnaCommands");
+c$.getColourBySequenceCommand = Clazz.defineMethod (c$, "getColourBySequenceCommand",
+function (ssm, files, sequence, sr, fr, alignment) {
+var str = new java.util.ArrayList ();
+var command = new StringBuffer ();
+for (var pdbfnum = 0; pdbfnum < files.length; pdbfnum++) {
+var mapping = ssm.getMapping (files[pdbfnum]);
+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.varna.VarnaCommands.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);
+}return str.toArray ( new Array (str.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");
+});
diff --git a/bin/jalview/io/AlignFile.js b/bin/jalview/io/AlignFile.js
index f3247de..142c507 100644
--- a/bin/jalview/io/AlignFile.js
+++ b/bin/jalview/io/AlignFile.js
@@ -1,158 +1,158 @@
-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 (["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");
+});
diff --git a/bin/jalview/io/AlignmentProperties.js b/bin/jalview/io/AlignmentProperties.js
index 0092589..6030bea 100644
--- a/bin/jalview/io/AlignmentProperties.js
+++ b/bin/jalview/io/AlignmentProperties.js
@@ -1,78 +1,78 @@
-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 ? "
" : 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 ("");
-}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 ("
");
-}pos = npos + 1;
-} while (npos != -1);
-sb.append ("" + key + " | " + val + " |
");
-} else {
-sb.append (nl + key + "\t" + vals);
-}}
-if (html) {
-sb.append ("
");
-}}}, "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.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 ? "
" : 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 ("");
+}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 ("
");
+}pos = npos + 1;
+} while (npos != -1);
+sb.append ("" + key + " | " + val + " |
");
+} else {
+sb.append (nl + key + "\t" + vals);
+}}
+if (html) {
+sb.append ("
");
+}}}, "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);
+});
+});
diff --git a/bin/jalview/io/AnnotationFile.class b/bin/jalview/io/AnnotationFile.class
index 4aea77ae865b6b714b9287cb808d4631545e91f6..fd5b7293d5a862b706a73e4abde4c304ee90c61a 100644
GIT binary patch
literal 36157
zcmchA34B$>_5YdW-uvFmO$bR|lE)eZ1rh>+81V(f00Dw5N>~go5RwN3LlTp)DehFQ
z)_o1Qp<>(>g#eU1Vi#O8WDDvx
z6+=v4zHDKnaaQHRTC>3Vs><3qm5nw09xb#-8?XUV)W@Y>l;NX1L1{d{p-qv7%Erp(
z`o;hqKm#1=-vNW=tDBl5%Un8;4ic2IIMRG{V|_!Uv3a$ig9hz`uj0Y`7V&fkxnz;e
zPx&tSDZo!dTuSlEhPvcZs*es9gi1jpTuLK5fTxiz9ZDI%15cm#X-Q3!pq}wP*oOeH
z1L;kX=IP#cdmAh$*wsvdURhU*_E=P>_F03vScgN{mh8^d<57r1M+(Z>x2~qPI@0K)
zaiF^?B~#~=mCl`CGJX1tStYZ|W=s#zSen4QaX3FsbZHVz2BlRtG(_q^F@;@CdLQ(T
zTW-cE_7MmyrGMUd&{uP$I-KXwRP3;s((>k-+F=t=9H6794-Ynj2Rpjc7#_29v4ycQ
zxaUll%4sxcxw+oMZh*$n1m3kdE;-}_J{!PQ%?ZB5hE)zaF1}?6wkfHtSzNa)lH9h~
zTc4Tm)S9N|f9ZImyO?H-yC*f)FK;M5;%85Z
z>Gyb-=F$m*p8TZ~>Uy*;W;wpTcKNcp@<=V@9fTqG>nx_?_%2J-?!!O>=0LDch%D+F
z$tjg_af@yJ*^2__)?zn78=dzTQnJAlC^Zp43?|hl_8V+BwS!Pw-4GLOha`1ig84Zc
zC}_{mp7}2TpVTF>1Qd4Oj{hG!=BFjJ)S((d{bCdN$sKp;B-SWC)~t1v%b<3afvb$n
znov5?@1uHXu>iCC$t*n@A;Ev9gfcpmr_$`wa#|rMbwy264LI4b6t+F8lnvX@0Rh)H
z7IX7eF0H0hKq5ub@r|Ia{W3az2j9Xd@=uh_D?5Ibcqok3?}jY}$8zPpJHuP+(y!=Tw1&EfweD;5MCXl-35>Gh6grYIFYIfTDi!sN0ErQ>Hz
zE%!6rD_y#ZuJ&|ZhYr|-n9fTG-xRu*);ZMDL60z(xwM|H1F6(BM~vkF2JO(hELsi(
z+(0)ubR)ngG*PV9r44j5L_?i1zB=mMs4jBoR%q$t%6xPih;IlhAfvzTU<$kw+dHUi
zUrilTS3bHMoeFsl_quc+Bgz4yreip!;yw;NASg32uQ;~`XcO0N0iF`I<7%+&=(w5s
z_-PwGM^N#0f2barQh
ziyJE&mKX*>`!XK)NtbrfQ=m~03ebk7&*L7?xb!Rqp!}PnX6VewBGx^>cjq6Bqu)rN5eOLE$XW1ed+RTk=}U!WelUde*7gOMAvdMB|7-4ypXDf;E+~ixAzN7C2St}}Qm&1Y*69crD{_W6@@G%S%n3+wi
zt*-?4x1#}BHBHkir!yf=WRiGSNLMIcWJ-0Usj9K2f$b2WQdq9AnWQa4(mnwj(La60
zeB%N6eFCH#7*{eg{_X+-J4Vq0aEeHCMK_TSp$y8OwWKl9w4}Zk7IN3(cM>xWyG6x5
zkpb9oPs`7f$#O-ICu!AIE{xRrL=KkX_lppH>xdp*%IP>f2o2E-f=Bd5J1iQ65%V*>
z9gBL4fF`o|Po69Ki36}j&|LM)8?nb;m&%pR!yu@kl>E=
z(PE$&n}D+KOo|~dM7}Eu#1Ie;93oF%%yGm}2!zDE%j%jVi$R5=
zP#g?TgeB}IF~SvxFlD8HSeh$q>Y9#1L>uw0OK4(I;)-!%yr;pL
z0ZXD-86Oa(Vv-{!8W%2U7sl5wgKJ#VRA1+c$)e1V{G>`)33|}@!4TnN#8FHRQ<)sb
zCy(5L9H6wsbZ$3;^;MT-Ui}Ny24V_ffYb3LLpOU%${jDwb2z#ET2=G5YLE!U#2q0@+iw)v4U&T
zAqQ5L)Yiu8Sgeaxu2{{L-KyYOHpcrk`NXMM*~}SpkDfW>=+c?9%1X;2d|)EFeltLG
z{i2%YF}$f~@N}Vl3gMQ~f-F%Gz4UlBO{}v6g{(!*42BGc6Ev~p#Y=kT^lxBKDRb@tbIbmuJp5qg(
zz)i{2vPsjYl}?|4&?^*E7?UyaW_+JTF*x}l%yp}$|Di5c(Nzw
zSV_pe44w^BN1qMV;2AQ66!sj1l0= |