X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fcommands%2FEditCommand.java;h=9321524dc230a46bf64ed37d5539d65d49b8beeb;hb=f52f7b378972cc884b5d3e5cc250f89667f558f7;hp=a8aa8860e1b6c23e6c6196b46908e71ed3856c2f;hpb=6357db6c20614a666b7b446aeb3260c5379637eb;p=jalview.git diff --git a/src/jalview/commands/EditCommand.java b/src/jalview/commands/EditCommand.java index a8aa886..9321524 100644 --- a/src/jalview/commands/EditCommand.java +++ b/src/jalview/commands/EditCommand.java @@ -1,18 +1,18 @@ /* * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7) * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle - * + * * This file is part of Jalview. - * + * * Jalview is free software: you can redistribute it and/or - * modify it under the terms of the GNU General Public License + * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - * - * Jalview is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR + * + * Jalview is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License along with Jalview. If not, see . */ package jalview.commands; @@ -22,24 +22,24 @@ import java.util.*; import jalview.datamodel.*; /** - * + * *

* Title: EditCommmand *

- * + * *

* Description: Essential information for performing undo and redo for cut/paste * insert/delete gap which can be stored in the HistoryList *

- * + * *

* Copyright: Copyright (c) 2006 *

- * + * *

* Company: Dundee University *

- * + * * @author not attributable * @version 1.0 */ @@ -54,7 +54,7 @@ public class EditCommand implements CommandI public static final int PASTE = 3; public static final int REPLACE = 4; - + public static final int INSERT_NUC=5; Edit[] edits; @@ -96,11 +96,13 @@ public class EditCommand implements CommandI performEdit(0, null); } + @Override final public String getDescription() { return description; } + @Override public int getSize() { return edits == null ? 0 : edits.length; @@ -116,7 +118,7 @@ public class EditCommand implements CommandI * operation affects more alignment objects than the one referenced in al (for * example, cut or pasting whole sequences). Use the form with an additional * AlignmentI[] views parameter. - * + * * @param command * @param seqs * @param position @@ -133,7 +135,7 @@ public class EditCommand implements CommandI /** * append a new edit command with a set of alignment views that may be * operated on - * + * * @param command * @param seqs * @param position @@ -202,11 +204,13 @@ public class EditCommand implements CommandI } } + @Override final public void doCommand(AlignmentI[] views) { performEdit(0, views); } + @Override final public void undoCommand(AlignmentI[] views) { int e = 0, eSize = edits.length; @@ -245,7 +249,7 @@ public class EditCommand implements CommandI adjustAnnotations(command, true, false, null); } -// +// // final void insertNuc(Edit command) // { // @@ -452,12 +456,12 @@ public class EditCommand implements CommandI * cut addHistoryItem(new EditCommand("Cut Sequences", EditCommand.CUT, * cut, sg.getStartRes(), sg.getEndRes()-sg.getStartRes()+1, * viewport.alignment)); - * + * */ /** * then addHistoryItem(new EditCommand( "Add sequences", * EditCommand.PASTE, sequences, 0, alignment.getWidth(), alignment) ); - * + * */ oldstring = command.seqs[i].getSequenceAsString(); tmp = new StringBuffer(oldstring.substring(0, start));