]> ruin.nu Git - moosique.git/blobdiff - MooGUI.java
no message
[moosique.git] / MooGUI.java
index dcb52da9469934f4a310840128f5a99f25fa0361..17a69c3b10035ee71cd3e0dcbd4f2d621a279794 100644 (file)
@@ -1,25 +1,75 @@
+import javax.sound.midi.*;
 import javax.swing.*;
+import java.awt.*;
+import java.awt.event.*;
 
-/*
+/**
  * Moosique's graphical user interface.
  * 
- * @author  Andersson, Andreen, Lanneskog, Pehrson
- * @version 1
+ * @author  Mikael Andreen
  */
  
-public class MooGUI {
+public class MooGUI extends JFrame implements WindowListener {
 
-       /* 
+       private Sequence seq;
+       private JLabel statusBar;
+       // private MooView view;
+       
+       /** 
         * Creates the GUI.
         */
-       public MooGUI () {
+       public MooGUI(Sequence seq) {
+               super("Moosique");
+               
+               // Adds menu bar.
+               setJMenuBar(new MooMenu());
+
+               // Adds toolbar.
+               getContentPane().add(new MooToolbar(), BorderLayout.NORTH);
+               addWindowListener(this);
+               
+               // Adds one track.
+               getContentPane().add(new MooTrackView(), BorderLayout.CENTER);
+               addWindowListener(this);
+               
+               // Adds main view.
+               // view = new MooView();
 
+               // Adds status bar.
+               statusBar = new JLabel("Welcome to Moosique!", JLabel.CENTER);
+               getContentPane().add(statusBar, BorderLayout.SOUTH);
+
+               pack();
+               Dimension bounds = new Dimension(400,300);
+               setSize(bounds.width,bounds.height);
+               setLocation((Toolkit.getDefaultToolkit().getScreenSize().width / 2) - (bounds.width / 2), (Toolkit.getDefaultToolkit().getScreenSize().height / 2) - (bounds.height / 2));
+               // setResizable(false);
+               // setBackground(Color.white);
+               setVisible(true);
+               show();
+       }
+       
+       /** 
+        * Changes the sequence of the GUI.
+        * @param sequence      the MIDI sequence to visualize
+        */
+       public void setSequence(Sequence sequence) {
+               seq = sequence;
        }
 
-       /* 
-        * 
+       /** 
+        * Shows the given message in the status bar.
+        * @param text  the message to show
         */
-       public void () {
-       
+       public void setStatus(String text) {
+               statusBar.setText(text);
        }
+
+       public void windowOpened(WindowEvent e) {}
+       public void windowClosing(WindowEvent e) {Moosique.quit();}
+       public void windowClosed(WindowEvent e) {}
+       public void windowIconified(WindowEvent e) {}
+       public void windowDeiconified(WindowEvent e) {}
+       public void windowActivated(WindowEvent e) {}
+       public void windowDeactivated(WindowEvent e) {}
 }