2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
3 * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
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/>.
18 package jalview.jbgui;
21 import java.awt.event.*;
24 import javax.swing.event.*;
26 public class GPCAPanel extends JInternalFrame
28 JPanel jPanel2 = new JPanel();
30 JLabel jLabel1 = new JLabel();
32 JLabel jLabel2 = new JLabel();
34 JLabel jLabel3 = new JLabel();
36 protected JComboBox xCombobox = new JComboBox();
38 protected JComboBox yCombobox = new JComboBox();
40 protected JComboBox zCombobox = new JComboBox();
42 protected JButton resetButton = new JButton();
44 FlowLayout flowLayout1 = new FlowLayout();
46 BorderLayout borderLayout1 = new BorderLayout();
48 JMenuBar jMenuBar1 = new JMenuBar();
50 JMenu fileMenu = new JMenu();
52 JMenu saveMenu = new JMenu();
54 JMenuItem eps = new JMenuItem();
56 JMenuItem png = new JMenuItem();
58 JMenuItem print = new JMenuItem();
60 JMenuItem outputValues = new JMenuItem();
62 JMenuItem outputPoints = new JMenuItem();
64 JMenuItem outputProjPoints = new JMenuItem();
66 protected JMenu viewMenu = new JMenu();
68 protected JCheckBoxMenuItem showLabels = new JCheckBoxMenuItem();
70 JMenuItem bgcolour = new JMenuItem();
72 JMenuItem originalSeqData = new JMenuItem();
74 protected JMenu associateViewsMenu = new JMenu();
76 protected JMenu calcSettings=new JMenu();
77 protected JCheckBoxMenuItem nuclSetting=new JCheckBoxMenuItem();
78 protected JCheckBoxMenuItem protSetting=new JCheckBoxMenuItem();
79 protected JCheckBoxMenuItem jvVersionSetting=new JCheckBoxMenuItem();
81 protected JLabel statusBar = new JLabel();
82 protected GridLayout statusPanelLayout = new GridLayout();
83 protected JPanel statusPanel=new JPanel();
94 for (int i = 1; i < 8; i++)
96 xCombobox.addItem("dim " + i);
97 yCombobox.addItem("dim " + i);
98 zCombobox.addItem("dim " + i);
101 setJMenuBar(jMenuBar1);
104 private void jbInit() throws Exception
106 this.getContentPane().setLayout(borderLayout1);
107 jPanel2.setLayout(flowLayout1);
108 jLabel1.setFont(new java.awt.Font("Verdana", 0, 12));
109 jLabel1.setText("x=");
110 jLabel2.setFont(new java.awt.Font("Verdana", 0, 12));
111 jLabel2.setText("y=");
112 jLabel3.setFont(new java.awt.Font("Verdana", 0, 12));
113 jLabel3.setText("z=");
114 jPanel2.setBackground(Color.white);
115 jPanel2.setBorder(null);
116 zCombobox.setFont(new java.awt.Font("Verdana", 0, 12));
117 zCombobox.addActionListener(new java.awt.event.ActionListener()
119 public void actionPerformed(ActionEvent e)
121 zCombobox_actionPerformed(e);
124 yCombobox.setFont(new java.awt.Font("Verdana", 0, 12));
125 yCombobox.addActionListener(new java.awt.event.ActionListener()
127 public void actionPerformed(ActionEvent e)
129 yCombobox_actionPerformed(e);
132 xCombobox.setFont(new java.awt.Font("Verdana", 0, 12));
133 xCombobox.addActionListener(new java.awt.event.ActionListener()
135 public void actionPerformed(ActionEvent e)
137 xCombobox_actionPerformed(e);
140 resetButton.setFont(new java.awt.Font("Verdana",0,12));
141 resetButton.setText("Reset");
142 resetButton.addActionListener(new java.awt.event.ActionListener()
145 public void actionPerformed(ActionEvent e)
147 resetButton_actionPerformed(e);
150 fileMenu.setText("File");
151 saveMenu.setText("Save as");
153 eps.addActionListener(new ActionListener()
155 public void actionPerformed(ActionEvent e)
157 eps_actionPerformed(e);
161 png.addActionListener(new ActionListener()
163 public void actionPerformed(ActionEvent e)
165 png_actionPerformed(e);
168 outputValues.setText("Output Values...");
169 outputValues.addActionListener(new ActionListener()
171 public void actionPerformed(ActionEvent e)
173 outputValues_actionPerformed(e);
176 outputPoints.setText("Output points...");
177 outputPoints.addActionListener(new ActionListener()
179 public void actionPerformed(ActionEvent e)
181 outputPoints_actionPerformed(e);
184 outputProjPoints.setText("Output transformed points...");
185 outputProjPoints.addActionListener(new ActionListener()
187 public void actionPerformed(ActionEvent e)
189 outputProjPoints_actionPerformed(e);
192 print.addActionListener(new ActionListener()
194 public void actionPerformed(ActionEvent e)
196 print_actionPerformed(e);
199 viewMenu.setText("View");
200 viewMenu.addMenuListener(new MenuListener()
202 public void menuSelected(MenuEvent e)
204 viewMenu_menuSelected();
207 public void menuDeselected(MenuEvent e)
211 public void menuCanceled(MenuEvent e)
215 showLabels.setText("Show Labels");
216 showLabels.addActionListener(new ActionListener()
218 public void actionPerformed(ActionEvent e)
220 showLabels_actionPerformed(e);
223 print.setText("Print");
224 bgcolour.setText("Background Colour...");
225 bgcolour.addActionListener(new ActionListener()
227 public void actionPerformed(ActionEvent e)
229 bgcolour_actionPerformed(e);
232 originalSeqData.setText("Input Data...");
233 originalSeqData.addActionListener(new ActionListener()
235 public void actionPerformed(ActionEvent e)
237 originalSeqData_actionPerformed(e);
240 associateViewsMenu.setText("Associate Nodes With");
241 calcSettings.setText("Change Parameters");
242 nuclSetting.setText("Nucleotide matrix");
243 protSetting.setText("Protein matrix");
244 nuclSetting.addActionListener(new ActionListener()
248 public void actionPerformed(ActionEvent arg0)
250 nuclSetting_actionPerfomed(arg0);
253 protSetting.addActionListener(new ActionListener()
257 public void actionPerformed(ActionEvent arg0)
259 protSetting_actionPerfomed(arg0);
262 jvVersionSetting.setText("Jalview PCA Calculation");
263 jvVersionSetting.addActionListener(new ActionListener()
266 public void actionPerformed(ActionEvent arg0)
268 jvVersionSetting_actionPerfomed(arg0);
271 calcSettings.add(jvVersionSetting);
272 calcSettings.add(nuclSetting);
273 calcSettings.add(protSetting);
274 statusPanel.setLayout(statusPanelLayout);
275 statusBar.setFont(new java.awt.Font("Verdana",0,12));
276 //statusPanel.setBackground(Color.lightGray);
277 //statusBar.setBackground(Color.lightGray);
278 //statusPanel.add(statusBar, null);
279 JPanel panelBar = new JPanel(new BorderLayout());
280 panelBar.add(jPanel2, BorderLayout.NORTH);
281 panelBar.add(statusPanel, BorderLayout.SOUTH);
282 this.getContentPane().add(panelBar, BorderLayout.SOUTH);
283 jPanel2.add(jLabel1, null);
284 jPanel2.add(xCombobox, null);
285 jPanel2.add(jLabel2, null);
286 jPanel2.add(yCombobox, null);
287 jPanel2.add(jLabel3, null);
288 jPanel2.add(zCombobox, null);
289 jPanel2.add(resetButton, null);
290 jMenuBar1.add(fileMenu);
291 jMenuBar1.add(viewMenu);
292 jMenuBar1.add(calcSettings);
293 fileMenu.add(saveMenu);
294 fileMenu.add(outputValues);
296 fileMenu.add(originalSeqData);
297 fileMenu.add(outputPoints);
298 fileMenu.add(outputProjPoints);
301 viewMenu.add(showLabels);
302 viewMenu.add(bgcolour);
303 viewMenu.add(associateViewsMenu);
306 protected void resetButton_actionPerformed(ActionEvent e)
308 // TODO Auto-generated method stub
312 protected void protSetting_actionPerfomed(ActionEvent arg0)
314 // TODO Auto-generated method stub
318 protected void nuclSetting_actionPerfomed(ActionEvent arg0)
320 // TODO Auto-generated method stub
324 protected void outputPoints_actionPerformed(ActionEvent e)
326 // TODO Auto-generated method stub
330 protected void outputProjPoints_actionPerformed(ActionEvent e)
332 // TODO Auto-generated method stub
336 protected void xCombobox_actionPerformed(ActionEvent e)
340 protected void yCombobox_actionPerformed(ActionEvent e)
344 protected void zCombobox_actionPerformed(ActionEvent e)
348 public void eps_actionPerformed(ActionEvent e)
353 public void png_actionPerformed(ActionEvent e)
358 public void outputValues_actionPerformed(ActionEvent e)
363 public void print_actionPerformed(ActionEvent e)
368 public void showLabels_actionPerformed(ActionEvent e)
373 public void bgcolour_actionPerformed(ActionEvent e)
378 public void originalSeqData_actionPerformed(ActionEvent e)
383 public void viewMenu_menuSelected()
388 protected void jvVersionSetting_actionPerfomed(ActionEvent arg0)
390 // TODO Auto-generated method stub