- //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);
+ statusBar = new JLabel("Welcome to Moosique!", JLabel.CENTER);
+ statusBar.setFont(FONT);
+ pane.add(statusBar, BorderLayout.SOUTH);
+
+ // Brings on the colors!
+ setBackground(pane);
+ setBackground(menu);
+ setBackground(toolbar);
+ setBackground(view);
+
+ // Creates timer.
+ timer = new java.util.Timer();
+
+ // Sets up global key listener.
+ ActionMap am = getRootPane().getActionMap();
+
+ Action playAction = new AbstractAction() {
+ public void actionPerformed(ActionEvent ae) {
+ if (!Moosique.getSequencer().isRunning()) {
+ Moosique.play();
+ } else {
+ Moosique.stop();
+ }
+ }};
+ am.put("Play", playAction);
+ am.put("Change octave up", createOctaveAction(true));
+ am.put("Change octave down", createOctaveAction(false));
+
+ InputMap im = getRootPane().getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
+ KeyStroke playKey = KeyStroke.getKeyStroke(KeyEvent.VK_SPACE, 0);
+ KeyStroke octaveUpKey = KeyStroke.getKeyStroke(KeyEvent.VK_F9, 0);
+ KeyStroke octaveDownKey = KeyStroke.getKeyStroke(KeyEvent.VK_F10, 0);
+ im.put(playKey, "Play");
+ im.put(octaveUpKey, "Change octave up");
+ im.put(octaveDownKey, "Change octave down");
+ advanceStatus();
+
+ // Configures window.
+ addWindowListener(new MooGUICloser());