import javax.swing.*;
-import java.awt.event.*;
import java.awt.*;
+import java.awt.event.*;
import javax.sound.midi.*;
/**
private JLabel measure, beats, ticks, measurevalue, beatsvalue, ticksvalue;
private ImageIcon playIcon, pauseIcon;
private MooMouseAdapter mouseAdapter;
+ public static final Color bgColor = new Color(192, 224, 255);
/**
* Creates the toolbar.
*/
- public MooToolbar() {
+ public MooToolbar() {
+ setFloatable(false);
mouseAdapter = new MooMouseAdapter();
+ // Creates playback buttons
rewind = createButton("images/rewind.gif", "Rewind");
add(rewind);
-
playpause = createButton("images/play.gif", "Play");
add(playpause);
playIcon = new ImageIcon("images/play.gif");
pauseIcon = new ImageIcon("images/pause.gif");
-
stop = createButton("images/stop.gif", "Stop");
add(stop);
-
fastforward = createButton("images/forward.gif", "Fast forward");
add(fastforward);
+ // Creates progress indicator
JPanel progIndPanel = new JPanel();
- progIndPanel.setBorder(BorderFactory.createLineBorder(Color.black));
- progIndPanel.setMaximumSize(new Dimension(100,22));
- progIndPanel.setLayout(new GridLayout(2,3));
+ progIndPanel.setMaximumSize(new Dimension(120,27));
+ progIndPanel.setLayout(new GridLayout(2,4));
measure = createLabel("Mrs",10);
beats = createLabel("Beat",10);
ticks = createLabel("Tick",10);
- measurevalue = createLabel("1", 12);
- beatsvalue = createLabel("1",12);
- ticksvalue = createLabel("1",12);
+ measurevalue = createLabel("1", 16);
+ beatsvalue = createLabel("1",16);
+ ticksvalue = createLabel("1",16);
+
+ JPanel spacenorth = new JPanel();
+ spacenorth.setBackground(bgColor);
+ progIndPanel.add(spacenorth);
+
progIndPanel.add(measure);
progIndPanel.add(beats);
progIndPanel.add(ticks);
+
+ JPanel spacesouth = new JPanel();
+ spacesouth.setBackground(bgColor);
+ progIndPanel.add(spacesouth);
+
progIndPanel.add(measurevalue);
progIndPanel.add(beatsvalue);
progIndPanel.add(ticksvalue);
*/
private JLabel createLabel(String title, int fontSize){
JLabel value = new JLabel(title,JLabel.CENTER);
- value.setFont(new Font("Times New Roman", Font.BOLD, fontSize));
+ value.setFont(new Font("Times New Roman", Font.PLAIN, fontSize));
+ value.setBorder(BorderFactory.createLineBorder(Color.black));
return value;
}
public void mouseReleased(MouseEvent e) {}
}
-}
\ No newline at end of file
+}