X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fcommands%2FEditCommand.java;h=81076e539de4504f5774be6c7c98bb20aad7894a;hb=b87e96a7592f21c11e2e3a218b24de524c3a39fc;hp=cac843f8488e9877ae5abbdd535e90a497b22fb6;hpb=793e6d46ae572461a030e2751c0d748f2521b71e;p=jalview.git diff --git a/src/jalview/commands/EditCommand.java b/src/jalview/commands/EditCommand.java index cac843f..81076e5 100644 --- a/src/jalview/commands/EditCommand.java +++ b/src/jalview/commands/EditCommand.java @@ -114,7 +114,7 @@ public class EditCommand implements CommandI public abstract Action getUndoAction(); }; - private List edits = new ArrayList(); + private List edits = new ArrayList<>(); String description; @@ -789,7 +789,7 @@ public class EditCommand implements CommandI if (modifyVisibility && !insert) { // only occurs if a sequence was added or deleted. - command.deletedAnnotationRows = new Hashtable(); + command.deletedAnnotationRows = new Hashtable<>(); } if (command.fullAlignmentHeight) { @@ -948,7 +948,7 @@ public class EditCommand implements CommandI if (!insert) { - command.deletedAnnotations = new Hashtable(); + command.deletedAnnotations = new Hashtable<>(); } int aSize; @@ -1138,7 +1138,7 @@ public class EditCommand implements CommandI return; } - List oldsf = new ArrayList(); + List oldsf = new ArrayList<>(); int cSize = j - i; @@ -1196,7 +1196,7 @@ public class EditCommand implements CommandI if (command.editedFeatures == null) { - command.editedFeatures = new Hashtable>(); + command.editedFeatures = new Hashtable<>(); } command.editedFeatures.put(seq, oldsf); @@ -1233,7 +1233,7 @@ public class EditCommand implements CommandI */ public Map priorState(boolean forUndo) { - Map result = new HashMap(); + Map result = new HashMap<>(); if (getEdits() == null) { return result; @@ -1266,7 +1266,7 @@ public class EditCommand implements CommandI * Work backwards through the edit list, deriving the sequences before each * was applied. The final result is the sequence set before any edits. */ - Iterator editList = new ReverseListIterator(getEdits()); + Iterator editList = new ReverseListIterator<>(getEdits()); while (editList.hasNext()) { Edit oldEdit = editList.next(); @@ -1339,6 +1339,12 @@ public class EditCommand implements CommandI char gapChar; + /* + * flag that identifies edits inserted to balance + * user edits in a 'locked editing' region + */ + private boolean systemGenerated; + public Edit(Action cmd, SequenceI[] sqs, int pos, int count, char gap) { @@ -1410,6 +1416,16 @@ public class EditCommand implements CommandI { return gapChar; } + + public void setSystemGenerated(boolean b) + { + systemGenerated = b; + } + + public boolean isSystemGenerated() + { + return systemGenerated; + } } /** @@ -1427,7 +1443,7 @@ public class EditCommand implements CommandI } else { - return new ReverseListIterator(getEdits()); + return new ReverseListIterator<>(getEdits()); } } }