Merge branch 'develop' into update_212_Dec_merge_with_21125_chamges
[jalview.git] / src / jalview / gui / AnnotationColourChooser.java
index 4e9a26d..477fd6a 100644 (file)
@@ -66,6 +66,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;
 
@@ -245,6 +246,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();
@@ -257,6 +271,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);
@@ -272,6 +287,10 @@ public class AnnotationColourChooser extends AnnotationRowFilter
     this.validate();
   }
 
+  protected void transparency_actionPerformed()
+  {
+    updateView();
+  }
   protected void resetColours_actionPerformed()
   {
     setDefaultMinMax();
@@ -299,7 +318,7 @@ public class AnnotationColourChooser extends AnnotationRowFilter
         updateView();
       }
     };
-    JalviewColourChooser.showColourChooser(Desktop.getDesktop(), ttl,
+    JalviewColourChooser.showColourChooser(Desktop.getDesktopPane(), ttl,
             colourPanel.getBackground(), listener);
   }
 
@@ -425,6 +444,8 @@ public class AnnotationColourChooser extends AnnotationRowFilter
 
     acg.setThresholdIsMinMax(thresholdIsMin.isSelected());
 
+    acg.setPositionToTransparency(transparency.isSelected());
+    
     this.ap.alignFrame.changeColour(acg);
 
     if (av.getAlignment().getGroups() != null)