JAL-1767 schema and Castor changes for Save PCA in project
[jalview.git] / src / jalview / schemabinding / version2 / JalviewModelSequence.java
index 9328e15..932ba14 100644 (file)
@@ -1,31 +1,16 @@
 /*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2b1)
- * Copyright (C) 2014 The Jalview Authors
- * 
- * This file is part of Jalview.
- * 
- * 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 Jalview.  If not, see <http://www.gnu.org/licenses/>.
- * The Jalview Authors are detailed in the 'AUTHORS' file.
+ * This class was automatically generated with 
+ * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
+ * Schema.
+ * $Id$
  */
+
 package jalview.schemabinding.version2;
 
 //---------------------------------/
 //- Imported classes and packages -/
 //---------------------------------/
 
-import jalview.util.MessageManager;
-
 import org.exolab.castor.xml.Marshaller;
 import org.exolab.castor.xml.Unmarshaller;
 
@@ -67,6 +52,11 @@ public class JalviewModelSequence implements java.io.Serializable
   private java.util.Vector _treeList;
 
   /**
+   * Field _pcaViewerList.
+   */
+  private java.util.Vector _pcaViewerList;
+
+  /**
    * Field _featureSettings.
    */
   private jalview.schemabinding.version2.FeatureSettings _featureSettings;
@@ -83,6 +73,7 @@ public class JalviewModelSequence implements java.io.Serializable
     this._viewportList = new java.util.Vector();
     this._userColoursList = new java.util.Vector();
     this._treeList = new java.util.Vector();
+    this._pcaViewerList = new java.util.Vector();
   }
 
   // -----------/
@@ -148,6 +139,35 @@ public class JalviewModelSequence implements java.io.Serializable
   /**
    * 
    * 
+   * @param vPcaViewer
+   * @throws java.lang.IndexOutOfBoundsException
+   *           if the index given is outside the bounds of the collection
+   */
+  public void addPcaViewer(
+          final jalview.schemabinding.version2.PcaViewer vPcaViewer)
+          throws java.lang.IndexOutOfBoundsException
+  {
+    this._pcaViewerList.addElement(vPcaViewer);
+  }
+
+  /**
+   * 
+   * 
+   * @param index
+   * @param vPcaViewer
+   * @throws java.lang.IndexOutOfBoundsException
+   *           if the index given is outside the bounds of the collection
+   */
+  public void addPcaViewer(final int index,
+          final jalview.schemabinding.version2.PcaViewer vPcaViewer)
+          throws java.lang.IndexOutOfBoundsException
+  {
+    this._pcaViewerList.add(index, vPcaViewer);
+  }
+
+  /**
+   * 
+   * 
    * @param vTree
    * @throws java.lang.IndexOutOfBoundsException
    *           if the index given is outside the bounds of the collection
@@ -254,6 +274,17 @@ public class JalviewModelSequence implements java.io.Serializable
   }
 
   /**
+   * Method enumeratePcaViewer.
+   * 
+   * @return an Enumeration over all jalview.schemabinding.version2.PcaViewer
+   *         elements
+   */
+  public java.util.Enumeration enumeratePcaViewer()
+  {
+    return this._pcaViewerList.elements();
+  }
+
+  /**
    * Method enumerateTree.
    * 
    * @return an Enumeration over all jalview.schemabinding.version2.Tree
@@ -311,11 +342,9 @@ public class JalviewModelSequence implements java.io.Serializable
     // check bounds for index
     if (index < 0 || index >= this._JGroupList.size())
     {
-        throw new IndexOutOfBoundsException(MessageManager.formatMessage("exception.index_value_not_in_range", new String[]{
-                         "getJGroup",
-                         Integer.valueOf(index).toString(),
-                         Integer.valueOf((this._JGroupList.size() - 1)).toString()
-          })); 
+      throw new IndexOutOfBoundsException(
+              "getJGroup: Index value '" + index + "' not in range [0.."
+                      + (this._JGroupList.size() - 1) + "]");
     }
 
     return (jalview.schemabinding.version2.JGroup) _JGroupList.get(index);
@@ -362,11 +391,8 @@ public class JalviewModelSequence implements java.io.Serializable
     // check bounds for index
     if (index < 0 || index >= this._JSeqList.size())
     {
-        throw new IndexOutOfBoundsException(MessageManager.formatMessage("exception.index_value_not_in_range", new String[]{
-                 "getJSeq",
-                 Integer.valueOf(index).toString(),
-                 Integer.valueOf((this._JSeqList.size() - 1)).toString()
-        })); 
+      throw new IndexOutOfBoundsException("getJSeq: Index value '" + index
+              + "' not in range [0.." + (this._JSeqList.size() - 1) + "]");
     }
 
     return (jalview.schemabinding.version2.JSeq) _JSeqList.get(index);
@@ -399,6 +425,56 @@ public class JalviewModelSequence implements java.io.Serializable
   }
 
   /**
+   * Method getPcaViewer.
+   * 
+   * @param index
+   * @throws java.lang.IndexOutOfBoundsException
+   *           if the index given is outside the bounds of the collection
+   * @return the value of the jalview.schemabinding.version2.PcaViewer at the
+   *         given index
+   */
+  public jalview.schemabinding.version2.PcaViewer getPcaViewer(
+          final int index) throws java.lang.IndexOutOfBoundsException
+  {
+    // check bounds for index
+    if (index < 0 || index >= this._pcaViewerList.size())
+    {
+      throw new IndexOutOfBoundsException(
+              "getPcaViewer: Index value '" + index + "' not in range [0.."
+                      + (this._pcaViewerList.size() - 1) + "]");
+    }
+
+    return (jalview.schemabinding.version2.PcaViewer) _pcaViewerList
+            .get(index);
+  }
+
+  /**
+   * Method getPcaViewer.Returns the contents of the collection in an Array.
+   * <p>
+   * Note: Just in case the collection contents are changing in another thread,
+   * we pass a 0-length Array of the correct type into the API call. This way we
+   * <i>know</i> that the Array returned is of exactly the correct length.
+   * 
+   * @return this collection as an Array
+   */
+  public jalview.schemabinding.version2.PcaViewer[] getPcaViewer()
+  {
+    jalview.schemabinding.version2.PcaViewer[] array = new jalview.schemabinding.version2.PcaViewer[0];
+    return (jalview.schemabinding.version2.PcaViewer[]) this._pcaViewerList
+            .toArray(array);
+  }
+
+  /**
+   * Method getPcaViewerCount.
+   * 
+   * @return the size of this collection
+   */
+  public int getPcaViewerCount()
+  {
+    return this._pcaViewerList.size();
+  }
+
+  /**
    * Method getTree.
    * 
    * @param index
@@ -413,11 +489,8 @@ public class JalviewModelSequence implements java.io.Serializable
     // check bounds for index
     if (index < 0 || index >= this._treeList.size())
     {
-        throw new IndexOutOfBoundsException(MessageManager.formatMessage("exception.index_value_not_in_range", new String[]{
-                         "getJgetTreeSeq",
-                         Integer.valueOf(index).toString(),
-                         Integer.valueOf((this._treeList.size() - 1)).toString()
-          })); 
+      throw new IndexOutOfBoundsException("getTree: Index value '" + index
+              + "' not in range [0.." + (this._treeList.size() - 1) + "]");
     }
 
     return (jalview.schemabinding.version2.Tree) _treeList.get(index);
@@ -464,11 +537,9 @@ public class JalviewModelSequence implements java.io.Serializable
     // check bounds for index
     if (index < 0 || index >= this._userColoursList.size())
     {
-        throw new IndexOutOfBoundsException(MessageManager.formatMessage("exception.index_value_not_in_range", new String[]{
-                 "getUserColours",
-                 Integer.valueOf(index).toString(),
-                 Integer.valueOf((this._userColoursList.size() - 1)).toString()
-        })); 
+      throw new IndexOutOfBoundsException("getUserColours: Index value '"
+              + index + "' not in range [0.."
+              + (this._userColoursList.size() - 1) + "]");
     }
 
     return (jalview.schemabinding.version2.UserColours) _userColoursList
@@ -510,17 +581,15 @@ public class JalviewModelSequence implements java.io.Serializable
    * @return the value of the jalview.schemabinding.version2.Viewport at the
    *         given index
    */
-  public jalview.schemabinding.version2.Viewport getViewport(final int index)
-          throws java.lang.IndexOutOfBoundsException
+  public jalview.schemabinding.version2.Viewport getViewport(
+          final int index) throws java.lang.IndexOutOfBoundsException
   {
     // check bounds for index
     if (index < 0 || index >= this._viewportList.size())
     {
-        throw new IndexOutOfBoundsException(MessageManager.formatMessage("exception.index_value_not_in_range", new String[]{
-                         "getViewport",
-                         Integer.valueOf(index).toString(),
-                         Integer.valueOf((this._viewportList.size() - 1)).toString()
-          })); 
+      throw new IndexOutOfBoundsException(
+              "getViewport: Index value '" + index + "' not in range [0.."
+                      + (this._viewportList.size() - 1) + "]");
     }
 
     return (jalview.schemabinding.version2.Viewport) _viewportList
@@ -608,35 +677,42 @@ public class JalviewModelSequence implements java.io.Serializable
   }
 
   /**
-     */
+   */
   public void removeAllJGroup()
   {
     this._JGroupList.clear();
   }
 
   /**
-     */
+   */
   public void removeAllJSeq()
   {
     this._JSeqList.clear();
   }
 
   /**
-     */
+   */
+  public void removeAllPcaViewer()
+  {
+    this._pcaViewerList.clear();
+  }
+
+  /**
+   */
   public void removeAllTree()
   {
     this._treeList.clear();
   }
 
   /**
-     */
+   */
   public void removeAllUserColours()
   {
     this._userColoursList.clear();
   }
 
   /**
-     */
+   */
   public void removeAllViewport()
   {
     this._viewportList.clear();
@@ -693,6 +769,32 @@ public class JalviewModelSequence implements java.io.Serializable
   }
 
   /**
+   * Method removePcaViewer.
+   * 
+   * @param vPcaViewer
+   * @return true if the object was removed from the collection.
+   */
+  public boolean removePcaViewer(
+          final jalview.schemabinding.version2.PcaViewer vPcaViewer)
+  {
+    boolean removed = _pcaViewerList.remove(vPcaViewer);
+    return removed;
+  }
+
+  /**
+   * Method removePcaViewerAt.
+   * 
+   * @param index
+   * @return the element removed from the collection
+   */
+  public jalview.schemabinding.version2.PcaViewer removePcaViewerAt(
+          final int index)
+  {
+    java.lang.Object obj = this._pcaViewerList.remove(index);
+    return (jalview.schemabinding.version2.PcaViewer) obj;
+  }
+
+  /**
    * Method removeTree.
    * 
    * @param vTree
@@ -795,11 +897,9 @@ public class JalviewModelSequence implements java.io.Serializable
     // check bounds for index
     if (index < 0 || index >= this._JGroupList.size())
     {
-        throw new IndexOutOfBoundsException(MessageManager.formatMessage("exception.index_value_not_in_range", new String[]{
-                 "setJGroup",
-                 Integer.valueOf(index).toString(),
-                 Integer.valueOf((this._JGroupList.size() - 1)).toString()
-        })); 
+      throw new IndexOutOfBoundsException(
+              "setJGroup: Index value '" + index + "' not in range [0.."
+                      + (this._JGroupList.size() - 1) + "]");
     }
 
     this._JGroupList.set(index, vJGroup);
@@ -837,11 +937,8 @@ public class JalviewModelSequence implements java.io.Serializable
     // check bounds for index
     if (index < 0 || index >= this._JSeqList.size())
     {
-        throw new IndexOutOfBoundsException(MessageManager.formatMessage("exception.index_value_not_in_range", new String[]{
-                         "setJSeq",
-                         Integer.valueOf(index).toString(),
-                         Integer.valueOf((this._JSeqList.size() - 1)).toString()
-          })); 
+      throw new IndexOutOfBoundsException("setJSeq: Index value '" + index
+              + "' not in range [0.." + (this._JSeqList.size() - 1) + "]");
     }
 
     this._JSeqList.set(index, vJSeq);
@@ -852,7 +949,8 @@ public class JalviewModelSequence implements java.io.Serializable
    * 
    * @param vJSeqArray
    */
-  public void setJSeq(final jalview.schemabinding.version2.JSeq[] vJSeqArray)
+  public void setJSeq(
+          final jalview.schemabinding.version2.JSeq[] vJSeqArray)
   {
     // -- copy array
     _JSeqList.clear();
@@ -867,6 +965,46 @@ public class JalviewModelSequence implements java.io.Serializable
    * 
    * 
    * @param index
+   * @param vPcaViewer
+   * @throws java.lang.IndexOutOfBoundsException
+   *           if the index given is outside the bounds of the collection
+   */
+  public void setPcaViewer(final int index,
+          final jalview.schemabinding.version2.PcaViewer vPcaViewer)
+          throws java.lang.IndexOutOfBoundsException
+  {
+    // check bounds for index
+    if (index < 0 || index >= this._pcaViewerList.size())
+    {
+      throw new IndexOutOfBoundsException(
+              "setPcaViewer: Index value '" + index + "' not in range [0.."
+                      + (this._pcaViewerList.size() - 1) + "]");
+    }
+
+    this._pcaViewerList.set(index, vPcaViewer);
+  }
+
+  /**
+   * 
+   * 
+   * @param vPcaViewerArray
+   */
+  public void setPcaViewer(
+          final jalview.schemabinding.version2.PcaViewer[] vPcaViewerArray)
+  {
+    // -- copy array
+    _pcaViewerList.clear();
+
+    for (int i = 0; i < vPcaViewerArray.length; i++)
+    {
+      this._pcaViewerList.add(vPcaViewerArray[i]);
+    }
+  }
+
+  /**
+   * 
+   * 
+   * @param index
    * @param vTree
    * @throws java.lang.IndexOutOfBoundsException
    *           if the index given is outside the bounds of the collection
@@ -878,11 +1016,8 @@ public class JalviewModelSequence implements java.io.Serializable
     // check bounds for index
     if (index < 0 || index >= this._treeList.size())
     {
-        throw new IndexOutOfBoundsException(MessageManager.formatMessage("exception.index_value_not_in_range", new String[]{
-                 "setTree",
-                 Integer.valueOf(index).toString(),
-                 Integer.valueOf((this._treeList.size() - 1)).toString()
-        })); 
+      throw new IndexOutOfBoundsException("setTree: Index value '" + index
+              + "' not in range [0.." + (this._treeList.size() - 1) + "]");
     }
 
     this._treeList.set(index, vTree);
@@ -893,7 +1028,8 @@ public class JalviewModelSequence implements java.io.Serializable
    * 
    * @param vTreeArray
    */
-  public void setTree(final jalview.schemabinding.version2.Tree[] vTreeArray)
+  public void setTree(
+          final jalview.schemabinding.version2.Tree[] vTreeArray)
   {
     // -- copy array
     _treeList.clear();
@@ -919,11 +1055,9 @@ public class JalviewModelSequence implements java.io.Serializable
     // check bounds for index
     if (index < 0 || index >= this._userColoursList.size())
     {
-        throw new IndexOutOfBoundsException(MessageManager.formatMessage("exception.index_value_not_in_range", new String[]{
-                         "setUserColours",
-                         Integer.valueOf(index).toString(),
-                         Integer.valueOf((this._userColoursList.size() - 1)).toString()
-          })); 
+      throw new IndexOutOfBoundsException("setUserColours: Index value '"
+              + index + "' not in range [0.."
+              + (this._userColoursList.size() - 1) + "]");
     }
 
     this._userColoursList.set(index, vUserColours);
@@ -961,11 +1095,9 @@ public class JalviewModelSequence implements java.io.Serializable
     // check bounds for index
     if (index < 0 || index >= this._viewportList.size())
     {
-        throw new IndexOutOfBoundsException(MessageManager.formatMessage("exception.index_value_not_in_range", new String[]{
-                 "setViewport",
-                 Integer.valueOf(index).toString(),
-                 Integer.valueOf((this._viewportList.size() - 1)).toString()
-        })); 
+      throw new IndexOutOfBoundsException(
+              "setViewport: Index value '" + index + "' not in range [0.."
+                      + (this._viewportList.size() - 1) + "]");
     }
 
     this._viewportList.set(index, vViewport);