measure = createLabel("Msr", 10);
beats = createLabel("Beat", 10);
ticks = createLabel("Tick", 10);
- measureValue = createLabel("1", 16);
- measureValue.setBorder(BorderFactory.createLineBorder(Color.black));
- beatsValue = createLabel("1", 16);
- beatsValue.setBorder(BorderFactory.createLineBorder(Color.black));
- ticksValue = createLabel("1", 16);
- ticksValue.setBorder(BorderFactory.createLineBorder(Color.black));
+ measureValue = formatProgInd(createLabel("1", 16));
+ beatsValue = formatProgInd(createLabel("1", 16));
+ ticksValue = formatProgInd(createLabel("1", 16));
JPanel spacenorth = new JPanel();
spacenorth.setBackground(bgColor);
JPanel spacesouth = new JPanel();
ticksValue.setText(Long.toString(ticks));
}
- /**
+ /*
* Creates a button with the specified image and tooltip.
- * @param imagelocation the imagelacation of the the image displayed in the button
- * @param tooltip the tooltip associated with this button
- * @return button the button to be attached to the toolbar
*/
private JButton createButton(String imagelocation, String tooltip) {
JButton button = new JButton (new ImageIcon(imagelocation));
return button;
}
- /**
+ /*
* Creates labels with the specified text and font size.
- * @param title the titel displayed on the label
- * @param fontsize the fontzise of the text displayed on the label
*/
private JLabel createLabel(String title, int fontSize){
JLabel label = new JLabel(title,JLabel.CENTER);
return label;
}
+ /*
+ * Formats the given label for the progress indicator.
+ */
+ private JLabel formatProgInd(JLabel label){
+ label.setBorder(BorderFactory.createLineBorder(Color.black));
+ label.setBackground(Color.white);
+ return label;
+ }
+
class MooMouseAdapter extends MouseAdapter {
public void mouseClicked(MouseEvent e) {
if (((JButton)e.getSource()).getToolTipText() == "Play") {