X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fjbgui%2FGDesktop.java;h=574233740f34521549b7e9bde933d9741d8aea17;hb=f3df97a8d39f8124610d661f8c141677f73d86b0;hp=aa86809d952b82212ccb010b93f68ef6c568c1af;hpb=4f90c01f2b85f6c042ddba89e4dacb8cc2f86881;p=jalview.git diff --git a/src/jalview/jbgui/GDesktop.java b/src/jalview/jbgui/GDesktop.java index aa86809..5742337 100755 --- a/src/jalview/jbgui/GDesktop.java +++ b/src/jalview/jbgui/GDesktop.java @@ -1,20 +1,19 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer - * Copyright (C) 2007 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8) + * Copyright (C) 2012 J Procter, AM Waterhouse, LM Lui, J Engelhardt, G Barton, M Clamp, S Searle + * + * This file is part of Jalview. + * + * Jalview is free software: you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * + * Jalview is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with Jalview. If not, see . */ package jalview.jbgui; @@ -25,42 +24,72 @@ import javax.swing.*; /** * DOCUMENT ME! - * + * * @author $author$ * @version $Revision$ */ -public class GDesktop - extends JFrame +public class GDesktop extends JFrame { protected static JMenu windowMenu = new JMenu(); + JMenuBar desktopMenubar = new JMenuBar(); + JMenu FileMenu = new JMenu(); + JMenu HelpMenu = new JMenu(); + protected JMenu VamsasMenu = new JMenu(); + protected JMenu VamsasStMenu = new JMenu(); + JMenuItem inputLocalFileMenuItem = new JMenuItem(); + JMenuItem inputURLMenuItem = new JMenuItem(); + JMenuItem inputTextboxMenuItem = new JMenuItem(); + JMenuItem quit = new JMenuItem(); + JMenuItem aboutMenuItem = new JMenuItem(); + JMenuItem documentationMenuItem = new JMenuItem(); + FlowLayout flowLayout1 = new FlowLayout(); + protected JMenu toolsMenu = new JMenu(); + JMenuItem preferences = new JMenuItem(); + JMenuItem saveState = new JMenuItem(); + JMenuItem loadState = new JMenuItem(); + JMenu inputMenu = new JMenu(); + protected JMenuItem vamsasStart = new JMenuItem(); + protected JMenuItem vamsasImport = new JMenuItem(); + protected JMenuItem vamsasSave = new JMenuItem(); + JMenuItem inputSequence = new JMenuItem(); + protected JMenuItem vamsasStop = new JMenuItem(); + JMenuItem closeAll = new JMenuItem(); + JMenuItem raiseRelated = new JMenuItem(); + JMenuItem minimizeAssociated = new JMenuItem(); + protected JCheckBoxMenuItem showMemusage = new JCheckBoxMenuItem(); + JMenuItem garbageCollect = new JMenuItem(); + protected JCheckBoxMenuItem showConsole = new JCheckBoxMenuItem(); + + protected JCheckBoxMenuItem showNews = new JCheckBoxMenuItem(); + /** * Creates a new GDesktop object. */ @@ -70,8 +99,7 @@ public class GDesktop { jbInit(); this.setJMenuBar(desktopMenubar); - } - catch (Exception e) + } catch (Exception e) { e.printStackTrace(); } @@ -92,12 +120,13 @@ public class GDesktop /** * DOCUMENT ME! - * - * @throws Exception DOCUMENT ME! + * + * @throws Exception + * DOCUMENT ME! */ - private void jbInit() - throws Exception + private void jbInit() throws Exception { + FileMenu.setText("File"); HelpMenu.setText("Help"); VamsasMenu.setText("Vamsas"); @@ -105,16 +134,17 @@ public class GDesktop VamsasStMenu.setText("Connect to"); VamsasStMenu.setToolTipText("Join an existing vamsas session"); inputLocalFileMenuItem.setText("from File"); - inputLocalFileMenuItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke( - java.awt.event.KeyEvent.VK_O, - Toolkit.getDefaultToolkit().getMenuShortcutKeyMask(), false)); - inputLocalFileMenuItem.addActionListener(new java.awt.event.ActionListener() - { - public void actionPerformed(ActionEvent e) - { - inputLocalFileMenuItem_actionPerformed(null); - } - }); + inputLocalFileMenuItem.setAccelerator(javax.swing.KeyStroke + .getKeyStroke(java.awt.event.KeyEvent.VK_O, Toolkit + .getDefaultToolkit().getMenuShortcutKeyMask(), false)); + inputLocalFileMenuItem + .addActionListener(new java.awt.event.ActionListener() + { + public void actionPerformed(ActionEvent e) + { + inputLocalFileMenuItem_actionPerformed(null); + } + }); inputURLMenuItem.setText("from URL"); inputURLMenuItem.addActionListener(new java.awt.event.ActionListener() { @@ -124,13 +154,14 @@ public class GDesktop } }); inputTextboxMenuItem.setText("from Textbox"); - inputTextboxMenuItem.addActionListener(new java.awt.event.ActionListener() - { - public void actionPerformed(ActionEvent e) - { - inputTextboxMenuItem_actionPerformed(null); - } - }); + inputTextboxMenuItem + .addActionListener(new java.awt.event.ActionListener() + { + public void actionPerformed(ActionEvent e) + { + inputTextboxMenuItem_actionPerformed(null); + } + }); quit.setText("Quit"); quit.addActionListener(new java.awt.event.ActionListener() { @@ -148,15 +179,16 @@ public class GDesktop } }); documentationMenuItem.setText("Documentation"); - documentationMenuItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke( - java.awt.event.KeyEvent.VK_F1, 0, false)); - documentationMenuItem.addActionListener(new java.awt.event.ActionListener() - { - public void actionPerformed(ActionEvent e) - { - documentationMenuItem_actionPerformed(e); - } - }); + documentationMenuItem.setAccelerator(javax.swing.KeyStroke + .getKeyStroke(java.awt.event.KeyEvent.VK_F1, 0, false)); + documentationMenuItem + .addActionListener(new java.awt.event.ActionListener() + { + public void actionPerformed(ActionEvent e) + { + documentationMenuItem_actionPerformed(e); + } + }); this.getContentPane().setLayout(flowLayout1); windowMenu.setText("Window"); preferences.setText("Preferences..."); @@ -269,6 +301,22 @@ public class GDesktop showMemusage_actionPerformed(e); } }); + showConsole.setText("Show Java Console"); + showConsole.addActionListener(new ActionListener() + { + public void actionPerformed(ActionEvent e) + { + showConsole_actionPerformed(e); + } + }); + showNews.setText("Show Jalview News"); + showNews.addActionListener(new ActionListener() + { + public void actionPerformed(ActionEvent e) + { + showNews_actionPerformed(e); + } + }); desktopMenubar.add(FileMenu); desktopMenubar.add(toolsMenu); VamsasMenu.setVisible(false); @@ -292,6 +340,8 @@ public class GDesktop VamsasMenu.add(vamsasStop); toolsMenu.add(preferences); toolsMenu.add(showMemusage); + toolsMenu.add(showConsole); + toolsMenu.add(showNews); toolsMenu.add(garbageCollect); inputMenu.add(inputLocalFileMenuItem); inputMenu.add(inputURLMenuItem); @@ -300,19 +350,31 @@ public class GDesktop windowMenu.add(raiseRelated); windowMenu.add(minimizeAssociated); windowMenu.addSeparator(); - // inputMenu.add(vamsasLoad); + // inputMenu.add(vamsasLoad); + } + + protected void showConsole_actionPerformed(ActionEvent e) + { + // TODO Auto-generated method stub + + } + + protected void showNews_actionPerformed(ActionEvent e) + { + // TODO Auto-generated method stub + } protected void showMemusage_actionPerformed(ActionEvent e) { // TODO Auto-generated method stub - + } protected void garbageCollect_actionPerformed(ActionEvent e) { // TODO Auto-generated method stub - + } protected void vamsasStMenu_actionPerformed() @@ -325,30 +387,34 @@ public class GDesktop /** * DOCUMENT ME! - * - * @param e DOCUMENT ME! + * + * @param e + * DOCUMENT ME! */ - protected void inputLocalFileMenuItem_actionPerformed(jalview.gui. - AlignViewport av) + protected void inputLocalFileMenuItem_actionPerformed( + jalview.gui.AlignViewport av) { } /** * DOCUMENT ME! - * - * @param e DOCUMENT ME! + * + * @param e + * DOCUMENT ME! */ - protected void inputURLMenuItem_actionPerformed(jalview.gui.AlignViewport av) + protected void inputURLMenuItem_actionPerformed( + jalview.gui.AlignViewport av) { } /** * DOCUMENT ME! - * - * @param e DOCUMENT ME! + * + * @param e + * DOCUMENT ME! */ - protected void inputTextboxMenuItem_actionPerformed(jalview.gui.AlignViewport - av) + protected void inputTextboxMenuItem_actionPerformed( + jalview.gui.AlignViewport av) { } @@ -361,8 +427,9 @@ public class GDesktop /** * DOCUMENT ME! - * - * @param e DOCUMENT ME! + * + * @param e + * DOCUMENT ME! */ protected void aboutMenuItem_actionPerformed(ActionEvent e) { @@ -370,8 +437,9 @@ public class GDesktop /** * DOCUMENT ME! - * - * @param e DOCUMENT ME! + * + * @param e + * DOCUMENT ME! */ protected void documentationMenuItem_actionPerformed(ActionEvent e) { @@ -379,8 +447,9 @@ public class GDesktop /** * DOCUMENT ME! - * - * @param e DOCUMENT ME! + * + * @param e + * DOCUMENT ME! */ public void SaveState_actionPerformed(ActionEvent e) { @@ -388,8 +457,9 @@ public class GDesktop /** * DOCUMENT ME! - * - * @param e DOCUMENT ME! + * + * @param e + * DOCUMENT ME! */ protected void preferences_actionPerformed(ActionEvent e) { @@ -397,8 +467,9 @@ public class GDesktop /** * DOCUMENT ME! - * - * @param e DOCUMENT ME! + * + * @param e + * DOCUMENT ME! */ public void saveState_actionPerformed(ActionEvent e) { @@ -406,8 +477,9 @@ public class GDesktop /** * DOCUMENT ME! - * - * @param e DOCUMENT ME! + * + * @param e + * DOCUMENT ME! */ public void loadState_actionPerformed(ActionEvent e) { @@ -415,8 +487,9 @@ public class GDesktop /** * DOCUMENT ME! - * - * @param e DOCUMENT ME! + * + * @param e + * DOCUMENT ME! */ public void loadJalviewAlign_actionPerformed(ActionEvent e) {