1 package jalview.datamodel;
\r
3 import jalview.jbgui.*;
\r
4 import jalview.schemes.*;
\r
5 import jalview.analysis.*;
\r
6 import jalview.datamodel.*;
\r
8 import java.util.Vector;
\r
11 public class SequenceGroup {
\r
13 boolean displayBoxes;
\r
14 boolean displayText;
\r
17 Conservation conserve;
\r
19 boolean aaFrequencyValid = false;
\r
20 Vector sequences = new Vector();
\r
24 public SequenceGroup() {
\r
25 this.isSelected = false;
\r
26 this.displayBoxes = true;
\r
27 this.displayText = true;
\r
28 this.colourText = false;
\r
29 this.display = true;
\r
32 public SequenceGroup( ColourSchemeI scheme, boolean isSelected,
\r
33 boolean displayBoxes, boolean displayText,
\r
37 this.isSelected = isSelected;
\r
38 this.displayBoxes = displayBoxes;
\r
39 this.displayText = displayText;
\r
40 this.colourText = colourText;
\r
41 this.display = display;
\r
44 public Conservation getConservation() {
\r
47 public void addSequence(SequenceI s) {
\r
48 sequences.addElement(s);
\r
51 public void deleteSequence(SequenceI s) {
\r
52 sequences.removeElement(s);
\r
55 public void setColourText(boolean state) {
\r
58 public boolean getColourText() {
\r
62 public void setDisplayText(boolean state) {
\r
63 displayText = state;
\r
66 public boolean getDisplayText() {
\r
70 public void setDisplayBoxes(boolean state) {
\r
71 displayBoxes = state;
\r
74 public boolean getDisplayBoxes() {
\r
75 return displayBoxes;
\r
78 public int getSize() {
\r
79 return sequences.size();
\r
81 public SequenceI getSequenceAt(int i) {
\r
82 return (SequenceI)sequences.elementAt(i);
\r
85 public Vector getAAFrequency() {
\r
86 if (aaFrequency == null || aaFrequencyValid == false) {
\r
87 aaFrequency = AAFrequency.calculate(sequences,1,getWidth());
\r
88 aaFrequencyValid = true;
\r
92 public int getWidth() {
\r
93 // MC This needs to get reset when characters are inserted and deleted
\r
95 for (int i = 0; i < sequences.size(); i++) {
\r
96 SequenceI seq = (SequenceI)sequences.elementAt(i);
\r
97 if (seq.getLength() > width) {
\r
98 width = seq.getLength();
\r