JAL-1355
[jalview.git] / src / jalview / schemabinding / version2 / JalviewUserColours.java
index 49f428a..e6ced25 100644 (file)
@@ -24,6 +24,8 @@ package jalview.schemabinding.version2;
 //- Imported classes and packages -/
 //---------------------------------/
 
+import jalview.util.MessageManager;
+
 import org.exolab.castor.xml.Marshaller;
 import org.exolab.castor.xml.Unmarshaller;
 
@@ -120,9 +122,11 @@ public class JalviewUserColours implements java.io.Serializable
     // check bounds for index
     if (index < 0 || index >= this._colourList.size())
     {
-      throw new IndexOutOfBoundsException("getColour: Index value '"
-              + index + "' not in range [0.."
-              + (this._colourList.size() - 1) + "]");
+        throw new IndexOutOfBoundsException(MessageManager.formatMessage("exception.index_value_not_in_range", new String[]{
+                         "getColour",
+                         Integer.valueOf(index).toString(),
+                         Integer.valueOf((this._colourList.size() - 1)).toString()
+          })); 
     }
 
     return (Colour) _colourList.get(index);
@@ -274,9 +278,11 @@ public class JalviewUserColours implements java.io.Serializable
     // check bounds for index
     if (index < 0 || index >= this._colourList.size())
     {
-      throw new IndexOutOfBoundsException("setColour: Index value '"
-              + index + "' not in range [0.."
-              + (this._colourList.size() - 1) + "]");
+        throw new IndexOutOfBoundsException(MessageManager.formatMessage("exception.index_value_not_in_range", new String[]{
+                 "setColour",
+                 Integer.valueOf(index).toString(),
+                 Integer.valueOf((this._colourList.size() - 1)).toString()
+        })); 
     }
 
     this._colourList.set(index, vColour);