/*\r
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.6)\r
- * Copyright (C) 2010 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
* \r
* This file is part of Jalview.\r
* \r
* columns or hidden row keywords.\r
* \r
* @param annotations\r
- * @param groups\r
+ * @param list\r
* @param properties\r
* @return feature file as a string.\r
*/\r
public String printAnnotations(AlignmentAnnotation[] annotations,\r
- Vector groups, Hashtable properties)\r
+ List<SequenceGroup> list, Hashtable properties)\r
{\r
- return printAnnotations(annotations, groups, properties, null);\r
+ return printAnnotations(annotations, list, properties, null);\r
\r
}\r
\r
* properties and views.\r
* \r
* @param annotations\r
- * @param groups\r
+ * @param list\r
* @param properties\r
* @param views\r
* @return annotation file\r
*/\r
public String printAnnotations(AlignmentAnnotation[] annotations,\r
- Vector groups, Hashtable properties, ViewDef[] views)\r
+ List<SequenceGroup> list, Hashtable properties, ViewDef[] views)\r
{\r
// TODO: resolve views issue : annotationFile could contain visible region,\r
// or full data + hidden region specifications for a view.\r
text.append(rowprops.toString());\r
}\r
\r
- if (groups != null)\r
+ if (list != null)\r
{\r
- printGroups(groups);\r
+ printGroups(list);\r
}\r
\r
if (properties != null)\r
return text.toString();\r
}\r
\r
- public void printGroups(Vector sequenceGroups)\r
+ public void printGroups(List<SequenceGroup> list)\r
{\r
- SequenceGroup sg;\r
SequenceI seqrep = null;\r
- for (int i = 0; i < sequenceGroups.size(); i++)\r
+ for (SequenceGroup sg:list)\r
{\r
- sg = (SequenceGroup) sequenceGroups.elementAt(i);\r
if (!sg.hasSeqrep())\r
{\r
text.append("SEQUENCE_GROUP\t" + sg.getName() + "\t"\r
}\r
// Finally, resolve the groupRefs\r
Enumeration en = groupRefRows.keys();\r
- SequenceGroup theGroup = null;\r
-\r
+ \r
while (en.hasMoreElements())\r
{\r
groupRef = (String) en.nextElement();\r
boolean matched = false;\r
// Resolve group: TODO: add a getGroupByName method to alignments\r
- Vector grps = al.getGroups();\r
- for (int g = 0, gSize = grps.size(); g < gSize; g++)\r
+ for (SequenceGroup theGroup : al.getGroups())\r
{\r
- theGroup = (SequenceGroup) grps.elementAt(g);\r
if (theGroup.getName().equals(groupRef))\r
{\r
if (matched)\r
{\r
return;\r
}\r
- SequenceGroup sg = null;\r
-\r
+ \r
String name = st.nextToken();\r
-\r
- Vector groups = al.getGroups();\r
- for (int i = 0; i < groups.size(); i++)\r
+ SequenceGroup sg=null;\r
+ for (SequenceGroup _sg:al.getGroups())\r
{\r
- sg = (SequenceGroup) groups.elementAt(i);\r
- if (sg.getName().equals(name))\r
+ if ((sg=_sg).getName().equals(name))\r
{\r
break;\r
}\r
sg.getStartRes(), sg.getEndRes() + 1);\r
\r
c.calculate();\r
- c.verdict(false, 25);\r
+ c.verdict(false, 25); // TODO: refer to conservation percent threshold\r
\r
sg.cs.setConservation(c);\r
\r