2 * Jalview - A Sequence Alignment Editor and Viewer
3 * Copyright (C) 2007 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
19 package jalview.jbgui;
22 import java.awt.event.*;
34 protected static JMenu windowMenu = new JMenu();
35 JMenuBar desktopMenubar = new JMenuBar();
36 JMenu FileMenu = new JMenu();
37 JMenu HelpMenu = new JMenu();
38 protected JMenu VamsasMenu = new JMenu();
39 JMenuItem inputLocalFileMenuItem = new JMenuItem();
40 JMenuItem inputURLMenuItem = new JMenuItem();
41 JMenuItem inputTextboxMenuItem = new JMenuItem();
42 JMenuItem quit = new JMenuItem();
43 JMenuItem aboutMenuItem = new JMenuItem();
44 JMenuItem documentationMenuItem = new JMenuItem();
45 FlowLayout flowLayout1 = new FlowLayout();
46 protected JMenu toolsMenu = new JMenu();
47 JMenuItem preferences = new JMenuItem();
48 JMenuItem saveState = new JMenuItem();
49 JMenuItem loadState = new JMenuItem();
50 JMenu inputMenu = new JMenu();
51 protected JMenuItem vamsasLoad = new JMenuItem();
52 JMenuItem inputSequence = new JMenuItem();
53 protected JMenuItem vamsasStop = new JMenuItem();
54 JMenuItem closeAll = new JMenuItem();
55 JMenuItem raiseRelated = new JMenuItem();
56 JMenuItem minimizeAssociated = new JMenuItem();
59 * Creates a new GDesktop object.
66 this.setJMenuBar(desktopMenubar);
73 if (!System.getProperty("os.name").startsWith("Mac"))
75 FileMenu.setMnemonic('F');
76 inputLocalFileMenuItem.setMnemonic('L');
77 VamsasMenu.setMnemonic('V');
78 inputURLMenuItem.setMnemonic('U');
79 inputTextboxMenuItem.setMnemonic('C');
80 quit.setMnemonic('Q');
81 saveState.setMnemonic('S');
82 loadState.setMnemonic('L');
83 inputMenu.setMnemonic('I');
90 * @throws Exception DOCUMENT ME!
95 FileMenu.setText("File");
96 HelpMenu.setText("Help");
97 VamsasMenu.setText("Vamsas");
98 VamsasMenu.setToolTipText("Share data with other vamsas applications.");
99 inputLocalFileMenuItem.setText("from File");
100 inputLocalFileMenuItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(
101 java.awt.event.KeyEvent.VK_O,
102 Toolkit.getDefaultToolkit().getMenuShortcutKeyMask(), false));
103 inputLocalFileMenuItem.addActionListener(new java.awt.event.ActionListener()
105 public void actionPerformed(ActionEvent e)
107 inputLocalFileMenuItem_actionPerformed(null);
110 inputURLMenuItem.setText("from URL");
111 inputURLMenuItem.addActionListener(new java.awt.event.ActionListener()
113 public void actionPerformed(ActionEvent e)
115 inputURLMenuItem_actionPerformed(null);
118 inputTextboxMenuItem.setText("from Textbox");
119 inputTextboxMenuItem.addActionListener(new java.awt.event.ActionListener()
121 public void actionPerformed(ActionEvent e)
123 inputTextboxMenuItem_actionPerformed(null);
126 quit.setText("Quit");
127 quit.addActionListener(new java.awt.event.ActionListener()
129 public void actionPerformed(ActionEvent e)
134 aboutMenuItem.setText("About");
135 aboutMenuItem.addActionListener(new java.awt.event.ActionListener()
137 public void actionPerformed(ActionEvent e)
139 aboutMenuItem_actionPerformed(e);
142 documentationMenuItem.setText("Documentation");
143 documentationMenuItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(
144 java.awt.event.KeyEvent.VK_F1, 0, false));
145 documentationMenuItem.addActionListener(new java.awt.event.ActionListener()
147 public void actionPerformed(ActionEvent e)
149 documentationMenuItem_actionPerformed(e);
152 this.getContentPane().setLayout(flowLayout1);
153 windowMenu.setText("Window");
154 preferences.setText("Preferences...");
155 preferences.addActionListener(new ActionListener()
157 public void actionPerformed(ActionEvent e)
159 preferences_actionPerformed(e);
162 toolsMenu.setText("Tools");
163 saveState.setText("Save Project");
164 saveState.addActionListener(new ActionListener()
166 public void actionPerformed(ActionEvent e)
168 saveState_actionPerformed(e);
171 loadState.setText("Load Project");
172 loadState.addActionListener(new ActionListener()
174 public void actionPerformed(ActionEvent e)
176 loadState_actionPerformed(e);
179 inputMenu.setText("Input Alignment");
180 vamsasLoad.setText("Start Vamsas Session...");
181 vamsasLoad.setVisible(false);
182 vamsasLoad.addActionListener(new ActionListener()
184 public void actionPerformed(ActionEvent e)
186 vamsasLoad_actionPerformed(e);
189 inputSequence.setText("Fetch Sequence(s)...");
190 inputSequence.addActionListener(new ActionListener()
192 public void actionPerformed(ActionEvent e)
194 inputSequence_actionPerformed(e);
197 vamsasStop.setText("Stop Vamsas Session");
198 vamsasStop.setVisible(false);
199 vamsasStop.addActionListener(new ActionListener()
201 public void actionPerformed(ActionEvent e)
203 vamsasStop_actionPerformed(e);
206 closeAll.setText("Close All");
207 closeAll.addActionListener(new ActionListener()
209 public void actionPerformed(ActionEvent e)
211 closeAll_actionPerformed(e);
214 raiseRelated.setText("Raise Associated Windows");
215 raiseRelated.addActionListener(new ActionListener()
217 public void actionPerformed(ActionEvent e)
219 raiseRelated_actionPerformed(e);
222 minimizeAssociated.setText("Minimize Associated Windows");
223 minimizeAssociated.addActionListener(new ActionListener()
225 public void actionPerformed(ActionEvent e)
227 minimizeAssociated_actionPerformed(e);
230 desktopMenubar.add(FileMenu);
231 desktopMenubar.add(toolsMenu);
232 VamsasMenu.setVisible(false);
233 desktopMenubar.add(VamsasMenu);
234 desktopMenubar.add(HelpMenu);
235 desktopMenubar.add(windowMenu);
236 FileMenu.add(inputMenu);
237 FileMenu.add(inputSequence);
238 FileMenu.addSeparator();
239 FileMenu.add(saveState);
240 FileMenu.add(loadState);
241 FileMenu.addSeparator();
243 HelpMenu.add(aboutMenuItem);
244 HelpMenu.add(documentationMenuItem);
245 VamsasMenu.add(vamsasLoad);
246 VamsasMenu.add(vamsasStop);
247 toolsMenu.add(preferences);
248 inputMenu.add(inputLocalFileMenuItem);
249 inputMenu.add(inputURLMenuItem);
250 inputMenu.add(inputTextboxMenuItem);
251 windowMenu.add(closeAll);
252 windowMenu.add(raiseRelated);
253 windowMenu.add(minimizeAssociated);
254 windowMenu.addSeparator();
255 // inputMenu.add(vamsasLoad);
261 * @param e DOCUMENT ME!
263 protected void inputLocalFileMenuItem_actionPerformed(jalview.gui.
271 * @param e DOCUMENT ME!
273 protected void inputURLMenuItem_actionPerformed(jalview.gui.AlignViewport av)
280 * @param e DOCUMENT ME!
282 protected void inputTextboxMenuItem_actionPerformed(jalview.gui.AlignViewport
290 protected void quit()
297 * @param e DOCUMENT ME!
299 protected void aboutMenuItem_actionPerformed(ActionEvent e)
306 * @param e DOCUMENT ME!
308 protected void documentationMenuItem_actionPerformed(ActionEvent e)
315 * @param e DOCUMENT ME!
317 public void SaveState_actionPerformed(ActionEvent e)
324 * @param e DOCUMENT ME!
326 protected void preferences_actionPerformed(ActionEvent e)
333 * @param e DOCUMENT ME!
335 public void saveState_actionPerformed(ActionEvent e)
342 * @param e DOCUMENT ME!
344 public void loadState_actionPerformed(ActionEvent e)
351 * @param e DOCUMENT ME!
353 public void loadJalviewAlign_actionPerformed(ActionEvent e)
357 public void vamsasLoad_actionPerformed(ActionEvent e)
362 public void inputSequence_actionPerformed(ActionEvent e)
367 public void vamsasStop_actionPerformed(ActionEvent e)
372 public void closeAll_actionPerformed(ActionEvent e)
377 public void raiseRelated_actionPerformed(ActionEvent e)
382 public void minimizeAssociated_actionPerformed(ActionEvent e)