2 * This class was automatically generated with
3 * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
8 package jalview.schemabinding.version2;
10 //---------------------------------/
11 //- Imported classes and packages -/
12 //---------------------------------/
14 import org.exolab.castor.xml.Marshaller;
15 import org.exolab.castor.xml.Unmarshaller;
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
24 * @version $Revision$ $Date$
26 public class RnaViewer implements java.io.Serializable {
29 //--------------------------/
30 //- Class/Member Variables -/
31 //--------------------------/
36 private java.lang.String _title;
39 * An id unique to the RNA viewer panel
42 private java.lang.String _viewId;
45 * horizontal position of split pane divider
48 private int _dividerLocation;
51 * keeps track of state for field: _dividerLocation
53 private boolean _has_dividerLocation;
56 * Index of the selected structure in the
60 private int _selectedRna;
63 * keeps track of state for field: _selectedRna
65 private boolean _has_selectedRna;
73 * keeps track of state for field: _width
75 private boolean _has_width;
83 * keeps track of state for field: _height
85 private boolean _has_height;
93 * keeps track of state for field: _xpos
95 private boolean _has_xpos;
103 * keeps track of state for field: _ypos
105 private boolean _has_ypos;
108 * Field _secondaryStructureList.
110 private java.util.Vector _secondaryStructureList;
119 this._secondaryStructureList = new java.util.Vector();
130 * @param vSecondaryStructure
131 * @throws java.lang.IndexOutOfBoundsException if the index
132 * given is outside the bounds of the collection
134 public void addSecondaryStructure(
135 final jalview.schemabinding.version2.SecondaryStructure vSecondaryStructure)
136 throws java.lang.IndexOutOfBoundsException {
137 this._secondaryStructureList.addElement(vSecondaryStructure);
144 * @param vSecondaryStructure
145 * @throws java.lang.IndexOutOfBoundsException if the index
146 * given is outside the bounds of the collection
148 public void addSecondaryStructure(
150 final jalview.schemabinding.version2.SecondaryStructure vSecondaryStructure)
151 throws java.lang.IndexOutOfBoundsException {
152 this._secondaryStructureList.add(index, vSecondaryStructure);
157 public void deleteDividerLocation(
159 this._has_dividerLocation= false;
164 public void deleteHeight(
166 this._has_height= false;
171 public void deleteSelectedRna(
173 this._has_selectedRna= false;
178 public void deleteWidth(
180 this._has_width= false;
185 public void deleteXpos(
187 this._has_xpos= false;
192 public void deleteYpos(
194 this._has_ypos= false;
198 * Method enumerateSecondaryStructure.
200 * @return an Enumeration over all
201 * jalview.schemabinding.version2.SecondaryStructure elements
203 public java.util.Enumeration enumerateSecondaryStructure(
205 return this._secondaryStructureList.elements();
209 * Returns the value of field 'dividerLocation'. The field
210 * 'dividerLocation' has the following description: horizontal
211 * position of split pane divider
214 * @return the value of field 'DividerLocation'.
216 public int getDividerLocation(
218 return this._dividerLocation;
222 * Returns the value of field 'height'.
224 * @return the value of field 'Height'.
226 public int getHeight(
232 * Method getSecondaryStructure.
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
241 public jalview.schemabinding.version2.SecondaryStructure getSecondaryStructure(
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) + "]");
249 return (jalview.schemabinding.version2.SecondaryStructure) _secondaryStructureList.get(index);
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.
260 * @return this collection as an Array
262 public jalview.schemabinding.version2.SecondaryStructure[] getSecondaryStructure(
264 jalview.schemabinding.version2.SecondaryStructure[] array = new jalview.schemabinding.version2.SecondaryStructure[0];
265 return (jalview.schemabinding.version2.SecondaryStructure[]) this._secondaryStructureList.toArray(array);
269 * Method getSecondaryStructureCount.
271 * @return the size of this collection
273 public int getSecondaryStructureCount(
275 return this._secondaryStructureList.size();
279 * Returns the value of field 'selectedRna'. The field
280 * 'selectedRna' has the following description: Index of the
281 * selected structure in the
285 * @return the value of field 'SelectedRna'.
287 public int getSelectedRna(
289 return this._selectedRna;
293 * Returns the value of field 'title'.
295 * @return the value of field 'Title'.
297 public java.lang.String getTitle(
303 * Returns the value of field 'viewId'. The field 'viewId' has
304 * the following description: An id unique to the RNA viewer
308 * @return the value of field 'ViewId'.
310 public java.lang.String getViewId(
316 * Returns the value of field 'width'.
318 * @return the value of field 'Width'.
326 * Returns the value of field 'xpos'.
328 * @return the value of field 'Xpos'.
336 * Returns the value of field 'ypos'.
338 * @return the value of field 'Ypos'.
346 * Method hasDividerLocation.
348 * @return true if at least one DividerLocation has been added
350 public boolean hasDividerLocation(
352 return this._has_dividerLocation;
358 * @return true if at least one Height has been added
360 public boolean hasHeight(
362 return this._has_height;
366 * Method hasSelectedRna.
368 * @return true if at least one SelectedRna has been added
370 public boolean hasSelectedRna(
372 return this._has_selectedRna;
378 * @return true if at least one Width has been added
380 public boolean hasWidth(
382 return this._has_width;
388 * @return true if at least one Xpos has been added
390 public boolean hasXpos(
392 return this._has_xpos;
398 * @return true if at least one Ypos has been added
400 public boolean hasYpos(
402 return this._has_ypos;
408 * @return true if this object is valid according to the schema
410 public boolean isValid(
414 } catch (org.exolab.castor.xml.ValidationException vex) {
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
430 final java.io.Writer out)
431 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
432 Marshaller.marshal(this, out);
439 * @throws java.io.IOException if an IOException occurs during
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
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);
454 public void removeAllSecondaryStructure(
456 this._secondaryStructureList.clear();
460 * Method removeSecondaryStructure.
462 * @param vSecondaryStructure
463 * @return true if the object was removed from the collection.
465 public boolean removeSecondaryStructure(
466 final jalview.schemabinding.version2.SecondaryStructure vSecondaryStructure) {
467 boolean removed = _secondaryStructureList.remove(vSecondaryStructure);
472 * Method removeSecondaryStructureAt.
475 * @return the element removed from the collection
477 public jalview.schemabinding.version2.SecondaryStructure removeSecondaryStructureAt(
479 java.lang.Object obj = this._secondaryStructureList.remove(index);
480 return (jalview.schemabinding.version2.SecondaryStructure) obj;
484 * Sets the value of field 'dividerLocation'. The field
485 * 'dividerLocation' has the following description: horizontal
486 * position of split pane divider
489 * @param dividerLocation the value of field 'dividerLocation'.
491 public void setDividerLocation(
492 final int dividerLocation) {
493 this._dividerLocation = dividerLocation;
494 this._has_dividerLocation = true;
498 * Sets the value of field 'height'.
500 * @param height the value of field 'height'.
502 public void setHeight(
504 this._height = height;
505 this._has_height = true;
512 * @param vSecondaryStructure
513 * @throws java.lang.IndexOutOfBoundsException if the index
514 * given is outside the bounds of the collection
516 public void setSecondaryStructure(
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) + "]");
525 this._secondaryStructureList.set(index, vSecondaryStructure);
531 * @param vSecondaryStructureArray
533 public void setSecondaryStructure(
534 final jalview.schemabinding.version2.SecondaryStructure[] vSecondaryStructureArray) {
536 _secondaryStructureList.clear();
538 for (int i = 0; i < vSecondaryStructureArray.length; i++) {
539 this._secondaryStructureList.add(vSecondaryStructureArray[i]);
544 * Sets the value of field 'selectedRna'. The field
545 * 'selectedRna' has the following description: Index of the
546 * selected structure in the
550 * @param selectedRna the value of field 'selectedRna'.
552 public void setSelectedRna(
553 final int selectedRna) {
554 this._selectedRna = selectedRna;
555 this._has_selectedRna = true;
559 * Sets the value of field 'title'.
561 * @param title the value of field 'title'.
563 public void setTitle(
564 final java.lang.String title) {
569 * Sets the value of field 'viewId'. The field 'viewId' has the
570 * following description: An id unique to the RNA viewer panel
573 * @param viewId the value of field 'viewId'.
575 public void setViewId(
576 final java.lang.String viewId) {
577 this._viewId = viewId;
581 * Sets the value of field 'width'.
583 * @param width the value of field 'width'.
585 public void setWidth(
588 this._has_width = true;
592 * Sets the value of field 'xpos'.
594 * @param xpos the value of field 'xpos'.
599 this._has_xpos = true;
603 * Sets the value of field 'ypos'.
605 * @param ypos the value of field 'ypos'.
610 this._has_ypos = true;
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
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);
633 * @throws org.exolab.castor.xml.ValidationException if this
634 * object is an invalid instance according to the schema
636 public void validate(
638 throws org.exolab.castor.xml.ValidationException {
639 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
640 validator.validate(this);