JAL-3054 table tooltip follow mouse in a sensible manner
[jalview.git] / src / jalview / binding / FeatureSettings.java
1 /*
2  * This class was automatically generated with 
3  * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
4  * Schema.
5  * $Id$
6  */
7
8 package jalview.binding;
9
10 //---------------------------------/
11 //- Imported classes and packages -/
12 //---------------------------------/
13
14 import org.exolab.castor.xml.Marshaller;
15 import org.exolab.castor.xml.Unmarshaller;
16
17 /**
18  * Class FeatureSettings.
19  * 
20  * @version $Revision$ $Date$
21  */
22 public class FeatureSettings implements java.io.Serializable
23 {
24
25   // --------------------------/
26   // - Class/Member Variables -/
27   // --------------------------/
28
29   /**
30    * Field _settingList.
31    */
32   private java.util.Vector _settingList;
33
34   // ----------------/
35   // - Constructors -/
36   // ----------------/
37
38   public FeatureSettings()
39   {
40     super();
41     this._settingList = new java.util.Vector();
42   }
43
44   // -----------/
45   // - Methods -/
46   // -----------/
47
48   /**
49    * 
50    * 
51    * @param vSetting
52    * @throws java.lang.IndexOutOfBoundsException
53    *           if the index given is outside the bounds of the collection
54    */
55   public void addSetting(final jalview.binding.Setting vSetting)
56           throws java.lang.IndexOutOfBoundsException
57   {
58     this._settingList.addElement(vSetting);
59   }
60
61   /**
62    * 
63    * 
64    * @param index
65    * @param vSetting
66    * @throws java.lang.IndexOutOfBoundsException
67    *           if the index given is outside the bounds of the collection
68    */
69   public void addSetting(final int index,
70           final jalview.binding.Setting vSetting)
71           throws java.lang.IndexOutOfBoundsException
72   {
73     this._settingList.add(index, vSetting);
74   }
75
76   /**
77    * Method enumerateSetting.
78    * 
79    * @return an Enumeration over all jalview.binding.Setting elements
80    */
81   public java.util.Enumeration enumerateSetting()
82   {
83     return this._settingList.elements();
84   }
85
86   /**
87    * Method getSetting.
88    * 
89    * @param index
90    * @throws java.lang.IndexOutOfBoundsException
91    *           if the index given is outside the bounds of the collection
92    * @return the value of the jalview.binding.Setting at the given index
93    */
94   public jalview.binding.Setting getSetting(final int index)
95           throws java.lang.IndexOutOfBoundsException
96   {
97     // check bounds for index
98     if (index < 0 || index >= this._settingList.size())
99     {
100       throw new IndexOutOfBoundsException(
101               "getSetting: Index value '" + index + "' not in range [0.."
102                       + (this._settingList.size() - 1) + "]");
103     }
104
105     return (jalview.binding.Setting) _settingList.get(index);
106   }
107
108   /**
109    * Method getSetting.Returns the contents of the collection in an Array.
110    * <p>
111    * Note: Just in case the collection contents are changing in another thread,
112    * we pass a 0-length Array of the correct type into the API call. This way we
113    * <i>know</i> that the Array returned is of exactly the correct length.
114    * 
115    * @return this collection as an Array
116    */
117   public jalview.binding.Setting[] getSetting()
118   {
119     jalview.binding.Setting[] array = new jalview.binding.Setting[0];
120     return (jalview.binding.Setting[]) this._settingList.toArray(array);
121   }
122
123   /**
124    * Method getSettingCount.
125    * 
126    * @return the size of this collection
127    */
128   public int getSettingCount()
129   {
130     return this._settingList.size();
131   }
132
133   /**
134    * Method isValid.
135    * 
136    * @return true if this object is valid according to the schema
137    */
138   public boolean isValid()
139   {
140     try
141     {
142       validate();
143     } catch (org.exolab.castor.xml.ValidationException vex)
144     {
145       return false;
146     }
147     return true;
148   }
149
150   /**
151    * 
152    * 
153    * @param out
154    * @throws org.exolab.castor.xml.MarshalException
155    *           if object is null or if any SAXException is thrown during
156    *           marshaling
157    * @throws org.exolab.castor.xml.ValidationException
158    *           if this object is an invalid instance according to the schema
159    */
160   public void marshal(final java.io.Writer out)
161           throws org.exolab.castor.xml.MarshalException,
162           org.exolab.castor.xml.ValidationException
163   {
164     Marshaller.marshal(this, out);
165   }
166
167   /**
168    * 
169    * 
170    * @param handler
171    * @throws java.io.IOException
172    *           if an IOException occurs during marshaling
173    * @throws org.exolab.castor.xml.ValidationException
174    *           if this object is an invalid instance according to the schema
175    * @throws org.exolab.castor.xml.MarshalException
176    *           if object is null or if any SAXException is thrown during
177    *           marshaling
178    */
179   public void marshal(final org.xml.sax.ContentHandler handler)
180           throws java.io.IOException,
181           org.exolab.castor.xml.MarshalException,
182           org.exolab.castor.xml.ValidationException
183   {
184     Marshaller.marshal(this, handler);
185   }
186
187   /**
188      */
189   public void removeAllSetting()
190   {
191     this._settingList.clear();
192   }
193
194   /**
195    * Method removeSetting.
196    * 
197    * @param vSetting
198    * @return true if the object was removed from the collection.
199    */
200   public boolean removeSetting(final jalview.binding.Setting vSetting)
201   {
202     boolean removed = _settingList.remove(vSetting);
203     return removed;
204   }
205
206   /**
207    * Method removeSettingAt.
208    * 
209    * @param index
210    * @return the element removed from the collection
211    */
212   public jalview.binding.Setting removeSettingAt(final int index)
213   {
214     java.lang.Object obj = this._settingList.remove(index);
215     return (jalview.binding.Setting) obj;
216   }
217
218   /**
219    * 
220    * 
221    * @param index
222    * @param vSetting
223    * @throws java.lang.IndexOutOfBoundsException
224    *           if the index given is outside the bounds of the collection
225    */
226   public void setSetting(final int index,
227           final jalview.binding.Setting vSetting)
228           throws java.lang.IndexOutOfBoundsException
229   {
230     // check bounds for index
231     if (index < 0 || index >= this._settingList.size())
232     {
233       throw new IndexOutOfBoundsException(
234               "setSetting: Index value '" + index + "' not in range [0.."
235                       + (this._settingList.size() - 1) + "]");
236     }
237
238     this._settingList.set(index, vSetting);
239   }
240
241   /**
242    * 
243    * 
244    * @param vSettingArray
245    */
246   public void setSetting(final jalview.binding.Setting[] vSettingArray)
247   {
248     // -- copy array
249     _settingList.clear();
250
251     for (int i = 0; i < vSettingArray.length; i++)
252     {
253       this._settingList.add(vSettingArray[i]);
254     }
255   }
256
257   /**
258    * Method unmarshal.
259    * 
260    * @param reader
261    * @throws org.exolab.castor.xml.MarshalException
262    *           if object is null or if any SAXException is thrown during
263    *           marshaling
264    * @throws org.exolab.castor.xml.ValidationException
265    *           if this object is an invalid instance according to the schema
266    * @return the unmarshaled jalview.binding.FeatureSettings
267    */
268   public static jalview.binding.FeatureSettings unmarshal(
269           final java.io.Reader reader)
270           throws org.exolab.castor.xml.MarshalException,
271           org.exolab.castor.xml.ValidationException
272   {
273     return (jalview.binding.FeatureSettings) Unmarshaller
274             .unmarshal(jalview.binding.FeatureSettings.class, reader);
275   }
276
277   /**
278    * 
279    * 
280    * @throws org.exolab.castor.xml.ValidationException
281    *           if this object is an invalid instance according to the schema
282    */
283   public void validate() throws org.exolab.castor.xml.ValidationException
284   {
285     org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
286     validator.validate(this);
287   }
288
289 }