JAL-3187 basic first version for tooltips only (rendering yet to do)
[jalview.git] / src / jalview / gui / FeatureSettings.java
index dbe3317..35215b4 100644 (file)
@@ -150,6 +150,8 @@ public class FeatureSettings extends JPanel
 
   JSlider transparency = new JSlider();
 
+  JCheckBox showComplement;
+
   /*
    * when true, constructor is still executing - so ignore UI events
    */
@@ -1260,6 +1262,19 @@ public class FeatureSettings extends JPanel
     transparency.setToolTipText(
             MessageManager.getString("label.transparency_tip"));
 
+    boolean nucleotide = af.getViewport().getAlignment().isNucleotide();
+    showComplement = new JCheckBox(
+            "Show " + (nucleotide ? "protein" : "CDS") + " features");
+    showComplement.addActionListener(new ActionListener()
+    {
+      @Override
+      public void actionPerformed(ActionEvent e)
+      {
+        af.getViewport()
+                .setShowComplementFeatures(showComplement.isSelected());
+      }
+    });
+
     JPanel transPanel = new JPanel(new GridLayout(1, 2));
     bigPanel.add(transPanel, BorderLayout.SOUTH);
 
@@ -1269,7 +1284,16 @@ public class FeatureSettings extends JPanel
     transbuttons.add(sortByScore);
     transbuttons.add(sortByDens);
     transbuttons.add(help);
-    transPanel.add(transparency);
+
+    boolean hasComplement = af.getViewport().getCodingComplement() != null;
+    JPanel transPanelLeft = new JPanel(
+            new GridLayout(hasComplement ? 2 : 1, 1));
+    transPanelLeft.add(transparency);
+    if (hasComplement)
+    {
+      transPanelLeft.add(showComplement);
+    }
+    transPanel.add(transPanelLeft);
     transPanel.add(transbuttons);
 
     JPanel buttonPanel = new JPanel();