+ if (_aa.sequenceRef == null)
+ {
+ rowsel = columnSelection.intersects(ci.cStart, ci.cEnd);
+ }
+ else
+ {
+ // TODO check we have correctly mapped cstart to local sequence
+ // numbering
+ int s = _aa.sequenceRef.findIndex(ci.cStart);
+ int e = _aa.sequenceRef.findIndex(ci.cEnd);
+ if (maskHiddenCols && hasHiddenColumns)
+ {
+ // TODO: turn into function and create test !!
+ Iterator<int[]> viscont = hiddenColumns
+ .getVisContigsIterator(s, e, false);
+ containsHidden = !viscont.hasNext();
+ }
+ if (s > 0 && s < _aa.sequenceRef.getLength())
+ {
+ rowsel = columnSelection.intersects(s, e);
+ }
+
+ }
+ }
+ // TODO: show selected region
+ if (colsel || rowsel)
+ {
+
+ col = getSelectedColorForRange(min, max, contacts, ci.cStart,
+ ci.cEnd);
+ if (colsel && rowsel)
+ {
+ col = new Color(col.getBlue(), col.getGreen(), col.getRed());
+ }
+ else
+ {
+ col = new Color(col.getBlue(), col.getBlue(), col.getBlue());
+ }
+ }
+ else
+ {
+ col = getColorForRange(min, max, contacts, ci.cStart, ci.cEnd);
+ }
+ if (containsHidden)
+ {
+ col = Color.red;
+ }
+ g.setColor(col);
+ if (cgeom.pixels_step > 1)
+ {
+ g.fillRect(x * charWidth, ht, charWidth, 1 + cgeom.pixels_step);