}
// do we want to thread this ? (contention with seqsel and colsel locks, I
// suspect)
- boolean repaint = false;
+ // rules are: colsel is copied if there is a real intersection between sequence selection
+ boolean repaint = false,copycolsel=true;
if (av.selectionGroup == null || !av.isSelectionGroupChanged())
{
SequenceGroup sgroup = null;
}
sgroup = seqsel.intersect(av.alignment,
(av.hasHiddenRows) ? av.hiddenRepSequences : null);
+ if ((sgroup==null || sgroup.getSize()==0) && (colsel==null || colsel.size()==0))
+ {
+ // don't copy columns if the region didn't intersect.
+ copycolsel=false;
+ }
}
if (sgroup != null && sgroup.getSize() > 0)
{
}
repaint = av.isSelectionGroupChanged();
}
- if (av.colSel == null || !av.isColSelChanged())
+ if (copycolsel && (av.colSel == null || !av.isColSelChanged()))
{
// the current selection is unset or from a previous message
// so import the new colsel.
}
else
{
+ // TODO: shift colSel according to the intersecting sequences
if (av.colSel == null)
{
av.colSel = new ColumnSelection(colsel);
}
repaint |= av.isColSelChanged();
}
- if (av.hasHiddenColumns
+ if (copycolsel && av.hasHiddenColumns
&& (av.colSel == null || av.colSel.getHiddenColumns() == null))
{
System.err.println("Bad things");