2 * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
3 * Copyright (C) $$Year-Rel$$ 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;
25 import java.awt.BorderLayout;
26 import java.awt.Color;
27 import java.awt.FlowLayout;
28 import java.awt.GridLayout;
29 import java.awt.event.ActionEvent;
30 import java.awt.event.ActionListener;
32 import javax.swing.JButton;
33 import javax.swing.JCheckBoxMenuItem;
34 import javax.swing.JComboBox;
35 import javax.swing.JInternalFrame;
36 import javax.swing.JLabel;
37 import javax.swing.JMenu;
38 import javax.swing.JMenuBar;
39 import javax.swing.JMenuItem;
40 import javax.swing.JPanel;
41 import javax.swing.event.MenuEvent;
42 import javax.swing.event.MenuListener;
44 public class GPCAPanel extends JInternalFrame
46 JPanel jPanel2 = new JPanel();
48 JLabel jLabel1 = new JLabel();
50 JLabel jLabel2 = new JLabel();
52 JLabel jLabel3 = new JLabel();
54 protected JComboBox xCombobox = new JComboBox();
56 protected JComboBox yCombobox = new JComboBox();
58 protected JComboBox zCombobox = new JComboBox();
60 protected JButton resetButton = new JButton();
62 FlowLayout flowLayout1 = new FlowLayout();
64 BorderLayout borderLayout1 = new BorderLayout();
66 JMenuBar jMenuBar1 = new JMenuBar();
68 JMenu fileMenu = new JMenu();
70 JMenu saveMenu = new JMenu();
72 protected JMenu scoreMatrixMenu = new JMenu();
74 JMenuItem eps = new JMenuItem();
76 JMenuItem png = new JMenuItem();
78 JMenuItem print = new JMenuItem();
80 JMenuItem outputValues = new JMenuItem();
82 JMenuItem outputPoints = new JMenuItem();
84 JMenuItem outputProjPoints = new JMenuItem();
86 protected JMenu viewMenu = new JMenu();
88 protected JCheckBoxMenuItem showLabels = new JCheckBoxMenuItem();
90 JMenuItem bgcolour = new JMenuItem();
92 JMenuItem originalSeqData = new JMenuItem();
94 protected JMenu associateViewsMenu = new JMenu();
96 protected JMenu calcSettings = new JMenu();
98 protected JCheckBoxMenuItem nuclSetting = new JCheckBoxMenuItem();
100 protected JCheckBoxMenuItem protSetting = new JCheckBoxMenuItem();
102 protected JCheckBoxMenuItem jvVersionSetting = new JCheckBoxMenuItem();
104 protected JLabel statusBar = new JLabel();
106 protected GridLayout statusPanelLayout = new GridLayout();
108 protected JPanel statusPanel = new JPanel();
115 } catch (Exception e)
120 for (int i = 1; i < 8; i++)
122 xCombobox.addItem("dim " + i);
123 yCombobox.addItem("dim " + i);
124 zCombobox.addItem("dim " + i);
127 setJMenuBar(jMenuBar1);
130 private void jbInit() throws Exception
132 this.getContentPane().setLayout(borderLayout1);
133 jPanel2.setLayout(flowLayout1);
134 jLabel1.setFont(new java.awt.Font("Verdana", 0, 12));
135 jLabel1.setText("x=");
136 jLabel2.setFont(new java.awt.Font("Verdana", 0, 12));
137 jLabel2.setText("y=");
138 jLabel3.setFont(new java.awt.Font("Verdana", 0, 12));
139 jLabel3.setText("z=");
140 jPanel2.setBackground(Color.white);
141 jPanel2.setBorder(null);
142 zCombobox.setFont(new java.awt.Font("Verdana", 0, 12));
143 zCombobox.addActionListener(new java.awt.event.ActionListener()
145 public void actionPerformed(ActionEvent e)
147 zCombobox_actionPerformed(e);
150 yCombobox.setFont(new java.awt.Font("Verdana", 0, 12));
151 yCombobox.addActionListener(new java.awt.event.ActionListener()
153 public void actionPerformed(ActionEvent e)
155 yCombobox_actionPerformed(e);
158 xCombobox.setFont(new java.awt.Font("Verdana", 0, 12));
159 xCombobox.addActionListener(new java.awt.event.ActionListener()
161 public void actionPerformed(ActionEvent e)
163 xCombobox_actionPerformed(e);
166 resetButton.setFont(new java.awt.Font("Verdana", 0, 12));
167 resetButton.setText(MessageManager.getString("action.reset"));
168 resetButton.addActionListener(new java.awt.event.ActionListener()
171 public void actionPerformed(ActionEvent e)
173 resetButton_actionPerformed(e);
176 fileMenu.setText(MessageManager.getString("action.file"));
177 saveMenu.setText(MessageManager.getString("action.save_as"));
179 eps.addActionListener(new ActionListener()
181 public void actionPerformed(ActionEvent e)
183 eps_actionPerformed(e);
187 png.addActionListener(new ActionListener()
189 public void actionPerformed(ActionEvent e)
191 png_actionPerformed(e);
194 outputValues.setText(MessageManager.getString("label.output_values"));
195 outputValues.addActionListener(new ActionListener()
197 public void actionPerformed(ActionEvent e)
199 outputValues_actionPerformed(e);
202 outputPoints.setText(MessageManager.getString("label.output_points"));
203 outputPoints.addActionListener(new ActionListener()
205 public void actionPerformed(ActionEvent e)
207 outputPoints_actionPerformed(e);
210 outputProjPoints.setText(MessageManager
211 .getString("label.output_transformed_points"));
212 outputProjPoints.addActionListener(new ActionListener()
214 public void actionPerformed(ActionEvent e)
216 outputProjPoints_actionPerformed(e);
219 print.addActionListener(new ActionListener()
221 public void actionPerformed(ActionEvent e)
223 print_actionPerformed(e);
226 viewMenu.setText(MessageManager.getString("action.view"));
227 viewMenu.addMenuListener(new MenuListener()
229 public void menuSelected(MenuEvent e)
231 viewMenu_menuSelected();
234 public void menuDeselected(MenuEvent e)
238 public void menuCanceled(MenuEvent e)
242 scoreMatrixMenu.setText(MessageManager
243 .getString("label.select_score_model"));
244 scoreMatrixMenu.addMenuListener(new MenuListener()
246 public void menuSelected(MenuEvent e)
248 scoreMatrix_menuSelected();
251 public void menuDeselected(MenuEvent e)
255 public void menuCanceled(MenuEvent e)
259 showLabels.setText(MessageManager.getString("label.show_labels"));
260 showLabels.addActionListener(new ActionListener()
262 public void actionPerformed(ActionEvent e)
264 showLabels_actionPerformed(e);
267 print.setText(MessageManager.getString("action.print"));
268 bgcolour.setText(MessageManager.getString("action.background_colour"));
269 bgcolour.addActionListener(new ActionListener()
271 public void actionPerformed(ActionEvent e)
273 bgcolour_actionPerformed(e);
276 originalSeqData.setText(MessageManager.getString("label.input_data"));
277 originalSeqData.addActionListener(new ActionListener()
279 public void actionPerformed(ActionEvent e)
281 originalSeqData_actionPerformed(e);
284 associateViewsMenu.setText(MessageManager
285 .getString("label.associate_nodes_with"));
286 calcSettings.setText(MessageManager.getString("action.change_params"));
288 .setText(MessageManager.getString("label.nucleotide_matrix"));
289 protSetting.setText(MessageManager.getString("label.protein_matrix"));
290 nuclSetting.addActionListener(new ActionListener()
294 public void actionPerformed(ActionEvent arg0)
296 nuclSetting_actionPerfomed(arg0);
299 protSetting.addActionListener(new ActionListener()
303 public void actionPerformed(ActionEvent arg0)
305 protSetting_actionPerfomed(arg0);
308 jvVersionSetting.setText(MessageManager
309 .getString("label.jalview_pca_calculation"));
310 jvVersionSetting.addActionListener(new ActionListener()
313 public void actionPerformed(ActionEvent arg0)
315 jvVersionSetting_actionPerfomed(arg0);
318 calcSettings.add(jvVersionSetting);
319 calcSettings.add(nuclSetting);
320 calcSettings.add(protSetting);
321 calcSettings.add(scoreMatrixMenu);
322 statusPanel.setLayout(statusPanelLayout);
323 statusBar.setFont(new java.awt.Font("Verdana", 0, 12));
324 // statusPanel.setBackground(Color.lightGray);
325 // statusBar.setBackground(Color.lightGray);
326 // statusPanel.add(statusBar, null);
327 JPanel panelBar = new JPanel(new BorderLayout());
328 panelBar.add(jPanel2, BorderLayout.NORTH);
329 panelBar.add(statusPanel, BorderLayout.SOUTH);
330 this.getContentPane().add(panelBar, BorderLayout.SOUTH);
331 jPanel2.add(jLabel1, null);
332 jPanel2.add(xCombobox, null);
333 jPanel2.add(jLabel2, null);
334 jPanel2.add(yCombobox, null);
335 jPanel2.add(jLabel3, null);
336 jPanel2.add(zCombobox, null);
337 jPanel2.add(resetButton, null);
338 jMenuBar1.add(fileMenu);
339 jMenuBar1.add(viewMenu);
340 jMenuBar1.add(calcSettings);
341 fileMenu.add(saveMenu);
342 fileMenu.add(outputValues);
344 fileMenu.add(originalSeqData);
345 fileMenu.add(outputPoints);
346 fileMenu.add(outputProjPoints);
349 viewMenu.add(showLabels);
350 viewMenu.add(bgcolour);
351 viewMenu.add(associateViewsMenu);
354 protected void scoreMatrix_menuSelected()
356 // TODO Auto-generated method stub
360 protected void resetButton_actionPerformed(ActionEvent e)
362 // TODO Auto-generated method stub
366 protected void protSetting_actionPerfomed(ActionEvent arg0)
368 // TODO Auto-generated method stub
372 protected void nuclSetting_actionPerfomed(ActionEvent arg0)
374 // TODO Auto-generated method stub
378 protected void outputPoints_actionPerformed(ActionEvent e)
380 // TODO Auto-generated method stub
384 protected void outputProjPoints_actionPerformed(ActionEvent e)
386 // TODO Auto-generated method stub
390 protected void xCombobox_actionPerformed(ActionEvent e)
394 protected void yCombobox_actionPerformed(ActionEvent e)
398 protected void zCombobox_actionPerformed(ActionEvent e)
402 public void eps_actionPerformed(ActionEvent e)
407 public void png_actionPerformed(ActionEvent e)
412 public void outputValues_actionPerformed(ActionEvent e)
417 public void print_actionPerformed(ActionEvent e)
422 public void showLabels_actionPerformed(ActionEvent e)
427 public void bgcolour_actionPerformed(ActionEvent e)
432 public void originalSeqData_actionPerformed(ActionEvent e)
437 public void viewMenu_menuSelected()
442 protected void jvVersionSetting_actionPerfomed(ActionEvent arg0)
444 // TODO Auto-generated method stub