imported Vamsas bindings and alpha vamsas client code from VamJalview cvs branch...
[jalview.git] / src / jalview / jbgui / GDesktop.java
1 /*
2 * Jalview - A Sequence Alignment Editor and Viewer
3 * Copyright (C) 2006 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
4 *
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.
9 *
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.
14 *
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
18 */
19 package jalview.jbgui;
20
21 import java.awt.*;
22 import java.awt.event.*;
23
24 import javax.swing.*;
25
26
27 /**
28  * DOCUMENT ME!
29  *
30  * @author $author$
31  * @version $Revision$
32  */
33 public class GDesktop extends JFrame
34 {
35     protected static JMenu windowMenu = new JMenu();
36     JMenuBar DesktopMenubar = new JMenuBar();
37     JMenu FileMenu = new JMenu();
38     JMenu HelpMenu = new JMenu();
39     protected JMenu VamsasMenu = new JMenu();
40     JMenuItem inputLocalFileMenuItem = new JMenuItem();
41     JMenuItem inputURLMenuItem = new JMenuItem();
42     JMenuItem inputTextboxMenuItem = new JMenuItem();
43     JMenuItem quit = new JMenuItem();
44     JMenuItem aboutMenuItem = new JMenuItem();
45     JMenuItem documentationMenuItem = new JMenuItem();
46     FlowLayout flowLayout1 = new FlowLayout();
47     JMenu toolsMenu = new JMenu();
48     JMenuItem preferences = new JMenuItem();
49     JMenuItem saveState = new JMenuItem();
50     JMenuItem loadState = new JMenuItem();
51     JMenu jMenu1 = new JMenu();
52   protected JMenuItem vamsasLoad = new JMenuItem();
53   JMenuItem inputSequence = new JMenuItem();
54   protected JMenuItem vamsasStop = new JMenuItem();
55
56   /**
57      * Creates a new GDesktop object.
58      */
59     public GDesktop()
60     {
61         try
62         {
63             jbInit();
64             this.setJMenuBar(DesktopMenubar);
65         }
66         catch (Exception e)
67         {
68             e.printStackTrace();
69         }
70     }
71
72     /**
73      * DOCUMENT ME!
74      *
75      * @throws Exception DOCUMENT ME!
76      */
77     private void jbInit() throws Exception
78     {
79         FileMenu.setMnemonic('F');
80         FileMenu.setText("File");
81         HelpMenu.setText("Help");
82         VamsasMenu.setText("Vamsas");
83         VamsasMenu.setMnemonic('V');
84         VamsasMenu.setToolTipText("Share data with other vamsas applications.");
85         inputLocalFileMenuItem.setMnemonic('L');
86         inputLocalFileMenuItem.setText("from File");
87         inputLocalFileMenuItem.addActionListener(new java.awt.event.ActionListener()
88             {
89                 public void actionPerformed(ActionEvent e)
90                 {
91                     inputLocalFileMenuItem_actionPerformed(null);
92                 }
93             });
94         inputURLMenuItem.setMnemonic('U');
95         inputURLMenuItem.setText("from URL");
96         inputURLMenuItem.addActionListener(new java.awt.event.ActionListener()
97             {
98                 public void actionPerformed(ActionEvent e)
99                 {
100                     inputURLMenuItem_actionPerformed(null);
101                 }
102             });
103         inputTextboxMenuItem.setMnemonic('C');
104         inputTextboxMenuItem.setText("from Textbox");
105         inputTextboxMenuItem.addActionListener(new java.awt.event.ActionListener()
106             {
107                 public void actionPerformed(ActionEvent e)
108                 {
109                     inputTextboxMenuItem_actionPerformed(null);
110                 }
111             });
112         quit.setMnemonic('Q');
113         quit.setText("Quit");
114         quit.addActionListener(new java.awt.event.ActionListener()
115             {
116                 public void actionPerformed(ActionEvent e)
117                 {
118                     quit();
119                 }
120             });
121         aboutMenuItem.setText("About");
122         aboutMenuItem.addActionListener(new java.awt.event.ActionListener()
123             {
124                 public void actionPerformed(ActionEvent e)
125                 {
126                     aboutMenuItem_actionPerformed(e);
127                 }
128             });
129         documentationMenuItem.setText("Documentation");
130         documentationMenuItem.addActionListener(new java.awt.event.ActionListener()
131             {
132                 public void actionPerformed(ActionEvent e)
133                 {
134                     documentationMenuItem_actionPerformed(e);
135                 }
136             });
137         this.getContentPane().setLayout(flowLayout1);
138         windowMenu.setText("Window");
139         preferences.setText("Preferences...");
140         preferences.addActionListener(new ActionListener()
141             {
142                 public void actionPerformed(ActionEvent e)
143                 {
144                     preferences_actionPerformed(e);
145                 }
146             });
147         toolsMenu.setText("Tools");
148         saveState.setMnemonic('S');
149         saveState.setText("Save Project");
150         saveState.addActionListener(new ActionListener()
151             {
152                 public void actionPerformed(ActionEvent e)
153                 {
154                     saveState_actionPerformed(e);
155                 }
156             });
157         loadState.setMnemonic('L');
158         loadState.setText("Load Project");
159         loadState.addActionListener(new ActionListener()
160             {
161                 public void actionPerformed(ActionEvent e)
162                 {
163                     loadState_actionPerformed(e);
164                 }
165             });
166         jMenu1.setMnemonic('I');
167         jMenu1.setText("Input Alignment");
168     vamsasLoad.setText("Start Vamsas Session...");
169     vamsasLoad.setVisible(false);
170     vamsasLoad.addActionListener(new ActionListener()
171     {
172       public void actionPerformed(ActionEvent e)
173       {
174         vamsasLoad_actionPerformed(e);
175       }
176     });
177     inputSequence.setText("Fetch Sequence(s)...");
178     inputSequence.addActionListener(new ActionListener()
179     {
180       public void actionPerformed(ActionEvent e)
181       {
182         inputSequence_actionPerformed(e);
183       }
184     });
185     vamsasStop.setText("Stop Vamsas Session");
186     vamsasStop.setVisible(false);
187     vamsasStop.addActionListener(new ActionListener()
188     {
189       public void actionPerformed(ActionEvent e)
190       {
191         vamsasStop_actionPerformed(e);
192       }
193     });    DesktopMenubar.add(FileMenu);
194         DesktopMenubar.add(toolsMenu);
195         VamsasMenu.setVisible(false);
196         DesktopMenubar.add(VamsasMenu);
197         DesktopMenubar.add(HelpMenu);
198         DesktopMenubar.add(windowMenu);
199         FileMenu.addSeparator();
200     FileMenu.add(jMenu1);
201     FileMenu.add(inputSequence);
202     FileMenu.addSeparator();
203         FileMenu.add(saveState);
204         FileMenu.add(loadState);
205         FileMenu.addSeparator();
206         FileMenu.add(quit);
207         HelpMenu.add(aboutMenuItem);
208         HelpMenu.add(documentationMenuItem);
209         VamsasMenu.add(vamsasLoad);
210         VamsasMenu.add(vamsasStop);
211         toolsMenu.add(preferences);
212         jMenu1.add(inputLocalFileMenuItem);
213         jMenu1.add(inputURLMenuItem);
214         jMenu1.add(inputTextboxMenuItem);
215         //    jMenu1.add(vamsasLoad);
216   }
217
218     /**
219      * DOCUMENT ME!
220      *
221      * @param e DOCUMENT ME!
222      */
223     protected void inputLocalFileMenuItem_actionPerformed(jalview.gui.AlignViewport av)
224     {
225     }
226
227     /**
228      * DOCUMENT ME!
229      *
230      * @param e DOCUMENT ME!
231      */
232     protected void inputURLMenuItem_actionPerformed(jalview.gui.AlignViewport av)
233     {
234     }
235
236     /**
237      * DOCUMENT ME!
238      *
239      * @param e DOCUMENT ME!
240      */
241     protected void inputTextboxMenuItem_actionPerformed(jalview.gui.AlignViewport av)
242     {
243     }
244
245     /**
246      * DOCUMENT ME!
247      */
248     protected void quit()
249     {
250     }
251
252     /**
253      * DOCUMENT ME!
254      *
255      * @param e DOCUMENT ME!
256      */
257     protected void aboutMenuItem_actionPerformed(ActionEvent e)
258     {
259     }
260
261     /**
262      * DOCUMENT ME!
263      *
264      * @param e DOCUMENT ME!
265      */
266     protected void documentationMenuItem_actionPerformed(ActionEvent e)
267     {
268     }
269
270     /**
271      * DOCUMENT ME!
272      *
273      * @param e DOCUMENT ME!
274      */
275     public void SaveState_actionPerformed(ActionEvent e)
276     {
277     }
278
279     /**
280      * DOCUMENT ME!
281      *
282      * @param e DOCUMENT ME!
283      */
284     protected void preferences_actionPerformed(ActionEvent e)
285     {
286     }
287
288     /**
289      * DOCUMENT ME!
290      *
291      * @param e DOCUMENT ME!
292      */
293     public void saveState_actionPerformed(ActionEvent e)
294     {
295     }
296
297     /**
298      * DOCUMENT ME!
299      *
300      * @param e DOCUMENT ME!
301      */
302     public void loadState_actionPerformed(ActionEvent e)
303     {
304     }
305
306     /**
307      * DOCUMENT ME!
308      *
309      * @param e DOCUMENT ME!
310      */
311     public void loadJalviewAlign_actionPerformed(ActionEvent e)
312     {
313     }
314
315   public void vamsasLoad_actionPerformed(ActionEvent e)
316   {
317
318   }
319
320   public void inputSequence_actionPerformed(ActionEvent e)
321   {
322
323   }
324   public void vamsasStop_actionPerformed(ActionEvent e)
325   {
326
327         }
328 }