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
53 * Creates a new GDesktop object.
\r
60 this.setJMenuBar(DesktopMenubar);
\r
64 e.printStackTrace();
\r
71 * @throws Exception DOCUMENT ME!
\r
73 private void jbInit() throws Exception
\r
75 FileMenu.setMnemonic('F');
\r
76 FileMenu.setText("File");
\r
77 HelpMenu.setText("Help");
\r
78 inputLocalFileMenuItem.setMnemonic('L');
\r
79 inputLocalFileMenuItem.setText("from File");
\r
80 inputLocalFileMenuItem.addActionListener(new java.awt.event.ActionListener()
\r
82 public void actionPerformed(ActionEvent e)
\r
84 inputLocalFileMenuItem_actionPerformed(e);
\r
87 inputURLMenuItem.setMnemonic('U');
\r
88 inputURLMenuItem.setText("from URL");
\r
89 inputURLMenuItem.addActionListener(new java.awt.event.ActionListener()
\r
91 public void actionPerformed(ActionEvent e)
\r
93 inputURLMenuItem_actionPerformed(e);
\r
96 inputTextboxMenuItem.setMnemonic('C');
\r
97 inputTextboxMenuItem.setText("from Textbox");
\r
98 inputTextboxMenuItem.addActionListener(new java.awt.event.ActionListener()
\r
100 public void actionPerformed(ActionEvent e)
\r
102 inputTextboxMenuItem_actionPerformed(e);
\r
105 quit.setMnemonic('Q');
\r
106 quit.setText("Quit");
\r
107 quit.addActionListener(new java.awt.event.ActionListener()
\r
109 public void actionPerformed(ActionEvent e)
\r
114 aboutMenuItem.setText("About");
\r
115 aboutMenuItem.addActionListener(new java.awt.event.ActionListener()
\r
117 public void actionPerformed(ActionEvent e)
\r
119 aboutMenuItem_actionPerformed(e);
\r
122 documentationMenuItem.setText("Documentation");
\r
123 documentationMenuItem.addActionListener(new java.awt.event.ActionListener()
\r
125 public void actionPerformed(ActionEvent e)
\r
127 documentationMenuItem_actionPerformed(e);
\r
130 this.getContentPane().setLayout(flowLayout1);
\r
131 windowMenu.setText("Window");
\r
132 preferences.setText("Preferences...");
\r
133 preferences.addActionListener(new ActionListener()
\r
135 public void actionPerformed(ActionEvent e)
\r
137 preferences_actionPerformed(e);
\r
140 toolsMenu.setText("Tools");
\r
141 saveState.setMnemonic('S');
\r
142 saveState.setText("Save Project");
\r
143 saveState.addActionListener(new ActionListener()
\r
145 public void actionPerformed(ActionEvent e)
\r
147 saveState_actionPerformed(e);
\r
150 loadState.setMnemonic('L');
\r
151 loadState.setText("Load Project");
\r
152 loadState.addActionListener(new ActionListener()
\r
154 public void actionPerformed(ActionEvent e)
\r
156 loadState_actionPerformed(e);
\r
159 jMenu1.setMnemonic('I');
\r
160 jMenu1.setText("Input Alignment");
\r
161 DesktopMenubar.add(FileMenu);
\r
162 DesktopMenubar.add(toolsMenu);
\r
163 DesktopMenubar.add(HelpMenu);
\r
164 DesktopMenubar.add(windowMenu);
\r
165 FileMenu.addSeparator();
\r
166 FileMenu.add(jMenu1);
\r
167 FileMenu.addSeparator();
\r
168 FileMenu.add(saveState);
\r
169 FileMenu.add(loadState);
\r
170 FileMenu.addSeparator();
\r
171 FileMenu.add(quit);
\r
172 HelpMenu.add(aboutMenuItem);
\r
173 HelpMenu.add(documentationMenuItem);
\r
174 toolsMenu.add(preferences);
\r
175 jMenu1.add(inputLocalFileMenuItem);
\r
176 jMenu1.add(inputURLMenuItem);
\r
177 jMenu1.add(inputTextboxMenuItem);
\r
183 * @param e DOCUMENT ME!
\r
185 protected void inputLocalFileMenuItem_actionPerformed(ActionEvent e)
\r
192 * @param e DOCUMENT ME!
\r
194 protected void inputURLMenuItem_actionPerformed(ActionEvent e)
\r
201 * @param e DOCUMENT ME!
\r
203 protected void inputTextboxMenuItem_actionPerformed(ActionEvent e)
\r
210 protected void quit()
\r
217 * @param e DOCUMENT ME!
\r
219 protected void aboutMenuItem_actionPerformed(ActionEvent e)
\r
226 * @param e DOCUMENT ME!
\r
228 protected void documentationMenuItem_actionPerformed(ActionEvent e)
\r
235 * @param e DOCUMENT ME!
\r
237 public void SaveState_actionPerformed(ActionEvent e)
\r
244 * @param e DOCUMENT ME!
\r
246 protected void preferences_actionPerformed(ActionEvent e)
\r
253 * @param e DOCUMENT ME!
\r
255 public void saveState_actionPerformed(ActionEvent e)
\r
262 * @param e DOCUMENT ME!
\r
264 public void loadState_actionPerformed(ActionEvent e)
\r
271 * @param e DOCUMENT ME!
\r
273 public void loadJalviewAlign_actionPerformed(ActionEvent e)
\r