From 6a0443ac38398913712bcece37a672d0f33e8d81 Mon Sep 17 00:00:00 2001 From: gmungoc Date: Mon, 21 Jan 2019 12:41:17 +0000 Subject: [PATCH] JAL-3187 repaint a 'following' complementary view on change --- src/jalview/gui/FeatureSettings.java | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/src/jalview/gui/FeatureSettings.java b/src/jalview/gui/FeatureSettings.java index 35215b4..9f7326f 100644 --- a/src/jalview/gui/FeatureSettings.java +++ b/src/jalview/gui/FeatureSettings.java @@ -20,6 +20,7 @@ */ package jalview.gui; +import jalview.api.AlignViewportI; import jalview.api.FeatureColourI; import jalview.api.FeatureSettingsControllerI; import jalview.datamodel.AlignmentI; @@ -520,7 +521,7 @@ public class FeatureSettings extends JPanel { fr.setGroupVisibility(check.getText(), check.isSelected()); resetTable(new String[] { grp }); - af.alignPanel.paintAlignment(true, true); + refreshDisplay(); } }); groupPanel.add(check); @@ -1078,7 +1079,7 @@ public class FeatureSettings extends JPanel if (fr.setFeaturePriority(rowData, visibleNew)) { - af.alignPanel.paintAlignment(true, true); + refreshDisplay(); } } @@ -1253,7 +1254,7 @@ public class FeatureSettings extends JPanel if (!inConstruction) { fr.setTransparency((100 - transparency.getValue()) / 100f); - af.alignPanel.paintAlignment(true, true); + refreshDisplay(); } } }); @@ -1272,6 +1273,7 @@ public class FeatureSettings extends JPanel { af.getViewport() .setShowComplementFeatures(showComplement.isSelected()); + refreshDisplay(); } }); @@ -1307,6 +1309,22 @@ public class FeatureSettings extends JPanel this.add(settingsPane); } + /** + * Repaints alignment, structure and overview (if shown). If there is a + * complementary view which is showing this view's features, then also + * repaints that. + */ + void refreshDisplay() + { + af.alignPanel.paintAlignment(true, true); + AlignViewportI complement = af.getViewport().getCodingComplement(); + if (complement != null && complement.isShowComplementFeatures()) + { + AlignFrame af2 = Desktop.getAlignFrameFor(complement); + af2.alignPanel.paintAlignment(true, true); + } + } + // /////////////////////////////////////////////////////////////////////// // http://java.sun.com/docs/books/tutorial/uiswing/components/table.html // /////////////////////////////////////////////////////////////////////// -- 1.7.10.2