package jalview.datamodel;\r
\r
-import jalview.jbgui.*;\r
-import jalview.schemes.*;\r
import jalview.analysis.*;\r
import jalview.util.*;\r
import java.util.*;\r
public Alignment(SequenceI[] seqs) {\r
sequences = new Vector();\r
\r
- for (int i=0; i < seqs.length; i++) {\r
+ for (int i=0; i < seqs.length; i++)\r
sequences.addElement(seqs[i]);\r
- }\r
\r
- groups.addElement(new SequenceGroup());\r
+ SequenceGroup all = new SequenceGroup();\r
+ all.setName("Group 1");\r
+ groups.addElement(all);\r
\r
int i = 0;\r
\r
while (i < seqs.length) {\r
- addToGroup((SequenceGroup)groups.elementAt(0),seqs[i]);\r
+ addToGroup(all,seqs[i]);\r
i++;\r
}\r
\r
\r
/** */\r
public SequenceGroup findGroup(SequenceI s) {\r
- for (int i = 0; i < this.groups.size();i++) {\r
+ for (int i = 0; i < this.groups.size();i++)\r
+ {\r
SequenceGroup sg = (SequenceGroup)groups.elementAt(i);\r
- if (sg.sequences.contains(s)) {\r
+ if (sg.sequences.contains(s))\r
return sg;\r
- }\r
+\r
}\r
return null;\r
\r
int i = 0;\r
while (i < sequences.size()) {\r
SequenceI s = getSequenceAt(i);\r
- if (s.getName().equals(name)) {\r
+ if (s.getName().equals(name))\r
return s;\r
- }\r
+\r
+ i++;\r
+ }\r
+ return null;\r
+ }\r
+\r
+ /** */\r
+ public SequenceI findbyDisplayId(String name) {\r
+ int i = 0;\r
+ while (i < sequences.size()) {\r
+ SequenceI s = getSequenceAt(i);\r
+ if (s.getDisplayId().equals(name))\r
+ return s;\r
+\r
i++;\r
}\r
return null;\r