nameHash.put(node.element(), rect);
// Colour selected leaves differently
- SequenceGroup selected = av.getSelectionGroup();
+ boolean isSelected = false;
+ if (tp.getColumnWise())
+ {
+ isSelected = isColumnForNodeSelected(node);
+ }
+ else
+ {
+ SequenceGroup selected = av.getSelectionGroup();
- if ((selected != null)
- && selected.getSequences(null).contains(node.element()))
+ if ((selected != null)
+ && selected.getSequences(null).contains(node.element()))
+ {
+ isSelected = true;
+ }
+ }
+ if (isSelected)
{
g.setColor(Color.gray);
}
}
+ private boolean isColumnForNodeSelected(BinaryNode bn)
+ {
+ SequenceI rseq = tp.assocAnnotation.sequenceRef;
+ int colm = -1;
+ try
+ {
+ colm = Integer.parseInt(
+ bn.getName().substring(bn.getName().indexOf("c") + 1));
+ } catch (Exception e)
+ {
+ return false;
+ }
+ ColumnSelection cs = av.getColumnSelection();
+ HiddenColumns hc = av.getAlignment().getHiddenColumns();
+ int offp = (rseq != null) ? rseq.findIndex(rseq.getStart() - 1 + colm)
+ : colm;
+
+ if (!av.hasHiddenColumns() || hc.isVisible(offp))
+ {
+ return cs.contains(offp);
+ }
+ return false;
+ }
+
private void markColumnsFor(AlignmentPanel[] aps, Vector<BinaryNode> l,
Color col)
{