JAL-1807 still testing
[jalviewjs.git] / bin / jalview / commands / TrimRegionCommand.js
index 2732ca0..ff06747 100644 (file)
@@ -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");\r
+Clazz.load (["jalview.commands.EditCommand"], "jalview.commands.TrimRegionCommand", null, function () {\r
+c$ = Clazz.decorateAsClass (function () {\r
+this.colSel = null;\r
+this.start = null;\r
+this.shiftList = null;\r
+this.selectionGroup = null;\r
+this.deletedHiddenColumns = null;\r
+this.columnsDeleted = 0;\r
+Clazz.instantialize (this, arguments);\r
+}, jalview.commands, "TrimRegionCommand", jalview.commands.EditCommand);\r
+Clazz.makeConstructor (c$, \r
+function (description, command, seqs, column, al, colSel, selectedRegion) {\r
+Clazz.superConstructor (this, jalview.commands.TrimRegionCommand, []);\r
+this.description = description;\r
+this.selectionGroup = selectedRegion;\r
+this.colSel = colSel;\r
+if (command.equalsIgnoreCase (jalview.commands.TrimRegionCommand.TRIM_LEFT)) {\r
+if (column == 0) {\r
+return;\r
+}this.columnsDeleted = column;\r
+this.setEdit (Clazz.innerTypeInstance (jalview.commands.EditCommand.Edit, this, null, jalview.commands.EditCommand.Action.CUT, seqs, 0, column, al));\r
+} else if (command.equalsIgnoreCase (jalview.commands.TrimRegionCommand.TRIM_RIGHT)) {\r
+var width = al.getWidth () - column - 1;\r
+if (width < 2) {\r
+return;\r
+}this.columnsDeleted = width - 1;\r
+this.setEdit (Clazz.innerTypeInstance (jalview.commands.EditCommand.Edit, this, null, jalview.commands.EditCommand.Action.CUT, seqs, column + 1, width, al));\r
+}var i;\r
+var isize = this.getEdit (0).seqs.length;\r
+this.start =  Clazz.newIntArray (isize, 0);\r
+for (i = 0; i < isize; i++) {\r
+this.start[i] = this.getEdit (0).seqs[i].getStart ();\r
+}\r
+this.performEdit (0, null);\r
+}, "~S,~S,~A,~N,jalview.datamodel.AlignmentI,jalview.datamodel.ColumnSelection,jalview.datamodel.SequenceGroup");\r
+Clazz.defineMethod (c$, "cut", \r
+function (command) {\r
+var column;\r
+var j;\r
+var jSize = command.seqs.length;\r
+for (j = 0; j < jSize; j++) {\r
+if (command.position == 0) {\r
+column = command.seqs[j].findPosition (command.number);\r
+command.seqs[j].setStart (column);\r
+} else {\r
+column = command.seqs[j].findPosition (command.position) - 1;\r
+command.seqs[j].setEnd (column);\r
+}}\r
+Clazz.superCall (this, jalview.commands.TrimRegionCommand, "cut", [command, null]);\r
+if (command.position == 0) {\r
+this.deletedHiddenColumns = this.colSel.compensateForEdit (0, command.number);\r
+if (this.selectionGroup != null) {\r
+this.selectionGroup.adjustForRemoveLeft (command.number);\r
+}} else {\r
+this.deletedHiddenColumns = this.colSel.compensateForEdit (command.position, command.number);\r
+if (this.selectionGroup != null) {\r
+this.selectionGroup.adjustForRemoveRight (command.position);\r
+}}}, "jalview.commands.EditCommand.Edit");\r
+Clazz.defineMethod (c$, "paste", \r
+function (command) {\r
+Clazz.superCall (this, jalview.commands.TrimRegionCommand, "paste", [command, null]);\r
+var column;\r
+var j;\r
+var jSize = command.seqs.length;\r
+for (j = 0; j < jSize; j++) {\r
+if (command.position == 0) {\r
+command.seqs[j].setStart (this.start[j]);\r
+} else {\r
+column = command.seqs[j].findPosition (command.number + command.position) - 1;\r
+command.seqs[j].setEnd (column);\r
+}}\r
+if (command.position == 0) {\r
+this.colSel.compensateForEdit (0, -command.number);\r
+if (this.selectionGroup != null) {\r
+this.selectionGroup.adjustForRemoveLeft (-command.number);\r
+}}if (this.deletedHiddenColumns != null) {\r
+var region;\r
+for (var i = 0; i < this.deletedHiddenColumns.size (); i++) {\r
+region = this.deletedHiddenColumns.get (i);\r
+this.colSel.hideColumns (region[0], region[1]);\r
+}\r
+}}, "jalview.commands.EditCommand.Edit");\r
+Clazz.overrideMethod (c$, "getSize", \r
+function () {\r
+return this.columnsDeleted;\r
+});\r
+Clazz.defineStatics (c$,\r
+"TRIM_LEFT", "TrimLeft",\r
+"TRIM_RIGHT", "TrimRight");\r
+});\r