From 47d7a627f0bb59aaa87b158ce3572658a9861a08 Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Tue, 17 Oct 2017 14:42:56 +0100 Subject: [PATCH] JAL-2773 renamed flags for clarity --- src/jalview/gui/FeatureColourChooser.java | 6 +++--- src/jalview/gui/SeqPanel.java | 25 +++++++++++++------------ 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/src/jalview/gui/FeatureColourChooser.java b/src/jalview/gui/FeatureColourChooser.java index 2e9f0ed..d8db546 100644 --- a/src/jalview/gui/FeatureColourChooser.java +++ b/src/jalview/gui/FeatureColourChooser.java @@ -396,9 +396,9 @@ public class FeatureColourChooser extends JalviewDialog * feature type, and repaints the alignment, and optionally the Overview * and/or structure viewer if open * - * @param updateOverview + * @param updateStructsAndOverview */ - void changeColour(boolean updateOverview) + void changeColour(boolean updateStructsAndOverview) { // Check if combobox is still adjusting if (adjusting) @@ -507,7 +507,7 @@ public class FeatureColourChooser extends JalviewDialog } fr.setColour(type, acg); cs = acg; - ap.paintAlignment(updateOverview, updateOverview); + ap.paintAlignment(updateStructsAndOverview, updateStructsAndOverview); } @Override diff --git a/src/jalview/gui/SeqPanel.java b/src/jalview/gui/SeqPanel.java index 531eca6..516652b 100644 --- a/src/jalview/gui/SeqPanel.java +++ b/src/jalview/gui/SeqPanel.java @@ -852,11 +852,12 @@ public class SeqPanel extends JPanel /** * set when the current UI interaction has resulted in a change that requires - * overview shading to be recalculated. this could be changed to something - * more expressive that indicates what actually has changed, so selective - * redraws can be applied + * shading in overviews and structures to be recalculated. this could be + * changed to a something more expressive that indicates what actually has + * changed, so selective redraws can be applied (ie. only structures, only + * overview, etc) */ - private boolean needOverviewUpdate = false; // TODO: refactor to avcontroller + private boolean updateOverviewAndStructs = false; // TODO: refactor to avcontroller /** * set if av.getSelectionGroup() refers to a group that is defined on the @@ -1656,7 +1657,7 @@ public class SeqPanel extends JPanel final int res = findColumn(evt); final int seq = findSeq(evt); oldSeq = seq; - needOverviewUpdate = false; + updateOverviewAndStructs = false; startWrapBlock = wrappedBlock; @@ -1821,7 +1822,7 @@ public class SeqPanel extends JPanel // always do this - annotation has own state // but defer colourscheme update until hidden sequences are passed in boolean vischange = stretchGroup.recalcConservation(true); - needOverviewUpdate |= vischange && av.isSelectionDefinedGroup() + updateOverviewAndStructs |= vischange && av.isSelectionDefinedGroup() && afterDrag; if (stretchGroup.cs != null) { @@ -1843,8 +1844,8 @@ public class SeqPanel extends JPanel PaintRefresher.Refresh(this, av.getSequenceSetId()); // TODO: structure colours only need updating if stretchGroup used to or now // does contain sequences with structure views - ap.paintAlignment(needOverviewUpdate, needOverviewUpdate); - needOverviewUpdate = false; + ap.paintAlignment(updateOverviewAndStructs, updateOverviewAndStructs); + updateOverviewAndStructs = false; changeEndRes = false; changeStartRes = false; stretchGroup = null; @@ -1898,7 +1899,7 @@ public class SeqPanel extends JPanel if (res > (stretchGroup.getStartRes() - 1)) { stretchGroup.setEndRes(res); - needOverviewUpdate |= av.isSelectionDefinedGroup(); + updateOverviewAndStructs |= av.isSelectionDefinedGroup(); } } else if (changeStartRes) @@ -1906,7 +1907,7 @@ public class SeqPanel extends JPanel if (res < (stretchGroup.getEndRes() + 1)) { stretchGroup.setStartRes(res); - needOverviewUpdate |= av.isSelectionDefinedGroup(); + updateOverviewAndStructs |= av.isSelectionDefinedGroup(); } } @@ -1940,7 +1941,7 @@ public class SeqPanel extends JPanel if (stretchGroup.getSequences(null).contains(nextSeq)) { stretchGroup.deleteSequence(seq, false); - needOverviewUpdate |= av.isSelectionDefinedGroup(); + updateOverviewAndStructs |= av.isSelectionDefinedGroup(); } else { @@ -1950,7 +1951,7 @@ public class SeqPanel extends JPanel } stretchGroup.addSequence(nextSeq, false); - needOverviewUpdate |= av.isSelectionDefinedGroup(); + updateOverviewAndStructs |= av.isSelectionDefinedGroup(); } } -- 1.7.10.2