2 * Jalview - A Sequence Alignment Editor and Viewer
\r
3 * Copyright (C) 2007 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
\r
5 * This program is free software; you can redistribute it and/or
\r
6 * modify it under the terms of the GNU General Public License
\r
7 * as published by the Free Software Foundation; either version 2
\r
8 * of the License, or (at your option) any later version.
\r
10 * This program is distributed in the hope that it will be useful,
\r
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
13 * GNU General Public License for more details.
\r
15 * You should have received a copy of the GNU General Public License
\r
16 * along with this program; if not, write to the Free Software
\r
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
\r
19 package jalview.jbgui;
\r
22 import java.awt.event.*;
\r
23 import javax.swing.*;
\r
24 import javax.swing.event.*;
\r
26 public class GPCAPanel
\r
27 extends JInternalFrame
\r
29 JPanel jPanel2 = new JPanel();
\r
30 JLabel jLabel1 = new JLabel();
\r
31 JLabel jLabel2 = new JLabel();
\r
32 JLabel jLabel3 = new JLabel();
\r
33 protected JComboBox xCombobox = new JComboBox();
\r
34 protected JComboBox yCombobox = new JComboBox();
\r
35 protected JComboBox zCombobox = new JComboBox();
\r
36 FlowLayout flowLayout1 = new FlowLayout();
\r
37 BorderLayout borderLayout1 = new BorderLayout();
\r
38 JMenuBar jMenuBar1 = new JMenuBar();
\r
39 JMenu fileMenu = new JMenu();
\r
40 JMenu saveMenu = new JMenu();
\r
41 JMenuItem eps = new JMenuItem();
\r
42 JMenuItem png = new JMenuItem();
\r
43 JMenuItem print = new JMenuItem();
\r
44 JMenuItem outputValues = new JMenuItem();
\r
45 protected JMenu viewMenu = new JMenu();
\r
46 protected JCheckBoxMenuItem showLabels = new JCheckBoxMenuItem();
\r
47 JMenuItem bgcolour = new JMenuItem();
\r
48 JMenuItem originalSeqData = new JMenuItem();
\r
49 protected JMenu associateViewsMenu = new JMenu();
\r
59 e.printStackTrace();
\r
62 for (int i = 1; i < 8; i++)
\r
64 xCombobox.addItem("dim " + i);
\r
65 yCombobox.addItem("dim " + i);
\r
66 zCombobox.addItem("dim " + i);
\r
69 setJMenuBar(jMenuBar1);
\r
72 private void jbInit()
\r
75 this.getContentPane().setLayout(borderLayout1);
\r
76 jPanel2.setLayout(flowLayout1);
\r
77 jLabel1.setFont(new java.awt.Font("Verdana", 0, 12));
\r
78 jLabel1.setText("x=");
\r
79 jLabel2.setFont(new java.awt.Font("Verdana", 0, 12));
\r
80 jLabel2.setText("y=");
\r
81 jLabel3.setFont(new java.awt.Font("Verdana", 0, 12));
\r
82 jLabel3.setText("z=");
\r
83 jPanel2.setBackground(Color.white);
\r
84 jPanel2.setBorder(null);
\r
85 zCombobox.setFont(new java.awt.Font("Verdana", 0, 12));
\r
86 zCombobox.addActionListener(new java.awt.event.ActionListener()
\r
88 public void actionPerformed(ActionEvent e)
\r
90 zCombobox_actionPerformed(e);
\r
93 yCombobox.setFont(new java.awt.Font("Verdana", 0, 12));
\r
94 yCombobox.addActionListener(new java.awt.event.ActionListener()
\r
96 public void actionPerformed(ActionEvent e)
\r
98 yCombobox_actionPerformed(e);
\r
101 xCombobox.setFont(new java.awt.Font("Verdana", 0, 12));
\r
102 xCombobox.addActionListener(new java.awt.event.ActionListener()
\r
104 public void actionPerformed(ActionEvent e)
\r
106 xCombobox_actionPerformed(e);
\r
109 fileMenu.setText("File");
\r
110 saveMenu.setText("Save as");
\r
111 eps.setText("EPS");
\r
112 eps.addActionListener(new ActionListener()
\r
114 public void actionPerformed(ActionEvent e)
\r
116 eps_actionPerformed(e);
\r
119 png.setText("PNG");
\r
120 png.addActionListener(new ActionListener()
\r
122 public void actionPerformed(ActionEvent e)
\r
124 png_actionPerformed(e);
\r
127 outputValues.setText("Output Values...");
\r
128 outputValues.addActionListener(new ActionListener()
\r
130 public void actionPerformed(ActionEvent e)
\r
132 outputValues_actionPerformed(e);
\r
135 print.addActionListener(new ActionListener()
\r
137 public void actionPerformed(ActionEvent e)
\r
139 print_actionPerformed(e);
\r
142 viewMenu.setText("View");
\r
143 viewMenu.addMenuListener(new MenuListener()
\r
145 public void menuSelected(MenuEvent e)
\r
147 viewMenu_menuSelected();
\r
150 public void menuDeselected(MenuEvent e)
\r
154 public void menuCanceled(MenuEvent e)
\r
158 showLabels.setText("Show Labels");
\r
159 showLabels.addActionListener(new ActionListener()
\r
161 public void actionPerformed(ActionEvent e)
\r
163 showLabels_actionPerformed(e);
\r
166 print.setText("Print");
\r
167 bgcolour.setText("Background Colour...");
\r
168 bgcolour.addActionListener(new ActionListener()
\r
170 public void actionPerformed(ActionEvent e)
\r
172 bgcolour_actionPerformed(e);
\r
175 originalSeqData.setText("Input Data...");
\r
176 originalSeqData.addActionListener(new ActionListener()
\r
178 public void actionPerformed(ActionEvent e)
\r
180 originalSeqData_actionPerformed(e);
\r
183 associateViewsMenu.setText("Associate Nodes With");
\r
184 this.getContentPane().add(jPanel2, BorderLayout.SOUTH);
\r
185 jPanel2.add(jLabel1, null);
\r
186 jPanel2.add(xCombobox, null);
\r
187 jPanel2.add(jLabel2, null);
\r
188 jPanel2.add(yCombobox, null);
\r
189 jPanel2.add(jLabel3, null);
\r
190 jPanel2.add(zCombobox, null);
\r
191 jMenuBar1.add(fileMenu);
\r
192 jMenuBar1.add(viewMenu);
\r
193 fileMenu.add(saveMenu);
\r
194 fileMenu.add(outputValues);
\r
195 fileMenu.add(print);
\r
196 fileMenu.add(originalSeqData);
\r
199 viewMenu.add(showLabels);
\r
200 viewMenu.add(bgcolour);
\r
201 viewMenu.add(associateViewsMenu);
\r
204 protected void xCombobox_actionPerformed(ActionEvent e)
\r
208 protected void yCombobox_actionPerformed(ActionEvent e)
\r
212 protected void zCombobox_actionPerformed(ActionEvent e)
\r
216 public void eps_actionPerformed(ActionEvent e)
\r
221 public void png_actionPerformed(ActionEvent e)
\r
226 public void outputValues_actionPerformed(ActionEvent e)
\r
231 public void print_actionPerformed(ActionEvent e)
\r
236 public void showLabels_actionPerformed(ActionEvent e)
\r
241 public void bgcolour_actionPerformed(ActionEvent e)
\r
246 public void originalSeqData_actionPerformed(ActionEvent e)
\r
251 public void viewMenu_menuSelected()
\r