2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2)
3 * Copyright (C) 2014 The Jalview Authors
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
10 * of the License, or (at your option) any later version.
12 * Jalview is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty
14 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with Jalview. If not, see <http://www.gnu.org/licenses/>.
19 * The Jalview Authors are detailed in the 'AUTHORS' file.
21 package jalview.jbgui;
23 import jalview.util.MessageManager;
26 import java.awt.event.*;
29 import javax.swing.event.*;
31 public class GPCAPanel extends JInternalFrame
33 JPanel jPanel2 = new JPanel();
35 JLabel jLabel1 = new JLabel();
37 JLabel jLabel2 = new JLabel();
39 JLabel jLabel3 = new JLabel();
41 protected JComboBox xCombobox = new JComboBox();
43 protected JComboBox yCombobox = new JComboBox();
45 protected JComboBox zCombobox = new JComboBox();
47 protected JButton resetButton = new JButton();
49 FlowLayout flowLayout1 = new FlowLayout();
51 BorderLayout borderLayout1 = new BorderLayout();
53 JMenuBar jMenuBar1 = new JMenuBar();
55 JMenu fileMenu = new JMenu();
57 JMenu saveMenu = new JMenu();
59 protected JMenu scoreMatrixMenu = new JMenu();
61 JMenuItem eps = new JMenuItem();
63 JMenuItem png = new JMenuItem();
65 JMenuItem print = new JMenuItem();
67 JMenuItem outputValues = new JMenuItem();
69 JMenuItem outputPoints = new JMenuItem();
71 JMenuItem outputProjPoints = new JMenuItem();
73 protected JMenu viewMenu = new JMenu();
75 protected JCheckBoxMenuItem showLabels = new JCheckBoxMenuItem();
77 JMenuItem bgcolour = new JMenuItem();
79 JMenuItem originalSeqData = new JMenuItem();
81 protected JMenu associateViewsMenu = new JMenu();
83 protected JMenu calcSettings = new JMenu();
85 protected JCheckBoxMenuItem nuclSetting = new JCheckBoxMenuItem();
87 protected JCheckBoxMenuItem protSetting = new JCheckBoxMenuItem();
89 protected JCheckBoxMenuItem jvVersionSetting = new JCheckBoxMenuItem();
91 protected JLabel statusBar = new JLabel();
93 protected GridLayout statusPanelLayout = new GridLayout();
95 protected JPanel statusPanel = new JPanel();
102 } catch (Exception e)
107 for (int i = 1; i < 8; i++)
109 xCombobox.addItem("dim " + i);
110 yCombobox.addItem("dim " + i);
111 zCombobox.addItem("dim " + i);
114 setJMenuBar(jMenuBar1);
117 private void jbInit() throws Exception
119 this.getContentPane().setLayout(borderLayout1);
120 jPanel2.setLayout(flowLayout1);
121 jLabel1.setFont(new java.awt.Font("Verdana", 0, 12));
122 jLabel1.setText("x=");
123 jLabel2.setFont(new java.awt.Font("Verdana", 0, 12));
124 jLabel2.setText("y=");
125 jLabel3.setFont(new java.awt.Font("Verdana", 0, 12));
126 jLabel3.setText("z=");
127 jPanel2.setBackground(Color.white);
128 jPanel2.setBorder(null);
129 zCombobox.setFont(new java.awt.Font("Verdana", 0, 12));
130 zCombobox.addActionListener(new java.awt.event.ActionListener()
132 public void actionPerformed(ActionEvent e)
134 zCombobox_actionPerformed(e);
137 yCombobox.setFont(new java.awt.Font("Verdana", 0, 12));
138 yCombobox.addActionListener(new java.awt.event.ActionListener()
140 public void actionPerformed(ActionEvent e)
142 yCombobox_actionPerformed(e);
145 xCombobox.setFont(new java.awt.Font("Verdana", 0, 12));
146 xCombobox.addActionListener(new java.awt.event.ActionListener()
148 public void actionPerformed(ActionEvent e)
150 xCombobox_actionPerformed(e);
153 resetButton.setFont(new java.awt.Font("Verdana", 0, 12));
154 resetButton.setText(MessageManager.getString("action.reset"));
155 resetButton.addActionListener(new java.awt.event.ActionListener()
158 public void actionPerformed(ActionEvent e)
160 resetButton_actionPerformed(e);
163 fileMenu.setText(MessageManager.getString("action.file"));
164 saveMenu.setText(MessageManager.getString("action.save_as"));
166 eps.addActionListener(new ActionListener()
168 public void actionPerformed(ActionEvent e)
170 eps_actionPerformed(e);
174 png.addActionListener(new ActionListener()
176 public void actionPerformed(ActionEvent e)
178 png_actionPerformed(e);
181 outputValues.setText(MessageManager.getString("label.output_values"));
182 outputValues.addActionListener(new ActionListener()
184 public void actionPerformed(ActionEvent e)
186 outputValues_actionPerformed(e);
189 outputPoints.setText(MessageManager.getString("label.output_points"));
190 outputPoints.addActionListener(new ActionListener()
192 public void actionPerformed(ActionEvent e)
194 outputPoints_actionPerformed(e);
197 outputProjPoints.setText(MessageManager.getString("label.output_transformed_points") + "...");
198 outputProjPoints.addActionListener(new ActionListener()
200 public void actionPerformed(ActionEvent e)
202 outputProjPoints_actionPerformed(e);
205 print.addActionListener(new ActionListener()
207 public void actionPerformed(ActionEvent e)
209 print_actionPerformed(e);
212 viewMenu.setText(MessageManager.getString("action.view"));
213 viewMenu.addMenuListener(new MenuListener()
215 public void menuSelected(MenuEvent e)
217 viewMenu_menuSelected();
220 public void menuDeselected(MenuEvent e)
224 public void menuCanceled(MenuEvent e)
228 scoreMatrixMenu.setText(MessageManager.getString("label.select_score_model"));
229 scoreMatrixMenu.addMenuListener(new MenuListener()
231 public void menuSelected(MenuEvent e)
233 scoreMatrix_menuSelected();
236 public void menuDeselected(MenuEvent e)
240 public void menuCanceled(MenuEvent e)
244 showLabels.setText(MessageManager.getString("label.show_labels"));
245 showLabels.addActionListener(new ActionListener()
247 public void actionPerformed(ActionEvent e)
249 showLabels_actionPerformed(e);
252 print.setText(MessageManager.getString("action.print"));
253 bgcolour.setText(MessageManager.getString("label.background_colour") + "...");
254 bgcolour.addActionListener(new ActionListener()
256 public void actionPerformed(ActionEvent e)
258 bgcolour_actionPerformed(e);
261 originalSeqData.setText(MessageManager.getString("label.input_data"));
262 originalSeqData.addActionListener(new ActionListener()
264 public void actionPerformed(ActionEvent e)
266 originalSeqData_actionPerformed(e);
269 associateViewsMenu.setText(MessageManager.getString("label.associate_nodes_with"));
270 calcSettings.setText(MessageManager.getString("action.change_params"));
271 nuclSetting.setText(MessageManager.getString("label.nucleotide_matrix"));
272 protSetting.setText(MessageManager.getString("label.protein_matrix"));
273 nuclSetting.addActionListener(new ActionListener()
277 public void actionPerformed(ActionEvent arg0)
279 nuclSetting_actionPerfomed(arg0);
282 protSetting.addActionListener(new ActionListener()
286 public void actionPerformed(ActionEvent arg0)
288 protSetting_actionPerfomed(arg0);
291 jvVersionSetting.setText(MessageManager.getString("label.jalview_pca_calculation"));
292 jvVersionSetting.addActionListener(new ActionListener()
295 public void actionPerformed(ActionEvent arg0)
297 jvVersionSetting_actionPerfomed(arg0);
300 calcSettings.add(jvVersionSetting);
301 calcSettings.add(nuclSetting);
302 calcSettings.add(protSetting);
303 calcSettings.add(scoreMatrixMenu);
304 statusPanel.setLayout(statusPanelLayout);
305 statusBar.setFont(new java.awt.Font("Verdana", 0, 12));
306 // statusPanel.setBackground(Color.lightGray);
307 // statusBar.setBackground(Color.lightGray);
308 // statusPanel.add(statusBar, null);
309 JPanel panelBar = new JPanel(new BorderLayout());
310 panelBar.add(jPanel2, BorderLayout.NORTH);
311 panelBar.add(statusPanel, BorderLayout.SOUTH);
312 this.getContentPane().add(panelBar, BorderLayout.SOUTH);
313 jPanel2.add(jLabel1, null);
314 jPanel2.add(xCombobox, null);
315 jPanel2.add(jLabel2, null);
316 jPanel2.add(yCombobox, null);
317 jPanel2.add(jLabel3, null);
318 jPanel2.add(zCombobox, null);
319 jPanel2.add(resetButton, null);
320 jMenuBar1.add(fileMenu);
321 jMenuBar1.add(viewMenu);
322 jMenuBar1.add(calcSettings);
323 fileMenu.add(saveMenu);
324 fileMenu.add(outputValues);
326 fileMenu.add(originalSeqData);
327 fileMenu.add(outputPoints);
328 fileMenu.add(outputProjPoints);
331 viewMenu.add(showLabels);
332 viewMenu.add(bgcolour);
333 viewMenu.add(associateViewsMenu);
336 protected void scoreMatrix_menuSelected()
338 // TODO Auto-generated method stub
342 protected void resetButton_actionPerformed(ActionEvent e)
344 // TODO Auto-generated method stub
348 protected void protSetting_actionPerfomed(ActionEvent arg0)
350 // TODO Auto-generated method stub
354 protected void nuclSetting_actionPerfomed(ActionEvent arg0)
356 // TODO Auto-generated method stub
360 protected void outputPoints_actionPerformed(ActionEvent e)
362 // TODO Auto-generated method stub
366 protected void outputProjPoints_actionPerformed(ActionEvent e)
368 // TODO Auto-generated method stub
372 protected void xCombobox_actionPerformed(ActionEvent e)
376 protected void yCombobox_actionPerformed(ActionEvent e)
380 protected void zCombobox_actionPerformed(ActionEvent e)
384 public void eps_actionPerformed(ActionEvent e)
389 public void png_actionPerformed(ActionEvent e)
394 public void outputValues_actionPerformed(ActionEvent e)
399 public void print_actionPerformed(ActionEvent e)
404 public void showLabels_actionPerformed(ActionEvent e)
409 public void bgcolour_actionPerformed(ActionEvent e)
414 public void originalSeqData_actionPerformed(ActionEvent e)
419 public void viewMenu_menuSelected()
424 protected void jvVersionSetting_actionPerfomed(ActionEvent arg0)
426 // TODO Auto-generated method stub