translations: add menu item for launching translation tool
git-svn-id: https://micropolis.googlecode.com/svn/trunk/micropolis-java@658 d9718cc8-9f43-0410-858b-315f434eb58c
This commit is contained in:
parent
b20a0f7e77
commit
237b28ebe7
3 changed files with 35 additions and 0 deletions
|
@ -647,6 +647,14 @@ public class MainWindow extends JFrame
|
||||||
JMenu helpMenu = new JMenu(strings.getString("menu.help"));
|
JMenu helpMenu = new JMenu(strings.getString("menu.help"));
|
||||||
menuBar.add(helpMenu);
|
menuBar.add(helpMenu);
|
||||||
|
|
||||||
|
menuItem = new JMenuItem(strings.getString("menu.help.launch-translation-tool"));
|
||||||
|
menuItem.addActionListener(new ActionListener() {
|
||||||
|
public void actionPerformed(ActionEvent evt)
|
||||||
|
{
|
||||||
|
onLaunchTranslationToolClicked();
|
||||||
|
}});
|
||||||
|
helpMenu.add(menuItem);
|
||||||
|
|
||||||
menuItem = new JMenuItem(strings.getString("menu.help.about"));
|
menuItem = new JMenuItem(strings.getString("menu.help.about"));
|
||||||
menuItem.addActionListener(wrapActionListener(
|
menuItem.addActionListener(wrapActionListener(
|
||||||
new ActionListener() {
|
new ActionListener() {
|
||||||
|
@ -1470,6 +1478,15 @@ public class MainWindow extends JFrame
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void onLaunchTranslationToolClicked()
|
||||||
|
{
|
||||||
|
if (maybeSaveCity()) {
|
||||||
|
dispose();
|
||||||
|
TranslationTool tt = new TranslationTool();
|
||||||
|
tt.setVisible(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void onAboutClicked()
|
private void onAboutClicked()
|
||||||
{
|
{
|
||||||
String version = getClass().getPackage().getImplementationVersion();
|
String version = getClass().getPackage().getImplementationVersion();
|
||||||
|
|
17
src/micropolisj/gui/TranslationTool.java
Normal file
17
src/micropolisj/gui/TranslationTool.java
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
package micropolisj.gui;
|
||||||
|
|
||||||
|
import java.awt.*;
|
||||||
|
import javax.swing.*;
|
||||||
|
|
||||||
|
public class TranslationTool extends JFrame
|
||||||
|
{
|
||||||
|
public TranslationTool()
|
||||||
|
{
|
||||||
|
JButton btn = new JButton("Hello World!");
|
||||||
|
add(btn, BorderLayout.CENTER);
|
||||||
|
|
||||||
|
pack();
|
||||||
|
setLocationRelativeTo(null);
|
||||||
|
setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
|
||||||
|
}
|
||||||
|
}
|
|
@ -107,6 +107,7 @@ menu.windows.evaluation = Evaluation
|
||||||
menu.windows.graph = Graph
|
menu.windows.graph = Graph
|
||||||
|
|
||||||
menu.help = Help
|
menu.help = Help
|
||||||
|
menu.help.launch-translation-tool = Launch Translation Tool
|
||||||
menu.help.about = About
|
menu.help.about = About
|
||||||
|
|
||||||
!
|
!
|
||||||
|
|
Reference in a new issue