2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8)
3 * Copyright (C) 2012 J Procter, AM Waterhouse, LM Lui, J Engelhardt, G Barton, M Clamp, S Searle
5 * This file is part of Jalview.
7 * Jalview is free software: you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
11 * Jalview is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty
13 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 * PURPOSE. See the GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License along with Jalview. If not, see <http://www.gnu.org/licenses/>.
18 package jalview.jbgui;
20 import jalview.util.MessageManager;
23 import java.awt.event.*;
26 import javax.swing.event.*;
28 public class GPCAPanel extends JInternalFrame
30 JPanel jPanel2 = new JPanel();
32 JLabel jLabel1 = new JLabel();
34 JLabel jLabel2 = new JLabel();
36 JLabel jLabel3 = new JLabel();
38 protected JComboBox xCombobox = new JComboBox();
40 protected JComboBox yCombobox = new JComboBox();
42 protected JComboBox zCombobox = new JComboBox();
44 protected JButton resetButton = new JButton();
46 FlowLayout flowLayout1 = new FlowLayout();
48 BorderLayout borderLayout1 = new BorderLayout();
50 JMenuBar jMenuBar1 = new JMenuBar();
52 JMenu fileMenu = new JMenu();
54 JMenu saveMenu = new JMenu();
56 JMenuItem eps = new JMenuItem();
58 JMenuItem png = new JMenuItem();
60 JMenuItem print = new JMenuItem();
62 JMenuItem outputValues = new JMenuItem();
64 JMenuItem outputPoints = new JMenuItem();
66 JMenuItem outputProjPoints = new JMenuItem();
68 protected JMenu viewMenu = new JMenu();
70 protected JCheckBoxMenuItem showLabels = new JCheckBoxMenuItem();
72 JMenuItem bgcolour = new JMenuItem();
74 JMenuItem originalSeqData = new JMenuItem();
76 protected JMenu associateViewsMenu = new JMenu();
78 protected JMenu calcSettings = new JMenu();
80 protected JCheckBoxMenuItem nuclSetting = new JCheckBoxMenuItem();
82 protected JCheckBoxMenuItem protSetting = new JCheckBoxMenuItem();
84 protected JCheckBoxMenuItem jvVersionSetting = new JCheckBoxMenuItem();
86 protected JLabel statusBar = new JLabel();
88 protected GridLayout statusPanelLayout = new GridLayout();
90 protected JPanel statusPanel = new JPanel();
102 for (int i = 1; i < 8; i++)
104 xCombobox.addItem("dim " + i);
105 yCombobox.addItem("dim " + i);
106 zCombobox.addItem("dim " + i);
109 setJMenuBar(jMenuBar1);
112 private void jbInit() throws Exception
114 this.getContentPane().setLayout(borderLayout1);
115 jPanel2.setLayout(flowLayout1);
116 jLabel1.setFont(new java.awt.Font("Verdana", 0, 12));
117 jLabel1.setText("x=");
118 jLabel2.setFont(new java.awt.Font("Verdana", 0, 12));
119 jLabel2.setText("y=");
120 jLabel3.setFont(new java.awt.Font("Verdana", 0, 12));
121 jLabel3.setText("z=");
122 jPanel2.setBackground(Color.white);
123 jPanel2.setBorder(null);
124 zCombobox.setFont(new java.awt.Font("Verdana", 0, 12));
125 zCombobox.addActionListener(new java.awt.event.ActionListener()
127 public void actionPerformed(ActionEvent e)
129 zCombobox_actionPerformed(e);
132 yCombobox.setFont(new java.awt.Font("Verdana", 0, 12));
133 yCombobox.addActionListener(new java.awt.event.ActionListener()
135 public void actionPerformed(ActionEvent e)
137 yCombobox_actionPerformed(e);
140 xCombobox.setFont(new java.awt.Font("Verdana", 0, 12));
141 xCombobox.addActionListener(new java.awt.event.ActionListener()
143 public void actionPerformed(ActionEvent e)
145 xCombobox_actionPerformed(e);
148 resetButton.setFont(new java.awt.Font("Verdana", 0, 12));
149 resetButton.setText(MessageManager.getString("action.reset"));
150 resetButton.addActionListener(new java.awt.event.ActionListener()
153 public void actionPerformed(ActionEvent e)
155 resetButton_actionPerformed(e);
158 fileMenu.setText(MessageManager.getString("action.file"));
159 saveMenu.setText(MessageManager.getString("action.save_as"));
161 eps.addActionListener(new ActionListener()
163 public void actionPerformed(ActionEvent e)
165 eps_actionPerformed(e);
169 png.addActionListener(new ActionListener()
171 public void actionPerformed(ActionEvent e)
173 png_actionPerformed(e);
176 outputValues.setText(MessageManager.getString("label.output_values"));
177 outputValues.addActionListener(new ActionListener()
179 public void actionPerformed(ActionEvent e)
181 outputValues_actionPerformed(e);
184 outputPoints.setText(MessageManager.getString("label.output_points"));
185 outputPoints.addActionListener(new ActionListener()
187 public void actionPerformed(ActionEvent e)
189 outputPoints_actionPerformed(e);
192 outputProjPoints.setText(MessageManager.getString("label.output_transformed_points") + "...");
193 outputProjPoints.addActionListener(new ActionListener()
195 public void actionPerformed(ActionEvent e)
197 outputProjPoints_actionPerformed(e);
200 print.addActionListener(new ActionListener()
202 public void actionPerformed(ActionEvent e)
204 print_actionPerformed(e);
207 viewMenu.setText(MessageManager.getString("aciton.view"));
208 viewMenu.addMenuListener(new MenuListener()
210 public void menuSelected(MenuEvent e)
212 viewMenu_menuSelected();
215 public void menuDeselected(MenuEvent e)
219 public void menuCanceled(MenuEvent e)
223 showLabels.setText(MessageManager.getString("label.show_labels"));
224 showLabels.addActionListener(new ActionListener()
226 public void actionPerformed(ActionEvent e)
228 showLabels_actionPerformed(e);
231 print.setText(MessageManager.getString("action.print"));
232 bgcolour.setText(MessageManager.getString("label.background_colour") + "...");
233 bgcolour.addActionListener(new ActionListener()
235 public void actionPerformed(ActionEvent e)
237 bgcolour_actionPerformed(e);
240 originalSeqData.setText(MessageManager.getString("label.input_data"));
241 originalSeqData.addActionListener(new ActionListener()
243 public void actionPerformed(ActionEvent e)
245 originalSeqData_actionPerformed(e);
248 associateViewsMenu.setText(MessageManager.getString("label.associate_nodes_with"));
249 calcSettings.setText(MessageManager.getString("action.change_params"));
250 nuclSetting.setText(MessageManager.getString("label.nucleotide_matrix"));
251 protSetting.setText(MessageManager.getString("label.protein_matrix"));
252 nuclSetting.addActionListener(new ActionListener()
256 public void actionPerformed(ActionEvent arg0)
258 nuclSetting_actionPerfomed(arg0);
261 protSetting.addActionListener(new ActionListener()
265 public void actionPerformed(ActionEvent arg0)
267 protSetting_actionPerfomed(arg0);
270 jvVersionSetting.setText(MessageManager.getString("label.jalview_pca_calculation"));
271 jvVersionSetting.addActionListener(new ActionListener()
274 public void actionPerformed(ActionEvent arg0)
276 jvVersionSetting_actionPerfomed(arg0);
279 calcSettings.add(jvVersionSetting);
280 calcSettings.add(nuclSetting);
281 calcSettings.add(protSetting);
282 statusPanel.setLayout(statusPanelLayout);
283 statusBar.setFont(new java.awt.Font("Verdana", 0, 12));
284 // statusPanel.setBackground(Color.lightGray);
285 // statusBar.setBackground(Color.lightGray);
286 // statusPanel.add(statusBar, null);
287 JPanel panelBar = new JPanel(new BorderLayout());
288 panelBar.add(jPanel2, BorderLayout.NORTH);
289 panelBar.add(statusPanel, BorderLayout.SOUTH);
290 this.getContentPane().add(panelBar, BorderLayout.SOUTH);
291 jPanel2.add(jLabel1, null);
292 jPanel2.add(xCombobox, null);
293 jPanel2.add(jLabel2, null);
294 jPanel2.add(yCombobox, null);
295 jPanel2.add(jLabel3, null);
296 jPanel2.add(zCombobox, null);
297 jPanel2.add(resetButton, null);
298 jMenuBar1.add(fileMenu);
299 jMenuBar1.add(viewMenu);
300 jMenuBar1.add(calcSettings);
301 fileMenu.add(saveMenu);
302 fileMenu.add(outputValues);
304 fileMenu.add(originalSeqData);
305 fileMenu.add(outputPoints);
306 fileMenu.add(outputProjPoints);
309 viewMenu.add(showLabels);
310 viewMenu.add(bgcolour);
311 viewMenu.add(associateViewsMenu);
314 protected void resetButton_actionPerformed(ActionEvent e)
316 // TODO Auto-generated method stub
320 protected void protSetting_actionPerfomed(ActionEvent arg0)
322 // TODO Auto-generated method stub
326 protected void nuclSetting_actionPerfomed(ActionEvent arg0)
328 // TODO Auto-generated method stub
332 protected void outputPoints_actionPerformed(ActionEvent e)
334 // TODO Auto-generated method stub
338 protected void outputProjPoints_actionPerformed(ActionEvent e)
340 // TODO Auto-generated method stub
344 protected void xCombobox_actionPerformed(ActionEvent e)
348 protected void yCombobox_actionPerformed(ActionEvent e)
352 protected void zCombobox_actionPerformed(ActionEvent e)
356 public void eps_actionPerformed(ActionEvent e)
361 public void png_actionPerformed(ActionEvent e)
366 public void outputValues_actionPerformed(ActionEvent e)
371 public void print_actionPerformed(ActionEvent e)
376 public void showLabels_actionPerformed(ActionEvent e)
381 public void bgcolour_actionPerformed(ActionEvent e)
386 public void originalSeqData_actionPerformed(ActionEvent e)
391 public void viewMenu_menuSelected()
396 protected void jvVersionSetting_actionPerfomed(ActionEvent arg0)
398 // TODO Auto-generated method stub