apply jalview code style
[jalview.git] / src / jalview / schemabinding / version2 / descriptors / TreeDescriptor.java
index 5a983e7..9d70d62 100644 (file)
@@ -1,26 +1,25 @@
 /*\r
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.4)\r
- * Copyright (C) 2008 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle\r
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.6)\r
+ * Copyright (C) 2010 J Procter, AM Waterhouse, 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
+ * This file is part of Jalview.\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
+ * Jalview 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 3 of the License, or (at your option) any later version.\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
+ * Jalview is distributed in the hope that it will be useful, but \r
+ * WITHOUT ANY WARRANTY; without even the implied warranty \r
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR \r
+ * PURPOSE.  See the GNU General Public License for more details.\r
+ * \r
+ * You should have received a copy of the GNU General Public License along with Jalview.  If not, see <http://www.gnu.org/licenses/>.\r
  */\r
 package jalview.schemabinding.version2.descriptors;\r
 \r
-// ---------------------------------/\r
-// - Imported classes and packages -/\r
-// ---------------------------------/\r
+//---------------------------------/\r
+//- Imported classes and packages -/\r
+//---------------------------------/\r
 \r
 import jalview.schemabinding.version2.Tree;\r
 \r
@@ -645,9 +644,7 @@ public class TreeDescriptor extends
             target.deleteMarkUnlinked();\r
             return;\r
           }\r
-          target\r
-                  .setMarkUnlinked(((java.lang.Boolean) value)\r
-                          .booleanValue());\r
+          target.setMarkUnlinked(((java.lang.Boolean) value).booleanValue());\r
         } catch (java.lang.Exception ex)\r
         {\r
           throw new IllegalStateException(ex.toString());\r
@@ -779,6 +776,50 @@ public class TreeDescriptor extends
       fieldValidator.setValidator(typeValidator);\r
     }\r
     desc.setValidator(fieldValidator);\r
+    // -- _id\r
+    desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(\r
+            java.lang.String.class, "_id", "id",\r
+            org.exolab.castor.xml.NodeType.Attribute);\r
+    super.setIdentity(desc);\r
+    handler = new org.exolab.castor.xml.XMLFieldHandler()\r
+    {\r
+      public java.lang.Object getValue(java.lang.Object object)\r
+              throws IllegalStateException\r
+      {\r
+        Tree target = (Tree) object;\r
+        return target.getId();\r
+      }\r
+\r
+      public void setValue(java.lang.Object object, java.lang.Object value)\r
+              throws IllegalStateException, IllegalArgumentException\r
+      {\r
+        try\r
+        {\r
+          Tree target = (Tree) object;\r
+          target.setId((java.lang.String) value);\r
+        } catch (java.lang.Exception ex)\r
+        {\r
+          throw new IllegalStateException(ex.toString());\r
+        }\r
+      }\r
+\r
+      public java.lang.Object newInstance(java.lang.Object parent)\r
+      {\r
+        return new java.lang.String();\r
+      }\r
+    };\r
+    desc.setHandler(handler);\r
+    desc.setMultivalued(false);\r
+    addFieldDescriptor(desc);\r
+\r
+    // -- validation code for: _id\r
+    fieldValidator = new org.exolab.castor.xml.FieldValidator();\r
+    { // -- local scope\r
+      org.exolab.castor.xml.validators.IdValidator typeValidator;\r
+      typeValidator = new org.exolab.castor.xml.validators.IdValidator();\r
+      fieldValidator.setValidator(typeValidator);\r
+    }\r
+    desc.setValidator(fieldValidator);\r
     // -- initialize element descriptors\r
 \r
     // -- _title\r