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
198 .getString("label.output_transformed_points") + "...");
199 outputProjPoints.addActionListener(new ActionListener()
201 public void actionPerformed(ActionEvent e)
203 outputProjPoints_actionPerformed(e);
206 print.addActionListener(new ActionListener()
208 public void actionPerformed(ActionEvent e)
210 print_actionPerformed(e);
213 viewMenu.setText(MessageManager.getString("action.view"));
214 viewMenu.addMenuListener(new MenuListener()
216 public void menuSelected(MenuEvent e)
218 viewMenu_menuSelected();
221 public void menuDeselected(MenuEvent e)
225 public void menuCanceled(MenuEvent e)
229 scoreMatrixMenu.setText(MessageManager
230 .getString("label.select_score_model"));
231 scoreMatrixMenu.addMenuListener(new MenuListener()
233 public void menuSelected(MenuEvent e)
235 scoreMatrix_menuSelected();
238 public void menuDeselected(MenuEvent e)
242 public void menuCanceled(MenuEvent e)
246 showLabels.setText(MessageManager.getString("label.show_labels"));
247 showLabels.addActionListener(new ActionListener()
249 public void actionPerformed(ActionEvent e)
251 showLabels_actionPerformed(e);
254 print.setText(MessageManager.getString("action.print"));
255 bgcolour.setText(MessageManager.getString("label.background_colour")
257 bgcolour.addActionListener(new ActionListener()
259 public void actionPerformed(ActionEvent e)
261 bgcolour_actionPerformed(e);
264 originalSeqData.setText(MessageManager.getString("label.input_data"));
265 originalSeqData.addActionListener(new ActionListener()
267 public void actionPerformed(ActionEvent e)
269 originalSeqData_actionPerformed(e);
272 associateViewsMenu.setText(MessageManager
273 .getString("label.associate_nodes_with"));
274 calcSettings.setText(MessageManager.getString("action.change_params"));
276 .setText(MessageManager.getString("label.nucleotide_matrix"));
277 protSetting.setText(MessageManager.getString("label.protein_matrix"));
278 nuclSetting.addActionListener(new ActionListener()
282 public void actionPerformed(ActionEvent arg0)
284 nuclSetting_actionPerfomed(arg0);
287 protSetting.addActionListener(new ActionListener()
291 public void actionPerformed(ActionEvent arg0)
293 protSetting_actionPerfomed(arg0);
296 jvVersionSetting.setText(MessageManager
297 .getString("label.jalview_pca_calculation"));
298 jvVersionSetting.addActionListener(new ActionListener()
301 public void actionPerformed(ActionEvent arg0)
303 jvVersionSetting_actionPerfomed(arg0);
306 calcSettings.add(jvVersionSetting);
307 calcSettings.add(nuclSetting);
308 calcSettings.add(protSetting);
309 calcSettings.add(scoreMatrixMenu);
310 statusPanel.setLayout(statusPanelLayout);
311 statusBar.setFont(new java.awt.Font("Verdana", 0, 12));
312 // statusPanel.setBackground(Color.lightGray);
313 // statusBar.setBackground(Color.lightGray);
314 // statusPanel.add(statusBar, null);
315 JPanel panelBar = new JPanel(new BorderLayout());
316 panelBar.add(jPanel2, BorderLayout.NORTH);
317 panelBar.add(statusPanel, BorderLayout.SOUTH);
318 this.getContentPane().add(panelBar, BorderLayout.SOUTH);
319 jPanel2.add(jLabel1, null);
320 jPanel2.add(xCombobox, null);
321 jPanel2.add(jLabel2, null);
322 jPanel2.add(yCombobox, null);
323 jPanel2.add(jLabel3, null);
324 jPanel2.add(zCombobox, null);
325 jPanel2.add(resetButton, null);
326 jMenuBar1.add(fileMenu);
327 jMenuBar1.add(viewMenu);
328 jMenuBar1.add(calcSettings);
329 fileMenu.add(saveMenu);
330 fileMenu.add(outputValues);
332 fileMenu.add(originalSeqData);
333 fileMenu.add(outputPoints);
334 fileMenu.add(outputProjPoints);
337 viewMenu.add(showLabels);
338 viewMenu.add(bgcolour);
339 viewMenu.add(associateViewsMenu);
342 protected void scoreMatrix_menuSelected()
344 // TODO Auto-generated method stub
348 protected void resetButton_actionPerformed(ActionEvent e)
350 // TODO Auto-generated method stub
354 protected void protSetting_actionPerfomed(ActionEvent arg0)
356 // TODO Auto-generated method stub
360 protected void nuclSetting_actionPerfomed(ActionEvent arg0)
362 // TODO Auto-generated method stub
366 protected void outputPoints_actionPerformed(ActionEvent e)
368 // TODO Auto-generated method stub
372 protected void outputProjPoints_actionPerformed(ActionEvent e)
374 // TODO Auto-generated method stub
378 protected void xCombobox_actionPerformed(ActionEvent e)
382 protected void yCombobox_actionPerformed(ActionEvent e)
386 protected void zCombobox_actionPerformed(ActionEvent e)
390 public void eps_actionPerformed(ActionEvent e)
395 public void png_actionPerformed(ActionEvent e)
400 public void outputValues_actionPerformed(ActionEvent e)
405 public void print_actionPerformed(ActionEvent e)
410 public void showLabels_actionPerformed(ActionEvent e)
415 public void bgcolour_actionPerformed(ActionEvent e)
420 public void originalSeqData_actionPerformed(ActionEvent e)
425 public void viewMenu_menuSelected()
430 protected void jvVersionSetting_actionPerfomed(ActionEvent arg0)
432 // TODO Auto-generated method stub