From 5f7330e5fb8a2c16ff6543bc492cce458fb8274f Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Tue, 15 Jan 2019 13:10:42 +0000 Subject: [PATCH] JAL-1767 refactor associated view logic to public method and synchronise PCAPanel.av/ap with RotateableCanvac.ap/av --- src/jalview/gui/PCAPanel.java | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/src/jalview/gui/PCAPanel.java b/src/jalview/gui/PCAPanel.java index df0cd03..3388d4d 100644 --- a/src/jalview/gui/PCAPanel.java +++ b/src/jalview/gui/PCAPanel.java @@ -508,11 +508,7 @@ public class PCAPanel extends GPCAPanel @Override public void actionPerformed(ActionEvent evt) { - getRotatableCanvas().setApplyToAllViews(false); - getRotatableCanvas().av = panel.av; - getRotatableCanvas().ap = panel; - PaintRefresher.Register(PCAPanel.this, - panel.av.getSequenceSetId()); + selectAssociatedView(panel); } }); @@ -778,4 +774,21 @@ public class PCAPanel extends GPCAPanel { this.top = top; } + + /** + * set the associated view for this PCA. + * + * @param panel + */ + public void selectAssociatedView(AlignmentPanel panel) + { + getRotatableCanvas().setApplyToAllViews(false); + + ap = panel; + av = panel.av; + + getRotatableCanvas().av = panel.av; + getRotatableCanvas().ap = panel; + PaintRefresher.Register(PCAPanel.this, panel.av.getSequenceSetId()); + } } -- 1.7.10.2