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
54 * Creates a new GDesktop object.
\r
61 this.setJMenuBar(DesktopMenubar);
\r
65 e.printStackTrace();
\r
72 * @throws Exception DOCUMENT ME!
\r
74 private void jbInit() throws Exception
\r
76 FileMenu.setMnemonic('F');
\r
77 FileMenu.setText("File");
\r
78 HelpMenu.setText("Help");
\r
79 inputLocalFileMenuItem.setMnemonic('L');
\r
80 inputLocalFileMenuItem.setText("from File");
\r
81 inputLocalFileMenuItem.addActionListener(new java.awt.event.ActionListener()
\r
83 public void actionPerformed(ActionEvent e)
\r
85 inputLocalFileMenuItem_actionPerformed(e);
\r
88 inputURLMenuItem.setMnemonic('U');
\r
89 inputURLMenuItem.setText("from URL");
\r
90 inputURLMenuItem.addActionListener(new java.awt.event.ActionListener()
\r
92 public void actionPerformed(ActionEvent e)
\r
94 inputURLMenuItem_actionPerformed(e);
\r
97 inputTextboxMenuItem.setMnemonic('C');
\r
98 inputTextboxMenuItem.setText("from Textbox");
\r
99 inputTextboxMenuItem.addActionListener(new java.awt.event.ActionListener()
\r
101 public void actionPerformed(ActionEvent e)
\r
103 inputTextboxMenuItem_actionPerformed(e);
\r
106 quit.setMnemonic('Q');
\r
107 quit.setText("Quit");
\r
108 quit.addActionListener(new java.awt.event.ActionListener()
\r
110 public void actionPerformed(ActionEvent e)
\r
115 aboutMenuItem.setText("About");
\r
116 aboutMenuItem.addActionListener(new java.awt.event.ActionListener()
\r
118 public void actionPerformed(ActionEvent e)
\r
120 aboutMenuItem_actionPerformed(e);
\r
123 documentationMenuItem.setText("Documentation");
\r
124 documentationMenuItem.addActionListener(new java.awt.event.ActionListener()
\r
126 public void actionPerformed(ActionEvent e)
\r
128 documentationMenuItem_actionPerformed(e);
\r
131 this.getContentPane().setLayout(flowLayout1);
\r
132 windowMenu.setText("Window");
\r
133 preferences.setText("Preferences...");
\r
134 preferences.addActionListener(new ActionListener()
\r
136 public void actionPerformed(ActionEvent e)
\r
138 preferences_actionPerformed(e);
\r
141 toolsMenu.setText("Tools");
\r
142 saveState.setMnemonic('S');
\r
143 saveState.setText("Save Project");
\r
144 saveState.addActionListener(new ActionListener()
\r
146 public void actionPerformed(ActionEvent e)
\r
148 saveState_actionPerformed(e);
\r
151 loadState.setMnemonic('L');
\r
152 loadState.setText("Load Project");
\r
153 loadState.addActionListener(new ActionListener()
\r
155 public void actionPerformed(ActionEvent e)
\r
157 loadState_actionPerformed(e);
\r
160 jMenu1.setMnemonic('I');
\r
161 jMenu1.setText("Input Alignment");
\r
162 vamsasLoad.setText("Vamsas");
\r
163 vamsasLoad.addActionListener(new ActionListener()
\r
165 public void actionPerformed(ActionEvent e)
\r
167 vamsasLoad_actionPerformed(e);
\r
170 DesktopMenubar.add(FileMenu);
\r
171 DesktopMenubar.add(toolsMenu);
\r
172 DesktopMenubar.add(HelpMenu);
\r
173 DesktopMenubar.add(windowMenu);
\r
174 FileMenu.addSeparator();
\r
175 FileMenu.add(jMenu1);
\r
176 FileMenu.addSeparator();
\r
177 FileMenu.add(saveState);
\r
178 FileMenu.add(loadState);
\r
179 FileMenu.addSeparator();
\r
180 FileMenu.add(quit);
\r
181 HelpMenu.add(aboutMenuItem);
\r
182 HelpMenu.add(documentationMenuItem);
\r
183 toolsMenu.add(preferences);
\r
184 jMenu1.add(inputLocalFileMenuItem);
\r
185 jMenu1.add(inputURLMenuItem);
\r
186 jMenu1.add(inputTextboxMenuItem);
\r
187 jMenu1.add(vamsasLoad);
\r
193 * @param e DOCUMENT ME!
\r
195 protected void inputLocalFileMenuItem_actionPerformed(ActionEvent e)
\r
202 * @param e DOCUMENT ME!
\r
204 protected void inputURLMenuItem_actionPerformed(ActionEvent e)
\r
211 * @param e DOCUMENT ME!
\r
213 protected void inputTextboxMenuItem_actionPerformed(ActionEvent e)
\r
220 protected void quit()
\r
227 * @param e DOCUMENT ME!
\r
229 protected void aboutMenuItem_actionPerformed(ActionEvent e)
\r
236 * @param e DOCUMENT ME!
\r
238 protected void documentationMenuItem_actionPerformed(ActionEvent e)
\r
245 * @param e DOCUMENT ME!
\r
247 public void SaveState_actionPerformed(ActionEvent e)
\r
254 * @param e DOCUMENT ME!
\r
256 protected void preferences_actionPerformed(ActionEvent e)
\r
263 * @param e DOCUMENT ME!
\r
265 public void saveState_actionPerformed(ActionEvent e)
\r
272 * @param e DOCUMENT ME!
\r
274 public void loadState_actionPerformed(ActionEvent e)
\r
281 * @param e DOCUMENT ME!
\r
283 public void loadJalviewAlign_actionPerformed(ActionEvent e)
\r
287 public void vamsasLoad_actionPerformed(ActionEvent e)
\r