2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.0b1)
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 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/>.
17 * The Jalview Authors are detailed in the 'AUTHORS' file.
19 package jalview.jbgui;
21 import jalview.util.MessageManager;
24 import java.awt.event.*;
27 import javax.swing.event.*;
29 public class GPCAPanel extends JInternalFrame
31 JPanel jPanel2 = new JPanel();
33 JLabel jLabel1 = new JLabel();
35 JLabel jLabel2 = new JLabel();
37 JLabel jLabel3 = new JLabel();
39 protected JComboBox xCombobox = new JComboBox();
41 protected JComboBox yCombobox = new JComboBox();
43 protected JComboBox zCombobox = new JComboBox();
45 protected JButton resetButton = new JButton();
47 FlowLayout flowLayout1 = new FlowLayout();
49 BorderLayout borderLayout1 = new BorderLayout();
51 JMenuBar jMenuBar1 = new JMenuBar();
53 JMenu fileMenu = new JMenu();
55 JMenu saveMenu = new JMenu();
57 protected JMenu scoreMatrixMenu = new JMenu();
59 JMenuItem eps = new JMenuItem();
61 JMenuItem png = new JMenuItem();
63 JMenuItem print = new JMenuItem();
65 JMenuItem outputValues = new JMenuItem();
67 JMenuItem outputPoints = new JMenuItem();
69 JMenuItem outputProjPoints = new JMenuItem();
71 protected JMenu viewMenu = new JMenu();
73 protected JCheckBoxMenuItem showLabels = new JCheckBoxMenuItem();
75 JMenuItem bgcolour = new JMenuItem();
77 JMenuItem originalSeqData = new JMenuItem();
79 protected JMenu associateViewsMenu = new JMenu();
81 protected JMenu calcSettings = new JMenu();
83 protected JCheckBoxMenuItem nuclSetting = new JCheckBoxMenuItem();
85 protected JCheckBoxMenuItem protSetting = new JCheckBoxMenuItem();
87 protected JCheckBoxMenuItem jvVersionSetting = new JCheckBoxMenuItem();
89 protected JLabel statusBar = new JLabel();
91 protected GridLayout statusPanelLayout = new GridLayout();
93 protected JPanel statusPanel = new JPanel();
100 } catch (Exception e)
105 for (int i = 1; i < 8; i++)
107 xCombobox.addItem("dim " + i);
108 yCombobox.addItem("dim " + i);
109 zCombobox.addItem("dim " + i);
112 setJMenuBar(jMenuBar1);
115 private void jbInit() throws Exception
117 this.getContentPane().setLayout(borderLayout1);
118 jPanel2.setLayout(flowLayout1);
119 jLabel1.setFont(new java.awt.Font("Verdana", 0, 12));
120 jLabel1.setText("x=");
121 jLabel2.setFont(new java.awt.Font("Verdana", 0, 12));
122 jLabel2.setText("y=");
123 jLabel3.setFont(new java.awt.Font("Verdana", 0, 12));
124 jLabel3.setText("z=");
125 jPanel2.setBackground(Color.white);
126 jPanel2.setBorder(null);
127 zCombobox.setFont(new java.awt.Font("Verdana", 0, 12));
128 zCombobox.addActionListener(new java.awt.event.ActionListener()
130 public void actionPerformed(ActionEvent e)
132 zCombobox_actionPerformed(e);
135 yCombobox.setFont(new java.awt.Font("Verdana", 0, 12));
136 yCombobox.addActionListener(new java.awt.event.ActionListener()
138 public void actionPerformed(ActionEvent e)
140 yCombobox_actionPerformed(e);
143 xCombobox.setFont(new java.awt.Font("Verdana", 0, 12));
144 xCombobox.addActionListener(new java.awt.event.ActionListener()
146 public void actionPerformed(ActionEvent e)
148 xCombobox_actionPerformed(e);
151 resetButton.setFont(new java.awt.Font("Verdana", 0, 12));
152 resetButton.setText(MessageManager.getString("action.reset"));
153 resetButton.addActionListener(new java.awt.event.ActionListener()
156 public void actionPerformed(ActionEvent e)
158 resetButton_actionPerformed(e);
161 fileMenu.setText(MessageManager.getString("action.file"));
162 saveMenu.setText(MessageManager.getString("action.save_as"));
164 eps.addActionListener(new ActionListener()
166 public void actionPerformed(ActionEvent e)
168 eps_actionPerformed(e);
172 png.addActionListener(new ActionListener()
174 public void actionPerformed(ActionEvent e)
176 png_actionPerformed(e);
179 outputValues.setText(MessageManager.getString("label.output_values"));
180 outputValues.addActionListener(new ActionListener()
182 public void actionPerformed(ActionEvent e)
184 outputValues_actionPerformed(e);
187 outputPoints.setText(MessageManager.getString("label.output_points"));
188 outputPoints.addActionListener(new ActionListener()
190 public void actionPerformed(ActionEvent e)
192 outputPoints_actionPerformed(e);
195 outputProjPoints.setText(MessageManager.getString("label.output_transformed_points") + "...");
196 outputProjPoints.addActionListener(new ActionListener()
198 public void actionPerformed(ActionEvent e)
200 outputProjPoints_actionPerformed(e);
203 print.addActionListener(new ActionListener()
205 public void actionPerformed(ActionEvent e)
207 print_actionPerformed(e);
210 viewMenu.setText(MessageManager.getString("action.view"));
211 viewMenu.addMenuListener(new MenuListener()
213 public void menuSelected(MenuEvent e)
215 viewMenu_menuSelected();
218 public void menuDeselected(MenuEvent e)
222 public void menuCanceled(MenuEvent e)
226 scoreMatrixMenu.setText(MessageManager.getString("label.score_matrices"));
227 scoreMatrixMenu.addMenuListener(new MenuListener()
229 public void menuSelected(MenuEvent e)
231 scoreMatrix_menuSelected();
234 public void menuDeselected(MenuEvent e)
238 public void menuCanceled(MenuEvent e)
242 showLabels.setText(MessageManager.getString("label.show_labels"));
243 showLabels.addActionListener(new ActionListener()
245 public void actionPerformed(ActionEvent e)
247 showLabels_actionPerformed(e);
250 print.setText(MessageManager.getString("action.print"));
251 bgcolour.setText(MessageManager.getString("label.background_colour") + "...");
252 bgcolour.addActionListener(new ActionListener()
254 public void actionPerformed(ActionEvent e)
256 bgcolour_actionPerformed(e);
259 originalSeqData.setText(MessageManager.getString("label.input_data"));
260 originalSeqData.addActionListener(new ActionListener()
262 public void actionPerformed(ActionEvent e)
264 originalSeqData_actionPerformed(e);
267 associateViewsMenu.setText(MessageManager.getString("label.associate_nodes_with"));
268 calcSettings.setText(MessageManager.getString("action.change_params"));
269 nuclSetting.setText(MessageManager.getString("label.nucleotide_matrix"));
270 protSetting.setText(MessageManager.getString("label.protein_matrix"));
271 nuclSetting.addActionListener(new ActionListener()
275 public void actionPerformed(ActionEvent arg0)
277 nuclSetting_actionPerfomed(arg0);
280 protSetting.addActionListener(new ActionListener()
284 public void actionPerformed(ActionEvent arg0)
286 protSetting_actionPerfomed(arg0);
289 jvVersionSetting.setText(MessageManager.getString("label.jalview_pca_calculation"));
290 jvVersionSetting.addActionListener(new ActionListener()
293 public void actionPerformed(ActionEvent arg0)
295 jvVersionSetting_actionPerfomed(arg0);
298 calcSettings.add(jvVersionSetting);
299 calcSettings.add(nuclSetting);
300 calcSettings.add(protSetting);
301 calcSettings.add(scoreMatrixMenu);
302 statusPanel.setLayout(statusPanelLayout);
303 statusBar.setFont(new java.awt.Font("Verdana", 0, 12));
304 // statusPanel.setBackground(Color.lightGray);
305 // statusBar.setBackground(Color.lightGray);
306 // statusPanel.add(statusBar, null);
307 JPanel panelBar = new JPanel(new BorderLayout());
308 panelBar.add(jPanel2, BorderLayout.NORTH);
309 panelBar.add(statusPanel, BorderLayout.SOUTH);
310 this.getContentPane().add(panelBar, BorderLayout.SOUTH);
311 jPanel2.add(jLabel1, null);
312 jPanel2.add(xCombobox, null);
313 jPanel2.add(jLabel2, null);
314 jPanel2.add(yCombobox, null);
315 jPanel2.add(jLabel3, null);
316 jPanel2.add(zCombobox, null);
317 jPanel2.add(resetButton, null);
318 jMenuBar1.add(fileMenu);
319 jMenuBar1.add(viewMenu);
320 jMenuBar1.add(calcSettings);
321 fileMenu.add(saveMenu);
322 fileMenu.add(outputValues);
324 fileMenu.add(originalSeqData);
325 fileMenu.add(outputPoints);
326 fileMenu.add(outputProjPoints);
329 viewMenu.add(showLabels);
330 viewMenu.add(bgcolour);
331 viewMenu.add(associateViewsMenu);
334 protected void scoreMatrix_menuSelected()
336 // TODO Auto-generated method stub
340 protected void resetButton_actionPerformed(ActionEvent e)
342 // TODO Auto-generated method stub
346 protected void protSetting_actionPerfomed(ActionEvent arg0)
348 // TODO Auto-generated method stub
352 protected void nuclSetting_actionPerfomed(ActionEvent arg0)
354 // TODO Auto-generated method stub
358 protected void outputPoints_actionPerformed(ActionEvent e)
360 // TODO Auto-generated method stub
364 protected void outputProjPoints_actionPerformed(ActionEvent e)
366 // TODO Auto-generated method stub
370 protected void xCombobox_actionPerformed(ActionEvent e)
374 protected void yCombobox_actionPerformed(ActionEvent e)
378 protected void zCombobox_actionPerformed(ActionEvent e)
382 public void eps_actionPerformed(ActionEvent e)
387 public void png_actionPerformed(ActionEvent e)
392 public void outputValues_actionPerformed(ActionEvent e)
397 public void print_actionPerformed(ActionEvent e)
402 public void showLabels_actionPerformed(ActionEvent e)
407 public void bgcolour_actionPerformed(ActionEvent e)
412 public void originalSeqData_actionPerformed(ActionEvent e)
417 public void viewMenu_menuSelected()
422 protected void jvVersionSetting_actionPerfomed(ActionEvent arg0)
424 // TODO Auto-generated method stub