From ce0b5bfca6d1d8d0ebf1870d8d741320b721328b Mon Sep 17 00:00:00 2001 From: fourthline Date: Mon, 21 Jul 2014 17:12:54 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=90=E3=83=BC=E3=82=B8=E3=83=A7=E3=83=B3?= =?UTF-8?q?=E6=83=85=E5=A0=B1=E3=81=AE=E8=A1=A8=E7=A4=BA=20#3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- properties/appResource.properties | 4 ++++ properties/appResource_ja.properties | 4 ++++ properties/appResource_ko.properties | 4 ++++ src/fourthline/mabiicco/ActionDispatcher.java | 4 ++++ src/fourthline/mabiicco/AppResource.java | 5 +++++ .../mabiicco/preloader/MabiIccoPreloader.java | 4 +--- src/fourthline/mabiicco/ui/About.java | 18 ++++++++++++++++++ src/fourthline/mabiicco/ui/MainFrame.java | 7 +++++++ 8 files changed, 47 insertions(+), 3 deletions(-) create mode 100644 src/fourthline/mabiicco/ui/About.java diff --git a/properties/appResource.properties b/properties/appResource.properties index 65438fcb..e2c81c52 100644 --- a/properties/appResource.properties +++ b/properties/appResource.properties @@ -76,6 +76,10 @@ menu.next.icon=/img/next.png menu.setting=Setup menu.noteHeight=Note Height +####### menu.help ####### +menu.help=Help +menu.about=About MabiIcco + ####### menu.* ####### menu.inputMML=Input MML menu.outputMML=Output MML diff --git a/properties/appResource_ja.properties b/properties/appResource_ja.properties index 56d89922..0b7d5ba1 100644 --- a/properties/appResource_ja.properties +++ b/properties/appResource_ja.properties @@ -76,6 +76,10 @@ menu.next.icon=/img/next.png menu.setting=設定 menu.noteHeight=ノート表示(高さ) +####### menu.help ####### +menu.help=ヘルプ +menu.about=MabiIccoについて + ####### menu.* ####### menu.inputMML=クリップボードから入力 menu.outputMML=クリップボードへ出力 diff --git a/properties/appResource_ko.properties b/properties/appResource_ko.properties index 65438fcb..e2c81c52 100644 --- a/properties/appResource_ko.properties +++ b/properties/appResource_ko.properties @@ -76,6 +76,10 @@ menu.next.icon=/img/next.png menu.setting=Setup menu.noteHeight=Note Height +####### menu.help ####### +menu.help=Help +menu.about=About MabiIcco + ####### menu.* ####### menu.inputMML=Input MML menu.outputMML=Output MML diff --git a/src/fourthline/mabiicco/ActionDispatcher.java b/src/fourthline/mabiicco/ActionDispatcher.java index 56800f66..cadf64e7 100644 --- a/src/fourthline/mabiicco/ActionDispatcher.java +++ b/src/fourthline/mabiicco/ActionDispatcher.java @@ -18,6 +18,7 @@ import javax.swing.filechooser.FileNameExtensionFilter; import fourthline.mabiicco.midi.MabiDLS; +import fourthline.mabiicco.ui.About; import fourthline.mabiicco.ui.MMLScorePropertyPanel; import fourthline.mabiicco.ui.MMLSeqView; import fourthline.mabiicco.ui.MainFrame; @@ -67,6 +68,7 @@ public class ActionDispatcher implements ActionListener, IFileStateObserver, IEd public static final String REMOVE_MEASURE = "remove_measure"; public static final String NOTE_PROPERTY = "note_property"; public static final String TRANSPOSE = "transpose"; + public static final String ABOUT = "about"; private File openedFile = null; @@ -187,6 +189,8 @@ public void actionPerformed(ActionEvent e) { editState.noteProperty(); } else if (command.equals(TRANSPOSE)) { new MMLTranspose().execute(mainFrame, mmlSeqView); + } else if (command.equals(ABOUT)) { + new About().show(mainFrame); } } diff --git a/src/fourthline/mabiicco/AppResource.java b/src/fourthline/mabiicco/AppResource.java index 93eccfea..48f0bc3a 100644 --- a/src/fourthline/mabiicco/AppResource.java +++ b/src/fourthline/mabiicco/AppResource.java @@ -20,6 +20,11 @@ public class AppResource { private AppResource() {} + public static String getVersionText() { + String versionText = AppResource.getManifestValue("Implementation-Version") + + " build" + AppResource.getBuildNumber(); + return versionText; + } public static String getManifestValue(String key) { if (mf == null) { try { diff --git a/src/fourthline/mabiicco/preloader/MabiIccoPreloader.java b/src/fourthline/mabiicco/preloader/MabiIccoPreloader.java index 2af79146..5223851c 100644 --- a/src/fourthline/mabiicco/preloader/MabiIccoPreloader.java +++ b/src/fourthline/mabiicco/preloader/MabiIccoPreloader.java @@ -18,12 +18,10 @@ public class MabiIccoPreloader extends Preloader { private Stage stage; private Scene createPreloaderScene() throws Exception { - String versionText = AppResource.getManifestValue("Implementation-Version") - + " build" + AppResource.getBuildNumber(); FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("Startup.fxml")); Parent root = (Parent) fxmlLoader.load(); controller = fxmlLoader.getController(); - controller.versionLabel.setText(versionText); + controller.versionLabel.setText(AppResource.getVersionText()); return new Scene(root); } diff --git a/src/fourthline/mabiicco/ui/About.java b/src/fourthline/mabiicco/ui/About.java new file mode 100644 index 00000000..aa1e4e24 --- /dev/null +++ b/src/fourthline/mabiicco/ui/About.java @@ -0,0 +1,18 @@ +/* + * Copyright (C) 2014 たんらる + */ + +package fourthline.mabiicco.ui; + +import java.awt.Frame; +import javax.swing.JOptionPane; + +import fourthline.mabiicco.AppResource; + +public class About { + public void show(Frame parentFrame) { + String title = AppResource.getText("menu.about"); + String text = "Version: " + AppResource.getVersionText(); + JOptionPane.showMessageDialog(parentFrame, text, title, JOptionPane.PLAIN_MESSAGE); + } +} diff --git a/src/fourthline/mabiicco/ui/MainFrame.java b/src/fourthline/mabiicco/ui/MainFrame.java index c75f715c..16f47df9 100644 --- a/src/fourthline/mabiicco/ui/MainFrame.java +++ b/src/fourthline/mabiicco/ui/MainFrame.java @@ -420,6 +420,13 @@ private JMenuBar createMenuBar() { menuBar.add(settingMenu); createNoteHeightMenu(settingMenu); + /************************* Help Menu *************************/ + JMenu helpMenu = new JMenu(text("menu.help")); + menuBar.add(helpMenu); + + JMenuItem aboutMenuItem = createMenuItem(text("menu.about"), ActionDispatcher.ABOUT); + helpMenu.add(aboutMenuItem); + return menuBar; }