JAL-1683 replace year/version strings with tokens in source
[jalview.git] / src / jalview / binding / Annotation.java
old mode 100755 (executable)
new mode 100644 (file)
index ec3e248..005adf0
@@ -1,26 +1,30 @@
 /*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.4)
- * Copyright (C) 2008 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
  * 
- * This program 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 2
- * of the License, or (at your option) any later version.
+ * This file is part of Jalview.
  * 
- * This program 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.
+ * 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.
+ *  
+ * 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 this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+ * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
  */
 package jalview.binding;
 
-// ---------------------------------/
-// - Imported classes and packages -/
-// ---------------------------------/
+//---------------------------------/
+//- Imported classes and packages -/
+//---------------------------------/
+
+import jalview.util.MessageManager;
 
 import org.exolab.castor.xml.Marshaller;
 import org.exolab.castor.xml.Unmarshaller;
@@ -91,7 +95,7 @@ public class Annotation implements java.io.Serializable
    * 
    * @param vAnnotationElement
    * @throws java.lang.IndexOutOfBoundsException
-   *                 if the index given is outside the bounds of the collection
+   *           if the index given is outside the bounds of the collection
    */
   public void addAnnotationElement(
           final jalview.binding.AnnotationElement vAnnotationElement)
@@ -106,7 +110,7 @@ public class Annotation implements java.io.Serializable
    * @param index
    * @param vAnnotationElement
    * @throws java.lang.IndexOutOfBoundsException
-   *                 if the index given is outside the bounds of the collection
+   *           if the index given is outside the bounds of the collection
    */
   public void addAnnotationElement(final int index,
           final jalview.binding.AnnotationElement vAnnotationElement)
@@ -116,14 +120,14 @@ public class Annotation implements java.io.Serializable
   }
 
   /**
-   */
+     */
   public void deleteGraph()
   {
     this._has_graph = false;
   }
 
   /**
-   */
+     */
   public void deleteGraphType()
   {
     this._has_graphType = false;
@@ -144,7 +148,7 @@ public class Annotation implements java.io.Serializable
    * 
    * @param index
    * @throws java.lang.IndexOutOfBoundsException
-   *                 if the index given is outside the bounds of the collection
+   *           if the index given is outside the bounds of the collection
    * @return the value of the jalview.binding.AnnotationElement at the given
    *         index
    */
@@ -154,10 +158,11 @@ public class Annotation implements java.io.Serializable
     // check bounds for index
     if (index < 0 || index >= this._annotationElementList.size())
     {
-      throw new IndexOutOfBoundsException(
-              "getAnnotationElement: Index value '" + index
-                      + "' not in range [0.."
-                      + (this._annotationElementList.size() - 1) + "]");
+      throw new IndexOutOfBoundsException(MessageManager.formatMessage("exception.index_value_not_in_range", new String[]{
+                 "getAnnotationElement",
+                 Integer.valueOf(index).toString(),
+                 Integer.valueOf((this._annotationElementList.size() - 1)).toString()
+      }));
     }
 
     return (jalview.binding.AnnotationElement) _annotationElementList
@@ -283,11 +288,10 @@ public class Annotation implements java.io.Serializable
    * 
    * @param out
    * @throws org.exolab.castor.xml.MarshalException
-   *                 if object is null or if any SAXException is thrown during
-   *                 marshaling
+   *           if object is null or if any SAXException is thrown during
+   *           marshaling
    * @throws org.exolab.castor.xml.ValidationException
-   *                 if this object is an invalid instance according to the
-   *                 schema
+   *           if this object is an invalid instance according to the schema
    */
   public void marshal(final java.io.Writer out)
           throws org.exolab.castor.xml.MarshalException,
@@ -301,13 +305,12 @@ public class Annotation implements java.io.Serializable
    * 
    * @param handler
    * @throws java.io.IOException
-   *                 if an IOException occurs during marshaling
+   *           if an IOException occurs during marshaling
    * @throws org.exolab.castor.xml.ValidationException
-   *                 if this object is an invalid instance according to the
-   *                 schema
+   *           if this object is an invalid instance according to the schema
    * @throws org.exolab.castor.xml.MarshalException
-   *                 if object is null or if any SAXException is thrown during
-   *                 marshaling
+   *           if object is null or if any SAXException is thrown during
+   *           marshaling
    */
   public void marshal(final org.xml.sax.ContentHandler handler)
           throws java.io.IOException,
@@ -318,7 +321,7 @@ public class Annotation implements java.io.Serializable
   }
 
   /**
-   */
+     */
   public void removeAllAnnotationElement()
   {
     this._annotationElementList.clear();
@@ -356,7 +359,7 @@ public class Annotation implements java.io.Serializable
    * @param index
    * @param vAnnotationElement
    * @throws java.lang.IndexOutOfBoundsException
-   *                 if the index given is outside the bounds of the collection
+   *           if the index given is outside the bounds of the collection
    */
   public void setAnnotationElement(final int index,
           final jalview.binding.AnnotationElement vAnnotationElement)
@@ -365,10 +368,11 @@ public class Annotation implements java.io.Serializable
     // check bounds for index
     if (index < 0 || index >= this._annotationElementList.size())
     {
-      throw new IndexOutOfBoundsException(
-              "setAnnotationElement: Index value '" + index
-                      + "' not in range [0.."
-                      + (this._annotationElementList.size() - 1) + "]");
+        throw new IndexOutOfBoundsException(MessageManager.formatMessage("exception.index_value_not_in_range", new String[]{
+                 "setAnnotationElement",
+                 Integer.valueOf(index).toString(),
+                 Integer.valueOf((this._annotationElementList.size() - 1)).toString()
+        }));
     }
 
     this._annotationElementList.set(index, vAnnotationElement);
@@ -395,7 +399,7 @@ public class Annotation implements java.io.Serializable
    * Sets the value of field 'description'.
    * 
    * @param description
-   *                the value of field 'description'.
+   *          the value of field 'description'.
    */
   public void setDescription(final java.lang.String description)
   {
@@ -406,7 +410,7 @@ public class Annotation implements java.io.Serializable
    * Sets the value of field 'graph'.
    * 
    * @param graph
-   *                the value of field 'graph'.
+   *          the value of field 'graph'.
    */
   public void setGraph(final boolean graph)
   {
@@ -418,7 +422,7 @@ public class Annotation implements java.io.Serializable
    * Sets the value of field 'graphType'.
    * 
    * @param graphType
-   *                the value of field 'graphType'.
+   *          the value of field 'graphType'.
    */
   public void setGraphType(final int graphType)
   {
@@ -430,7 +434,7 @@ public class Annotation implements java.io.Serializable
    * Sets the value of field 'label'.
    * 
    * @param label
-   *                the value of field 'label'.
+   *          the value of field 'label'.
    */
   public void setLabel(final java.lang.String label)
   {
@@ -442,11 +446,10 @@ public class Annotation implements java.io.Serializable
    * 
    * @param reader
    * @throws org.exolab.castor.xml.MarshalException
-   *                 if object is null or if any SAXException is thrown during
-   *                 marshaling
+   *           if object is null or if any SAXException is thrown during
+   *           marshaling
    * @throws org.exolab.castor.xml.ValidationException
-   *                 if this object is an invalid instance according to the
-   *                 schema
+   *           if this object is an invalid instance according to the schema
    * @return the unmarshaled jalview.binding.Annotation
    */
   public static jalview.binding.Annotation unmarshal(
@@ -462,8 +465,7 @@ public class Annotation implements java.io.Serializable
    * 
    * 
    * @throws org.exolab.castor.xml.ValidationException
-   *                 if this object is an invalid instance according to the
-   *                 schema
+   *           if this object is an invalid instance according to the schema
    */
   public void validate() throws org.exolab.castor.xml.ValidationException
   {