From: Jim Procter Date: Tue, 2 May 2017 16:59:01 +0000 (+0100) Subject: JAL-1632 validate CalculationChooser when selection or alignment changes X-Git-Tag: Release_2_10_2~3^2~105^2~2^2~1 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=20ef625b0c1441ed696d93a5749ae011ef5016fa;p=jalview.git JAL-1632 validate CalculationChooser when selection or alignment changes --- diff --git a/src/jalview/gui/AlignmentPanel.java b/src/jalview/gui/AlignmentPanel.java index ccb3464..04de50b 100644 --- a/src/jalview/gui/AlignmentPanel.java +++ b/src/jalview/gui/AlignmentPanel.java @@ -171,6 +171,11 @@ public class AlignmentPanel extends GAlignmentPanel implements { av.alignmentChanged(this); + if (getCalculationDialog() != null) + { + getCalculationDialog().validateCalcTypes(); + } + alignFrame.updateEditMenuBar(); paintAlignment(true); diff --git a/src/jalview/gui/SeqPanel.java b/src/jalview/gui/SeqPanel.java index e0b80fe..ab53c58 100644 --- a/src/jalview/gui/SeqPanel.java +++ b/src/jalview/gui/SeqPanel.java @@ -1956,9 +1956,20 @@ public class SeqPanel extends JPanel implements MouseListener, // shared between viewports. boolean iSentTheSelection = (av == source || (source instanceof AlignViewport && ((AlignmentViewport) source) .getSequenceSetId().equals(av.getSequenceSetId()))); - if (iSentTheSelection || !av.followSelection) + + if (iSentTheSelection) { - return; + // respond to our own event by updating dependent dialogs + if (ap.getCalculationDialog() != null) + { + ap.getCalculationDialog().validateCalcTypes(); + } + + // process further ? + if (!av.followSelection) + { + return; + } } /* @@ -2056,6 +2067,13 @@ public class SeqPanel extends JPanel implements MouseListener, PaintRefresher.Refresh(this, av.getSequenceSetId()); // ap.paintAlignment(false); } + + // lastly, update dependent dialogs + if (ap.getCalculationDialog() != null) + { + ap.getCalculationDialog().validateCalcTypes(); + } + } /** @@ -2095,6 +2113,12 @@ public class SeqPanel extends JPanel implements MouseListener, av); av.setColumnSelection(cs); + // lastly, update any dependent dialogs + if (ap.getCalculationDialog() != null) + { + ap.getCalculationDialog().validateCalcTypes(); + } + PaintRefresher.Refresh(this, av.getSequenceSetId()); return true;