4ac40d516600f7e75865249d5528b963f48fc175
[jalview.git] / src / jalview / binding / JalviewModelSequence.java
1 /*\r
2  * This class was automatically generated with \r
3  * <a href="http://www.castor.org">Castor 0.9.6</a>, using an XML\r
4  * Schema.\r
5  * $Id$\r
6  */\r
7 \r
8 package jalview.binding;\r
9 \r
10   //---------------------------------/\r
11  //- Imported classes and packages -/\r
12 //---------------------------------/\r
13 \r
14 import java.io.IOException;\r
15 import java.io.Reader;\r
16 import java.io.Serializable;\r
17 import java.io.Writer;\r
18 import java.util.Enumeration;\r
19 import java.util.Vector;\r
20 import org.exolab.castor.xml.MarshalException;\r
21 import org.exolab.castor.xml.Marshaller;\r
22 import org.exolab.castor.xml.Unmarshaller;\r
23 import org.exolab.castor.xml.ValidationException;\r
24 import org.xml.sax.ContentHandler;\r
25 \r
26 /**\r
27  * Class JalviewModelSequence.\r
28  * \r
29  * @version $Revision$ $Date$\r
30  */\r
31 public class JalviewModelSequence implements java.io.Serializable {\r
32 \r
33 \r
34       //--------------------------/\r
35      //- Class/Member Variables -/\r
36     //--------------------------/\r
37 \r
38     /**\r
39      * Field _JSeqList\r
40      */\r
41     private java.util.Vector _JSeqList;\r
42 \r
43     /**\r
44      * Field _JGroupList\r
45      */\r
46     private java.util.Vector _JGroupList;\r
47 \r
48     /**\r
49      * Field _viewportList\r
50      */\r
51     private java.util.Vector _viewportList;\r
52 \r
53     /**\r
54      * Field _userColoursList\r
55      */\r
56     private java.util.Vector _userColoursList;\r
57 \r
58     /**\r
59      * Field _treeList\r
60      */\r
61     private java.util.Vector _treeList;\r
62 \r
63 \r
64       //----------------/\r
65      //- Constructors -/\r
66     //----------------/\r
67 \r
68     public JalviewModelSequence() {\r
69         super();\r
70         _JSeqList = new Vector();\r
71         _JGroupList = new Vector();\r
72         _viewportList = new Vector();\r
73         _userColoursList = new Vector();\r
74         _treeList = new Vector();\r
75     } //-- jalview.binding.JalviewModelSequence()\r
76 \r
77 \r
78       //-----------/\r
79      //- Methods -/\r
80     //-----------/\r
81 \r
82     /**\r
83      * Method addJGroup\r
84      * \r
85      * \r
86      * \r
87      * @param vJGroup\r
88      */\r
89     public void addJGroup(jalview.binding.JGroup vJGroup)\r
90         throws java.lang.IndexOutOfBoundsException\r
91     {\r
92         _JGroupList.addElement(vJGroup);\r
93     } //-- void addJGroup(jalview.binding.JGroup) \r
94 \r
95     /**\r
96      * Method addJGroup\r
97      * \r
98      * \r
99      * \r
100      * @param index\r
101      * @param vJGroup\r
102      */\r
103     public void addJGroup(int index, jalview.binding.JGroup vJGroup)\r
104         throws java.lang.IndexOutOfBoundsException\r
105     {\r
106         _JGroupList.insertElementAt(vJGroup, index);\r
107     } //-- void addJGroup(int, jalview.binding.JGroup) \r
108 \r
109     /**\r
110      * Method addJSeq\r
111      * \r
112      * \r
113      * \r
114      * @param vJSeq\r
115      */\r
116     public void addJSeq(jalview.binding.JSeq vJSeq)\r
117         throws java.lang.IndexOutOfBoundsException\r
118     {\r
119         _JSeqList.addElement(vJSeq);\r
120     } //-- void addJSeq(jalview.binding.JSeq) \r
121 \r
122     /**\r
123      * Method addJSeq\r
124      * \r
125      * \r
126      * \r
127      * @param index\r
128      * @param vJSeq\r
129      */\r
130     public void addJSeq(int index, jalview.binding.JSeq vJSeq)\r
131         throws java.lang.IndexOutOfBoundsException\r
132     {\r
133         _JSeqList.insertElementAt(vJSeq, index);\r
134     } //-- void addJSeq(int, jalview.binding.JSeq) \r
135 \r
136     /**\r
137      * Method addTree\r
138      * \r
139      * \r
140      * \r
141      * @param vTree\r
142      */\r
143     public void addTree(jalview.binding.Tree vTree)\r
144         throws java.lang.IndexOutOfBoundsException\r
145     {\r
146         _treeList.addElement(vTree);\r
147     } //-- void addTree(jalview.binding.Tree) \r
148 \r
149     /**\r
150      * Method addTree\r
151      * \r
152      * \r
153      * \r
154      * @param index\r
155      * @param vTree\r
156      */\r
157     public void addTree(int index, jalview.binding.Tree vTree)\r
158         throws java.lang.IndexOutOfBoundsException\r
159     {\r
160         _treeList.insertElementAt(vTree, index);\r
161     } //-- void addTree(int, jalview.binding.Tree) \r
162 \r
163     /**\r
164      * Method addUserColours\r
165      * \r
166      * \r
167      * \r
168      * @param vUserColours\r
169      */\r
170     public void addUserColours(jalview.binding.UserColours vUserColours)\r
171         throws java.lang.IndexOutOfBoundsException\r
172     {\r
173         _userColoursList.addElement(vUserColours);\r
174     } //-- void addUserColours(jalview.binding.UserColours) \r
175 \r
176     /**\r
177      * Method addUserColours\r
178      * \r
179      * \r
180      * \r
181      * @param index\r
182      * @param vUserColours\r
183      */\r
184     public void addUserColours(int index, jalview.binding.UserColours vUserColours)\r
185         throws java.lang.IndexOutOfBoundsException\r
186     {\r
187         _userColoursList.insertElementAt(vUserColours, index);\r
188     } //-- void addUserColours(int, jalview.binding.UserColours) \r
189 \r
190     /**\r
191      * Method addViewport\r
192      * \r
193      * \r
194      * \r
195      * @param vViewport\r
196      */\r
197     public void addViewport(jalview.binding.Viewport vViewport)\r
198         throws java.lang.IndexOutOfBoundsException\r
199     {\r
200         _viewportList.addElement(vViewport);\r
201     } //-- void addViewport(jalview.binding.Viewport) \r
202 \r
203     /**\r
204      * Method addViewport\r
205      * \r
206      * \r
207      * \r
208      * @param index\r
209      * @param vViewport\r
210      */\r
211     public void addViewport(int index, jalview.binding.Viewport vViewport)\r
212         throws java.lang.IndexOutOfBoundsException\r
213     {\r
214         _viewportList.insertElementAt(vViewport, index);\r
215     } //-- void addViewport(int, jalview.binding.Viewport) \r
216 \r
217     /**\r
218      * Method enumerateJGroup\r
219      * \r
220      * \r
221      * \r
222      * @return Enumeration\r
223      */\r
224     public java.util.Enumeration enumerateJGroup()\r
225     {\r
226         return _JGroupList.elements();\r
227     } //-- java.util.Enumeration enumerateJGroup() \r
228 \r
229     /**\r
230      * Method enumerateJSeq\r
231      * \r
232      * \r
233      * \r
234      * @return Enumeration\r
235      */\r
236     public java.util.Enumeration enumerateJSeq()\r
237     {\r
238         return _JSeqList.elements();\r
239     } //-- java.util.Enumeration enumerateJSeq() \r
240 \r
241     /**\r
242      * Method enumerateTree\r
243      * \r
244      * \r
245      * \r
246      * @return Enumeration\r
247      */\r
248     public java.util.Enumeration enumerateTree()\r
249     {\r
250         return _treeList.elements();\r
251     } //-- java.util.Enumeration enumerateTree() \r
252 \r
253     /**\r
254      * Method enumerateUserColours\r
255      * \r
256      * \r
257      * \r
258      * @return Enumeration\r
259      */\r
260     public java.util.Enumeration enumerateUserColours()\r
261     {\r
262         return _userColoursList.elements();\r
263     } //-- java.util.Enumeration enumerateUserColours() \r
264 \r
265     /**\r
266      * Method enumerateViewport\r
267      * \r
268      * \r
269      * \r
270      * @return Enumeration\r
271      */\r
272     public java.util.Enumeration enumerateViewport()\r
273     {\r
274         return _viewportList.elements();\r
275     } //-- java.util.Enumeration enumerateViewport() \r
276 \r
277     /**\r
278      * Method getJGroup\r
279      * \r
280      * \r
281      * \r
282      * @param index\r
283      * @return JGroup\r
284      */\r
285     public jalview.binding.JGroup getJGroup(int index)\r
286         throws java.lang.IndexOutOfBoundsException\r
287     {\r
288         //-- check bounds for index\r
289         if ((index < 0) || (index > _JGroupList.size())) {\r
290             throw new IndexOutOfBoundsException();\r
291         }\r
292         \r
293         return (jalview.binding.JGroup) _JGroupList.elementAt(index);\r
294     } //-- jalview.binding.JGroup getJGroup(int) \r
295 \r
296     /**\r
297      * Method getJGroup\r
298      * \r
299      * \r
300      * \r
301      * @return JGroup\r
302      */\r
303     public jalview.binding.JGroup[] getJGroup()\r
304     {\r
305         int size = _JGroupList.size();\r
306         jalview.binding.JGroup[] mArray = new jalview.binding.JGroup[size];\r
307         for (int index = 0; index < size; index++) {\r
308             mArray[index] = (jalview.binding.JGroup) _JGroupList.elementAt(index);\r
309         }\r
310         return mArray;\r
311     } //-- jalview.binding.JGroup[] getJGroup() \r
312 \r
313     /**\r
314      * Method getJGroupCount\r
315      * \r
316      * \r
317      * \r
318      * @return int\r
319      */\r
320     public int getJGroupCount()\r
321     {\r
322         return _JGroupList.size();\r
323     } //-- int getJGroupCount() \r
324 \r
325     /**\r
326      * Method getJSeq\r
327      * \r
328      * \r
329      * \r
330      * @param index\r
331      * @return JSeq\r
332      */\r
333     public jalview.binding.JSeq getJSeq(int index)\r
334         throws java.lang.IndexOutOfBoundsException\r
335     {\r
336         //-- check bounds for index\r
337         if ((index < 0) || (index > _JSeqList.size())) {\r
338             throw new IndexOutOfBoundsException();\r
339         }\r
340         \r
341         return (jalview.binding.JSeq) _JSeqList.elementAt(index);\r
342     } //-- jalview.binding.JSeq getJSeq(int) \r
343 \r
344     /**\r
345      * Method getJSeq\r
346      * \r
347      * \r
348      * \r
349      * @return JSeq\r
350      */\r
351     public jalview.binding.JSeq[] getJSeq()\r
352     {\r
353         int size = _JSeqList.size();\r
354         jalview.binding.JSeq[] mArray = new jalview.binding.JSeq[size];\r
355         for (int index = 0; index < size; index++) {\r
356             mArray[index] = (jalview.binding.JSeq) _JSeqList.elementAt(index);\r
357         }\r
358         return mArray;\r
359     } //-- jalview.binding.JSeq[] getJSeq() \r
360 \r
361     /**\r
362      * Method getJSeqCount\r
363      * \r
364      * \r
365      * \r
366      * @return int\r
367      */\r
368     public int getJSeqCount()\r
369     {\r
370         return _JSeqList.size();\r
371     } //-- int getJSeqCount() \r
372 \r
373     /**\r
374      * Method getTree\r
375      * \r
376      * \r
377      * \r
378      * @param index\r
379      * @return Tree\r
380      */\r
381     public jalview.binding.Tree getTree(int index)\r
382         throws java.lang.IndexOutOfBoundsException\r
383     {\r
384         //-- check bounds for index\r
385         if ((index < 0) || (index > _treeList.size())) {\r
386             throw new IndexOutOfBoundsException();\r
387         }\r
388         \r
389         return (jalview.binding.Tree) _treeList.elementAt(index);\r
390     } //-- jalview.binding.Tree getTree(int) \r
391 \r
392     /**\r
393      * Method getTree\r
394      * \r
395      * \r
396      * \r
397      * @return Tree\r
398      */\r
399     public jalview.binding.Tree[] getTree()\r
400     {\r
401         int size = _treeList.size();\r
402         jalview.binding.Tree[] mArray = new jalview.binding.Tree[size];\r
403         for (int index = 0; index < size; index++) {\r
404             mArray[index] = (jalview.binding.Tree) _treeList.elementAt(index);\r
405         }\r
406         return mArray;\r
407     } //-- jalview.binding.Tree[] getTree() \r
408 \r
409     /**\r
410      * Method getTreeCount\r
411      * \r
412      * \r
413      * \r
414      * @return int\r
415      */\r
416     public int getTreeCount()\r
417     {\r
418         return _treeList.size();\r
419     } //-- int getTreeCount() \r
420 \r
421     /**\r
422      * Method getUserColours\r
423      * \r
424      * \r
425      * \r
426      * @param index\r
427      * @return UserColours\r
428      */\r
429     public jalview.binding.UserColours getUserColours(int index)\r
430         throws java.lang.IndexOutOfBoundsException\r
431     {\r
432         //-- check bounds for index\r
433         if ((index < 0) || (index > _userColoursList.size())) {\r
434             throw new IndexOutOfBoundsException();\r
435         }\r
436         \r
437         return (jalview.binding.UserColours) _userColoursList.elementAt(index);\r
438     } //-- jalview.binding.UserColours getUserColours(int) \r
439 \r
440     /**\r
441      * Method getUserColours\r
442      * \r
443      * \r
444      * \r
445      * @return UserColours\r
446      */\r
447     public jalview.binding.UserColours[] getUserColours()\r
448     {\r
449         int size = _userColoursList.size();\r
450         jalview.binding.UserColours[] mArray = new jalview.binding.UserColours[size];\r
451         for (int index = 0; index < size; index++) {\r
452             mArray[index] = (jalview.binding.UserColours) _userColoursList.elementAt(index);\r
453         }\r
454         return mArray;\r
455     } //-- jalview.binding.UserColours[] getUserColours() \r
456 \r
457     /**\r
458      * Method getUserColoursCount\r
459      * \r
460      * \r
461      * \r
462      * @return int\r
463      */\r
464     public int getUserColoursCount()\r
465     {\r
466         return _userColoursList.size();\r
467     } //-- int getUserColoursCount() \r
468 \r
469     /**\r
470      * Method getViewport\r
471      * \r
472      * \r
473      * \r
474      * @param index\r
475      * @return Viewport\r
476      */\r
477     public jalview.binding.Viewport getViewport(int index)\r
478         throws java.lang.IndexOutOfBoundsException\r
479     {\r
480         //-- check bounds for index\r
481         if ((index < 0) || (index > _viewportList.size())) {\r
482             throw new IndexOutOfBoundsException();\r
483         }\r
484         \r
485         return (jalview.binding.Viewport) _viewportList.elementAt(index);\r
486     } //-- jalview.binding.Viewport getViewport(int) \r
487 \r
488     /**\r
489      * Method getViewport\r
490      * \r
491      * \r
492      * \r
493      * @return Viewport\r
494      */\r
495     public jalview.binding.Viewport[] getViewport()\r
496     {\r
497         int size = _viewportList.size();\r
498         jalview.binding.Viewport[] mArray = new jalview.binding.Viewport[size];\r
499         for (int index = 0; index < size; index++) {\r
500             mArray[index] = (jalview.binding.Viewport) _viewportList.elementAt(index);\r
501         }\r
502         return mArray;\r
503     } //-- jalview.binding.Viewport[] getViewport() \r
504 \r
505     /**\r
506      * Method getViewportCount\r
507      * \r
508      * \r
509      * \r
510      * @return int\r
511      */\r
512     public int getViewportCount()\r
513     {\r
514         return _viewportList.size();\r
515     } //-- int getViewportCount() \r
516 \r
517     /**\r
518      * Method isValid\r
519      * \r
520      * \r
521      * \r
522      * @return boolean\r
523      */\r
524     public boolean isValid()\r
525     {\r
526         try {\r
527             validate();\r
528         }\r
529         catch (org.exolab.castor.xml.ValidationException vex) {\r
530             return false;\r
531         }\r
532         return true;\r
533     } //-- boolean isValid() \r
534 \r
535     /**\r
536      * Method marshal\r
537      * \r
538      * \r
539      * \r
540      * @param out\r
541      */\r
542     public void marshal(java.io.Writer out)\r
543         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException\r
544     {\r
545         \r
546         Marshaller.marshal(this, out);\r
547     } //-- void marshal(java.io.Writer) \r
548 \r
549     /**\r
550      * Method marshal\r
551      * \r
552      * \r
553      * \r
554      * @param handler\r
555      */\r
556     public void marshal(org.xml.sax.ContentHandler handler)\r
557         throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException\r
558     {\r
559         \r
560         Marshaller.marshal(this, handler);\r
561     } //-- void marshal(org.xml.sax.ContentHandler) \r
562 \r
563     /**\r
564      * Method removeAllJGroup\r
565      * \r
566      */\r
567     public void removeAllJGroup()\r
568     {\r
569         _JGroupList.removeAllElements();\r
570     } //-- void removeAllJGroup() \r
571 \r
572     /**\r
573      * Method removeAllJSeq\r
574      * \r
575      */\r
576     public void removeAllJSeq()\r
577     {\r
578         _JSeqList.removeAllElements();\r
579     } //-- void removeAllJSeq() \r
580 \r
581     /**\r
582      * Method removeAllTree\r
583      * \r
584      */\r
585     public void removeAllTree()\r
586     {\r
587         _treeList.removeAllElements();\r
588     } //-- void removeAllTree() \r
589 \r
590     /**\r
591      * Method removeAllUserColours\r
592      * \r
593      */\r
594     public void removeAllUserColours()\r
595     {\r
596         _userColoursList.removeAllElements();\r
597     } //-- void removeAllUserColours() \r
598 \r
599     /**\r
600      * Method removeAllViewport\r
601      * \r
602      */\r
603     public void removeAllViewport()\r
604     {\r
605         _viewportList.removeAllElements();\r
606     } //-- void removeAllViewport() \r
607 \r
608     /**\r
609      * Method removeJGroup\r
610      * \r
611      * \r
612      * \r
613      * @param index\r
614      * @return JGroup\r
615      */\r
616     public jalview.binding.JGroup removeJGroup(int index)\r
617     {\r
618         java.lang.Object obj = _JGroupList.elementAt(index);\r
619         _JGroupList.removeElementAt(index);\r
620         return (jalview.binding.JGroup) obj;\r
621     } //-- jalview.binding.JGroup removeJGroup(int) \r
622 \r
623     /**\r
624      * Method removeJSeq\r
625      * \r
626      * \r
627      * \r
628      * @param index\r
629      * @return JSeq\r
630      */\r
631     public jalview.binding.JSeq removeJSeq(int index)\r
632     {\r
633         java.lang.Object obj = _JSeqList.elementAt(index);\r
634         _JSeqList.removeElementAt(index);\r
635         return (jalview.binding.JSeq) obj;\r
636     } //-- jalview.binding.JSeq removeJSeq(int) \r
637 \r
638     /**\r
639      * Method removeTree\r
640      * \r
641      * \r
642      * \r
643      * @param index\r
644      * @return Tree\r
645      */\r
646     public jalview.binding.Tree removeTree(int index)\r
647     {\r
648         java.lang.Object obj = _treeList.elementAt(index);\r
649         _treeList.removeElementAt(index);\r
650         return (jalview.binding.Tree) obj;\r
651     } //-- jalview.binding.Tree removeTree(int) \r
652 \r
653     /**\r
654      * Method removeUserColours\r
655      * \r
656      * \r
657      * \r
658      * @param index\r
659      * @return UserColours\r
660      */\r
661     public jalview.binding.UserColours removeUserColours(int index)\r
662     {\r
663         java.lang.Object obj = _userColoursList.elementAt(index);\r
664         _userColoursList.removeElementAt(index);\r
665         return (jalview.binding.UserColours) obj;\r
666     } //-- jalview.binding.UserColours removeUserColours(int) \r
667 \r
668     /**\r
669      * Method removeViewport\r
670      * \r
671      * \r
672      * \r
673      * @param index\r
674      * @return Viewport\r
675      */\r
676     public jalview.binding.Viewport removeViewport(int index)\r
677     {\r
678         java.lang.Object obj = _viewportList.elementAt(index);\r
679         _viewportList.removeElementAt(index);\r
680         return (jalview.binding.Viewport) obj;\r
681     } //-- jalview.binding.Viewport removeViewport(int) \r
682 \r
683     /**\r
684      * Method setJGroup\r
685      * \r
686      * \r
687      * \r
688      * @param index\r
689      * @param vJGroup\r
690      */\r
691     public void setJGroup(int index, jalview.binding.JGroup vJGroup)\r
692         throws java.lang.IndexOutOfBoundsException\r
693     {\r
694         //-- check bounds for index\r
695         if ((index < 0) || (index > _JGroupList.size())) {\r
696             throw new IndexOutOfBoundsException();\r
697         }\r
698         _JGroupList.setElementAt(vJGroup, index);\r
699     } //-- void setJGroup(int, jalview.binding.JGroup) \r
700 \r
701     /**\r
702      * Method setJGroup\r
703      * \r
704      * \r
705      * \r
706      * @param JGroupArray\r
707      */\r
708     public void setJGroup(jalview.binding.JGroup[] JGroupArray)\r
709     {\r
710         //-- copy array\r
711         _JGroupList.removeAllElements();\r
712         for (int i = 0; i < JGroupArray.length; i++) {\r
713             _JGroupList.addElement(JGroupArray[i]);\r
714         }\r
715     } //-- void setJGroup(jalview.binding.JGroup) \r
716 \r
717     /**\r
718      * Method setJSeq\r
719      * \r
720      * \r
721      * \r
722      * @param index\r
723      * @param vJSeq\r
724      */\r
725     public void setJSeq(int index, jalview.binding.JSeq vJSeq)\r
726         throws java.lang.IndexOutOfBoundsException\r
727     {\r
728         //-- check bounds for index\r
729         if ((index < 0) || (index > _JSeqList.size())) {\r
730             throw new IndexOutOfBoundsException();\r
731         }\r
732         _JSeqList.setElementAt(vJSeq, index);\r
733     } //-- void setJSeq(int, jalview.binding.JSeq) \r
734 \r
735     /**\r
736      * Method setJSeq\r
737      * \r
738      * \r
739      * \r
740      * @param JSeqArray\r
741      */\r
742     public void setJSeq(jalview.binding.JSeq[] JSeqArray)\r
743     {\r
744         //-- copy array\r
745         _JSeqList.removeAllElements();\r
746         for (int i = 0; i < JSeqArray.length; i++) {\r
747             _JSeqList.addElement(JSeqArray[i]);\r
748         }\r
749     } //-- void setJSeq(jalview.binding.JSeq) \r
750 \r
751     /**\r
752      * Method setTree\r
753      * \r
754      * \r
755      * \r
756      * @param index\r
757      * @param vTree\r
758      */\r
759     public void setTree(int index, jalview.binding.Tree vTree)\r
760         throws java.lang.IndexOutOfBoundsException\r
761     {\r
762         //-- check bounds for index\r
763         if ((index < 0) || (index > _treeList.size())) {\r
764             throw new IndexOutOfBoundsException();\r
765         }\r
766         _treeList.setElementAt(vTree, index);\r
767     } //-- void setTree(int, jalview.binding.Tree) \r
768 \r
769     /**\r
770      * Method setTree\r
771      * \r
772      * \r
773      * \r
774      * @param treeArray\r
775      */\r
776     public void setTree(jalview.binding.Tree[] treeArray)\r
777     {\r
778         //-- copy array\r
779         _treeList.removeAllElements();\r
780         for (int i = 0; i < treeArray.length; i++) {\r
781             _treeList.addElement(treeArray[i]);\r
782         }\r
783     } //-- void setTree(jalview.binding.Tree) \r
784 \r
785     /**\r
786      * Method setUserColours\r
787      * \r
788      * \r
789      * \r
790      * @param index\r
791      * @param vUserColours\r
792      */\r
793     public void setUserColours(int index, jalview.binding.UserColours vUserColours)\r
794         throws java.lang.IndexOutOfBoundsException\r
795     {\r
796         //-- check bounds for index\r
797         if ((index < 0) || (index > _userColoursList.size())) {\r
798             throw new IndexOutOfBoundsException();\r
799         }\r
800         _userColoursList.setElementAt(vUserColours, index);\r
801     } //-- void setUserColours(int, jalview.binding.UserColours) \r
802 \r
803     /**\r
804      * Method setUserColours\r
805      * \r
806      * \r
807      * \r
808      * @param userColoursArray\r
809      */\r
810     public void setUserColours(jalview.binding.UserColours[] userColoursArray)\r
811     {\r
812         //-- copy array\r
813         _userColoursList.removeAllElements();\r
814         for (int i = 0; i < userColoursArray.length; i++) {\r
815             _userColoursList.addElement(userColoursArray[i]);\r
816         }\r
817     } //-- void setUserColours(jalview.binding.UserColours) \r
818 \r
819     /**\r
820      * Method setViewport\r
821      * \r
822      * \r
823      * \r
824      * @param index\r
825      * @param vViewport\r
826      */\r
827     public void setViewport(int index, jalview.binding.Viewport vViewport)\r
828         throws java.lang.IndexOutOfBoundsException\r
829     {\r
830         //-- check bounds for index\r
831         if ((index < 0) || (index > _viewportList.size())) {\r
832             throw new IndexOutOfBoundsException();\r
833         }\r
834         _viewportList.setElementAt(vViewport, index);\r
835     } //-- void setViewport(int, jalview.binding.Viewport) \r
836 \r
837     /**\r
838      * Method setViewport\r
839      * \r
840      * \r
841      * \r
842      * @param viewportArray\r
843      */\r
844     public void setViewport(jalview.binding.Viewport[] viewportArray)\r
845     {\r
846         //-- copy array\r
847         _viewportList.removeAllElements();\r
848         for (int i = 0; i < viewportArray.length; i++) {\r
849             _viewportList.addElement(viewportArray[i]);\r
850         }\r
851     } //-- void setViewport(jalview.binding.Viewport) \r
852 \r
853     /**\r
854      * Method unmarshal\r
855      * \r
856      * \r
857      * \r
858      * @param reader\r
859      * @return Object\r
860      */\r
861     public static java.lang.Object unmarshal(java.io.Reader reader)\r
862         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException\r
863     {\r
864         return (jalview.binding.JalviewModelSequence) Unmarshaller.unmarshal(jalview.binding.JalviewModelSequence.class, reader);\r
865     } //-- java.lang.Object unmarshal(java.io.Reader) \r
866 \r
867     /**\r
868      * Method validate\r
869      * \r
870      */\r
871     public void validate()\r
872         throws org.exolab.castor.xml.ValidationException\r
873     {\r
874         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();\r
875         validator.validate(this);\r
876     } //-- void validate() \r
877 \r
878 }\r