From: Jim Procter Date: Thu, 22 Jul 2021 19:41:26 +0000 (+0100) Subject: JAL-3853 JAL-1870 toggle to enable/disable posterior probability transparency when... X-Git-Url: http://source.jalview.org/gitweb/?p=jalview.git;a=commitdiff_plain;h=5eb7a8846e81e791ad3f6d018d6e64d0a512a549 JAL-3853 JAL-1870 toggle to enable/disable posterior probability transparency when rendering per sequence annotation row scores .. needs more work --- diff --git a/src/jalview/gui/AnnotationColourChooser.java b/src/jalview/gui/AnnotationColourChooser.java index bd05be1..33708ae 100644 --- a/src/jalview/gui/AnnotationColourChooser.java +++ b/src/jalview/gui/AnnotationColourChooser.java @@ -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) diff --git a/src/jalview/gui/AnnotationRowFilter.java b/src/jalview/gui/AnnotationRowFilter.java index f13cb10..50835f2 100644 --- a/src/jalview/gui/AnnotationRowFilter.java +++ b/src/jalview/gui/AnnotationRowFilter.java @@ -367,6 +367,7 @@ public abstract class AnnotationRowFilter extends JPanel updateView(); } + protected void propagateSeqAssociatedThreshold(boolean allAnnotation, AlignmentAnnotation annotation)