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(null);
\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(null);
\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(null);
\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.setVisible(false);
\r
165 vamsasLoad.addActionListener(new ActionListener()
\r
167 public void actionPerformed(ActionEvent e)
\r
169 vamsasLoad_actionPerformed(e);
\r
172 inputSequence.setText("Fetch Sequence(s)...");
\r
173 inputSequence.addActionListener(new ActionListener()
\r
175 public void actionPerformed(ActionEvent e)
\r
177 inputSequence_actionPerformed(e);
\r
180 DesktopMenubar.add(FileMenu);
\r
181 DesktopMenubar.add(toolsMenu);
\r
182 DesktopMenubar.add(HelpMenu);
\r
183 DesktopMenubar.add(windowMenu);
\r
184 FileMenu.addSeparator();
\r
185 FileMenu.add(jMenu1);
\r
186 FileMenu.add(inputSequence);
\r
187 FileMenu.addSeparator();
\r
188 FileMenu.add(saveState);
\r
189 FileMenu.add(loadState);
\r
190 FileMenu.addSeparator();
\r
191 FileMenu.add(quit);
\r
192 HelpMenu.add(aboutMenuItem);
\r
193 HelpMenu.add(documentationMenuItem);
\r
194 toolsMenu.add(preferences);
\r
195 jMenu1.add(inputLocalFileMenuItem);
\r
196 jMenu1.add(inputURLMenuItem);
\r
197 jMenu1.add(inputTextboxMenuItem);
\r
198 jMenu1.add(vamsasLoad);
\r
204 * @param e DOCUMENT ME!
\r
206 protected void inputLocalFileMenuItem_actionPerformed(jalview.gui.AlignViewport av)
\r
213 * @param e DOCUMENT ME!
\r
215 protected void inputURLMenuItem_actionPerformed(jalview.gui.AlignViewport av)
\r
222 * @param e DOCUMENT ME!
\r
224 protected void inputTextboxMenuItem_actionPerformed(jalview.gui.AlignViewport av)
\r
231 protected void quit()
\r
238 * @param e DOCUMENT ME!
\r
240 protected void aboutMenuItem_actionPerformed(ActionEvent e)
\r
247 * @param e DOCUMENT ME!
\r
249 protected void documentationMenuItem_actionPerformed(ActionEvent e)
\r
256 * @param e DOCUMENT ME!
\r
258 public void SaveState_actionPerformed(ActionEvent e)
\r
265 * @param e DOCUMENT ME!
\r
267 protected void preferences_actionPerformed(ActionEvent e)
\r
274 * @param e DOCUMENT ME!
\r
276 public void saveState_actionPerformed(ActionEvent e)
\r
283 * @param e DOCUMENT ME!
\r
285 public void loadState_actionPerformed(ActionEvent e)
\r
292 * @param e DOCUMENT ME!
\r
294 public void loadJalviewAlign_actionPerformed(ActionEvent e)
\r
298 public void vamsasLoad_actionPerformed(ActionEvent e)
\r
303 public void inputSequence_actionPerformed(ActionEvent e)
\r