Clover icon

jalviewX

  1. Project Clover database Wed Oct 31 2018 15:13:58 GMT
  2. Package jalview.jbgui

File GPCAPanel.java

 

Coverage histogram

../../img/srcFileCovDistChart0.png
56% of files have more coverage

Code metrics

2
118
39
1
421
337
41
0.35
3.03
39
1.05

Classes

Class Line # Actions
GPCAPanel 46 118 41 159
0.00%
 

Contributing tests

No tests hitting this source file were found.

Source view

1    /*
2    * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
3    * Copyright (C) $$Year-Rel$$ The Jalview Authors
4    *
5    * This file is part of Jalview.
6    *
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.
11    *
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.
16    *
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.
20    */
21    package jalview.jbgui;
22   
23    import jalview.util.ImageMaker.TYPE;
24    import jalview.util.MessageManager;
25   
26    import java.awt.BorderLayout;
27    import java.awt.Color;
28    import java.awt.FlowLayout;
29    import java.awt.Font;
30    import java.awt.GridLayout;
31    import java.awt.event.ActionEvent;
32    import java.awt.event.ActionListener;
33   
34    import javax.swing.JButton;
35    import javax.swing.JCheckBoxMenuItem;
36    import javax.swing.JComboBox;
37    import javax.swing.JInternalFrame;
38    import javax.swing.JLabel;
39    import javax.swing.JMenu;
40    import javax.swing.JMenuBar;
41    import javax.swing.JMenuItem;
42    import javax.swing.JPanel;
43    import javax.swing.event.MenuEvent;
44    import javax.swing.event.MenuListener;
45   
 
46    public class GPCAPanel extends JInternalFrame
47    {
48    private static final Font VERDANA_12 = new Font("Verdana", 0, 12);
49   
50    protected JComboBox<String> xCombobox = new JComboBox<String>();
51   
52    protected JComboBox<String> yCombobox = new JComboBox<String>();
53   
54    protected JComboBox<String> zCombobox = new JComboBox<String>();
55   
56    protected JMenu scoreModelMenu = new JMenu();
57   
58    protected JMenu viewMenu = new JMenu();
59   
60    protected JCheckBoxMenuItem showLabels = new JCheckBoxMenuItem();
61   
62    protected JMenu associateViewsMenu = new JMenu();
63   
64    protected JMenu calcSettings = new JMenu();
65   
66    protected JCheckBoxMenuItem nuclSetting = new JCheckBoxMenuItem();
67   
68    protected JCheckBoxMenuItem protSetting = new JCheckBoxMenuItem();
69   
70    protected JLabel statusBar = new JLabel();
71   
72    protected JPanel statusPanel = new JPanel();
73   
 
74  0 toggle public GPCAPanel()
75    {
76  0 try
77    {
78  0 jbInit();
79    } catch (Exception e)
80    {
81  0 e.printStackTrace();
82    }
83   
84  0 for (int i = 1; i < 8; i++)
85    {
86  0 xCombobox.addItem("dim " + i);
87  0 yCombobox.addItem("dim " + i);
88  0 zCombobox.addItem("dim " + i);
89    }
90    }
91   
 
92  0 toggle private void jbInit() throws Exception
93    {
94  0 this.getContentPane().setLayout(new BorderLayout());
95  0 JPanel jPanel2 = new JPanel();
96  0 jPanel2.setLayout(new FlowLayout());
97  0 JLabel jLabel1 = new JLabel();
98  0 jLabel1.setFont(VERDANA_12);
99  0 jLabel1.setText("x=");
100  0 JLabel jLabel2 = new JLabel();
101  0 jLabel2.setFont(VERDANA_12);
102  0 jLabel2.setText("y=");
103  0 JLabel jLabel3 = new JLabel();
104  0 jLabel3.setFont(VERDANA_12);
105  0 jLabel3.setText("z=");
106  0 jPanel2.setBackground(Color.white);
107  0 jPanel2.setBorder(null);
108  0 zCombobox.setFont(VERDANA_12);
109  0 zCombobox.addActionListener(new ActionListener()
110    {
 
111  0 toggle @Override
112    public void actionPerformed(ActionEvent e)
113    {
114  0 zCombobox_actionPerformed(e);
115    }
116    });
117  0 yCombobox.setFont(VERDANA_12);
118  0 yCombobox.addActionListener(new ActionListener()
119    {
 
120  0 toggle @Override
121    public void actionPerformed(ActionEvent e)
122    {
123  0 yCombobox_actionPerformed(e);
124    }
125    });
126  0 xCombobox.setFont(VERDANA_12);
127  0 xCombobox.addActionListener(new ActionListener()
128    {
 
129  0 toggle @Override
130    public void actionPerformed(ActionEvent e)
131    {
132  0 xCombobox_actionPerformed(e);
133    }
134    });
135  0 JButton resetButton = new JButton();
136  0 resetButton.setFont(VERDANA_12);
137  0 resetButton.setText(MessageManager.getString("action.reset"));
138  0 resetButton.addActionListener(new ActionListener()
139    {
 
140  0 toggle @Override
141    public void actionPerformed(ActionEvent e)
142    {
143  0 resetButton_actionPerformed(e);
144    }
145    });
146  0 JMenu fileMenu = new JMenu();
147  0 fileMenu.setText(MessageManager.getString("action.file"));
148  0 JMenu saveMenu = new JMenu();
149  0 saveMenu.setText(MessageManager.getString("action.save_as"));
150  0 JMenuItem eps = new JMenuItem("EPS");
151  0 eps.addActionListener(new ActionListener()
152    {
 
153  0 toggle @Override
154    public void actionPerformed(ActionEvent e)
155    {
156  0 makePCAImage(TYPE.EPS);
157    }
158    });
159  0 JMenuItem png = new JMenuItem("PNG");
160  0 png.addActionListener(new ActionListener()
161    {
 
162  0 toggle @Override
163    public void actionPerformed(ActionEvent e)
164    {
165  0 makePCAImage(TYPE.PNG);
166    }
167    });
168  0 JMenuItem outputValues = new JMenuItem();
169  0 outputValues.setText(MessageManager.getString("label.output_values"));
170  0 outputValues.addActionListener(new ActionListener()
171    {
 
172  0 toggle @Override
173    public void actionPerformed(ActionEvent e)
174    {
175  0 outputValues_actionPerformed(e);
176    }
177    });
178  0 JMenuItem outputPoints = new JMenuItem();
179  0 outputPoints.setText(MessageManager.getString("label.output_points"));
180  0 outputPoints.addActionListener(new ActionListener()
181    {
 
182  0 toggle @Override
183    public void actionPerformed(ActionEvent e)
184    {
185  0 outputPoints_actionPerformed(e);
186    }
187    });
188  0 JMenuItem outputProjPoints = new JMenuItem();
189  0 outputProjPoints.setText(
190    MessageManager.getString("label.output_transformed_points"));
191  0 outputProjPoints.addActionListener(new ActionListener()
192    {
 
193  0 toggle @Override
194    public void actionPerformed(ActionEvent e)
195    {
196  0 outputProjPoints_actionPerformed(e);
197    }
198    });
199  0 JMenuItem print = new JMenuItem();
200  0 print.setText(MessageManager.getString("action.print"));
201  0 print.addActionListener(new ActionListener()
202    {
 
203  0 toggle @Override
204    public void actionPerformed(ActionEvent e)
205    {
206  0 print_actionPerformed(e);
207    }
208    });
209  0 viewMenu.setText(MessageManager.getString("action.view"));
210  0 viewMenu.addMenuListener(new MenuListener()
211    {
 
212  0 toggle @Override
213    public void menuSelected(MenuEvent e)
214    {
215  0 viewMenu_menuSelected();
216    }
217   
 
218  0 toggle @Override
219    public void menuDeselected(MenuEvent e)
220    {
221    }
222   
 
223  0 toggle @Override
224    public void menuCanceled(MenuEvent e)
225    {
226    }
227    });
228  0 scoreModelMenu
229    .setText(MessageManager.getString("label.select_score_model"));
230  0 scoreModelMenu.addMenuListener(new MenuListener()
231    {
 
232  0 toggle @Override
233    public void menuSelected(MenuEvent e)
234    {
235  0 scoreModel_menuSelected();
236    }
237   
 
238  0 toggle @Override
239    public void menuDeselected(MenuEvent e)
240    {
241    }
242   
 
243  0 toggle @Override
244    public void menuCanceled(MenuEvent e)
245    {
246    }
247    });
248  0 showLabels.setText(MessageManager.getString("label.show_labels"));
249  0 showLabels.addActionListener(new ActionListener()
250    {
 
251  0 toggle @Override
252    public void actionPerformed(ActionEvent e)
253    {
254  0 showLabels_actionPerformed(e);
255    }
256    });
257  0 JMenuItem bgcolour = new JMenuItem();
258  0 bgcolour.setText(MessageManager.getString("action.background_colour"));
259  0 bgcolour.addActionListener(new ActionListener()
260    {
 
261  0 toggle @Override
262    public void actionPerformed(ActionEvent e)
263    {
264  0 bgcolour_actionPerformed(e);
265    }
266    });
267  0 JMenuItem originalSeqData = new JMenuItem();
268  0 originalSeqData.setText(MessageManager.getString("label.input_data"));
269  0 originalSeqData.addActionListener(new ActionListener()
270    {
 
271  0 toggle @Override
272    public void actionPerformed(ActionEvent e)
273    {
274  0 originalSeqData_actionPerformed(e);
275    }
276    });
277  0 associateViewsMenu.setText(
278    MessageManager.getString("label.associate_nodes_with"));
279  0 calcSettings.setText(MessageManager.getString("action.change_params"));
280  0 nuclSetting
281    .setText(MessageManager.getString("label.nucleotide_matrix"));
282  0 protSetting.setText(MessageManager.getString("label.protein_matrix"));
283  0 nuclSetting.addActionListener(new ActionListener()
284    {
285   
 
286  0 toggle @Override
287    public void actionPerformed(ActionEvent arg0)
288    {
289  0 nuclSetting_actionPerfomed(arg0);
290    }
291    });
292  0 protSetting.addActionListener(new ActionListener()
293    {
294   
 
295  0 toggle @Override
296    public void actionPerformed(ActionEvent arg0)
297    {
298  0 protSetting_actionPerfomed(arg0);
299    }
300    });
301   
302  0 calcSettings.add(nuclSetting);
303  0 calcSettings.add(protSetting);
304  0 calcSettings.add(scoreModelMenu);
305  0 statusPanel.setLayout(new GridLayout());
306  0 statusBar.setFont(VERDANA_12);
307    // statusPanel.setBackground(Color.lightGray);
308    // statusBar.setBackground(Color.lightGray);
309    // statusPanel.add(statusBar, null);
310  0 JPanel panelBar = new JPanel(new BorderLayout());
311  0 panelBar.add(jPanel2, BorderLayout.NORTH);
312  0 panelBar.add(statusPanel, BorderLayout.SOUTH);
313  0 this.getContentPane().add(panelBar, BorderLayout.SOUTH);
314  0 jPanel2.add(jLabel1, null);
315  0 jPanel2.add(xCombobox, null);
316  0 jPanel2.add(jLabel2, null);
317  0 jPanel2.add(yCombobox, null);
318  0 jPanel2.add(jLabel3, null);
319  0 jPanel2.add(zCombobox, null);
320  0 jPanel2.add(resetButton, null);
321   
322  0 JMenuBar jMenuBar1 = new JMenuBar();
323  0 jMenuBar1.add(fileMenu);
324  0 jMenuBar1.add(viewMenu);
325  0 jMenuBar1.add(calcSettings);
326  0 setJMenuBar(jMenuBar1);
327  0 fileMenu.add(saveMenu);
328  0 fileMenu.add(outputValues);
329  0 fileMenu.add(print);
330  0 fileMenu.add(originalSeqData);
331  0 fileMenu.add(outputPoints);
332  0 fileMenu.add(outputProjPoints);
333  0 saveMenu.add(eps);
334  0 saveMenu.add(png);
335  0 viewMenu.add(showLabels);
336  0 viewMenu.add(bgcolour);
337  0 viewMenu.add(associateViewsMenu);
338    }
339   
 
340  0 toggle protected void scoreModel_menuSelected()
341    {
342    // TODO Auto-generated method stub
343   
344    }
345   
 
346  0 toggle protected void resetButton_actionPerformed(ActionEvent e)
347    {
348    // TODO Auto-generated method stub
349   
350    }
351   
 
352  0 toggle protected void protSetting_actionPerfomed(ActionEvent arg0)
353    {
354    // TODO Auto-generated method stub
355   
356    }
357   
 
358  0 toggle protected void nuclSetting_actionPerfomed(ActionEvent arg0)
359    {
360    // TODO Auto-generated method stub
361   
362    }
363   
 
364  0 toggle protected void outputPoints_actionPerformed(ActionEvent e)
365    {
366    // TODO Auto-generated method stub
367   
368    }
369   
 
370  0 toggle protected void outputProjPoints_actionPerformed(ActionEvent e)
371    {
372    // TODO Auto-generated method stub
373   
374    }
375   
 
376  0 toggle protected void xCombobox_actionPerformed(ActionEvent e)
377    {
378    }
379   
 
380  0 toggle protected void yCombobox_actionPerformed(ActionEvent e)
381    {
382    }
383   
 
384  0 toggle protected void zCombobox_actionPerformed(ActionEvent e)
385    {
386    }
387   
 
388  0 toggle public void makePCAImage(TYPE imageType)
389    {
390    }
391   
 
392  0 toggle public void outputValues_actionPerformed(ActionEvent e)
393    {
394   
395    }
396   
 
397  0 toggle public void print_actionPerformed(ActionEvent e)
398    {
399   
400    }
401   
 
402  0 toggle public void showLabels_actionPerformed(ActionEvent e)
403    {
404   
405    }
406   
 
407  0 toggle public void bgcolour_actionPerformed(ActionEvent e)
408    {
409   
410    }
411   
 
412  0 toggle public void originalSeqData_actionPerformed(ActionEvent e)
413    {
414   
415    }
416   
 
417  0 toggle public void viewMenu_menuSelected()
418    {
419   
420    }
421    }