formatting
[jalview.git] / src / jalview / commands / EditCommand.java
index d41f9f8..c67ebf5 100644 (file)
@@ -22,24 +22,24 @@ import java.util.*;
 import jalview.datamodel.*;
 
 /**
- *
+ * 
  * <p>
  * Title: EditCommmand
  * </p>
- *
+ * 
  * <p>
  * Description: Essential information for performing undo and redo for cut/paste
  * insert/delete gap which can be stored in the HistoryList
  * </p>
- *
+ * 
  * <p>
  * Copyright: Copyright (c) 2006
  * </p>
- *
+ * 
  * <p>
  * Company: Dundee University
  * </p>
- *
+ * 
  * @author not attributable
  * @version 1.0
  */
@@ -55,7 +55,7 @@ public class EditCommand implements CommandI
 
   public static final int REPLACE = 4;
 
-  public static final int INSERT_NUC=5;
+  public static final int INSERT_NUC = 5;
 
   Edit[] edits;
 
@@ -118,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
@@ -135,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
@@ -196,10 +196,10 @@ public class EditCommand implements CommandI
       case REPLACE:
         replace(edits[e]);
         break;
-        //TODO:add deleteNuc for UNDO
-//      case INSERT_NUC:
-//     insertNuc(edits[e]);
-//     break;
+      // TODO:add deleteNuc for UNDO
+      // case INSERT_NUC:
+      // insertNuc(edits[e]);
+      // break;
       }
     }
   }
@@ -233,7 +233,7 @@ public class EditCommand implements CommandI
       case REPLACE:
         replace(edits[e]);
         break;
-       }
+      }
     }
   }
 
@@ -244,23 +244,24 @@ 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);
   }
-//
-//  final void insertNuc(Edit command)
-//  {
-//
-//    for (int s = 0; s < command.seqs.length; s++)
-//    {
-//        System.out.println("pos: "+command.position+" number: "+command.number);
-//     command.seqs[s].insertCharAt(command.position, command.number,'A');
-//    }
-//
-//    adjustAnnotations(command, true, false, null);
-//  }
+
+  //
+  // final void insertNuc(Edit command)
+  // {
+  //
+  // for (int s = 0; s < command.seqs.length; s++)
+  // {
+  // System.out.println("pos: "+command.position+" number: "+command.number);
+  // command.seqs[s].insertCharAt(command.position, command.number,'A');
+  // }
+  //
+  // adjustAnnotations(command, true, false, null);
+  // }
 
   final void deleteGap(Edit command)
   {
@@ -349,7 +350,8 @@ public class EditCommand implements CommandI
         if (command.alIndex[i] < command.al.getHeight())
         {
           List<SequenceI> sequences;
-          synchronized (sequences=command.al.getSequences()) {
+          synchronized (sequences = command.al.getSequences())
+          {
             sequences.add(command.alIndex[i], command.seqs[i]);
           }
         }
@@ -452,18 +454,19 @@ public class EditCommand implements CommandI
     command.number = start + command.string[0].length;
     for (int i = 0; i < command.seqs.length; i++)
     {
-      boolean newDSWasNeeded = command.oldds != null && command.oldds[i] != null;
+      boolean newDSWasNeeded = command.oldds != null
+              && command.oldds[i] != null;
 
       /**
        * 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));
@@ -500,7 +503,8 @@ public class EditCommand implements CommandI
           fullseq = osp.substring(0, ipos) + nogaprep
                   + osp.substring(ipos + nogaprep.length());
           newds.setSequence(fullseq.toUpperCase());
-          // TODO: JAL-1131 ensure newly created dataset sequence is added to the set of
+          // TODO: JAL-1131 ensure newly created dataset sequence is added to
+          // the set of
           // dataset sequences associated with the alignment.
           // TODO: JAL-1131 fix up any annotation associated with new dataset
           // sequence to ensure that original sequence/annotation relationships