JAL-3187 first stab at ‘show CDS/Protein Settings’ for convenient switching between...
authorJim Procter <jprocter@issues.jalview.org>
Wed, 12 Feb 2020 17:36:44 +0000 (17:36 +0000)
committerJim Procter <jprocter@issues.jalview.org>
Wed, 12 Feb 2020 17:36:44 +0000 (17:36 +0000)
resources/lang/Messages.properties
src/jalview/gui/FeatureSettings.java

index fdd15cd..05f05ea 100644 (file)
@@ -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<br>converted to local sequence coordinates
\ No newline at end of file
index 11d5e39..8ce090f 100644 (file)
@@ -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);