1 /*******************************************************************************
2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
3 * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
5 * This file is part of Jalview.
7 * Jalview is free software: you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
11 * Jalview is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty
13 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 * PURPOSE. See the GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License along with Jalview. If not, see <http://www.gnu.org/licenses/>.
17 *******************************************************************************/
19 * This class was automatically generated with
20 * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
25 package jalview.schemabinding.version2;
27 //---------------------------------/
28 //- Imported classes and packages -/
29 //---------------------------------/
31 import org.exolab.castor.xml.Marshaller;
32 import org.exolab.castor.xml.Unmarshaller;
37 * @version $Revision$ $Date$
39 public class JGroup implements java.io.Serializable {
42 //--------------------------/
43 //- Class/Member Variables -/
44 //--------------------------/
52 * keeps track of state for field: _start
54 private boolean _has_start;
62 * keeps track of state for field: _end
64 private boolean _has_end;
69 private java.lang.String _name;
74 private java.lang.String _colour;
77 * Field _consThreshold.
79 private int _consThreshold;
82 * keeps track of state for field: _consThreshold
84 private boolean _has_consThreshold;
87 * Field _pidThreshold.
89 private int _pidThreshold;
92 * keeps track of state for field: _pidThreshold
94 private boolean _has_pidThreshold;
97 * Field _outlineColour.
99 private int _outlineColour;
102 * keeps track of state for field: _outlineColour
104 private boolean _has_outlineColour;
107 * Field _displayBoxes.
109 private boolean _displayBoxes;
112 * keeps track of state for field: _displayBoxes
114 private boolean _has_displayBoxes;
117 * Field _displayText.
119 private boolean _displayText;
122 * keeps track of state for field: _displayText
124 private boolean _has_displayText;
129 private boolean _colourText;
132 * keeps track of state for field: _colourText
134 private boolean _has_colourText;
139 private int _textCol1;
142 * keeps track of state for field: _textCol1
144 private boolean _has_textCol1;
149 private int _textCol2;
152 * keeps track of state for field: _textCol2
154 private boolean _has_textCol2;
157 * Field _textColThreshold.
159 private int _textColThreshold;
162 * keeps track of state for field: _textColThreshold
164 private boolean _has_textColThreshold;
167 * Field _showUnconserved.
169 private boolean _showUnconserved;
172 * keeps track of state for field: _showUnconserved
174 private boolean _has_showUnconserved;
177 * Field _ignoreGapsinConsensus.
179 private boolean _ignoreGapsinConsensus = true;
182 * keeps track of state for field: _ignoreGapsinConsensus
184 private boolean _has_ignoreGapsinConsensus;
187 * Field _showConsensusHistogram.
189 private boolean _showConsensusHistogram = true;
192 * keeps track of state for field: _showConsensusHistogram
194 private boolean _has_showConsensusHistogram;
197 * Field _showSequenceLogo.
199 private boolean _showSequenceLogo = false;
202 * keeps track of state for field: _showSequenceLogo
204 private boolean _has_showSequenceLogo;
207 * Optional sequence group ID (only needs to be unique for this
211 private java.lang.String _id;
216 private java.util.Vector _seqList;
225 this._seqList = new java.util.Vector();
237 * @throws java.lang.IndexOutOfBoundsException if the index
238 * given is outside the bounds of the collection
241 final java.lang.String vSeq)
242 throws java.lang.IndexOutOfBoundsException {
243 this._seqList.addElement(vSeq);
251 * @throws java.lang.IndexOutOfBoundsException if the index
252 * given is outside the bounds of the collection
256 final java.lang.String vSeq)
257 throws java.lang.IndexOutOfBoundsException {
258 this._seqList.add(index, vSeq);
263 public void deleteColourText(
265 this._has_colourText= false;
270 public void deleteConsThreshold(
272 this._has_consThreshold= false;
277 public void deleteDisplayBoxes(
279 this._has_displayBoxes= false;
284 public void deleteDisplayText(
286 this._has_displayText= false;
291 public void deleteEnd(
293 this._has_end= false;
298 public void deleteIgnoreGapsinConsensus(
300 this._has_ignoreGapsinConsensus= false;
305 public void deleteOutlineColour(
307 this._has_outlineColour= false;
312 public void deletePidThreshold(
314 this._has_pidThreshold= false;
319 public void deleteShowConsensusHistogram(
321 this._has_showConsensusHistogram= false;
326 public void deleteShowSequenceLogo(
328 this._has_showSequenceLogo= false;
333 public void deleteShowUnconserved(
335 this._has_showUnconserved= false;
340 public void deleteStart(
342 this._has_start= false;
347 public void deleteTextCol1(
349 this._has_textCol1= false;
354 public void deleteTextCol2(
356 this._has_textCol2= false;
361 public void deleteTextColThreshold(
363 this._has_textColThreshold= false;
367 * Method enumerateSeq.
369 * @return an Enumeration over all java.lang.String elements
371 public java.util.Enumeration enumerateSeq(
373 return this._seqList.elements();
377 * Returns the value of field 'colour'.
379 * @return the value of field 'Colour'.
381 public java.lang.String getColour(
387 * Returns the value of field 'colourText'.
389 * @return the value of field 'ColourText'.
391 public boolean getColourText(
393 return this._colourText;
397 * Returns the value of field 'consThreshold'.
399 * @return the value of field 'ConsThreshold'.
401 public int getConsThreshold(
403 return this._consThreshold;
407 * Returns the value of field 'displayBoxes'.
409 * @return the value of field 'DisplayBoxes'.
411 public boolean getDisplayBoxes(
413 return this._displayBoxes;
417 * Returns the value of field 'displayText'.
419 * @return the value of field 'DisplayText'.
421 public boolean getDisplayText(
423 return this._displayText;
427 * Returns the value of field 'end'.
429 * @return the value of field 'End'.
437 * Returns the value of field 'id'. The field 'id' has the
438 * following description: Optional sequence group ID (only
439 * needs to be unique for this alignment)
442 * @return the value of field 'Id'.
444 public java.lang.String getId(
450 * Returns the value of field 'ignoreGapsinConsensus'.
452 * @return the value of field 'IgnoreGapsinConsensus'.
454 public boolean getIgnoreGapsinConsensus(
456 return this._ignoreGapsinConsensus;
460 * Returns the value of field 'name'.
462 * @return the value of field 'Name'.
464 public java.lang.String getName(
470 * Returns the value of field 'outlineColour'.
472 * @return the value of field 'OutlineColour'.
474 public int getOutlineColour(
476 return this._outlineColour;
480 * Returns the value of field 'pidThreshold'.
482 * @return the value of field 'PidThreshold'.
484 public int getPidThreshold(
486 return this._pidThreshold;
493 * @throws java.lang.IndexOutOfBoundsException if the index
494 * given is outside the bounds of the collection
495 * @return the value of the java.lang.String at the given index
497 public java.lang.String getSeq(
499 throws java.lang.IndexOutOfBoundsException {
500 // check bounds for index
501 if (index < 0 || index >= this._seqList.size()) {
502 throw new IndexOutOfBoundsException("getSeq: Index value '" + index + "' not in range [0.." + (this._seqList.size() - 1) + "]");
505 return (java.lang.String) _seqList.get(index);
509 * Method getSeq.Returns the contents of the collection in an
510 * Array. <p>Note: Just in case the collection contents are
511 * changing in another thread, we pass a 0-length Array of the
512 * correct type into the API call. This way we <i>know</i>
513 * that the Array returned is of exactly the correct length.
515 * @return this collection as an Array
517 public java.lang.String[] getSeq(
519 java.lang.String[] array = new java.lang.String[0];
520 return (java.lang.String[]) this._seqList.toArray(array);
524 * Method getSeqCount.
526 * @return the size of this collection
528 public int getSeqCount(
530 return this._seqList.size();
534 * Returns the value of field 'showConsensusHistogram'.
536 * @return the value of field 'ShowConsensusHistogram'.
538 public boolean getShowConsensusHistogram(
540 return this._showConsensusHistogram;
544 * Returns the value of field 'showSequenceLogo'.
546 * @return the value of field 'ShowSequenceLogo'.
548 public boolean getShowSequenceLogo(
550 return this._showSequenceLogo;
554 * Returns the value of field 'showUnconserved'.
556 * @return the value of field 'ShowUnconserved'.
558 public boolean getShowUnconserved(
560 return this._showUnconserved;
564 * Returns the value of field 'start'.
566 * @return the value of field 'Start'.
574 * Returns the value of field 'textCol1'.
576 * @return the value of field 'TextCol1'.
578 public int getTextCol1(
580 return this._textCol1;
584 * Returns the value of field 'textCol2'.
586 * @return the value of field 'TextCol2'.
588 public int getTextCol2(
590 return this._textCol2;
594 * Returns the value of field 'textColThreshold'.
596 * @return the value of field 'TextColThreshold'.
598 public int getTextColThreshold(
600 return this._textColThreshold;
604 * Method hasColourText.
606 * @return true if at least one ColourText has been added
608 public boolean hasColourText(
610 return this._has_colourText;
614 * Method hasConsThreshold.
616 * @return true if at least one ConsThreshold has been added
618 public boolean hasConsThreshold(
620 return this._has_consThreshold;
624 * Method hasDisplayBoxes.
626 * @return true if at least one DisplayBoxes has been added
628 public boolean hasDisplayBoxes(
630 return this._has_displayBoxes;
634 * Method hasDisplayText.
636 * @return true if at least one DisplayText has been added
638 public boolean hasDisplayText(
640 return this._has_displayText;
646 * @return true if at least one End has been added
648 public boolean hasEnd(
650 return this._has_end;
654 * Method hasIgnoreGapsinConsensus.
656 * @return true if at least one IgnoreGapsinConsensus has been
659 public boolean hasIgnoreGapsinConsensus(
661 return this._has_ignoreGapsinConsensus;
665 * Method hasOutlineColour.
667 * @return true if at least one OutlineColour has been added
669 public boolean hasOutlineColour(
671 return this._has_outlineColour;
675 * Method hasPidThreshold.
677 * @return true if at least one PidThreshold has been added
679 public boolean hasPidThreshold(
681 return this._has_pidThreshold;
685 * Method hasShowConsensusHistogram.
687 * @return true if at least one ShowConsensusHistogram has been
690 public boolean hasShowConsensusHistogram(
692 return this._has_showConsensusHistogram;
696 * Method hasShowSequenceLogo.
698 * @return true if at least one ShowSequenceLogo has been added
700 public boolean hasShowSequenceLogo(
702 return this._has_showSequenceLogo;
706 * Method hasShowUnconserved.
708 * @return true if at least one ShowUnconserved has been added
710 public boolean hasShowUnconserved(
712 return this._has_showUnconserved;
718 * @return true if at least one Start has been added
720 public boolean hasStart(
722 return this._has_start;
726 * Method hasTextCol1.
728 * @return true if at least one TextCol1 has been added
730 public boolean hasTextCol1(
732 return this._has_textCol1;
736 * Method hasTextCol2.
738 * @return true if at least one TextCol2 has been added
740 public boolean hasTextCol2(
742 return this._has_textCol2;
746 * Method hasTextColThreshold.
748 * @return true if at least one TextColThreshold has been added
750 public boolean hasTextColThreshold(
752 return this._has_textColThreshold;
756 * Returns the value of field 'colourText'.
758 * @return the value of field 'ColourText'.
760 public boolean isColourText(
762 return this._colourText;
766 * Returns the value of field 'displayBoxes'.
768 * @return the value of field 'DisplayBoxes'.
770 public boolean isDisplayBoxes(
772 return this._displayBoxes;
776 * Returns the value of field 'displayText'.
778 * @return the value of field 'DisplayText'.
780 public boolean isDisplayText(
782 return this._displayText;
786 * Returns the value of field 'ignoreGapsinConsensus'.
788 * @return the value of field 'IgnoreGapsinConsensus'.
790 public boolean isIgnoreGapsinConsensus(
792 return this._ignoreGapsinConsensus;
796 * Returns the value of field 'showConsensusHistogram'.
798 * @return the value of field 'ShowConsensusHistogram'.
800 public boolean isShowConsensusHistogram(
802 return this._showConsensusHistogram;
806 * Returns the value of field 'showSequenceLogo'.
808 * @return the value of field 'ShowSequenceLogo'.
810 public boolean isShowSequenceLogo(
812 return this._showSequenceLogo;
816 * Returns the value of field 'showUnconserved'.
818 * @return the value of field 'ShowUnconserved'.
820 public boolean isShowUnconserved(
822 return this._showUnconserved;
828 * @return true if this object is valid according to the schema
830 public boolean isValid(
834 } catch (org.exolab.castor.xml.ValidationException vex) {
844 * @throws org.exolab.castor.xml.MarshalException if object is
845 * null or if any SAXException is thrown during marshaling
846 * @throws org.exolab.castor.xml.ValidationException if this
847 * object is an invalid instance according to the schema
850 final java.io.Writer out)
851 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
852 Marshaller.marshal(this, out);
859 * @throws java.io.IOException if an IOException occurs during
861 * @throws org.exolab.castor.xml.ValidationException if this
862 * object is an invalid instance according to the schema
863 * @throws org.exolab.castor.xml.MarshalException if object is
864 * null or if any SAXException is thrown during marshaling
867 final org.xml.sax.ContentHandler handler)
868 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
869 Marshaller.marshal(this, handler);
874 public void removeAllSeq(
876 this._seqList.clear();
883 * @return true if the object was removed from the collection.
885 public boolean removeSeq(
886 final java.lang.String vSeq) {
887 boolean removed = _seqList.remove(vSeq);
892 * Method removeSeqAt.
895 * @return the element removed from the collection
897 public java.lang.String removeSeqAt(
899 java.lang.Object obj = this._seqList.remove(index);
900 return (java.lang.String) obj;
904 * Sets the value of field 'colour'.
906 * @param colour the value of field 'colour'.
908 public void setColour(
909 final java.lang.String colour) {
910 this._colour = colour;
914 * Sets the value of field 'colourText'.
916 * @param colourText the value of field 'colourText'.
918 public void setColourText(
919 final boolean colourText) {
920 this._colourText = colourText;
921 this._has_colourText = true;
925 * Sets the value of field 'consThreshold'.
927 * @param consThreshold the value of field 'consThreshold'.
929 public void setConsThreshold(
930 final int consThreshold) {
931 this._consThreshold = consThreshold;
932 this._has_consThreshold = true;
936 * Sets the value of field 'displayBoxes'.
938 * @param displayBoxes the value of field 'displayBoxes'.
940 public void setDisplayBoxes(
941 final boolean displayBoxes) {
942 this._displayBoxes = displayBoxes;
943 this._has_displayBoxes = true;
947 * Sets the value of field 'displayText'.
949 * @param displayText the value of field 'displayText'.
951 public void setDisplayText(
952 final boolean displayText) {
953 this._displayText = displayText;
954 this._has_displayText = true;
958 * Sets the value of field 'end'.
960 * @param end the value of field 'end'.
965 this._has_end = true;
969 * Sets the value of field 'id'. The field 'id' has the
970 * following description: Optional sequence group ID (only
971 * needs to be unique for this alignment)
974 * @param id the value of field 'id'.
977 final java.lang.String id) {
982 * Sets the value of field 'ignoreGapsinConsensus'.
984 * @param ignoreGapsinConsensus the value of field
985 * 'ignoreGapsinConsensus'.
987 public void setIgnoreGapsinConsensus(
988 final boolean ignoreGapsinConsensus) {
989 this._ignoreGapsinConsensus = ignoreGapsinConsensus;
990 this._has_ignoreGapsinConsensus = true;
994 * Sets the value of field 'name'.
996 * @param name the value of field 'name'.
999 final java.lang.String name) {
1004 * Sets the value of field 'outlineColour'.
1006 * @param outlineColour the value of field 'outlineColour'.
1008 public void setOutlineColour(
1009 final int outlineColour) {
1010 this._outlineColour = outlineColour;
1011 this._has_outlineColour = true;
1015 * Sets the value of field 'pidThreshold'.
1017 * @param pidThreshold the value of field 'pidThreshold'.
1019 public void setPidThreshold(
1020 final int pidThreshold) {
1021 this._pidThreshold = pidThreshold;
1022 this._has_pidThreshold = true;
1030 * @throws java.lang.IndexOutOfBoundsException if the index
1031 * given is outside the bounds of the collection
1035 final java.lang.String vSeq)
1036 throws java.lang.IndexOutOfBoundsException {
1037 // check bounds for index
1038 if (index < 0 || index >= this._seqList.size()) {
1039 throw new IndexOutOfBoundsException("setSeq: Index value '" + index + "' not in range [0.." + (this._seqList.size() - 1) + "]");
1042 this._seqList.set(index, vSeq);
1051 final java.lang.String[] vSeqArray) {
1055 for (int i = 0; i < vSeqArray.length; i++) {
1056 this._seqList.add(vSeqArray[i]);
1061 * Sets the value of field 'showConsensusHistogram'.
1063 * @param showConsensusHistogram the value of field
1064 * 'showConsensusHistogram'.
1066 public void setShowConsensusHistogram(
1067 final boolean showConsensusHistogram) {
1068 this._showConsensusHistogram = showConsensusHistogram;
1069 this._has_showConsensusHistogram = true;
1073 * Sets the value of field 'showSequenceLogo'.
1075 * @param showSequenceLogo the value of field 'showSequenceLogo'
1077 public void setShowSequenceLogo(
1078 final boolean showSequenceLogo) {
1079 this._showSequenceLogo = showSequenceLogo;
1080 this._has_showSequenceLogo = true;
1084 * Sets the value of field 'showUnconserved'.
1086 * @param showUnconserved the value of field 'showUnconserved'.
1088 public void setShowUnconserved(
1089 final boolean showUnconserved) {
1090 this._showUnconserved = showUnconserved;
1091 this._has_showUnconserved = true;
1095 * Sets the value of field 'start'.
1097 * @param start the value of field 'start'.
1099 public void setStart(
1101 this._start = start;
1102 this._has_start = true;
1106 * Sets the value of field 'textCol1'.
1108 * @param textCol1 the value of field 'textCol1'.
1110 public void setTextCol1(
1111 final int textCol1) {
1112 this._textCol1 = textCol1;
1113 this._has_textCol1 = true;
1117 * Sets the value of field 'textCol2'.
1119 * @param textCol2 the value of field 'textCol2'.
1121 public void setTextCol2(
1122 final int textCol2) {
1123 this._textCol2 = textCol2;
1124 this._has_textCol2 = true;
1128 * Sets the value of field 'textColThreshold'.
1130 * @param textColThreshold the value of field 'textColThreshold'
1132 public void setTextColThreshold(
1133 final int textColThreshold) {
1134 this._textColThreshold = textColThreshold;
1135 this._has_textColThreshold = true;
1142 * @throws org.exolab.castor.xml.MarshalException if object is
1143 * null or if any SAXException is thrown during marshaling
1144 * @throws org.exolab.castor.xml.ValidationException if this
1145 * object is an invalid instance according to the schema
1146 * @return the unmarshaled jalview.schemabinding.version2.JGroup
1148 public static jalview.schemabinding.version2.JGroup unmarshal(
1149 final java.io.Reader reader)
1150 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
1151 return (jalview.schemabinding.version2.JGroup) Unmarshaller.unmarshal(jalview.schemabinding.version2.JGroup.class, reader);
1157 * @throws org.exolab.castor.xml.ValidationException if this
1158 * object is an invalid instance according to the schema
1160 public void validate(
1162 throws org.exolab.castor.xml.ValidationException {
1163 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
1164 validator.validate(this);