frame = new JInternalFrame();\r
frame.setContentPane(this);\r
frame.setLayer(JLayeredPane.PALETTE_LAYER);\r
- Desktop.addInternalFrame(frame, "Colour by Annotation", 480, 110);\r
+ Desktop.addInternalFrame(frame, "Colour by Annotation", 470, 110, false);\r
\r
try{\r
jbInit();\r
if(av.alignment.getAlignmentAnnotation()==null)\r
return;\r
\r
- for(int i=0; i<av.alignment.getAlignmentAnnotation().length; i++)\r
+ if(oldcs instanceof AnnotationColourGradient)\r
{\r
- annotations.addItem(av.alignment.getAlignmentAnnotation()[i].label);\r
- }\r
-\r
- // if(av.getGlobalColourScheme() instanceof AnnotationColourGradient)\r
- {\r
- // minColour.\r
+ AnnotationColourGradient acg = (AnnotationColourGradient)oldcs;\r
+ minColour.setBackground( acg.getMinColour() );\r
+ maxColour.setBackground( acg.getMaxColour() );\r
}\r
- // else\r
+ else\r
{\r
minColour.setBackground(Color.orange);\r
maxColour.setBackground(Color.red);\r
}\r
+\r
+ for (int i = 0; i < av.alignment.getAlignmentAnnotation().length; i++)\r
+ {\r
+ annotations.addItem(av.alignment.getAlignmentAnnotation()[i].label);\r
+ }\r
+\r
}\r
\r
public AnnotationColourChooser()\r
thresholdCheck.setSelectedIcon(null);\r
thresholdCheck.setText("Above Threshold");\r
thresholdCheck.setBounds(new Rectangle(329, 6, 109, 23));\r
- apply.setOpaque(false);\r
- apply.setSelectedIcon(null);\r
- apply.setText("Apply");\r
- apply.addActionListener(new ActionListener()\r
+ thresholdCheck.addActionListener(new ActionListener()\r
{\r
public void actionPerformed(ActionEvent e)\r
{\r
- apply_actionPerformed(e);\r
+ thresholdCheck_actionPerformed(e);\r
}\r
});\r
ok.setOpaque(false);\r
this.setLayout(borderLayout1);\r
jPanel2.setLayout(null);\r
annotations.setBounds(new Rectangle(5, 7, 135, 21));\r
+ annotations.addActionListener(new ActionListener()\r
+ {\r
+ public void actionPerformed(ActionEvent e)\r
+ {\r
+ annotations_actionPerformed(e);\r
+ }\r
+ });\r
jPanel1.setBackground(Color.white);\r
jPanel2.setBackground(Color.white);\r
- jPanel1.add(apply);\r
jPanel1.add(ok);\r
jPanel1.add(cancel);\r
jPanel2.add(annotations);\r
JButton minColour = new JButton();\r
JButton maxColour = new JButton();\r
JCheckBox thresholdCheck = new JCheckBox();\r
- JButton apply = new JButton();\r
JButton ok = new JButton();\r
JButton cancel = new JButton();\r
JPanel jPanel1 = new JPanel();\r
JPanel jPanel2 = new JPanel();\r
BorderLayout borderLayout1 = new BorderLayout();\r
- public void apply_actionPerformed(ActionEvent e)\r
- {\r
- changeColour();\r
- }\r
+\r
\r
public void minColour_actionPerformed(ActionEvent e)\r
{\r
if (col != null)\r
minColour.setBackground(col);\r
minColour.repaint();\r
+ changeColour();\r
}\r
\r
public void maxColour_actionPerformed(ActionEvent e)\r
if (col != null)\r
maxColour.setBackground(col);\r
maxColour.repaint();\r
+ changeColour();\r
}\r
\r
void changeColour()\r
}catch(Exception ex){}\r
}\r
\r
+ public void thresholdCheck_actionPerformed(ActionEvent e)\r
+ {\r
+ changeColour();\r
+ }\r
+\r
+ public void annotations_actionPerformed(ActionEvent e)\r
+ {\r
+ changeColour();\r
+ }\r
+\r
}\r