X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fcommands%2FEditCommand.java;h=cac843f8488e9877ae5abbdd535e90a497b22fb6;hb=77bcd1f60d9c26328d8859445f4225cd0ef571a9;hp=0a8dc7dc68c3a9ea87cf5e39a10f0ba0ceefa12c;hpb=0e65ec37e2c956e0ad94feda6fd07b7c3a9003ee;p=jalview.git
diff --git a/src/jalview/commands/EditCommand.java b/src/jalview/commands/EditCommand.java
index 0a8dc7d..cac843f 100644
--- a/src/jalview/commands/EditCommand.java
+++ b/src/jalview/commands/EditCommand.java
@@ -222,14 +222,16 @@ public class EditCommand implements CommandI
/**
* Check a contiguous edit; either
*
- * - a new Insert positions to the right of the last , or
+ * - a new Insert positions to the right of the last ,
+ * or
* - a new Delete gaps which is positions to the left of the last
* delete.
*
*/
- 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);
if (contiguous)
{
/*
@@ -475,7 +477,8 @@ public class EditCommand implements CommandI
{
command.seqs[s].insertCharAt(command.position, command.number,
command.gapChar);
- // System.out.println("pos: "+command.position+" number: "+command.number);
+ // System.out.println("pos: "+command.position+" number:
+ // "+command.number);
}
adjustAnnotations(command, true, false, null);
@@ -504,8 +507,8 @@ public class EditCommand implements CommandI
{
for (int s = 0; s < command.seqs.length; s++)
{
- command.seqs[s].deleteChars(command.position, command.position
- + command.number);
+ command.seqs[s].deleteChars(command.position,
+ command.position + command.number);
}
adjustAnnotations(command, false, false, null);
@@ -536,8 +539,8 @@ public class EditCommand implements CommandI
// we are redoing an undone cut.
sequence.setDatasetSequence(null);
}
- sequence.deleteChars(command.position, command.position
- + command.number);
+ sequence.deleteChars(command.position,
+ command.position + command.number);
if (command.oldds != null && command.oldds[i] != null)
{
// oldds entry contains the cut dataset sequence.
@@ -647,8 +650,8 @@ public class EditCommand implements CommandI
{
newDSNeeded = true;
start = command.seqs[i].findPosition(command.position);
- end = command.seqs[i].findPosition(command.position
- + command.number);
+ end = command.seqs[i]
+ .findPosition(command.position + command.number);
}
if (command.seqs[i].getStart() == start)
{
@@ -732,16 +735,16 @@ public class EditCommand implements CommandI
tmp = new StringBuffer(oldstring.substring(0, start));
tmp.append(command.string[i]);
String nogaprep = jalview.analysis.AlignSeq.extractGaps(
- jalview.util.Comparison.GapChars, new String(
- command.string[i]));
+ jalview.util.Comparison.GapChars,
+ new String(command.string[i]));
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(
- jalview.util.Comparison.GapChars, new String(
- command.string[i]));
+ jalview.util.Comparison.GapChars,
+ new String(command.string[i]));
if (!nogaprep.toLowerCase().equals(nogapold.toLowerCase()))
{
if (newDSWasNeeded)
@@ -798,7 +801,7 @@ public class EditCommand implements CommandI
AlignmentAnnotation[] tmp;
for (int s = 0; s < command.seqs.length; s++)
{
- command.seqs[s].zapCursor();
+ command.seqs[s].sequenceChanged();
if (modifyVisibility)
{
@@ -836,7 +839,8 @@ public class EditCommand implements CommandI
tmp = saved;
command.deletedAnnotationRows.put(command.seqs[s], saved);
// and then remove any annotation in the other views
- for (int alview = 0; views != null && alview < views.length; alview++)
+ for (int alview = 0; views != null
+ && alview < views.length; alview++)
{
if (views[alview] != command.al)
{
@@ -888,7 +892,8 @@ public class EditCommand implements CommandI
}
// and then duplicate added annotation on every other alignment
// view
- for (int vnum = 0; views != null && vnum < views.length; vnum++)
+ for (int vnum = 0; views != null
+ && vnum < views.length; vnum++)
{
if (views[vnum] != command.al)
{
@@ -1015,8 +1020,8 @@ public class EditCommand implements CommandI
}
System.arraycopy(annotations[a].annotations, command.position,
- temp, command.position + command.number, aSize
- - command.position);
+ temp, command.position + command.number,
+ aSize - command.position);
}
else
{
@@ -1059,8 +1064,8 @@ public class EditCommand implements CommandI
annotations[a].annotations.length - command.position);
if (copylen > 0)
{
- System.arraycopy(annotations[a].annotations,
- command.position, deleted, 0, copylen); // command.number);
+ System.arraycopy(annotations[a].annotations, command.position,
+ deleted, 0, copylen); // command.number);
}
}
@@ -1069,10 +1074,10 @@ public class EditCommand implements CommandI
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); // aSize
+ System.arraycopy(annotations[a].annotations,
+ command.position + command.number, temp,
+ command.position, annotations[a].annotations.length
+ - command.position - command.number); // aSize
}
}
else