X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fjbgui%2FGDesktop.java;h=51b40139a1911f335d7659d969ba24a7a2c76a86;hb=a8f483d04205bb8273ee311c12968b7e86d205fa;hp=a8e2ef5aebdc4f9923380d3482a969af73f99d38;hpb=506d60f0e188723ddc91c26824b41ac7034df3fe;p=jalview.git diff --git a/src/jalview/jbgui/GDesktop.java b/src/jalview/jbgui/GDesktop.java index a8e2ef5..51b4013 100755 --- a/src/jalview/jbgui/GDesktop.java +++ b/src/jalview/jbgui/GDesktop.java @@ -1,23 +1,25 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer (Version 2.4) - * Copyright (C) 2008 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle + * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2) + * Copyright (C) 2014 The Jalview Authors * - * 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 file is part of Jalview. * - * 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. + * 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 this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * You should have received a copy of the GNU General Public License along with Jalview. If not, see . + * The Jalview Authors are detailed in the 'AUTHORS' file. */ package jalview.jbgui; +import jalview.util.MessageManager; + import java.awt.*; import java.awt.event.*; @@ -87,6 +89,10 @@ public class GDesktop extends JFrame JMenuItem garbageCollect = new JMenuItem(); + protected JCheckBoxMenuItem showConsole = new JCheckBoxMenuItem(); + + protected JCheckBoxMenuItem showNews = new JCheckBoxMenuItem(); + /** * Creates a new GDesktop object. */ @@ -119,17 +125,18 @@ public class GDesktop extends JFrame * DOCUMENT ME! * * @throws Exception - * DOCUMENT ME! + * DOCUMENT ME! */ private void jbInit() throws Exception { - FileMenu.setText("File"); - HelpMenu.setText("Help"); + + FileMenu.setText(MessageManager.getString("action.file")); + HelpMenu.setText(MessageManager.getString("action.help")); VamsasMenu.setText("Vamsas"); - VamsasMenu.setToolTipText("Share data with other vamsas applications."); - VamsasStMenu.setText("Connect to"); - VamsasStMenu.setToolTipText("Join an existing vamsas session"); - inputLocalFileMenuItem.setText("from File"); + VamsasMenu.setToolTipText(MessageManager.getString("label.share_data_vamsas_applications")); + VamsasStMenu.setText(MessageManager.getString("label.connect_to")); + VamsasStMenu.setToolTipText(MessageManager.getString("label.join_existing_vamsas_session")); + inputLocalFileMenuItem.setText(MessageManager.getString("label.load_tree_from_file")); inputLocalFileMenuItem.setAccelerator(javax.swing.KeyStroke .getKeyStroke(java.awt.event.KeyEvent.VK_O, Toolkit .getDefaultToolkit().getMenuShortcutKeyMask(), false)); @@ -141,7 +148,7 @@ public class GDesktop extends JFrame inputLocalFileMenuItem_actionPerformed(null); } }); - inputURLMenuItem.setText("from URL"); + inputURLMenuItem.setText(MessageManager.getString("label.from_url")); inputURLMenuItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) @@ -149,7 +156,7 @@ public class GDesktop extends JFrame inputURLMenuItem_actionPerformed(null); } }); - inputTextboxMenuItem.setText("from Textbox"); + inputTextboxMenuItem.setText(MessageManager.getString("label.from_textbox")); inputTextboxMenuItem .addActionListener(new java.awt.event.ActionListener() { @@ -158,7 +165,7 @@ public class GDesktop extends JFrame inputTextboxMenuItem_actionPerformed(null); } }); - quit.setText("Quit"); + quit.setText(MessageManager.getString("action.quit")); quit.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) @@ -166,7 +173,7 @@ public class GDesktop extends JFrame quit(); } }); - aboutMenuItem.setText("About"); + aboutMenuItem.setText(MessageManager.getString("label.about")); aboutMenuItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) @@ -174,7 +181,7 @@ public class GDesktop extends JFrame aboutMenuItem_actionPerformed(e); } }); - documentationMenuItem.setText("Documentation"); + documentationMenuItem.setText(MessageManager.getString("label.documentation")); documentationMenuItem.setAccelerator(javax.swing.KeyStroke .getKeyStroke(java.awt.event.KeyEvent.VK_F1, 0, false)); documentationMenuItem @@ -186,8 +193,8 @@ public class GDesktop extends JFrame } }); this.getContentPane().setLayout(flowLayout1); - windowMenu.setText("Window"); - preferences.setText("Preferences..."); + windowMenu.setText(MessageManager.getString("label.window")); + preferences.setText(MessageManager.getString("label.preferences") + "..."); preferences.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) @@ -195,8 +202,8 @@ public class GDesktop extends JFrame preferences_actionPerformed(e); } }); - toolsMenu.setText("Tools"); - saveState.setText("Save Project"); + toolsMenu.setText(MessageManager.getString("label.tools")); + saveState.setText(MessageManager.getString("action.save_project")); saveState.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) @@ -204,7 +211,7 @@ public class GDesktop extends JFrame saveState_actionPerformed(e); } }); - loadState.setText("Load Project"); + loadState.setText(MessageManager.getString("action.load_project")); loadState.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) @@ -212,8 +219,8 @@ public class GDesktop extends JFrame loadState_actionPerformed(e); } }); - inputMenu.setText("Input Alignment"); - vamsasStart.setText("New Vamsas Session..."); + inputMenu.setText(MessageManager.getString("label.input_alignment")); + vamsasStart.setText(MessageManager.getString("label.new_vamsas_session") + "..."); vamsasStart.setVisible(false); vamsasStart.addActionListener(new ActionListener() { @@ -222,7 +229,7 @@ public class GDesktop extends JFrame vamsasStart_actionPerformed(e); } }); - vamsasImport.setText("Load Vamsas Session..."); + vamsasImport.setText(MessageManager.getString("label.load_vamsas_session") + "..."); vamsasImport.setVisible(false); vamsasImport.addActionListener(new ActionListener() { @@ -231,7 +238,7 @@ public class GDesktop extends JFrame vamsasImport_actionPerformed(e); } }); - vamsasSave.setText("Save Vamsas Session..."); + vamsasSave.setText(MessageManager.getString("label.save_vamsas_session") + "..."); vamsasSave.setVisible(false); vamsasSave.addActionListener(new ActionListener() { @@ -240,7 +247,7 @@ public class GDesktop extends JFrame vamsasSave_actionPerformed(e); } }); - inputSequence.setText("Fetch Sequence(s)..."); + inputSequence.setText(MessageManager.getString("label.fetch_sequences") + "..."); inputSequence.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) @@ -248,7 +255,7 @@ public class GDesktop extends JFrame inputSequence_actionPerformed(e); } }); - vamsasStop.setText("Stop Vamsas Session"); + vamsasStop.setText(MessageManager.getString("label.stop_vamsas_session")); vamsasStop.setVisible(false); vamsasStop.addActionListener(new ActionListener() { @@ -257,7 +264,7 @@ public class GDesktop extends JFrame vamsasStop_actionPerformed(e); } }); - closeAll.setText("Close All"); + closeAll.setText(MessageManager.getString("action.close_all")); closeAll.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) @@ -265,7 +272,7 @@ public class GDesktop extends JFrame closeAll_actionPerformed(e); } }); - raiseRelated.setText("Raise Associated Windows"); + raiseRelated.setText(MessageManager.getString("action.raise_associated_windows")); raiseRelated.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) @@ -273,7 +280,7 @@ public class GDesktop extends JFrame raiseRelated_actionPerformed(e); } }); - minimizeAssociated.setText("Minimize Associated Windows"); + minimizeAssociated.setText(MessageManager.getString("action.minimize_associated_windows")); minimizeAssociated.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) @@ -281,7 +288,7 @@ public class GDesktop extends JFrame minimizeAssociated_actionPerformed(e); } }); - garbageCollect.setText("Collect Garbage"); + garbageCollect.setText(MessageManager.getString("label.collect_garbage")); garbageCollect.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) @@ -289,7 +296,7 @@ public class GDesktop extends JFrame garbageCollect_actionPerformed(e); } }); - showMemusage.setText("Show Memory Usage"); + showMemusage.setText(MessageManager.getString("label.show_memory_usage")); showMemusage.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) @@ -297,6 +304,22 @@ public class GDesktop extends JFrame showMemusage_actionPerformed(e); } }); + showConsole.setText(MessageManager.getString("label.show_java_console")); + showConsole.addActionListener(new ActionListener() + { + public void actionPerformed(ActionEvent e) + { + showConsole_actionPerformed(e); + } + }); + showNews.setText(MessageManager.getString("label.show_jalview_news")); + showNews.addActionListener(new ActionListener() + { + public void actionPerformed(ActionEvent e) + { + showNews_actionPerformed(e); + } + }); desktopMenubar.add(FileMenu); desktopMenubar.add(toolsMenu); VamsasMenu.setVisible(false); @@ -320,6 +343,8 @@ public class GDesktop extends JFrame VamsasMenu.add(vamsasStop); toolsMenu.add(preferences); toolsMenu.add(showMemusage); + toolsMenu.add(showConsole); + toolsMenu.add(showNews); toolsMenu.add(garbageCollect); inputMenu.add(inputLocalFileMenuItem); inputMenu.add(inputURLMenuItem); @@ -331,6 +356,18 @@ public class GDesktop extends JFrame // 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 @@ -355,7 +392,7 @@ public class GDesktop extends JFrame * DOCUMENT ME! * * @param e - * DOCUMENT ME! + * DOCUMENT ME! */ protected void inputLocalFileMenuItem_actionPerformed( jalview.gui.AlignViewport av) @@ -366,7 +403,7 @@ public class GDesktop extends JFrame * DOCUMENT ME! * * @param e - * DOCUMENT ME! + * DOCUMENT ME! */ protected void inputURLMenuItem_actionPerformed( jalview.gui.AlignViewport av) @@ -377,7 +414,7 @@ public class GDesktop extends JFrame * DOCUMENT ME! * * @param e - * DOCUMENT ME! + * DOCUMENT ME! */ protected void inputTextboxMenuItem_actionPerformed( jalview.gui.AlignViewport av) @@ -395,7 +432,7 @@ public class GDesktop extends JFrame * DOCUMENT ME! * * @param e - * DOCUMENT ME! + * DOCUMENT ME! */ protected void aboutMenuItem_actionPerformed(ActionEvent e) { @@ -405,7 +442,7 @@ public class GDesktop extends JFrame * DOCUMENT ME! * * @param e - * DOCUMENT ME! + * DOCUMENT ME! */ protected void documentationMenuItem_actionPerformed(ActionEvent e) { @@ -415,7 +452,7 @@ public class GDesktop extends JFrame * DOCUMENT ME! * * @param e - * DOCUMENT ME! + * DOCUMENT ME! */ public void SaveState_actionPerformed(ActionEvent e) { @@ -425,7 +462,7 @@ public class GDesktop extends JFrame * DOCUMENT ME! * * @param e - * DOCUMENT ME! + * DOCUMENT ME! */ protected void preferences_actionPerformed(ActionEvent e) { @@ -435,7 +472,7 @@ public class GDesktop extends JFrame * DOCUMENT ME! * * @param e - * DOCUMENT ME! + * DOCUMENT ME! */ public void saveState_actionPerformed(ActionEvent e) { @@ -445,7 +482,7 @@ public class GDesktop extends JFrame * DOCUMENT ME! * * @param e - * DOCUMENT ME! + * DOCUMENT ME! */ public void loadState_actionPerformed(ActionEvent e) { @@ -455,7 +492,7 @@ public class GDesktop extends JFrame * DOCUMENT ME! * * @param e - * DOCUMENT ME! + * DOCUMENT ME! */ public void loadJalviewAlign_actionPerformed(ActionEvent e) {