]> ruin.nu Git - moosique.git/blob - MooGUI.java
Changed beginnings of comments from /* to /** which is necessary for the comments...
[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         Sequence seq;
15         
16         /** 
17          * Creates the GUI.
18          */
19         public MooGUI(Sequence seq) {
20                 super("Moosique");
21                 addWindowListener(this);
22                 MooInstrumentList m = new MooInstrumentList();
23                 getContentPane().add(m);
24                 m.addKeyListener(new MooKeyboard());
25                 pack();
26                 Dimension bounds = new Dimension(300,70);
27 //              setSize(bounds.width,bounds.height);
28                 setLocation((Toolkit.getDefaultToolkit().getScreenSize().width / 2) - (bounds.width / 2), (Toolkit.getDefaultToolkit().getScreenSize().height / 2) - (bounds.height / 2));
29 //              setResizable(false);
30                 setBackground(Color.white);
31                 setVisible(true);
32         }
33         
34         /** 
35          * Changes the sequence of the GUI.
36          * @param sequence      the MIDI sequence to visualize
37          */
38         public void setSequence(Sequence sequence) {
39                 seq = sequence;
40         }
41
42         public void windowOpened(WindowEvent e) {}
43         public void windowClosing(WindowEvent e) {Moosique.quit();}
44         public void windowClosed(WindowEvent e) {}
45         public void windowIconified(WindowEvent e) {}
46         public void windowDeiconified(WindowEvent e) {}
47         public void windowActivated(WindowEvent e) {}
48         public void windowDeactivated(WindowEvent e) {}
49 }