+ // Brings on the colors!
+ setBackground(pane);
+ setBackground(menu);
+ setBackground(toolbar);
+ setBackground(view);
+ statusBar.setBackground(bgColor);
+ view.setBackground(bgColor);
+
+ // 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);
+
+ InputMap im = getRootPane().getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
+ KeyStroke playKey = KeyStroke.getKeyStroke(KeyEvent.VK_SPACE, 0);
+ im.put(playKey, "Play");
+
+ // Configures window.
+ addWindowListener(new MooGUICloser());
+ pack();
+ setIconImage(Toolkit.getDefaultToolkit().getImage("images/moose.gif"));
+ Dimension bounds = Toolkit.getDefaultToolkit().getScreenSize();
+ setSize(bounds.width,bounds.height - 40);
+ setLocation(0, 0);
+ // setResizable(false);
+ setBackground(Color.white);
+ setVisible(true);
+ show();
+ }
+
+ private void setBackground(Container c) {
+ c.setBackground(bgColor);
+ Component[] comps = c.getComponents();
+ for (int i = 0; i < comps.length; i++) {
+ comps[i].setBackground(bgColor);
+ }
+ }
+
+ /**
+ * Changes the sequence of the GUI.
+ * @param sequence the MIDI sequence to visualize
+ */
+ public void setSequence(Sequence sequence) {
+ seq = sequence;
+ view.setTracks(seq.getTracks());
+ toolbar.resetProgInd();