Alignment Annotation added
[jalview.git] / src / jalview / datamodel / AlignmentAnnotation.java
1 package jalview.datamodel;\r
2 \r
3 public class AlignmentAnnotation\r
4 {\r
5   public String label;\r
6   public String description;\r
7   public Annotation  [] annotations;\r
8   public boolean isGraph = false;\r
9   public float graphMin, graphMax;\r
10   public int windowLength;\r
11 \r
12   // Graphical hints and tips\r
13   public boolean editable = false;\r
14   public boolean hasIcons; //\r
15   public boolean hasText;\r
16   public boolean visible = true;\r
17   public int height=0;\r
18 \r
19   public AlignmentAnnotation(String label, String description, Annotation [] annotations)\r
20   {\r
21     // always editable?\r
22     editable = true;\r
23     this.label = label;\r
24     this.description = description;\r
25     this.annotations = annotations;\r
26     for(int i=0; i<annotations.length; i++)\r
27     {\r
28       if (annotations[i]!=null &&(\r
29           annotations[i].secondaryStructure == 'H' ||\r
30           annotations[i].secondaryStructure == 'E'))\r
31         hasIcons = true;\r
32 \r
33       if (annotations[i]!=null && annotations[i].displayCharacter.length()>0)\r
34         hasText = true;\r
35     }\r
36   }\r
37 \r
38   public AlignmentAnnotation(String label, String description, Annotation [] annotations, float min, float max, int winLength)\r
39   {\r
40     // graphs are not editable\r
41     this.label = label;\r
42     this.description = description;\r
43     this.annotations = annotations;\r
44     isGraph = true;\r
45     graphMin = min;\r
46     graphMax = max;\r
47     windowLength = winLength;\r
48     for(int i=0; i<annotations.length; i++)\r
49     {\r
50       if (annotations[i]!=null &&(\r
51           annotations[i].secondaryStructure == 'H' ||\r
52           annotations[i].secondaryStructure == 'E'))\r
53         hasIcons = true;\r
54 \r
55       if (annotations[i]!=null && annotations[i].displayCharacter.length()>0)\r
56         hasText = true;\r
57     }\r
58 \r
59 \r
60   }\r
61 \r
62 }\r