X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fbinding%2FJalviewUserColours.java;h=f3682457833ee2634fd6f3a633d829e1d64afc90;hb=7703a6a091c65e45bfb8f4d056cd2cbdb19b3535;hp=822392e1b18582be50c840629b2768ba8b84a3b7;hpb=506d60f0e188723ddc91c26824b41ac7034df3fe;p=jalview.git diff --git a/src/jalview/binding/JalviewUserColours.java b/src/jalview/binding/JalviewUserColours.java old mode 100755 new mode 100644 index 822392e..f368245 --- a/src/jalview/binding/JalviewUserColours.java +++ b/src/jalview/binding/JalviewUserColours.java @@ -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 . + * 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; @@ -43,6 +47,12 @@ public class JalviewUserColours implements java.io.Serializable private java.lang.String _schemeName; /** + * Jalview colour scheme document version. + * + */ + private java.lang.String _version; + + /** * Field _colourList. */ private java.util.Vector _colourList; @@ -66,7 +76,7 @@ public class JalviewUserColours implements java.io.Serializable * * @param vColour * @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 addColour(final Colour vColour) throws java.lang.IndexOutOfBoundsException @@ -80,7 +90,7 @@ public class JalviewUserColours implements java.io.Serializable * @param index * @param vColour * @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 addColour(final int index, final Colour vColour) throws java.lang.IndexOutOfBoundsException @@ -103,7 +113,7 @@ public class JalviewUserColours 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 Colour at the given index */ public Colour getColour(final int index) @@ -112,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); @@ -156,6 +168,18 @@ public class JalviewUserColours implements java.io.Serializable } /** + * Returns the value of field 'version'. The field 'version' has the following + * description: Jalview colour scheme document version. + * + * + * @return the value of field 'Version'. + */ + public java.lang.String getVersion() + { + return this._version; + } + + /** * Method isValid. * * @return true if this object is valid according to the schema @@ -177,11 +201,10 @@ public class JalviewUserColours 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, @@ -195,13 +218,12 @@ public class JalviewUserColours 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, @@ -212,7 +234,7 @@ public class JalviewUserColours implements java.io.Serializable } /** - */ + */ public void removeAllColour() { this._colourList.clear(); @@ -248,7 +270,7 @@ public class JalviewUserColours implements java.io.Serializable * @param index * @param vColour * @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 setColour(final int index, final Colour vColour) throws java.lang.IndexOutOfBoundsException @@ -256,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); @@ -284,7 +308,7 @@ public class JalviewUserColours implements java.io.Serializable * Sets the value of field 'schemeName'. * * @param schemeName - * the value of field 'schemeName'. + * the value of field 'schemeName'. */ public void setSchemeName(final java.lang.String schemeName) { @@ -292,15 +316,27 @@ public class JalviewUserColours implements java.io.Serializable } /** + * Sets the value of field 'version'. The field 'version' has the following + * description: Jalview colour scheme document version. + * + * + * @param version + * the value of field 'version'. + */ + public void setVersion(final java.lang.String version) + { + this._version = version; + } + + /** * Method unmarshal. * * @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.JalviewUserColours */ public static jalview.binding.JalviewUserColours unmarshal( @@ -316,8 +352,7 @@ public class JalviewUserColours 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 {