]> ruin.nu Git - moosique.git/blob - MooToolbar.java
varför vill det inte bli radbrytning???
[moosique.git] / MooToolbar.java
1 import javax.swing.*;
2 import java.awt.event.*;
3 import java.awt.*;
4 import java.awt.Color;
5
6 public class MooToolbar extends JToolBar implements ActionListener      {
7
8         public MooToolbar()     {
9         
10                 rewind = createButton("images/rewind.gif", "rewind");
11                 add(rewind);
12
13                 playpause = createButton("images/play.gif", "play");
14                 add(playpause);
15                 
16                 stop = createButton("images/stop.gif", "stop");
17                 add(stop);
18                 
19                 fastforward = createButton("images/forward.gif", "fast forward");
20                 add(fastforward);
21                 
22                 meas = createProjIndButton("Mrs: \n" + measures);
23                 add(meas);
24                 
25                 beat = createProjIndButton("Beat: \n" + beats);
26                 add(beat);
27                 
28                 tick = createProjIndButton("Tick: \n" + ticks);
29                 add(tick);
30
31                 }
32                 
33                 private JButton createButton(String imageLocation, String toolTip) {
34                         JButton button = new JButton (new ImageIcon(imageLocation));
35                         button.setToolTipText(toolTip);
36                         button.addActionListener(this);
37                         return button;
38                 }
39                 
40                 private JButton createProjIndButton(String title){
41                         JButton abutton = new JButton(title);
42                         abutton.setFont(new Font("Times New Roman", Font.PLAIN ,8));
43                         abutton.setMinimumSize(new Dimension(30,22));
44                         abutton.setVerticalTextPosition(AbstractButton.CENTER);
45                         return abutton;
46                 }
47                 
48                         
49                 public void actionPerformed(ActionEvent e) {}
50                                         
51                         /*if () {
52                         
53                         } else if () {
54                                 
55                         
56                         } else if () {
57                         
58                         } else if () {
59                         
60                         }*/
61                 private JButton rewind;
62                 private JButton playpause;
63                 private JButton stop;
64                 private JButton fastforward;
65                 private JButton meas;
66                 private JButton beat;
67                 private JButton tick;
68                 private int measures = 1;
69                 private int beats = 1;
70                 private int ticks = 1;
71
72 }