{
// numColumns is out of date, so recalculate
int size = 0;
- if (hiddenColumns != null)
+
+ Iterator<int[]> it = hiddenColumns.iterator();
+ while (it.hasNext())
{
- Iterator<int[]> it = hiddenColumns.iterator();
- while (it.hasNext())
- {
- int[] range = it.next();
- size += range[1] - range[0] + 1;
- }
+ int[] range = it.next();
+ size += range[1] - range[0] + 1;
}
+
numColumns = size;
}
*/
public void makeVisibleAnnotation(AlignmentAnnotation alignmentAnnotation)
{
- makeVisibleAnnotation(0, alignmentAnnotation.annotations.length,
+ if (alignmentAnnotation != null
+ && alignmentAnnotation.annotations != null)
+ {
+ makeVisibleAnnotation(0, alignmentAnnotation.annotations.length,
alignmentAnnotation);
+ }
}
/**
int startFrom = start;
int endAt = end;
- if (alignmentAnnotation.annotations != null)
+ if (alignmentAnnotation != null
+ && alignmentAnnotation.annotations != null)
{
if (hiddenColumns != null && hiddenColumns.size() > 0)
{
higestRange = (range[1] >= endPos) ? range : higestRange;
}
- if (lowestRange[0] == -1 && lowestRange[1] == -1)
+ if (lowestRange[0] == -1) // includes (lowestRange[1] == -1)
{
startPos = alignmentStartEnd[0];
}
startPos = lowestRange[1] + 1;
}
- if (higestRange[0] == -1 && higestRange[1] == -1)
+ if (higestRange[0] == -1) // includes (higestRange[1] == -1)
{
endPos = alignmentStartEnd[1];
}
{
reveal = hiddenColumns.get(regionindex);
}
- // or try the next region
- else
- {
- regionindex++;
- if (regionindex < hiddenColumns.size()
- && hiddenColumns.get(regionindex)[0] == adjres + 1)
- {
- reveal = hiddenColumns.get(regionindex);
- }
- }
}
return reveal;