2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8)
3 * Copyright (C) 2012 J Procter, AM Waterhouse, LM Lui, J Engelhardt, 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();
78 protected JCheckBoxMenuItem nuclSetting = new JCheckBoxMenuItem();
80 protected JCheckBoxMenuItem protSetting = new JCheckBoxMenuItem();
82 protected JCheckBoxMenuItem jvVersionSetting = new JCheckBoxMenuItem();
84 protected JLabel statusBar = new JLabel();
86 protected GridLayout statusPanelLayout = new GridLayout();
88 protected JPanel statusPanel = new JPanel();
100 for (int i = 1; i < 8; i++)
102 xCombobox.addItem("dim " + i);
103 yCombobox.addItem("dim " + i);
104 zCombobox.addItem("dim " + i);
107 setJMenuBar(jMenuBar1);
110 private void jbInit() throws Exception
112 this.getContentPane().setLayout(borderLayout1);
113 jPanel2.setLayout(flowLayout1);
114 jLabel1.setFont(new java.awt.Font("Verdana", 0, 12));
115 jLabel1.setText("x=");
116 jLabel2.setFont(new java.awt.Font("Verdana", 0, 12));
117 jLabel2.setText("y=");
118 jLabel3.setFont(new java.awt.Font("Verdana", 0, 12));
119 jLabel3.setText("z=");
120 jPanel2.setBackground(Color.white);
121 jPanel2.setBorder(null);
122 zCombobox.setFont(new java.awt.Font("Verdana", 0, 12));
123 zCombobox.addActionListener(new java.awt.event.ActionListener()
125 public void actionPerformed(ActionEvent e)
127 zCombobox_actionPerformed(e);
130 yCombobox.setFont(new java.awt.Font("Verdana", 0, 12));
131 yCombobox.addActionListener(new java.awt.event.ActionListener()
133 public void actionPerformed(ActionEvent e)
135 yCombobox_actionPerformed(e);
138 xCombobox.setFont(new java.awt.Font("Verdana", 0, 12));
139 xCombobox.addActionListener(new java.awt.event.ActionListener()
141 public void actionPerformed(ActionEvent e)
143 xCombobox_actionPerformed(e);
146 resetButton.setFont(new java.awt.Font("Verdana", 0, 12));
147 resetButton.setText("Reset");
148 resetButton.addActionListener(new java.awt.event.ActionListener()
151 public void actionPerformed(ActionEvent e)
153 resetButton_actionPerformed(e);
156 fileMenu.setText("File");
157 saveMenu.setText("Save as");
159 eps.addActionListener(new ActionListener()
161 public void actionPerformed(ActionEvent e)
163 eps_actionPerformed(e);
167 png.addActionListener(new ActionListener()
169 public void actionPerformed(ActionEvent e)
171 png_actionPerformed(e);
174 outputValues.setText("Output Values...");
175 outputValues.addActionListener(new ActionListener()
177 public void actionPerformed(ActionEvent e)
179 outputValues_actionPerformed(e);
182 outputPoints.setText("Output points...");
183 outputPoints.addActionListener(new ActionListener()
185 public void actionPerformed(ActionEvent e)
187 outputPoints_actionPerformed(e);
190 outputProjPoints.setText("Output transformed points...");
191 outputProjPoints.addActionListener(new ActionListener()
193 public void actionPerformed(ActionEvent e)
195 outputProjPoints_actionPerformed(e);
198 print.addActionListener(new ActionListener()
200 public void actionPerformed(ActionEvent e)
202 print_actionPerformed(e);
205 viewMenu.setText("View");
206 viewMenu.addMenuListener(new MenuListener()
208 public void menuSelected(MenuEvent e)
210 viewMenu_menuSelected();
213 public void menuDeselected(MenuEvent e)
217 public void menuCanceled(MenuEvent e)
221 showLabels.setText("Show Labels");
222 showLabels.addActionListener(new ActionListener()
224 public void actionPerformed(ActionEvent e)
226 showLabels_actionPerformed(e);
229 print.setText("Print");
230 bgcolour.setText("Background Colour...");
231 bgcolour.addActionListener(new ActionListener()
233 public void actionPerformed(ActionEvent e)
235 bgcolour_actionPerformed(e);
238 originalSeqData.setText("Input Data...");
239 originalSeqData.addActionListener(new ActionListener()
241 public void actionPerformed(ActionEvent e)
243 originalSeqData_actionPerformed(e);
246 associateViewsMenu.setText("Associate Nodes With");
247 calcSettings.setText("Change Parameters");
248 nuclSetting.setText("Nucleotide matrix");
249 protSetting.setText("Protein matrix");
250 nuclSetting.addActionListener(new ActionListener()
254 public void actionPerformed(ActionEvent arg0)
256 nuclSetting_actionPerfomed(arg0);
259 protSetting.addActionListener(new ActionListener()
263 public void actionPerformed(ActionEvent arg0)
265 protSetting_actionPerfomed(arg0);
268 jvVersionSetting.setText("Jalview PCA Calculation");
269 jvVersionSetting.addActionListener(new ActionListener()
272 public void actionPerformed(ActionEvent arg0)
274 jvVersionSetting_actionPerfomed(arg0);
277 calcSettings.add(jvVersionSetting);
278 calcSettings.add(nuclSetting);
279 calcSettings.add(protSetting);
280 statusPanel.setLayout(statusPanelLayout);
281 statusBar.setFont(new java.awt.Font("Verdana", 0, 12));
282 // statusPanel.setBackground(Color.lightGray);
283 // statusBar.setBackground(Color.lightGray);
284 // statusPanel.add(statusBar, null);
285 JPanel panelBar = new JPanel(new BorderLayout());
286 panelBar.add(jPanel2, BorderLayout.NORTH);
287 panelBar.add(statusPanel, BorderLayout.SOUTH);
288 this.getContentPane().add(panelBar, BorderLayout.SOUTH);
289 jPanel2.add(jLabel1, null);
290 jPanel2.add(xCombobox, null);
291 jPanel2.add(jLabel2, null);
292 jPanel2.add(yCombobox, null);
293 jPanel2.add(jLabel3, null);
294 jPanel2.add(zCombobox, null);
295 jPanel2.add(resetButton, null);
296 jMenuBar1.add(fileMenu);
297 jMenuBar1.add(viewMenu);
298 jMenuBar1.add(calcSettings);
299 fileMenu.add(saveMenu);
300 fileMenu.add(outputValues);
302 fileMenu.add(originalSeqData);
303 fileMenu.add(outputPoints);
304 fileMenu.add(outputProjPoints);
307 viewMenu.add(showLabels);
308 viewMenu.add(bgcolour);
309 viewMenu.add(associateViewsMenu);
312 protected void resetButton_actionPerformed(ActionEvent e)
314 // TODO Auto-generated method stub
318 protected void protSetting_actionPerfomed(ActionEvent arg0)
320 // TODO Auto-generated method stub
324 protected void nuclSetting_actionPerfomed(ActionEvent arg0)
326 // TODO Auto-generated method stub
330 protected void outputPoints_actionPerformed(ActionEvent e)
332 // TODO Auto-generated method stub
336 protected void outputProjPoints_actionPerformed(ActionEvent e)
338 // TODO Auto-generated method stub
342 protected void xCombobox_actionPerformed(ActionEvent e)
346 protected void yCombobox_actionPerformed(ActionEvent e)
350 protected void zCombobox_actionPerformed(ActionEvent e)
354 public void eps_actionPerformed(ActionEvent e)
359 public void png_actionPerformed(ActionEvent e)
364 public void outputValues_actionPerformed(ActionEvent e)
369 public void print_actionPerformed(ActionEvent e)
374 public void showLabels_actionPerformed(ActionEvent e)
379 public void bgcolour_actionPerformed(ActionEvent e)
384 public void originalSeqData_actionPerformed(ActionEvent e)
389 public void viewMenu_menuSelected()
394 protected void jvVersionSetting_actionPerfomed(ActionEvent arg0)
396 // TODO Auto-generated method stub