JAL-3063 top level element added to colours schema, JAXB classes regen'd
[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:element name="JalviewUserColours" type="jalview:JalviewUserColours" />
21         <xs:complexType name="JalviewUserColours">
22                 <xs:sequence>
23                         <xs:element name="Version" maxOccurs="1" minOccurs="0" type="xs:string">
24                                 <xs:annotation>
25                                 <xs:documentation>
26                                 Jalview colour scheme document version.
27                                 </xs:documentation>
28                                 </xs:annotation>
29                         </xs:element>
30                         <xs:element name="colour" maxOccurs="unbounded" minOccurs="0">
31                                 <xs:complexType>
32                                     <xs:sequence>
33                                             <xs:element name="attributeName" type="xs:string" minOccurs="0" maxOccurs="2">
34                                                         <xs:annotation>
35                                                                 <xs:documentation>name of feature attribute to colour by, or attribute and sub-attribute</xs:documentation>
36                                                         </xs:annotation>
37                                             </xs:element> 
38                                         </xs:sequence>
39                                         <xs:attribute name="Name" type="xs:string">
40                                                 <xs:annotation>
41                                                         <xs:documentation>Single letter residue code for an alignment colour scheme, or feature type for a feature colour scheme</xs:documentation>
42                                                 </xs:annotation>
43                                         </xs:attribute>
44                                         <xs:attribute name="RGB" type="xs:string" use="required"/>
45                                         <xs:attribute name="minRGB" type="xs:string" use="optional"/>
46                                         <xs:attribute name="noValueColour" use="optional" type="jalview:NoValueColour" default="Min" />
47                                         <xs:attribute name="threshType" use="optional" type="jalview:ThresholdType" />
48                                         <xs:attribute name="threshold" type="xs:float" use="optional"/>
49                                         <xs:attribute name="max" type="xs:float" use="optional"/>
50                                         <xs:attribute name="min" type="xs:float" use="optional"/>
51                                         <xs:attribute name="colourByLabel" type="xs:boolean" use="optional"/>
52                                         <xs:attribute name="autoScale" type="xs:boolean" use="optional"/>
53                                 </xs:complexType>
54                         </xs:element>
55                         <xs:element name="filter" maxOccurs="unbounded" minOccurs="0" >
56                             <xs:complexType>
57                                         <xs:sequence> 
58                                                 <xs:element name="matcherSet" type="jalview:FeatureMatcherSet" />
59                                         </xs:sequence> 
60                                         <xs:attribute name="featureType" type="xs:string" use="required"/>
61                             </xs:complexType>
62                         </xs:element>
63                 </xs:sequence>
64                 <xs:attribute name="schemeName" type="xs:string" use="optional"/>
65         </xs:complexType>
66
67         <xs:complexType name="FeatureMatcherSet"> 
68                 <xs:annotation>
69                         <xs:documentation>A feature match condition, which may be simple or compound</xs:documentation>
70                 </xs:annotation>
71           <xs:choice> 
72             <xs:element name="matchCondition" type="jalview:FeatureMatcher" /> 
73             <xs:element name="compoundMatcher">
74                     <xs:complexType>
75                           <xs:sequence> 
76                               <xs:element name="matcherSet" minOccurs="2" maxOccurs="2" type="jalview:FeatureMatcherSet" /> 
77                           </xs:sequence> 
78                       <xs:attribute name="and" type="xs:boolean" use="required">
79                                   <xs:annotation>
80                                         <xs:documentation>If true, matchers are AND-ed, if false they are OR-ed</xs:documentation>
81                                   </xs:annotation>
82                       </xs:attribute>
83                     </xs:complexType>
84             </xs:element>
85           </xs:choice> 
86         </xs:complexType> 
87         
88         <xs:complexType name="FeatureMatcher"> 
89           <xs:sequence> 
90             <xs:element name="attributeName" type="xs:string" minOccurs="0" maxOccurs="2">
91                         <xs:annotation>
92                                 <xs:documentation>name of feature attribute to filter on, or attribute and sub-attribute</xs:documentation>
93                         </xs:annotation>
94             </xs:element> 
95             <xs:element name="condition" type="xs:string" /> 
96             <xs:element name="value" type="xs:string" /> 
97           </xs:sequence>
98           <xs:attribute name="by" type="jalview:FilterBy" />
99         </xs:complexType>
100
101         <xs:simpleType name="ThresholdType">
102                 <xs:annotation>
103                         <xs:documentation>Whether filter has a threshold, and if so is it
104                                 above or below
105                         </xs:documentation>
106                 </xs:annotation>
107                 <xs:restriction base="xs:string">
108                         <xs:enumeration value="NONE" />
109                         <xs:enumeration value="ABOVE" />
110                         <xs:enumeration value="BELOW" />
111                 </xs:restriction>
112         </xs:simpleType>
113         
114         <xs:simpleType name="FilterBy">
115                 <xs:annotation>
116                         <xs:documentation>Filter may apply to label, score or some feature attribute</xs:documentation>
117                 </xs:annotation>
118                 <xs:restriction base="xs:string">
119               <xs:enumeration value="byLabel" />
120               <xs:enumeration value="byScore" />
121               <xs:enumeration value="byAttribute" />
122             </xs:restriction>   
123         </xs:simpleType>
124         
125         <xs:simpleType name="NoValueColour">
126                 <xs:annotation>
127                         <xs:documentation>Graduated feature colour if no score (or attribute) value</xs:documentation>
128                 </xs:annotation>
129                 <xs:restriction base="xs:string">
130               <xs:enumeration value="None" />
131               <xs:enumeration value="Min" />
132               <xs:enumeration value="Max" />
133             </xs:restriction>   
134         </xs:simpleType>
135 </xs:schema>