1 Clazz.declarePackage ("jalview.commands");
2 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 () {
3 c$ = Clazz.decorateAsClass (function () {
5 this.description = null;
6 if (!Clazz.isClassDefined ("jalview.commands.EditCommand.Edit")) {
7 jalview.commands.EditCommand.$EditCommand$Edit$ ();
9 Clazz.instantialize (this, arguments);
10 }, jalview.commands, "EditCommand", null, jalview.commands.CommandI);
11 Clazz.prepareFields (c$, function () {
12 this.edits = new java.util.ArrayList ();
14 Clazz.makeConstructor (c$,
17 Clazz.makeConstructor (c$,
18 function (description) {
19 this.description = description;
21 Clazz.makeConstructor (c$,
22 function (description, command, seqs, position, number, al) {
23 this.description = description;
24 if (command === jalview.commands.EditCommand.Action.CUT || command === jalview.commands.EditCommand.Action.PASTE) {
25 this.setEdit (Clazz.innerTypeInstance (jalview.commands.EditCommand.Edit, this, null, command, seqs, position, number, al));
26 }this.performEdit (0, null);
27 }, "~S,jalview.commands.EditCommand.Action,~A,~N,~N,jalview.datamodel.AlignmentI");
28 Clazz.makeConstructor (c$,
29 function (description, command, replace, seqs, position, number, al) {
30 this.description = description;
31 if (command === jalview.commands.EditCommand.Action.REPLACE) {
32 this.setEdit (Clazz.innerTypeInstance (jalview.commands.EditCommand.Edit, this, null, command, seqs, position, number, al, replace));
33 }this.performEdit (0, null);
34 }, "~S,jalview.commands.EditCommand.Action,~S,~A,~N,~N,jalview.datamodel.AlignmentI");
35 Clazz.defineMethod (c$, "setEdit",
39 }, "jalview.commands.EditCommand.Edit");
40 Clazz.defineMethod (c$, "addEdit",
42 if (!jalview.commands.EditCommand.expandEdit (this.edits, e)) {
44 }}, "jalview.commands.EditCommand.Edit");
45 c$.expandEdit = Clazz.defineMethod (c$, "expandEdit",
47 if (edits == null || edits.isEmpty ()) {
49 }var lastEdit = edits.get (edits.size () - 1);
50 var action = e.command;
51 if (lastEdit.command !== action) {
53 }if (lastEdit.seqs.length != e.seqs.length) {
55 }for (var i = 0; i < e.seqs.length; i++) {
56 if (lastEdit.seqs[i].getDatasetSequence () !== e.seqs[i].getDatasetSequence ()) {
59 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);
61 lastEdit.number += e.number;
62 lastEdit.seqs = e.seqs;
63 if (action === jalview.commands.EditCommand.Action.DELETE_GAP) {
67 }, "java.util.List,jalview.commands.EditCommand.Edit");
68 Clazz.defineMethod (c$, "clearEdits",
72 Clazz.defineMethod (c$, "getEdit",
74 if (i >= 0 && i < this.edits.size ()) {
75 return this.edits.get (i);
78 Clazz.overrideMethod (c$, "getDescription",
80 return this.description;
82 Clazz.overrideMethod (c$, "getSize",
84 return this.edits.size ();
86 Clazz.defineMethod (c$, "getAlignment",
88 return (this.edits.isEmpty () ? null : this.edits.get (0).al);
90 Clazz.defineMethod (c$, "appendEdit",
91 function (command, seqs, position, number, al, performEdit) {
92 this.appendEdit (command, seqs, position, number, al, performEdit, null);
93 }, "jalview.commands.EditCommand.Action,~A,~N,~N,jalview.datamodel.AlignmentI,~B");
94 Clazz.defineMethod (c$, "appendEdit",
95 function (command, seqs, position, number, al, performEdit, views) {
96 var edit = Clazz.innerTypeInstance (jalview.commands.EditCommand.Edit, this, null, command, seqs, position, number, al.getGapCharacter ());
97 if (al.getHeight () == seqs.length) {
99 edit.fullAlignmentHeight = true;
100 }this.addEdit (edit);
102 jalview.commands.EditCommand.performEdit (edit, views);
103 }}, "jalview.commands.EditCommand.Action,~A,~N,~N,jalview.datamodel.AlignmentI,~B,~A");
104 Clazz.defineMethod (c$, "appendEdit",
105 function (edit, al, performEdit, views) {
106 if (al.getHeight () == edit.seqs.length) {
108 edit.fullAlignmentHeight = true;
109 }this.addEdit (edit);
111 jalview.commands.EditCommand.performEdit (edit, views);
112 }}, "jalview.commands.EditCommand.Edit,jalview.datamodel.AlignmentI,~B,~A");
113 Clazz.defineMethod (c$, "performEdit",
114 function (commandIndex, views) {
115 var iterator = this.edits.listIterator (commandIndex);
116 while (iterator.hasNext ()) {
117 var edit = iterator.next ();
118 jalview.commands.EditCommand.performEdit (edit, views);
121 c$.performEdit = Clazz.defineMethod (c$, "performEdit",
122 function (edit, views) {
123 switch (edit.command) {
124 case jalview.commands.EditCommand.Action.INSERT_GAP:
125 jalview.commands.EditCommand.insertGap (edit);
127 case jalview.commands.EditCommand.Action.DELETE_GAP:
128 jalview.commands.EditCommand.deleteGap (edit);
130 case jalview.commands.EditCommand.Action.CUT:
131 jalview.commands.EditCommand.cut (edit, views);
133 case jalview.commands.EditCommand.Action.PASTE:
134 jalview.commands.EditCommand.paste (edit, views);
136 case jalview.commands.EditCommand.Action.REPLACE:
137 jalview.commands.EditCommand.replace (edit);
139 case jalview.commands.EditCommand.Action.INSERT_NUC:
144 }, "jalview.commands.EditCommand.Edit,~A");
145 Clazz.overrideMethod (c$, "doCommand",
147 this.performEdit (0, views);
149 Clazz.overrideMethod (c$, "undoCommand",
151 var iterator = this.edits.listIterator (this.edits.size ());
152 while (iterator.hasPrevious ()) {
153 var e = iterator.previous ();
155 case jalview.commands.EditCommand.Action.INSERT_GAP:
156 jalview.commands.EditCommand.deleteGap (e);
158 case jalview.commands.EditCommand.Action.DELETE_GAP:
159 jalview.commands.EditCommand.insertGap (e);
161 case jalview.commands.EditCommand.Action.CUT:
162 jalview.commands.EditCommand.paste (e, views);
164 case jalview.commands.EditCommand.Action.PASTE:
165 jalview.commands.EditCommand.cut (e, views);
167 case jalview.commands.EditCommand.Action.REPLACE:
168 jalview.commands.EditCommand.replace (e);
170 case jalview.commands.EditCommand.Action.INSERT_NUC:
177 c$.insertGap = Clazz.defineMethod (c$, "insertGap",
179 for (var s = 0; s < command.seqs.length; s++) {
180 command.seqs[s].insertCharAt (command.position, command.number, command.gapChar);
182 jalview.commands.EditCommand.adjustAnnotations (command, true, false, null);
183 }, "jalview.commands.EditCommand.Edit");
184 c$.deleteGap = Clazz.defineMethod (c$, "deleteGap",
186 for (var s = 0; s < command.seqs.length; s++) {
187 command.seqs[s].deleteChars (command.position, command.position + command.number);
189 jalview.commands.EditCommand.adjustAnnotations (command, false, false, null);
190 }, "jalview.commands.EditCommand.Edit");
191 c$.cut = Clazz.defineMethod (c$, "cut",
192 function (command, views) {
193 var seqDeleted = false;
194 command.string = Clazz.newCharArray (command.seqs.length, '\0');
195 for (var i = 0; i < command.seqs.length; i++) {
196 var sequence = command.seqs[i];
197 if (sequence.getLength () > command.position) {
198 command.string[i] = sequence.getSequence (command.position, command.position + command.number);
199 var oldds = sequence.getDatasetSequence ();
200 if (command.oldds != null && command.oldds[i] != null) {
201 sequence.setDatasetSequence (null);
202 }sequence.deleteChars (command.position, command.position + command.number);
203 if (command.oldds != null && command.oldds[i] != null) {
204 sequence.setDatasetSequence (command.oldds[i]);
205 command.oldds[i] = oldds;
207 if (oldds !== sequence.getDatasetSequence () || sequence.getSequenceFeatures () != null) {
208 if (command.oldds == null) {
209 command.oldds = new Array (command.seqs.length);
210 }command.oldds[i] = oldds;
211 jalview.commands.EditCommand.adjustFeatures (command, i, sequence.findPosition (command.position), sequence.findPosition (command.position + command.number), false);
212 }}}if (sequence.getLength () < 1) {
213 command.al.deleteSequence (sequence);
216 jalview.commands.EditCommand.adjustAnnotations (command, false, seqDeleted, views);
217 }, "jalview.commands.EditCommand.Edit,~A");
218 c$.paste = Clazz.defineMethod (c$, "paste",
219 function (command, views) {
225 var seqWasDeleted = false;
228 for (var i = 0; i < command.seqs.length; i++) {
230 newDSWasNeeded = command.oldds != null && command.oldds[i] != null;
231 if (command.seqs[i].getLength () < 1) {
232 if (command.alIndex[i] < command.al.getHeight ()) {
235 if (!(command.alIndex[i] < 0)) {
236 sequences.add (command.alIndex[i], command.seqs[i]);
238 command.al.addSequence (command.seqs[i]);
239 }seqWasDeleted = true;
240 }newstart = command.seqs[i].getStart ();
241 newend = command.seqs[i].getEnd ();
242 tmp = new StringBuffer ();
243 tmp.append (command.seqs[i].getSequence ());
244 if (command.string != null && command.string[i] != null) {
245 if (command.position >= tmp.length ()) {
246 var length = command.position - tmp.length ();
248 tmp.append (command.gapChar);
251 }tmp.insert (command.position, command.string[i]);
252 for (var s = 0; s < command.string[i].length; s++) {
253 if (jalview.schemes.ResidueProperties.aaIndex[command.string[i][s].charCodeAt (0)] != 23) {
256 start = command.seqs[i].findPosition (command.position);
257 end = command.seqs[i].findPosition (command.position + command.number);
258 }if (command.seqs[i].getStart () == start) {
263 command.string[i] = null;
264 }command.seqs[i].setSequence (tmp.toString ());
265 command.seqs[i].setStart (newstart);
266 command.seqs[i].setEnd (newend);
268 if (command.seqs[i].getDatasetSequence () != null) {
270 if (newDSWasNeeded) {
271 ds = command.oldds[i];
273 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 ());
274 ds.setDescription (command.seqs[i].getDescription ());
275 }if (command.oldds == null) {
276 command.oldds = new Array (command.seqs.length);
277 }command.oldds[i] = command.seqs[i].getDatasetSequence ();
278 command.seqs[i].setDatasetSequence (ds);
279 }jalview.commands.EditCommand.adjustFeatures (command, i, start, end, true);
281 jalview.commands.EditCommand.adjustAnnotations (command, true, seqWasDeleted, views);
282 command.string = null;
283 }, "jalview.commands.EditCommand.Edit,~A");
284 c$.replace = Clazz.defineMethod (c$, "replace",
288 var start = command.position;
289 var end = command.number;
290 command.number = start + command.string[0].length;
291 for (var i = 0; i < command.seqs.length; i++) {
292 var newDSWasNeeded = command.oldds != null && command.oldds[i] != null;
293 oldstring = command.seqs[i].getSequenceAsString ();
294 tmp = new StringBuffer (oldstring.substring (0, start));
295 tmp.append (command.string[i]);
296 var nogaprep = jalview.analysis.AlignSeq.extractGaps (jalview.util.Comparison.GapChars, String.instantialize (command.string[i]));
297 var ipos = command.seqs[i].findPosition (start) - command.seqs[i].getStart ();
298 tmp.append (oldstring.substring (end));
299 command.seqs[i].setSequence (tmp.toString ());
300 command.string[i] = oldstring.substring (start, end).toCharArray ();
301 var nogapold = jalview.analysis.AlignSeq.extractGaps (jalview.util.Comparison.GapChars, String.instantialize (command.string[i]));
302 if (!nogaprep.toLowerCase ().equals (nogapold.toLowerCase ())) {
303 if (newDSWasNeeded) {
304 var oldds = command.seqs[i].getDatasetSequence ();
305 command.seqs[i].setDatasetSequence (command.oldds[i]);
306 command.oldds[i] = oldds;
308 if (command.oldds == null) {
309 command.oldds = new Array (command.seqs.length);
310 }command.oldds[i] = command.seqs[i].getDatasetSequence ();
311 var newds = new jalview.datamodel.Sequence (command.seqs[i].getDatasetSequence ());
313 var osp = newds.getSequenceAsString ();
314 fullseq = osp.substring (0, ipos) + nogaprep + osp.substring (ipos + nogaprep.length);
315 newds.setSequence (fullseq.toUpperCase ());
316 command.seqs[i].setDatasetSequence (newds);
320 }, "jalview.commands.EditCommand.Edit");
321 c$.adjustAnnotations = Clazz.defineMethod (c$, "adjustAnnotations",
322 function (command, insert, modifyVisibility, views) {
323 var annotations = null;
324 if (modifyVisibility && !insert) {
325 command.deletedAnnotationRows = new java.util.Hashtable ();
326 }if (command.fullAlignmentHeight) {
327 annotations = command.al.getAlignmentAnnotation ();
331 for (var s = 0; s < command.seqs.length; s++) {
332 if (modifyVisibility) {
334 tmp = command.seqs[s].getAnnotation ();
336 var alen = tmp.length;
337 for (var aa = 0; aa < tmp.length; aa++) {
338 if (!command.al.deleteAnnotation (tmp[aa])) {
342 command.seqs[s].setAlignmentAnnotation (null);
343 if (alen != tmp.length) {
344 var saved = new Array (alen);
345 for (var aa = 0, aapos = 0; aa < tmp.length; aa++) {
346 if (tmp[aa] != null) {
347 saved[aapos++] = tmp[aa];
351 command.deletedAnnotationRows.put (command.seqs[s], saved);
352 for (var alview = 0; views != null && alview < views.length; alview++) {
353 if (views[alview] !== command.al) {
354 var toremove = views[alview].getAlignmentAnnotation ();
355 if (toremove == null || toremove.length == 0) {
357 }for (var aa = 0; aa < toremove.length; aa++) {
358 if (toremove[aa].sequenceRef === command.seqs[s]) {
359 views[alview].deleteAnnotation (toremove[aa]);
363 command.deletedAnnotationRows.put (command.seqs[s], tmp);
365 if (command.deletedAnnotationRows != null && command.deletedAnnotationRows.containsKey (command.seqs[s])) {
366 var revealed = command.deletedAnnotationRows.get (command.seqs[s]);
367 command.seqs[s].setAlignmentAnnotation (revealed);
368 if (revealed != null) {
369 for (var aa = 0; aa < revealed.length; aa++) {
370 command.al.addAnnotation (revealed[aa]);
372 for (var aa = 0; aa < revealed.length; aa++) {
373 command.al.setAnnotationIndex (revealed[aa], aa);
375 for (var vnum = 0; views != null && vnum < views.length; vnum++) {
376 if (views[vnum] !== command.al) {
377 var avwidth = views[vnum].getWidth () + 1;
378 for (var a = 0; a < revealed.length; a++) {
379 var newann = new jalview.datamodel.AlignmentAnnotation (revealed[a]);
380 command.seqs[s].addAlignmentAnnotation (newann);
381 newann.padAnnotation (avwidth);
382 views[vnum].addAnnotation (newann);
383 views[vnum].setAnnotationIndex (newann, a);
387 }if (command.seqs[s].getAnnotation () == null) {
390 annotations = command.seqs[s].getAnnotation ();
392 tmp = new Array (aSize + command.seqs[s].getAnnotation ().length);
393 System.arraycopy (annotations, 0, tmp, 0, aSize);
394 System.arraycopy (command.seqs[s].getAnnotation (), 0, tmp, aSize, command.seqs[s].getAnnotation ().length);
396 }aSize = annotations.length;
398 }if (annotations == null) {
401 command.deletedAnnotations = new java.util.Hashtable ();
404 for (var a = 0; a < annotations.length; a++) {
405 if (annotations[a].autoCalculated || annotations[a].annotations == null) {
408 aSize = annotations[a].annotations.length;
410 temp = new Array (aSize + command.number);
411 if (annotations[a].padGaps) {
412 for (var aa = 0; aa < temp.length; aa++) {
413 temp[aa] = new jalview.datamodel.Annotation (command.gapChar + "", null, ' ', 0);
416 if (command.position < aSize) {
417 if (command.position + command.number >= aSize) {
420 tSize = aSize - command.number;
425 }temp = new Array (tSize);
427 if (command.position < annotations[a].annotations.length) {
428 System.arraycopy (annotations[a].annotations, 0, temp, 0, command.position);
429 if (command.deletedAnnotations != null && command.deletedAnnotations.containsKey (annotations[a].annotationId)) {
430 var restore = command.deletedAnnotations.get (annotations[a].annotationId);
431 System.arraycopy (restore, 0, temp, command.position, command.number);
432 }System.arraycopy (annotations[a].annotations, command.position, temp, command.position + command.number, aSize - command.position);
434 if (command.deletedAnnotations != null && command.deletedAnnotations.containsKey (annotations[a].annotationId)) {
435 var restore = command.deletedAnnotations.get (annotations[a].annotationId);
436 temp = new Array (annotations[a].annotations.length + restore.length);
437 System.arraycopy (annotations[a].annotations, 0, temp, 0, annotations[a].annotations.length);
438 System.arraycopy (restore, 0, temp, annotations[a].annotations.length, restore.length);
440 temp = annotations[a].annotations;
442 if (tSize != aSize || command.position < 2) {
443 var copylen = Math.min (command.position, annotations[a].annotations.length);
445 System.arraycopy (annotations[a].annotations, 0, temp, 0, copylen);
446 }var deleted = new Array (command.number);
447 if (copylen >= command.position) {
448 copylen = Math.min (command.number, annotations[a].annotations.length - command.position);
450 System.arraycopy (annotations[a].annotations, command.position, deleted, 0, copylen);
451 }}command.deletedAnnotations.put (annotations[a].annotationId, deleted);
452 if (annotations[a].annotations.length > command.position + command.number) {
453 System.arraycopy (annotations[a].annotations, command.position + command.number, temp, command.position, annotations[a].annotations.length - command.position - command.number);
455 var dSize = aSize - command.position;
457 var deleted = new Array (command.number);
458 System.arraycopy (annotations[a].annotations, command.position, deleted, 0, dSize);
459 command.deletedAnnotations.put (annotations[a].annotationId, deleted);
460 tSize = Math.min (annotations[a].annotations.length, command.position);
461 temp = new Array (tSize);
462 System.arraycopy (annotations[a].annotations, 0, temp, 0, tSize);
464 temp = annotations[a].annotations;
465 }}}annotations[a].annotations = temp;
467 }, "jalview.commands.EditCommand.Edit,~B,~B,~A");
468 c$.adjustFeatures = Clazz.defineMethod (c$, "adjustFeatures",
469 function (command, index, i, j, insert) {
470 var seq = command.seqs[index];
471 var sequence = seq.getDatasetSequence ();
472 if (sequence == null) {
475 if (command.editedFeatures != null && command.editedFeatures.containsKey (seq)) {
476 sequence.setSequenceFeatures (command.editedFeatures.get (seq));
478 }var sf = sequence.getSequenceFeatures ();
481 }var oldsf = new Array (sf.length);
483 for (var s = 0; s < sf.length; s++) {
484 var copy = new jalview.datamodel.SequenceFeature (sf[s]);
486 if (sf[s].getEnd () < i) {
488 }if (sf[s].getBegin () > j) {
489 sf[s].setBegin (copy.getBegin () - cSize);
490 sf[s].setEnd (copy.getEnd () - cSize);
492 }if (sf[s].getBegin () >= i) {
494 }if (sf[s].getEnd () < j) {
495 sf[s].setEnd (j - 1);
496 }sf[s].setEnd (sf[s].getEnd () - (cSize));
497 if (sf[s].getBegin () > sf[s].getEnd ()) {
498 sequence.deleteFeature (sf[s]);
500 if (command.editedFeatures == null) {
501 command.editedFeatures = new java.util.Hashtable ();
502 }command.editedFeatures.put (seq, oldsf);
503 }, "jalview.commands.EditCommand.Edit,~N,~N,~N,~B");
504 Clazz.defineMethod (c$, "getEdits",
508 Clazz.defineMethod (c$, "priorState",
510 var result = new java.util.HashMap ();
511 if (this.getEdits () == null) {
514 for (var e, $e = this.getEdits ().iterator (); $e.hasNext () && ((e = $e.next ()) || true);) {
515 for (var seq, $seq = 0, $$seq = e.getSequences (); $seq < $$seq.length && ((seq = $$seq[$seq]) || true); $seq++) {
516 var ds = seq.getDatasetSequence ();
517 var preEdit = result.get (ds);
518 if (preEdit == null) {
519 preEdit = new jalview.datamodel.Sequence ("", seq.getSequenceAsString ());
520 preEdit.setDatasetSequence (ds);
521 result.put (ds, preEdit);
525 }var edits = new jalview.util.ReverseListIterator (this.getEdits ());
526 while (edits.hasNext ()) {
527 var oldEdit = edits.next ();
528 var action = oldEdit.getAction ();
529 var position = oldEdit.getPosition ();
530 var number = oldEdit.getNumber ();
531 var gap = oldEdit.getGapCharacter ();
532 for (var seq, $seq = 0, $$seq = oldEdit.getSequences (); $seq < $$seq.length && ((seq = $$seq[$seq]) || true); $seq++) {
533 var ds = seq.getDatasetSequence ();
534 var preEdit = result.get (ds);
535 if (preEdit == null) {
536 preEdit = new jalview.datamodel.Sequence ("", seq.getSequenceAsString ());
537 preEdit.setDatasetSequence (ds);
538 result.put (ds, preEdit);
540 if (action === jalview.commands.EditCommand.Action.DELETE_GAP) {
541 preEdit.setSequence ( String.instantialize (jalview.util.StringUtils.insertCharAt (preEdit.getSequence (), position, number, gap)));
542 } else if (action === jalview.commands.EditCommand.Action.INSERT_GAP) {
543 preEdit.setSequence ( String.instantialize (jalview.util.StringUtils.deleteChars (preEdit.getSequence (), position, position + number)));
545 System.err.println ("Can't undo edit action " + action);
550 Clazz.defineMethod (c$, "getEditIterator",
551 function (forwards) {
553 return this.getEdits ().iterator ();
555 return new jalview.util.ReverseListIterator (this.getEdits ());
557 c$.$EditCommand$Edit$ = function () {
559 c$ = Clazz.decorateAsClass (function () {
560 Clazz.prepareCallback (this, arguments);
562 this.fullAlignmentHeight = false;
563 this.deletedAnnotationRows = null;
564 this.deletedAnnotations = null;
565 this.editedFeatures = null;
574 Clazz.instantialize (this, arguments);
575 }, jalview.commands.EditCommand, "Edit");
576 Clazz.makeConstructor (c$,
577 function (a, b, c, d, e) {
583 }, "jalview.commands.EditCommand.Action,~A,~N,~N,~S");
584 Clazz.makeConstructor (c$,
585 function (a, b, c, d, e) {
586 this.gapChar = e.getGapCharacter ();
592 this.alIndex = Clazz.newIntArray (b.length, 0);
593 for (var f = 0; f < b.length; f++) {
594 this.alIndex[f] = e.findIndex (b[f]);
596 this.fullAlignmentHeight = (e.getHeight () == b.length);
597 }, "jalview.commands.EditCommand.Action,~A,~N,~N,jalview.datamodel.AlignmentI");
598 Clazz.makeConstructor (c$,
599 function (a, b, c, d, e, f) {
605 this.gapChar = e.getGapCharacter ();
606 this.string = Clazz.newCharArray (b.length, '\0');
607 for (var g = 0; g < b.length; g++) {
608 this.string[g] = f.toCharArray ();
610 this.fullAlignmentHeight = (e.getHeight () == b.length);
611 }, "jalview.commands.EditCommand.Action,~A,~N,~N,jalview.datamodel.AlignmentI,~S");
612 Clazz.defineMethod (c$, "getSequences",
616 Clazz.defineMethod (c$, "getPosition",
618 return this.position;
620 Clazz.defineMethod (c$, "getAction",
624 Clazz.defineMethod (c$, "getNumber",
628 Clazz.defineMethod (c$, "getGapCharacter",
635 c$ = Clazz.declareType (jalview.commands.EditCommand, "Action", Enum);
636 (Clazz.isClassDefined ("jalview.commands.EditCommand$Action$1") ? 0 : jalview.commands.EditCommand.$EditCommand$Action$1$ ())Clazz.defineEnumConstant (c$, "INSERT_GAP", 0, [], jalview.commands.EditCommand.Action);
637 (Clazz.isClassDefined ("jalview.commands.EditCommand$Action$2") ? 0 : jalview.commands.EditCommand.$EditCommand$Action$2$ ())Clazz.defineEnumConstant (c$, "DELETE_GAP", 1, [], jalview.commands.EditCommand.Action);
638 (Clazz.isClassDefined ("jalview.commands.EditCommand$Action$3") ? 0 : jalview.commands.EditCommand.$EditCommand$Action$3$ ())Clazz.defineEnumConstant (c$, "CUT", 2, [], jalview.commands.EditCommand.Action);
639 (Clazz.isClassDefined ("jalview.commands.EditCommand$Action$4") ? 0 : jalview.commands.EditCommand.$EditCommand$Action$4$ ())Clazz.defineEnumConstant (c$, "PASTE", 3, [], jalview.commands.EditCommand.Action);
640 (Clazz.isClassDefined ("jalview.commands.EditCommand$Action$5") ? 0 : jalview.commands.EditCommand.$EditCommand$Action$5$ ())Clazz.defineEnumConstant (c$, "REPLACE", 4, [], jalview.commands.EditCommand.Action);
641 (Clazz.isClassDefined ("jalview.commands.EditCommand$Action$6") ? 0 : jalview.commands.EditCommand.$EditCommand$Action$6$ ())Clazz.defineEnumConstant (c$, "INSERT_NUC", 5, [], jalview.commands.EditCommand.Action);