]> ruin.nu Git - moosique.git/blobdiff - MooGUI.java
försöker och försöker
[moosique.git] / MooGUI.java
index 0c1720289b53cb9cdf32dbff6956e284126255ee..3fff59d4e5bc1c766faab2a6f7bc6c239c22558c 100644 (file)
@@ -3,7 +3,7 @@ import javax.swing.*;
 import java.awt.*;
 import java.awt.event.*;
 
-/*
+/**
  * Moosique's graphical user interface.
  * 
  * @author  Mikael Andreen
@@ -11,26 +11,47 @@ import java.awt.event.*;
  
 public class MooGUI extends JFrame implements WindowListener {
 
-       Sequence seq;
+       private Sequence seq;
+       private JLabel statusBar;
+       // private MooView view;
        
-       /* 
+       /** 
         * Creates the GUI.
         */
        public MooGUI(Sequence seq) {
                super("Moosique");
-               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);
+               
+               // 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!", Label.CENTER);
+
+               //MooInstrumentList m = new MooInstrumentList();
+               //getContentPane().add(m, BorderLayout.CENTER);
+               //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
         */
@@ -38,11 +59,19 @@ public class MooGUI extends JFrame implements WindowListener {
                seq = sequence;
        }
 
-       public void windowOpened(WindowEvent e) {}
-       public void windowClosing(WindowEvent e) {}
-       public void windowClosed(WindowEvent e) {Moosique.quit();}
+       /** 
+        * Shows the given message in the status bar.
+        * @param text  the message to show
+        */
+       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) {}
-}
\ No newline at end of file
+}