From: Jim Procter Date: Wed, 12 Feb 2020 17:36:44 +0000 (+0000) Subject: JAL-3187 first stab at ‘show CDS/Protein Settings’ for convenient switching between... X-Git-Tag: Develop-2_11_2_0-d20201215~101^2~17 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=5fefa2921f96368c895ff07e8340653a477cd68b;p=jalview.git JAL-3187 first stab at ‘show CDS/Protein Settings’ for convenient switching between complementary feature settings --- 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);