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 JMenuItem eps = new JMenuItem();
59 JMenuItem png = new JMenuItem();
61 JMenuItem print = new JMenuItem();
63 JMenuItem outputValues = new JMenuItem();
65 JMenuItem outputPoints = new JMenuItem();
67 JMenuItem outputProjPoints = new JMenuItem();
69 protected JMenu viewMenu = new JMenu();
71 protected JCheckBoxMenuItem showLabels = new JCheckBoxMenuItem();
73 JMenuItem bgcolour = new JMenuItem();
75 JMenuItem originalSeqData = new JMenuItem();
77 protected JMenu associateViewsMenu = new JMenu();
79 protected JMenu calcSettings = new JMenu();
81 protected JCheckBoxMenuItem nuclSetting = new JCheckBoxMenuItem();
83 protected JCheckBoxMenuItem protSetting = new JCheckBoxMenuItem();
85 protected JCheckBoxMenuItem jvVersionSetting = new JCheckBoxMenuItem();
87 protected JLabel statusBar = new JLabel();
89 protected GridLayout statusPanelLayout = new GridLayout();
91 protected JPanel statusPanel = new JPanel();
103 for (int i = 1; i < 8; i++)
105 xCombobox.addItem("dim " + i);
106 yCombobox.addItem("dim " + i);
107 zCombobox.addItem("dim " + i);
110 setJMenuBar(jMenuBar1);
113 private void jbInit() throws Exception
115 this.getContentPane().setLayout(borderLayout1);
116 jPanel2.setLayout(flowLayout1);
117 jLabel1.setFont(new java.awt.Font("Verdana", 0, 12));
118 jLabel1.setText("x=");
119 jLabel2.setFont(new java.awt.Font("Verdana", 0, 12));
120 jLabel2.setText("y=");
121 jLabel3.setFont(new java.awt.Font("Verdana", 0, 12));
122 jLabel3.setText("z=");
123 jPanel2.setBackground(Color.white);
124 jPanel2.setBorder(null);
125 zCombobox.setFont(new java.awt.Font("Verdana", 0, 12));
126 zCombobox.addActionListener(new java.awt.event.ActionListener()
128 public void actionPerformed(ActionEvent e)
130 zCombobox_actionPerformed(e);
133 yCombobox.setFont(new java.awt.Font("Verdana", 0, 12));
134 yCombobox.addActionListener(new java.awt.event.ActionListener()
136 public void actionPerformed(ActionEvent e)
138 yCombobox_actionPerformed(e);
141 xCombobox.setFont(new java.awt.Font("Verdana", 0, 12));
142 xCombobox.addActionListener(new java.awt.event.ActionListener()
144 public void actionPerformed(ActionEvent e)
146 xCombobox_actionPerformed(e);
149 resetButton.setFont(new java.awt.Font("Verdana", 0, 12));
150 resetButton.setText(MessageManager.getString("action.reset"));
151 resetButton.addActionListener(new java.awt.event.ActionListener()
154 public void actionPerformed(ActionEvent e)
156 resetButton_actionPerformed(e);
159 fileMenu.setText(MessageManager.getString("action.file"));
160 saveMenu.setText(MessageManager.getString("action.save_as"));
162 eps.addActionListener(new ActionListener()
164 public void actionPerformed(ActionEvent e)
166 eps_actionPerformed(e);
170 png.addActionListener(new ActionListener()
172 public void actionPerformed(ActionEvent e)
174 png_actionPerformed(e);
177 outputValues.setText(MessageManager.getString("label.output_values"));
178 outputValues.addActionListener(new ActionListener()
180 public void actionPerformed(ActionEvent e)
182 outputValues_actionPerformed(e);
185 outputPoints.setText(MessageManager.getString("label.output_points"));
186 outputPoints.addActionListener(new ActionListener()
188 public void actionPerformed(ActionEvent e)
190 outputPoints_actionPerformed(e);
193 outputProjPoints.setText(MessageManager.getString("label.output_transformed_points") + "...");
194 outputProjPoints.addActionListener(new ActionListener()
196 public void actionPerformed(ActionEvent e)
198 outputProjPoints_actionPerformed(e);
201 print.addActionListener(new ActionListener()
203 public void actionPerformed(ActionEvent e)
205 print_actionPerformed(e);
208 viewMenu.setText(MessageManager.getString("action.view"));
209 viewMenu.addMenuListener(new MenuListener()
211 public void menuSelected(MenuEvent e)
213 viewMenu_menuSelected();
216 public void menuDeselected(MenuEvent e)
220 public void menuCanceled(MenuEvent e)
224 showLabels.setText(MessageManager.getString("label.show_labels"));
225 showLabels.addActionListener(new ActionListener()
227 public void actionPerformed(ActionEvent e)
229 showLabels_actionPerformed(e);
232 print.setText(MessageManager.getString("action.print"));
233 bgcolour.setText(MessageManager.getString("label.background_colour") + "...");
234 bgcolour.addActionListener(new ActionListener()
236 public void actionPerformed(ActionEvent e)
238 bgcolour_actionPerformed(e);
241 originalSeqData.setText(MessageManager.getString("label.input_data"));
242 originalSeqData.addActionListener(new ActionListener()
244 public void actionPerformed(ActionEvent e)
246 originalSeqData_actionPerformed(e);
249 associateViewsMenu.setText(MessageManager.getString("label.associate_nodes_with"));
250 calcSettings.setText(MessageManager.getString("action.change_params"));
251 nuclSetting.setText(MessageManager.getString("label.nucleotide_matrix"));
252 protSetting.setText(MessageManager.getString("label.protein_matrix"));
253 nuclSetting.addActionListener(new ActionListener()
257 public void actionPerformed(ActionEvent arg0)
259 nuclSetting_actionPerfomed(arg0);
262 protSetting.addActionListener(new ActionListener()
266 public void actionPerformed(ActionEvent arg0)
268 protSetting_actionPerfomed(arg0);
271 jvVersionSetting.setText(MessageManager.getString("label.jalview_pca_calculation"));
272 jvVersionSetting.addActionListener(new ActionListener()
275 public void actionPerformed(ActionEvent arg0)
277 jvVersionSetting_actionPerfomed(arg0);
280 calcSettings.add(jvVersionSetting);
281 calcSettings.add(nuclSetting);
282 calcSettings.add(protSetting);
283 statusPanel.setLayout(statusPanelLayout);
284 statusBar.setFont(new java.awt.Font("Verdana", 0, 12));
285 // statusPanel.setBackground(Color.lightGray);
286 // statusBar.setBackground(Color.lightGray);
287 // statusPanel.add(statusBar, null);
288 JPanel panelBar = new JPanel(new BorderLayout());
289 panelBar.add(jPanel2, BorderLayout.NORTH);
290 panelBar.add(statusPanel, BorderLayout.SOUTH);
291 this.getContentPane().add(panelBar, BorderLayout.SOUTH);
292 jPanel2.add(jLabel1, null);
293 jPanel2.add(xCombobox, null);
294 jPanel2.add(jLabel2, null);
295 jPanel2.add(yCombobox, null);
296 jPanel2.add(jLabel3, null);
297 jPanel2.add(zCombobox, null);
298 jPanel2.add(resetButton, null);
299 jMenuBar1.add(fileMenu);
300 jMenuBar1.add(viewMenu);
301 jMenuBar1.add(calcSettings);
302 fileMenu.add(saveMenu);
303 fileMenu.add(outputValues);
305 fileMenu.add(originalSeqData);
306 fileMenu.add(outputPoints);
307 fileMenu.add(outputProjPoints);
310 viewMenu.add(showLabels);
311 viewMenu.add(bgcolour);
312 viewMenu.add(associateViewsMenu);
315 protected void resetButton_actionPerformed(ActionEvent e)
317 // TODO Auto-generated method stub
321 protected void protSetting_actionPerfomed(ActionEvent arg0)
323 // TODO Auto-generated method stub
327 protected void nuclSetting_actionPerfomed(ActionEvent arg0)
329 // TODO Auto-generated method stub
333 protected void outputPoints_actionPerformed(ActionEvent e)
335 // TODO Auto-generated method stub
339 protected void outputProjPoints_actionPerformed(ActionEvent e)
341 // TODO Auto-generated method stub
345 protected void xCombobox_actionPerformed(ActionEvent e)
349 protected void yCombobox_actionPerformed(ActionEvent e)
353 protected void zCombobox_actionPerformed(ActionEvent e)
357 public void eps_actionPerformed(ActionEvent e)
362 public void png_actionPerformed(ActionEvent e)
367 public void outputValues_actionPerformed(ActionEvent e)
372 public void print_actionPerformed(ActionEvent e)
377 public void showLabels_actionPerformed(ActionEvent e)
382 public void bgcolour_actionPerformed(ActionEvent e)
387 public void originalSeqData_actionPerformed(ActionEvent e)
392 public void viewMenu_menuSelected()
397 protected void jvVersionSetting_actionPerfomed(ActionEvent arg0)
399 // TODO Auto-generated method stub