2 * Jalview - A Sequence Alignment Editor and Viewer
\r
3 * Copyright (C) 2006 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.MenuListener;
\r
25 import javax.swing.event.MenuEvent;
\r
27 public class GPCAPanel
\r
28 extends JInternalFrame
\r
30 JPanel jPanel2 = new JPanel();
\r
31 JLabel jLabel1 = new JLabel();
\r
32 JLabel jLabel2 = new JLabel();
\r
33 JLabel jLabel3 = new JLabel();
\r
34 protected JComboBox xCombobox = new JComboBox();
\r
35 protected JComboBox yCombobox = new JComboBox();
\r
36 protected JComboBox zCombobox = new JComboBox();
\r
37 FlowLayout flowLayout1 = new FlowLayout();
\r
38 BorderLayout borderLayout1 = new BorderLayout();
\r
39 JMenuBar jMenuBar1 = new JMenuBar();
\r
40 JMenu fileMenu = new JMenu();
\r
41 JMenu saveMenu = new JMenu();
\r
42 JMenuItem eps = new JMenuItem();
\r
43 JMenuItem png = new JMenuItem();
\r
44 JMenuItem print = new JMenuItem();
\r
45 JMenuItem outputValues = new JMenuItem();
\r
46 protected JMenu viewMenu = new JMenu();
\r
47 protected JCheckBoxMenuItem showLabels = new JCheckBoxMenuItem();
\r
48 JMenuItem bgcolour = new JMenuItem();
\r
49 JMenuItem originalSeqData = new JMenuItem();
\r
50 protected JMenu associateViewsMenu = new JMenu();
\r
60 e.printStackTrace();
\r
63 for (int i = 1; i < 8; i++)
\r
65 xCombobox.addItem("dim " + i);
\r
66 yCombobox.addItem("dim " + i);
\r
67 zCombobox.addItem("dim " + i);
\r
71 setJMenuBar(jMenuBar1);
\r
74 private void jbInit()
\r
77 this.getContentPane().setLayout(borderLayout1);
\r
78 jPanel2.setLayout(flowLayout1);
\r
79 jLabel1.setFont(new java.awt.Font("Verdana", 0, 12));
\r
80 jLabel1.setText("x=");
\r
81 jLabel2.setFont(new java.awt.Font("Verdana", 0, 12));
\r
82 jLabel2.setText("y=");
\r
83 jLabel3.setFont(new java.awt.Font("Verdana", 0, 12));
\r
84 jLabel3.setText("z=");
\r
85 jPanel2.setBackground(Color.white);
\r
86 jPanel2.setBorder(null);
\r
87 zCombobox.setFont(new java.awt.Font("Verdana", 0, 12));
\r
88 zCombobox.addActionListener(new java.awt.event.ActionListener()
\r
90 public void actionPerformed(ActionEvent e)
\r
92 zCombobox_actionPerformed(e);
\r
95 yCombobox.setFont(new java.awt.Font("Verdana", 0, 12));
\r
96 yCombobox.addActionListener(new java.awt.event.ActionListener()
\r
98 public void actionPerformed(ActionEvent e)
\r
100 yCombobox_actionPerformed(e);
\r
103 xCombobox.setFont(new java.awt.Font("Verdana", 0, 12));
\r
104 xCombobox.addActionListener(new java.awt.event.ActionListener()
\r
106 public void actionPerformed(ActionEvent e)
\r
108 xCombobox_actionPerformed(e);
\r
111 fileMenu.setText("File");
\r
112 saveMenu.setText("Save as");
\r
113 eps.setText("EPS");
\r
114 eps.addActionListener(new ActionListener()
\r
116 public void actionPerformed(ActionEvent e)
\r
118 eps_actionPerformed(e);
\r
121 png.setText("PNG");
\r
122 png.addActionListener(new ActionListener()
\r
124 public void actionPerformed(ActionEvent e)
\r
126 png_actionPerformed(e);
\r
129 outputValues.setText("Output Values...");
\r
130 outputValues.addActionListener(new ActionListener()
\r
132 public void actionPerformed(ActionEvent e)
\r
134 outputValues_actionPerformed(e);
\r
137 print.addActionListener(new ActionListener()
\r
139 public void actionPerformed(ActionEvent e)
\r
141 print_actionPerformed(e);
\r
144 viewMenu.setText("View");
\r
145 viewMenu.addMenuListener(new MenuListener()
\r
147 public void menuSelected(MenuEvent e)
\r
149 viewMenu_menuSelected();
\r
152 public void menuDeselected(MenuEvent e)
\r
156 public void menuCanceled(MenuEvent e)
\r
160 showLabels.setText("Show Labels");
\r
161 showLabels.addActionListener(new ActionListener()
\r
163 public void actionPerformed(ActionEvent e)
\r
165 showLabels_actionPerformed(e);
\r
168 print.setText("Print");
\r
169 bgcolour.setText("Background Colour...");
\r
170 bgcolour.addActionListener(new ActionListener()
\r
172 public void actionPerformed(ActionEvent e)
\r
174 bgcolour_actionPerformed(e);
\r
177 originalSeqData.setText("Input Data...");
\r
178 originalSeqData.addActionListener(new ActionListener()
\r
180 public void actionPerformed(ActionEvent e)
\r
182 originalSeqData_actionPerformed(e);
\r
185 associateViewsMenu.setText("Associate Nodes With");
\r
186 this.getContentPane().add(jPanel2, BorderLayout.SOUTH);
\r
187 jPanel2.add(jLabel1, null);
\r
188 jPanel2.add(xCombobox, null);
\r
189 jPanel2.add(jLabel2, null);
\r
190 jPanel2.add(yCombobox, null);
\r
191 jPanel2.add(jLabel3, null);
\r
192 jPanel2.add(zCombobox, null);
\r
193 jMenuBar1.add(fileMenu);
\r
194 jMenuBar1.add(viewMenu);
\r
195 fileMenu.add(saveMenu);
\r
196 fileMenu.add(outputValues);
\r
197 fileMenu.add(print);
\r
198 fileMenu.add(originalSeqData);
\r
201 viewMenu.add(showLabels);
\r
202 viewMenu.add(bgcolour);
\r
203 viewMenu.add(associateViewsMenu);
\r
206 protected void xCombobox_actionPerformed(ActionEvent e)
\r
210 protected void yCombobox_actionPerformed(ActionEvent e)
\r
214 protected void zCombobox_actionPerformed(ActionEvent e)
\r
218 public void eps_actionPerformed(ActionEvent e)
\r
223 public void png_actionPerformed(ActionEvent e)
\r
228 public void outputValues_actionPerformed(ActionEvent e)
\r
233 public void print_actionPerformed(ActionEvent e)
\r
238 public void showLabels_actionPerformed(ActionEvent e)
\r
243 public void bgcolour_actionPerformed(ActionEvent e)
\r
248 public void originalSeqData_actionPerformed(ActionEvent e)
\r
253 public void viewMenu_menuSelected()
\r