JAL-1683 replace year/version strings with tokens in source
[jalview.git] / src / jalview / binding / JGroup.java
old mode 100755 (executable)
new mode 100644 (file)
index a0117ee..c1f9cd3
@@ -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;
@@ -151,7 +155,7 @@ public class JGroup implements java.io.Serializable
    * 
    * @param vSeq
    * @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 addSeq(final int vSeq)
           throws java.lang.IndexOutOfBoundsException
@@ -165,7 +169,7 @@ public class JGroup implements java.io.Serializable
    * @param index
    * @param vSeq
    * @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 addSeq(final int index, final int vSeq)
           throws java.lang.IndexOutOfBoundsException
@@ -174,56 +178,56 @@ public class JGroup implements java.io.Serializable
   }
 
   /**
-   */
+     */
   public void deleteColourText()
   {
     this._has_colourText = false;
   }
 
   /**
-   */
+     */
   public void deleteConsThreshold()
   {
     this._has_consThreshold = false;
   }
 
   /**
-   */
+     */
   public void deleteDisplayBoxes()
   {
     this._has_displayBoxes = false;
   }
 
   /**
-   */
+     */
   public void deleteDisplayText()
   {
     this._has_displayText = false;
   }
 
   /**
-   */
+     */
   public void deleteEnd()
   {
     this._has_end = false;
   }
 
   /**
-   */
+     */
   public void deleteOutlineColour()
   {
     this._has_outlineColour = false;
   }
 
   /**
-   */
+     */
   public void deletePidThreshold()
   {
     this._has_pidThreshold = false;
   }
 
   /**
-   */
+     */
   public void deleteStart()
   {
     this._has_start = false;
@@ -334,7 +338,7 @@ public class JGroup 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 int at the given index
    */
   public int getSeq(final int index)
@@ -343,8 +347,11 @@ public class JGroup implements java.io.Serializable
     // check bounds for index
     if (index < 0 || index >= this._seqList.size())
     {
-      throw new IndexOutOfBoundsException("getSeq: Index value '" + index
-              + "' not in range [0.." + (this._seqList.size() - 1) + "]");
+        throw new IndexOutOfBoundsException(MessageManager.formatMessage("exception.index_value_not_in_range", new String[]{
+                 "getSeq",
+                 Integer.valueOf(index).toString(),
+                 Integer.valueOf((this._seqList.size() - 1)).toString()
+        })); 
     }
 
     return ((java.lang.Integer) _seqList.get(index)).intValue();
@@ -519,11 +526,10 @@ public class JGroup 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,
@@ -537,13 +543,12 @@ public class JGroup 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,
@@ -554,7 +559,7 @@ public class JGroup implements java.io.Serializable
   }
 
   /**
-   */
+     */
   public void removeAllSeq()
   {
     this._seqList.clear();
@@ -588,7 +593,7 @@ public class JGroup implements java.io.Serializable
    * Sets the value of field 'colour'.
    * 
    * @param colour
-   *                the value of field 'colour'.
+   *          the value of field 'colour'.
    */
   public void setColour(final java.lang.String colour)
   {
@@ -599,7 +604,7 @@ public class JGroup implements java.io.Serializable
    * Sets the value of field 'colourText'.
    * 
    * @param colourText
-   *                the value of field 'colourText'.
+   *          the value of field 'colourText'.
    */
   public void setColourText(final boolean colourText)
   {
@@ -611,7 +616,7 @@ public class JGroup implements java.io.Serializable
    * Sets the value of field 'consThreshold'.
    * 
    * @param consThreshold
-   *                the value of field 'consThreshold'.
+   *          the value of field 'consThreshold'.
    */
   public void setConsThreshold(final int consThreshold)
   {
@@ -623,7 +628,7 @@ public class JGroup implements java.io.Serializable
    * Sets the value of field 'displayBoxes'.
    * 
    * @param displayBoxes
-   *                the value of field 'displayBoxes'.
+   *          the value of field 'displayBoxes'.
    */
   public void setDisplayBoxes(final boolean displayBoxes)
   {
@@ -635,7 +640,7 @@ public class JGroup implements java.io.Serializable
    * Sets the value of field 'displayText'.
    * 
    * @param displayText
-   *                the value of field 'displayText'.
+   *          the value of field 'displayText'.
    */
   public void setDisplayText(final boolean displayText)
   {
@@ -647,7 +652,7 @@ public class JGroup implements java.io.Serializable
    * Sets the value of field 'end'.
    * 
    * @param end
-   *                the value of field 'end'.
+   *          the value of field 'end'.
    */
   public void setEnd(final int end)
   {
@@ -659,7 +664,7 @@ public class JGroup implements java.io.Serializable
    * Sets the value of field 'name'.
    * 
    * @param name
-   *                the value of field 'name'.
+   *          the value of field 'name'.
    */
   public void setName(final java.lang.String name)
   {
@@ -670,7 +675,7 @@ public class JGroup implements java.io.Serializable
    * Sets the value of field 'outlineColour'.
    * 
    * @param outlineColour
-   *                the value of field 'outlineColour'.
+   *          the value of field 'outlineColour'.
    */
   public void setOutlineColour(final int outlineColour)
   {
@@ -682,7 +687,7 @@ public class JGroup implements java.io.Serializable
    * Sets the value of field 'pidThreshold'.
    * 
    * @param pidThreshold
-   *                the value of field 'pidThreshold'.
+   *          the value of field 'pidThreshold'.
    */
   public void setPidThreshold(final int pidThreshold)
   {
@@ -696,7 +701,7 @@ public class JGroup implements java.io.Serializable
    * @param index
    * @param vSeq
    * @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 setSeq(final int index, final int vSeq)
           throws java.lang.IndexOutOfBoundsException
@@ -704,8 +709,11 @@ public class JGroup implements java.io.Serializable
     // check bounds for index
     if (index < 0 || index >= this._seqList.size())
     {
-      throw new IndexOutOfBoundsException("setSeq: Index value '" + index
-              + "' not in range [0.." + (this._seqList.size() - 1) + "]");
+        throw new IndexOutOfBoundsException(MessageManager.formatMessage("exception.index_value_not_in_range", new String[]{
+                         "setSeq",
+                         Integer.valueOf(index).toString(),
+                         Integer.valueOf((this._seqList.size() - 1)).toString()
+          })); 
     }
 
     this._seqList.set(index, new java.lang.Integer(vSeq));
@@ -731,7 +739,7 @@ public class JGroup implements java.io.Serializable
    * Sets the value of field 'start'.
    * 
    * @param start
-   *                the value of field 'start'.
+   *          the value of field 'start'.
    */
   public void setStart(final int start)
   {
@@ -744,11 +752,10 @@ public class JGroup 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.JGroup
    */
   public static jalview.binding.JGroup unmarshal(final java.io.Reader reader)
@@ -763,8 +770,7 @@ public class JGroup 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
   {