+ }\r
+\r
+ /**\r
+ * delete any columns in alignmentAnnotation that are hidden (including sequence associated annotation).\r
+ * @param alignmentAnnotation\r
+ */\r
+ public void makeVisibleAnnotation(AlignmentAnnotation alignmentAnnotation)\r
+ {\r
+ makeVisibleAnnotation(-1,-1,alignmentAnnotation);\r
+ }\r
+ /**\r
+ * delete any columns in alignmentAnnotation that are hidden (including sequence associated annotation).\r
+ * @param start remove any annotation to the right of this column\r
+ * @param end remove any annotation to the left of this column\r
+ * @param alignmentAnnotation the annotation to operate on\r
+ */\r
+ public void makeVisibleAnnotation(int start, int end, AlignmentAnnotation alignmentAnnotation)\r
+ {\r
+ if (alignmentAnnotation.annotations==null)\r
+ {\r
+ return;\r
+ }\r
+ if (start==end && end==-1)\r
+ {\r
+ start = 0;\r
+ end = alignmentAnnotation.annotations.length;\r
+ }\r
+ if (hiddenColumns != null && hiddenColumns.size() > 0)\r
+ {\r
+ // then mangle the alignmentAnnotation annotation array\r
+ Vector annels = new Vector();\r
+ Annotation[] els = null;\r
+ Vector regions = getHiddenColumns();\r
+ int blockStart = start, blockEnd = end;\r
+ int[] region;\r
+ int hideStart, hideEnd,w=0;\r
+\r
+ for (int j = 0; j < regions.size(); j++)\r
+ {\r
+ region = (int[]) regions.elementAt(j);\r
+ hideStart = region[0];\r
+ hideEnd = region[1];\r
+\r
+ if (hideStart < start)\r
+ {\r
+ continue;\r
+ }\r
+\r
+ blockStart = Math.min(blockStart, hideEnd + 1);\r
+ blockEnd = Math.min(blockEnd, hideStart);\r
+\r
+ if (blockStart > blockEnd)\r
+ {\r
+ break;\r
+ }\r
+\r
+ annels.addElement(els = new Annotation[blockEnd-blockStart]);\r
+ System.arraycopy(alignmentAnnotation.annotations, blockStart, els, 0, els.length);\r
+ w+=els.length;\r
+ blockStart = hideEnd + 1;\r
+ blockEnd = end;\r
+ }\r