+ 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
+ {\r
+ if (row.annotations[j] != null)\r
+ {\r
+ hasLabels |= (row.annotations[j].displayCharacter != null\r
+ && row.annotations[j].displayCharacter.length() > 0 && !row.annotations[j].displayCharacter\r
+ .equals(" "));\r
+ hasGlyphs |= (row.annotations[j].secondaryStructure != 0 && row.annotations[j].secondaryStructure != ' ');\r
+ hasValues |= (row.annotations[j].value != Float.NaN); // NaNs can't\r
+ // be\r
+ // rendered..\r
+ hasText |= (row.annotations[j].description != null && row.annotations[j].description\r
+ .length() > 0);\r
+ }\r