X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fbinding%2FJalviewModelSequence.java;h=cbb50d51d53666f8e3fc80a9c4672c4cf7c39ca4;hb=49236af7c1d2b9e2cd5f4ffca47922fdeb12cbbe;hp=7f1789363e4eab365c1cc40101fac60a06fc8e38;hpb=124589ea0c58cbb7b3788bbf13b687a0ece3c9e0;p=jalview.git diff --git a/src/jalview/binding/JalviewModelSequence.java b/src/jalview/binding/JalviewModelSequence.java index 7f17893..cbb50d5 100755 --- a/src/jalview/binding/JalviewModelSequence.java +++ b/src/jalview/binding/JalviewModelSequence.java @@ -50,6 +50,21 @@ public class JalviewModelSequence implements java.io.Serializable { */ private java.util.Vector _viewportList; + /** + * Field _userColoursList + */ + private java.util.Vector _userColoursList; + + /** + * Field _treeList + */ + private java.util.Vector _treeList; + + /** + * Field _featureSettings + */ + private jalview.binding.FeatureSettings _featureSettings; + //----------------/ //- Constructors -/ @@ -60,6 +75,8 @@ public class JalviewModelSequence implements java.io.Serializable { _JSeqList = new Vector(); _JGroupList = new Vector(); _viewportList = new Vector(); + _userColoursList = new Vector(); + _treeList = new Vector(); } //-- jalview.binding.JalviewModelSequence() @@ -122,6 +139,60 @@ public class JalviewModelSequence implements java.io.Serializable { } //-- 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) + + /** + * Method addUserColours + * + * + * + * @param index + * @param vUserColours + */ + public void addUserColours(int index, jalview.binding.UserColours vUserColours) + throws java.lang.IndexOutOfBoundsException + { + _userColoursList.insertElementAt(vUserColours, index); + } //-- void addUserColours(int, jalview.binding.UserColours) + + /** * Method addViewport * * @@ -173,6 +244,30 @@ public class JalviewModelSequence implements java.io.Serializable { } //-- 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() + + /** * Method enumerateViewport * * @@ -185,6 +280,17 @@ public class JalviewModelSequence implements java.io.Serializable { } //-- 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 * * @@ -281,6 +387,102 @@ public class JalviewModelSequence implements java.io.Serializable { } //-- 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 + */ + public jalview.binding.UserColours getUserColours(int index) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _userColoursList.size())) { + throw new IndexOutOfBoundsException(); + } + + return (jalview.binding.UserColours) _userColoursList.elementAt(index); + } //-- jalview.binding.UserColours getUserColours(int) + + /** + * Method getUserColours + * + * + * + * @return UserColours + */ + public jalview.binding.UserColours[] getUserColours() + { + int size = _userColoursList.size(); + jalview.binding.UserColours[] mArray = new jalview.binding.UserColours[size]; + for (int index = 0; index < size; index++) { + mArray[index] = (jalview.binding.UserColours) _userColoursList.elementAt(index); + } + return mArray; + } //-- jalview.binding.UserColours[] getUserColours() + + /** + * Method getUserColoursCount + * + * + * + * @return int + */ + public int getUserColoursCount() + { + return _userColoursList.size(); + } //-- int getUserColoursCount() + + /** * Method getViewport * * @@ -393,6 +595,24 @@ public class JalviewModelSequence implements java.io.Serializable { } //-- void removeAllJSeq() /** + * Method removeAllTree + * + */ + public void removeAllTree() + { + _treeList.removeAllElements(); + } //-- void removeAllTree() + + /** + * Method removeAllUserColours + * + */ + public void removeAllUserColours() + { + _userColoursList.removeAllElements(); + } //-- void removeAllUserColours() + + /** * Method removeAllViewport * */ @@ -432,6 +652,36 @@ public class JalviewModelSequence implements java.io.Serializable { } //-- 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 + */ + public jalview.binding.UserColours removeUserColours(int index) + { + java.lang.Object obj = _userColoursList.elementAt(index); + _userColoursList.removeElementAt(index); + return (jalview.binding.UserColours) obj; + } //-- jalview.binding.UserColours removeUserColours(int) + + /** * Method removeViewport * * @@ -447,6 +697,16 @@ public class JalviewModelSequence implements java.io.Serializable { } //-- 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 * * @@ -515,6 +775,74 @@ public class JalviewModelSequence implements java.io.Serializable { } //-- 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 + */ + public void setUserColours(int index, jalview.binding.UserColours vUserColours) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _userColoursList.size())) { + throw new IndexOutOfBoundsException(); + } + _userColoursList.setElementAt(vUserColours, index); + } //-- void setUserColours(int, jalview.binding.UserColours) + + /** + * Method setUserColours + * + * + * + * @param userColoursArray + */ + public void setUserColours(jalview.binding.UserColours[] userColoursArray) + { + //-- copy array + _userColoursList.removeAllElements(); + for (int i = 0; i < userColoursArray.length; i++) { + _userColoursList.addElement(userColoursArray[i]); + } + } //-- void setUserColours(jalview.binding.UserColours) + + /** * Method setViewport * *