From: Jim Procter Date: Tue, 15 Jan 2019 13:10:42 +0000 (+0000) Subject: JAL-1767 refactor associated view logic to public method and synchronise PCAPanel... X-Git-Tag: Release_2_11_1_0~78^2~1 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=5f7330e5fb8a2c16ff6543bc492cce458fb8274f;p=jalview.git JAL-1767 refactor associated view logic to public method and synchronise PCAPanel.av/ap with RotateableCanvac.ap/av --- 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()); + } }