OSDN Git Service

リファクタリング
[midichordhelper/MIDIChordHelper.git] / src / camidion / chordhelper / SongTitleLabel.java
1 package camidion.chordhelper;
2
3 import javax.swing.JLabel;
4
5 import camidion.chordhelper.midieditor.SequenceTrackListTableModel;
6
7 public class SongTitleLabel extends JLabel {
8         public void clear() {
9                 setText("<html>[No MIDI file loaded]</html>");
10         }
11         public void setSongTitle(int songIndex, SequenceTrackListTableModel sequenceModel) {
12                 String title = sequenceModel.toString();
13                 String titleHtml = title.isEmpty()?"[Untitled]":"<font color=maroon>"+title+"</font>";
14                 setText("<html>MIDI file " + songIndex + ": " + titleHtml + "</html>");
15         }
16 }