JAL-1620 version bump and release notes
[jalview.git] / src / jalview / datamodel / SeqCigar.java
index 182ad7b..77e9111 100644 (file)
@@ -1,25 +1,27 @@
 /*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2b1)
+ * Copyright (C) 2014 The Jalview Authors
  * 
  * 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 
- * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
- * 
+ * 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 
  * 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 <http://www.gnu.org/licenses/>.
+ * You should have received a copy of the GNU General Public License
+ * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
  */
 package jalview.datamodel;
 
 import java.util.Enumeration;
 import java.util.Hashtable;
-import java.util.Vector;
 
 import jalview.analysis.*;
 import jalview.util.*;
@@ -91,8 +93,7 @@ public class SeqCigar extends CigarSimple
             refseq.getSequenceAsString(start, end), GapChar);
     if (edit_result == null)
     {
-      throw new Error(
-              "Implementation Error - unexpected null from getSequenceAndDeletions");
+      throw new Error(MessageManager.getString("error.implementation_error_unexpected_null_from_get_sequence_and_deletions"));
     }
     int bounds[] = (int[]) edit_result[1];
     seq = new Sequence(refseq.getName(), (String) edit_result[0],
@@ -140,11 +141,11 @@ public class SeqCigar extends CigarSimple
     boolean hasgaps = false;
     if (seq == null)
     {
-      throw new Error("Implementation Error - _setSeq(null,...)");
+      throw new Error(MessageManager.getString("error.implementation_error_set_seq_null"));
     }
     if (_s < 0)
     {
-      throw new Error("Implementation Error: _s=" + _s);
+      throw new Error(MessageManager.formatMessage("error.implementation_error_s", new String[]{Integer.valueOf(_s).toString()}));
     }
     String seq_string = seq.getSequenceAsString();
     if (_e == 0 || _e < _s || _e > seq_string.length())
@@ -210,8 +211,7 @@ public class SeqCigar extends CigarSimple
     // Check offsets
     if (end > ds.getLength())
     {
-      throw new Error(
-              "SeqCigar: Possible implementation error: sequence is longer than dataset sequence");
+      throw new Error(MessageManager.getString("error.implementation_error_seqcigar_possible"));
       // end = ds.getLength();
     }
 
@@ -235,12 +235,11 @@ public class SeqCigar extends CigarSimple
     super();
     if (seq == null)
     {
-      throw new Error("Implementation Bug. Null seq !");
+      throw new Error(MessageManager.getString("error.implmentation_bug_seq_null"));
     }
     if (operation.length != range.length)
     {
-      throw new Error(
-              "Implementation Bug. Cigar Operation list!= range list");
+      throw new Error(MessageManager.getString("error.implementation_bug_cigar_operation_list_range_list"));
     }
 
     if (operation != null)
@@ -250,17 +249,14 @@ public class SeqCigar extends CigarSimple
 
       if (_setSeq(seq, false, 0, 0))
       {
-        throw new Error(
-                "NOT YET Implemented: Constructing a Cigar object from a cigar string and a gapped sequence.");
+        throw new Error(MessageManager.getString("error.not_yet_implemented_cigar_object_from_cigar_string"));
       }
       for (int i = this.length, j = 0; j < operation.length; i++, j++)
       {
         char op = operation[j];
         if (op != M && op != I && op != D)
         {
-          throw new Error("Implementation Bug. Cigar Operation '" + j
-                  + "' '" + op + "' not one of '" + M + "', '" + I
-                  + "', or '" + D + "'.");
+          throw new Error(MessageManager.formatMessage("error.implementation_bug_cigar_operation", new String[]{Integer.valueOf(j).toString(),Integer.valueOf(op).toString(),Integer.valueOf(M).toString(),Integer.valueOf(I).toString(),Integer.valueOf(D).toString()}));
         }
         this.operation[i] = op;
         this.range[i] = range[j];
@@ -274,8 +270,7 @@ public class SeqCigar extends CigarSimple
       this.length = 0;
       if (_setSeq(seq, false, 0, 0))
       {
-        throw new Error(
-                "NOT YET Implemented: Constructing a Cigar object from a cigar string and a gapped sequence.");
+        throw new Error(MessageManager.getString("error.not_yet_implemented_cigar_object_from_cigar_string"));
       }
     }
   }
@@ -382,7 +377,7 @@ public class SeqCigar extends CigarSimple
     super();
     if (seq == null)
     {
-      throw new Error("Implementation error for new Cigar(SequenceI)");
+      throw new Error(MessageManager.getString("error.implementation_error_for_new_cigar"));
     }
     _setSeq(seq, false, 0, 0);
     // there is still work to do
@@ -404,7 +399,7 @@ public class SeqCigar extends CigarSimple
     super();
     if (seq == null)
     {
-      throw new Error("Implementation error for new Cigar(SequenceI)");
+      throw new Error(MessageManager.getString("error.implementation_error_for_new_cigar"));
     }
     _setSeq(seq, false, start, end + 1);
     // there is still work to do
@@ -459,8 +454,7 @@ public class SeqCigar extends CigarSimple
       // endcol}, hidden regions {{start, end, col}})
       if (gs_regions[i] == null)
       {
-        throw new Error("Implementation error: " + i
-                + "'th sequence Cigar has no operations.");
+        throw new Error(MessageManager.formatMessage("error.implementation_error_cigar_seq_no_operations", new String[]{Integer.valueOf(i).toString()}));
       }
       g_seqs[i] = new StringBuffer((String) ((Object[]) gs_regions[i])[0]); // the
       // visible