\r
protected Vector sequences;\r
protected Vector groups = new Vector();\r
- protected char gapCharacter = '-';\r
+ protected ArrayList superGroup = new ArrayList();\r
+ protected char gapCharacter = '-';\r
\r
/** Make an alignment from an array of Sequences.\r
*\r
\r
}\r
return null;\r
+ }\r
+\r
+ public SequenceGroup [] findAllGroups(SequenceI s)\r
+ {\r
+\r
+ ArrayList temp = new ArrayList();\r
+\r
+ for (int i = 0; i < this.groups.size();i++)\r
+ {\r
+ SequenceGroup sg = (SequenceGroup)groups.elementAt(i);\r
+\r
+ if (sg.sequences.contains(s))\r
+ temp.add(sg);\r
+ }\r
+\r
+ SequenceGroup [] ret = new SequenceGroup[temp.size()];\r
+ temp.toArray( ret );\r
+\r
+ return ret;\r
\r
}\r
/** */\r
}\r
}\r
\r
+ public void addSuperGroup(SuperGroup sg)\r
+ {\r
+ superGroup.add(sg);\r
+ }\r
+\r
+ public void removeSuperGroup(SuperGroup sg)\r
+ {\r
+ superGroup.remove(sg);\r
+ }\r
+\r
+ public SuperGroup getSuperGroup(SequenceGroup sg)\r
+ {\r
+ for (int i = 0; i < this.superGroup.size(); i++)\r
+ {\r
+ SuperGroup temp = (SuperGroup) superGroup.get(i);\r
+ if (temp.sequenceGroups.contains(sg))\r
+ return temp;\r
+ }\r
+ return null;\r
+ }\r
+\r
/** */\r
public void addGroup(SequenceGroup sg) {\r
if(!groups.contains(sg))\r
groups.addElement(sg);\r
}\r
\r
- /** */\r
- public SequenceGroup addGroup() {\r
- SequenceGroup sg = new SequenceGroup();\r
- groups.addElement(sg);\r
- return sg;\r
+ public void deleteAllGroups()\r
+ {\r
+ groups.clear();\r
+ superGroup.clear();\r
+ int i=0;\r
+ while (i < sequences.size()) {\r
+ SequenceI s = getSequenceAt(i);\r
+ s.setColor(java.awt.Color.white);\r
+ i++;\r
+ }\r
+\r
+\r
}\r
\r
/** */\r