X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fjbgui%2FGDesktop.java;h=722a4082181424c1942c8ef899898d5d77ce0b97;hb=5d03e861fb4d2846d73a76979cd6f4b94d0f3751;hp=c0b247b4cd1a3d9a910ec4f09c1e756f37edd31c;hpb=9bea55eea55110a19b17d0127903802013fa60ea;p=jalview.git diff --git a/src/jalview/jbgui/GDesktop.java b/src/jalview/jbgui/GDesktop.java index c0b247b..722a408 100755 --- a/src/jalview/jbgui/GDesktop.java +++ b/src/jalview/jbgui/GDesktop.java @@ -1,23 +1,41 @@ -/******************** - * 2004 Jalview Reengineered - * Barton Group - * Dundee University +/* + * Jalview - A Sequence Alignment Editor and Viewer + * Copyright (C) 2007 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle * - * AM Waterhouse - *******************/ - + * 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 + */ package jalview.jbgui; -import javax.swing.*; -import java.awt.event.*; import java.awt.*; +import java.awt.event.*; +import javax.swing.*; - -public class GDesktop extends JFrame +/** + * DOCUMENT ME! + * + * @author $author$ + * @version $Revision$ + */ +public class GDesktop + extends JFrame { - JMenuBar DesktopMenubar = new JMenuBar(); + protected static JMenu windowMenu = new JMenu(); + JMenuBar desktopMenubar = new JMenuBar(); JMenu FileMenu = new JMenu(); JMenu HelpMenu = new JMenu(); + protected JMenu VamsasMenu = new JMenu(); JMenuItem inputLocalFileMenuItem = new JMenuItem(); JMenuItem inputURLMenuItem = new JMenuItem(); JMenuItem inputTextboxMenuItem = new JMenuItem(); @@ -25,61 +43,92 @@ public class GDesktop extends JFrame JMenuItem aboutMenuItem = new JMenuItem(); JMenuItem documentationMenuItem = new JMenuItem(); FlowLayout flowLayout1 = new FlowLayout(); - protected static JMenu windowMenu = new JMenu(); JMenu toolsMenu = new JMenu(); JMenuItem preferences = new JMenuItem(); + JMenuItem saveState = new JMenuItem(); + JMenuItem loadState = new JMenuItem(); + JMenu inputMenu = new JMenu(); + protected JMenuItem vamsasLoad = new JMenuItem(); + JMenuItem inputSequence = new JMenuItem(); + protected JMenuItem vamsasStop = new JMenuItem(); + JMenuItem closeAll = new JMenuItem(); + JMenuItem raiseRelated = new JMenuItem(); + JMenuItem minimizeAssociated = new JMenuItem(); + + /** + * Creates a new GDesktop object. + */ public GDesktop() { try { jbInit(); - this.setJMenuBar(DesktopMenubar); + this.setJMenuBar(desktopMenubar); } - catch(Exception e) + catch (Exception e) { e.printStackTrace(); } + if (!System.getProperty("os.name").startsWith("Mac")) + { + FileMenu.setMnemonic('F'); + inputLocalFileMenuItem.setMnemonic('L'); + VamsasMenu.setMnemonic('V'); + inputURLMenuItem.setMnemonic('U'); + inputTextboxMenuItem.setMnemonic('C'); + quit.setMnemonic('Q'); + saveState.setMnemonic('S'); + loadState.setMnemonic('L'); + inputMenu.setMnemonic('I'); + } } - private void jbInit() throws Exception + + /** + * DOCUMENT ME! + * + * @throws Exception DOCUMENT ME! + */ + private void jbInit() + throws Exception { - FileMenu.setMnemonic('F'); FileMenu.setText("File"); HelpMenu.setText("Help"); - inputLocalFileMenuItem.setMnemonic('L'); - inputLocalFileMenuItem.setText("Input Alignment From Local File"); + VamsasMenu.setText("Vamsas"); + VamsasMenu.setToolTipText("Share data with other vamsas applications."); + 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(e); + inputLocalFileMenuItem_actionPerformed(null); } }); - inputURLMenuItem.setMnemonic('U'); - inputURLMenuItem.setText("Input Alignment From URL"); + inputURLMenuItem.setText("from URL"); inputURLMenuItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { - inputURLMenuItem_actionPerformed(e); + inputURLMenuItem_actionPerformed(null); } }); - inputTextboxMenuItem.setMnemonic('T'); - inputTextboxMenuItem.setText("Input Alignment via Textbox"); + inputTextboxMenuItem.setText("from Textbox"); inputTextboxMenuItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { - inputTextboxMenuItem_actionPerformed(e); + inputTextboxMenuItem_actionPerformed(null); } }); - quit.setMnemonic('Q'); quit.setText("Quit"); quit.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { - quit_actionPerformed(e); + quit(); } }); aboutMenuItem.setText("About"); @@ -91,6 +140,8 @@ public class GDesktop extends JFrame } }); 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) @@ -105,52 +156,231 @@ public class GDesktop extends JFrame { public void actionPerformed(ActionEvent e) { - preferences_actionPerformed(e); } }); toolsMenu.setText("Tools"); - DesktopMenubar.add(FileMenu); - DesktopMenubar.add(toolsMenu); - DesktopMenubar.add(HelpMenu); - DesktopMenubar.add(windowMenu); + saveState.setText("Save Project"); + saveState.addActionListener(new ActionListener() + { + public void actionPerformed(ActionEvent e) + { + saveState_actionPerformed(e); + } + }); + loadState.setText("Load Project"); + loadState.addActionListener(new ActionListener() + { + public void actionPerformed(ActionEvent e) + { + loadState_actionPerformed(e); + } + }); + inputMenu.setText("Input Alignment"); + vamsasLoad.setText("Start Vamsas Session..."); + vamsasLoad.setVisible(false); + vamsasLoad.addActionListener(new ActionListener() + { + public void actionPerformed(ActionEvent e) + { + vamsasLoad_actionPerformed(e); + } + }); + inputSequence.setText("Fetch Sequence(s)..."); + inputSequence.addActionListener(new ActionListener() + { + public void actionPerformed(ActionEvent e) + { + inputSequence_actionPerformed(e); + } + }); + vamsasStop.setText("Stop Vamsas Session"); + vamsasStop.setVisible(false); + vamsasStop.addActionListener(new ActionListener() + { + public void actionPerformed(ActionEvent e) + { + vamsasStop_actionPerformed(e); + } + }); + closeAll.setText("Close All"); + closeAll.addActionListener(new ActionListener() + { + public void actionPerformed(ActionEvent e) + { + closeAll_actionPerformed(e); + } + }); + raiseRelated.setText("Raise Associated Windows"); + raiseRelated.addActionListener(new ActionListener() + { + public void actionPerformed(ActionEvent e) + { + raiseRelated_actionPerformed(e); + } + }); + minimizeAssociated.setText("Minimize Associated Windows"); + minimizeAssociated.addActionListener(new ActionListener() + { + public void actionPerformed(ActionEvent e) + { + minimizeAssociated_actionPerformed(e); + } + }); + desktopMenubar.add(FileMenu); + desktopMenubar.add(toolsMenu); + VamsasMenu.setVisible(false); + desktopMenubar.add(VamsasMenu); + desktopMenubar.add(HelpMenu); + desktopMenubar.add(windowMenu); + FileMenu.add(inputMenu); + FileMenu.add(inputSequence); FileMenu.addSeparator(); - FileMenu.add(inputLocalFileMenuItem); - FileMenu.add(inputURLMenuItem); - FileMenu.add(inputTextboxMenuItem); + FileMenu.add(saveState); + FileMenu.add(loadState); FileMenu.addSeparator(); FileMenu.add(quit); HelpMenu.add(aboutMenuItem); HelpMenu.add(documentationMenuItem); + VamsasMenu.add(vamsasLoad); + VamsasMenu.add(vamsasStop); toolsMenu.add(preferences); - + inputMenu.add(inputLocalFileMenuItem); + inputMenu.add(inputURLMenuItem); + inputMenu.add(inputTextboxMenuItem); + windowMenu.add(closeAll); + windowMenu.add(raiseRelated); + windowMenu.add(minimizeAssociated); + windowMenu.addSeparator(); + // inputMenu.add(vamsasLoad); } - protected void inputLocalFileMenuItem_actionPerformed(ActionEvent e) - { } + /** + * DOCUMENT ME! + * + * @param e DOCUMENT ME! + */ + protected void inputLocalFileMenuItem_actionPerformed(jalview.gui. + AlignViewport av) + { + } - protected void inputURLMenuItem_actionPerformed(ActionEvent e) - { } + /** + * DOCUMENT ME! + * + * @param e DOCUMENT ME! + */ + protected void inputURLMenuItem_actionPerformed(jalview.gui.AlignViewport av) + { + } - protected void inputTextboxMenuItem_actionPerformed(ActionEvent e) - { } + /** + * DOCUMENT ME! + * + * @param e DOCUMENT ME! + */ + protected void inputTextboxMenuItem_actionPerformed(jalview.gui.AlignViewport + av) + { + } - protected void quit_actionPerformed(ActionEvent e) - { } + /** + * DOCUMENT ME! + */ + protected void quit() + { + } + /** + * DOCUMENT ME! + * + * @param e DOCUMENT ME! + */ protected void aboutMenuItem_actionPerformed(ActionEvent e) - { } + { + } + /** + * DOCUMENT ME! + * + * @param e DOCUMENT ME! + */ protected void documentationMenuItem_actionPerformed(ActionEvent e) - { } + { + } + /** + * DOCUMENT ME! + * + * @param e DOCUMENT ME! + */ public void SaveState_actionPerformed(ActionEvent e) { - } + /** + * DOCUMENT ME! + * + * @param e DOCUMENT ME! + */ protected void preferences_actionPerformed(ActionEvent e) { + } + + /** + * DOCUMENT ME! + * + * @param e DOCUMENT ME! + */ + public void saveState_actionPerformed(ActionEvent e) + { + } + + /** + * DOCUMENT ME! + * + * @param e DOCUMENT ME! + */ + public void loadState_actionPerformed(ActionEvent e) + { + } + + /** + * DOCUMENT ME! + * + * @param e DOCUMENT ME! + */ + public void loadJalviewAlign_actionPerformed(ActionEvent e) + { + } + + public void vamsasLoad_actionPerformed(ActionEvent e) + { + + } + + public void inputSequence_actionPerformed(ActionEvent e) + { + + } + + public void vamsasStop_actionPerformed(ActionEvent e) + { + + } + + public void closeAll_actionPerformed(ActionEvent e) + { + + } + + public void raiseRelated_actionPerformed(ActionEvent e) + { + + } + + public void minimizeAssociated_actionPerformed(ActionEvent e) + { } }