2 * Jalview - A Sequence Alignment Editor and Viewer (Development Version 2.4.1)
\r
3 * Copyright (C) 2009 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
\r
5 * This program is free software; you can redistribute it and/or
\r
6 * modify it under the terms of the GNU General Public License
\r
7 * as published by the Free Software Foundation; either version 2
\r
8 * of the License, or (at your option) any later version.
\r
10 * This program is distributed in the hope that it will be useful,
\r
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
13 * GNU General Public License for more details.
\r
15 * You should have received a copy of the GNU General Public License
\r
16 * along with this program; if not, write to the Free Software
\r
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
\r
19 package jalview.schemabinding.version2;
\r
21 //---------------------------------/
\r
22 //- Imported classes and packages -/
\r
23 //---------------------------------/
\r
25 import org.exolab.castor.xml.Marshaller;
\r
26 import org.exolab.castor.xml.Unmarshaller;
\r
31 * @version $Revision$ $Date$
\r
33 public class JGroup implements java.io.Serializable {
\r
36 //--------------------------/
\r
37 //- Class/Member Variables -/
\r
38 //--------------------------/
\r
46 * keeps track of state for field: _start
\r
48 private boolean _has_start;
\r
56 * keeps track of state for field: _end
\r
58 private boolean _has_end;
\r
63 private java.lang.String _name;
\r
68 private java.lang.String _colour;
\r
71 * Field _consThreshold.
\r
73 private int _consThreshold;
\r
76 * keeps track of state for field: _consThreshold
\r
78 private boolean _has_consThreshold;
\r
81 * Field _pidThreshold.
\r
83 private int _pidThreshold;
\r
86 * keeps track of state for field: _pidThreshold
\r
88 private boolean _has_pidThreshold;
\r
91 * Field _outlineColour.
\r
93 private int _outlineColour;
\r
96 * keeps track of state for field: _outlineColour
\r
98 private boolean _has_outlineColour;
\r
101 * Field _displayBoxes.
\r
103 private boolean _displayBoxes;
\r
106 * keeps track of state for field: _displayBoxes
\r
108 private boolean _has_displayBoxes;
\r
111 * Field _displayText.
\r
113 private boolean _displayText;
\r
116 * keeps track of state for field: _displayText
\r
118 private boolean _has_displayText;
\r
121 * Field _colourText.
\r
123 private boolean _colourText;
\r
126 * keeps track of state for field: _colourText
\r
128 private boolean _has_colourText;
\r
133 private int _textCol1;
\r
136 * keeps track of state for field: _textCol1
\r
138 private boolean _has_textCol1;
\r
143 private int _textCol2;
\r
146 * keeps track of state for field: _textCol2
\r
148 private boolean _has_textCol2;
\r
151 * Field _textColThreshold.
\r
153 private int _textColThreshold;
\r
156 * keeps track of state for field: _textColThreshold
\r
158 private boolean _has_textColThreshold;
\r
161 * Field _showUnconserved.
\r
163 private boolean _showUnconserved;
\r
166 * keeps track of state for field: _showUnconserved
\r
168 private boolean _has_showUnconserved;
\r
173 private java.util.Vector _seqList;
\r
176 //----------------/
\r
177 //- Constructors -/
\r
178 //----------------/
\r
182 this._seqList = new java.util.Vector();
\r
194 * @throws java.lang.IndexOutOfBoundsException if the index
\r
195 * given is outside the bounds of the collection
\r
197 public void addSeq(
\r
198 final java.lang.String vSeq)
\r
199 throws java.lang.IndexOutOfBoundsException {
\r
200 this._seqList.addElement(vSeq);
\r
208 * @throws java.lang.IndexOutOfBoundsException if the index
\r
209 * given is outside the bounds of the collection
\r
211 public void addSeq(
\r
213 final java.lang.String vSeq)
\r
214 throws java.lang.IndexOutOfBoundsException {
\r
215 this._seqList.add(index, vSeq);
\r
220 public void deleteColourText(
\r
222 this._has_colourText= false;
\r
227 public void deleteConsThreshold(
\r
229 this._has_consThreshold= false;
\r
234 public void deleteDisplayBoxes(
\r
236 this._has_displayBoxes= false;
\r
241 public void deleteDisplayText(
\r
243 this._has_displayText= false;
\r
248 public void deleteEnd(
\r
250 this._has_end= false;
\r
255 public void deleteOutlineColour(
\r
257 this._has_outlineColour= false;
\r
262 public void deletePidThreshold(
\r
264 this._has_pidThreshold= false;
\r
269 public void deleteShowUnconserved(
\r
271 this._has_showUnconserved= false;
\r
276 public void deleteStart(
\r
278 this._has_start= false;
\r
283 public void deleteTextCol1(
\r
285 this._has_textCol1= false;
\r
290 public void deleteTextCol2(
\r
292 this._has_textCol2= false;
\r
297 public void deleteTextColThreshold(
\r
299 this._has_textColThreshold= false;
\r
303 * Method enumerateSeq.
\r
305 * @return an Enumeration over all java.lang.String elements
\r
307 public java.util.Enumeration enumerateSeq(
\r
309 return this._seqList.elements();
\r
313 * Returns the value of field 'colour'.
\r
315 * @return the value of field 'Colour'.
\r
317 public java.lang.String getColour(
\r
319 return this._colour;
\r
323 * Returns the value of field 'colourText'.
\r
325 * @return the value of field 'ColourText'.
\r
327 public boolean getColourText(
\r
329 return this._colourText;
\r
333 * Returns the value of field 'consThreshold'.
\r
335 * @return the value of field 'ConsThreshold'.
\r
337 public int getConsThreshold(
\r
339 return this._consThreshold;
\r
343 * Returns the value of field 'displayBoxes'.
\r
345 * @return the value of field 'DisplayBoxes'.
\r
347 public boolean getDisplayBoxes(
\r
349 return this._displayBoxes;
\r
353 * Returns the value of field 'displayText'.
\r
355 * @return the value of field 'DisplayText'.
\r
357 public boolean getDisplayText(
\r
359 return this._displayText;
\r
363 * Returns the value of field 'end'.
\r
365 * @return the value of field 'End'.
\r
373 * Returns the value of field 'name'.
\r
375 * @return the value of field 'Name'.
\r
377 public java.lang.String getName(
\r
383 * Returns the value of field 'outlineColour'.
\r
385 * @return the value of field 'OutlineColour'.
\r
387 public int getOutlineColour(
\r
389 return this._outlineColour;
\r
393 * Returns the value of field 'pidThreshold'.
\r
395 * @return the value of field 'PidThreshold'.
\r
397 public int getPidThreshold(
\r
399 return this._pidThreshold;
\r
406 * @throws java.lang.IndexOutOfBoundsException if the index
\r
407 * given is outside the bounds of the collection
\r
408 * @return the value of the java.lang.String at the given index
\r
410 public java.lang.String getSeq(
\r
412 throws java.lang.IndexOutOfBoundsException {
\r
413 // check bounds for index
\r
414 if (index < 0 || index >= this._seqList.size()) {
\r
415 throw new IndexOutOfBoundsException("getSeq: Index value '" + index + "' not in range [0.." + (this._seqList.size() - 1) + "]");
\r
418 return (java.lang.String) _seqList.get(index);
\r
422 * Method getSeq.Returns the contents of the collection in an
\r
423 * Array. <p>Note: Just in case the collection contents are
\r
424 * changing in another thread, we pass a 0-length Array of the
\r
425 * correct type into the API call. This way we <i>know</i>
\r
426 * that the Array returned is of exactly the correct length.
\r
428 * @return this collection as an Array
\r
430 public java.lang.String[] getSeq(
\r
432 java.lang.String[] array = new java.lang.String[0];
\r
433 return (java.lang.String[]) this._seqList.toArray(array);
\r
437 * Method getSeqCount.
\r
439 * @return the size of this collection
\r
441 public int getSeqCount(
\r
443 return this._seqList.size();
\r
447 * Returns the value of field 'showUnconserved'.
\r
449 * @return the value of field 'ShowUnconserved'.
\r
451 public boolean getShowUnconserved(
\r
453 return this._showUnconserved;
\r
457 * Returns the value of field 'start'.
\r
459 * @return the value of field 'Start'.
\r
461 public int getStart(
\r
463 return this._start;
\r
467 * Returns the value of field 'textCol1'.
\r
469 * @return the value of field 'TextCol1'.
\r
471 public int getTextCol1(
\r
473 return this._textCol1;
\r
477 * Returns the value of field 'textCol2'.
\r
479 * @return the value of field 'TextCol2'.
\r
481 public int getTextCol2(
\r
483 return this._textCol2;
\r
487 * Returns the value of field 'textColThreshold'.
\r
489 * @return the value of field 'TextColThreshold'.
\r
491 public int getTextColThreshold(
\r
493 return this._textColThreshold;
\r
497 * Method hasColourText.
\r
499 * @return true if at least one ColourText has been added
\r
501 public boolean hasColourText(
\r
503 return this._has_colourText;
\r
507 * Method hasConsThreshold.
\r
509 * @return true if at least one ConsThreshold has been added
\r
511 public boolean hasConsThreshold(
\r
513 return this._has_consThreshold;
\r
517 * Method hasDisplayBoxes.
\r
519 * @return true if at least one DisplayBoxes has been added
\r
521 public boolean hasDisplayBoxes(
\r
523 return this._has_displayBoxes;
\r
527 * Method hasDisplayText.
\r
529 * @return true if at least one DisplayText has been added
\r
531 public boolean hasDisplayText(
\r
533 return this._has_displayText;
\r
539 * @return true if at least one End has been added
\r
541 public boolean hasEnd(
\r
543 return this._has_end;
\r
547 * Method hasOutlineColour.
\r
549 * @return true if at least one OutlineColour has been added
\r
551 public boolean hasOutlineColour(
\r
553 return this._has_outlineColour;
\r
557 * Method hasPidThreshold.
\r
559 * @return true if at least one PidThreshold has been added
\r
561 public boolean hasPidThreshold(
\r
563 return this._has_pidThreshold;
\r
567 * Method hasShowUnconserved.
\r
569 * @return true if at least one ShowUnconserved has been added
\r
571 public boolean hasShowUnconserved(
\r
573 return this._has_showUnconserved;
\r
579 * @return true if at least one Start has been added
\r
581 public boolean hasStart(
\r
583 return this._has_start;
\r
587 * Method hasTextCol1.
\r
589 * @return true if at least one TextCol1 has been added
\r
591 public boolean hasTextCol1(
\r
593 return this._has_textCol1;
\r
597 * Method hasTextCol2.
\r
599 * @return true if at least one TextCol2 has been added
\r
601 public boolean hasTextCol2(
\r
603 return this._has_textCol2;
\r
607 * Method hasTextColThreshold.
\r
609 * @return true if at least one TextColThreshold has been added
\r
611 public boolean hasTextColThreshold(
\r
613 return this._has_textColThreshold;
\r
617 * Returns the value of field 'colourText'.
\r
619 * @return the value of field 'ColourText'.
\r
621 public boolean isColourText(
\r
623 return this._colourText;
\r
627 * Returns the value of field 'displayBoxes'.
\r
629 * @return the value of field 'DisplayBoxes'.
\r
631 public boolean isDisplayBoxes(
\r
633 return this._displayBoxes;
\r
637 * Returns the value of field 'displayText'.
\r
639 * @return the value of field 'DisplayText'.
\r
641 public boolean isDisplayText(
\r
643 return this._displayText;
\r
647 * Returns the value of field 'showUnconserved'.
\r
649 * @return the value of field 'ShowUnconserved'.
\r
651 public boolean isShowUnconserved(
\r
653 return this._showUnconserved;
\r
659 * @return true if this object is valid according to the schema
\r
661 public boolean isValid(
\r
665 } catch (org.exolab.castor.xml.ValidationException vex) {
\r
675 * @throws org.exolab.castor.xml.MarshalException if object is
\r
676 * null or if any SAXException is thrown during marshaling
\r
677 * @throws org.exolab.castor.xml.ValidationException if this
\r
678 * object is an invalid instance according to the schema
\r
680 public void marshal(
\r
681 final java.io.Writer out)
\r
682 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
\r
683 Marshaller.marshal(this, out);
\r
690 * @throws java.io.IOException if an IOException occurs during
\r
692 * @throws org.exolab.castor.xml.ValidationException if this
\r
693 * object is an invalid instance according to the schema
\r
694 * @throws org.exolab.castor.xml.MarshalException if object is
\r
695 * null or if any SAXException is thrown during marshaling
\r
697 public void marshal(
\r
698 final org.xml.sax.ContentHandler handler)
\r
699 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
\r
700 Marshaller.marshal(this, handler);
\r
705 public void removeAllSeq(
\r
707 this._seqList.clear();
\r
711 * Method removeSeq.
\r
714 * @return true if the object was removed from the collection.
\r
716 public boolean removeSeq(
\r
717 final java.lang.String vSeq) {
\r
718 boolean removed = _seqList.remove(vSeq);
\r
723 * Method removeSeqAt.
\r
726 * @return the element removed from the collection
\r
728 public java.lang.String removeSeqAt(
\r
730 java.lang.Object obj = this._seqList.remove(index);
\r
731 return (java.lang.String) obj;
\r
735 * Sets the value of field 'colour'.
\r
737 * @param colour the value of field 'colour'.
\r
739 public void setColour(
\r
740 final java.lang.String colour) {
\r
741 this._colour = colour;
\r
745 * Sets the value of field 'colourText'.
\r
747 * @param colourText the value of field 'colourText'.
\r
749 public void setColourText(
\r
750 final boolean colourText) {
\r
751 this._colourText = colourText;
\r
752 this._has_colourText = true;
\r
756 * Sets the value of field 'consThreshold'.
\r
758 * @param consThreshold the value of field 'consThreshold'.
\r
760 public void setConsThreshold(
\r
761 final int consThreshold) {
\r
762 this._consThreshold = consThreshold;
\r
763 this._has_consThreshold = true;
\r
767 * Sets the value of field 'displayBoxes'.
\r
769 * @param displayBoxes the value of field 'displayBoxes'.
\r
771 public void setDisplayBoxes(
\r
772 final boolean displayBoxes) {
\r
773 this._displayBoxes = displayBoxes;
\r
774 this._has_displayBoxes = true;
\r
778 * Sets the value of field 'displayText'.
\r
780 * @param displayText the value of field 'displayText'.
\r
782 public void setDisplayText(
\r
783 final boolean displayText) {
\r
784 this._displayText = displayText;
\r
785 this._has_displayText = true;
\r
789 * Sets the value of field 'end'.
\r
791 * @param end the value of field 'end'.
\r
793 public void setEnd(
\r
796 this._has_end = true;
\r
800 * Sets the value of field 'name'.
\r
802 * @param name the value of field 'name'.
\r
804 public void setName(
\r
805 final java.lang.String name) {
\r
810 * Sets the value of field 'outlineColour'.
\r
812 * @param outlineColour the value of field 'outlineColour'.
\r
814 public void setOutlineColour(
\r
815 final int outlineColour) {
\r
816 this._outlineColour = outlineColour;
\r
817 this._has_outlineColour = true;
\r
821 * Sets the value of field 'pidThreshold'.
\r
823 * @param pidThreshold the value of field 'pidThreshold'.
\r
825 public void setPidThreshold(
\r
826 final int pidThreshold) {
\r
827 this._pidThreshold = pidThreshold;
\r
828 this._has_pidThreshold = true;
\r
836 * @throws java.lang.IndexOutOfBoundsException if the index
\r
837 * given is outside the bounds of the collection
\r
839 public void setSeq(
\r
841 final java.lang.String vSeq)
\r
842 throws java.lang.IndexOutOfBoundsException {
\r
843 // check bounds for index
\r
844 if (index < 0 || index >= this._seqList.size()) {
\r
845 throw new IndexOutOfBoundsException("setSeq: Index value '" + index + "' not in range [0.." + (this._seqList.size() - 1) + "]");
\r
848 this._seqList.set(index, vSeq);
\r
856 public void setSeq(
\r
857 final java.lang.String[] vSeqArray) {
\r
861 for (int i = 0; i < vSeqArray.length; i++) {
\r
862 this._seqList.add(vSeqArray[i]);
\r
867 * Sets the value of field 'showUnconserved'.
\r
869 * @param showUnconserved the value of field 'showUnconserved'.
\r
871 public void setShowUnconserved(
\r
872 final boolean showUnconserved) {
\r
873 this._showUnconserved = showUnconserved;
\r
874 this._has_showUnconserved = true;
\r
878 * Sets the value of field 'start'.
\r
880 * @param start the value of field 'start'.
\r
882 public void setStart(
\r
884 this._start = start;
\r
885 this._has_start = true;
\r
889 * Sets the value of field 'textCol1'.
\r
891 * @param textCol1 the value of field 'textCol1'.
\r
893 public void setTextCol1(
\r
894 final int textCol1) {
\r
895 this._textCol1 = textCol1;
\r
896 this._has_textCol1 = true;
\r
900 * Sets the value of field 'textCol2'.
\r
902 * @param textCol2 the value of field 'textCol2'.
\r
904 public void setTextCol2(
\r
905 final int textCol2) {
\r
906 this._textCol2 = textCol2;
\r
907 this._has_textCol2 = true;
\r
911 * Sets the value of field 'textColThreshold'.
\r
913 * @param textColThreshold the value of field 'textColThreshold'
\r
915 public void setTextColThreshold(
\r
916 final int textColThreshold) {
\r
917 this._textColThreshold = textColThreshold;
\r
918 this._has_textColThreshold = true;
\r
922 * Method unmarshal.
\r
925 * @throws org.exolab.castor.xml.MarshalException if object is
\r
926 * null or if any SAXException is thrown during marshaling
\r
927 * @throws org.exolab.castor.xml.ValidationException if this
\r
928 * object is an invalid instance according to the schema
\r
929 * @return the unmarshaled jalview.schemabinding.version2.JGroup
\r
931 public static jalview.schemabinding.version2.JGroup unmarshal(
\r
932 final java.io.Reader reader)
\r
933 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
\r
934 return (jalview.schemabinding.version2.JGroup) Unmarshaller.unmarshal(jalview.schemabinding.version2.JGroup.class, reader);
\r
940 * @throws org.exolab.castor.xml.ValidationException if this
\r
941 * object is an invalid instance according to the schema
\r
943 public void validate(
\r
945 throws org.exolab.castor.xml.ValidationException {
\r
946 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
\r
947 validator.validate(this);
\r