X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fbinding%2FJalviewModelSequence.java;h=cbb50d51d53666f8e3fc80a9c4672c4cf7c39ca4;hb=582d39cb05dfbb5f956f74d4a97a17d9f63b0786;hp=d22dcd464a488caad4f3eb23f44b625f8ea4ca9b;hpb=99c58ee0ae2a848f982552e53feaf6d5cb9925e5;p=jalview.git diff --git a/src/jalview/binding/JalviewModelSequence.java b/src/jalview/binding/JalviewModelSequence.java index d22dcd4..cbb50d5 100755 --- a/src/jalview/binding/JalviewModelSequence.java +++ b/src/jalview/binding/JalviewModelSequence.java @@ -1,29 +1,10 @@ /* - * This class was automatically generated with + * This class was automatically generated with * Castor 0.9.6, using an XML * Schema. * $Id$ */ -/* -* Jalview - A Sequence Alignment Editor and Viewer -* Copyright (C) 2005 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle -* -* 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 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. -* -* 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 -*/ - package jalview.binding; //---------------------------------/ @@ -44,7 +25,7 @@ import org.xml.sax.ContentHandler; /** * Class JalviewModelSequence. - * + * * @version $Revision$ $Date$ */ public class JalviewModelSequence implements java.io.Serializable { @@ -74,6 +55,16 @@ public class JalviewModelSequence implements java.io.Serializable { */ private java.util.Vector _userColoursList; + /** + * Field _treeList + */ + private java.util.Vector _treeList; + + /** + * Field _featureSettings + */ + private jalview.binding.FeatureSettings _featureSettings; + //----------------/ //- Constructors -/ @@ -85,6 +76,7 @@ public class JalviewModelSequence implements java.io.Serializable { _JGroupList = new Vector(); _viewportList = new Vector(); _userColoursList = new Vector(); + _treeList = new Vector(); } //-- jalview.binding.JalviewModelSequence() @@ -94,22 +86,22 @@ public class JalviewModelSequence implements java.io.Serializable { /** * Method addJGroup - * - * - * + * + * + * * @param vJGroup */ public void addJGroup(jalview.binding.JGroup vJGroup) throws java.lang.IndexOutOfBoundsException { _JGroupList.addElement(vJGroup); - } //-- void addJGroup(jalview.binding.JGroup) + } //-- void addJGroup(jalview.binding.JGroup) /** * Method addJGroup - * - * - * + * + * + * * @param index * @param vJGroup */ @@ -117,26 +109,26 @@ public class JalviewModelSequence implements java.io.Serializable { throws java.lang.IndexOutOfBoundsException { _JGroupList.insertElementAt(vJGroup, index); - } //-- void addJGroup(int, jalview.binding.JGroup) + } //-- void addJGroup(int, jalview.binding.JGroup) /** * Method addJSeq - * - * - * + * + * + * * @param vJSeq */ public void addJSeq(jalview.binding.JSeq vJSeq) throws java.lang.IndexOutOfBoundsException { _JSeqList.addElement(vJSeq); - } //-- void addJSeq(jalview.binding.JSeq) + } //-- void addJSeq(jalview.binding.JSeq) /** * Method addJSeq - * - * - * + * + * + * * @param index * @param vJSeq */ @@ -144,26 +136,53 @@ public class JalviewModelSequence implements java.io.Serializable { throws java.lang.IndexOutOfBoundsException { _JSeqList.insertElementAt(vJSeq, index); - } //-- void addJSeq(int, jalview.binding.JSeq) + } //-- void addJSeq(int, jalview.binding.JSeq) + + /** + * Method addTree + * + * + * + * @param vTree + */ + public void addTree(jalview.binding.Tree vTree) + throws java.lang.IndexOutOfBoundsException + { + _treeList.addElement(vTree); + } //-- void addTree(jalview.binding.Tree) + + /** + * Method addTree + * + * + * + * @param index + * @param vTree + */ + public void addTree(int index, jalview.binding.Tree vTree) + throws java.lang.IndexOutOfBoundsException + { + _treeList.insertElementAt(vTree, index); + } //-- void addTree(int, jalview.binding.Tree) /** * Method addUserColours - * - * - * + * + * + * * @param vUserColours */ public void addUserColours(jalview.binding.UserColours vUserColours) throws java.lang.IndexOutOfBoundsException { _userColoursList.addElement(vUserColours); - } //-- void addUserColours(jalview.binding.UserColours) + } //-- void addUserColours(jalview.binding.UserColours) /** * Method addUserColours - * - * - * + * + * + * * @param index * @param vUserColours */ @@ -171,26 +190,26 @@ public class JalviewModelSequence implements java.io.Serializable { throws java.lang.IndexOutOfBoundsException { _userColoursList.insertElementAt(vUserColours, index); - } //-- void addUserColours(int, jalview.binding.UserColours) + } //-- void addUserColours(int, jalview.binding.UserColours) /** * Method addViewport - * - * - * + * + * + * * @param vViewport */ public void addViewport(jalview.binding.Viewport vViewport) throws java.lang.IndexOutOfBoundsException { _viewportList.addElement(vViewport); - } //-- void addViewport(jalview.binding.Viewport) + } //-- void addViewport(jalview.binding.Viewport) /** * Method addViewport - * - * - * + * + * + * * @param index * @param vViewport */ @@ -198,61 +217,84 @@ public class JalviewModelSequence implements java.io.Serializable { throws java.lang.IndexOutOfBoundsException { _viewportList.insertElementAt(vViewport, index); - } //-- void addViewport(int, jalview.binding.Viewport) + } //-- void addViewport(int, jalview.binding.Viewport) /** * Method enumerateJGroup - * - * - * + * + * + * * @return Enumeration */ public java.util.Enumeration enumerateJGroup() { return _JGroupList.elements(); - } //-- java.util.Enumeration enumerateJGroup() + } //-- java.util.Enumeration enumerateJGroup() /** * Method enumerateJSeq - * - * - * + * + * + * * @return Enumeration */ public java.util.Enumeration enumerateJSeq() { return _JSeqList.elements(); - } //-- java.util.Enumeration enumerateJSeq() + } //-- java.util.Enumeration enumerateJSeq() + + /** + * Method enumerateTree + * + * + * + * @return Enumeration + */ + public java.util.Enumeration enumerateTree() + { + return _treeList.elements(); + } //-- java.util.Enumeration enumerateTree() /** * Method enumerateUserColours - * - * - * + * + * + * * @return Enumeration */ public java.util.Enumeration enumerateUserColours() { return _userColoursList.elements(); - } //-- java.util.Enumeration enumerateUserColours() + } //-- java.util.Enumeration enumerateUserColours() /** * Method enumerateViewport - * - * - * + * + * + * * @return Enumeration */ public java.util.Enumeration enumerateViewport() { return _viewportList.elements(); - } //-- java.util.Enumeration enumerateViewport() + } //-- java.util.Enumeration enumerateViewport() + + /** + * Returns the value of field 'featureSettings'. + * + * @return FeatureSettings + * @return the value of field 'featureSettings'. + */ + public jalview.binding.FeatureSettings getFeatureSettings() + { + return this._featureSettings; + } //-- jalview.binding.FeatureSettings getFeatureSettings() /** * Method getJGroup - * - * - * + * + * + * * @param index * @return JGroup */ @@ -263,15 +305,15 @@ public class JalviewModelSequence implements java.io.Serializable { if ((index < 0) || (index > _JGroupList.size())) { throw new IndexOutOfBoundsException(); } - + return (jalview.binding.JGroup) _JGroupList.elementAt(index); - } //-- jalview.binding.JGroup getJGroup(int) + } //-- jalview.binding.JGroup getJGroup(int) /** * Method getJGroup - * - * - * + * + * + * * @return JGroup */ public jalview.binding.JGroup[] getJGroup() @@ -282,25 +324,25 @@ public class JalviewModelSequence implements java.io.Serializable { mArray[index] = (jalview.binding.JGroup) _JGroupList.elementAt(index); } return mArray; - } //-- jalview.binding.JGroup[] getJGroup() + } //-- jalview.binding.JGroup[] getJGroup() /** * Method getJGroupCount - * - * - * + * + * + * * @return int */ public int getJGroupCount() { return _JGroupList.size(); - } //-- int getJGroupCount() + } //-- int getJGroupCount() /** * Method getJSeq - * - * - * + * + * + * * @param index * @return JSeq */ @@ -311,15 +353,15 @@ public class JalviewModelSequence implements java.io.Serializable { if ((index < 0) || (index > _JSeqList.size())) { throw new IndexOutOfBoundsException(); } - + return (jalview.binding.JSeq) _JSeqList.elementAt(index); - } //-- jalview.binding.JSeq getJSeq(int) + } //-- jalview.binding.JSeq getJSeq(int) /** * Method getJSeq - * - * - * + * + * + * * @return JSeq */ public jalview.binding.JSeq[] getJSeq() @@ -330,25 +372,73 @@ public class JalviewModelSequence implements java.io.Serializable { mArray[index] = (jalview.binding.JSeq) _JSeqList.elementAt(index); } return mArray; - } //-- jalview.binding.JSeq[] getJSeq() + } //-- jalview.binding.JSeq[] getJSeq() /** * Method getJSeqCount - * - * - * + * + * + * * @return int */ public int getJSeqCount() { return _JSeqList.size(); - } //-- int getJSeqCount() + } //-- int getJSeqCount() + + /** + * Method getTree + * + * + * + * @param index + * @return Tree + */ + public jalview.binding.Tree getTree(int index) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _treeList.size())) { + throw new IndexOutOfBoundsException(); + } + + return (jalview.binding.Tree) _treeList.elementAt(index); + } //-- jalview.binding.Tree getTree(int) + + /** + * Method getTree + * + * + * + * @return Tree + */ + public jalview.binding.Tree[] getTree() + { + int size = _treeList.size(); + jalview.binding.Tree[] mArray = new jalview.binding.Tree[size]; + for (int index = 0; index < size; index++) { + mArray[index] = (jalview.binding.Tree) _treeList.elementAt(index); + } + return mArray; + } //-- jalview.binding.Tree[] getTree() + + /** + * Method getTreeCount + * + * + * + * @return int + */ + public int getTreeCount() + { + return _treeList.size(); + } //-- int getTreeCount() /** * Method getUserColours - * - * - * + * + * + * * @param index * @return UserColours */ @@ -359,15 +449,15 @@ public class JalviewModelSequence implements java.io.Serializable { if ((index < 0) || (index > _userColoursList.size())) { throw new IndexOutOfBoundsException(); } - + return (jalview.binding.UserColours) _userColoursList.elementAt(index); - } //-- jalview.binding.UserColours getUserColours(int) + } //-- jalview.binding.UserColours getUserColours(int) /** * Method getUserColours - * - * - * + * + * + * * @return UserColours */ public jalview.binding.UserColours[] getUserColours() @@ -378,25 +468,25 @@ public class JalviewModelSequence implements java.io.Serializable { mArray[index] = (jalview.binding.UserColours) _userColoursList.elementAt(index); } return mArray; - } //-- jalview.binding.UserColours[] getUserColours() + } //-- jalview.binding.UserColours[] getUserColours() /** * Method getUserColoursCount - * - * - * + * + * + * * @return int */ public int getUserColoursCount() { return _userColoursList.size(); - } //-- int getUserColoursCount() + } //-- int getUserColoursCount() /** * Method getViewport - * - * - * + * + * + * * @param index * @return Viewport */ @@ -407,15 +497,15 @@ public class JalviewModelSequence implements java.io.Serializable { if ((index < 0) || (index > _viewportList.size())) { throw new IndexOutOfBoundsException(); } - + return (jalview.binding.Viewport) _viewportList.elementAt(index); - } //-- jalview.binding.Viewport getViewport(int) + } //-- jalview.binding.Viewport getViewport(int) /** * Method getViewport - * - * - * + * + * + * * @return Viewport */ public jalview.binding.Viewport[] getViewport() @@ -426,25 +516,25 @@ public class JalviewModelSequence implements java.io.Serializable { mArray[index] = (jalview.binding.Viewport) _viewportList.elementAt(index); } return mArray; - } //-- jalview.binding.Viewport[] getViewport() + } //-- jalview.binding.Viewport[] getViewport() /** * Method getViewportCount - * - * - * + * + * + * * @return int */ public int getViewportCount() { return _viewportList.size(); - } //-- int getViewportCount() + } //-- int getViewportCount() /** * Method isValid - * - * - * + * + * + * * @return boolean */ public boolean isValid() @@ -456,77 +546,86 @@ public class JalviewModelSequence implements java.io.Serializable { return false; } return true; - } //-- boolean isValid() + } //-- boolean isValid() /** * Method marshal - * - * - * + * + * + * * @param out */ public void marshal(java.io.Writer out) throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - + Marshaller.marshal(this, out); - } //-- void marshal(java.io.Writer) + } //-- void marshal(java.io.Writer) /** * Method marshal - * - * - * + * + * + * * @param handler */ public void marshal(org.xml.sax.ContentHandler handler) throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - + Marshaller.marshal(this, handler); - } //-- void marshal(org.xml.sax.ContentHandler) + } //-- void marshal(org.xml.sax.ContentHandler) /** * Method removeAllJGroup - * + * */ public void removeAllJGroup() { _JGroupList.removeAllElements(); - } //-- void removeAllJGroup() + } //-- void removeAllJGroup() /** * Method removeAllJSeq - * + * */ public void removeAllJSeq() { _JSeqList.removeAllElements(); - } //-- void removeAllJSeq() + } //-- void removeAllJSeq() + + /** + * Method removeAllTree + * + */ + public void removeAllTree() + { + _treeList.removeAllElements(); + } //-- void removeAllTree() /** * Method removeAllUserColours - * + * */ public void removeAllUserColours() { _userColoursList.removeAllElements(); - } //-- void removeAllUserColours() + } //-- void removeAllUserColours() /** * Method removeAllViewport - * + * */ public void removeAllViewport() { _viewportList.removeAllElements(); - } //-- void removeAllViewport() + } //-- void removeAllViewport() /** * Method removeJGroup - * - * - * + * + * + * * @param index * @return JGroup */ @@ -535,13 +634,13 @@ public class JalviewModelSequence implements java.io.Serializable { java.lang.Object obj = _JGroupList.elementAt(index); _JGroupList.removeElementAt(index); return (jalview.binding.JGroup) obj; - } //-- jalview.binding.JGroup removeJGroup(int) + } //-- jalview.binding.JGroup removeJGroup(int) /** * Method removeJSeq - * - * - * + * + * + * * @param index * @return JSeq */ @@ -550,13 +649,28 @@ public class JalviewModelSequence implements java.io.Serializable { java.lang.Object obj = _JSeqList.elementAt(index); _JSeqList.removeElementAt(index); return (jalview.binding.JSeq) obj; - } //-- jalview.binding.JSeq removeJSeq(int) + } //-- jalview.binding.JSeq removeJSeq(int) + + /** + * Method removeTree + * + * + * + * @param index + * @return Tree + */ + public jalview.binding.Tree removeTree(int index) + { + java.lang.Object obj = _treeList.elementAt(index); + _treeList.removeElementAt(index); + return (jalview.binding.Tree) obj; + } //-- jalview.binding.Tree removeTree(int) /** * Method removeUserColours - * - * - * + * + * + * * @param index * @return UserColours */ @@ -565,13 +679,13 @@ public class JalviewModelSequence implements java.io.Serializable { java.lang.Object obj = _userColoursList.elementAt(index); _userColoursList.removeElementAt(index); return (jalview.binding.UserColours) obj; - } //-- jalview.binding.UserColours removeUserColours(int) + } //-- jalview.binding.UserColours removeUserColours(int) /** * Method removeViewport - * - * - * + * + * + * * @param index * @return Viewport */ @@ -580,13 +694,23 @@ public class JalviewModelSequence implements java.io.Serializable { java.lang.Object obj = _viewportList.elementAt(index); _viewportList.removeElementAt(index); return (jalview.binding.Viewport) obj; - } //-- jalview.binding.Viewport removeViewport(int) + } //-- jalview.binding.Viewport removeViewport(int) + + /** + * Sets the value of field 'featureSettings'. + * + * @param featureSettings the value of field 'featureSettings'. + */ + public void setFeatureSettings(jalview.binding.FeatureSettings featureSettings) + { + this._featureSettings = featureSettings; + } //-- void setFeatureSettings(jalview.binding.FeatureSettings) /** * Method setJGroup - * - * - * + * + * + * * @param index * @param vJGroup */ @@ -598,13 +722,13 @@ public class JalviewModelSequence implements java.io.Serializable { throw new IndexOutOfBoundsException(); } _JGroupList.setElementAt(vJGroup, index); - } //-- void setJGroup(int, jalview.binding.JGroup) + } //-- void setJGroup(int, jalview.binding.JGroup) /** * Method setJGroup - * - * - * + * + * + * * @param JGroupArray */ public void setJGroup(jalview.binding.JGroup[] JGroupArray) @@ -614,13 +738,13 @@ public class JalviewModelSequence implements java.io.Serializable { for (int i = 0; i < JGroupArray.length; i++) { _JGroupList.addElement(JGroupArray[i]); } - } //-- void setJGroup(jalview.binding.JGroup) + } //-- void setJGroup(jalview.binding.JGroup) /** * Method setJSeq - * - * - * + * + * + * * @param index * @param vJSeq */ @@ -632,13 +756,13 @@ public class JalviewModelSequence implements java.io.Serializable { throw new IndexOutOfBoundsException(); } _JSeqList.setElementAt(vJSeq, index); - } //-- void setJSeq(int, jalview.binding.JSeq) + } //-- void setJSeq(int, jalview.binding.JSeq) /** * Method setJSeq - * - * - * + * + * + * * @param JSeqArray */ public void setJSeq(jalview.binding.JSeq[] JSeqArray) @@ -648,13 +772,47 @@ public class JalviewModelSequence implements java.io.Serializable { for (int i = 0; i < JSeqArray.length; i++) { _JSeqList.addElement(JSeqArray[i]); } - } //-- void setJSeq(jalview.binding.JSeq) + } //-- void setJSeq(jalview.binding.JSeq) + + /** + * Method setTree + * + * + * + * @param index + * @param vTree + */ + public void setTree(int index, jalview.binding.Tree vTree) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _treeList.size())) { + throw new IndexOutOfBoundsException(); + } + _treeList.setElementAt(vTree, index); + } //-- void setTree(int, jalview.binding.Tree) + + /** + * Method setTree + * + * + * + * @param treeArray + */ + public void setTree(jalview.binding.Tree[] treeArray) + { + //-- copy array + _treeList.removeAllElements(); + for (int i = 0; i < treeArray.length; i++) { + _treeList.addElement(treeArray[i]); + } + } //-- void setTree(jalview.binding.Tree) /** * Method setUserColours - * - * - * + * + * + * * @param index * @param vUserColours */ @@ -666,13 +824,13 @@ public class JalviewModelSequence implements java.io.Serializable { throw new IndexOutOfBoundsException(); } _userColoursList.setElementAt(vUserColours, index); - } //-- void setUserColours(int, jalview.binding.UserColours) + } //-- void setUserColours(int, jalview.binding.UserColours) /** * Method setUserColours - * - * - * + * + * + * * @param userColoursArray */ public void setUserColours(jalview.binding.UserColours[] userColoursArray) @@ -682,13 +840,13 @@ public class JalviewModelSequence implements java.io.Serializable { for (int i = 0; i < userColoursArray.length; i++) { _userColoursList.addElement(userColoursArray[i]); } - } //-- void setUserColours(jalview.binding.UserColours) + } //-- void setUserColours(jalview.binding.UserColours) /** * Method setViewport - * - * - * + * + * + * * @param index * @param vViewport */ @@ -700,13 +858,13 @@ public class JalviewModelSequence implements java.io.Serializable { throw new IndexOutOfBoundsException(); } _viewportList.setElementAt(vViewport, index); - } //-- void setViewport(int, jalview.binding.Viewport) + } //-- void setViewport(int, jalview.binding.Viewport) /** * Method setViewport - * - * - * + * + * + * * @param viewportArray */ public void setViewport(jalview.binding.Viewport[] viewportArray) @@ -716,13 +874,13 @@ public class JalviewModelSequence implements java.io.Serializable { for (int i = 0; i < viewportArray.length; i++) { _viewportList.addElement(viewportArray[i]); } - } //-- void setViewport(jalview.binding.Viewport) + } //-- void setViewport(jalview.binding.Viewport) /** * Method unmarshal - * - * - * + * + * + * * @param reader * @return Object */ @@ -730,17 +888,17 @@ public class JalviewModelSequence implements java.io.Serializable { throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { return (jalview.binding.JalviewModelSequence) Unmarshaller.unmarshal(jalview.binding.JalviewModelSequence.class, reader); - } //-- java.lang.Object unmarshal(java.io.Reader) + } //-- java.lang.Object unmarshal(java.io.Reader) /** * Method validate - * + * */ public void validate() throws org.exolab.castor.xml.ValidationException { org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); validator.validate(this); - } //-- void validate() + } //-- void validate() }