2 * Jalview - A Sequence Alignment Editor and Viewer
\r
3 * Copyright (C) 2005 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
24 import javax.swing.*;
\r
31 * @version $Revision$
\r
33 public class GDesktop extends JFrame
\r
35 protected static JMenu windowMenu = new JMenu();
\r
36 JMenuBar DesktopMenubar = new JMenuBar();
\r
37 JMenu FileMenu = new JMenu();
\r
38 JMenu HelpMenu = new JMenu();
\r
39 JMenuItem inputLocalFileMenuItem = new JMenuItem();
\r
40 JMenuItem inputURLMenuItem = new JMenuItem();
\r
41 JMenuItem inputTextboxMenuItem = new JMenuItem();
\r
42 JMenuItem quit = new JMenuItem();
\r
43 JMenuItem aboutMenuItem = new JMenuItem();
\r
44 JMenuItem documentationMenuItem = new JMenuItem();
\r
45 FlowLayout flowLayout1 = new FlowLayout();
\r
46 JMenu toolsMenu = new JMenu();
\r
47 JMenuItem preferences = new JMenuItem();
\r
48 JMenuItem saveState = new JMenuItem();
\r
49 JMenuItem loadState = new JMenuItem();
\r
50 JMenu jMenu1 = new JMenu();
\r
51 JMenuItem vamsasLoad = new JMenuItem();
\r
52 JMenuItem inputSequence = new JMenuItem();
\r
55 * Creates a new GDesktop object.
\r
62 this.setJMenuBar(DesktopMenubar);
\r
66 e.printStackTrace();
\r
73 * @throws Exception DOCUMENT ME!
\r
75 private void jbInit() throws Exception
\r
77 FileMenu.setMnemonic('F');
\r
78 FileMenu.setText("File");
\r
79 HelpMenu.setText("Help");
\r
80 inputLocalFileMenuItem.setMnemonic('L');
\r
81 inputLocalFileMenuItem.setText("from File");
\r
82 inputLocalFileMenuItem.addActionListener(new java.awt.event.ActionListener()
\r
84 public void actionPerformed(ActionEvent e)
\r
86 inputLocalFileMenuItem_actionPerformed(e);
\r
89 inputURLMenuItem.setMnemonic('U');
\r
90 inputURLMenuItem.setText("from URL");
\r
91 inputURLMenuItem.addActionListener(new java.awt.event.ActionListener()
\r
93 public void actionPerformed(ActionEvent e)
\r
95 inputURLMenuItem_actionPerformed(e);
\r
98 inputTextboxMenuItem.setMnemonic('C');
\r
99 inputTextboxMenuItem.setText("from Textbox");
\r
100 inputTextboxMenuItem.addActionListener(new java.awt.event.ActionListener()
\r
102 public void actionPerformed(ActionEvent e)
\r
104 inputTextboxMenuItem_actionPerformed(e);
\r
107 quit.setMnemonic('Q');
\r
108 quit.setText("Quit");
\r
109 quit.addActionListener(new java.awt.event.ActionListener()
\r
111 public void actionPerformed(ActionEvent e)
\r
116 aboutMenuItem.setText("About");
\r
117 aboutMenuItem.addActionListener(new java.awt.event.ActionListener()
\r
119 public void actionPerformed(ActionEvent e)
\r
121 aboutMenuItem_actionPerformed(e);
\r
124 documentationMenuItem.setText("Documentation");
\r
125 documentationMenuItem.addActionListener(new java.awt.event.ActionListener()
\r
127 public void actionPerformed(ActionEvent e)
\r
129 documentationMenuItem_actionPerformed(e);
\r
132 this.getContentPane().setLayout(flowLayout1);
\r
133 windowMenu.setText("Window");
\r
134 preferences.setText("Preferences...");
\r
135 preferences.addActionListener(new ActionListener()
\r
137 public void actionPerformed(ActionEvent e)
\r
139 preferences_actionPerformed(e);
\r
142 toolsMenu.setText("Tools");
\r
143 saveState.setMnemonic('S');
\r
144 saveState.setText("Save Project");
\r
145 saveState.addActionListener(new ActionListener()
\r
147 public void actionPerformed(ActionEvent e)
\r
149 saveState_actionPerformed(e);
\r
152 loadState.setMnemonic('L');
\r
153 loadState.setText("Load Project");
\r
154 loadState.addActionListener(new ActionListener()
\r
156 public void actionPerformed(ActionEvent e)
\r
158 loadState_actionPerformed(e);
\r
161 jMenu1.setMnemonic('I');
\r
162 jMenu1.setText("Input Alignment");
\r
163 vamsasLoad.setText("Vamsas");
\r
164 vamsasLoad.addActionListener(new ActionListener()
\r
166 public void actionPerformed(ActionEvent e)
\r
168 vamsasLoad_actionPerformed(e);
\r
171 inputSequence.setText("Input Sequence...");
\r
172 inputSequence.addActionListener(new ActionListener()
\r
174 public void actionPerformed(ActionEvent e)
\r
176 inputSequence_actionPerformed(e);
\r
179 DesktopMenubar.add(FileMenu);
\r
180 DesktopMenubar.add(toolsMenu);
\r
181 DesktopMenubar.add(HelpMenu);
\r
182 DesktopMenubar.add(windowMenu);
\r
183 FileMenu.addSeparator();
\r
184 FileMenu.add(jMenu1);
\r
185 FileMenu.add(inputSequence);
\r
186 FileMenu.addSeparator();
\r
187 FileMenu.add(saveState);
\r
188 FileMenu.add(loadState);
\r
189 FileMenu.addSeparator();
\r
190 FileMenu.add(quit);
\r
191 HelpMenu.add(aboutMenuItem);
\r
192 HelpMenu.add(documentationMenuItem);
\r
193 toolsMenu.add(preferences);
\r
194 jMenu1.add(inputLocalFileMenuItem);
\r
195 jMenu1.add(inputURLMenuItem);
\r
196 jMenu1.add(inputTextboxMenuItem);
\r
197 jMenu1.add(vamsasLoad);
\r
203 * @param e DOCUMENT ME!
\r
205 protected void inputLocalFileMenuItem_actionPerformed(ActionEvent e)
\r
212 * @param e DOCUMENT ME!
\r
214 protected void inputURLMenuItem_actionPerformed(ActionEvent e)
\r
221 * @param e DOCUMENT ME!
\r
223 protected void inputTextboxMenuItem_actionPerformed(ActionEvent e)
\r
230 protected void quit()
\r
237 * @param e DOCUMENT ME!
\r
239 protected void aboutMenuItem_actionPerformed(ActionEvent e)
\r
246 * @param e DOCUMENT ME!
\r
248 protected void documentationMenuItem_actionPerformed(ActionEvent e)
\r
255 * @param e DOCUMENT ME!
\r
257 public void SaveState_actionPerformed(ActionEvent e)
\r
264 * @param e DOCUMENT ME!
\r
266 protected void preferences_actionPerformed(ActionEvent e)
\r
273 * @param e DOCUMENT ME!
\r
275 public void saveState_actionPerformed(ActionEvent e)
\r
282 * @param e DOCUMENT ME!
\r
284 public void loadState_actionPerformed(ActionEvent e)
\r
291 * @param e DOCUMENT ME!
\r
293 public void loadJalviewAlign_actionPerformed(ActionEvent e)
\r
297 public void vamsasLoad_actionPerformed(ActionEvent e)
\r
302 public void inputSequence_actionPerformed(ActionEvent e)
\r