2 * Jalview - A Sequence Alignment Editor and Viewer (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
171 * Field _ignoreGapsinConsensus.
\r
173 private boolean _ignoreGapsinConsensus = true;
\r
176 * keeps track of state for field: _ignoreGapsinConsensus
\r
178 private boolean _has_ignoreGapsinConsensus;
\r
181 * Field _showConsensusHistogram.
\r
183 private boolean _showConsensusHistogram = true;
\r
186 * keeps track of state for field: _showConsensusHistogram
\r
188 private boolean _has_showConsensusHistogram;
\r
191 * Field _showConsensusProfile.
\r
193 private boolean _showConsensusProfile = false;
\r
196 * keeps track of state for field: _showConsensusProfile
\r
198 private boolean _has_showConsensusProfile;
\r
201 * Optional sequence group ID (only needs to be unique for this
\r
205 private java.lang.String _id;
\r
210 private java.util.Vector _seqList;
\r
213 //----------------/
\r
214 //- Constructors -/
\r
215 //----------------/
\r
219 this._seqList = new java.util.Vector();
\r
231 * @throws java.lang.IndexOutOfBoundsException if the index
\r
232 * given is outside the bounds of the collection
\r
234 public void addSeq(
\r
235 final java.lang.String vSeq)
\r
236 throws java.lang.IndexOutOfBoundsException {
\r
237 this._seqList.addElement(vSeq);
\r
245 * @throws java.lang.IndexOutOfBoundsException if the index
\r
246 * given is outside the bounds of the collection
\r
248 public void addSeq(
\r
250 final java.lang.String vSeq)
\r
251 throws java.lang.IndexOutOfBoundsException {
\r
252 this._seqList.add(index, vSeq);
\r
257 public void deleteColourText(
\r
259 this._has_colourText= false;
\r
264 public void deleteConsThreshold(
\r
266 this._has_consThreshold= false;
\r
271 public void deleteDisplayBoxes(
\r
273 this._has_displayBoxes= false;
\r
278 public void deleteDisplayText(
\r
280 this._has_displayText= false;
\r
285 public void deleteEnd(
\r
287 this._has_end= false;
\r
292 public void deleteIgnoreGapsinConsensus(
\r
294 this._has_ignoreGapsinConsensus= false;
\r
299 public void deleteOutlineColour(
\r
301 this._has_outlineColour= false;
\r
306 public void deletePidThreshold(
\r
308 this._has_pidThreshold= false;
\r
313 public void deleteShowConsensusHistogram(
\r
315 this._has_showConsensusHistogram= false;
\r
320 public void deleteShowConsensusProfile(
\r
322 this._has_showConsensusProfile= false;
\r
327 public void deleteShowUnconserved(
\r
329 this._has_showUnconserved= false;
\r
334 public void deleteStart(
\r
336 this._has_start= false;
\r
341 public void deleteTextCol1(
\r
343 this._has_textCol1= false;
\r
348 public void deleteTextCol2(
\r
350 this._has_textCol2= false;
\r
355 public void deleteTextColThreshold(
\r
357 this._has_textColThreshold= false;
\r
361 * Method enumerateSeq.
\r
363 * @return an Enumeration over all java.lang.String elements
\r
365 public java.util.Enumeration enumerateSeq(
\r
367 return this._seqList.elements();
\r
371 * Returns the value of field 'colour'.
\r
373 * @return the value of field 'Colour'.
\r
375 public java.lang.String getColour(
\r
377 return this._colour;
\r
381 * Returns the value of field 'colourText'.
\r
383 * @return the value of field 'ColourText'.
\r
385 public boolean getColourText(
\r
387 return this._colourText;
\r
391 * Returns the value of field 'consThreshold'.
\r
393 * @return the value of field 'ConsThreshold'.
\r
395 public int getConsThreshold(
\r
397 return this._consThreshold;
\r
401 * Returns the value of field 'displayBoxes'.
\r
403 * @return the value of field 'DisplayBoxes'.
\r
405 public boolean getDisplayBoxes(
\r
407 return this._displayBoxes;
\r
411 * Returns the value of field 'displayText'.
\r
413 * @return the value of field 'DisplayText'.
\r
415 public boolean getDisplayText(
\r
417 return this._displayText;
\r
421 * Returns the value of field 'end'.
\r
423 * @return the value of field 'End'.
\r
431 * Returns the value of field 'id'. The field 'id' has the
\r
432 * following description: Optional sequence group ID (only
\r
433 * needs to be unique for this alignment)
\r
436 * @return the value of field 'Id'.
\r
438 public java.lang.String getId(
\r
444 * Returns the value of field 'ignoreGapsinConsensus'.
\r
446 * @return the value of field 'IgnoreGapsinConsensus'.
\r
448 public boolean getIgnoreGapsinConsensus(
\r
450 return this._ignoreGapsinConsensus;
\r
454 * Returns the value of field 'name'.
\r
456 * @return the value of field 'Name'.
\r
458 public java.lang.String getName(
\r
464 * Returns the value of field 'outlineColour'.
\r
466 * @return the value of field 'OutlineColour'.
\r
468 public int getOutlineColour(
\r
470 return this._outlineColour;
\r
474 * Returns the value of field 'pidThreshold'.
\r
476 * @return the value of field 'PidThreshold'.
\r
478 public int getPidThreshold(
\r
480 return this._pidThreshold;
\r
487 * @throws java.lang.IndexOutOfBoundsException if the index
\r
488 * given is outside the bounds of the collection
\r
489 * @return the value of the java.lang.String at the given index
\r
491 public java.lang.String getSeq(
\r
493 throws java.lang.IndexOutOfBoundsException {
\r
494 // check bounds for index
\r
495 if (index < 0 || index >= this._seqList.size()) {
\r
496 throw new IndexOutOfBoundsException("getSeq: Index value '" + index + "' not in range [0.." + (this._seqList.size() - 1) + "]");
\r
499 return (java.lang.String) _seqList.get(index);
\r
503 * Method getSeq.Returns the contents of the collection in an
\r
504 * Array. <p>Note: Just in case the collection contents are
\r
505 * changing in another thread, we pass a 0-length Array of the
\r
506 * correct type into the API call. This way we <i>know</i>
\r
507 * that the Array returned is of exactly the correct length.
\r
509 * @return this collection as an Array
\r
511 public java.lang.String[] getSeq(
\r
513 java.lang.String[] array = new java.lang.String[0];
\r
514 return (java.lang.String[]) this._seqList.toArray(array);
\r
518 * Method getSeqCount.
\r
520 * @return the size of this collection
\r
522 public int getSeqCount(
\r
524 return this._seqList.size();
\r
528 * Returns the value of field 'showConsensusHistogram'.
\r
530 * @return the value of field 'ShowConsensusHistogram'.
\r
532 public boolean getShowConsensusHistogram(
\r
534 return this._showConsensusHistogram;
\r
538 * Returns the value of field 'showConsensusProfile'.
\r
540 * @return the value of field 'ShowConsensusProfile'.
\r
542 public boolean getShowConsensusProfile(
\r
544 return this._showConsensusProfile;
\r
548 * Returns the value of field 'showUnconserved'.
\r
550 * @return the value of field 'ShowUnconserved'.
\r
552 public boolean getShowUnconserved(
\r
554 return this._showUnconserved;
\r
558 * Returns the value of field 'start'.
\r
560 * @return the value of field 'Start'.
\r
562 public int getStart(
\r
564 return this._start;
\r
568 * Returns the value of field 'textCol1'.
\r
570 * @return the value of field 'TextCol1'.
\r
572 public int getTextCol1(
\r
574 return this._textCol1;
\r
578 * Returns the value of field 'textCol2'.
\r
580 * @return the value of field 'TextCol2'.
\r
582 public int getTextCol2(
\r
584 return this._textCol2;
\r
588 * Returns the value of field 'textColThreshold'.
\r
590 * @return the value of field 'TextColThreshold'.
\r
592 public int getTextColThreshold(
\r
594 return this._textColThreshold;
\r
598 * Method hasColourText.
\r
600 * @return true if at least one ColourText has been added
\r
602 public boolean hasColourText(
\r
604 return this._has_colourText;
\r
608 * Method hasConsThreshold.
\r
610 * @return true if at least one ConsThreshold has been added
\r
612 public boolean hasConsThreshold(
\r
614 return this._has_consThreshold;
\r
618 * Method hasDisplayBoxes.
\r
620 * @return true if at least one DisplayBoxes has been added
\r
622 public boolean hasDisplayBoxes(
\r
624 return this._has_displayBoxes;
\r
628 * Method hasDisplayText.
\r
630 * @return true if at least one DisplayText has been added
\r
632 public boolean hasDisplayText(
\r
634 return this._has_displayText;
\r
640 * @return true if at least one End has been added
\r
642 public boolean hasEnd(
\r
644 return this._has_end;
\r
648 * Method hasIgnoreGapsinConsensus.
\r
650 * @return true if at least one IgnoreGapsinConsensus has been
\r
653 public boolean hasIgnoreGapsinConsensus(
\r
655 return this._has_ignoreGapsinConsensus;
\r
659 * Method hasOutlineColour.
\r
661 * @return true if at least one OutlineColour has been added
\r
663 public boolean hasOutlineColour(
\r
665 return this._has_outlineColour;
\r
669 * Method hasPidThreshold.
\r
671 * @return true if at least one PidThreshold has been added
\r
673 public boolean hasPidThreshold(
\r
675 return this._has_pidThreshold;
\r
679 * Method hasShowConsensusHistogram.
\r
681 * @return true if at least one ShowConsensusHistogram has been
\r
684 public boolean hasShowConsensusHistogram(
\r
686 return this._has_showConsensusHistogram;
\r
690 * Method hasShowConsensusProfile.
\r
692 * @return true if at least one ShowConsensusProfile has been
\r
695 public boolean hasShowConsensusProfile(
\r
697 return this._has_showConsensusProfile;
\r
701 * Method hasShowUnconserved.
\r
703 * @return true if at least one ShowUnconserved has been added
\r
705 public boolean hasShowUnconserved(
\r
707 return this._has_showUnconserved;
\r
713 * @return true if at least one Start has been added
\r
715 public boolean hasStart(
\r
717 return this._has_start;
\r
721 * Method hasTextCol1.
\r
723 * @return true if at least one TextCol1 has been added
\r
725 public boolean hasTextCol1(
\r
727 return this._has_textCol1;
\r
731 * Method hasTextCol2.
\r
733 * @return true if at least one TextCol2 has been added
\r
735 public boolean hasTextCol2(
\r
737 return this._has_textCol2;
\r
741 * Method hasTextColThreshold.
\r
743 * @return true if at least one TextColThreshold has been added
\r
745 public boolean hasTextColThreshold(
\r
747 return this._has_textColThreshold;
\r
751 * Returns the value of field 'colourText'.
\r
753 * @return the value of field 'ColourText'.
\r
755 public boolean isColourText(
\r
757 return this._colourText;
\r
761 * Returns the value of field 'displayBoxes'.
\r
763 * @return the value of field 'DisplayBoxes'.
\r
765 public boolean isDisplayBoxes(
\r
767 return this._displayBoxes;
\r
771 * Returns the value of field 'displayText'.
\r
773 * @return the value of field 'DisplayText'.
\r
775 public boolean isDisplayText(
\r
777 return this._displayText;
\r
781 * Returns the value of field 'ignoreGapsinConsensus'.
\r
783 * @return the value of field 'IgnoreGapsinConsensus'.
\r
785 public boolean isIgnoreGapsinConsensus(
\r
787 return this._ignoreGapsinConsensus;
\r
791 * Returns the value of field 'showConsensusHistogram'.
\r
793 * @return the value of field 'ShowConsensusHistogram'.
\r
795 public boolean isShowConsensusHistogram(
\r
797 return this._showConsensusHistogram;
\r
801 * Returns the value of field 'showConsensusProfile'.
\r
803 * @return the value of field 'ShowConsensusProfile'.
\r
805 public boolean isShowConsensusProfile(
\r
807 return this._showConsensusProfile;
\r
811 * Returns the value of field 'showUnconserved'.
\r
813 * @return the value of field 'ShowUnconserved'.
\r
815 public boolean isShowUnconserved(
\r
817 return this._showUnconserved;
\r
823 * @return true if this object is valid according to the schema
\r
825 public boolean isValid(
\r
829 } catch (org.exolab.castor.xml.ValidationException vex) {
\r
839 * @throws org.exolab.castor.xml.MarshalException if object is
\r
840 * null or if any SAXException is thrown during marshaling
\r
841 * @throws org.exolab.castor.xml.ValidationException if this
\r
842 * object is an invalid instance according to the schema
\r
844 public void marshal(
\r
845 final java.io.Writer out)
\r
846 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
\r
847 Marshaller.marshal(this, out);
\r
854 * @throws java.io.IOException if an IOException occurs during
\r
856 * @throws org.exolab.castor.xml.ValidationException if this
\r
857 * object is an invalid instance according to the schema
\r
858 * @throws org.exolab.castor.xml.MarshalException if object is
\r
859 * null or if any SAXException is thrown during marshaling
\r
861 public void marshal(
\r
862 final org.xml.sax.ContentHandler handler)
\r
863 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
\r
864 Marshaller.marshal(this, handler);
\r
869 public void removeAllSeq(
\r
871 this._seqList.clear();
\r
875 * Method removeSeq.
\r
878 * @return true if the object was removed from the collection.
\r
880 public boolean removeSeq(
\r
881 final java.lang.String vSeq) {
\r
882 boolean removed = _seqList.remove(vSeq);
\r
887 * Method removeSeqAt.
\r
890 * @return the element removed from the collection
\r
892 public java.lang.String removeSeqAt(
\r
894 java.lang.Object obj = this._seqList.remove(index);
\r
895 return (java.lang.String) obj;
\r
899 * Sets the value of field 'colour'.
\r
901 * @param colour the value of field 'colour'.
\r
903 public void setColour(
\r
904 final java.lang.String colour) {
\r
905 this._colour = colour;
\r
909 * Sets the value of field 'colourText'.
\r
911 * @param colourText the value of field 'colourText'.
\r
913 public void setColourText(
\r
914 final boolean colourText) {
\r
915 this._colourText = colourText;
\r
916 this._has_colourText = true;
\r
920 * Sets the value of field 'consThreshold'.
\r
922 * @param consThreshold the value of field 'consThreshold'.
\r
924 public void setConsThreshold(
\r
925 final int consThreshold) {
\r
926 this._consThreshold = consThreshold;
\r
927 this._has_consThreshold = true;
\r
931 * Sets the value of field 'displayBoxes'.
\r
933 * @param displayBoxes the value of field 'displayBoxes'.
\r
935 public void setDisplayBoxes(
\r
936 final boolean displayBoxes) {
\r
937 this._displayBoxes = displayBoxes;
\r
938 this._has_displayBoxes = true;
\r
942 * Sets the value of field 'displayText'.
\r
944 * @param displayText the value of field 'displayText'.
\r
946 public void setDisplayText(
\r
947 final boolean displayText) {
\r
948 this._displayText = displayText;
\r
949 this._has_displayText = true;
\r
953 * Sets the value of field 'end'.
\r
955 * @param end the value of field 'end'.
\r
957 public void setEnd(
\r
960 this._has_end = true;
\r
964 * Sets the value of field 'id'. The field 'id' has the
\r
965 * following description: Optional sequence group ID (only
\r
966 * needs to be unique for this alignment)
\r
969 * @param id the value of field 'id'.
\r
972 final java.lang.String id) {
\r
977 * Sets the value of field 'ignoreGapsinConsensus'.
\r
979 * @param ignoreGapsinConsensus the value of field
\r
980 * 'ignoreGapsinConsensus'.
\r
982 public void setIgnoreGapsinConsensus(
\r
983 final boolean ignoreGapsinConsensus) {
\r
984 this._ignoreGapsinConsensus = ignoreGapsinConsensus;
\r
985 this._has_ignoreGapsinConsensus = true;
\r
989 * Sets the value of field 'name'.
\r
991 * @param name the value of field 'name'.
\r
993 public void setName(
\r
994 final java.lang.String name) {
\r
999 * Sets the value of field 'outlineColour'.
\r
1001 * @param outlineColour the value of field 'outlineColour'.
\r
1003 public void setOutlineColour(
\r
1004 final int outlineColour) {
\r
1005 this._outlineColour = outlineColour;
\r
1006 this._has_outlineColour = true;
\r
1010 * Sets the value of field 'pidThreshold'.
\r
1012 * @param pidThreshold the value of field 'pidThreshold'.
\r
1014 public void setPidThreshold(
\r
1015 final int pidThreshold) {
\r
1016 this._pidThreshold = pidThreshold;
\r
1017 this._has_pidThreshold = true;
\r
1025 * @throws java.lang.IndexOutOfBoundsException if the index
\r
1026 * given is outside the bounds of the collection
\r
1028 public void setSeq(
\r
1030 final java.lang.String vSeq)
\r
1031 throws java.lang.IndexOutOfBoundsException {
\r
1032 // check bounds for index
\r
1033 if (index < 0 || index >= this._seqList.size()) {
\r
1034 throw new IndexOutOfBoundsException("setSeq: Index value '" + index + "' not in range [0.." + (this._seqList.size() - 1) + "]");
\r
1037 this._seqList.set(index, vSeq);
\r
1043 * @param vSeqArray
\r
1045 public void setSeq(
\r
1046 final java.lang.String[] vSeqArray) {
\r
1050 for (int i = 0; i < vSeqArray.length; i++) {
\r
1051 this._seqList.add(vSeqArray[i]);
\r
1056 * Sets the value of field 'showConsensusHistogram'.
\r
1058 * @param showConsensusHistogram the value of field
\r
1059 * 'showConsensusHistogram'.
\r
1061 public void setShowConsensusHistogram(
\r
1062 final boolean showConsensusHistogram) {
\r
1063 this._showConsensusHistogram = showConsensusHistogram;
\r
1064 this._has_showConsensusHistogram = true;
\r
1068 * Sets the value of field 'showConsensusProfile'.
\r
1070 * @param showConsensusProfile the value of field
\r
1071 * 'showConsensusProfile'.
\r
1073 public void setShowConsensusProfile(
\r
1074 final boolean showConsensusProfile) {
\r
1075 this._showConsensusProfile = showConsensusProfile;
\r
1076 this._has_showConsensusProfile = true;
\r
1080 * Sets the value of field 'showUnconserved'.
\r
1082 * @param showUnconserved the value of field 'showUnconserved'.
\r
1084 public void setShowUnconserved(
\r
1085 final boolean showUnconserved) {
\r
1086 this._showUnconserved = showUnconserved;
\r
1087 this._has_showUnconserved = true;
\r
1091 * Sets the value of field 'start'.
\r
1093 * @param start the value of field 'start'.
\r
1095 public void setStart(
\r
1096 final int start) {
\r
1097 this._start = start;
\r
1098 this._has_start = true;
\r
1102 * Sets the value of field 'textCol1'.
\r
1104 * @param textCol1 the value of field 'textCol1'.
\r
1106 public void setTextCol1(
\r
1107 final int textCol1) {
\r
1108 this._textCol1 = textCol1;
\r
1109 this._has_textCol1 = true;
\r
1113 * Sets the value of field 'textCol2'.
\r
1115 * @param textCol2 the value of field 'textCol2'.
\r
1117 public void setTextCol2(
\r
1118 final int textCol2) {
\r
1119 this._textCol2 = textCol2;
\r
1120 this._has_textCol2 = true;
\r
1124 * Sets the value of field 'textColThreshold'.
\r
1126 * @param textColThreshold the value of field 'textColThreshold'
\r
1128 public void setTextColThreshold(
\r
1129 final int textColThreshold) {
\r
1130 this._textColThreshold = textColThreshold;
\r
1131 this._has_textColThreshold = true;
\r
1135 * Method unmarshal.
\r
1138 * @throws org.exolab.castor.xml.MarshalException if object is
\r
1139 * null or if any SAXException is thrown during marshaling
\r
1140 * @throws org.exolab.castor.xml.ValidationException if this
\r
1141 * object is an invalid instance according to the schema
\r
1142 * @return the unmarshaled jalview.schemabinding.version2.JGroup
\r
1144 public static jalview.schemabinding.version2.JGroup unmarshal(
\r
1145 final java.io.Reader reader)
\r
1146 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
\r
1147 return (jalview.schemabinding.version2.JGroup) Unmarshaller.unmarshal(jalview.schemabinding.version2.JGroup.class, reader);
\r
1153 * @throws org.exolab.castor.xml.ValidationException if this
\r
1154 * object is an invalid instance according to the schema
\r
1156 public void validate(
\r
1158 throws org.exolab.castor.xml.ValidationException {
\r
1159 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
\r
1160 validator.validate(this);
\r