JAL-3180 Disabled 'By Annotation' group colour menu item
[jalview.git] / src / jalview / schemabinding / version2 / JSeq.java
index cb2f51d..7c6308e 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;
 
@@ -87,6 +72,16 @@ public class JSeq implements java.io.Serializable
   private boolean _has_hidden;
 
   /**
+   * Field _viewreference.
+   */
+  private boolean _viewreference;
+
+  /**
+   * keeps track of state for field: _viewreference
+   */
+  private boolean _has_viewreference;
+
+  /**
    * Field _featuresList.
    */
   private java.util.Vector _featuresList;
@@ -101,6 +96,15 @@ public class JSeq implements java.io.Serializable
    */
   private java.util.Vector _hiddenSequencesList;
 
+  /**
+   * Reference to a viewer showing RNA structure for this sequence. Schema
+   * supports one viewer showing multiple annotations for multiple sequences,
+   * though currently only one annotation for one sequence (gapped or trimmed)
+   * is used
+   * 
+   */
+  private java.util.Vector _rnaViewerList;
+
   // ----------------/
   // - Constructors -/
   // ----------------/
@@ -111,6 +115,7 @@ public class JSeq implements java.io.Serializable
     this._featuresList = new java.util.Vector();
     this._pdbidsList = new java.util.Vector();
     this._hiddenSequencesList = new java.util.Vector();
+    this._rnaViewerList = new java.util.Vector();
   }
 
   // -----------/
@@ -204,6 +209,35 @@ public class JSeq implements java.io.Serializable
   }
 
   /**
+   * 
+   * 
+   * @param vRnaViewer
+   * @throws java.lang.IndexOutOfBoundsException
+   *           if the index given is outside the bounds of the collection
+   */
+  public void addRnaViewer(
+          final jalview.schemabinding.version2.RnaViewer vRnaViewer)
+          throws java.lang.IndexOutOfBoundsException
+  {
+    this._rnaViewerList.addElement(vRnaViewer);
+  }
+
+  /**
+   * 
+   * 
+   * @param index
+   * @param vRnaViewer
+   * @throws java.lang.IndexOutOfBoundsException
+   *           if the index given is outside the bounds of the collection
+   */
+  public void addRnaViewer(final int index,
+          final jalview.schemabinding.version2.RnaViewer vRnaViewer)
+          throws java.lang.IndexOutOfBoundsException
+  {
+    this._rnaViewerList.add(index, vRnaViewer);
+  }
+
+  /**
      */
   public void deleteColour()
   {
@@ -232,6 +266,13 @@ public class JSeq implements java.io.Serializable
   }
 
   /**
+     */
+  public void deleteViewreference()
+  {
+    this._has_viewreference = false;
+  }
+
+  /**
    * Method enumerateFeatures.
    * 
    * @return an Enumeration over all jalview.schemabinding.version2.Features
@@ -264,6 +305,17 @@ public class JSeq implements java.io.Serializable
   }
 
   /**
+   * Method enumerateRnaViewer.
+   * 
+   * @return an Enumeration over all jalview.schemabinding.version2.RnaViewer
+   *         elements
+   */
+  public java.util.Enumeration enumerateRnaViewer()
+  {
+    return this._rnaViewerList.elements();
+  }
+
+  /**
    * Returns the value of field 'colour'.
    * 
    * @return the value of field 'Colour'.
@@ -298,11 +350,9 @@ public class JSeq implements java.io.Serializable
     // check bounds for index
     if (index < 0 || index >= this._featuresList.size())
     {
-        throw new IndexOutOfBoundsException(MessageManager.formatMessage("exception.index_value_not_in_range", new String[]{
-                         "getFeatures",
-                         Integer.valueOf(index).toString(),
-                         Integer.valueOf((this._featuresList.size() - 1)).toString()
-          })); 
+      throw new IndexOutOfBoundsException("getFeatures: Index value '"
+              + index + "' not in range [0.."
+              + (this._featuresList.size() - 1) + "]");
     }
 
     return (jalview.schemabinding.version2.Features) _featuresList
@@ -359,11 +409,10 @@ public class JSeq implements java.io.Serializable
     // check bounds for index
     if (index < 0 || index >= this._hiddenSequencesList.size())
     {
-        throw new IndexOutOfBoundsException(MessageManager.formatMessage("exception.index_value_not_in_range", new String[]{
-                 "getHiddenSequences",
-                 Integer.valueOf(index).toString(),
-                 Integer.valueOf((this._hiddenSequencesList.size() - 1)).toString()
-        })); 
+      throw new IndexOutOfBoundsException(
+              "getHiddenSequences: Index value '" + index
+                      + "' not in range [0.."
+                      + (this._hiddenSequencesList.size() - 1) + "]");
     }
 
     return ((java.lang.Integer) _hiddenSequencesList.get(index)).intValue();
@@ -422,11 +471,9 @@ public class JSeq implements java.io.Serializable
     // check bounds for index
     if (index < 0 || index >= this._pdbidsList.size())
     {
-        throw new IndexOutOfBoundsException(MessageManager.formatMessage("exception.index_value_not_in_range", new String[]{
-                         "getPdbids",
-                         Integer.valueOf(index).toString(),
-                         Integer.valueOf((this._pdbidsList.size() - 1)).toString()
-          })); 
+      throw new IndexOutOfBoundsException("getPdbids: Index value '"
+              + index + "' not in range [0.."
+              + (this._pdbidsList.size() - 1) + "]");
     }
 
     return (jalview.schemabinding.version2.Pdbids) _pdbidsList.get(index);
@@ -459,6 +506,56 @@ public class JSeq implements java.io.Serializable
   }
 
   /**
+   * Method getRnaViewer.
+   * 
+   * @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.RnaViewer at the
+   *         given index
+   */
+  public jalview.schemabinding.version2.RnaViewer getRnaViewer(
+          final int index) throws java.lang.IndexOutOfBoundsException
+  {
+    // check bounds for index
+    if (index < 0 || index >= this._rnaViewerList.size())
+    {
+      throw new IndexOutOfBoundsException("getRnaViewer: Index value '"
+              + index + "' not in range [0.."
+              + (this._rnaViewerList.size() - 1) + "]");
+    }
+
+    return (jalview.schemabinding.version2.RnaViewer) _rnaViewerList
+            .get(index);
+  }
+
+  /**
+   * Method getRnaViewer.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.RnaViewer[] getRnaViewer()
+  {
+    jalview.schemabinding.version2.RnaViewer[] array = new jalview.schemabinding.version2.RnaViewer[0];
+    return (jalview.schemabinding.version2.RnaViewer[]) this._rnaViewerList
+            .toArray(array);
+  }
+
+  /**
+   * Method getRnaViewerCount.
+   * 
+   * @return the size of this collection
+   */
+  public int getRnaViewerCount()
+  {
+    return this._rnaViewerList.size();
+  }
+
+  /**
    * Returns the value of field 'start'.
    * 
    * @return the value of field 'Start'.
@@ -469,6 +566,16 @@ public class JSeq implements java.io.Serializable
   }
 
   /**
+   * Returns the value of field 'viewreference'.
+   * 
+   * @return the value of field 'Viewreference'.
+   */
+  public boolean getViewreference()
+  {
+    return this._viewreference;
+  }
+
+  /**
    * Method hasColour.
    * 
    * @return true if at least one Colour has been added
@@ -509,6 +616,16 @@ public class JSeq implements java.io.Serializable
   }
 
   /**
+   * Method hasViewreference.
+   * 
+   * @return true if at least one Viewreference has been added
+   */
+  public boolean hasViewreference()
+  {
+    return this._has_viewreference;
+  }
+
+  /**
    * Returns the value of field 'hidden'.
    * 
    * @return the value of field 'Hidden'.
@@ -536,6 +653,16 @@ public class JSeq implements java.io.Serializable
   }
 
   /**
+   * Returns the value of field 'viewreference'.
+   * 
+   * @return the value of field 'Viewreference'.
+   */
+  public boolean isViewreference()
+  {
+    return this._viewreference;
+  }
+
+  /**
    * 
    * 
    * @param out
@@ -594,6 +721,13 @@ public class JSeq implements java.io.Serializable
   }
 
   /**
+     */
+  public void removeAllRnaViewer()
+  {
+    this._rnaViewerList.clear();
+  }
+
+  /**
    * Method removeFeatures.
    * 
    * @param vFeatures
@@ -671,6 +805,32 @@ public class JSeq implements java.io.Serializable
   }
 
   /**
+   * Method removeRnaViewer.
+   * 
+   * @param vRnaViewer
+   * @return true if the object was removed from the collection.
+   */
+  public boolean removeRnaViewer(
+          final jalview.schemabinding.version2.RnaViewer vRnaViewer)
+  {
+    boolean removed = _rnaViewerList.remove(vRnaViewer);
+    return removed;
+  }
+
+  /**
+   * Method removeRnaViewerAt.
+   * 
+   * @param index
+   * @return the element removed from the collection
+   */
+  public jalview.schemabinding.version2.RnaViewer removeRnaViewerAt(
+          final int index)
+  {
+    java.lang.Object obj = this._rnaViewerList.remove(index);
+    return (jalview.schemabinding.version2.RnaViewer) obj;
+  }
+
+  /**
    * Sets the value of field 'colour'.
    * 
    * @param colour
@@ -709,11 +869,9 @@ public class JSeq implements java.io.Serializable
     // check bounds for index
     if (index < 0 || index >= this._featuresList.size())
     {
-        throw new IndexOutOfBoundsException(MessageManager.formatMessage("exception.index_value_not_in_range", new String[]{
-                 "setFeatures",
-                 Integer.valueOf(index).toString(),
-                 Integer.valueOf((this._featuresList.size() - 1)).toString()
-        })); 
+      throw new IndexOutOfBoundsException("setFeatures: Index value '"
+              + index + "' not in range [0.."
+              + (this._featuresList.size() - 1) + "]");
     }
 
     this._featuresList.set(index, vFeatures);
@@ -762,11 +920,10 @@ public class JSeq implements java.io.Serializable
     // check bounds for index
     if (index < 0 || index >= this._hiddenSequencesList.size())
     {
-        throw new IndexOutOfBoundsException(MessageManager.formatMessage("exception.index_value_not_in_range", new String[]{
-                         "setHiddenSequences",
-                         Integer.valueOf(index).toString(),
-                         Integer.valueOf((this._hiddenSequencesList.size() - 1)).toString()
-          })); 
+      throw new IndexOutOfBoundsException(
+              "setHiddenSequences: Index value '" + index
+                      + "' not in range [0.."
+                      + (this._hiddenSequencesList.size() - 1) + "]");
     }
 
     this._hiddenSequencesList.set(index, new java.lang.Integer(
@@ -816,11 +973,9 @@ public class JSeq implements java.io.Serializable
     // check bounds for index
     if (index < 0 || index >= this._pdbidsList.size())
     {
-        throw new IndexOutOfBoundsException(MessageManager.formatMessage("exception.index_value_not_in_range", new String[]{
-                 "setPdbids",
-                 Integer.valueOf(index).toString(),
-                 Integer.valueOf((this._pdbidsList.size() - 1)).toString()
-        })); 
+      throw new IndexOutOfBoundsException("setPdbids: Index value '"
+              + index + "' not in range [0.."
+              + (this._pdbidsList.size() - 1) + "]");
     }
 
     this._pdbidsList.set(index, vPdbids);
@@ -844,6 +999,46 @@ public class JSeq implements java.io.Serializable
   }
 
   /**
+   * 
+   * 
+   * @param index
+   * @param vRnaViewer
+   * @throws java.lang.IndexOutOfBoundsException
+   *           if the index given is outside the bounds of the collection
+   */
+  public void setRnaViewer(final int index,
+          final jalview.schemabinding.version2.RnaViewer vRnaViewer)
+          throws java.lang.IndexOutOfBoundsException
+  {
+    // check bounds for index
+    if (index < 0 || index >= this._rnaViewerList.size())
+    {
+      throw new IndexOutOfBoundsException("setRnaViewer: Index value '"
+              + index + "' not in range [0.."
+              + (this._rnaViewerList.size() - 1) + "]");
+    }
+
+    this._rnaViewerList.set(index, vRnaViewer);
+  }
+
+  /**
+   * 
+   * 
+   * @param vRnaViewerArray
+   */
+  public void setRnaViewer(
+          final jalview.schemabinding.version2.RnaViewer[] vRnaViewerArray)
+  {
+    // -- copy array
+    _rnaViewerList.clear();
+
+    for (int i = 0; i < vRnaViewerArray.length; i++)
+    {
+      this._rnaViewerList.add(vRnaViewerArray[i]);
+    }
+  }
+
+  /**
    * Sets the value of field 'start'.
    * 
    * @param start
@@ -856,6 +1051,18 @@ public class JSeq implements java.io.Serializable
   }
 
   /**
+   * Sets the value of field 'viewreference'.
+   * 
+   * @param viewreference
+   *          the value of field 'viewreference'.
+   */
+  public void setViewreference(final boolean viewreference)
+  {
+    this._viewreference = viewreference;
+    this._has_viewreference = true;
+  }
+
+  /**
    * Method unmarshal.
    * 
    * @param reader