X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FAnnotationColourChooser.java;h=b748c85c01c57390eb0631a225890b0227aaaef8;hb=6834a636a0b72693041e2f1090c1123f215c9ec1;hp=f4992177c1494dc1c1f6d6c8ae37e7c0b7b69419;hpb=174230b4233d9ce80f94527768d2cd2f76da11ab;p=jalview.git diff --git a/src/jalview/gui/AnnotationColourChooser.java b/src/jalview/gui/AnnotationColourChooser.java index f499217..b748c85 100755 --- a/src/jalview/gui/AnnotationColourChooser.java +++ b/src/jalview/gui/AnnotationColourChooser.java @@ -26,6 +26,8 @@ import jalview.schemes.*; import javax.swing.event.*; import java.util.*; import jalview.datamodel.SequenceGroup; +import java.awt.Dimension; +import javax.swing.BorderFactory; public class AnnotationColourChooser extends JPanel @@ -127,24 +129,27 @@ public class AnnotationColourChooser throws Exception { minColour.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11)); - minColour.setToolTipText(""); - minColour.setMargin(new Insets(2, 2, 2, 2)); - minColour.setText("Min Colour"); - minColour.addActionListener(new ActionListener() + minColour.setBorder(BorderFactory.createEtchedBorder()); + minColour.setPreferredSize(new Dimension(40, 20)); + minColour.setToolTipText("Minimum Colour"); + minColour.addMouseListener(new MouseAdapter() { - public void actionPerformed(ActionEvent e) + public void mousePressed(MouseEvent e) { - minColour_actionPerformed(e); + if (minColour.isEnabled()) + minColour_actionPerformed(); } }); maxColour.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11)); - maxColour.setMargin(new Insets(2, 2, 2, 2)); - maxColour.setText("Max Colour"); - maxColour.addActionListener(new ActionListener() + maxColour.setBorder(BorderFactory.createEtchedBorder()); + maxColour.setPreferredSize(new Dimension(40, 20)); + maxColour.setToolTipText("Maximum Colour"); + maxColour.addMouseListener(new MouseAdapter() { - public void actionPerformed(ActionEvent e) + public void mousePressed(MouseEvent e) { - maxColour_actionPerformed(e); + if (maxColour.isEnabled()) + maxColour_actionPerformed(); } }); ok.setOpaque(false); @@ -225,8 +230,8 @@ public class AnnotationColourChooser } JComboBox annotations = new JComboBox(); - JButton minColour = new JButton(); - JButton maxColour = new JButton(); + JPanel minColour = new JPanel(); + JPanel maxColour = new JPanel(); JButton ok = new JButton(); JButton cancel = new JButton(); JPanel jPanel1 = new JPanel(); @@ -240,7 +245,7 @@ public class AnnotationColourChooser JTextField thresholdValue = new JTextField(20); JCheckBox currentColours = new JCheckBox(); - public void minColour_actionPerformed(ActionEvent e) + public void minColour_actionPerformed() { Color col = JColorChooser.showDialog(this, "Select Colour for Minimum Value", @@ -251,7 +256,7 @@ public class AnnotationColourChooser changeColour(); } - public void maxColour_actionPerformed(ActionEvent e) + public void maxColour_actionPerformed() { Color col = JColorChooser.showDialog(this, "Select Colour for Maximum Value",