JAL-4375 Add an AnnotationColouringI interface, and generic AnnotationColouringRanges...
[jalview.git] / src / jalview / datamodel / annotations / AnnotationRowBuilder.java
1 /*
2  * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
3  * Copyright (C) $$Year-Rel$$ The Jalview Authors
4  * 
5  * This file is part of Jalview.
6  * 
7  * Jalview is free software: you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License 
9  * as published by the Free Software Foundation, either version 3
10  * 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
18  * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
19  * The Jalview Authors are detailed in the 'AUTHORS' file.
20  */
21 package jalview.datamodel.annotations;
22
23 import jalview.datamodel.Annotation;
24 import jalview.structure.StructureImportSettings.TFType;
25
26 public class AnnotationRowBuilder
27 {
28
29   String name;
30
31   boolean hasDescription = false;
32
33   String description;
34
35   boolean hasMinMax = false;
36
37   /**
38    * the type of temperature factor plot (if it is one)
39    */
40   // private TFType tfType = TFType.DEFAULT;
41   private TFType tfType = null;
42
43   public void setTFType(TFType t)
44   {
45     tfType = t;
46   }
47
48   public TFType getTFType()
49   {
50     return tfType;
51   }
52
53   /**
54    * Colouring model for the annotation
55    * 
56    * @param ac
57    */
58   private AnnotationColouringI annotationColouring = null;
59
60   public void setAnnotationColouring(AnnotationColouringI ac)
61   {
62     annotationColouring = ac;
63   }
64
65   public AnnotationColouringI getAnnotationColouring()
66   {
67     return annotationColouring;
68   }
69
70   public String getName()
71   {
72     return name;
73   }
74
75   public void setName(String name)
76   {
77     this.name = name;
78   }
79
80   public boolean isHasDescription()
81   {
82     return hasDescription;
83   }
84
85   public void setHasDescription(boolean hasDescription)
86   {
87     this.hasDescription = hasDescription;
88   }
89
90   public String getDescription()
91   {
92     return description;
93   }
94
95   public void setDescription(String description)
96   {
97     this.description = description;
98   }
99
100   public boolean isHasMinMax()
101   {
102     return hasMinMax;
103   }
104
105   public void setHasMinMax(boolean hasMinMax)
106   {
107     this.hasMinMax = hasMinMax;
108   }
109
110   public float getMin()
111   {
112     return min;
113   }
114
115   public void setMin(float min)
116   {
117     this.min = min;
118   }
119
120   public float getMax()
121   {
122     return max;
123   }
124
125   public void setMax(float max)
126   {
127     this.max = max;
128   }
129
130   float min, max;
131
132   public AnnotationRowBuilder(String string)
133   {
134     name = string;
135   }
136
137   public AnnotationRowBuilder(String name, float min, float max, TFType tft)
138   {
139     this(name, min, max);
140     setTFType(tft);
141   }
142
143   public AnnotationRowBuilder(String name, float min, float max)
144   {
145     this(name);
146     this.min = min;
147     this.max = max;
148     this.hasMinMax = true;
149   }
150
151   /**
152    * override this to apply some form of transformation to the annotation - eg a
153    * colourscheme
154    * 
155    * @param annotation
156    */
157   public void processAnnotation(Annotation annotation)
158   {
159
160   }
161 }