• R/O
  • HTTP
  • SSH
  • HTTPS

MIDIChordHelper: Commit

Javaアプリ MIDI Chord Helper のソースコード


Commit MetaInfo

Revision05385b7c597f96cd7487445ab01e116abd837d69 (tree)
Time2017-05-24 01:23:04
AuthorAkiyoshi Kamide <kamide@yk.r...>
CommiterAkiyoshi Kamide

Log Message

起動直後に「Starting...」画面を表示するようにした

Change Summary

Incremental Difference

--- a/src/camidion/chordhelper/ChordHelperApplet.java
+++ b/src/camidion/chordhelper/ChordHelperApplet.java
@@ -274,7 +274,7 @@ public class ChordHelperApplet extends JApplet {
274274 */
275275 public static class VersionInfo {
276276 public static final String NAME = "MIDI Chord Helper";
277- public static final String VERSION = "Ver.20170518.1";
277+ public static final String VERSION = "Ver.20170523.1";
278278 public static final String COPYRIGHT = "Copyright (C) 2004-2017";
279279 public static final String AUTHER = "@きよし - Akiyoshi Kamide";
280280 public static final String URL = "http://www.yk.rim.or.jp/~kamide/music/chordhelper/";
--- a/src/camidion/chordhelper/MidiChordHelper.java
+++ b/src/camidion/chordhelper/MidiChordHelper.java
@@ -74,31 +74,43 @@ public class MidiChordHelper extends JFrame implements AppletStub, AppletContext
7474 updateFilename(((PlaylistTableModel)event.getSource()).getSequencerModel());
7575 }
7676 private MidiChordHelper(List<File> fileList) {
77- ChordHelperApplet applet = new ChordHelperApplet();
78- add(applet, BorderLayout.CENTER);
79- add(statusBar, BorderLayout.SOUTH);
80- applet.setStub(this);
81- applet.init();
82- setIconImage(applet.getIconImage());
77+ setTitle(ChordHelperApplet.VersionInfo.NAME);
78+ JLabel startingLabel = new JLabel(
79+ "<html>"
80+ +"<div width=300 height=50 style='font-size: 120%; font-style: italic; text-align: center;'>"
81+ +"Starting...</div>"
82+ +"</html>");
83+ add(startingLabel);
8384 pack();
8485 setLocationRelativeTo(null);
85- setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
86- addWindowListener(new WindowAdapter() {
87- @Override
88- public void windowClosing(WindowEvent event) {
89- if( applet.isModified() && ! confirmBeforeExit() ) return;
90- applet.destroy();
91- System.exit(0);
92- }
93- });
94- PlaylistTableModel playlist = applet.midiEditor.getPlaylistModel();
95- MidiSequencerModel sequencer = playlist.getSequencerModel();
96- sequencer.addChangeListener(e->updateFilename((MidiSequencerModel)e.getSource()));
97- playlist.addTableModelListener(e->updateFilename(e));
98- updateFilename(sequencer);
9986 setVisible(true);
100- applet.start();
101- applet.midiEditor.play(fileList);
87+ SwingUtilities.invokeLater(()->{
88+ ChordHelperApplet applet = new ChordHelperApplet();
89+ remove(startingLabel);
90+ add(applet, BorderLayout.CENTER);
91+ add(statusBar, BorderLayout.SOUTH);
92+ applet.setStub(this);
93+ applet.init();
94+ setIconImage(applet.getIconImage());
95+ pack();
96+ setLocationRelativeTo(null);
97+ setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
98+ addWindowListener(new WindowAdapter() {
99+ @Override
100+ public void windowClosing(WindowEvent event) {
101+ if( applet.isModified() && ! confirmBeforeExit() ) return;
102+ applet.destroy();
103+ System.exit(0);
104+ }
105+ });
106+ PlaylistTableModel playlist = applet.midiEditor.getPlaylistModel();
107+ MidiSequencerModel sequencer = playlist.getSequencerModel();
108+ sequencer.addChangeListener(e->updateFilename((MidiSequencerModel)e.getSource()));
109+ playlist.addTableModelListener(e->updateFilename(e));
110+ updateFilename(sequencer);
111+ applet.start();
112+ applet.midiEditor.play(fileList);
113+ });
102114 }
103115 @Override
104116 public boolean isActive() { return true; }
Show on old repository browser