JAL-2798 added methods for getting/adding external tree viewer
[jalview.git] / src / jalview / schemabinding / version2 / JalviewModelSequence.java
1 /*
2  * This class was automatically generated with 
3  * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
4  * Schema.
5  * $Id$
6  */
7
8 package jalview.schemabinding.version2;
9
10 //---------------------------------/
11 //- Imported classes and packages -/
12 //---------------------------------/
13
14 import org.exolab.castor.xml.Marshaller;
15 import org.exolab.castor.xml.Unmarshaller;
16
17 /**
18  * Class JalviewModelSequence.
19  * 
20  * @version $Revision$ $Date$
21  */
22 public class JalviewModelSequence implements java.io.Serializable
23 {
24
25   // --------------------------/
26   // - Class/Member Variables -/
27   // --------------------------/
28
29   /**
30    * Field _JSeqList.
31    */
32   private java.util.Vector _JSeqList;
33
34   /**
35    * Field _JGroupList.
36    */
37   private java.util.Vector _JGroupList;
38
39   /**
40    * Field _viewportList.
41    */
42   private java.util.Vector _viewportList;
43
44   /**
45    * Field _userColoursList.
46    */
47   private java.util.Vector _userColoursList;
48
49   /**
50    * Field _treeList.
51    */
52   private java.util.Vector _treeList;
53
54   /**
55    * Field _featureSettings.
56    */
57   private jalview.schemabinding.version2.FeatureSettings _featureSettings;
58
59   /**
60    * List of external trees
61    */
62   private java.util.Vector<jalview.ext.treeviewer.TreeFrameI> _extTreeList;
63
64   // ----------------/
65   // - Constructors -/
66   // ----------------/
67
68   public JalviewModelSequence()
69   {
70     super();
71     this._JSeqList = new java.util.Vector();
72     this._JGroupList = new java.util.Vector();
73     this._viewportList = new java.util.Vector();
74     this._userColoursList = new java.util.Vector();
75     this._treeList = new java.util.Vector();
76     this._extTreeList = new java.util.Vector<>();
77   }
78
79   // -----------/
80   // - Methods -/
81   // -----------/
82
83   /**
84    * 
85    * 
86    * @param vJGroup
87    * @throws java.lang.IndexOutOfBoundsException
88    *           if the index given is outside the bounds of the collection
89    */
90   public void addJGroup(final jalview.schemabinding.version2.JGroup vJGroup)
91           throws java.lang.IndexOutOfBoundsException
92   {
93     this._JGroupList.addElement(vJGroup);
94   }
95
96   /**
97    * 
98    * 
99    * @param index
100    * @param vJGroup
101    * @throws java.lang.IndexOutOfBoundsException
102    *           if the index given is outside the bounds of the collection
103    */
104   public void addJGroup(final int index,
105           final jalview.schemabinding.version2.JGroup vJGroup)
106           throws java.lang.IndexOutOfBoundsException
107   {
108     this._JGroupList.add(index, vJGroup);
109   }
110
111   /**
112    * 
113    * 
114    * @param vJSeq
115    * @throws java.lang.IndexOutOfBoundsException
116    *           if the index given is outside the bounds of the collection
117    */
118   public void addJSeq(final jalview.schemabinding.version2.JSeq vJSeq)
119           throws java.lang.IndexOutOfBoundsException
120   {
121     this._JSeqList.addElement(vJSeq);
122   }
123
124   /**
125    * 
126    * 
127    * @param index
128    * @param vJSeq
129    * @throws java.lang.IndexOutOfBoundsException
130    *           if the index given is outside the bounds of the collection
131    */
132   public void addJSeq(final int index,
133           final jalview.schemabinding.version2.JSeq vJSeq)
134           throws java.lang.IndexOutOfBoundsException
135   {
136     this._JSeqList.add(index, vJSeq);
137   }
138
139   /**
140    * 
141    * 
142    * @param vTree
143    * @throws java.lang.IndexOutOfBoundsException
144    *           if the index given is outside the bounds of the collection
145    */
146   public void addTree(final jalview.schemabinding.version2.Tree vTree)
147           throws java.lang.IndexOutOfBoundsException
148   {
149     this._treeList.addElement(vTree);
150   }
151
152   /**
153    * 
154    * 
155    * @param index
156    * @param vTree
157    * @throws java.lang.IndexOutOfBoundsException
158    *           if the index given is outside the bounds of the collection
159    */
160   public void addTree(final int index,
161           final jalview.schemabinding.version2.Tree vTree)
162           throws java.lang.IndexOutOfBoundsException
163   {
164     this._treeList.add(index, vTree);
165   }
166
167   public void addExtTreeViewer(jalview.ext.treeviewer.TreeFrameI treeViewer)
168   {
169     this._extTreeList.add(treeViewer);
170   }
171
172   public void addExtTreeViewer(final int index,
173           jalview.ext.treeviewer.TreeFrameI treeViewer)
174   {
175     this._extTreeList.add(index, treeViewer);
176   }
177   /**
178    * 
179    * 
180    * @param vUserColours
181    * @throws java.lang.IndexOutOfBoundsException
182    *           if the index given is outside the bounds of the collection
183    */
184   public void addUserColours(
185           final jalview.schemabinding.version2.UserColours vUserColours)
186           throws java.lang.IndexOutOfBoundsException
187   {
188     this._userColoursList.addElement(vUserColours);
189   }
190
191   /**
192    * 
193    * 
194    * @param index
195    * @param vUserColours
196    * @throws java.lang.IndexOutOfBoundsException
197    *           if the index given is outside the bounds of the collection
198    */
199   public void addUserColours(final int index,
200           final jalview.schemabinding.version2.UserColours vUserColours)
201           throws java.lang.IndexOutOfBoundsException
202   {
203     this._userColoursList.add(index, vUserColours);
204   }
205
206   /**
207    * 
208    * 
209    * @param vViewport
210    * @throws java.lang.IndexOutOfBoundsException
211    *           if the index given is outside the bounds of the collection
212    */
213   public void addViewport(
214           final jalview.schemabinding.version2.Viewport vViewport)
215           throws java.lang.IndexOutOfBoundsException
216   {
217     this._viewportList.addElement(vViewport);
218   }
219
220   /**
221    * 
222    * 
223    * @param index
224    * @param vViewport
225    * @throws java.lang.IndexOutOfBoundsException
226    *           if the index given is outside the bounds of the collection
227    */
228   public void addViewport(final int index,
229           final jalview.schemabinding.version2.Viewport vViewport)
230           throws java.lang.IndexOutOfBoundsException
231   {
232     this._viewportList.add(index, vViewport);
233   }
234
235   /**
236    * Method enumerateJGroup.
237    * 
238    * @return an Enumeration over all jalview.schemabinding.version2.JGroup
239    *         elements
240    */
241   public java.util.Enumeration enumerateJGroup()
242   {
243     return this._JGroupList.elements();
244   }
245
246   /**
247    * Method enumerateJSeq.
248    * 
249    * @return an Enumeration over all jalview.schemabinding.version2.JSeq
250    *         elements
251    */
252   public java.util.Enumeration enumerateJSeq()
253   {
254     return this._JSeqList.elements();
255   }
256
257   /**
258    * Method enumerateTree.
259    * 
260    * @return an Enumeration over all jalview.schemabinding.version2.Tree
261    *         elements
262    */
263   public java.util.Enumeration enumerateTree()
264   {
265     return this._treeList.elements();
266   }
267
268   /**
269    * Method enumerateUserColours.
270    * 
271    * @return an Enumeration over all jalview.schemabinding.version2.UserColours
272    *         elements
273    */
274   public java.util.Enumeration enumerateUserColours()
275   {
276     return this._userColoursList.elements();
277   }
278
279   /**
280    * Method enumerateViewport.
281    * 
282    * @return an Enumeration over all jalview.schemabinding.version2.Viewport
283    *         elements
284    */
285   public java.util.Enumeration enumerateViewport()
286   {
287     return this._viewportList.elements();
288   }
289
290   /**
291    * Returns the value of field 'featureSettings'.
292    * 
293    * @return the value of field 'FeatureSettings'.
294    */
295   public jalview.schemabinding.version2.FeatureSettings getFeatureSettings()
296   {
297     return this._featureSettings;
298   }
299
300   /**
301    * Method getJGroup.
302    * 
303    * @param index
304    * @throws java.lang.IndexOutOfBoundsException
305    *           if the index given is outside the bounds of the collection
306    * @return the value of the jalview.schemabinding.version2.JGroup at the given
307    *         index
308    */
309   public jalview.schemabinding.version2.JGroup getJGroup(final int index)
310           throws java.lang.IndexOutOfBoundsException
311   {
312     // check bounds for index
313     if (index < 0 || index >= this._JGroupList.size())
314     {
315       throw new IndexOutOfBoundsException("getJGroup: Index value '"
316               + index + "' not in range [0.."
317               + (this._JGroupList.size() - 1) + "]");
318     }
319
320     return (jalview.schemabinding.version2.JGroup) _JGroupList.get(index);
321   }
322
323   /**
324    * Method getJGroup.Returns the contents of the collection in an Array.
325    * <p>
326    * Note: Just in case the collection contents are changing in another thread,
327    * we pass a 0-length Array of the correct type into the API call. This way we
328    * <i>know</i> that the Array returned is of exactly the correct length.
329    * 
330    * @return this collection as an Array
331    */
332   public jalview.schemabinding.version2.JGroup[] getJGroup()
333   {
334     jalview.schemabinding.version2.JGroup[] array = new jalview.schemabinding.version2.JGroup[0];
335     return (jalview.schemabinding.version2.JGroup[]) this._JGroupList
336             .toArray(array);
337   }
338
339   /**
340    * Method getJGroupCount.
341    * 
342    * @return the size of this collection
343    */
344   public int getJGroupCount()
345   {
346     return this._JGroupList.size();
347   }
348
349   /**
350    * Method getJSeq.
351    * 
352    * @param index
353    * @throws java.lang.IndexOutOfBoundsException
354    *           if the index given is outside the bounds of the collection
355    * @return the value of the jalview.schemabinding.version2.JSeq at the given
356    *         index
357    */
358   public jalview.schemabinding.version2.JSeq getJSeq(final int index)
359           throws java.lang.IndexOutOfBoundsException
360   {
361     // check bounds for index
362     if (index < 0 || index >= this._JSeqList.size())
363     {
364       throw new IndexOutOfBoundsException("getJSeq: Index value '" + index
365               + "' not in range [0.." + (this._JSeqList.size() - 1) + "]");
366     }
367
368     return (jalview.schemabinding.version2.JSeq) _JSeqList.get(index);
369   }
370
371   /**
372    * Method getJSeq.Returns the contents of the collection in an Array.
373    * <p>
374    * Note: Just in case the collection contents are changing in another thread,
375    * we pass a 0-length Array of the correct type into the API call. This way we
376    * <i>know</i> that the Array returned is of exactly the correct length.
377    * 
378    * @return this collection as an Array
379    */
380   public jalview.schemabinding.version2.JSeq[] getJSeq()
381   {
382     jalview.schemabinding.version2.JSeq[] array = new jalview.schemabinding.version2.JSeq[0];
383     return (jalview.schemabinding.version2.JSeq[]) this._JSeqList
384             .toArray(array);
385   }
386
387   /**
388    * Method getJSeqCount.
389    * 
390    * @return the size of this collection
391    */
392   public int getJSeqCount()
393   {
394     return this._JSeqList.size();
395   }
396
397   /**
398    * Method getTree.
399    * 
400    * @param index
401    * @throws java.lang.IndexOutOfBoundsException
402    *           if the index given is outside the bounds of the collection
403    * @return the value of the jalview.schemabinding.version2.Tree at the given
404    *         index
405    */
406   public jalview.schemabinding.version2.Tree getTree(final int index)
407           throws java.lang.IndexOutOfBoundsException
408   {
409     // check bounds for index
410     if (index < 0 || index >= this._treeList.size())
411     {
412       throw new IndexOutOfBoundsException("getTree: Index value '" + index
413               + "' not in range [0.." + (this._treeList.size() - 1) + "]");
414     }
415
416     return (jalview.schemabinding.version2.Tree) _treeList.get(index);
417   }
418
419   /**
420    * Method getTree.Returns the contents of the collection in an Array.
421    * <p>
422    * Note: Just in case the collection contents are changing in another thread,
423    * we pass a 0-length Array of the correct type into the API call. This way we
424    * <i>know</i> that the Array returned is of exactly the correct length.
425    * 
426    * @return this collection as an Array
427    */
428   public jalview.schemabinding.version2.Tree[] getTree()
429   {
430     jalview.schemabinding.version2.Tree[] array = new jalview.schemabinding.version2.Tree[0];
431     return (jalview.schemabinding.version2.Tree[]) this._treeList
432             .toArray(array);
433   }
434
435   /**
436    * Method getTreeCount.
437    * 
438    * @return the size of this collection
439    */
440   public int getTreeCount()
441   {
442     return this._treeList.size();
443   }
444
445   public jalview.ext.treeviewer.TreeFrameI getExtTreeViewer(final int index)
446           throws java.lang.IndexOutOfBoundsException
447   {
448     // check bounds for index
449     if (index < 0 || index >= this._extTreeList.size())
450     {
451       throw new IndexOutOfBoundsException("getExtTreeViewer: Index value '"
452               + index + "' not in range [0.."
453               + (this._extTreeList.size() - 1) + "]");
454     }
455
456     return _extTreeList.get(index);
457   }
458
459   public jalview.ext.treeviewer.TreeFrameI[] getExtTreeViewer()
460   {
461     jalview.ext.treeviewer.TreeFrameI[] array = new jalview.ext.treeviewer.TreeFrameI[0];
462     return this._extTreeList.toArray(array);
463   }
464
465   public int getExtTreeViewerCount()
466   {
467     return this._extTreeList.size();
468   }
469
470   /**
471    * Method getUserColours.
472    * 
473    * @param index
474    * @throws java.lang.IndexOutOfBoundsException
475    *           if the index given is outside the bounds of the collection
476    * @return the value of the jalview.schemabinding.version2.UserColours at the
477    *         given index
478    */
479   public jalview.schemabinding.version2.UserColours getUserColours(
480           final int index) throws java.lang.IndexOutOfBoundsException
481   {
482     // check bounds for index
483     if (index < 0 || index >= this._userColoursList.size())
484     {
485       throw new IndexOutOfBoundsException("getUserColours: Index value '"
486               + index + "' not in range [0.."
487               + (this._userColoursList.size() - 1) + "]");
488     }
489
490     return (jalview.schemabinding.version2.UserColours) _userColoursList
491             .get(index);
492   }
493
494   /**
495    * Method getUserColours.Returns the contents of the collection in an Array.
496    * <p>
497    * Note: Just in case the collection contents are changing in another thread,
498    * we pass a 0-length Array of the correct type into the API call. This way we
499    * <i>know</i> that the Array returned is of exactly the correct length.
500    * 
501    * @return this collection as an Array
502    */
503   public jalview.schemabinding.version2.UserColours[] getUserColours()
504   {
505     jalview.schemabinding.version2.UserColours[] array = new jalview.schemabinding.version2.UserColours[0];
506     return (jalview.schemabinding.version2.UserColours[]) this._userColoursList
507             .toArray(array);
508   }
509
510   /**
511    * Method getUserColoursCount.
512    * 
513    * @return the size of this collection
514    */
515   public int getUserColoursCount()
516   {
517     return this._userColoursList.size();
518   }
519
520   /**
521    * Method getViewport.
522    * 
523    * @param index
524    * @throws java.lang.IndexOutOfBoundsException
525    *           if the index given is outside the bounds of the collection
526    * @return the value of the jalview.schemabinding.version2.Viewport at the
527    *         given index
528    */
529   public jalview.schemabinding.version2.Viewport getViewport(final int index)
530           throws java.lang.IndexOutOfBoundsException
531   {
532     // check bounds for index
533     if (index < 0 || index >= this._viewportList.size())
534     {
535       throw new IndexOutOfBoundsException("getViewport: Index value '"
536               + index + "' not in range [0.."
537               + (this._viewportList.size() - 1) + "]");
538     }
539
540     return (jalview.schemabinding.version2.Viewport) _viewportList
541             .get(index);
542   }
543
544   /**
545    * Method getViewport.Returns the contents of the collection in an Array.
546    * <p>
547    * Note: Just in case the collection contents are changing in another thread,
548    * we pass a 0-length Array of the correct type into the API call. This way we
549    * <i>know</i> that the Array returned is of exactly the correct length.
550    * 
551    * @return this collection as an Array
552    */
553   public jalview.schemabinding.version2.Viewport[] getViewport()
554   {
555     jalview.schemabinding.version2.Viewport[] array = new jalview.schemabinding.version2.Viewport[0];
556     return (jalview.schemabinding.version2.Viewport[]) this._viewportList
557             .toArray(array);
558   }
559
560   /**
561    * Method getViewportCount.
562    * 
563    * @return the size of this collection
564    */
565   public int getViewportCount()
566   {
567     return this._viewportList.size();
568   }
569
570   /**
571    * Method isValid.
572    * 
573    * @return true if this object is valid according to the schema
574    */
575   public boolean isValid()
576   {
577     try
578     {
579       validate();
580     } catch (org.exolab.castor.xml.ValidationException vex)
581     {
582       return false;
583     }
584     return true;
585   }
586
587   /**
588    * 
589    * 
590    * @param out
591    * @throws org.exolab.castor.xml.MarshalException
592    *           if object is null or if any SAXException is thrown during
593    *           marshaling
594    * @throws org.exolab.castor.xml.ValidationException
595    *           if this object is an invalid instance according to the schema
596    */
597   public void marshal(final java.io.Writer out)
598           throws org.exolab.castor.xml.MarshalException,
599           org.exolab.castor.xml.ValidationException
600   {
601     Marshaller.marshal(this, out);
602   }
603
604   /**
605    * 
606    * 
607    * @param handler
608    * @throws java.io.IOException
609    *           if an IOException occurs during marshaling
610    * @throws org.exolab.castor.xml.ValidationException
611    *           if this object is an invalid instance according to the schema
612    * @throws org.exolab.castor.xml.MarshalException
613    *           if object is null or if any SAXException is thrown during
614    *           marshaling
615    */
616   public void marshal(final org.xml.sax.ContentHandler handler)
617           throws java.io.IOException,
618           org.exolab.castor.xml.MarshalException,
619           org.exolab.castor.xml.ValidationException
620   {
621     Marshaller.marshal(this, handler);
622   }
623
624   /**
625      */
626   public void removeAllJGroup()
627   {
628     this._JGroupList.clear();
629   }
630
631   /**
632      */
633   public void removeAllJSeq()
634   {
635     this._JSeqList.clear();
636   }
637
638   /**
639      */
640   public void removeAllTree()
641   {
642     this._treeList.clear();
643   }
644
645   /**
646      */
647   public void removeAllUserColours()
648   {
649     this._userColoursList.clear();
650   }
651
652   /**
653      */
654   public void removeAllViewport()
655   {
656     this._viewportList.clear();
657   }
658
659   /**
660    * Method removeJGroup.
661    * 
662    * @param vJGroup
663    * @return true if the object was removed from the collection.
664    */
665   public boolean removeJGroup(
666           final jalview.schemabinding.version2.JGroup vJGroup)
667   {
668     boolean removed = _JGroupList.remove(vJGroup);
669     return removed;
670   }
671
672   /**
673    * Method removeJGroupAt.
674    * 
675    * @param index
676    * @return the element removed from the collection
677    */
678   public jalview.schemabinding.version2.JGroup removeJGroupAt(
679           final int index)
680   {
681     java.lang.Object obj = this._JGroupList.remove(index);
682     return (jalview.schemabinding.version2.JGroup) obj;
683   }
684
685   /**
686    * Method removeJSeq.
687    * 
688    * @param vJSeq
689    * @return true if the object was removed from the collection.
690    */
691   public boolean removeJSeq(final jalview.schemabinding.version2.JSeq vJSeq)
692   {
693     boolean removed = _JSeqList.remove(vJSeq);
694     return removed;
695   }
696
697   /**
698    * Method removeJSeqAt.
699    * 
700    * @param index
701    * @return the element removed from the collection
702    */
703   public jalview.schemabinding.version2.JSeq removeJSeqAt(final int index)
704   {
705     java.lang.Object obj = this._JSeqList.remove(index);
706     return (jalview.schemabinding.version2.JSeq) obj;
707   }
708
709   /**
710    * Method removeTree.
711    * 
712    * @param vTree
713    * @return true if the object was removed from the collection.
714    */
715   public boolean removeTree(final jalview.schemabinding.version2.Tree vTree)
716   {
717     boolean removed = _treeList.remove(vTree);
718     return removed;
719   }
720
721   /**
722    * Method removeTreeAt.
723    * 
724    * @param index
725    * @return the element removed from the collection
726    */
727   public jalview.schemabinding.version2.Tree removeTreeAt(final int index)
728   {
729     java.lang.Object obj = this._treeList.remove(index);
730     return (jalview.schemabinding.version2.Tree) obj;
731   }
732
733   /**
734    * Method removeUserColours.
735    * 
736    * @param vUserColours
737    * @return true if the object was removed from the collection.
738    */
739   public boolean removeUserColours(
740           final jalview.schemabinding.version2.UserColours vUserColours)
741   {
742     boolean removed = _userColoursList.remove(vUserColours);
743     return removed;
744   }
745
746   /**
747    * Method removeUserColoursAt.
748    * 
749    * @param index
750    * @return the element removed from the collection
751    */
752   public jalview.schemabinding.version2.UserColours removeUserColoursAt(
753           final int index)
754   {
755     java.lang.Object obj = this._userColoursList.remove(index);
756     return (jalview.schemabinding.version2.UserColours) obj;
757   }
758
759   /**
760    * Method removeViewport.
761    * 
762    * @param vViewport
763    * @return true if the object was removed from the collection.
764    */
765   public boolean removeViewport(
766           final jalview.schemabinding.version2.Viewport vViewport)
767   {
768     boolean removed = _viewportList.remove(vViewport);
769     return removed;
770   }
771
772   /**
773    * Method removeViewportAt.
774    * 
775    * @param index
776    * @return the element removed from the collection
777    */
778   public jalview.schemabinding.version2.Viewport removeViewportAt(
779           final int index)
780   {
781     java.lang.Object obj = this._viewportList.remove(index);
782     return (jalview.schemabinding.version2.Viewport) obj;
783   }
784
785   /**
786    * Sets the value of field 'featureSettings'.
787    * 
788    * @param featureSettings
789    *          the value of field 'featureSettings'.
790    */
791   public void setFeatureSettings(
792           final jalview.schemabinding.version2.FeatureSettings featureSettings)
793   {
794     this._featureSettings = featureSettings;
795   }
796
797   /**
798    * 
799    * 
800    * @param index
801    * @param vJGroup
802    * @throws java.lang.IndexOutOfBoundsException
803    *           if the index given is outside the bounds of the collection
804    */
805   public void setJGroup(final int index,
806           final jalview.schemabinding.version2.JGroup vJGroup)
807           throws java.lang.IndexOutOfBoundsException
808   {
809     // check bounds for index
810     if (index < 0 || index >= this._JGroupList.size())
811     {
812       throw new IndexOutOfBoundsException("setJGroup: Index value '"
813               + index + "' not in range [0.."
814               + (this._JGroupList.size() - 1) + "]");
815     }
816
817     this._JGroupList.set(index, vJGroup);
818   }
819
820   /**
821    * 
822    * 
823    * @param vJGroupArray
824    */
825   public void setJGroup(
826           final jalview.schemabinding.version2.JGroup[] vJGroupArray)
827   {
828     // -- copy array
829     _JGroupList.clear();
830
831     for (int i = 0; i < vJGroupArray.length; i++)
832     {
833       this._JGroupList.add(vJGroupArray[i]);
834     }
835   }
836
837   /**
838    * 
839    * 
840    * @param index
841    * @param vJSeq
842    * @throws java.lang.IndexOutOfBoundsException
843    *           if the index given is outside the bounds of the collection
844    */
845   public void setJSeq(final int index,
846           final jalview.schemabinding.version2.JSeq vJSeq)
847           throws java.lang.IndexOutOfBoundsException
848   {
849     // check bounds for index
850     if (index < 0 || index >= this._JSeqList.size())
851     {
852       throw new IndexOutOfBoundsException("setJSeq: Index value '" + index
853               + "' not in range [0.." + (this._JSeqList.size() - 1) + "]");
854     }
855
856     this._JSeqList.set(index, vJSeq);
857   }
858
859   /**
860    * 
861    * 
862    * @param vJSeqArray
863    */
864   public void setJSeq(final jalview.schemabinding.version2.JSeq[] vJSeqArray)
865   {
866     // -- copy array
867     _JSeqList.clear();
868
869     for (int i = 0; i < vJSeqArray.length; i++)
870     {
871       this._JSeqList.add(vJSeqArray[i]);
872     }
873   }
874
875   /**
876    * 
877    * 
878    * @param index
879    * @param vTree
880    * @throws java.lang.IndexOutOfBoundsException
881    *           if the index given is outside the bounds of the collection
882    */
883   public void setTree(final int index,
884           final jalview.schemabinding.version2.Tree vTree)
885           throws java.lang.IndexOutOfBoundsException
886   {
887     // check bounds for index
888     if (index < 0 || index >= this._treeList.size())
889     {
890       throw new IndexOutOfBoundsException("setTree: Index value '" + index
891               + "' not in range [0.." + (this._treeList.size() - 1) + "]");
892     }
893
894     this._treeList.set(index, vTree);
895   }
896
897   /**
898    * 
899    * 
900    * @param vTreeArray
901    */
902   public void setTree(final jalview.schemabinding.version2.Tree[] vTreeArray)
903   {
904     // -- copy array
905     _treeList.clear();
906
907     for (int i = 0; i < vTreeArray.length; i++)
908     {
909       this._treeList.add(vTreeArray[i]);
910     }
911   }
912
913   /**
914    * 
915    * 
916    * @param index
917    * @param vUserColours
918    * @throws java.lang.IndexOutOfBoundsException
919    *           if the index given is outside the bounds of the collection
920    */
921   public void setUserColours(final int index,
922           final jalview.schemabinding.version2.UserColours vUserColours)
923           throws java.lang.IndexOutOfBoundsException
924   {
925     // check bounds for index
926     if (index < 0 || index >= this._userColoursList.size())
927     {
928       throw new IndexOutOfBoundsException("setUserColours: Index value '"
929               + index + "' not in range [0.."
930               + (this._userColoursList.size() - 1) + "]");
931     }
932
933     this._userColoursList.set(index, vUserColours);
934   }
935
936   /**
937    * 
938    * 
939    * @param vUserColoursArray
940    */
941   public void setUserColours(
942           final jalview.schemabinding.version2.UserColours[] vUserColoursArray)
943   {
944     // -- copy array
945     _userColoursList.clear();
946
947     for (int i = 0; i < vUserColoursArray.length; i++)
948     {
949       this._userColoursList.add(vUserColoursArray[i]);
950     }
951   }
952
953   /**
954    * 
955    * 
956    * @param index
957    * @param vViewport
958    * @throws java.lang.IndexOutOfBoundsException
959    *           if the index given is outside the bounds of the collection
960    */
961   public void setViewport(final int index,
962           final jalview.schemabinding.version2.Viewport vViewport)
963           throws java.lang.IndexOutOfBoundsException
964   {
965     // check bounds for index
966     if (index < 0 || index >= this._viewportList.size())
967     {
968       throw new IndexOutOfBoundsException("setViewport: Index value '"
969               + index + "' not in range [0.."
970               + (this._viewportList.size() - 1) + "]");
971     }
972
973     this._viewportList.set(index, vViewport);
974   }
975
976   /**
977    * 
978    * 
979    * @param vViewportArray
980    */
981   public void setViewport(
982           final jalview.schemabinding.version2.Viewport[] vViewportArray)
983   {
984     // -- copy array
985     _viewportList.clear();
986
987     for (int i = 0; i < vViewportArray.length; i++)
988     {
989       this._viewportList.add(vViewportArray[i]);
990     }
991   }
992
993   /**
994    * Method unmarshal.
995    * 
996    * @param reader
997    * @throws org.exolab.castor.xml.MarshalException
998    *           if object is null or if any SAXException is thrown during
999    *           marshaling
1000    * @throws org.exolab.castor.xml.ValidationException
1001    *           if this object is an invalid instance according to the schema
1002    * @return the unmarshaled jalview.schemabinding.version2.JalviewModelSequence
1003    */
1004   public static jalview.schemabinding.version2.JalviewModelSequence unmarshal(
1005           final java.io.Reader reader)
1006           throws org.exolab.castor.xml.MarshalException,
1007           org.exolab.castor.xml.ValidationException
1008   {
1009     return (jalview.schemabinding.version2.JalviewModelSequence) Unmarshaller
1010             .unmarshal(
1011                     jalview.schemabinding.version2.JalviewModelSequence.class,
1012                     reader);
1013   }
1014
1015   /**
1016    * 
1017    * 
1018    * @throws org.exolab.castor.xml.ValidationException
1019    *           if this object is an invalid instance according to the schema
1020    */
1021   public void validate() throws org.exolab.castor.xml.ValidationException
1022   {
1023     org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
1024     validator.validate(this);
1025   }
1026
1027 }