JAL-3063 tweak schema so JAXB generates enums for enumerated values
[jalview.git] / schemas / JalviewUserColours.xsd
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3   Jalview - A Sequence Alignment Editor and Viewer (Version 2.8)
4   Copyright (C) 2012 J Procter, AM Waterhouse, LM Lui, J Engelhardt, G Barton, M Clamp, S Searle
5   
6   This file is part of Jalview.
7   
8   Jalview is free software: you can redistribute it and/or
9   modify it under the terms of the GNU General Public License 
10   as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
11    
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.
16   
17   You should have received a copy of the GNU General Public License along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
18 -->
19 <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:jalview="www.jalview.org/colours" targetNamespace="www.jalview.org/colours">
20         <xs:complexType name="JalviewUserColours">
21                 <xs:sequence>
22                         <xs:element name="Version" maxOccurs="1" minOccurs="0" type="xs:string">
23                                 <xs:annotation>
24                                 <xs:documentation>
25                                 Jalview colour scheme document version.
26                                 </xs:documentation>
27                                 </xs:annotation>
28                         </xs:element>
29                         <xs:element name="colour" maxOccurs="unbounded" minOccurs="0">
30                                 <xs:complexType>
31                                     <xs:sequence>
32                                             <xs:element name="attributeName" type="xs:string" minOccurs="0" maxOccurs="2">
33                                                         <xs:annotation>
34                                                                 <xs:documentation>name of feature attribute to colour by, or attribute and sub-attribute</xs:documentation>
35                                                         </xs:annotation>
36                                             </xs:element> 
37                                         </xs:sequence>
38                                         <xs:attribute name="Name" type="xs:string">
39                                                 <xs:annotation>
40                                                         <xs:documentation>Single letter residue code for an alignment colour scheme, or feature type for a feature colour scheme</xs:documentation>
41                                                 </xs:annotation>
42                                         </xs:attribute>
43                                         <xs:attribute name="RGB" type="xs:string" use="required"/>
44                                         <xs:attribute name="minRGB" type="xs:string" use="optional"/>
45                                         <xs:attribute name="noValueColour" use="optional" type="jalview:NoValueColour" default="Min" />
46                                         <xs:attribute name="threshType" use="optional" type="jalview:ThresholdType" />
47                                         <xs:attribute name="threshold" type="xs:float" use="optional"/>
48                                         <xs:attribute name="max" type="xs:float" use="optional"/>
49                                         <xs:attribute name="min" type="xs:float" use="optional"/>
50                                         <xs:attribute name="colourByLabel" type="xs:boolean" use="optional"/>
51                                         <xs:attribute name="autoScale" type="xs:boolean" use="optional"/>
52                                 </xs:complexType>
53                         </xs:element>
54                         <xs:element name="filter" maxOccurs="unbounded" minOccurs="0" >
55                             <xs:complexType>
56                                         <xs:sequence> 
57                                                 <xs:element name="matcherSet" type="jalview:FeatureMatcherSet" />
58                                         </xs:sequence> 
59                                         <xs:attribute name="featureType" type="xs:string" use="required"/>
60                             </xs:complexType>
61                         </xs:element>
62                 </xs:sequence>
63                 <xs:attribute name="schemeName" type="xs:string" use="optional"/>
64         </xs:complexType>
65
66         <xs:complexType name="FeatureMatcherSet"> 
67                 <xs:annotation>
68                         <xs:documentation>A feature match condition, which may be simple or compound</xs:documentation>
69                 </xs:annotation>
70           <xs:choice> 
71             <xs:element name="matchCondition" type="jalview:FeatureMatcher" /> 
72             <xs:element name="compoundMatcher">
73                     <xs:complexType>
74                           <xs:sequence> 
75                               <xs:element name="matcherSet" minOccurs="2" maxOccurs="2" type="jalview:FeatureMatcherSet" /> 
76                           </xs:sequence> 
77                       <xs:attribute name="and" type="xs:boolean" use="required">
78                                   <xs:annotation>
79                                         <xs:documentation>If true, matchers are AND-ed, if false they are OR-ed</xs:documentation>
80                                   </xs:annotation>
81                       </xs:attribute>
82                     </xs:complexType>
83             </xs:element>
84           </xs:choice> 
85         </xs:complexType> 
86         
87         <xs:complexType name="FeatureMatcher"> 
88           <xs:sequence> 
89             <xs:element name="attributeName" type="xs:string" minOccurs="0" maxOccurs="2">
90                         <xs:annotation>
91                                 <xs:documentation>name of feature attribute to filter on, or attribute and sub-attribute</xs:documentation>
92                         </xs:annotation>
93             </xs:element> 
94             <xs:element name="condition" type="xs:string" /> 
95             <xs:element name="value" type="xs:string" /> 
96           </xs:sequence>
97           <xs:attribute name="by" type="jalview:FilterBy" />
98         </xs:complexType>
99
100         <xs:simpleType name="ThresholdType">
101                 <xs:annotation>
102                         <xs:documentation>Whether filter has a threshold, and if so is it
103                                 above or below
104                         </xs:documentation>
105                 </xs:annotation>
106                 <xs:restriction base="xs:string">
107                         <xs:enumeration value="NONE" />
108                         <xs:enumeration value="ABOVE" />
109                         <xs:enumeration value="BELOW" />
110                 </xs:restriction>
111         </xs:simpleType>
112         
113         <xs:simpleType name="FilterBy">
114                 <xs:annotation>
115                         <xs:documentation>Filter may apply to label, score or some feature attribute</xs:documentation>
116                 </xs:annotation>
117                 <xs:restriction base="xs:string">
118               <xs:enumeration value="byLabel" />
119               <xs:enumeration value="byScore" />
120               <xs:enumeration value="byAttribute" />
121             </xs:restriction>   
122         </xs:simpleType>
123         
124         <xs:simpleType name="NoValueColour">
125                 <xs:annotation>
126                         <xs:documentation>Graduated feature colour if no score (or attribute) value</xs:documentation>
127                 </xs:annotation>
128                 <xs:restriction base="xs:string">
129               <xs:enumeration value="None" />
130               <xs:enumeration value="Min" />
131               <xs:enumeration value="Max" />
132             </xs:restriction>   
133         </xs:simpleType>
134 </xs:schema>