- measurevalue = createProjIndLabel("1", 12);
- panel.add(measurevalue);
-
- beatsvalue = createProjIndLabel("1",12);
- panel.add(beatsvalue);
-
- ticksvalue = createProjIndLabel("1", 12);
- panel.add(ticksvalue);
-
- playimage = Toolkit.getDefaultToolkit().getImage("images/play.gif");
- pauseimage = Toolkit.getDefaultToolkit().getImage("images/pause.gif");
-
- }
-
- /**
- * creates a JButton for the toolbar
- * @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));
- button.setToolTipText(tooltip);
- button.addActionListener(this);
- return button;
- }
-
- /**
- * creates JLabels for the progressindikator, attached to the toolbar
- * @param title the titel displayed on the label
- * @param fontsize the fontzise of the text displayed on the label
- * @param fontstyle the fontstyle of the text displayed on the label
- * @return titelvalue the label that is a part of the progressindikator
- */
- private JLabel createProjIndLabel(String title, int fontsize){
- JLabel titelvalue = new JLabel(title,JLabel.CENTER);
- titelvalue.setFont(new Font("Times New Roman",
- Font.BOLD ,fontsize));
- titelvalue.setBorder(BorderFactory.createLineBorder(Color.black));
- return titelvalue;
- }
- // int pos = Moosique.getSequencer().getTickPosition();
- // int measures = pos / (4 * Moosique.getSequence.get)
- // int beats = (pos - measures * 4 * 96) / 96;
- // int ticks = (pos - measures*4*96 - beats*96);
-
-
- public void actionPerformed(ActionEvent e) {
+ /**
+ * 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));
+ button.setToolTipText(tooltip);
+ button.addMouseListener(mouseAdapter);
+ 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 value = new JLabel(title,JLabel.CENTER);
+ value.setFont(new Font("Times New Roman", Font.BOLD, fontSize));
+ return value;
+ }
+
+ // int pos = Moosique.getSequencer().getTickPosition();
+ // int measures = pos / (4 * Moosique.getSequence.get)
+ // int beats = (pos - measures * 4 * 96) / 96;
+ // int ticks = (pos - measures*4*96 - beats*96);