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 for this sequence. Schema
19 * supports one viewer showing multiple annotations for multiple sequences,
20 * though currently only one annotation for one sequence (gapped or trimmed) is
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 viewer panel
59 private int _selectedRna;
62 * keeps track of state for field: _selectedRna
64 private boolean _has_selectedRna;
72 * keeps track of state for field: _width
74 private boolean _has_width;
82 * keeps track of state for field: _height
84 private boolean _has_height;
92 * keeps track of state for field: _xpos
94 private boolean _has_xpos;
102 * keeps track of state for field: _ypos
104 private boolean _has_ypos;
107 * Field _secondaryStructureList.
109 private java.util.Vector _secondaryStructureList;
118 this._secondaryStructureList = new java.util.Vector();
128 * @param vSecondaryStructure
129 * @throws java.lang.IndexOutOfBoundsException
130 * if the index given is outside the bounds of the collection
132 public void addSecondaryStructure(
133 final jalview.schemabinding.version2.SecondaryStructure vSecondaryStructure)
134 throws java.lang.IndexOutOfBoundsException
136 this._secondaryStructureList.addElement(vSecondaryStructure);
143 * @param vSecondaryStructure
144 * @throws java.lang.IndexOutOfBoundsException
145 * if the index given is outside the bounds of the collection
147 public void addSecondaryStructure(
149 final jalview.schemabinding.version2.SecondaryStructure vSecondaryStructure)
150 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 'dividerLocation'
210 * has the following description: horizontal position of split pane divider
213 * @return the value of field 'DividerLocation'.
215 public int getDividerLocation()
217 return this._dividerLocation;
221 * Returns the value of field 'height'.
223 * @return the value of field 'Height'.
225 public int getHeight()
231 * Method getSecondaryStructure.
234 * @throws java.lang.IndexOutOfBoundsException
235 * if the index given is outside the bounds of the collection
236 * @return the value of the jalview.schemabinding.version2.SecondaryStructure
239 public jalview.schemabinding.version2.SecondaryStructure getSecondaryStructure(
240 final int index) throws java.lang.IndexOutOfBoundsException
242 // check bounds for index
243 if (index < 0 || index >= this._secondaryStructureList.size())
245 throw new IndexOutOfBoundsException(
246 "getSecondaryStructure: Index value '" + index
247 + "' not in range [0.."
248 + (this._secondaryStructureList.size() - 1) + "]");
251 return (jalview.schemabinding.version2.SecondaryStructure) _secondaryStructureList
256 * Method getSecondaryStructure.Returns the contents of the collection in an
259 * Note: Just in case the collection contents are changing in another thread,
260 * we pass a 0-length Array of the correct type into the API call. This way we
261 * <i>know</i> that the Array returned is of exactly the correct length.
263 * @return this collection as an Array
265 public jalview.schemabinding.version2.SecondaryStructure[] getSecondaryStructure()
267 jalview.schemabinding.version2.SecondaryStructure[] array = new jalview.schemabinding.version2.SecondaryStructure[0];
268 return (jalview.schemabinding.version2.SecondaryStructure[]) this._secondaryStructureList
273 * Method getSecondaryStructureCount.
275 * @return the size of this collection
277 public int getSecondaryStructureCount()
279 return this._secondaryStructureList.size();
283 * Returns the value of field 'selectedRna'. The field 'selectedRna' has the
284 * following description: Index of the selected structure in the viewer panel
287 * @return the value of field 'SelectedRna'.
289 public int getSelectedRna()
291 return this._selectedRna;
295 * Returns the value of field 'title'.
297 * @return the value of field 'Title'.
299 public java.lang.String getTitle()
305 * Returns the value of field 'viewId'. The field 'viewId' has the following
306 * description: An id unique to the RNA viewer panel
309 * @return the value of field 'ViewId'.
311 public java.lang.String getViewId()
317 * Returns the value of field 'width'.
319 * @return the value of field 'Width'.
321 public int getWidth()
327 * Returns the value of field 'xpos'.
329 * @return the value of field 'Xpos'.
337 * Returns the value of field 'ypos'.
339 * @return the value of field 'Ypos'.
347 * Method hasDividerLocation.
349 * @return true if at least one DividerLocation has been added
351 public boolean hasDividerLocation()
353 return this._has_dividerLocation;
359 * @return true if at least one Height has been added
361 public boolean hasHeight()
363 return this._has_height;
367 * Method hasSelectedRna.
369 * @return true if at least one SelectedRna has been added
371 public boolean hasSelectedRna()
373 return this._has_selectedRna;
379 * @return true if at least one Width has been added
381 public boolean hasWidth()
383 return this._has_width;
389 * @return true if at least one Xpos has been added
391 public boolean hasXpos()
393 return this._has_xpos;
399 * @return true if at least one Ypos has been added
401 public boolean hasYpos()
403 return this._has_ypos;
409 * @return true if this object is valid according to the schema
411 public boolean isValid()
416 } catch (org.exolab.castor.xml.ValidationException vex)
427 * @throws org.exolab.castor.xml.MarshalException
428 * if object is null or if any SAXException is thrown during
430 * @throws org.exolab.castor.xml.ValidationException
431 * if this object is an invalid instance according to the schema
433 public void marshal(final java.io.Writer out)
434 throws org.exolab.castor.xml.MarshalException,
435 org.exolab.castor.xml.ValidationException
437 Marshaller.marshal(this, out);
444 * @throws java.io.IOException
445 * if an IOException occurs during marshaling
446 * @throws org.exolab.castor.xml.ValidationException
447 * if this object is an invalid instance according to the schema
448 * @throws org.exolab.castor.xml.MarshalException
449 * if object is null or if any SAXException is thrown during
452 public void marshal(final org.xml.sax.ContentHandler handler)
453 throws java.io.IOException,
454 org.exolab.castor.xml.MarshalException,
455 org.exolab.castor.xml.ValidationException
457 Marshaller.marshal(this, handler);
462 public void removeAllSecondaryStructure()
464 this._secondaryStructureList.clear();
468 * Method removeSecondaryStructure.
470 * @param vSecondaryStructure
471 * @return true if the object was removed from the collection.
473 public boolean removeSecondaryStructure(
474 final jalview.schemabinding.version2.SecondaryStructure vSecondaryStructure)
476 boolean removed = _secondaryStructureList.remove(vSecondaryStructure);
481 * Method removeSecondaryStructureAt.
484 * @return the element removed from the collection
486 public jalview.schemabinding.version2.SecondaryStructure removeSecondaryStructureAt(
489 java.lang.Object obj = this._secondaryStructureList.remove(index);
490 return (jalview.schemabinding.version2.SecondaryStructure) obj;
494 * Sets the value of field 'dividerLocation'. The field 'dividerLocation' has
495 * the following description: horizontal position of split pane divider
498 * @param dividerLocation
499 * the value of field 'dividerLocation'.
501 public void setDividerLocation(final int dividerLocation)
503 this._dividerLocation = dividerLocation;
504 this._has_dividerLocation = true;
508 * Sets the value of field 'height'.
511 * the value of field 'height'.
513 public void setHeight(final int height)
515 this._height = height;
516 this._has_height = true;
523 * @param vSecondaryStructure
524 * @throws java.lang.IndexOutOfBoundsException
525 * if the index given is outside the bounds of the collection
527 public void setSecondaryStructure(
529 final jalview.schemabinding.version2.SecondaryStructure vSecondaryStructure)
530 throws java.lang.IndexOutOfBoundsException
532 // check bounds for index
533 if (index < 0 || index >= this._secondaryStructureList.size())
535 throw new IndexOutOfBoundsException(
536 "setSecondaryStructure: Index value '" + index
537 + "' not in range [0.."
538 + (this._secondaryStructureList.size() - 1) + "]");
541 this._secondaryStructureList.set(index, vSecondaryStructure);
547 * @param vSecondaryStructureArray
549 public void setSecondaryStructure(
550 final jalview.schemabinding.version2.SecondaryStructure[] vSecondaryStructureArray)
553 _secondaryStructureList.clear();
555 for (int i = 0; i < vSecondaryStructureArray.length; i++)
557 this._secondaryStructureList.add(vSecondaryStructureArray[i]);
562 * Sets the value of field 'selectedRna'. The field 'selectedRna' has the
563 * following description: Index of the selected structure in the viewer panel
567 * the value of field 'selectedRna'.
569 public void setSelectedRna(final int selectedRna)
571 this._selectedRna = selectedRna;
572 this._has_selectedRna = true;
576 * Sets the value of field 'title'.
579 * the value of field 'title'.
581 public void setTitle(final java.lang.String title)
587 * Sets the value of field 'viewId'. The field 'viewId' has the following
588 * description: An id unique to the RNA viewer panel
592 * the value of field 'viewId'.
594 public void setViewId(final java.lang.String viewId)
596 this._viewId = viewId;
600 * Sets the value of field 'width'.
603 * the value of field 'width'.
605 public void setWidth(final int width)
608 this._has_width = true;
612 * Sets the value of field 'xpos'.
615 * the value of field 'xpos'.
617 public void setXpos(final int xpos)
620 this._has_xpos = true;
624 * Sets the value of field 'ypos'.
627 * the value of field 'ypos'.
629 public void setYpos(final int ypos)
632 this._has_ypos = true;
639 * @throws org.exolab.castor.xml.MarshalException
640 * if object is null or if any SAXException is thrown during
642 * @throws org.exolab.castor.xml.ValidationException
643 * if this object is an invalid instance according to the schema
644 * @return the unmarshaled jalview.schemabinding.version2.RnaViewer
646 public static jalview.schemabinding.version2.RnaViewer unmarshal(
647 final java.io.Reader reader)
648 throws org.exolab.castor.xml.MarshalException,
649 org.exolab.castor.xml.ValidationException
651 return (jalview.schemabinding.version2.RnaViewer) Unmarshaller
652 .unmarshal(jalview.schemabinding.version2.RnaViewer.class,
659 * @throws org.exolab.castor.xml.ValidationException
660 * if this object is an invalid instance according to the schema
662 public void validate() throws org.exolab.castor.xml.ValidationException
664 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
665 validator.validate(this);