]> ruin.nu Git - moosique.git/blobdiff - MooGUI.java
Changed beginnings of comments from /* to /** which is necessary for the comments...
[moosique.git] / MooGUI.java
index 0095f42fc6906e60be3d06332bef79695718e833..cc145ab4a57f4e3f2603094aa8300c7152a6f51e 100644 (file)
@@ -1,29 +1,49 @@
 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 {
 
        Sequence seq;
        
-       /* 
+       /** 
         * Creates the GUI.
         */
-       public MooGUI () {
-
+       public MooGUI(Sequence seq) {
+               super("Moosique");
+               addWindowListener(this);
+               MooInstrumentList m = new MooInstrumentList();
+               getContentPane().add(m);
+               m.addKeyListener(new MooKeyboard());
+               pack();
+               Dimension bounds = new Dimension(300,70);
+//             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);
        }
        
-       /* 
+       /** 
         * Changes the sequence of the GUI.
         * @param sequence      the MIDI sequence to visualize
         */
        public void setSequence(Sequence sequence) {
                seq = sequence;
        }
-}
+
+       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) {}
+}
\ No newline at end of file