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 _showSequenceLogo.
\r
193 private boolean _showSequenceLogo = false;
\r
196 * keeps track of state for field: _showSequenceLogo
\r
198 private boolean _has_showSequenceLogo;
\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 deleteShowSequenceLogo(
\r
322 this._has_showSequenceLogo= 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 'showSequenceLogo'.
\r
540 * @return the value of field 'ShowSequenceLogo'.
\r
542 public boolean getShowSequenceLogo(
\r
544 return this._showSequenceLogo;
\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 hasShowSequenceLogo.
\r
692 * @return true if at least one ShowSequenceLogo has been added
\r
694 public boolean hasShowSequenceLogo(
\r
696 return this._has_showSequenceLogo;
\r
700 * Method hasShowUnconserved.
\r
702 * @return true if at least one ShowUnconserved has been added
\r
704 public boolean hasShowUnconserved(
\r
706 return this._has_showUnconserved;
\r
712 * @return true if at least one Start has been added
\r
714 public boolean hasStart(
\r
716 return this._has_start;
\r
720 * Method hasTextCol1.
\r
722 * @return true if at least one TextCol1 has been added
\r
724 public boolean hasTextCol1(
\r
726 return this._has_textCol1;
\r
730 * Method hasTextCol2.
\r
732 * @return true if at least one TextCol2 has been added
\r
734 public boolean hasTextCol2(
\r
736 return this._has_textCol2;
\r
740 * Method hasTextColThreshold.
\r
742 * @return true if at least one TextColThreshold has been added
\r
744 public boolean hasTextColThreshold(
\r
746 return this._has_textColThreshold;
\r
750 * Returns the value of field 'colourText'.
\r
752 * @return the value of field 'ColourText'.
\r
754 public boolean isColourText(
\r
756 return this._colourText;
\r
760 * Returns the value of field 'displayBoxes'.
\r
762 * @return the value of field 'DisplayBoxes'.
\r
764 public boolean isDisplayBoxes(
\r
766 return this._displayBoxes;
\r
770 * Returns the value of field 'displayText'.
\r
772 * @return the value of field 'DisplayText'.
\r
774 public boolean isDisplayText(
\r
776 return this._displayText;
\r
780 * Returns the value of field 'ignoreGapsinConsensus'.
\r
782 * @return the value of field 'IgnoreGapsinConsensus'.
\r
784 public boolean isIgnoreGapsinConsensus(
\r
786 return this._ignoreGapsinConsensus;
\r
790 * Returns the value of field 'showConsensusHistogram'.
\r
792 * @return the value of field 'ShowConsensusHistogram'.
\r
794 public boolean isShowConsensusHistogram(
\r
796 return this._showConsensusHistogram;
\r
800 * Returns the value of field 'showSequenceLogo'.
\r
802 * @return the value of field 'ShowSequenceLogo'.
\r
804 public boolean isShowSequenceLogo(
\r
806 return this._showSequenceLogo;
\r
810 * Returns the value of field 'showUnconserved'.
\r
812 * @return the value of field 'ShowUnconserved'.
\r
814 public boolean isShowUnconserved(
\r
816 return this._showUnconserved;
\r
822 * @return true if this object is valid according to the schema
\r
824 public boolean isValid(
\r
828 } catch (org.exolab.castor.xml.ValidationException vex) {
\r
838 * @throws org.exolab.castor.xml.MarshalException if object is
\r
839 * null or if any SAXException is thrown during marshaling
\r
840 * @throws org.exolab.castor.xml.ValidationException if this
\r
841 * object is an invalid instance according to the schema
\r
843 public void marshal(
\r
844 final java.io.Writer out)
\r
845 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
\r
846 Marshaller.marshal(this, out);
\r
853 * @throws java.io.IOException if an IOException occurs during
\r
855 * @throws org.exolab.castor.xml.ValidationException if this
\r
856 * object is an invalid instance according to the schema
\r
857 * @throws org.exolab.castor.xml.MarshalException if object is
\r
858 * null or if any SAXException is thrown during marshaling
\r
860 public void marshal(
\r
861 final org.xml.sax.ContentHandler handler)
\r
862 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
\r
863 Marshaller.marshal(this, handler);
\r
868 public void removeAllSeq(
\r
870 this._seqList.clear();
\r
874 * Method removeSeq.
\r
877 * @return true if the object was removed from the collection.
\r
879 public boolean removeSeq(
\r
880 final java.lang.String vSeq) {
\r
881 boolean removed = _seqList.remove(vSeq);
\r
886 * Method removeSeqAt.
\r
889 * @return the element removed from the collection
\r
891 public java.lang.String removeSeqAt(
\r
893 java.lang.Object obj = this._seqList.remove(index);
\r
894 return (java.lang.String) obj;
\r
898 * Sets the value of field 'colour'.
\r
900 * @param colour the value of field 'colour'.
\r
902 public void setColour(
\r
903 final java.lang.String colour) {
\r
904 this._colour = colour;
\r
908 * Sets the value of field 'colourText'.
\r
910 * @param colourText the value of field 'colourText'.
\r
912 public void setColourText(
\r
913 final boolean colourText) {
\r
914 this._colourText = colourText;
\r
915 this._has_colourText = true;
\r
919 * Sets the value of field 'consThreshold'.
\r
921 * @param consThreshold the value of field 'consThreshold'.
\r
923 public void setConsThreshold(
\r
924 final int consThreshold) {
\r
925 this._consThreshold = consThreshold;
\r
926 this._has_consThreshold = true;
\r
930 * Sets the value of field 'displayBoxes'.
\r
932 * @param displayBoxes the value of field 'displayBoxes'.
\r
934 public void setDisplayBoxes(
\r
935 final boolean displayBoxes) {
\r
936 this._displayBoxes = displayBoxes;
\r
937 this._has_displayBoxes = true;
\r
941 * Sets the value of field 'displayText'.
\r
943 * @param displayText the value of field 'displayText'.
\r
945 public void setDisplayText(
\r
946 final boolean displayText) {
\r
947 this._displayText = displayText;
\r
948 this._has_displayText = true;
\r
952 * Sets the value of field 'end'.
\r
954 * @param end the value of field 'end'.
\r
956 public void setEnd(
\r
959 this._has_end = true;
\r
963 * Sets the value of field 'id'. The field 'id' has the
\r
964 * following description: Optional sequence group ID (only
\r
965 * needs to be unique for this alignment)
\r
968 * @param id the value of field 'id'.
\r
971 final java.lang.String id) {
\r
976 * Sets the value of field 'ignoreGapsinConsensus'.
\r
978 * @param ignoreGapsinConsensus the value of field
\r
979 * 'ignoreGapsinConsensus'.
\r
981 public void setIgnoreGapsinConsensus(
\r
982 final boolean ignoreGapsinConsensus) {
\r
983 this._ignoreGapsinConsensus = ignoreGapsinConsensus;
\r
984 this._has_ignoreGapsinConsensus = true;
\r
988 * Sets the value of field 'name'.
\r
990 * @param name the value of field 'name'.
\r
992 public void setName(
\r
993 final java.lang.String name) {
\r
998 * Sets the value of field 'outlineColour'.
\r
1000 * @param outlineColour the value of field 'outlineColour'.
\r
1002 public void setOutlineColour(
\r
1003 final int outlineColour) {
\r
1004 this._outlineColour = outlineColour;
\r
1005 this._has_outlineColour = true;
\r
1009 * Sets the value of field 'pidThreshold'.
\r
1011 * @param pidThreshold the value of field 'pidThreshold'.
\r
1013 public void setPidThreshold(
\r
1014 final int pidThreshold) {
\r
1015 this._pidThreshold = pidThreshold;
\r
1016 this._has_pidThreshold = true;
\r
1024 * @throws java.lang.IndexOutOfBoundsException if the index
\r
1025 * given is outside the bounds of the collection
\r
1027 public void setSeq(
\r
1029 final java.lang.String vSeq)
\r
1030 throws java.lang.IndexOutOfBoundsException {
\r
1031 // check bounds for index
\r
1032 if (index < 0 || index >= this._seqList.size()) {
\r
1033 throw new IndexOutOfBoundsException("setSeq: Index value '" + index + "' not in range [0.." + (this._seqList.size() - 1) + "]");
\r
1036 this._seqList.set(index, vSeq);
\r
1042 * @param vSeqArray
\r
1044 public void setSeq(
\r
1045 final java.lang.String[] vSeqArray) {
\r
1049 for (int i = 0; i < vSeqArray.length; i++) {
\r
1050 this._seqList.add(vSeqArray[i]);
\r
1055 * Sets the value of field 'showConsensusHistogram'.
\r
1057 * @param showConsensusHistogram the value of field
\r
1058 * 'showConsensusHistogram'.
\r
1060 public void setShowConsensusHistogram(
\r
1061 final boolean showConsensusHistogram) {
\r
1062 this._showConsensusHistogram = showConsensusHistogram;
\r
1063 this._has_showConsensusHistogram = true;
\r
1067 * Sets the value of field 'showSequenceLogo'.
\r
1069 * @param showSequenceLogo the value of field 'showSequenceLogo'
\r
1071 public void setShowSequenceLogo(
\r
1072 final boolean showSequenceLogo) {
\r
1073 this._showSequenceLogo = showSequenceLogo;
\r
1074 this._has_showSequenceLogo = true;
\r
1078 * Sets the value of field 'showUnconserved'.
\r
1080 * @param showUnconserved the value of field 'showUnconserved'.
\r
1082 public void setShowUnconserved(
\r
1083 final boolean showUnconserved) {
\r
1084 this._showUnconserved = showUnconserved;
\r
1085 this._has_showUnconserved = true;
\r
1089 * Sets the value of field 'start'.
\r
1091 * @param start the value of field 'start'.
\r
1093 public void setStart(
\r
1094 final int start) {
\r
1095 this._start = start;
\r
1096 this._has_start = true;
\r
1100 * Sets the value of field 'textCol1'.
\r
1102 * @param textCol1 the value of field 'textCol1'.
\r
1104 public void setTextCol1(
\r
1105 final int textCol1) {
\r
1106 this._textCol1 = textCol1;
\r
1107 this._has_textCol1 = true;
\r
1111 * Sets the value of field 'textCol2'.
\r
1113 * @param textCol2 the value of field 'textCol2'.
\r
1115 public void setTextCol2(
\r
1116 final int textCol2) {
\r
1117 this._textCol2 = textCol2;
\r
1118 this._has_textCol2 = true;
\r
1122 * Sets the value of field 'textColThreshold'.
\r
1124 * @param textColThreshold the value of field 'textColThreshold'
\r
1126 public void setTextColThreshold(
\r
1127 final int textColThreshold) {
\r
1128 this._textColThreshold = textColThreshold;
\r
1129 this._has_textColThreshold = true;
\r
1133 * Method unmarshal.
\r
1136 * @throws org.exolab.castor.xml.MarshalException if object is
\r
1137 * null or if any SAXException is thrown during marshaling
\r
1138 * @throws org.exolab.castor.xml.ValidationException if this
\r
1139 * object is an invalid instance according to the schema
\r
1140 * @return the unmarshaled jalview.schemabinding.version2.JGroup
\r
1142 public static jalview.schemabinding.version2.JGroup unmarshal(
\r
1143 final java.io.Reader reader)
\r
1144 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
\r
1145 return (jalview.schemabinding.version2.JGroup) Unmarshaller.unmarshal(jalview.schemabinding.version2.JGroup.class, reader);
\r
1151 * @throws org.exolab.castor.xml.ValidationException if this
\r
1152 * object is an invalid instance according to the schema
\r
1154 public void validate(
\r
1156 throws org.exolab.castor.xml.ValidationException {
\r
1157 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
\r
1158 validator.validate(this);
\r