1 import javax.sound.midi.*;
4 import java.awt.event.*;
7 * Moosique's graphical user interface.
9 * @author Mikael Andreen
12 public class MooGUI extends JFrame implements WindowListener {
15 private JLabel statusBar;
16 // private MooView view;
21 public MooGUI(Sequence seq) {
25 setJMenuBar(new MooMenu());
28 getContentPane().add(new MooToolbar(), BorderLayout.NORTH);
29 addWindowListener(this);
32 // view = new MooView();
35 statusBar = new JLabel("Welcome to Moosique!", Label.CENTER);
37 MooInstrumentList m = new MooInstrumentList();
38 getContentPane().add(m, BorderLayout.CENTER);
39 m.addKeyListener(new MooKeyboard());
42 // Dimension bounds = new Dimension(300,70);
43 // setSize(bounds.width,bounds.height);
44 // setLocation((Toolkit.getDefaultToolkit().getScreenSize().width / 2) - (bounds.width / 2), (Toolkit.getDefaultToolkit().getScreenSize().height / 2) - (bounds.height / 2));
45 // setResizable(false);
46 // setBackground(Color.white);
51 * Changes the sequence of the GUI.
52 * @param sequence the MIDI sequence to visualize
54 public void setSequence(Sequence sequence) {
59 * Shows the given message in the status bar.
60 * @param text the message to show
62 public void setStatus(String text) {
63 statusBar.setText(text);
66 public void windowOpened(WindowEvent e) {}
67 public void windowClosing(WindowEvent e) {Moosique.quit();}
68 public void windowClosed(WindowEvent e) {}
69 public void windowIconified(WindowEvent e) {}
70 public void windowDeiconified(WindowEvent e) {}
71 public void windowActivated(WindowEvent e) {}
72 public void windowDeactivated(WindowEvent e) {}