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 getContentPane().add(new MooTrackView(), BorderLayout.CENTER);
33 addWindowListener(this);
36 // view = new MooView();
39 statusBar = new JLabel("Welcome to Moosique!", JLabel.CENTER);
40 getContentPane().add(statusBar, BorderLayout.SOUTH);
43 Dimension bounds = new Dimension(400,300);
44 setSize(bounds.width,bounds.height);
45 setLocation((Toolkit.getDefaultToolkit().getScreenSize().width / 2) - (bounds.width / 2), (Toolkit.getDefaultToolkit().getScreenSize().height / 2) - (bounds.height / 2));
46 // setResizable(false);
47 // setBackground(Color.white);
53 * Changes the sequence of the GUI.
54 * @param sequence the MIDI sequence to visualize
56 public void setSequence(Sequence sequence) {
61 * Shows the given message in the status bar.
62 * @param text the message to show
64 public void setStatus(String text) {
65 statusBar.setText(text);
68 public void windowOpened(WindowEvent e) {}
69 public void windowClosing(WindowEvent e) {Moosique.quit();}
70 public void windowClosed(WindowEvent e) {}
71 public void windowIconified(WindowEvent e) {}
72 public void windowDeiconified(WindowEvent e) {}
73 public void windowActivated(WindowEvent e) {}
74 public void windowDeactivated(WindowEvent e) {}