+ else\r
+ {\r
+ if (refSeq == null || refSeq != row.sequenceRef)\r
+ {\r
+ refSeq = row.sequenceRef;\r
+ text.append(newline);\r
+ text.append("SEQUENCE_REF\t");\r
+ text.append(refSeq.getName());\r
+ text.append(newline);\r
+ }\r
+ }\r
+ // mark any group references for the row\r
+ if (row.groupRef == null)\r
+ {\r
+\r
+ if (refGroup != null)\r
+ {\r
+ text.append(newline);\r
+ text.append("GROUP_REF\tALIGNMENT");\r
+ text.append(newline);\r
+ }\r
+\r
+ refGroup = null;\r
+ }\r
+ else\r
+ {\r
+ if (refGroup == null || refGroup != row.groupRef)\r
+ {\r
+ refGroup = row.groupRef;\r
+ text.append(newline);\r
+ text.append("GROUP_REF\t");\r
+ text.append(refGroup.getName());\r
+ text.append(newline);\r
+ }\r
+ }\r
+\r
+ boolean hasGlyphs = row.hasIcons, hasLabels = row.hasText, hasValues = row.hasScore, hasText = false;\r
+ // lookahead to check what the annotation row object actually contains.\r
+ for (int j = 0; row.annotations != null\r
+ && j < row.annotations.length\r
+ && (!hasGlyphs || !hasLabels || !hasValues); j++)\r