]> ruin.nu Git - moosique.git/blob - MooTrackTitle.java
getting more and more ready..
[moosique.git] / MooTrackTitle.java
1 import javax.swing.*;
2 import java.awt.*;
3 import java.awt.event.*;
4
5 /**
6  * The title bar for each track with track name, channel, instrument etc.
7  * 
8  * @author  Andersson, Andreen, Lanneskog, Pehrson
9  * @version 1
10  */
11  
12 public class MooTrackTitle extends JPanel{
13
14         private MooInstrumentList instruments;
15         private JComboBox channel;
16         private JCheckBox mute;
17         private JCheckBox solo;
18         /** 
19          * Creates the title bar.
20          */
21         public MooTrackTitle () {
22                 setLayout(new GridLayout(1,3));
23                 instruments = new MooInstrumentList();
24                 add(instruments);
25
26                 channel = new JComboBox();
27                 for (int i = 0; i < 16; i++)
28                         channel.addItem(new Integer(i));
29                 channel.addItemListener(new ItemListener(){
30                                 public void itemStateChanged(ItemEvent e){
31                                         if (e.getStateChange() != e.SELECTED)
32                                                 return; //return if this even isn't the selection event.
33
34                                         Object ob = e.getItem();
35                                         if (ob instanceof Integer){
36                                                 //set channel
37                                         }
38                                 }});
39                 add(channel);
40                 
41                 mute = new JCheckBox("Mute");
42                 mute.addActionListener(new ActionListener(){
43                                 public void actionPerformed(ActionEvent event){
44                                         //setMute
45                                         solo.setSelected(false);
46                                 }});
47                 add(mute);
48
49                 solo = new JCheckBox("Solo");
50                 solo.addActionListener(new ActionListener(){
51                                 public void actionPerformed(ActionEvent event){
52                                         //setSolo
53                                         mute.setSelected(false);
54                                 }});
55                 add(solo);
56         }
57 }