2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2)
3 * Copyright (C) 2014 The Jalview Authors
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
10 * of the License, or (at your option) any later version.
12 * Jalview is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty
14 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with Jalview. If not, see <http://www.gnu.org/licenses/>.
19 * The Jalview Authors are detailed in the 'AUTHORS' file.
21 package jalview.schemabinding.version2;
23 //---------------------------------/
24 //- Imported classes and packages -/
25 //---------------------------------/
27 import org.exolab.castor.xml.Marshaller;
28 import org.exolab.castor.xml.Unmarshaller;
33 * @version $Revision$ $Date$
35 public class JGroup implements java.io.Serializable
38 // --------------------------/
39 // - Class/Member Variables -/
40 // --------------------------/
48 * keeps track of state for field: _start
50 private boolean _has_start;
58 * keeps track of state for field: _end
60 private boolean _has_end;
65 private java.lang.String _name;
70 private java.lang.String _colour;
73 * Field _consThreshold.
75 private int _consThreshold;
78 * keeps track of state for field: _consThreshold
80 private boolean _has_consThreshold;
83 * Field _pidThreshold.
85 private int _pidThreshold;
88 * keeps track of state for field: _pidThreshold
90 private boolean _has_pidThreshold;
93 * Field _outlineColour.
95 private int _outlineColour;
98 * keeps track of state for field: _outlineColour
100 private boolean _has_outlineColour;
103 * Field _displayBoxes.
105 private boolean _displayBoxes;
108 * keeps track of state for field: _displayBoxes
110 private boolean _has_displayBoxes;
113 * Field _displayText.
115 private boolean _displayText;
118 * keeps track of state for field: _displayText
120 private boolean _has_displayText;
125 private boolean _colourText;
128 * keeps track of state for field: _colourText
130 private boolean _has_colourText;
135 private int _textCol1;
138 * keeps track of state for field: _textCol1
140 private boolean _has_textCol1;
145 private int _textCol2;
148 * keeps track of state for field: _textCol2
150 private boolean _has_textCol2;
153 * Field _textColThreshold.
155 private int _textColThreshold;
158 * keeps track of state for field: _textColThreshold
160 private boolean _has_textColThreshold;
163 * Field _showUnconserved.
165 private boolean _showUnconserved;
168 * keeps track of state for field: _showUnconserved
170 private boolean _has_showUnconserved;
173 * Field _ignoreGapsinConsensus.
175 private boolean _ignoreGapsinConsensus = true;
178 * keeps track of state for field: _ignoreGapsinConsensus
180 private boolean _has_ignoreGapsinConsensus;
183 * Field _showConsensusHistogram.
185 private boolean _showConsensusHistogram = true;
188 * keeps track of state for field: _showConsensusHistogram
190 private boolean _has_showConsensusHistogram;
193 * Field _showSequenceLogo.
195 private boolean _showSequenceLogo = false;
198 * keeps track of state for field: _showSequenceLogo
200 private boolean _has_showSequenceLogo;
203 * Field _normaliseSequenceLogo.
205 private boolean _normaliseSequenceLogo = false;
208 * keeps track of state for field: _normaliseSequenceLogo
210 private boolean _has_normaliseSequenceLogo;
213 * Optional sequence group ID (only needs to be unique for this alignment)
216 private java.lang.String _id;
221 private java.util.Vector _seqList;
224 * Field _annotationColours.
226 private jalview.schemabinding.version2.AnnotationColours _annotationColours;
235 this._seqList = new java.util.Vector();
246 * @throws java.lang.IndexOutOfBoundsException
247 * if the index given is outside the bounds of the collection
249 public void addSeq(final java.lang.String vSeq)
250 throws java.lang.IndexOutOfBoundsException
252 this._seqList.addElement(vSeq);
260 * @throws java.lang.IndexOutOfBoundsException
261 * if the index given is outside the bounds of the collection
263 public void addSeq(final int index, final java.lang.String vSeq)
264 throws java.lang.IndexOutOfBoundsException
266 this._seqList.add(index, vSeq);
271 public void deleteColourText()
273 this._has_colourText = false;
278 public void deleteConsThreshold()
280 this._has_consThreshold = false;
285 public void deleteDisplayBoxes()
287 this._has_displayBoxes = false;
292 public void deleteDisplayText()
294 this._has_displayText = false;
299 public void deleteEnd()
301 this._has_end = false;
306 public void deleteIgnoreGapsinConsensus()
308 this._has_ignoreGapsinConsensus = false;
313 public void deleteNormaliseSequenceLogo()
315 this._has_normaliseSequenceLogo = false;
320 public void deleteOutlineColour()
322 this._has_outlineColour = false;
327 public void deletePidThreshold()
329 this._has_pidThreshold = false;
334 public void deleteShowConsensusHistogram()
336 this._has_showConsensusHistogram = false;
341 public void deleteShowSequenceLogo()
343 this._has_showSequenceLogo = false;
348 public void deleteShowUnconserved()
350 this._has_showUnconserved = false;
355 public void deleteStart()
357 this._has_start = false;
362 public void deleteTextCol1()
364 this._has_textCol1 = false;
369 public void deleteTextCol2()
371 this._has_textCol2 = false;
376 public void deleteTextColThreshold()
378 this._has_textColThreshold = false;
382 * Method enumerateSeq.
384 * @return an Enumeration over all java.lang.String elements
386 public java.util.Enumeration enumerateSeq()
388 return this._seqList.elements();
392 * Returns the value of field 'annotationColours'.
394 * @return the value of field 'AnnotationColours'.
396 public jalview.schemabinding.version2.AnnotationColours getAnnotationColours()
398 return this._annotationColours;
402 * Returns the value of field 'colour'.
404 * @return the value of field 'Colour'.
406 public java.lang.String getColour()
412 * Returns the value of field 'colourText'.
414 * @return the value of field 'ColourText'.
416 public boolean getColourText()
418 return this._colourText;
422 * Returns the value of field 'consThreshold'.
424 * @return the value of field 'ConsThreshold'.
426 public int getConsThreshold()
428 return this._consThreshold;
432 * Returns the value of field 'displayBoxes'.
434 * @return the value of field 'DisplayBoxes'.
436 public boolean getDisplayBoxes()
438 return this._displayBoxes;
442 * Returns the value of field 'displayText'.
444 * @return the value of field 'DisplayText'.
446 public boolean getDisplayText()
448 return this._displayText;
452 * Returns the value of field 'end'.
454 * @return the value of field 'End'.
462 * Returns the value of field 'id'. The field 'id' has the following
463 * description: Optional sequence group ID (only needs to be unique for this
467 * @return the value of field 'Id'.
469 public java.lang.String getId()
475 * Returns the value of field 'ignoreGapsinConsensus'.
477 * @return the value of field 'IgnoreGapsinConsensus'.
479 public boolean getIgnoreGapsinConsensus()
481 return this._ignoreGapsinConsensus;
485 * Returns the value of field 'name'.
487 * @return the value of field 'Name'.
489 public java.lang.String getName()
495 * Returns the value of field 'normaliseSequenceLogo'.
497 * @return the value of field 'NormaliseSequenceLogo'.
499 public boolean getNormaliseSequenceLogo()
501 return this._normaliseSequenceLogo;
505 * Returns the value of field 'outlineColour'.
507 * @return the value of field 'OutlineColour'.
509 public int getOutlineColour()
511 return this._outlineColour;
515 * Returns the value of field 'pidThreshold'.
517 * @return the value of field 'PidThreshold'.
519 public int getPidThreshold()
521 return this._pidThreshold;
528 * @throws java.lang.IndexOutOfBoundsException
529 * if the index given is outside the bounds of the collection
530 * @return the value of the java.lang.String at the given index
532 public java.lang.String getSeq(final int index)
533 throws java.lang.IndexOutOfBoundsException
535 // check bounds for index
536 if (index < 0 || index >= this._seqList.size())
538 throw new IndexOutOfBoundsException("getSeq: Index value '" + index
539 + "' not in range [0.." + (this._seqList.size() - 1) + "]");
542 return (java.lang.String) _seqList.get(index);
546 * Method getSeq.Returns the contents of the collection in an Array.
548 * Note: Just in case the collection contents are changing in another thread,
549 * we pass a 0-length Array of the correct type into the API call. This way we
550 * <i>know</i> that the Array returned is of exactly the correct length.
552 * @return this collection as an Array
554 public java.lang.String[] getSeq()
556 java.lang.String[] array = new java.lang.String[0];
557 return (java.lang.String[]) this._seqList.toArray(array);
561 * Method getSeqCount.
563 * @return the size of this collection
565 public int getSeqCount()
567 return this._seqList.size();
571 * Returns the value of field 'showConsensusHistogram'.
573 * @return the value of field 'ShowConsensusHistogram'.
575 public boolean getShowConsensusHistogram()
577 return this._showConsensusHistogram;
581 * Returns the value of field 'showSequenceLogo'.
583 * @return the value of field 'ShowSequenceLogo'.
585 public boolean getShowSequenceLogo()
587 return this._showSequenceLogo;
591 * Returns the value of field 'showUnconserved'.
593 * @return the value of field 'ShowUnconserved'.
595 public boolean getShowUnconserved()
597 return this._showUnconserved;
601 * Returns the value of field 'start'.
603 * @return the value of field 'Start'.
605 public int getStart()
611 * Returns the value of field 'textCol1'.
613 * @return the value of field 'TextCol1'.
615 public int getTextCol1()
617 return this._textCol1;
621 * Returns the value of field 'textCol2'.
623 * @return the value of field 'TextCol2'.
625 public int getTextCol2()
627 return this._textCol2;
631 * Returns the value of field 'textColThreshold'.
633 * @return the value of field 'TextColThreshold'.
635 public int getTextColThreshold()
637 return this._textColThreshold;
641 * Method hasColourText.
643 * @return true if at least one ColourText has been added
645 public boolean hasColourText()
647 return this._has_colourText;
651 * Method hasConsThreshold.
653 * @return true if at least one ConsThreshold has been added
655 public boolean hasConsThreshold()
657 return this._has_consThreshold;
661 * Method hasDisplayBoxes.
663 * @return true if at least one DisplayBoxes has been added
665 public boolean hasDisplayBoxes()
667 return this._has_displayBoxes;
671 * Method hasDisplayText.
673 * @return true if at least one DisplayText has been added
675 public boolean hasDisplayText()
677 return this._has_displayText;
683 * @return true if at least one End has been added
685 public boolean hasEnd()
687 return this._has_end;
691 * Method hasIgnoreGapsinConsensus.
693 * @return true if at least one IgnoreGapsinConsensus has been added
695 public boolean hasIgnoreGapsinConsensus()
697 return this._has_ignoreGapsinConsensus;
701 * Method hasNormaliseSequenceLogo.
703 * @return true if at least one NormaliseSequenceLogo has been added
705 public boolean hasNormaliseSequenceLogo()
707 return this._has_normaliseSequenceLogo;
711 * Method hasOutlineColour.
713 * @return true if at least one OutlineColour has been added
715 public boolean hasOutlineColour()
717 return this._has_outlineColour;
721 * Method hasPidThreshold.
723 * @return true if at least one PidThreshold has been added
725 public boolean hasPidThreshold()
727 return this._has_pidThreshold;
731 * Method hasShowConsensusHistogram.
733 * @return true if at least one ShowConsensusHistogram has been added
735 public boolean hasShowConsensusHistogram()
737 return this._has_showConsensusHistogram;
741 * Method hasShowSequenceLogo.
743 * @return true if at least one ShowSequenceLogo has been added
745 public boolean hasShowSequenceLogo()
747 return this._has_showSequenceLogo;
751 * Method hasShowUnconserved.
753 * @return true if at least one ShowUnconserved has been added
755 public boolean hasShowUnconserved()
757 return this._has_showUnconserved;
763 * @return true if at least one Start has been added
765 public boolean hasStart()
767 return this._has_start;
771 * Method hasTextCol1.
773 * @return true if at least one TextCol1 has been added
775 public boolean hasTextCol1()
777 return this._has_textCol1;
781 * Method hasTextCol2.
783 * @return true if at least one TextCol2 has been added
785 public boolean hasTextCol2()
787 return this._has_textCol2;
791 * Method hasTextColThreshold.
793 * @return true if at least one TextColThreshold has been added
795 public boolean hasTextColThreshold()
797 return this._has_textColThreshold;
801 * Returns the value of field 'colourText'.
803 * @return the value of field 'ColourText'.
805 public boolean isColourText()
807 return this._colourText;
811 * Returns the value of field 'displayBoxes'.
813 * @return the value of field 'DisplayBoxes'.
815 public boolean isDisplayBoxes()
817 return this._displayBoxes;
821 * Returns the value of field 'displayText'.
823 * @return the value of field 'DisplayText'.
825 public boolean isDisplayText()
827 return this._displayText;
831 * Returns the value of field 'ignoreGapsinConsensus'.
833 * @return the value of field 'IgnoreGapsinConsensus'.
835 public boolean isIgnoreGapsinConsensus()
837 return this._ignoreGapsinConsensus;
841 * Returns the value of field 'normaliseSequenceLogo'.
843 * @return the value of field 'NormaliseSequenceLogo'.
845 public boolean isNormaliseSequenceLogo()
847 return this._normaliseSequenceLogo;
851 * Returns the value of field 'showConsensusHistogram'.
853 * @return the value of field 'ShowConsensusHistogram'.
855 public boolean isShowConsensusHistogram()
857 return this._showConsensusHistogram;
861 * Returns the value of field 'showSequenceLogo'.
863 * @return the value of field 'ShowSequenceLogo'.
865 public boolean isShowSequenceLogo()
867 return this._showSequenceLogo;
871 * Returns the value of field 'showUnconserved'.
873 * @return the value of field 'ShowUnconserved'.
875 public boolean isShowUnconserved()
877 return this._showUnconserved;
883 * @return true if this object is valid according to the schema
885 public boolean isValid()
890 } catch (org.exolab.castor.xml.ValidationException vex)
901 * @throws org.exolab.castor.xml.MarshalException
902 * if object is null or if any SAXException is thrown during
904 * @throws org.exolab.castor.xml.ValidationException
905 * if this object is an invalid instance according to the schema
907 public void marshal(final java.io.Writer out)
908 throws org.exolab.castor.xml.MarshalException,
909 org.exolab.castor.xml.ValidationException
911 Marshaller.marshal(this, out);
918 * @throws java.io.IOException
919 * if an IOException occurs during marshaling
920 * @throws org.exolab.castor.xml.ValidationException
921 * if this object is an invalid instance according to the schema
922 * @throws org.exolab.castor.xml.MarshalException
923 * if object is null or if any SAXException is thrown during
926 public void marshal(final org.xml.sax.ContentHandler handler)
927 throws java.io.IOException,
928 org.exolab.castor.xml.MarshalException,
929 org.exolab.castor.xml.ValidationException
931 Marshaller.marshal(this, handler);
936 public void removeAllSeq()
938 this._seqList.clear();
945 * @return true if the object was removed from the collection.
947 public boolean removeSeq(final java.lang.String vSeq)
949 boolean removed = _seqList.remove(vSeq);
954 * Method removeSeqAt.
957 * @return the element removed from the collection
959 public java.lang.String removeSeqAt(final int index)
961 java.lang.Object obj = this._seqList.remove(index);
962 return (java.lang.String) obj;
966 * Sets the value of field 'annotationColours'.
968 * @param annotationColours
969 * the value of field 'annotationColours'.
971 public void setAnnotationColours(
972 final jalview.schemabinding.version2.AnnotationColours annotationColours)
974 this._annotationColours = annotationColours;
978 * Sets the value of field 'colour'.
981 * the value of field 'colour'.
983 public void setColour(final java.lang.String colour)
985 this._colour = colour;
989 * Sets the value of field 'colourText'.
992 * the value of field 'colourText'.
994 public void setColourText(final boolean colourText)
996 this._colourText = colourText;
997 this._has_colourText = true;
1001 * Sets the value of field 'consThreshold'.
1003 * @param consThreshold
1004 * the value of field 'consThreshold'.
1006 public void setConsThreshold(final int consThreshold)
1008 this._consThreshold = consThreshold;
1009 this._has_consThreshold = true;
1013 * Sets the value of field 'displayBoxes'.
1015 * @param displayBoxes
1016 * the value of field 'displayBoxes'.
1018 public void setDisplayBoxes(final boolean displayBoxes)
1020 this._displayBoxes = displayBoxes;
1021 this._has_displayBoxes = true;
1025 * Sets the value of field 'displayText'.
1027 * @param displayText
1028 * the value of field 'displayText'.
1030 public void setDisplayText(final boolean displayText)
1032 this._displayText = displayText;
1033 this._has_displayText = true;
1037 * Sets the value of field 'end'.
1040 * the value of field 'end'.
1042 public void setEnd(final int end)
1045 this._has_end = true;
1049 * Sets the value of field 'id'. The field 'id' has the following description:
1050 * Optional sequence group ID (only needs to be unique for this alignment)
1054 * the value of field 'id'.
1056 public void setId(final java.lang.String id)
1062 * Sets the value of field 'ignoreGapsinConsensus'.
1064 * @param ignoreGapsinConsensus
1065 * the value of field 'ignoreGapsinConsensus'.
1067 public void setIgnoreGapsinConsensus(final boolean ignoreGapsinConsensus)
1069 this._ignoreGapsinConsensus = ignoreGapsinConsensus;
1070 this._has_ignoreGapsinConsensus = true;
1074 * Sets the value of field 'name'.
1077 * the value of field 'name'.
1079 public void setName(final java.lang.String name)
1085 * Sets the value of field 'normaliseSequenceLogo'.
1087 * @param normaliseSequenceLogo
1088 * the value of field 'normaliseSequenceLogo'.
1090 public void setNormaliseSequenceLogo(final boolean normaliseSequenceLogo)
1092 this._normaliseSequenceLogo = normaliseSequenceLogo;
1093 this._has_normaliseSequenceLogo = true;
1097 * Sets the value of field 'outlineColour'.
1099 * @param outlineColour
1100 * the value of field 'outlineColour'.
1102 public void setOutlineColour(final int outlineColour)
1104 this._outlineColour = outlineColour;
1105 this._has_outlineColour = true;
1109 * Sets the value of field 'pidThreshold'.
1111 * @param pidThreshold
1112 * the value of field 'pidThreshold'.
1114 public void setPidThreshold(final int pidThreshold)
1116 this._pidThreshold = pidThreshold;
1117 this._has_pidThreshold = true;
1125 * @throws java.lang.IndexOutOfBoundsException
1126 * if the index given is outside the bounds of the collection
1128 public void setSeq(final int index, final java.lang.String vSeq)
1129 throws java.lang.IndexOutOfBoundsException
1131 // check bounds for index
1132 if (index < 0 || index >= this._seqList.size())
1134 throw new IndexOutOfBoundsException("setSeq: Index value '" + index
1135 + "' not in range [0.." + (this._seqList.size() - 1) + "]");
1138 this._seqList.set(index, vSeq);
1146 public void setSeq(final java.lang.String[] vSeqArray)
1151 for (int i = 0; i < vSeqArray.length; i++)
1153 this._seqList.add(vSeqArray[i]);
1158 * Sets the value of field 'showConsensusHistogram'.
1160 * @param showConsensusHistogram
1161 * the value of field 'showConsensusHistogram'.
1163 public void setShowConsensusHistogram(final boolean showConsensusHistogram)
1165 this._showConsensusHistogram = showConsensusHistogram;
1166 this._has_showConsensusHistogram = true;
1170 * Sets the value of field 'showSequenceLogo'.
1172 * @param showSequenceLogo
1173 * the value of field 'showSequenceLogo'
1175 public void setShowSequenceLogo(final boolean showSequenceLogo)
1177 this._showSequenceLogo = showSequenceLogo;
1178 this._has_showSequenceLogo = true;
1182 * Sets the value of field 'showUnconserved'.
1184 * @param showUnconserved
1185 * the value of field 'showUnconserved'.
1187 public void setShowUnconserved(final boolean showUnconserved)
1189 this._showUnconserved = showUnconserved;
1190 this._has_showUnconserved = true;
1194 * Sets the value of field 'start'.
1197 * the value of field 'start'.
1199 public void setStart(final int start)
1201 this._start = start;
1202 this._has_start = true;
1206 * Sets the value of field 'textCol1'.
1209 * the value of field 'textCol1'.
1211 public void setTextCol1(final int textCol1)
1213 this._textCol1 = textCol1;
1214 this._has_textCol1 = true;
1218 * Sets the value of field 'textCol2'.
1221 * the value of field 'textCol2'.
1223 public void setTextCol2(final int textCol2)
1225 this._textCol2 = textCol2;
1226 this._has_textCol2 = true;
1230 * Sets the value of field 'textColThreshold'.
1232 * @param textColThreshold
1233 * the value of field 'textColThreshold'
1235 public void setTextColThreshold(final int textColThreshold)
1237 this._textColThreshold = textColThreshold;
1238 this._has_textColThreshold = true;
1245 * @throws org.exolab.castor.xml.MarshalException
1246 * if object is null or if any SAXException is thrown during
1248 * @throws org.exolab.castor.xml.ValidationException
1249 * if this object is an invalid instance according to the schema
1250 * @return the unmarshaled jalview.schemabinding.version2.JGroup
1252 public static jalview.schemabinding.version2.JGroup unmarshal(
1253 final java.io.Reader reader)
1254 throws org.exolab.castor.xml.MarshalException,
1255 org.exolab.castor.xml.ValidationException
1257 return (jalview.schemabinding.version2.JGroup) Unmarshaller.unmarshal(
1258 jalview.schemabinding.version2.JGroup.class, reader);
1264 * @throws org.exolab.castor.xml.ValidationException
1265 * if this object is an invalid instance according to the schema
1267 public void validate() throws org.exolab.castor.xml.ValidationException
1269 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
1270 validator.validate(this);