Use font.getName, not font.getFontName
[jalview.git] / src / jalview / binding / JGroup.java
index eef4a28..5b6d74e 100755 (executable)
@@ -4,54 +4,36 @@
  * Schema.\r
  * $Id$\r
  */\r
+package jalview.binding;\r
 \r
-/*\r
-* Jalview - A Sequence Alignment Editor and Viewer\r
-* Copyright (C) 2005 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle\r
-*\r
-* This program is free software; you can redistribute it and/or\r
-* modify it under the terms of the GNU General Public License\r
-* as published by the Free Software Foundation; either version 2\r
-* of the License, or (at your option) any later version.\r
-*\r
-* This program is distributed in the hope that it will be useful,\r
-* but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
-* GNU General Public License for more details.\r
-*\r
-* You should have received a copy of the GNU General Public License\r
-* along with this program; if not, write to the Free Software\r
-* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA\r
-*/\r
+import org.exolab.castor.xml.MarshalException;\r
+import org.exolab.castor.xml.Marshaller;\r
+import org.exolab.castor.xml.Unmarshaller;\r
+import org.exolab.castor.xml.ValidationException;\r
 \r
-package jalview.binding;\r
+import org.xml.sax.ContentHandler;\r
 \r
-  //---------------------------------/\r
- //- Imported classes and packages -/\r
 //---------------------------------/\r
-\r
+//- Imported classes and packages -/\r
+//---------------------------------/\r
 import java.io.IOException;\r
 import java.io.Reader;\r
 import java.io.Serializable;\r
 import java.io.Writer;\r
+\r
 import java.util.Enumeration;\r
 import java.util.Vector;\r
-import org.exolab.castor.xml.MarshalException;\r
-import org.exolab.castor.xml.Marshaller;\r
-import org.exolab.castor.xml.Unmarshaller;\r
-import org.exolab.castor.xml.ValidationException;\r
-import org.xml.sax.ContentHandler;\r
+\r
 \r
 /**\r
  * Class JGroup.\r
  *\r
  * @version $Revision$ $Date$\r
  */\r
-public class JGroup implements java.io.Serializable {\r
-\r
-\r
-      //--------------------------/\r
-     //- Class/Member Variables -/\r
+public class JGroup implements java.io.Serializable\r
+{\r
+    //--------------------------/\r
+    //- Class/Member Variables -/\r
     //--------------------------/\r
 \r
     /**\r
@@ -149,33 +131,31 @@ public class JGroup implements java.io.Serializable {
      */\r
     private java.util.Vector _seqList;\r
 \r
-\r
-      //----------------/\r
-     //- Constructors -/\r
     //----------------/\r
-\r
-    public JGroup() {\r
+    //- Constructors -/\r
+    //----------------/\r
+    public JGroup()\r
+    {\r
         super();\r
         _seqList = new Vector();\r
-    } //-- jalview.binding.JGroup()\r
-\r
+    }\r
 \r
-      //-----------/\r
-     //- Methods -/\r
+    //-- jalview.binding.JGroup()\r
     //-----------/\r
 \r
     /**\r
-     * Method addSeq\r
-     *\r
+     * DOCUMENT ME!\r
      *\r
+     * @param vSeq DOCUMENT ME!\r
      *\r
-     * @param vSeq\r
+     * @throws java.lang.IndexOutOfBoundsException DOCUMENT ME!\r
      */\r
-    public void addSeq(int vSeq)\r
-        throws java.lang.IndexOutOfBoundsException\r
+    public void addSeq(int vSeq) throws java.lang.IndexOutOfBoundsException\r
     {\r
         _seqList.addElement(new java.lang.Integer(vSeq));\r
-    } //-- void addSeq(int)\r
+    }\r
+\r
+    //-- void addSeq(int) \r
 \r
     /**\r
      * Method addSeq\r
@@ -189,7 +169,9 @@ public class JGroup implements java.io.Serializable {
         throws java.lang.IndexOutOfBoundsException\r
     {\r
         _seqList.insertElementAt(new java.lang.Integer(vSeq), index);\r
-    } //-- void addSeq(int, int)\r
+    }\r
+\r
+    //-- void addSeq(int, int) \r
 \r
     /**\r
      * Method deleteColourText\r
@@ -197,8 +179,10 @@ public class JGroup implements java.io.Serializable {
      */\r
     public void deleteColourText()\r
     {\r
-        this._has_colourText= false;\r
-    } //-- void deleteColourText()\r
+        this._has_colourText = false;\r
+    }\r
+\r
+    //-- void deleteColourText() \r
 \r
     /**\r
      * Method deleteConsThreshold\r
@@ -206,8 +190,10 @@ public class JGroup implements java.io.Serializable {
      */\r
     public void deleteConsThreshold()\r
     {\r
-        this._has_consThreshold= false;\r
-    } //-- void deleteConsThreshold()\r
+        this._has_consThreshold = false;\r
+    }\r
+\r
+    //-- void deleteConsThreshold() \r
 \r
     /**\r
      * Method deleteDisplayBoxes\r
@@ -215,8 +201,10 @@ public class JGroup implements java.io.Serializable {
      */\r
     public void deleteDisplayBoxes()\r
     {\r
-        this._has_displayBoxes= false;\r
-    } //-- void deleteDisplayBoxes()\r
+        this._has_displayBoxes = false;\r
+    }\r
+\r
+    //-- void deleteDisplayBoxes() \r
 \r
     /**\r
      * Method deleteDisplayText\r
@@ -224,8 +212,10 @@ public class JGroup implements java.io.Serializable {
      */\r
     public void deleteDisplayText()\r
     {\r
-        this._has_displayText= false;\r
-    } //-- void deleteDisplayText()\r
+        this._has_displayText = false;\r
+    }\r
+\r
+    //-- void deleteDisplayText() \r
 \r
     /**\r
      * Method deleteEnd\r
@@ -233,8 +223,10 @@ public class JGroup implements java.io.Serializable {
      */\r
     public void deleteEnd()\r
     {\r
-        this._has_end= false;\r
-    } //-- void deleteEnd()\r
+        this._has_end = false;\r
+    }\r
+\r
+    //-- void deleteEnd() \r
 \r
     /**\r
      * Method deleteOutlineColour\r
@@ -242,8 +234,10 @@ public class JGroup implements java.io.Serializable {
      */\r
     public void deleteOutlineColour()\r
     {\r
-        this._has_outlineColour= false;\r
-    } //-- void deleteOutlineColour()\r
+        this._has_outlineColour = false;\r
+    }\r
+\r
+    //-- void deleteOutlineColour() \r
 \r
     /**\r
      * Method deletePidThreshold\r
@@ -251,8 +245,10 @@ public class JGroup implements java.io.Serializable {
      */\r
     public void deletePidThreshold()\r
     {\r
-        this._has_pidThreshold= false;\r
-    } //-- void deletePidThreshold()\r
+        this._has_pidThreshold = false;\r
+    }\r
+\r
+    //-- void deletePidThreshold() \r
 \r
     /**\r
      * Method deleteStart\r
@@ -260,8 +256,10 @@ public class JGroup implements java.io.Serializable {
      */\r
     public void deleteStart()\r
     {\r
-        this._has_start= false;\r
-    } //-- void deleteStart()\r
+        this._has_start = false;\r
+    }\r
+\r
+    //-- void deleteStart() \r
 \r
     /**\r
      * Method enumerateSeq\r
@@ -273,7 +271,9 @@ public class JGroup implements java.io.Serializable {
     public java.util.Enumeration enumerateSeq()\r
     {\r
         return _seqList.elements();\r
-    } //-- java.util.Enumeration enumerateSeq()\r
+    }\r
+\r
+    //-- java.util.Enumeration enumerateSeq() \r
 \r
     /**\r
      * Returns the value of field 'colour'.\r
@@ -284,7 +284,9 @@ public class JGroup implements java.io.Serializable {
     public java.lang.String getColour()\r
     {\r
         return this._colour;\r
-    } //-- java.lang.String getColour()\r
+    }\r
+\r
+    //-- java.lang.String getColour() \r
 \r
     /**\r
      * Returns the value of field 'colourText'.\r
@@ -295,7 +297,9 @@ public class JGroup implements java.io.Serializable {
     public boolean getColourText()\r
     {\r
         return this._colourText;\r
-    } //-- boolean getColourText()\r
+    }\r
+\r
+    //-- boolean getColourText() \r
 \r
     /**\r
      * Returns the value of field 'consThreshold'.\r
@@ -306,7 +310,9 @@ public class JGroup implements java.io.Serializable {
     public int getConsThreshold()\r
     {\r
         return this._consThreshold;\r
-    } //-- int getConsThreshold()\r
+    }\r
+\r
+    //-- int getConsThreshold() \r
 \r
     /**\r
      * Returns the value of field 'displayBoxes'.\r
@@ -317,7 +323,9 @@ public class JGroup implements java.io.Serializable {
     public boolean getDisplayBoxes()\r
     {\r
         return this._displayBoxes;\r
-    } //-- boolean getDisplayBoxes()\r
+    }\r
+\r
+    //-- boolean getDisplayBoxes() \r
 \r
     /**\r
      * Returns the value of field 'displayText'.\r
@@ -328,7 +336,9 @@ public class JGroup implements java.io.Serializable {
     public boolean getDisplayText()\r
     {\r
         return this._displayText;\r
-    } //-- boolean getDisplayText()\r
+    }\r
+\r
+    //-- boolean getDisplayText() \r
 \r
     /**\r
      * Returns the value of field 'end'.\r
@@ -339,7 +349,9 @@ public class JGroup implements java.io.Serializable {
     public int getEnd()\r
     {\r
         return this._end;\r
-    } //-- int getEnd()\r
+    }\r
+\r
+    //-- int getEnd() \r
 \r
     /**\r
      * Returns the value of field 'name'.\r
@@ -350,7 +362,9 @@ public class JGroup implements java.io.Serializable {
     public java.lang.String getName()\r
     {\r
         return this._name;\r
-    } //-- java.lang.String getName()\r
+    }\r
+\r
+    //-- java.lang.String getName() \r
 \r
     /**\r
      * Returns the value of field 'outlineColour'.\r
@@ -361,7 +375,9 @@ public class JGroup implements java.io.Serializable {
     public int getOutlineColour()\r
     {\r
         return this._outlineColour;\r
-    } //-- int getOutlineColour()\r
+    }\r
+\r
+    //-- int getOutlineColour() \r
 \r
     /**\r
      * Returns the value of field 'pidThreshold'.\r
@@ -372,7 +388,9 @@ public class JGroup implements java.io.Serializable {
     public int getPidThreshold()\r
     {\r
         return this._pidThreshold;\r
-    } //-- int getPidThreshold()\r
+    }\r
+\r
+    //-- int getPidThreshold() \r
 \r
     /**\r
      * Method getSeq\r
@@ -382,16 +400,18 @@ public class JGroup implements java.io.Serializable {
      * @param index\r
      * @return int\r
      */\r
-    public int getSeq(int index)\r
-        throws java.lang.IndexOutOfBoundsException\r
+    public int getSeq(int index) throws java.lang.IndexOutOfBoundsException\r
     {\r
         //-- check bounds for index\r
-        if ((index < 0) || (index > _seqList.size())) {\r
+        if ((index < 0) || (index > _seqList.size()))\r
+        {\r
             throw new IndexOutOfBoundsException();\r
         }\r
 \r
-        return ((java.lang.Integer)_seqList.elementAt(index)).intValue();\r
-    } //-- int getSeq(int)\r
+        return ((java.lang.Integer) _seqList.elementAt(index)).intValue();\r
+    }\r
+\r
+    //-- int getSeq(int) \r
 \r
     /**\r
      * Method getSeq\r
@@ -404,11 +424,16 @@ public class JGroup implements java.io.Serializable {
     {\r
         int size = _seqList.size();\r
         int[] mArray = new int[size];\r
-        for (int index = 0; index < size; index++) {\r
-            mArray[index] = ((java.lang.Integer)_seqList.elementAt(index)).intValue();\r
+\r
+        for (int index = 0; index < size; index++)\r
+        {\r
+            mArray[index] = ((java.lang.Integer) _seqList.elementAt(index)).intValue();\r
         }\r
+\r
         return mArray;\r
-    } //-- int[] getSeq()\r
+    }\r
+\r
+    //-- int[] getSeq() \r
 \r
     /**\r
      * Method getSeqCount\r
@@ -420,7 +445,9 @@ public class JGroup implements java.io.Serializable {
     public int getSeqCount()\r
     {\r
         return _seqList.size();\r
-    } //-- int getSeqCount()\r
+    }\r
+\r
+    //-- int getSeqCount() \r
 \r
     /**\r
      * Returns the value of field 'start'.\r
@@ -431,7 +458,9 @@ public class JGroup implements java.io.Serializable {
     public int getStart()\r
     {\r
         return this._start;\r
-    } //-- int getStart()\r
+    }\r
+\r
+    //-- int getStart() \r
 \r
     /**\r
      * Method hasColourText\r
@@ -443,7 +472,9 @@ public class JGroup implements java.io.Serializable {
     public boolean hasColourText()\r
     {\r
         return this._has_colourText;\r
-    } //-- boolean hasColourText()\r
+    }\r
+\r
+    //-- boolean hasColourText() \r
 \r
     /**\r
      * Method hasConsThreshold\r
@@ -455,7 +486,9 @@ public class JGroup implements java.io.Serializable {
     public boolean hasConsThreshold()\r
     {\r
         return this._has_consThreshold;\r
-    } //-- boolean hasConsThreshold()\r
+    }\r
+\r
+    //-- boolean hasConsThreshold() \r
 \r
     /**\r
      * Method hasDisplayBoxes\r
@@ -467,7 +500,9 @@ public class JGroup implements java.io.Serializable {
     public boolean hasDisplayBoxes()\r
     {\r
         return this._has_displayBoxes;\r
-    } //-- boolean hasDisplayBoxes()\r
+    }\r
+\r
+    //-- boolean hasDisplayBoxes() \r
 \r
     /**\r
      * Method hasDisplayText\r
@@ -479,7 +514,9 @@ public class JGroup implements java.io.Serializable {
     public boolean hasDisplayText()\r
     {\r
         return this._has_displayText;\r
-    } //-- boolean hasDisplayText()\r
+    }\r
+\r
+    //-- boolean hasDisplayText() \r
 \r
     /**\r
      * Method hasEnd\r
@@ -491,7 +528,9 @@ public class JGroup implements java.io.Serializable {
     public boolean hasEnd()\r
     {\r
         return this._has_end;\r
-    } //-- boolean hasEnd()\r
+    }\r
+\r
+    //-- boolean hasEnd() \r
 \r
     /**\r
      * Method hasOutlineColour\r
@@ -503,7 +542,9 @@ public class JGroup implements java.io.Serializable {
     public boolean hasOutlineColour()\r
     {\r
         return this._has_outlineColour;\r
-    } //-- boolean hasOutlineColour()\r
+    }\r
+\r
+    //-- boolean hasOutlineColour() \r
 \r
     /**\r
      * Method hasPidThreshold\r
@@ -515,7 +556,9 @@ public class JGroup implements java.io.Serializable {
     public boolean hasPidThreshold()\r
     {\r
         return this._has_pidThreshold;\r
-    } //-- boolean hasPidThreshold()\r
+    }\r
+\r
+    //-- boolean hasPidThreshold() \r
 \r
     /**\r
      * Method hasStart\r
@@ -527,7 +570,9 @@ public class JGroup implements java.io.Serializable {
     public boolean hasStart()\r
     {\r
         return this._has_start;\r
-    } //-- boolean hasStart()\r
+    }\r
+\r
+    //-- boolean hasStart() \r
 \r
     /**\r
      * Method isValid\r
@@ -538,14 +583,19 @@ public class JGroup implements java.io.Serializable {
      */\r
     public boolean isValid()\r
     {\r
-        try {\r
+        try\r
+        {\r
             validate();\r
         }\r
-        catch (org.exolab.castor.xml.ValidationException vex) {\r
+        catch (org.exolab.castor.xml.ValidationException vex)\r
+        {\r
             return false;\r
         }\r
+\r
         return true;\r
-    } //-- boolean isValid()\r
+    }\r
+\r
+    //-- boolean isValid() \r
 \r
     /**\r
      * Method marshal\r
@@ -555,11 +605,13 @@ public class JGroup implements java.io.Serializable {
      * @param out\r
      */\r
     public void marshal(java.io.Writer out)\r
-        throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException\r
+        throws org.exolab.castor.xml.MarshalException, \r
+            org.exolab.castor.xml.ValidationException\r
     {\r
-\r
         Marshaller.marshal(this, out);\r
-    } //-- void marshal(java.io.Writer)\r
+    }\r
+\r
+    //-- void marshal(java.io.Writer) \r
 \r
     /**\r
      * Method marshal\r
@@ -569,11 +621,13 @@ public class JGroup implements java.io.Serializable {
      * @param handler\r
      */\r
     public void marshal(org.xml.sax.ContentHandler handler)\r
-        throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException\r
+        throws java.io.IOException, org.exolab.castor.xml.MarshalException, \r
+            org.exolab.castor.xml.ValidationException\r
     {\r
-\r
         Marshaller.marshal(this, handler);\r
-    } //-- void marshal(org.xml.sax.ContentHandler)\r
+    }\r
+\r
+    //-- void marshal(org.xml.sax.ContentHandler) \r
 \r
     /**\r
      * Method removeAllSeq\r
@@ -582,7 +636,9 @@ public class JGroup implements java.io.Serializable {
     public void removeAllSeq()\r
     {\r
         _seqList.removeAllElements();\r
-    } //-- void removeAllSeq()\r
+    }\r
+\r
+    //-- void removeAllSeq() \r
 \r
     /**\r
      * Method removeSeq\r
@@ -596,8 +652,11 @@ public class JGroup implements java.io.Serializable {
     {\r
         java.lang.Object obj = _seqList.elementAt(index);\r
         _seqList.removeElementAt(index);\r
-        return ((java.lang.Integer)obj).intValue();\r
-    } //-- int removeSeq(int)\r
+\r
+        return ((java.lang.Integer) obj).intValue();\r
+    }\r
+\r
+    //-- int removeSeq(int) \r
 \r
     /**\r
      * Sets the value of field 'colour'.\r
@@ -607,7 +666,9 @@ public class JGroup implements java.io.Serializable {
     public void setColour(java.lang.String colour)\r
     {\r
         this._colour = colour;\r
-    } //-- void setColour(java.lang.String)\r
+    }\r
+\r
+    //-- void setColour(java.lang.String) \r
 \r
     /**\r
      * Sets the value of field 'colourText'.\r
@@ -618,7 +679,9 @@ public class JGroup implements java.io.Serializable {
     {\r
         this._colourText = colourText;\r
         this._has_colourText = true;\r
-    } //-- void setColourText(boolean)\r
+    }\r
+\r
+    //-- void setColourText(boolean) \r
 \r
     /**\r
      * Sets the value of field 'consThreshold'.\r
@@ -629,7 +692,9 @@ public class JGroup implements java.io.Serializable {
     {\r
         this._consThreshold = consThreshold;\r
         this._has_consThreshold = true;\r
-    } //-- void setConsThreshold(int)\r
+    }\r
+\r
+    //-- void setConsThreshold(int) \r
 \r
     /**\r
      * Sets the value of field 'displayBoxes'.\r
@@ -640,7 +705,9 @@ public class JGroup implements java.io.Serializable {
     {\r
         this._displayBoxes = displayBoxes;\r
         this._has_displayBoxes = true;\r
-    } //-- void setDisplayBoxes(boolean)\r
+    }\r
+\r
+    //-- void setDisplayBoxes(boolean) \r
 \r
     /**\r
      * Sets the value of field 'displayText'.\r
@@ -651,7 +718,9 @@ public class JGroup implements java.io.Serializable {
     {\r
         this._displayText = displayText;\r
         this._has_displayText = true;\r
-    } //-- void setDisplayText(boolean)\r
+    }\r
+\r
+    //-- void setDisplayText(boolean) \r
 \r
     /**\r
      * Sets the value of field 'end'.\r
@@ -662,7 +731,9 @@ public class JGroup implements java.io.Serializable {
     {\r
         this._end = end;\r
         this._has_end = true;\r
-    } //-- void setEnd(int)\r
+    }\r
+\r
+    //-- void setEnd(int) \r
 \r
     /**\r
      * Sets the value of field 'name'.\r
@@ -672,7 +743,9 @@ public class JGroup implements java.io.Serializable {
     public void setName(java.lang.String name)\r
     {\r
         this._name = name;\r
-    } //-- void setName(java.lang.String)\r
+    }\r
+\r
+    //-- void setName(java.lang.String) \r
 \r
     /**\r
      * Sets the value of field 'outlineColour'.\r
@@ -683,7 +756,9 @@ public class JGroup implements java.io.Serializable {
     {\r
         this._outlineColour = outlineColour;\r
         this._has_outlineColour = true;\r
-    } //-- void setOutlineColour(int)\r
+    }\r
+\r
+    //-- void setOutlineColour(int) \r
 \r
     /**\r
      * Sets the value of field 'pidThreshold'.\r
@@ -694,7 +769,9 @@ public class JGroup implements java.io.Serializable {
     {\r
         this._pidThreshold = pidThreshold;\r
         this._has_pidThreshold = true;\r
-    } //-- void setPidThreshold(int)\r
+    }\r
+\r
+    //-- void setPidThreshold(int) \r
 \r
     /**\r
      * Method setSeq\r
@@ -708,11 +785,15 @@ public class JGroup implements java.io.Serializable {
         throws java.lang.IndexOutOfBoundsException\r
     {\r
         //-- check bounds for index\r
-        if ((index < 0) || (index > _seqList.size())) {\r
+        if ((index < 0) || (index > _seqList.size()))\r
+        {\r
             throw new IndexOutOfBoundsException();\r
         }\r
+\r
         _seqList.setElementAt(new java.lang.Integer(vSeq), index);\r
-    } //-- void setSeq(int, int)\r
+    }\r
+\r
+    //-- void setSeq(int, int) \r
 \r
     /**\r
      * Method setSeq\r
@@ -725,10 +806,14 @@ public class JGroup implements java.io.Serializable {
     {\r
         //-- copy array\r
         _seqList.removeAllElements();\r
-        for (int i = 0; i < seqArray.length; i++) {\r
+\r
+        for (int i = 0; i < seqArray.length; i++)\r
+        {\r
             _seqList.addElement(new java.lang.Integer(seqArray[i]));\r
         }\r
-    } //-- void setSeq(int)\r
+    }\r
+\r
+    //-- void setSeq(int) \r
 \r
     /**\r
      * Sets the value of field 'start'.\r
@@ -739,7 +824,9 @@ public class JGroup implements java.io.Serializable {
     {\r
         this._start = start;\r
         this._has_start = true;\r
-    } //-- void setStart(int)\r
+    }\r
+\r
+    //-- void setStart(int) \r
 \r
     /**\r
      * Method unmarshal\r
@@ -750,20 +837,24 @@ public class JGroup implements java.io.Serializable {
      * @return Object\r
      */\r
     public static java.lang.Object unmarshal(java.io.Reader reader)\r
-        throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException\r
+        throws org.exolab.castor.xml.MarshalException, \r
+            org.exolab.castor.xml.ValidationException\r
     {\r
-        return (jalview.binding.JGroup) Unmarshaller.unmarshal(jalview.binding.JGroup.class, reader);\r
-    } //-- java.lang.Object unmarshal(java.io.Reader)\r
+        return (jalview.binding.JGroup) Unmarshaller.unmarshal(jalview.binding.JGroup.class,\r
+            reader);\r
+    }\r
+\r
+    //-- java.lang.Object unmarshal(java.io.Reader) \r
 \r
     /**\r
      * Method validate\r
      *\r
      */\r
-    public void validate()\r
-        throws org.exolab.castor.xml.ValidationException\r
+    public void validate() throws org.exolab.castor.xml.ValidationException\r
     {\r
         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();\r
         validator.validate(this);\r
-    } //-- void validate()\r
+    }\r
 \r
+    //-- void validate() \r
 }\r