]> ruin.nu Git - moosique.git/blob - MooTrackTitle.java
some changes..
[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(2,2));
23                 instruments = new MooInstrumentList();
24                 add(instruments);
25
26                 channel = new JComboBox();
27                 for (int i = 1; i <= 16; i++)
28                         channel.addItem(new Integer(i));
29                 channel.addItemListener(new ItemListener(){
30                                 public void itemStateChanged(ItemEvent e){
31                                         Object ob = channel.getSelectedItem();
32                                         if (ob instanceof Integer){
33                                                 //set channel
34                                         }
35                                 }});
36                 add(channel);
37                 
38                 mute = new JCheckBox("Mute");
39                 mute.addActionListener(new ActionListener(){
40                                 public void actionPerformed(ActionEvent event){
41                                         //setMute
42                                         solo.setSelected(false);
43                                 }});
44                 add(mute);
45
46                 solo = new JCheckBox("Solo");
47                 solo.addActionListener(new ActionListener(){
48                                 public void actionPerformed(ActionEvent event){
49                                         //setSolo
50                                         mute.setSelected(false);
51                                 }});
52                 add(solo);
53         }
54 }