X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fjbgui%2FGDesktop.java;h=4751d25cdb79adad4fada6c4b0da77eb7d085158;hb=4935082f08648ab92743e14e5e2dfefa3e0dcd4d;hp=302e0ca0bfa50b12f2a74d23b47f5ab556981274;hpb=d423f22792e47dbc800ae220a58677f988971d06;p=jalview.git diff --git a/src/jalview/jbgui/GDesktop.java b/src/jalview/jbgui/GDesktop.java index 302e0ca..4751d25 100755 --- a/src/jalview/jbgui/GDesktop.java +++ b/src/jalview/jbgui/GDesktop.java @@ -1,22 +1,27 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5) - * Copyright (C) 2010 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle + * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2) + * Copyright (C) 2014 The Jalview Authors * * 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. - * + * 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 . + * 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.*; @@ -63,7 +68,7 @@ public class GDesktop extends JFrame JMenuItem saveState = new JMenuItem(); JMenuItem loadState = new JMenuItem(); - + JMenu inputMenu = new JMenu(); protected JMenuItem vamsasStart = new JMenuItem(); @@ -88,6 +93,9 @@ public class GDesktop extends JFrame protected JCheckBoxMenuItem showConsole = new JCheckBoxMenuItem(); + protected JCheckBoxMenuItem showNews = new JCheckBoxMenuItem(); + + protected JMenuItem snapShotWindow = new JMenuItem(); /** * Creates a new GDesktop object. */ @@ -124,13 +132,17 @@ public class GDesktop extends JFrame */ 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)); @@ -142,7 +154,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) @@ -150,7 +162,8 @@ 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() { @@ -159,7 +172,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) @@ -167,7 +180,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) @@ -175,7 +188,8 @@ 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 @@ -187,8 +201,9 @@ 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) @@ -196,8 +211,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) @@ -205,7 +220,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) @@ -213,8 +228,9 @@ 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() { @@ -223,7 +239,8 @@ 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() { @@ -232,7 +249,8 @@ 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() { @@ -241,7 +259,8 @@ 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) @@ -249,7 +268,8 @@ 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() { @@ -258,7 +278,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) @@ -266,7 +286,8 @@ 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) @@ -274,7 +295,8 @@ 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) @@ -282,7 +304,8 @@ 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) @@ -290,7 +313,8 @@ 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) @@ -298,7 +322,8 @@ public class GDesktop extends JFrame showMemusage_actionPerformed(e); } }); - showConsole.setText("Show Java Console"); + showConsole + .setText(MessageManager.getString("label.show_java_console")); showConsole.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) @@ -306,6 +331,23 @@ public class GDesktop extends JFrame showConsole_actionPerformed(e); } }); + showNews.setText(MessageManager.getString("label.show_jalview_news")); + showNews.addActionListener(new ActionListener() + { + public void actionPerformed(ActionEvent e) + { + showNews_actionPerformed(e); + } + }); + snapShotWindow.setText(MessageManager.getString("label.take_snapshot")); + snapShotWindow.addActionListener(new ActionListener() + { + public void actionPerformed(ActionEvent e) + { + snapShotWindow_actionPerformed(e); + } + }); + desktopMenubar.add(FileMenu); desktopMenubar.add(toolsMenu); VamsasMenu.setVisible(false); @@ -330,7 +372,9 @@ public class GDesktop extends JFrame toolsMenu.add(preferences); toolsMenu.add(showMemusage); toolsMenu.add(showConsole); + toolsMenu.add(showNews); toolsMenu.add(garbageCollect); + toolsMenu.add(snapShotWindow); inputMenu.add(inputLocalFileMenuItem); inputMenu.add(inputURLMenuItem); inputMenu.add(inputTextboxMenuItem); @@ -341,12 +385,24 @@ public class GDesktop extends JFrame // inputMenu.add(vamsasLoad); } + protected void snapShotWindow_actionPerformed(ActionEvent e) + { + // TODO Auto-generated method stub + + } + 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