JAL-2962 remove Change Parameters menu from PCA panel
[jalview.git] / src / jalview / jbgui / GPCAPanel.java
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.MessageManager;
24
25 import java.awt.BorderLayout;
26 import java.awt.Color;
27 import java.awt.FlowLayout;
28 import java.awt.Font;
29 import java.awt.GridLayout;
30 import java.awt.event.ActionEvent;
31 import java.awt.event.ActionListener;
32
33 import javax.swing.JButton;
34 import javax.swing.JCheckBoxMenuItem;
35 import javax.swing.JComboBox;
36 import javax.swing.JInternalFrame;
37 import javax.swing.JLabel;
38 import javax.swing.JMenu;
39 import javax.swing.JMenuBar;
40 import javax.swing.JMenuItem;
41 import javax.swing.JPanel;
42 import javax.swing.event.MenuEvent;
43 import javax.swing.event.MenuListener;
44
45 public class GPCAPanel extends JInternalFrame
46 {
47   private static final Font VERDANA_12 = new Font("Verdana", 0, 12);
48
49   protected JComboBox<String> xCombobox = new JComboBox<>();
50
51   protected JComboBox<String> yCombobox = new JComboBox<>();
52
53   protected JComboBox<String> zCombobox = new JComboBox<>();
54
55   protected JMenu viewMenu = new JMenu();
56
57   protected JCheckBoxMenuItem showLabels = new JCheckBoxMenuItem();
58
59   protected JMenu associateViewsMenu = new JMenu();
60
61   protected JLabel statusBar = new JLabel();
62
63   protected JPanel statusPanel = new JPanel();
64
65   /**
66    * Constructor
67    */
68   public GPCAPanel()
69   {
70     try
71     {
72       jbInit();
73     } catch (Exception e)
74     {
75       e.printStackTrace();
76     }
77
78     for (int i = 1; i < 8; i++)
79     {
80       xCombobox.addItem("dim " + i);
81       yCombobox.addItem("dim " + i);
82       zCombobox.addItem("dim " + i);
83     }
84   }
85
86   private void jbInit() throws Exception
87   {
88     this.getContentPane().setLayout(new BorderLayout());
89     JPanel jPanel2 = new JPanel();
90     jPanel2.setLayout(new FlowLayout());
91     JLabel jLabel1 = new JLabel();
92     jLabel1.setFont(VERDANA_12);
93     jLabel1.setText("x=");
94     JLabel jLabel2 = new JLabel();
95     jLabel2.setFont(VERDANA_12);
96     jLabel2.setText("y=");
97     JLabel jLabel3 = new JLabel();
98     jLabel3.setFont(VERDANA_12);
99     jLabel3.setText("z=");
100     jPanel2.setBackground(Color.white);
101     jPanel2.setBorder(null);
102     zCombobox.setFont(VERDANA_12);
103     zCombobox.addActionListener(new ActionListener()
104     {
105       @Override
106       public void actionPerformed(ActionEvent e)
107       {
108         doDimensionChange();
109       }
110     });
111     yCombobox.setFont(VERDANA_12);
112     yCombobox.addActionListener(new ActionListener()
113     {
114       @Override
115       public void actionPerformed(ActionEvent e)
116       {
117         doDimensionChange();
118       }
119     });
120     xCombobox.setFont(VERDANA_12);
121     xCombobox.addActionListener(new ActionListener()
122     {
123       @Override
124       public void actionPerformed(ActionEvent e)
125       {
126         doDimensionChange();
127       }
128     });
129     JButton resetButton = new JButton();
130     resetButton.setFont(VERDANA_12);
131     resetButton.setText(MessageManager.getString("action.reset"));
132     resetButton.addActionListener(new ActionListener()
133     {
134       @Override
135       public void actionPerformed(ActionEvent e)
136       {
137         resetButton_actionPerformed();
138       }
139     });
140     JMenu fileMenu = new JMenu();
141     fileMenu.setText(MessageManager.getString("action.file"));
142     JMenu saveMenu = new JMenu();
143     saveMenu.setText(MessageManager.getString("action.save_as"));
144     JMenuItem eps = new JMenuItem("EPS");
145     eps.addActionListener(new ActionListener()
146     {
147       @Override
148       public void actionPerformed(ActionEvent e)
149       {
150         eps_actionPerformed();
151       }
152     });
153     JMenuItem png = new JMenuItem("PNG");
154     png.addActionListener(new ActionListener()
155     {
156       @Override
157       public void actionPerformed(ActionEvent e)
158       {
159         png_actionPerformed();
160       }
161     });
162     JMenuItem outputValues = new JMenuItem();
163     outputValues.setText(MessageManager.getString("label.output_values"));
164     outputValues.addActionListener(new ActionListener()
165     {
166       @Override
167       public void actionPerformed(ActionEvent e)
168       {
169         outputValues_actionPerformed();
170       }
171     });
172     JMenuItem outputPoints = new JMenuItem();
173     outputPoints.setText(MessageManager.getString("label.output_points"));
174     outputPoints.addActionListener(new ActionListener()
175     {
176       @Override
177       public void actionPerformed(ActionEvent e)
178       {
179         outputPoints_actionPerformed();
180       }
181     });
182     JMenuItem outputProjPoints = new JMenuItem();
183     outputProjPoints.setText(
184             MessageManager.getString("label.output_transformed_points"));
185     outputProjPoints.addActionListener(new ActionListener()
186     {
187       @Override
188       public void actionPerformed(ActionEvent e)
189       {
190         outputProjPoints_actionPerformed();
191       }
192     });
193     JMenuItem print = new JMenuItem();
194     print.setText(MessageManager.getString("action.print"));
195     print.addActionListener(new ActionListener()
196     {
197       @Override
198       public void actionPerformed(ActionEvent e)
199       {
200         print_actionPerformed();
201       }
202     });
203     viewMenu.setText(MessageManager.getString("action.view"));
204     viewMenu.addMenuListener(new MenuListener()
205     {
206       @Override
207       public void menuSelected(MenuEvent e)
208       {
209         viewMenu_menuSelected();
210       }
211
212       @Override
213       public void menuDeselected(MenuEvent e)
214       {
215       }
216
217       @Override
218       public void menuCanceled(MenuEvent e)
219       {
220       }
221     });
222     showLabels.setText(MessageManager.getString("label.show_labels"));
223     showLabels.addActionListener(new ActionListener()
224     {
225       @Override
226       public void actionPerformed(ActionEvent e)
227       {
228         showLabels_actionPerformed();
229       }
230     });
231     JMenuItem bgcolour = new JMenuItem();
232     bgcolour.setText(MessageManager.getString("action.background_colour"));
233     bgcolour.addActionListener(new ActionListener()
234     {
235       @Override
236       public void actionPerformed(ActionEvent e)
237       {
238         bgcolour_actionPerformed();
239       }
240     });
241     JMenuItem originalSeqData = new JMenuItem();
242     originalSeqData.setText(MessageManager.getString("label.input_data"));
243     originalSeqData.addActionListener(new ActionListener()
244     {
245       @Override
246       public void actionPerformed(ActionEvent e)
247       {
248         originalSeqData_actionPerformed();
249       }
250     });
251     associateViewsMenu.setText(
252             MessageManager.getString("label.associate_nodes_with"));
253
254     statusPanel.setLayout(new GridLayout());
255     statusBar.setFont(VERDANA_12);
256     // statusPanel.setBackground(Color.lightGray);
257     // statusBar.setBackground(Color.lightGray);
258     // statusPanel.add(statusBar, null);
259     JPanel panelBar = new JPanel(new BorderLayout());
260     panelBar.add(jPanel2, BorderLayout.NORTH);
261     panelBar.add(statusPanel, BorderLayout.SOUTH);
262     this.getContentPane().add(panelBar, BorderLayout.SOUTH);
263     jPanel2.add(jLabel1, null);
264     jPanel2.add(xCombobox, null);
265     jPanel2.add(jLabel2, null);
266     jPanel2.add(yCombobox, null);
267     jPanel2.add(jLabel3, null);
268     jPanel2.add(zCombobox, null);
269     jPanel2.add(resetButton, null);
270
271     JMenuBar jMenuBar1 = new JMenuBar();
272     jMenuBar1.add(fileMenu);
273     jMenuBar1.add(viewMenu);
274     setJMenuBar(jMenuBar1);
275     fileMenu.add(saveMenu);
276     fileMenu.add(outputValues);
277     fileMenu.add(print);
278     fileMenu.add(originalSeqData);
279     fileMenu.add(outputPoints);
280     fileMenu.add(outputProjPoints);
281     saveMenu.add(eps);
282     saveMenu.add(png);
283     viewMenu.add(showLabels);
284     viewMenu.add(bgcolour);
285     viewMenu.add(associateViewsMenu);
286   }
287
288   protected void resetButton_actionPerformed()
289   {
290   }
291
292   protected void outputPoints_actionPerformed()
293   {
294   }
295
296   protected void outputProjPoints_actionPerformed()
297   {
298   }
299
300   protected void eps_actionPerformed()
301   {
302   }
303
304   protected void png_actionPerformed()
305   {
306   }
307
308   protected void outputValues_actionPerformed()
309   {
310   }
311
312   protected void print_actionPerformed()
313   {
314   }
315
316   protected void showLabels_actionPerformed()
317   {
318   }
319
320   protected void bgcolour_actionPerformed()
321   {
322   }
323
324   protected void originalSeqData_actionPerformed()
325   {
326   }
327
328   protected void viewMenu_menuSelected()
329   {
330   }
331
332   protected void doDimensionChange()
333   {
334   }
335 }