]> ruin.nu Git - moosique.git/blobdiff - MooTrackTitle.java
FIXED THE MULTICOLUMN BUG!!!
[moosique.git] / MooTrackTitle.java
index b24931f0cc5cc7907f42461bab4f4dec1dbd94a5..26c9f32d025300d69b4b09864350ad74758b02f9 100644 (file)
@@ -1,6 +1,7 @@
 import javax.swing.*;
 import java.awt.*;
 import java.awt.event.*;
+import javax.sound.midi.*;
 
 /**
  * The title bar for each track with track name, channel, instrument etc.
@@ -9,8 +10,9 @@ import java.awt.event.*;
  * @version 1
  */
  
-public class MooTrackTitle extends JPanel{
+public class MooTrackTitle extends JPanel {
 
+       private JTextField title;
        private MooInstrumentList instruments;
        private JComboBox channel;
        private JCheckBox mute;
@@ -18,8 +20,16 @@ public class MooTrackTitle extends JPanel{
        /** 
         * Creates the title bar.
         */
-       public MooTrackTitle () {
-               setLayout(new GridLayout(3,1));
+       public MooTrackTitle (Track track) {
+               setLayout(new GridLayout(4,1));
+               setBorder(BorderFactory.createLineBorder(Color.black));
+
+               setPreferredSize(new Dimension(202,70));
+               title = new JTextField(); // JTextField(String text, int columns) 
+               title.setFont(Moosique.getGUI().FONT);
+               title.addFocusListener(new TitleFocusListener());
+               add(title);
+
                instruments = new MooInstrumentList();
                add(instruments);
 
@@ -27,7 +37,7 @@ public class MooTrackTitle extends JPanel{
                checkboxes.setLayout(new GridLayout(1,3));
 
                channel = new JComboBox();
-               channel.setFont(new Font("Helvetica", Font.PLAIN, 10));
+               channel.setFont(Moosique.getGUI().FONT);
                for (int i = 1; i <= 16; i++)
                        channel.addItem(new Integer(i));
                channel.addItemListener(new ItemListener(){
@@ -41,7 +51,7 @@ public class MooTrackTitle extends JPanel{
                
 
                mute = new JCheckBox("Mute");
-               mute.setFont(new Font("Helvetica", Font.PLAIN, 10));
+               mute.setFont(Moosique.getGUI().FONT);
                mute.addActionListener(new ActionListener(){
                                public void actionPerformed(ActionEvent event){
                                        //setMute
@@ -50,7 +60,7 @@ public class MooTrackTitle extends JPanel{
                checkboxes.add(mute);
 
                solo = new JCheckBox("Solo");
-               solo.setFont(new Font("Helvetica", Font.PLAIN, 10));
+               solo.setFont(Moosique.getGUI().FONT);
                solo.addActionListener(new ActionListener(){
                                public void actionPerformed(ActionEvent event){
                                        //setSolo
@@ -59,4 +69,10 @@ public class MooTrackTitle extends JPanel{
                checkboxes.add(solo);
                add(checkboxes);
        }
+
+       class TitleFocusListener extends FocusAdapter {
+               public void focusLost(FocusEvent e) {
+                       // Update the MidiEvent containing the title of this track
+               }
+       }
 }