X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fschemabinding%2Fversion2%2Fdescriptors%2FAnnotationDescriptor.java;h=c30ef18f795c2ed5b7c1112daa15ce117264ea7d;hb=6b71746c98f7c1118b474b0b920db3bd7b2a15c0;hp=d69c267254e71f1c00d5949674f456810c9e286b;hpb=506d60f0e188723ddc91c26824b41ac7034df3fe;p=jalview.git diff --git a/src/jalview/schemabinding/version2/descriptors/AnnotationDescriptor.java b/src/jalview/schemabinding/version2/descriptors/AnnotationDescriptor.java index d69c267..c30ef18 100644 --- a/src/jalview/schemabinding/version2/descriptors/AnnotationDescriptor.java +++ b/src/jalview/schemabinding/version2/descriptors/AnnotationDescriptor.java @@ -1,26 +1,25 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer (Version 2.4) - * Copyright (C) 2008 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle + * Jalview - A Sequence Alignment Editor and Viewer (Version 2.6) + * Copyright (C) 2010 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. + * This file is part of Jalview. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * Jalview is free software: you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Jalview is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with Jalview. If not, see . */ package jalview.schemabinding.version2.descriptors; -// ---------------------------------/ -// - Imported classes and packages -/ -// ---------------------------------/ +//---------------------------------/ +//- Imported classes and packages -/ +//---------------------------------/ import jalview.schemabinding.version2.Annotation; @@ -231,6 +230,51 @@ public class AnnotationDescriptor extends typeValidator.setWhiteSpace("preserve"); } desc.setValidator(fieldValidator); + // -- _groupRef + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.String.class, "_groupRef", "groupRef", + org.exolab.castor.xml.NodeType.Attribute); + desc.setImmutable(true); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + Annotation target = (Annotation) object; + return target.getGroupRef(); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Annotation target = (Annotation) object; + target.setGroupRef((java.lang.String) value); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _groupRef + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.StringValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.StringValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setWhiteSpace("preserve"); + } + desc.setValidator(fieldValidator); // -- _graphColour desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( java.lang.Integer.TYPE, "_graphColour", "graphColour", @@ -549,6 +593,226 @@ public class AnnotationDescriptor extends fieldValidator.setValidator(typeValidator); } desc.setValidator(fieldValidator); + // -- _centreColLabels + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Boolean.TYPE, "_centreColLabels", "centreColLabels", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + Annotation target = (Annotation) object; + if (!target.hasCentreColLabels()) + { + return null; + } + return (target.getCentreColLabels() ? java.lang.Boolean.TRUE + : java.lang.Boolean.FALSE); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Annotation target = (Annotation) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteCentreColLabels(); + return; + } + target.setCentreColLabels(((java.lang.Boolean) value) + .booleanValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _centreColLabels + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.BooleanValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + // -- _scaleColLabels + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Boolean.TYPE, "_scaleColLabels", "scaleColLabels", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + Annotation target = (Annotation) object; + if (!target.hasScaleColLabels()) + { + return null; + } + return (target.getScaleColLabels() ? java.lang.Boolean.TRUE + : java.lang.Boolean.FALSE); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Annotation target = (Annotation) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteScaleColLabels(); + return; + } + target.setScaleColLabels(((java.lang.Boolean) value) + .booleanValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _scaleColLabels + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.BooleanValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + // -- _showAllColLabels + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Boolean.TYPE, "_showAllColLabels", + "showAllColLabels", org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + Annotation target = (Annotation) object; + if (!target.hasShowAllColLabels()) + { + return null; + } + return (target.getShowAllColLabels() ? java.lang.Boolean.TRUE + : java.lang.Boolean.FALSE); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Annotation target = (Annotation) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteShowAllColLabels(); + return; + } + target.setShowAllColLabels(((java.lang.Boolean) value) + .booleanValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _showAllColLabels + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.BooleanValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + // -- _autoCalculated + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Boolean.TYPE, "_autoCalculated", "autoCalculated", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + Annotation target = (Annotation) object; + if (!target.hasAutoCalculated()) + { + return null; + } + return (target.getAutoCalculated() ? java.lang.Boolean.TRUE + : java.lang.Boolean.FALSE); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Annotation target = (Annotation) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteAutoCalculated(); + return; + } + target.setAutoCalculated(((java.lang.Boolean) value) + .booleanValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _autoCalculated + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.BooleanValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); // -- initialize element descriptors // -- _annotationElementList @@ -571,8 +835,7 @@ public class AnnotationDescriptor extends try { Annotation target = (Annotation) object; - target - .addAnnotationElement((jalview.schemabinding.version2.AnnotationElement) value); + target.addAnnotationElement((jalview.schemabinding.version2.AnnotationElement) value); } catch (java.lang.Exception ex) { throw new IllegalStateException(ex.toString()); @@ -722,8 +985,7 @@ public class AnnotationDescriptor extends try { Annotation target = (Annotation) object; - target - .setThresholdLine((jalview.schemabinding.version2.ThresholdLine) value); + target.setThresholdLine((jalview.schemabinding.version2.ThresholdLine) value); } catch (java.lang.Exception ex) { throw new IllegalStateException(ex.toString());