From 5fefa2921f96368c895ff07e8340653a477cd68b Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Wed, 12 Feb 2020 17:36:44 +0000 Subject: [PATCH] =?utf8?q?JAL-3187=20first=20stab=20at=20=E2=80=98show=20CDS?= =?utf8?q?/Protein=20Settings=E2=80=99=20for=20convenient=20switching=20betw?= =?utf8?q?een=20complementary=20feature=20settings?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- resources/lang/Messages.properties | 1 + src/jalview/gui/FeatureSettings.java | 40 ++++++++++++++++++++++++++++++---- 2 files changed, 37 insertions(+), 4 deletions(-) diff --git a/resources/lang/Messages.properties b/resources/lang/Messages.properties index fdd15cd..05f05ea 100644 --- a/resources/lang/Messages.properties +++ b/resources/lang/Messages.properties @@ -1401,6 +1401,7 @@ label.create_image_of = Create {0} image of {1} label.click_to_edit = Click to edit, right-click for menu label.by_annotation_tooltip = Annotation Colour is configured from the main Colour menu label.show_linked_features = Show {0} features +label.show_linked_feature_settings = Open {0} settings label.on_top = on top label.include_linked_features = Include {0} features label.include_linked_tooltip = Include visible {0} features
converted to local sequence coordinates \ No newline at end of file diff --git a/src/jalview/gui/FeatureSettings.java b/src/jalview/gui/FeatureSettings.java index 11d5e39..8ce090f 100644 --- a/src/jalview/gui/FeatureSettings.java +++ b/src/jalview/gui/FeatureSettings.java @@ -20,6 +20,7 @@ */ package jalview.gui; +import jalview.api.AlignViewControllerGuiI; import jalview.api.AlignViewportI; import jalview.api.FeatureColourI; import jalview.api.FeatureSettingsControllerI; @@ -47,7 +48,6 @@ import java.awt.BorderLayout; import java.awt.Color; import java.awt.Component; import java.awt.Dimension; -import java.awt.FlowLayout; import java.awt.Font; import java.awt.Graphics; import java.awt.GridLayout; @@ -1310,7 +1310,38 @@ public class FeatureSettings extends JPanel refreshDisplay(); } }); - + JButton viewComplementSettings = new JButton(MessageManager + .formatMessage("label.show_linked_feature_settings", + nucleotide + ? MessageManager.getString("label.protein") + .toLowerCase() + : "CDS")); + viewComplementSettings.addActionListener(new ActionListener() + { + + @Override + public void actionPerformed(ActionEvent e) + { + AlignViewControllerGuiI complAf = af.getSplitViewContainer() + .getComplementAlignFrame(af); + FeatureSettings complFeatureSettings = (FeatureSettings) complAf + .getFeatureSettingsUI(); + if (complFeatureSettings != null) + { + complFeatureSettings.frame.setVisible(true); + try + { + complFeatureSettings.frame.setSelected(true); + return; + } catch (Exception q) + { + } + } + { + complAf.showFeatureSettingsUI(); + } + } + }); JPanel lowerPanel = new JPanel(new GridLayout(1, 2)); bigPanel.add(lowerPanel, BorderLayout.SOUTH); @@ -1323,14 +1354,15 @@ public class FeatureSettings extends JPanel boolean hasComplement = af.getViewport().getCodingComplement() != null; JPanel transPanelLeft = new JPanel( - new GridLayout(hasComplement ? 3 : 2, 1)); + new GridLayout(hasComplement ? 4 : 2, 1)); transPanelLeft.add(new JLabel(" Colour transparency" + ":")); transPanelLeft.add(transparency); if (hasComplement) { - JPanel cp = new JPanel(new FlowLayout(FlowLayout.LEFT)); + JPanel cp = new JPanel(new GridLayout(3, 2)); cp.add(showComplement); cp.add(showComplementOnTop); + cp.add(viewComplementSettings); transPanelLeft.add(cp); } lowerPanel.add(transPanelLeft); -- 1.7.10.2