]> ruin.nu Git - moosique.git/blob - MooGUI.java
lagt till en toolbar och tillhörande gif bilder i mappen images
[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                 setJMenuBar(new MooMenu());
22                 getContentPane().add(new MooToolbar(), BorderLayout.NORTH);
23                 addWindowListener(this);
24                 MooInstrumentList m = new MooInstrumentList();
25                 getContentPane().add(m, BorderLayout.CENTER);
26                 m.addKeyListener(new MooKeyboard());
27                 pack();
28                 //Dimension bounds = new Dimension(300,70);
29                 
30 //              setSize(bounds.width,bounds.height);
31                 //setLocation((Toolkit.getDefaultToolkit().getScreenSize().width / 2) - (bounds.width / 2), (Toolkit.getDefaultToolkit().getScreenSize().height / 2) - (bounds.height / 2));
32 //              setResizable(false);
33                 //setBackground(Color.white);
34                 setVisible(true);
35         }
36         
37         /** 
38          * Changes the sequence of the GUI.
39          * @param sequence      the MIDI sequence to visualize
40          */
41         public void setSequence(Sequence sequence) {
42                 seq = sequence;
43         }
44
45         public void windowOpened(WindowEvent e) {}
46         public void windowClosing(WindowEvent e) {Moosique.quit();}
47         public void windowClosed(WindowEvent e) {}
48         public void windowIconified(WindowEvent e) {}
49         public void windowDeiconified(WindowEvent e) {}
50         public void windowActivated(WindowEvent e) {}
51         public void windowDeactivated(WindowEvent e) {}
52 }