X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fappletgui%2FSeqPanel.java;h=a43796015d001514f610c347571c534558c3888a;hb=4d9ad51dc8a445c2f1fb02b997e13bd945fa8ad2;hp=d88add1e572e4f27ad9a8699b800f52b165bbb31;hpb=e2f5868d84779717b0f2835ef009b30c9f6be078;p=jalview.git diff --git a/src/jalview/appletgui/SeqPanel.java b/src/jalview/appletgui/SeqPanel.java index d88add1..a437960 100644 --- a/src/jalview/appletgui/SeqPanel.java +++ b/src/jalview/appletgui/SeqPanel.java @@ -1529,9 +1529,11 @@ public class SeqPanel extends Panel implements MouseMotionListener, { return; } - - stretchGroup.recalcConservation(); // always do this - annotation has own - // state + // always do this - annotation has own state + // but defer colourscheme update until hidden sequences are passed in + boolean vischange = stretchGroup.recalcConservation(true); + // here we rely on stretchGroup == av.getSelection() + needOverviewUpdate |= vischange && av.isSelectionDefinedGroup(); if (stretchGroup.cs != null) { stretchGroup.cs.alignmentChanged(stretchGroup, @@ -1550,6 +1552,7 @@ public class SeqPanel extends Panel implements MouseMotionListener, } PaintRefresher.Refresh(ap, av.getSequenceSetId()); ap.paintAlignment(needOverviewUpdate); + needOverviewUpdate =false; changeEndRes = false; changeStartRes = false; stretchGroup = null; @@ -1604,6 +1607,7 @@ public class SeqPanel extends Panel implements MouseMotionListener, if (res > (stretchGroup.getStartRes() - 1)) { stretchGroup.setEndRes(res); + needOverviewUpdate |= av.isSelectionDefinedGroup(); } } else if (changeStartRes) @@ -1611,6 +1615,7 @@ public class SeqPanel extends Panel implements MouseMotionListener, if (res < (stretchGroup.getEndRes() + 1)) { stretchGroup.setStartRes(res); + needOverviewUpdate |= av.isSelectionDefinedGroup(); } } @@ -1644,6 +1649,7 @@ public class SeqPanel extends Panel implements MouseMotionListener, if (stretchGroup.getSequences(null).contains(nextSeq)) { stretchGroup.deleteSequence(seq, false); + needOverviewUpdate |= av.isSelectionDefinedGroup(); } else { @@ -1653,6 +1659,7 @@ public class SeqPanel extends Panel implements MouseMotionListener, } stretchGroup.addSequence(nextSeq, false); + needOverviewUpdate |= av.isSelectionDefinedGroup(); } } @@ -1821,9 +1828,12 @@ public class SeqPanel extends Panel implements MouseMotionListener, // do we want to thread this ? (contention with seqsel and colsel locks, I // suspect) - // rules are: colsel is copied if there is a real intersection between - // sequence selection - boolean repaint = false, copycolsel = true; + /* + * only copy colsel if there is a real intersection between + * sequence selection and this panel's alignment + */ + boolean repaint = false; + boolean copycolsel = false; if (av.getSelectionGroup() == null || !av.isSelectionGroupChanged(true)) { SequenceGroup sgroup = null; @@ -1840,11 +1850,9 @@ public class SeqPanel extends Panel implements MouseMotionListener, } sgroup = seqsel.intersect(av.getAlignment(), (av.hasHiddenRows()) ? av.getHiddenRepSequences() : null); - if ((sgroup == null || sgroup.getSize() == 0) - && (colsel == null || colsel.isEmpty())) + if ((sgroup != null && sgroup.getSize() > 0)) { - // don't copy columns if the region didn't intersect. - copycolsel = false; + copycolsel = true; } } if (sgroup != null && sgroup.getSize() > 0) @@ -1972,7 +1980,6 @@ public class SeqPanel extends Panel implements MouseMotionListener, ColumnSelection cs = MappingUtils.mapColumnSelection(colsel, sourceAv, av); av.setColumnSelection(cs); - av.isColSelChanged(true); ap.scalePanelHolder.repaint(); ap.repaint();