1 package jalview.datamodel;
\r
3 public class AlignmentAnnotation
\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
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
19 public AlignmentAnnotation(String label, String description, Annotation [] annotations)
\r
24 this.description = description;
\r
25 this.annotations = annotations;
\r
26 for(int i=0; i<annotations.length; i++)
\r
28 if (annotations[i]!=null &&(
\r
29 annotations[i].secondaryStructure == 'H' ||
\r
30 annotations[i].secondaryStructure == 'E'))
\r
33 if (annotations[i]!=null && annotations[i].displayCharacter.length()>0)
\r
38 public AlignmentAnnotation(String label, String description, Annotation [] annotations, float min, float max, int winLength)
\r
40 // graphs are not editable
\r
42 this.description = description;
\r
43 this.annotations = annotations;
\r
47 for(int i=0; i<annotations.length; i++)
\r
49 if(annotations[i]==null)
\r
51 if(annotations[i].value>max)
\r
52 max = annotations[i].value;
\r
53 if(annotations[i].value<min)
\r
54 min = annotations[i].value;
\r
60 windowLength = winLength;
\r
61 for(int i=0; i<annotations.length; i++)
\r
63 if (annotations[i]!=null &&(
\r
64 annotations[i].secondaryStructure == 'H' ||
\r
65 annotations[i].secondaryStructure == 'E'))
\r
68 if (annotations[i]!=null && annotations[i].displayCharacter.length()>0)
\r
73 public String toString()
\r
75 StringBuffer buffer = new StringBuffer();
\r
76 for(int i=0; i<annotations.length; i++)
\r
78 if(annotations[i]!=null)
\r
81 buffer.append(annotations[i].value);
\r
83 buffer.append(annotations[i].secondaryStructure);
\r
85 buffer.append(annotations[i].displayCharacter);
\r
88 buffer.append(", ");
\r
90 if(label.equals("Consensus"))
\r
92 buffer.append("\n");
\r
93 for (int i = 0; i < annotations.length; i++)
\r
95 if (annotations[i] != null)
\r
96 buffer.append(annotations[i].description);
\r
97 buffer.append(", ");
\r
100 return buffer.toString();
\r