JAL-892 schema changes (rnaViewer) for save Varna to project
[jalview.git] / src / jalview / schemabinding / version2 / RnaViewer.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  * Reference to a viewer showing RNA structure
19  *  for this sequence. Schema supports one viewer showing multiple
20  *  annotations for multiple sequences, though currently only one
21  *  annotation for one sequence (gapped or trimmed) is used
22  *  
23  * 
24  * @version $Revision$ $Date$
25  */
26 public class RnaViewer implements java.io.Serializable {
27
28
29       //--------------------------/
30      //- Class/Member Variables -/
31     //--------------------------/
32
33     /**
34      * Field _title.
35      */
36     private java.lang.String _title;
37
38     /**
39      * An id unique to the RNA viewer panel
40      *  
41      */
42     private java.lang.String _viewId;
43
44     /**
45      * horizontal position of split pane divider
46      *  
47      */
48     private int _dividerLocation;
49
50     /**
51      * keeps track of state for field: _dividerLocation
52      */
53     private boolean _has_dividerLocation;
54
55     /**
56      * Index of the selected structure in the
57      *  viewer panel
58      *  
59      */
60     private int _selectedRna;
61
62     /**
63      * keeps track of state for field: _selectedRna
64      */
65     private boolean _has_selectedRna;
66
67     /**
68      * Field _width.
69      */
70     private int _width;
71
72     /**
73      * keeps track of state for field: _width
74      */
75     private boolean _has_width;
76
77     /**
78      * Field _height.
79      */
80     private int _height;
81
82     /**
83      * keeps track of state for field: _height
84      */
85     private boolean _has_height;
86
87     /**
88      * Field _xpos.
89      */
90     private int _xpos;
91
92     /**
93      * keeps track of state for field: _xpos
94      */
95     private boolean _has_xpos;
96
97     /**
98      * Field _ypos.
99      */
100     private int _ypos;
101
102     /**
103      * keeps track of state for field: _ypos
104      */
105     private boolean _has_ypos;
106
107     /**
108      * Field _secondaryStructureList.
109      */
110     private java.util.Vector _secondaryStructureList;
111
112
113       //----------------/
114      //- Constructors -/
115     //----------------/
116
117     public RnaViewer() {
118         super();
119         this._secondaryStructureList = new java.util.Vector();
120     }
121
122
123       //-----------/
124      //- Methods -/
125     //-----------/
126
127     /**
128      * 
129      * 
130      * @param vSecondaryStructure
131      * @throws java.lang.IndexOutOfBoundsException if the index
132      * given is outside the bounds of the collection
133      */
134     public void addSecondaryStructure(
135             final jalview.schemabinding.version2.SecondaryStructure vSecondaryStructure)
136     throws java.lang.IndexOutOfBoundsException {
137         this._secondaryStructureList.addElement(vSecondaryStructure);
138     }
139
140     /**
141      * 
142      * 
143      * @param index
144      * @param vSecondaryStructure
145      * @throws java.lang.IndexOutOfBoundsException if the index
146      * given is outside the bounds of the collection
147      */
148     public void addSecondaryStructure(
149             final int index,
150             final jalview.schemabinding.version2.SecondaryStructure vSecondaryStructure)
151     throws java.lang.IndexOutOfBoundsException {
152         this._secondaryStructureList.add(index, vSecondaryStructure);
153     }
154
155     /**
156      */
157     public void deleteDividerLocation(
158     ) {
159         this._has_dividerLocation= false;
160     }
161
162     /**
163      */
164     public void deleteHeight(
165     ) {
166         this._has_height= false;
167     }
168
169     /**
170      */
171     public void deleteSelectedRna(
172     ) {
173         this._has_selectedRna= false;
174     }
175
176     /**
177      */
178     public void deleteWidth(
179     ) {
180         this._has_width= false;
181     }
182
183     /**
184      */
185     public void deleteXpos(
186     ) {
187         this._has_xpos= false;
188     }
189
190     /**
191      */
192     public void deleteYpos(
193     ) {
194         this._has_ypos= false;
195     }
196
197     /**
198      * Method enumerateSecondaryStructure.
199      * 
200      * @return an Enumeration over all
201      * jalview.schemabinding.version2.SecondaryStructure elements
202      */
203     public java.util.Enumeration enumerateSecondaryStructure(
204     ) {
205         return this._secondaryStructureList.elements();
206     }
207
208     /**
209      * Returns the value of field 'dividerLocation'. The field
210      * 'dividerLocation' has the following description: horizontal
211      * position of split pane divider
212      *  
213      * 
214      * @return the value of field 'DividerLocation'.
215      */
216     public int getDividerLocation(
217     ) {
218         return this._dividerLocation;
219     }
220
221     /**
222      * Returns the value of field 'height'.
223      * 
224      * @return the value of field 'Height'.
225      */
226     public int getHeight(
227     ) {
228         return this._height;
229     }
230
231     /**
232      * Method getSecondaryStructure.
233      * 
234      * @param index
235      * @throws java.lang.IndexOutOfBoundsException if the index
236      * given is outside the bounds of the collection
237      * @return the value of the
238      * jalview.schemabinding.version2.SecondaryStructure at the
239      * given index
240      */
241     public jalview.schemabinding.version2.SecondaryStructure getSecondaryStructure(
242             final int index)
243     throws java.lang.IndexOutOfBoundsException {
244         // check bounds for index
245         if (index < 0 || index >= this._secondaryStructureList.size()) {
246             throw new IndexOutOfBoundsException("getSecondaryStructure: Index value '" + index + "' not in range [0.." + (this._secondaryStructureList.size() - 1) + "]");
247         }
248         
249         return (jalview.schemabinding.version2.SecondaryStructure) _secondaryStructureList.get(index);
250     }
251
252     /**
253      * Method getSecondaryStructure.Returns the contents of the
254      * collection in an Array.  <p>Note:  Just in case the
255      * collection contents are changing in another thread, we pass
256      * a 0-length Array of the correct type into the API call. 
257      * This way we <i>know</i> that the Array returned is of
258      * exactly the correct length.
259      * 
260      * @return this collection as an Array
261      */
262     public jalview.schemabinding.version2.SecondaryStructure[] getSecondaryStructure(
263     ) {
264         jalview.schemabinding.version2.SecondaryStructure[] array = new jalview.schemabinding.version2.SecondaryStructure[0];
265         return (jalview.schemabinding.version2.SecondaryStructure[]) this._secondaryStructureList.toArray(array);
266     }
267
268     /**
269      * Method getSecondaryStructureCount.
270      * 
271      * @return the size of this collection
272      */
273     public int getSecondaryStructureCount(
274     ) {
275         return this._secondaryStructureList.size();
276     }
277
278     /**
279      * Returns the value of field 'selectedRna'. The field
280      * 'selectedRna' has the following description: Index of the
281      * selected structure in the
282      *  viewer panel
283      *  
284      * 
285      * @return the value of field 'SelectedRna'.
286      */
287     public int getSelectedRna(
288     ) {
289         return this._selectedRna;
290     }
291
292     /**
293      * Returns the value of field 'title'.
294      * 
295      * @return the value of field 'Title'.
296      */
297     public java.lang.String getTitle(
298     ) {
299         return this._title;
300     }
301
302     /**
303      * Returns the value of field 'viewId'. The field 'viewId' has
304      * the following description: An id unique to the RNA viewer
305      * panel
306      *  
307      * 
308      * @return the value of field 'ViewId'.
309      */
310     public java.lang.String getViewId(
311     ) {
312         return this._viewId;
313     }
314
315     /**
316      * Returns the value of field 'width'.
317      * 
318      * @return the value of field 'Width'.
319      */
320     public int getWidth(
321     ) {
322         return this._width;
323     }
324
325     /**
326      * Returns the value of field 'xpos'.
327      * 
328      * @return the value of field 'Xpos'.
329      */
330     public int getXpos(
331     ) {
332         return this._xpos;
333     }
334
335     /**
336      * Returns the value of field 'ypos'.
337      * 
338      * @return the value of field 'Ypos'.
339      */
340     public int getYpos(
341     ) {
342         return this._ypos;
343     }
344
345     /**
346      * Method hasDividerLocation.
347      * 
348      * @return true if at least one DividerLocation has been added
349      */
350     public boolean hasDividerLocation(
351     ) {
352         return this._has_dividerLocation;
353     }
354
355     /**
356      * Method hasHeight.
357      * 
358      * @return true if at least one Height has been added
359      */
360     public boolean hasHeight(
361     ) {
362         return this._has_height;
363     }
364
365     /**
366      * Method hasSelectedRna.
367      * 
368      * @return true if at least one SelectedRna has been added
369      */
370     public boolean hasSelectedRna(
371     ) {
372         return this._has_selectedRna;
373     }
374
375     /**
376      * Method hasWidth.
377      * 
378      * @return true if at least one Width has been added
379      */
380     public boolean hasWidth(
381     ) {
382         return this._has_width;
383     }
384
385     /**
386      * Method hasXpos.
387      * 
388      * @return true if at least one Xpos has been added
389      */
390     public boolean hasXpos(
391     ) {
392         return this._has_xpos;
393     }
394
395     /**
396      * Method hasYpos.
397      * 
398      * @return true if at least one Ypos has been added
399      */
400     public boolean hasYpos(
401     ) {
402         return this._has_ypos;
403     }
404
405     /**
406      * Method isValid.
407      * 
408      * @return true if this object is valid according to the schema
409      */
410     public boolean isValid(
411     ) {
412         try {
413             validate();
414         } catch (org.exolab.castor.xml.ValidationException vex) {
415             return false;
416         }
417         return true;
418     }
419
420     /**
421      * 
422      * 
423      * @param out
424      * @throws org.exolab.castor.xml.MarshalException if object is
425      * null or if any SAXException is thrown during marshaling
426      * @throws org.exolab.castor.xml.ValidationException if this
427      * object is an invalid instance according to the schema
428      */
429     public void marshal(
430             final java.io.Writer out)
431     throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
432         Marshaller.marshal(this, out);
433     }
434
435     /**
436      * 
437      * 
438      * @param handler
439      * @throws java.io.IOException if an IOException occurs during
440      * marshaling
441      * @throws org.exolab.castor.xml.ValidationException if this
442      * object is an invalid instance according to the schema
443      * @throws org.exolab.castor.xml.MarshalException if object is
444      * null or if any SAXException is thrown during marshaling
445      */
446     public void marshal(
447             final org.xml.sax.ContentHandler handler)
448     throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
449         Marshaller.marshal(this, handler);
450     }
451
452     /**
453      */
454     public void removeAllSecondaryStructure(
455     ) {
456         this._secondaryStructureList.clear();
457     }
458
459     /**
460      * Method removeSecondaryStructure.
461      * 
462      * @param vSecondaryStructure
463      * @return true if the object was removed from the collection.
464      */
465     public boolean removeSecondaryStructure(
466             final jalview.schemabinding.version2.SecondaryStructure vSecondaryStructure) {
467         boolean removed = _secondaryStructureList.remove(vSecondaryStructure);
468         return removed;
469     }
470
471     /**
472      * Method removeSecondaryStructureAt.
473      * 
474      * @param index
475      * @return the element removed from the collection
476      */
477     public jalview.schemabinding.version2.SecondaryStructure removeSecondaryStructureAt(
478             final int index) {
479         java.lang.Object obj = this._secondaryStructureList.remove(index);
480         return (jalview.schemabinding.version2.SecondaryStructure) obj;
481     }
482
483     /**
484      * Sets the value of field 'dividerLocation'. The field
485      * 'dividerLocation' has the following description: horizontal
486      * position of split pane divider
487      *  
488      * 
489      * @param dividerLocation the value of field 'dividerLocation'.
490      */
491     public void setDividerLocation(
492             final int dividerLocation) {
493         this._dividerLocation = dividerLocation;
494         this._has_dividerLocation = true;
495     }
496
497     /**
498      * Sets the value of field 'height'.
499      * 
500      * @param height the value of field 'height'.
501      */
502     public void setHeight(
503             final int height) {
504         this._height = height;
505         this._has_height = true;
506     }
507
508     /**
509      * 
510      * 
511      * @param index
512      * @param vSecondaryStructure
513      * @throws java.lang.IndexOutOfBoundsException if the index
514      * given is outside the bounds of the collection
515      */
516     public void setSecondaryStructure(
517             final int index,
518             final jalview.schemabinding.version2.SecondaryStructure vSecondaryStructure)
519     throws java.lang.IndexOutOfBoundsException {
520         // check bounds for index
521         if (index < 0 || index >= this._secondaryStructureList.size()) {
522             throw new IndexOutOfBoundsException("setSecondaryStructure: Index value '" + index + "' not in range [0.." + (this._secondaryStructureList.size() - 1) + "]");
523         }
524         
525         this._secondaryStructureList.set(index, vSecondaryStructure);
526     }
527
528     /**
529      * 
530      * 
531      * @param vSecondaryStructureArray
532      */
533     public void setSecondaryStructure(
534             final jalview.schemabinding.version2.SecondaryStructure[] vSecondaryStructureArray) {
535         //-- copy array
536         _secondaryStructureList.clear();
537         
538         for (int i = 0; i < vSecondaryStructureArray.length; i++) {
539                 this._secondaryStructureList.add(vSecondaryStructureArray[i]);
540         }
541     }
542
543     /**
544      * Sets the value of field 'selectedRna'. The field
545      * 'selectedRna' has the following description: Index of the
546      * selected structure in the
547      *  viewer panel
548      *  
549      * 
550      * @param selectedRna the value of field 'selectedRna'.
551      */
552     public void setSelectedRna(
553             final int selectedRna) {
554         this._selectedRna = selectedRna;
555         this._has_selectedRna = true;
556     }
557
558     /**
559      * Sets the value of field 'title'.
560      * 
561      * @param title the value of field 'title'.
562      */
563     public void setTitle(
564             final java.lang.String title) {
565         this._title = title;
566     }
567
568     /**
569      * Sets the value of field 'viewId'. The field 'viewId' has the
570      * following description: An id unique to the RNA viewer panel
571      *  
572      * 
573      * @param viewId the value of field 'viewId'.
574      */
575     public void setViewId(
576             final java.lang.String viewId) {
577         this._viewId = viewId;
578     }
579
580     /**
581      * Sets the value of field 'width'.
582      * 
583      * @param width the value of field 'width'.
584      */
585     public void setWidth(
586             final int width) {
587         this._width = width;
588         this._has_width = true;
589     }
590
591     /**
592      * Sets the value of field 'xpos'.
593      * 
594      * @param xpos the value of field 'xpos'.
595      */
596     public void setXpos(
597             final int xpos) {
598         this._xpos = xpos;
599         this._has_xpos = true;
600     }
601
602     /**
603      * Sets the value of field 'ypos'.
604      * 
605      * @param ypos the value of field 'ypos'.
606      */
607     public void setYpos(
608             final int ypos) {
609         this._ypos = ypos;
610         this._has_ypos = true;
611     }
612
613     /**
614      * Method unmarshal.
615      * 
616      * @param reader
617      * @throws org.exolab.castor.xml.MarshalException if object is
618      * null or if any SAXException is thrown during marshaling
619      * @throws org.exolab.castor.xml.ValidationException if this
620      * object is an invalid instance according to the schema
621      * @return the unmarshaled
622      * jalview.schemabinding.version2.RnaViewer
623      */
624     public static jalview.schemabinding.version2.RnaViewer unmarshal(
625             final java.io.Reader reader)
626     throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
627         return (jalview.schemabinding.version2.RnaViewer) Unmarshaller.unmarshal(jalview.schemabinding.version2.RnaViewer.class, reader);
628     }
629
630     /**
631      * 
632      * 
633      * @throws org.exolab.castor.xml.ValidationException if this
634      * object is an invalid instance according to the schema
635      */
636     public void validate(
637     )
638     throws org.exolab.castor.xml.ValidationException {
639         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
640         validator.validate(this);
641     }
642
643 }