- public EditCommand(String description, Action command, SequenceI[] seqs,
+ public EditCommand(String desc, Action command, SequenceI[] seqs,
if (command == Action.CUT || command == Action.PASTE)
{
setEdit(new Edit(command, seqs, position, number, al));
if (command == Action.CUT || command == Action.PASTE)
{
setEdit(new Edit(command, seqs, position, number, al));
- public EditCommand(String description, Action command, String replace,
+ public EditCommand(String desc, Action command, String replace,
SequenceI[] seqs, int position, int number, AlignmentI al)
{
SequenceI[] seqs, int position, int number, AlignmentI al)
{
if (command == Action.REPLACE)
{
setEdit(new Edit(command, seqs, position, number, al, replace));
if (command == Action.REPLACE)
{
setEdit(new Edit(command, seqs, position, number, al, replace));
- boolean contiguous = (action == Action.INSERT_GAP && e.position == lastEdit.position
- + lastEdit.number)
- || (action == Action.DELETE_GAP && e.position + e.number == lastEdit.position);
+ boolean contiguous = (action == Action.INSERT_GAP
+ && e.position == lastEdit.position + lastEdit.number)
+ || (action == Action.DELETE_GAP
+ && e.position + e.number == lastEdit.position);
}
adjustAnnotations(command, true, false, null);
}
adjustAnnotations(command, true, false, null);
}
adjustAnnotations(command, false, false, null);
}
adjustAnnotations(command, false, false, null);
if (command.oldds != null && command.oldds[i] != null)
{
// oldds entry contains the cut dataset sequence.
if (command.oldds != null && command.oldds[i] != null)
{
// oldds entry contains the cut dataset sequence.
{
if (command.oldds == null)
{
command.oldds = new SequenceI[command.seqs.length];
}
command.oldds[i] = oldds;
{
if (command.oldds == null)
{
command.oldds = new SequenceI[command.seqs.length];
}
command.oldds[i] = oldds;
tmp = new StringBuffer(oldstring.substring(0, start));
tmp.append(command.string[i]);
String nogaprep = jalview.analysis.AlignSeq.extractGaps(
tmp = new StringBuffer(oldstring.substring(0, start));
tmp.append(command.string[i]);
String nogaprep = jalview.analysis.AlignSeq.extractGaps(
int 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();
String nogapold = jalview.analysis.AlignSeq.extractGaps(
int 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();
String nogapold = jalview.analysis.AlignSeq.extractGaps(
tmp = saved;
command.deletedAnnotationRows.put(command.seqs[s], saved);
// and then remove any annotation in the other views
tmp = saved;
command.deletedAnnotationRows.put(command.seqs[s], saved);
// and then remove any annotation in the other views
- temp, command.position + command.number, aSize
- - command.position);
+ temp, command.position + command.number,
+ aSize - command.position);
- System.arraycopy(annotations[a].annotations,
- command.position, deleted, 0, copylen); // command.number);
+ System.arraycopy(annotations[a].annotations, command.position,
+ deleted, 0, copylen); // command.number);
- System.arraycopy(annotations[a].annotations, command.position
- + command.number, temp, command.position,
- annotations[a].annotations.length - command.position
- - command.number); // aSize
+ System.arraycopy(annotations[a].annotations,
+ command.position + command.number, temp,
+ command.position, annotations[a].annotations.length
+ - command.position - command.number); // aSize
- final static void adjustFeatures(Edit command, int index, int i, int j,
- boolean insert)
+ final static void adjustFeatures(Edit command, int index, final int i,
+ final int j, boolean insert)
int newBegin = copy.getBegin() - cSize;
int newEnd = copy.getEnd() - cSize;
SequenceFeature newSf = new SequenceFeature(feature, newBegin,
int newBegin = copy.getBegin() - cSize;
int newEnd = copy.getEnd() - cSize;
SequenceFeature newSf = new SequenceFeature(feature, newBegin,
sequence.deleteFeature(feature);
sequence.addSequenceFeature(newSf);
// feature.setBegin(newBegin);
sequence.deleteFeature(feature);
sequence.addSequenceFeature(newSf);
// feature.setBegin(newBegin);
- public Edit(Action command, SequenceI[] seqs, int position, int number,
- char gapChar)
+ public Edit(Action cmd, SequenceI[] sqs, int pos, int count,
+ char gap)
- Edit(Action command, SequenceI[] seqs, int position, int number,
- AlignmentI al)
+ Edit(Action cmd, SequenceI[] sqs, int pos, int count,
+ AlignmentI align)
- this.gapChar = al.getGapCharacter();
- this.command = command;
- this.seqs = seqs;
- this.position = position;
- this.number = number;
- this.al = al;
-
- alIndex = new int[seqs.length];
- for (int i = 0; i < seqs.length; i++)
+ this.gapChar = align.getGapCharacter();
+ this.command = cmd;
+ this.seqs = sqs;
+ this.position = pos;
+ this.number = count;
+ this.al = align;
+
+ alIndex = new int[sqs.length];
+ for (int i = 0; i < sqs.length; i++)
- Edit(Action command, SequenceI[] seqs, int position, int number,
- AlignmentI al, String replace)
+ Edit(Action cmd, SequenceI[] sqs, int pos, int count,
+ AlignmentI align, String replace)
- this.command = command;
- this.seqs = seqs;
- this.position = position;
- this.number = number;
- this.al = al;
- this.gapChar = al.getGapCharacter();
- string = new char[seqs.length][];
- for (int i = 0; i < seqs.length; i++)
+ this.command = cmd;
+ this.seqs = sqs;
+ this.position = pos;
+ this.number = count;
+ this.al = align;
+ this.gapChar = align.getGapCharacter();
+ string = new char[sqs.length][];
+ for (int i = 0; i < sqs.length; i++)