Skip to content

Commit

Permalink
バージョン情報の表示 #3
Browse files Browse the repository at this point in the history
  • Loading branch information
fourthline committed Jul 21, 2014
1 parent 5f2b46e commit ce0b5bf
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 3 deletions.
4 changes: 4 additions & 0 deletions properties/appResource.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions properties/appResource_ja.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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=クリップボードへ出力
Expand Down
4 changes: 4 additions & 0 deletions properties/appResource_ko.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions src/fourthline/mabiicco/ActionDispatcher.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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);
}
}

Expand Down
5 changes: 5 additions & 0 deletions src/fourthline/mabiicco/AppResource.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 1 addition & 3 deletions src/fourthline/mabiicco/preloader/MabiIccoPreloader.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
18 changes: 18 additions & 0 deletions src/fourthline/mabiicco/ui/About.java
Original file line number Diff line number Diff line change
@@ -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);
}
}
7 changes: 7 additions & 0 deletions src/fourthline/mabiicco/ui/MainFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit ce0b5bf

Please sign in to comment.