- /**\r
- * Copy constructor\r
- * @param copy\r
- */\r
- public ColumnSelection(ColumnSelection copy) {\r
- if (copy!=null) {\r
- if (copy.selected!=null) {\r
- selected = new Vector();\r
- for (int i=0,j=copy.selected.size(); i<j; i++) {\r
- selected.setElementAt(((Integer) copy.selected.elementAt(i)), i);\r
- }\r
+ else\r
+ {\r
+ return new int[]\r
+ { start, end - 1 };\r
+ }\r
+ }\r
+\r
+ /**\r
+ * delete any columns in alignmentAnnotation that are hidden (including\r
+ * sequence associated annotation).\r
+ * \r
+ * @param alignmentAnnotation\r
+ */\r
+ public void makeVisibleAnnotation(AlignmentAnnotation alignmentAnnotation)\r
+ {\r
+ makeVisibleAnnotation(-1, -1, alignmentAnnotation);\r
+ }\r
+\r
+ /**\r
+ * delete any columns in alignmentAnnotation that are hidden (including\r
+ * sequence associated annotation).\r
+ * \r
+ * @param start\r
+ * remove any annotation to the right of this column\r
+ * @param end\r
+ * remove any annotation to the left of this column\r
+ * @param alignmentAnnotation\r
+ * the annotation to operate on\r
+ */\r
+ public void makeVisibleAnnotation(int start, int end,\r
+ 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