JAL-3853 JAL-1870 toggle to enable/disable posterior probability transparency when...
authorJim Procter <j.procter@dundee.ac.uk>
Thu, 22 Jul 2021 19:41:26 +0000 (20:41 +0100)
committerJim Procter <j.procter@dundee.ac.uk>
Thu, 22 Jul 2021 19:46:18 +0000 (20:46 +0100)
src/jalview/gui/AnnotationColourChooser.java
src/jalview/gui/AnnotationRowFilter.java

index bd05be1..33708ae 100644 (file)
@@ -68,6 +68,7 @@ public class AnnotationColourChooser extends AnnotationRowFilter
   JPanel maxColour = new JPanel();
 
   private JCheckBox thresholdIsMin = new JCheckBox();
+  private JCheckBox transparency = new JCheckBox();
 
   protected static final int MIN_WIDTH = 500;
 
@@ -247,6 +248,19 @@ public class AnnotationColourChooser extends AnnotationRowFilter
       }
     });
 
+    transparency.setBackground(Color.white);
+    transparency.setFont(JvSwingUtils.getLabelFont());
+    transparency
+            .setText(MessageManager.getString("Use Transparency"));
+    transparency.addActionListener(new ActionListener()
+    {
+
+      @Override
+      public void actionPerformed(ActionEvent arg0)
+      {
+        transparency_actionPerformed();
+      }
+    });
     this.setLayout(new BorderLayout());
     JPanel jPanel1 = new JPanel();
     JPanel jPanel2 = new JPanel();
@@ -259,6 +273,7 @@ public class AnnotationColourChooser extends AnnotationRowFilter
     jPanel2.add(annotations, "grow, wrap");
     jPanel2.add(seqAssociated);
     jPanel2.add(useOriginalColours);
+    jPanel2.add(transparency);
     JPanel colpanel = new JPanel(new FlowLayout());
     colpanel.setBackground(Color.white);
     colpanel.add(minColour);
@@ -274,6 +289,10 @@ public class AnnotationColourChooser extends AnnotationRowFilter
     this.validate();
   }
 
+  protected void transparency_actionPerformed()
+  {
+    updateView();
+  }
   protected void resetColours_actionPerformed()
   {
     setDefaultMinMax();
@@ -433,6 +452,8 @@ public class AnnotationColourChooser extends AnnotationRowFilter
 
     acg.setThresholdIsMinMax(thresholdIsMin.isSelected());
 
+    acg.setPositionToTransparency(transparency.isSelected());
+    
     this.ap.alignFrame.changeColour(acg);
 
     if (av.getAlignment().getGroups() != null)
index f13cb10..50835f2 100644 (file)
@@ -367,6 +367,7 @@ public abstract class AnnotationRowFilter extends JPanel
 
     updateView();
   }
+  
 
   protected void propagateSeqAssociatedThreshold(boolean allAnnotation,
           AlignmentAnnotation annotation)