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