]> ruin.nu Git - moosique.git/blob - MooGUI.java
some changes..
[moosique.git] / MooGUI.java
1 import javax.sound.midi.*;
2 import javax.swing.*;
3 import java.awt.*;
4 import java.awt.event.*;
5
6 /**
7  * Moosique's graphical user interface.
8  * 
9  * @author  Mikael Andreen
10  */
11  
12 public class MooGUI extends JFrame implements WindowListener {
13
14         private Sequence seq;
15         private JLabel statusBar;
16         // private MooView view;
17         
18         /** 
19          * Creates the GUI.
20          */
21         public MooGUI(Sequence seq) {
22                 super("Moosique");
23                 
24                 // Adds menu bar.
25                 setJMenuBar(new MooMenu());
26
27                 // Adds toolbar.
28                 getContentPane().add(new MooToolbar(), BorderLayout.NORTH);
29                 addWindowListener(this);
30                 
31                 // Adds one track.
32                 getContentPane().add(new MooTrackView(), BorderLayout.CENTER);
33                 addWindowListener(this);
34                 
35                 // Adds main view.
36                 // view = new MooView();
37
38                 // Adds status bar.
39                 //statusBar = new JLabel("Welcome to Moosique!", Label.CENTER);
40
41                 //MooInstrumentList m = new MooInstrumentList();
42                 //getContentPane().add(m, BorderLayout.CENTER);
43                 //m.addKeyListener(new MooKeyboard());
44                 //pack();
45
46                 // Dimension bounds = new Dimension(300,70);
47                 // setSize(bounds.width,bounds.height);
48                 // setLocation((Toolkit.getDefaultToolkit().getScreenSize().width / 2) - (bounds.width / 2), (Toolkit.getDefaultToolkit().getScreenSize().height / 2) - (bounds.height / 2));
49                 // setResizable(false);
50                 // setBackground(Color.white);
51                 pack();
52                 setVisible(true);
53         }
54         
55         /** 
56          * Changes the sequence of the GUI.
57          * @param sequence      the MIDI sequence to visualize
58          */
59         public void setSequence(Sequence sequence) {
60                 seq = sequence;
61         }
62
63         /** 
64          * Shows the given message in the status bar.
65          * @param text  the message to show
66          */
67         public void setStatus(String text) {
68                 statusBar.setText(text);
69         }
70
71         public void windowOpened(WindowEvent e) {}
72         public void windowClosing(WindowEvent e) {Moosique.quit();}
73         public void windowClosed(WindowEvent e) {}
74         public void windowIconified(WindowEvent e) {}
75         public void windowDeiconified(WindowEvent e) {}
76         public void windowActivated(WindowEvent e) {}
77         public void windowDeactivated(WindowEvent e) {}
78 }