/*\r
* Jalview - A Sequence Alignment Editor and Viewer\r
-* Copyright (C) 2005 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle\r
+* Copyright (C) 2006 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle\r
*\r
* This program is free software; you can redistribute it and/or\r
* modify it under the terms of the GNU General Public License\r
import javax.swing.event.*;\r
import java.util.*;\r
import jalview.datamodel.SequenceGroup;\r
+import java.awt.Dimension;\r
+import javax.swing.BorderFactory;\r
\r
public class AnnotationColourChooser\r
extends JPanel\r
for (int g = 0; g < allGroups.size(); g++)\r
{\r
sg = (SequenceGroup) allGroups.get(g);\r
- oldgroupColours.put(sg, sg.cs);\r
+ if(sg.cs!=null)\r
+ oldgroupColours.put(sg, sg.cs);\r
}\r
}\r
this.av = av;\r
throws Exception\r
{\r
minColour.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));\r
- minColour.setToolTipText("");\r
- minColour.setMargin(new Insets(2, 2, 2, 2));\r
- minColour.setText("Min Colour");\r
- minColour.addActionListener(new ActionListener()\r
+ minColour.setBorder(BorderFactory.createEtchedBorder());\r
+ minColour.setPreferredSize(new Dimension(40, 20));\r
+ minColour.setToolTipText("Minimum Colour");\r
+ minColour.addMouseListener(new MouseAdapter()\r
{\r
- public void actionPerformed(ActionEvent e)\r
+ public void mousePressed(MouseEvent e)\r
{\r
- minColour_actionPerformed(e);\r
+ if (minColour.isEnabled())\r
+ minColour_actionPerformed();\r
}\r
});\r
maxColour.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));\r
- maxColour.setMargin(new Insets(2, 2, 2, 2));\r
- maxColour.setText("Max Colour");\r
- maxColour.addActionListener(new ActionListener()\r
+ maxColour.setBorder(BorderFactory.createEtchedBorder());\r
+ maxColour.setPreferredSize(new Dimension(40, 20));\r
+ maxColour.setToolTipText("Maximum Colour");\r
+ maxColour.addMouseListener(new MouseAdapter()\r
{\r
- public void actionPerformed(ActionEvent e)\r
+ public void mousePressed(MouseEvent e)\r
{\r
- maxColour_actionPerformed(e);\r
+ if (maxColour.isEnabled())\r
+ maxColour_actionPerformed();\r
}\r
});\r
ok.setOpaque(false);\r
}\r
\r
JComboBox annotations = new JComboBox();\r
- JButton minColour = new JButton();\r
- JButton maxColour = new JButton();\r
+ JPanel minColour = new JPanel();\r
+ JPanel maxColour = new JPanel();\r
JButton ok = new JButton();\r
JButton cancel = new JButton();\r
JPanel jPanel1 = new JPanel();\r
JTextField thresholdValue = new JTextField(20);\r
JCheckBox currentColours = new JCheckBox();\r
\r
- public void minColour_actionPerformed(ActionEvent e)\r
+ public void minColour_actionPerformed()\r
{\r
Color col = JColorChooser.showDialog(this,\r
"Select Colour for Minimum Value",\r
changeColour();\r
}\r
\r
- public void maxColour_actionPerformed(ActionEvent e)\r
+ public void maxColour_actionPerformed()\r
{\r
Color col = JColorChooser.showDialog(this,\r
"Select Colour for Maximum Value",\r