now has a name
authoramwaterhouse <Andrew Waterhouse>
Tue, 16 Nov 2004 15:14:22 +0000 (15:14 +0000)
committeramwaterhouse <Andrew Waterhouse>
Tue, 16 Nov 2004 15:14:22 +0000 (15:14 +0000)
src/jalview/datamodel/SequenceGroup.java

index de746ba..c8b375a 100755 (executable)
@@ -1,14 +1,12 @@
 package jalview.datamodel;\r
 \r
-import jalview.jbgui.*;\r
 import jalview.schemes.*;\r
 import jalview.analysis.*;\r
 import jalview.datamodel.*;\r
-\r
 import java.util.Vector;\r
-import java.awt.*;\r
 \r
-public class SequenceGroup {\r
+public class SequenceGroup{\r
+    String groupName;\r
     boolean isSelected;\r
     boolean displayBoxes;\r
     boolean displayText;\r
@@ -17,33 +15,50 @@ public class SequenceGroup {
     Conservation conserve;\r
     Vector   aaFrequency;\r
     boolean     aaFrequencyValid = false;\r
-    Vector sequences = new Vector();\r
+    public Vector sequences = new Vector();\r
     int         width = -1;\r
+    public ColourSchemeI cs;\r
 \r
 \r
   public SequenceGroup() {\r
+    groupName = "Group";\r
     this.isSelected = false;\r
     this.displayBoxes = true;\r
     this.displayText = true;\r
     this.colourText = false;\r
     this.display = true;\r
+    cs = new ZappoColourScheme();\r
   }\r
 \r
-  public SequenceGroup( ColourSchemeI scheme, boolean isSelected,\r
+  public SequenceGroup( String groupName, ColourSchemeI scheme, boolean isSelected,\r
                         boolean displayBoxes, boolean displayText,\r
                         boolean colourText,\r
                         boolean display) {\r
 \r
+    this.groupName = groupName;\r
     this.isSelected = isSelected;\r
     this.displayBoxes = displayBoxes;\r
     this.displayText = displayText;\r
     this.colourText = colourText;\r
     this.display = display;\r
+    this.cs = scheme;\r
+  }\r
+\r
+  public String getName()\r
+  {\r
+    return groupName;\r
   }\r
 \r
+  public void setName(String name)\r
+  {\r
+    groupName = name;\r
+  }\r
   public Conservation getConservation() {\r
      return conserve;\r
   }\r
+  public void setConservation(Conservation c)\r
+  { conserve = c; }\r
+\r
   public void addSequence(SequenceI s) {\r
     sequences.addElement(s);\r
   }\r
@@ -84,22 +99,21 @@ public class SequenceGroup {
 \r
     public Vector getAAFrequency() {\r
        if (aaFrequency == null || aaFrequencyValid == false) {\r
-           aaFrequency = AAFrequency.calculate(sequences,1,getWidth());\r
+           aaFrequency = AAFrequency.calculate(sequences,0,getWidth());\r
            aaFrequencyValid = true;\r
        }\r
        return aaFrequency;\r
     }\r
-    public int getWidth() {\r
-       // MC This needs to get reset when characters are inserted and deleted\r
-       if (width == -1) {\r
-           for (int i = 0; i < sequences.size(); i++) {\r
-               SequenceI seq = (SequenceI)sequences.elementAt(i);\r
-               if (seq.getLength() > width) {\r
-                   width = seq.getLength();\r
-               }\r
-           }\r
-       }\r
 \r
+    public int getWidth()\r
+    {\r
+       // MC This needs to get reset when characters are inserted and deleted\r
+        for (int i = 0; i < sequences.size(); i++)\r
+        {\r
+          SequenceI seq = (SequenceI) sequences.elementAt(i);\r
+          if (seq.getLength() > width)\r
+            width = seq.getLength();\r
+        }\r
        return width;\r
     }\r
 }\r